Random Terrain, on Mon Oct 13, 2008 10:16 PM, said:
Speaking of bankswitching, did I read this correctly:
http://www.atariage....p;#entry1456132
Quote
Additionally, batari Basic needs to store most of the graphics data in the last bank, so it can access the graphics data while executing its display kernel. Even if you put your "player0:" or "player1:" graphics statements in one of the other banks, the actual graphics data will be stored in the last bank anyway.
Question Set #3
So we have less than 4k for graphics, no matter what? And if
most graphics data is stored there, what kind of graphics data is
not stuffed in there?
Graphics that are loaded from RAM can be defined in any bank, because RAM is accessible from any bank. For Superchip and non-Superchip bankswitching of the standard kernel, the playfield is loaded from RAM, so the playfield statements can be in any bank.
As far as I know, graphics that are loaded from ROM must be stored in the same bank as the kernel, because the kernel needs to be able to load the graphics without having to bankswitch while the screen is being drawn. That means the player graphics must be stored in the last bank, where the kernel is. You can still use player0 and player1 statements in the other banks, because the pointers to the player graphics are stored in RAM-- but the actual data will be stored in the last bank.
One way around this is to relocate the player graphics to RAM. If you're using two players, and each one is 8 lines tall, that means you'll need 16 bytes of RAM for the players. In most cases, that probably means you'll need to use the Superchip option, which puts the playfield in Superchip RAM and gives you more zero-page RAM for other things, such as the players. But relocating the player graphics to RAM means you can't use the player0 and player1 statements, because they store the player data in ROM, so you'll need to store the player shapes in data tables of your own. Plus, you'll need to copy the shape data from ROM to RAM, which will use up some of your time cycles. Still, you won't need to do that during each loop, just whenever you want to change the player shapes.
Michael