BANK 5 - the screen memory
Posted: Tue Jan 10, 2023 5:15 pm
I am hacking my way through the jungle of the Next Issue 1 manual, and the densest jungle yet is chapter 16, dealing with colours.
Something that I always think of when tackling new computers is whether or not I can POKE directly to the screen memory. It's easy on the Spectrum and ZX81, almost as easy on the QL, wasn't too hard on the Commodore machines, trickier on the SAM Coupé (especially if I'm trying to do it via Z80 .asm), I think I've cracked it for the Amstrad CPC as well, and now... it's easy on the Next, because it's all there in BANK 5.
So far, so good. I already know about two blocks of 6K (DISP_FILE1 and DISP_FILE2), and two blocks of attributes (COLOUR_FILE1 and COLOUR_FILE2, though I've yet to see an example of how the second of these is used).
There must have been a good reason that each DISP_FILE starts at the beginning or the midpoint of the memory bank. But it does leave what looks to be a gap of 1280 bytes between the end of COLOUR_FILE1 and the start of DISP_FILE2 (i.e. 6192-8191) and a second 1280-byte gap at the end of COLOUR_FILE2 (i.e. 15104-16383).
Is this potentially useful? I've reached the PALETTE pages, and these gaps look like the perfect place to store custom palettes. LAYER 2 won't touch them as that uses BANKs 9-11. Am I on the right track, or am I going to get a nasty surprise in future chapters?
(I might try to fill a LAYER 1,3 screen with shash and then see if there's anything in the gaps.)
I realise I may need an even bigger machete in the next couple of chapters.
Something that I always think of when tackling new computers is whether or not I can POKE directly to the screen memory. It's easy on the Spectrum and ZX81, almost as easy on the QL, wasn't too hard on the Commodore machines, trickier on the SAM Coupé (especially if I'm trying to do it via Z80 .asm), I think I've cracked it for the Amstrad CPC as well, and now... it's easy on the Next, because it's all there in BANK 5.
So far, so good. I already know about two blocks of 6K (DISP_FILE1 and DISP_FILE2), and two blocks of attributes (COLOUR_FILE1 and COLOUR_FILE2, though I've yet to see an example of how the second of these is used).
There must have been a good reason that each DISP_FILE starts at the beginning or the midpoint of the memory bank. But it does leave what looks to be a gap of 1280 bytes between the end of COLOUR_FILE1 and the start of DISP_FILE2 (i.e. 6192-8191) and a second 1280-byte gap at the end of COLOUR_FILE2 (i.e. 15104-16383).
Is this potentially useful? I've reached the PALETTE pages, and these gaps look like the perfect place to store custom palettes. LAYER 2 won't touch them as that uses BANKs 9-11. Am I on the right track, or am I going to get a nasty surprise in future chapters?
(I might try to fill a LAYER 1,3 screen with shash and then see if there's anything in the gaps.)
I realise I may need an even bigger machete in the next couple of chapters.