2 minutes ago, rje said:
I’ve been feeling that lately since writing C for the X16. Memory goes fast.
There are two solutions though:
1. More RAM; that is, the RAM banks, which are fun to use!
2. Fast I/O
if the SD card on the X16 is fast enough, then you don’t need RAM banks.... in fact even with RAM banks, if I/O is slow, loading up the RAM banks is painful in at least some circumstances.
It's not loading the RAM bank where you get the win, it's switching to the RAM bank to use it where otherwise you would have to
reload the RAM bank where you get the win.
The SD card is 12.5MHz/bit, about 1.6MHz/byte plus overhead (not every SPI packet byte is a data byte, the bytes have to be put somewhere, etc.). The difference between the C64 1541 disk drive is night and day. Load an 8K RAM segment faster than you can blink.
So the "get Bank25" process is saving the current X8 RAM Bank2 as "Bank13" and then loading "Bank25" into it. Each happening ... well, basically faster than you can blink.
And you do it, and have a "swap bank" routine, and use it ... and compared to the C64, man, you are cooking.
But then ... LDA $0000 : PHA : LDA lrublock : STA $0000 : ... : PLA : STA $0000 -- 20 clocks at 8MHz, 400kHz/8K bytes.
And the CX16 version of that leaves the X8 version in the dust.