Page 1 of 1

Screen Management

Posted: Sun Mar 03, 2024 6:06 am
by mysecretgarden
Hi everyone!
I have a question. I want to design the screen for a video game.
Starting from the decimal address 7680 (initial part of the screen), and having 22 columns x 23 rows, I would have a total of 506 bytes to write.
Now if for example I used:
LDX [screenData]
STA $1E00,X
and I made a cycle, the value of X could not be higher than the fateful 255,
so how can I write the piece of data that I'm missing?

Is there a way to have just one cycle or do I have to break it in two?

Thanks

Davide

Re: Screen Management

Posted: Sun Mar 03, 2024 6:57 am
by srowe
mysecretgarden wrote: Sun Mar 03, 2024 6:06 am Starting from the decimal address 7680 (initial part of the screen), and having 22 columns x 23 rows, I would have a total of 506 bytes to write.
Now if for example I used:
LDX [screenData]
STA $1E00,X
and I made a cycle, the value of X could not be higher than the fateful 255,
so how can I write the piece of data that I'm missing?

Is there a way to have just one cycle or do I have to break it in two?
If the value is constant then just write to both pages in a single iteration of the loop

Code: Select all

LDX [screenData]
STA $1E00,X
STA $1F00,X
Otherwise you need to indirect using zero page and increment the page byte when the index wraps.

Re: Screen Management

Posted: Mon Mar 04, 2024 1:38 am
by Mike
mysecretgarden wrote:[...] the value of X could not be higher than the fateful 255, [...]
... yet people have managed to work with the 65xx being an 8-bit CPU all the time.

Please check out my VICMON primer thread for standard idioms to address into the screen.

If it's just the matter of initialising the screen contents from yet another buffer, use a two-fold unrolled loop for that (or four times unrolled if you include colour RAM).

Re: Screen Management

Posted: Fri Mar 08, 2024 12:23 pm
by Merytsetesh
Reading this is making my head hurt and spin at the same time. :lol: