|
Joined: Jan 2021
Posts: 58 Likes: 39
Member
|
OP
Member
Joined: Jan 2021
Posts: 58 Likes: 39 |
I'm currently working on a driver for the Casio CZ-1. I'd like to implement a cartridge slot that can support both: - Swappable 16kb and 4kb NVRAM carts (e.g. the existing casio_ra3_device which uses device_memcard_image_interface)
- Arbitrary-sized ROM carts with a software list
I'm only really familiar with slots where either all of the options are ROM/softlist based, or ones where all of the options are peripherals. Is there a particular ideal way to do this? Better yet, any particular systems that are a good example?
|
|
|
|
Joined: May 2007
Posts: 575 Likes: 9
Senior Member
|
Senior Member
Joined: May 2007
Posts: 575 Likes: 9 |
Maybe you can find some inspiration in the TI-99/4A cartridge emulation from me (src/devices/bus/ti99/gromport/cartridges.{h,cpp}).
|
|
|
|
Joined: Feb 2004
Posts: 2,526 Likes: 218
Very Senior Member
|
Very Senior Member
Joined: Feb 2004
Posts: 2,526 Likes: 218 |
The Virtual Boy cartridge slot (src/devices/bus/vboy) is pretty simple – it supports cartridges with onboard NVRAM as well as ROM.
|
|
|
|
Joined: Jan 2021
Posts: 58 Likes: 39
Member
|
OP
Member
Joined: Jan 2021
Posts: 58 Likes: 39 |
To clarify a bit, I'm aiming to support carts with either NVRAM or ROM, not both - i.e. the ROM carts are just read-only versions of memory cards with factory presets, etc. Ideally the NVRAM ones should still allow creating a new image through the UI. I thought about just using my existing device_memcard_image_interface subclass and letting it behave as read-only when loaded from a software list, but I'm not sure if that makes sense / is the best approach.
Last edited by Revenant; 11/15/23 04:36 PM.
|
|
|
|
Joined: Mar 2001
Posts: 17,098 Likes: 153
Very Senior Member
|
Very Senior Member
Joined: Mar 2001
Posts: 17,098 Likes: 153 |
I think what Vas suggested is fine. Image devices have an is_creatable() function that just needs to return false for the ROM cards and true otherwise.
|
|
|
|
Joined: Aug 2009
Posts: 1,205 Likes: 89
Very Senior Member
|
Very Senior Member
Joined: Aug 2009
Posts: 1,205 Likes: 89 |
By quick glance (and assuming I'm getting everything right from the schematics) the carts are 30-pin, single row, 8-bit of data bus and up to A13, Chip Enable, R/W and a couple extra pins I can't read properly due of poor scan (a "VBR" that goes to "VBU" connection, and a "KIO"). imho you can perfectly self contain the cart mapping to 0x0000-0x3fff from your bus a la vboy, where slot options can access that only and the couple pins really required for emulation.
|
|
|
|
Joined: Feb 2004
Posts: 2,526 Likes: 218
Very Senior Member
|
Very Senior Member
Joined: Feb 2004
Posts: 2,526 Likes: 218 |
The only complication is if it needs to be able to deal with on-the-fly card changes. If it has to deal with that, you can’t really do it with the slot/card paradigm because that forces you to do a hard reset for card changes. If that’s the case, you need to do it was a device_image_interface with custom implementation for software list load/unload.
|
|
|
|
Joined: Jan 2021
Posts: 58 Likes: 39
Member
|
OP
Member
Joined: Jan 2021
Posts: 58 Likes: 39 |
Yeah, it should be hot-swappable like the existing casio_ra3_device (which is one of the supported cart types here, alongside the larger RA-6 RAM cart and simple ROM carts). So would it make sense to just add read-only software list support to the existing NVRAM image device?
|
|
|
|
Joined: Feb 2004
Posts: 2,526 Likes: 218
Very Senior Member
|
Very Senior Member
Joined: Feb 2004
Posts: 2,526 Likes: 218 |
Yeah, you can add software list support to the existing device.
|
|
|
|
Joined: Jan 2021
Posts: 58 Likes: 39
Member
|
OP
Member
Joined: Jan 2021
Posts: 58 Likes: 39 |
I'll do that then, thanks.
|
|
|
1 members (1 invisible),
52
guests, and
1
robot. |
Key:
Admin,
Global Mod,
Mod
|
|
Forums9
Topics9,240
Posts120,958
Members5,061
|
Most Online1,283 Dec 21st, 2022
|
|
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!
|
|
|
|