fb39ca4 Posted June 23, 2014 Share Posted June 23, 2014 For the program I am writing, I need as much ROM space as possible, and a 512KB Tigervision 3F seems to be my best option. Is there some sort of option I need to set in DASM? Are there any 3F samples so I can see how it's done? None of the tutorials I have seen touch on this topic. Quote Link to comment Share on other sites More sharing options...
yllawwally Posted June 24, 2014 Share Posted June 24, 2014 I don't believe you need to use any special switches for 3f. I compiled the 3f demo from http://atariage.com/forums/topic/141764-bankswitching-demostemplates/ without a problem. I used dasm 3f.asm -f3 -o3f.bin . 1 Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted June 25, 2014 Share Posted June 25, 2014 If you're writing your program in assembly, there's no switches to set-- just make sure the ROM image will be the desired size based on the ORG and RORG addresses in your code, and access the necessary bank-switching hot spots for the type of bank-switching you want to use. On an actual cart, the bank-switching is determined by the cart itself-- i.e., the ROM chip(s), the way the address lines of the cart are wired, etc.-- rather than anything to do with the program per se. Stella and other emulators will either need to be told what type of bank-switching to use with the ROM, or else will try to determine the appropriate bank-switching based on things like the ROM size and the way certain memory locations (i.e., possible bank-switching hot spots) are used/initialized. If you're programming in batari Basic, you'll need to set the romsize for the desired bank-switching, so the batari Basic compiler will know how to set the ORG/RORG addresses in the assembly code that's compiled from your batari Basic code, as well as how to declare the hot spots. Quote Link to comment Share on other sites More sharing options...
fb39ca4 Posted June 25, 2014 Author Share Posted June 25, 2014 Ok, I've taken a look at the 3F bankswitching example, and this is my understanding of what I need to do for a 512K ROM: The stuff I want in the fixed page goes in the last 2K bank, including the initialization vectors. Then I put the rest of my data in the lower 255 blocks of 2K. To switch banks, I write the number of the bank I want to $3F. Please correct me if I am wrong. I will only have code in the fixed 2K bank, and the rest will be data that I don't plan on changing often, so I plan on generating the 255*2048 byte data section separately, and then concatenating it with a 2KB ROM I assemble. Also, is bank switching instantaneous once you write to $3F? Quote Link to comment Share on other sites More sharing options...
Rybags Posted June 25, 2014 Share Posted June 25, 2014 It'll practically always be the case of a fixed bank at the top of memory, otherwise you need to have system vectors for $FFFA-$FFFF in every bank that could appear there. Switching should be instant - generally you'd switch banks from code running outside the bank at the time but it can be a valid technique to switch from within the switchable area and have code that "falls through" ie- continues executing from just after the part that switched the bank, although usually a faster way of doing things can potentially be a pain to debug. Someone else might give more accurate info but AFAIK most/all bankswitching on 2600 carts will activate by a read access to the relevant area since the cart has no write line. Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted June 25, 2014 Share Posted June 25, 2014 it can be a valid technique to switch from within the switchable area and have code that "falls through" ie- continues executing from just after the part that switched the bank, With the "fall through" technique where you're switching banks from within a switchable area-- which is the only way to do it if you're using bank-switching schemes that switch all 4K of the cartridge area-- it's usually best to put the bank-switching code at the same spot in all of the banks. That isn't as fast as switching from anywhere in the area, since-- depending on how you do it-- you must JMP or JSR or RTS to get to the where the bank-switching code is, which can also involve some preparation to set things up, and there's also the need to JMP or JSR or RTS from the bank-switching code to wherever the target routine is. Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted June 25, 2014 Share Posted June 25, 2014 Ok, I've taken a look at the 3F bankswitching example, and this is my understanding of what I need to do for a 512K ROM: The stuff I want in the fixed page goes in the last 2K bank, including the initialization vectors. Then I put the rest of my data in the lower 255 blocks of 2K. To switch banks, I write the number of the bank I want to $3F. Please correct me if I am wrong. I will only have code in the fixed 2K bank, and the rest will be data that I don't plan on changing often, so I plan on generating the 255*2048 byte data section separately, and then concatenating it with a 2KB ROM I assemble. Also, is bank switching instantaneous once you write to $3F? You might want to consider using the 3E bank-switching method-- essentially the same as 3F, but writing to $3E lets you select one of up to 256 banks of 1K expansion RAM, so the maximum is 512K ROM and 256K RAM. Also, the bank-switching hotspots are limited to just $3E and $3F-- in the original 3F scheme, writing to any address from $00 to $3F triggered a switch. And I might be mistaken, but I think the original 3F scheme didn't actually go up to 512K ROM-- although I don't see why that would have been a limitation of the scheme itself, so it might have simply been that no cartridges using the 3F scheme ever went past a certain amount of ROM for monetary reasons. And of course if you do decide to use the 3E scheme, you don't need to use 512K of ROM and 256K of RAM. Quote Link to comment Share on other sites More sharing options...
fb39ca4 Posted June 26, 2014 Author Share Posted June 26, 2014 You might want to consider using the 3E bank-switching method-- essentially the same as 3F, but writing to $3E lets you select one of up to 256 banks of 1K expansion RAM, so the maximum is 512K ROM and 256K RAM. Also, the bank-switching hotspots are limited to just $3E and $3F-- in the original 3F scheme, writing to any address from $00 to $3F triggered a switch. And I might be mistaken, but I think the original 3F scheme didn't actually go up to 512K ROM-- although I don't see why that would have been a limitation of the scheme itself, so it might have simply been that no cartridges using the 3F scheme ever went past a certain amount of ROM for monetary reasons. And of course if you do decide to use the 3E scheme, you don't need to use 512K of ROM and 256K of RAM.Interesting. So 3E is a superset of 3F? I don't think I'll need it thouhgh it's good to have the option available. I've got everything I want stored in a 512K 3F ROM and Stella runs it fine. I think you're right about no actual 512K cartridges being produced though. When it's finished, my program will probably only ever be run on real hardware (if it ever does) through a flashcart. Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted June 26, 2014 Share Posted June 26, 2014 So 3E is a superset of 3F? I don't think "superset" is the right term-- I guess it would be if not for the change to the hotspots. It's my understanding that with the original version of 3F, accessing any location from $00 through $3F would switch banks-- so any 3F games that switched ROM banks by accessing $00 through $3E wouldn't be a subset of 3E. I don't know whether any 3F games actually accessed $00 through $3E to switch banks, at least deliberately-- but it could certainly happen by accident if the programmer tried to access a TIA register and forgot to use an address higher than $3F. Quote Link to comment Share on other sites More sharing options...
fb39ca4 Posted June 30, 2014 Author Share Posted June 30, 2014 (edited) I've figured out a use for the additional RAM in the 3E cartridges. The problem is, I need to use 256K of it, and Stella seems to be limiting me to only 32K of RAM. Writing 32-255 to $3F just switches me to the respective bank from 0-31. Is there a setting I have to change to enable all 256 banks of RAM? Edited June 30, 2014 by fb39ca4 Quote Link to comment Share on other sites More sharing options...
+Andrew Davie Posted July 2, 2014 Share Posted July 2, 2014 Armin Vogel and I designed the 3E scheme. It was the preliminaries for writing Boulder Dash. The scheme itself is limited to 480K (from memory) to make it compatible with running on the Cuttle Cart. The idea is that 32K of the CC was needed to implement the RAM, and hence the rest could be ROM. So there, in one go, is your reason for the 32K RAM limit and the 480K ROM limit. 480+32 = 512K, the CC capacity. However, in principle, the 3E could handle 256 ROM banks and 256 RAM banks. In short, it would be a trivial modification to Stella to allow bank support for > 32 RAM banks, but if it's not working now then it's probably specifically restricted to ensure compatibility with the strict definition of the bankswitch scheme capabilities. Cheers A Quote Link to comment Share on other sites More sharing options...
+Andrew Davie Posted July 2, 2014 Share Posted July 2, 2014 I checked the Stella code. The 3E support allows 256 ROM banks, but only 32 RAM banks. Strictly speaking, there should only be 224 ROM banks allowed, but some early ROMs used all 256 hence the out-of-spec support. Cheers A Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted July 2, 2014 Share Posted July 2, 2014 But if the limitations were related to using 3E bankswitching on a Cuttle Cart, does that mean an actual 3E cartridge could have 512K ROM and 256K RAM? If so, it would be nice for Stella to support that, in case anyone ever wants to develop a 3E game with 512K ROM and 256K RAM. Quote Link to comment Share on other sites More sharing options...
+Andrew Davie Posted July 3, 2014 Share Posted July 3, 2014 An actual cartridge could have 512K ROM and 256K RAM, but then it wouldn't, strictly speaking, be a 3E format cartridge. The bankswitch scheme was, to keep compatibility with Cuttle Cart capability, 480K max ROM and 32K max RAM. If you want to go the whole hog, then technically it's a different scheme. 3E(b) or something. Cheers A Quote Link to comment Share on other sites More sharing options...
fb39ca4 Posted July 4, 2014 Author Share Posted July 4, 2014 I'm figuring out how to do what I used to do with 256K of RAM with only 32K of RAM right now, but this means I am literally using every last bank of ROM. Is there any flash cart that can run a full 512K ROM + 32K RAM? Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted July 4, 2014 Share Posted July 4, 2014 I believe the Krokodile Cartridge can: http://www.arminvogl.de/KrokodileCartridge/ If you click on the link for the Krokodile Cartridge Manual and scroll down a bit to the list of cartridge bank-switching formats that are supported, you'll see "3E (up to 512K ROM and 32K RAM)." Quote Link to comment Share on other sites More sharing options...
SeaGtGruff Posted July 4, 2014 Share Posted July 4, 2014 (edited) If you want to go the whole hog, then technically it's a different scheme. 3E(b) or something. Okay. In that case, I vote for "3E Whee." Edit: Or "Whee 3E." Edited July 4, 2014 by SeaGtGruff 1 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.