Jump to content
IGNORED

Bankset Bankswitching


RevEng

Recommended Posts

Hi All,

 

I've written up a small doc at 7800.8bitdev.org on the new bankswitch scheme Fred (@batari) and I both devised for Petscii Robots, called "Banksets". (and by "both devised" I mean I asked if something like it could be done, and then Fred went off and did all of the hard work.)

 

The Petscii Robots tile graphics use up more than 36k of rom, and all of that and more needs to be in address space for Maria to draw the game screen. It's not hyperbole to say the game wouldn't have been possible without banksets. I also think banksets will open the doors to other games with a higher level of graphic and code complexity.

 

I still have a lot of ground work to do before opening the doors here... I've implemented banksets in A7800 emulation for the 2x128k rom size (with and without ram) but still need to implement some of the other sizes. 7800basic also needs a major update to support banksets, since intertwining code and graphics areas is at the 7800basic core, and that doesn't need to be done anymore with banksets. All of this will work will come soon, hopefully within the next month or two.

 

Lastly, I need to give thanks to @TailChao, who I reached out to, hoping to see if he had insight into any sharp corners we might have ahead of us. (R+V also uses a halt-based bankswitch scheme) He was more than gracious and shared notes, diagrams, and had a bunch of useful advice. :thumbsup:

 

Feel free to use this thread to ask questions that aren't covered at the wiki. I hope to flesh out the details there a bit, as I get input, and have time.

  • Like 14
  • Thanks 2
Link to comment
Share on other sites

This is pretty amazing! I'm definitely looking forward to seeing it implemented in 7800basic.

 

1 hour ago, RevEng said:

I also think banksets will open the doors to other games with a higher level of graphic and code complexity.

Yep. Lots of possibilities come to mind for this. I know it would make a Penult 7800 port a lot easier, too. Cool stuff!

  • Like 6
Link to comment
Share on other sites

When Mike started talking about how this could work I was blown away but until I saw the first build I just couldn't see how it was possible.  I suggested to David when discussing the project that we have the finest minds in 7800 land here at AA and boy I'm not wrong!

 

Thank you gents ?

king keraun cowboy hat GIF by Fuse

 

  • Like 7
Link to comment
Share on other sites

As far as flash carts, the best answer I have at this time is that some won't be compatible with bankset roms. It sounds like Concerto support may be split, depending on the generation. (I'm not sure if @batari has even had a chance to deeply look at it, as he has a lot of stuff on his plate) My guess is that CC2 won't be able to support it, and no idea about DF. 

 

From a theoretical standpoint, bankset support depends on the halt line being available to the flashcart logic (PLD, FPGA, or whatever the case may be) and the cart logic needs to be able to delay bankset-switching for 2 cycles after HALT has gone low. This can be done with a simple PLD, as Fred has done, but you need enough available gates to pull it off. (side note: the bankset scheme would have been viable back in the day)

 

A7800 emulation will support banksets. As part of the roll-out efforts, I'm going to reach out to authors on other emulation platforms (namely js7800 and MiSTer) so they have the info and test roms they need to implement support. I will also publicly release those test roms, and flesh out the bankset doc as any questions come in.

 

This is the unfortunate side-effect of bringing new stuff to the platform, but it's unavoidable unless we allow the scene to stagnate. Gotta break a few eggs to cover new ground with tasty ground-omelettes.

 

  • Like 3
  • Thanks 2
Link to comment
Share on other sites

