For developers wanting to explore FCM (full-colour mode), it can be quite a daunting journey initially, so here’s some pointers along with an ‘experimentation’ walkthrough that will let you peek and poke your way to a better understanding of FCM
...
one table for when this GOTOX bit is cleared
the other table for when this GOTOX bit is set
...
Why is it called the GOTOX bit?
Another point of confusion is that you have this bit called “GOTOX”, and you’d be forgiven for thinking that is relates to some re-positioning of characters to a new x-position.
Perhaps there was a time (earlier in the project) when the bit's sole purpose was to alter the purpose of screen-byte-pair to specify a new x-position, and in those days it made sense to call the bit
GOTOX
But now, setting this bit does way more than that, it modifies the purpose of other bit-fields do to other things (y-offsets for chars, rowmask, foreground/background rendering, etc)
So given that it does more than just 'gotox', maybe it needs a new name too, I'm not sure what yet. TOGGLE_FIELDS? ALT_FIELDS?
Where is character data located?
...
I need to divide this by 64 bytes ($40) to get the char index
(since each pixel within the 8x8 character needs one byte in FCM mode)I.e., $4,0000 / $40 = $1000
So you need to set:
Screen RAM byte 0 to $00
Screen RAM byte 1 to $10
...
What’s all this about 16-bit character numbers?!
...
The docs for CHR16 say it enables "16-bit character numbers", when in reality, it enables “13-bit character numbers” (i.e., bits 0-12 defined in the two fields above)
Whether it's worth changing the name to CHR13 at this stage, I'd lean towards yes, it ought to change to reflect the reality and not mislead, but maybe others might feel the name is locked in now that it has gone to print 😄
Then again, the mega65-book didn't go to print yet, just the user-guide, so maybe there's hope.
So, how many unique characters/tiles do I really have?
The documentation describes it as “Support for up to 8192 unique characters”:
...
Theoretically, that is true. We learnt earlier that we can refer to “13-bit character numbers”, which means we have 2^13 unique characters = 8192.
But in reality this isn’t possible.
To get 8192 tiles, that'd mean you'd need the first 512KB of ram available purely to hold character data
(64 bytes_per_char x 8192 chars = 512KB)…but the MEGA65 is only fitted with 384KB of chip ram, so that gives us a max of 6144 tiles
(384KB / 64 = 6144)…and some of that ram is going to be needed for the program's code and data, maybe kernal/basic needs too, so would likely end up less than that remaining too
Ok, I can now see why some folks here discussed in the past how fcm was a bit of a luxury and why many of them were more inclined to ncm mode 🙂
How many unique tiles/characters do I need to fill the screen?
So in FCM-mode:
To fill a 320x200 screen with unique tiles, you'd need 1000 tiles, sounds do-able 🙂
To fill a 640x400 screen with unique tiles, you'd need 4000 tiles, a bit more challenging, probably would be an 'assembly-only' thing, consuming BANKS 2,3,4,5 with character data. (no chance in basic)
For NCM-mode, I think all those stats halve and you get more breathing room.
FCM Experimentation via the UART monitor
...