Quantcast
Channel: stardot.org.uk
Viewing all articles
Browse latest Browse all 3544

programming • Re: Hardware scroll + fixed status area

$
0
0
Nice :)

It can also be used to give hardware clipping on the sides of the screen at the cost of some wasted space!

For Frogger, it draws everything in multiple copies and changing that or "clipping" at the sides would be prohibitive, so it actually has 32 frames per vsync with 33 (iirc) interrupts to set the start of screen address.

The displayed with is set to 224 pixels to match the arcade (starting at 16) but every new character row, the start address is moved on by 256 pixels of memory (&200) meaning that you don't see memory just before each line or just after each line. This allows "sprites" to be drawn without clipping and still move smoothly off the edge of the screen. So there is no actual hardware scrolling!

The interrupts also allow two of the colours to be swapped every pair of frames meaning that although it is MODE 1, it can use all 8 colours or about 13 iirc with a NuLA (colours are chosen so that it doesn't need to know if there is a NuLA because it was written before NuLA detection had been worked out).

Scramble is another of my games that uses vertical rupture with 32 frames per vsync, but this time only has 16 (17?) interrupts which are timed so that each one occurns near the right edge of the screen and executes:

Code:

ldy char_row : ldx #12lda row_hi,y : stx &FE00 : sta &FE01 : inxlda row_lo,y : stx &FE00 : sta &FE01 : iny; CRTC latches that start of the next frame between here the start of the next sta &FE01lda row_lo,y : stx &FE00 : sta &FE01 : dexlda row_hi,y : stx &FE00 : sta &FE01 : inysty char_row
Meaning that both the address for the next frame (latched ~immediately) and those for the one after that (new next frame by the time the address is written) can be written in one go. This saves about 30 cycles * 16 saving about 4 scan lines or about .25ms which was not worth the extra time it took to tweak the timing :lol:

PS The code is from memory so it might contain minor errors!

Statistics: Posted by tricky — Fri Dec 20, 2024 11:32 am



Viewing all articles
Browse latest Browse all 3544

Latest Images

Trending Articles



Latest Images