Correct, the older (2015-2016) Concertos don't have the HALT line connected to anything. In 2016, I am not sure that anyone fully understood HALT's behavior. With TailChao's investigation with a logic analyzer years later, the discovery that HALT's behavior was consistent led to the a separate memory space for Sally and Maria as a key feature of the Souper mapper. Unless there is another way to detect HALT (I'm not sure what that could be), it's unlikely these early Concertos will be able to use Bankset (barring hardware mods, like a jumper wire or something.)

 

When I redid the Concerto in 2020, however, I was aware that the Souper mapper used HALT so I did run the HALT line somewhere, though a hardware upgrade is needed to use it.

 

The upgrade would be available on pre-production and production models, though I expect that on production models, the 1M memory upgrade would include the bankset support as well, though one could just opt to get the bankset upgrade.

 

There would be other improvements included with either upgrade, some you'd see right away and others wouldn't be immediately obvious but would allow for certain new features when the firmware support for them is ready.

  • Like 6
Link to comment
Share on other sites

  • 1 month later...

Hey, congrats on getting this to work!

 

I'm not too fond of Sally and Maria's requirement to share the current bank - completely separating their view of the cartridge (and by proxy, any requirement for synchronization) was the core requirement for SOUPER and removes a significant amount of headache. But I'm guessing this and most of the other nits I'd like to pick originate from a gate limitation in whatever PLD you two are using.

 

On 1/11/2022 at 8:07 PM, RevEng said:

Lastly, I need to give thanks to @TailChao, who I reached out to, hoping to see if he had insight into any sharp corners we might have ahead of us. (R+V also uses a halt-based bankswitch scheme) He was more than gracious and shared notes, diagrams, and had a bunch of useful advice. :thumbsup:

This has now been dumped in a separate thread  here ← for posterity. Go forth and design weird hardware to keep emulator authors busy.

 

On 1/13/2022 at 11:31 PM, batari said:

In 2016, I am not sure that anyone fully understood HALT's behavior. With TailChao's investigation with a logic analyzer years later, the discovery that HALT's behavior was consistent led to the a separate memory space for Sally and Maria as a key feature of the Souper mapper. Unless there is another way to detect HALT (I'm not sure what that could be), it's unlikely these early Concertos will be able to use Bankset (barring hardware mods, like a jumper wire or something.)

Not quite, to give credit where it is due most of my own work was based upon this trace by nichtsnutz from 2014. I also never formally introduced my 7800 and logic analyzer - it was all scopes and handwaving. You could detect if Maria has the bus without using HALT from the access patterns (R/W is stuck high and her fetches do look different from Sally's) but this method requires far more gates and isn't likely to be as stable.

  • Like 5
Link to comment
Share on other sites

Will do, in the coming days. I'm going to be putting together a test suite of programs for cart/emulator implementers, since there will be a few different bankset formats. I'd rather do this bit formally, so that other people won't need to deal with revisions.

  • Like 5
Link to comment
Share on other sites

  • 1 month later...

Ok, a bit longer than promised, due to the required header changes, but I've released the "Bankset Test Suite" rom pack. You can find it at the bottom of the Bankset Bankswitching wiki page.

 

The a7800 master at github contains full Bankset support. I'm not quite ready for a release of a7800 just yet though - it may be another week or two - as we have testing to do, and incorporation of pokey@800 as a feature for non-bankset schemes.

 

If any emulator or flash cart dev has questions, feel free to reach out!

  • Like 6
Link to comment
Share on other sites

  • 7 months later...
On 1/12/2022 at 2:07 AM, RevEng said:

The Petscii Robots tile graphics use up more than 36k of rom, and all of that and more needs to be in address space for Maria to draw the game screen. It's not hyperbole to say the game wouldn't have been possible without banksets. I also think banksets will open the doors to other games with a higher level of graphic and code complexity.

 

The Petscii Robots tile engine is so amazing... and in full 160B mode!!

 

Speaking of high graphical complexity, still looking at the Petscii Robots tile engine, I was fantasizing about some playing fields in full 160B mode, using a single 13 color palette (just to make things easier) and reserving the second palette for sprites (or other tiles). So here's a "quick" SNES Zelda mock-up, 128 * 192 playing field, 4 * 8 tiles (but it could also be done with 4 * 16 tiles)... just an example to tickle the developers' fancy about 7800 graphics capabilities and Bankset Bankswitching. :)

 

 

243794433_Atari7800TheLegendofZelda...thumb.PNG.c1e18d816b5a67e35028aee257ab532b.PNG

 

  • Like 7
Link to comment
Share on other sites

I'm almost finished implementing banksets for A7800DS (thanks to @RevEng for the consult and the bankset rom pack for testing!).  A very slick mechanism if you ask me - really neat to see how much graphics you can push through this scheme.  The only thing I don't yet have working is 48/52K flat bankset + Pokey@4000 as I don't support the write-thru. I'm looking into supporting that - but I wonder how popular that target will be especially given support for Pokey@800.

  • Like 5
