Mord Posted July 16, 2007 Share Posted July 16, 2007 For the game I'm working slowly on, I'm writing it on the assumption the superchip is on the cartridge for the extra 128 bytes of ram. Is there anything special you need to do for the rom beyond ORGing the start at $F100 instead of the usual $F000? And if that's all that's needed for the rom, how do I make sure Stella is recognizing it as something that is suppose to have the superchip setup? Quote Link to comment Share on other sites More sharing options...
+batari Posted July 16, 2007 Share Posted July 16, 2007 For the game I'm working slowly on, I'm writing it on the assumption the superchip is on the cartridge for the extra 128 bytes of ram. Is there anything special you need to do for the rom beyond ORGing the start at $F100 instead of the usual $F000? And if that's all that's needed for the rom, how do I make sure Stella is recognizing it as something that is suppose to have the superchip setup? You need to fill $F000-$F0FF with $FF for it to be automatically detected. If you don't do this, it will still work in emulators but you'll need to specify the cartridge type manually. Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted July 16, 2007 Share Posted July 16, 2007 For the game I'm working slowly on, I'm writing it on the assumption the superchip is on the cartridge for the extra 128 bytes of ram. Is there anything special you need to do for the rom beyond ORGing the start at $F100 instead of the usual $F000? And if that's all that's needed for the rom, how do I make sure Stella is recognizing it as something that is suppose to have the superchip setup? Program each bank as if you're doing normal Atari 8K, 16K, or 32K bankswitching (F8, F6, or F4), but reserve the first 256 bytes of each bank for the Superchip-- that is, don't put any executable code or data there. If you fill those 256 bytes with $FF, then Stella and Z26 should be able to autodetect the format. Then, to access the Superchip, you write to the 128 bytes at $F000 through $F07F, and read from the 128 bytes at $F080 through $F0FF. For example: ; 8K Superchip, or F8SC bankswitching ; bank 1 ORG $E000 RORG $D000 ; reserve 256 bytes for Superchip (128 write, 128 read) repeat 256 HEX FF repend ORG $E100 RORG $D100 ; remainder of bank 1 is for your ROM ORG $EFF8 RORG $DFF8 ; bankswitching hotspots (2 bytes) repeat 2 HEX FF repend ORG $EFFA RORG $DFFA ; vectors WORD start WORD start WORD start ; bank 2 ORG $F000 RORG $F000 ; reserve 256 bytes for Superchip (128 write, 128 read) repeat 256 HEX FF repend ORG $F100 RORG $F100 ; remainder of bank 2 is for your ROM ORG $FFF8 RORG $FFF8 ; bankswitching hotspots (2 bytes) repeat 2 HEX FF repend ORG $FFFA RORG $FFFA ; vectors WORD start WORD start WORD start Obviously, this is just the most bare-bones skeleton. As with any bankswitching method, the first thing your "start" code should do is switch to the desired bank where your program begins. Keep in mind that although you're reserving 256 from each bank for the Superchip, the RAM bytes will always be present regardless of which bank you switch to. That is, the ROM will switch banks but the RAM will stay the same, if you see what I mean. Michael Quote Link to comment Share on other sites More sharing options...
Mord Posted July 16, 2007 Author Share Posted July 16, 2007 Program each bank as if you're doing normal Atari 8K, 16K, or 32K bankswitching (F8, F6, or F4), but reserve the first 256 bytes of each bank for the Superchip-- that is, don't put any executable code or data there. If you fill those 256 bytes with $FF, then Stella and Z26 should be able to autodetect the format. Then, to access the Superchip, you write to the 128 bytes at $F000 through $F07F, and read from the 128 bytes at $F080 through $F0FF. For example: Now done. ; 8K Superchip, or F8SC bankswitching ; bank 1 ORG $E000 RORG $D000 Now, given that I have my banks in separate .asm files and link them in dos after compiling them, is it necessary to be ORG/RORGing to these ranges instead of just using $F000 for each file? Obviously, this is just the most bare-bones skeleton. As with any bankswitching method, the first thing your "start" code should do is switch to the desired bank where your program begins. That part I have done properly at least. Keep in mind that although you're reserving 256 from each bank for the Superchip, the RAM bytes will always be present regardless of which bank you switch to. That is, the ROM will switch banks but the RAM will stay the same, if you see what I mean. nodnod. Which enables me to easily define the variables in my constants.asm file once, or so it should. I know I have an oversight somewhere still in the code. It's displaying again, but it seems to be reading data from the zero page for some of the sprite data as I can see the joystick registers of the TIA being displayed on the screen - it changes as I try to move around. Likely a missing # somewhere. Plus various other data is being initialized randomly by Stella. Essentially when I start the emulator, load the game I'll see a particular result on the sprites and player. (Sometimes the player size will be tiny, other times there will be multiple copies, color etc would all be randomly set.) And if I shut off the game, but not close the emulator, then restart it the visual effects will be the same. But if I shut down Stella, turn it back on, reload the game, I'll get a different set of colors, copies, sprite data, etc. Which will remain constant until I shut Stella down again. I'll check over the code during the day, it's likely just a wrong declaration somewhere. I get those often enough. At any rate, thanks for the help! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.