Steril707 Posted December 13, 2023 Share Posted December 13, 2023 I think I am at a point in my game dev where 64kb RAM is getting a little bit too tight. But I have currently no idea how to treat a 128kb setup in the Atari series. Can anybody give me some advice on this? Or point to a tutorial? Thanks. Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted December 13, 2023 Share Posted December 13, 2023 I think it will depend on what you want to put in the extra 64K, if graphics, then it's fairly easy you just need to keep track of which screen/data is where and in which bank. If it's code, you have to be a bit more careful, you would need to switch to the appropriate bank, jmp/jsr to your code and on exit, switch the bank back,. You couldn't put any code that uses VBI's or DLI's there, also any VBI's/DLI's that run normally could not have any code in the $4000-$7FFF window unless you turn all interrupts off while the bank is switched.. 1 Quote Link to comment Share on other sites More sharing options...
Steril707 Posted December 13, 2023 Author Share Posted December 13, 2023 I basically want to keep a big amount of fonts there... I read this just now: 130xe was the first "official" method of banking memory. It too used PORTB, but with an added twist: ANTIC and the CPU could access different banks. I wonder how this is done? Quote Link to comment Share on other sites More sharing options...
phaeron Posted December 13, 2023 Share Posted December 13, 2023 You can find information on PORTB banking with separate ANTIC access in many places, but for an official source, check Appendix H of the Atari 130XE Owner's Manual. The main thing this will tell you that some other places might not is that you should keep bits 6 and 7 high by default. ANTIC and the CPU can only access different banks in that the extended memory window can be conditionally enabled for only one of them. There is only one set of bank selection bits and so it isn't possible to point the two at different extended memory banks simultaneously. IOW, if ANTIC is accessing extended bank 2 at $4000-7FFF, the CPU can only either also access that same bank or $4000-7FFF in main memory. 1 Quote Link to comment Share on other sites More sharing options...
Rybags Posted December 13, 2023 Share Posted December 13, 2023 Not sure about 130XE having the first "official" banking. Maybe in a "from the factory" sense. There were 64K expansions for the 800 that allowed the 4K at $C000 to select one of 4 banks. I think they even had 16K bankable at $4000 in similar fashion to the XE, well before the XE came out. And no doubt, there were probably expansions for the Apple II that had bankable Ram. 2 Quote Link to comment Share on other sites More sharing options...
Steril707 Posted December 13, 2023 Author Share Posted December 13, 2023 2 minutes ago, Rybags said: Not sure about 130XE having the first "official" banking. Maybe in a "from the factory" sense. There were 64K expansions for the 800 that allowed the 4K at $C000 to select one of 4 banks. I think they even had 16K bankable at $4000 in similar fashion to the XE, well before the XE came out. And no doubt, there were probably expansions for the Apple II that had bankable Ram. It's part of a text that lists mem upgrades for the Atari 8-bit series. So it surely means Atari ones. Sorry for not posting the context... Quote Link to comment Share on other sites More sharing options...
Rybags Posted December 13, 2023 Share Posted December 13, 2023 We need clausb in on this - I think it might have been him that devised the 130XE-link expansion for the 800 before the XE existed. Quote Link to comment Share on other sites More sharing options...
Steril707 Posted December 13, 2023 Author Share Posted December 13, 2023 So, how do I put my data into that extended RAM? Basically, how do "Org" directives work with bank switching... Will my Screen be able to display chars that are in extended RAM? Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted December 13, 2023 Share Posted December 13, 2023 Method's I've used is to create the data and save it to disk, then load the data from disk into the bank(s) as required, you can then switch banks in your program. As it's not program data, then no "org" is needed, although the compiler will probably want one.. I would use a separate program to create the data then save it to disk. 1 Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted December 13, 2023 Share Posted December 13, 2023 I have a demo written in cc65 that uses the banked memory, each bank has 4 screens of data and I use 19 banks (U1M installed) but the first banks I use are the 130XE extended memory banks, the values required for PORTB are:- $FF,$E3,$E7,$EB,$EF $FF is the main RAM the others are the banks. The program reads the screen data from disk into the banks at runtime. This is the result, you will need a U1M though to use this as the data file is quite big. The program DRAWSTAR.XEX shows the screens being created before the animation, it does take a while to run. The program DRAWREAD.XEX reads the screen data from disk, the file SCREENS.IMG needs to be in the same directory as the .XEX, this is much faster as all it needs to do is read the data from disk into the banks before the animation. DRAWSTAR.XEX DRAWREAD.XEX SCREENS.IMG 1 1 Quote Link to comment Share on other sites More sharing options...
damosan Posted December 15, 2023 Share Posted December 15, 2023 On 12/13/2023 at 5:09 AM, TGB1718 said: You couldn't put any code that uses VBI's or DLI's there, also any VBI's/DLI's that run normally could not have any code in the $4000-$7FFF window unless you turn all interrupts off while the bank is switched.. Unless you copy relevant VBI/DLI stuff to each page right? That would work right? Quote Link to comment Share on other sites More sharing options...
TGB1718 Posted December 15, 2023 Share Posted December 15, 2023 Yes, that would work, however, you would need to make the switch to the new VBI/DLI when you knew there weren't any current interrupts in progress. Quote Link to comment Share on other sites More sharing options...
danwinslow Posted December 15, 2023 Share Posted December 15, 2023 I've used a system similar to what's been mentioned above. With CC65, I used the linker config to setup named code banks (bank1, bank2, etc.,) all at $4000, and used segment names to organize code and data into each one, each in it's own file. Then I had a small loader function that would load the banks one by one, flipping banks as necessary. I also had a table of metadata about the bank locations of various functions and data, and a function caller that would change bank as necessary, and call the function. It's much better to organize groups of related functionality so that most of the calls are within the same bank. Even duplicating sets of functions, for instance, utility functions across the banks can help a lot with the switching overhead. 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.