Link to comment
Share on other sites

3 minutes ago, Muddyfunster said:

Looking forward to this hitting 7800Basic :)

It's sorta kinda implemented already - if a bankset format is selected, then the graphics are going to Maria's part of the rom. But Maria needs to see any character strings and tile maps in her rom, not Sally's, so I'm working on making that bit as transparent as possible. It's a bit tricky, because your Mariaa code still needs to reference the location of the graphics stuff in Maria's rom, but neither bank is actually assembled yet. It's not an intractable problem. It just means I'll need to do a lot of extra dancing to keep dasm happy.

 

45 minutes ago, llabnip said:

I'm almost finished implementing banksets for A7800DS (thanks to @RevEng for the consult and the bankset rom pack for testing!).  A very slick mechanism if you ask me - really neat to see how much graphics you can push through this scheme.  The only thing I don't yet have working is 48/52K flat bankset + Pokey@4000 as I don't support the write-thru. I'm looking into supporting that - but I wonder how popular that target will be especially given support for Pokey@800.

So hard to say. My gut feel is the bigger sized banked formats will be the most popular. But I'm used to being constrained by 32K and 48K shared, and it could well be that a lot of designs don't need to be shoehorned into banks anymore with Sally and Maria getting their own rom.

 

1 hour ago, Defender_2600 said:

 

[...] here's a "quick" SNES Zelda mock-up, 128 * 192 playing field, 4 * 8 tiles (but it could also be done with 4 * 16 tiles)... just an example to tickle the developers' fancy about 7800 graphics capabilities and Bankset Bankswitching. :)

Very cool!!!

 

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

1 hour ago, RevEng said:

So hard to say. My gut feel is the bigger sized banked formats will be the most popular. But I'm used to being constrained by 32K and 48K shared, and it could well be that a lot of designs don't need to be shoehorned into banks anymore with Sally and Maria getting their own rom.

Understood. And to be clear - I support Bankset 32K with Pokey anywhere and 48K and 52K with Pokey anywhere but 4000. I'm working on that last combo where the Pokey overlaps ROM memory.

 

Edit: Although the standard doesn't call out anything > 2x128k, I'm also supporting 2x256 and 2x512 all with or without the RAMx2.  You know... just in case someone wants to port Elder Scrolls. :) 

 

Edit2: Figured out how to handle the write-only Pokey@4000 when ROM is also present. With that I now pass all current Bankset test roms!  I'd like a certificate. Or at least a gold star. Or just a thumbs up :) 

Edited by llabnip
  • Like 8
Link to comment
Share on other sites

  • 2 months later...

Has the 52KB direct ROM format been test on real hardware @RevEng? I see it working in a7800 fine.

 

I've implemented banksets on the 7800GD and all other schemes work, but the 52KB one does not. It appears to be accessing ROM correctly in the $3-4000 range but crashes within a few frames somewhere. I see the text at the top of the screen flash up, then the screen turns an orange-ish colour.

Edited by SainT
Link to comment
Share on other sites

29 minutes ago, SainT said:

Has the 52KB direct ROM format been test on real hardware @RevEng? I see it working in a7800 fine.

Truth be told, no. Since it was more or less a simple extension of the 48k, we haven't set it up in hardware.

 

It's entirely possible there's some unexpected bios issue, but I don't have time to dig into it at the moment. For now it may be better to just flag it as unsupported. I'll reply back to your message here when I've had a chance to investigate.

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

2 minutes ago, RevEng said:

Truth be told, no. Since it was more or less a simple extension of the 48k, we haven't set it up in hardware.

 

It's entirely possible there's some unexpected bios issue, but I don't have time to dig into it at the moment. For now it may be better to just flag it as unsupported. I'll reply back to your message here when I've had a chance to investigate.

Ok, cool, I'll do some digging my side as well out of curiosity! As the HSC uses the 3xxx region, you'd think it would be usable, but I guess there could be some holes within that region.

 

As I don't enable any mappers until past the BIOS boot, I don't have issues with the BIOS interfering, so this would have to be some kind of memory address decoding issue.

  • Like 1
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...