Trip2018 Posted October 11, 2022 Share Posted October 11, 2022 So I'm trying to make a demo. I want it to be a 64K demo, but I find swapping all 4k of a bank to waste too many cycles when all I'm doing is loading a byte or 2. So I've opted to have a 2k split format similar to what's elaborated here, where the last 2k is static and the rest is bank switched. Problem is, I don't think it exists for 64k... Maybe... I had no issues splitting up the chunks, but I'm not sure how to go about using "hotspots" for a scheme like this. So what I wanna know is: How do these hotspots work? Are they tied to the console, or the rom's chipset? If it's the rom, does that mean I have to define and write my own bankswitching scheme/hotspots? What emulators could I test it on that would work for a case like that? Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted October 11, 2022 Share Posted October 11, 2022 I think Tigervision's 3F is what you are looking for. We used deviation with RAM (3E) for Boulder Dash, but we found out that even 2K are not flexible enough. The fixed bank turned out to be a bottleneck. So I went for 3E+, which uses four 1K banks. It allows up to 64K ROM and 32K RAM. Comment from Stella's source code: Cartridge class for new tiling engine "Boulder Dash" format games with RAM. Kind of a combination of 3F and 3E, with better switchability. B.Watson's Cart3E was used as a template for building this implementation. The destination bank (0-3) is held in the top bits of the value written to $3E (for RAM switching) or $3F (for ROM switching). The low 6 bits give the actual bank number (0-63) corresponding to 512 byte blocks for RAM and 1024 byte blocks for ROM. The maximum size is therefore 32K RAM and 64K ROM. D7D6 indicate the bank number (0-3) D5D4D3D2D1D0 indicate the actual # (0-63) from the image/ram ROM: Note: In descriptions $F000 is equivalent to $1000 -- that is, we only deal with the low 13 bits of addressing. Stella code uses $1000, I'm used to $F000 So, mask with top bits clear :) when reading this document. In this scheme, the 4K address space is broken into four 1K ROM/512b RAM segments living at 0x1000, 0x1400, 0x1800, 0x1C00 (or, same thing, 0xF000... etc.), The last 1K ROM ($FC00-$FFFF) segment in the 6502 address space (ie: $1C00-$1FFF) is initialised to point to the FIRST 1K of the ROM image, so the reset vectors must be placed at the end of the first 1K in the ROM image. Note: This is DIFFERENT to 3E which switches in the UPPER bank and this bank is fixed. This allows variable sized ROM without having to detect size. ROM switching (write of block+bank number to $3F) D7D6 upper 2 bits of bank # indicates the destination segment (0-3, corresponding to $F000, $F400, $F800, $FC00), and lower 6 bits indicate the 1K bank to switch in. Can handle 64 x 1K ROM banks (64K total). D7 D6 D5D4D3D2D1D0 0 0 x x x x x x switch a 1K ROM bank xxxxxx to $F000 0 1 switch a 1K ROM bank xxxxxx to $F400 1 0 switch a 1K ROM bank xxxxxx to $F800 1 1 switch a 1K ROM bank xxxxxx to $FC00 RAM switching (write of segment+bank number to $3E) with D7D6 upper 2 bits of bank # indicates the destination RAM segment (0-3, corresponding to $F000, $F400, $F800, $FC00). Can handle 64 x 512 byte RAM banks (32K total) D7 D6 D5D4D3D2D1D0 0 0 x x x x x x switch a 512 byte RAM bank xxxxxx to $F000 with write @ $F200 0 1 switch a 512 byte RAM bank xxxxxx to $F400 with write @ $F600 1 0 switch a 512 byte RAM bank xxxxxx to $F800 with write @ $FA00 1 1 switch a 512 byte RAM bank xxxxxx to $FC00 with write @ $FE00 2 Quote Link to comment Share on other sites More sharing options...
Trip2018 Posted October 11, 2022 Author Share Posted October 11, 2022 Oh thanks! The 2k format should be enough because I'm not banking anything more than raw bytes for the vast majority of the rom and any code that I'll likely add, won't interfere with that 2k static. Quote Link to comment Share on other sites More sharing options...
Ecernosoft Posted October 12, 2022 Share Posted October 12, 2022 On 10/11/2022 at 2:10 AM, Trip2018 said: So I'm trying to make a demo. I want it to be a 64K demo, but I find swapping all 4k of a bank to waste too many cycles when all I'm doing is loading a byte or 2. So I've opted to have a 2k split format similar to what's elaborated here, where the last 2k is static and the rest is bank switched. Problem is, I don't think it exists for 64k... Maybe... I had no issues splitting up the chunks, but I'm not sure how to go about using "hotspots" for a scheme like this. So what I wanna know is: How do these hotspots work? Are they tied to the console, or the rom's chipset? If it's the rom, does that mean I have to define and write my own bankswitching scheme/hotspots? What emulators could I test it on that would work for a case like that? 64K? Pretty sure you could get 32K if you aren't doing anything extreme.. You're getting into Soni- cough cough, Zippy rom size stuff. Quote Link to comment Share on other sites More sharing options...
Trip2018 Posted October 13, 2022 Author Share Posted October 13, 2022 7 hours ago, Ecernosoft said: 64K? Pretty sure you could get 32K if you aren't doing anything extreme.. You're getting into Soni- cough cough, Zippy rom size stuff. It's compressed fmv. Nuff said! 👀 😅 Lucky me, after all the kernel and data I'll still have an extra 6k to fool around with. Maybe for an intro? Quote Link to comment Share on other sites More sharing options...
Ecernosoft Posted October 13, 2022 Share Posted October 13, 2022 6 hours ago, Trip2018 said: It's compressed fmv. Nuff said! 👀 😅 Lucky me, after all the kernel and data I'll still have an extra 6k to fool around with. Maybe for an intro? Video? 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.