diff options
author | MooglyGuy <MooglyGuy@users.noreply.github.com> | 2021-03-23 11:52:22 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-23 21:52:22 +1100 |
commit | 19b9f0233406af494bd1eac25c8d51cb743bdf73 (patch) | |
tree | df4e7355a96813d8ad66928bea555f9ea1c80da1 /src/devices/bus | |
parent | f2f52b28ff8f23c6778aa516d782a947e5679b66 (diff) |
-machine/i2cmem.cpp: Added Xicor X24C01 support. [Ryan Holtz]
* bus/megadrive: Added EEPROM cartridge variant with Xicor X24C01. [Ryan Holtz]
Diffstat (limited to 'src/devices/bus')
-rw-r--r-- | src/devices/bus/megadrive/eeprom.cpp | 73 | ||||
-rw-r--r-- | src/devices/bus/megadrive/eeprom.h | 14 | ||||
-rw-r--r-- | src/devices/bus/megadrive/md_carts.cpp | 3 |
3 files changed, 59 insertions, 31 deletions
diff --git a/src/devices/bus/megadrive/eeprom.cpp b/src/devices/bus/megadrive/eeprom.cpp index fa74fbe2917..a8cbdb6f35b 100644 --- a/src/devices/bus/megadrive/eeprom.cpp +++ b/src/devices/bus/megadrive/eeprom.cpp @@ -3,35 +3,36 @@ /*********************************************************************************************************** - MegaDrive / Genesis cart+EEPROM emulation - - - TODO: proper EEPROM emulation, still not worked on (just hooked up the I2C device) - - - i2c games mapping table: - - game name | SDA_IN | SDA_OUT | SCL | SIZE_MASK | PAGE_MASK | - ----------------------------------|------------|------------|------------|----------------|-----------| - NBA Jam | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x00ff (24C02) | 0x03 | xx - NBA Jam TE | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x00ff (24C02) | 0x03 | xx - NBA Jam TE (32x) | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x00ff (24C02) | 0x03 | - NFL Quarterback Club | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x00ff (24C02) | 0x03 | xx - NFL Quarterback Club 96 | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x07ff (24C16) | 0x07 | xx - College Slam | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x1fff (24C64) | 0x07 | xx - Frank Thomas Big Hurt Baseball | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x1fff (24C64) | 0x07 | xx - NHLPA Hockey 93 | 0x200001-7 | 0x200001-7 | 0x200001-6 | 0x007f (24C01) | 0x03 | xx - Rings of Power | 0x200001-7 | 0x200001-7 | 0x200001-6 | 0x007f (24C01) | 0x03 | xx - Evander Holyfield's Boxing | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x007f (24C01) | 0x03 | xx - Greatest Heavyweights of the Ring | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x007f (24C01) | 0x03 | xx - Wonder Boy V | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x007f (24C01) | 0x03 | xx - Sports Talk Baseball | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x007f (24C01) | 0x03 | xx - Megaman - the Wily Wars | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x007f (24C01) | 0x03 | xx ** - Micro Machines 2 | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x03ff (24C08) | 0x0f | - Micro Machines Military | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x03ff (24C08) | 0x0f | - Micro Machines 96 | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x07ff (24C16) | 0x0f | - Brian Lara Cricket 96 | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x1fff (24C64) | 0x??* | - ----------------------------------|------------|------------|------------|----------------|-----------| + MegaDrive / Genesis cart + I2C EEPROM emulation + + + TODO: EEPROM hookup verification in most games. + + + I2C games mapping table: + + Game mame | SDA_IN | SDA_OUT | SCL | SIZE_MASK | PAGE_MASK | WORKS | + ----------------------------------|------------|------------|------------|----------------|-----------|-------| + NBA Jam | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x00ff (24C02) | 0x03 | | xx + NBA Jam TE | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x00ff (24C02) | 0x03 | | xx + NBA Jam TE (32x) | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x00ff (24C02) | 0x03 | | + NFL Quarterback Club | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x00ff (24C02) | 0x03 | | xx + NFL Quarterback Club 96 | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x07ff (24C16) | 0x07 | | xx + College Slam | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x1fff (24C64) | 0x07 | | xx + Frank Thomas Big Hurt Baseball | 0x200001-0 | 0x200001-0 | 0x200000-0 | 0x1fff (24C64) | 0x07 | | xx + NHLPA Hockey 93 | 0x200001-7 | 0x200001-7 | 0x200001-6 | 0x007f (24C01) | 0x03 | | xx + Rings of Power | 0x200001-7 | 0x200001-7 | 0x200001-6 | 0x007f (24C01) | 0x03 | | xx + Honoo no Toukyuuji - Dodge Danpei | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x007f (24C01) | 0x03 | Unk. | xx + Evander Holyfield's Boxing | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x007f (24C01) | 0x03 | Unk. | xx + Greatest Heavyweights of the Ring | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x007f (24C01) | 0x03 | Unk. | xx + Wonder Boy V | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x007f (24C01) | 0x03 | Yes | xx + Sports Talk Baseball | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x007f (24C01) | 0x03 | Unk. | xx + Megaman - The Wily Wars | 0x200001-0 | 0x200001-0 | 0x200001-1 | 0x007f (24C01) | 0x03 | Yes | xx ** + Micro Machines 2 | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x03ff (24C08) | 0x0f | | + Micro Machines Military | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x03ff (24C08) | 0x0f | | + Micro Machines 96 | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x07ff (24C16) | 0x0f | | + Brian Lara Cricket 96 | 0x380001-7 | 0x300000-0*| 0x300000-1*| 0x1fff (24C64) | 0x??* | | + ----------------------------------|------------|------------|------------|----------------|-----------|-------| * Notes: check these ** original Rockman Mega World (J) set uses normal backup RAM @@ -58,6 +59,7 @@ DEFINE_DEVICE_TYPE(MD_EEPROM_NFLQB, md_eeprom_nflqb_device, "md_eeprom_nfl DEFINE_DEVICE_TYPE(MD_EEPROM_CSLAM, md_eeprom_cslam_device, "md_eeprom_cslam", "MD College Slam") DEFINE_DEVICE_TYPE(MD_EEPROM_NHLPA, md_eeprom_nhlpa_device, "md_eeprom_nhlpa", "MD NHLPA 93") DEFINE_DEVICE_TYPE(MD_EEPROM_BLARA, md_eeprom_blara_device, "md_eeprom_blara", "MD Brian Lara") +DEFINE_DEVICE_TYPE(MD_EEPROM_MODE1, md_eeprom_mode1_device, "md_eeprom_mode1", "MD Serial EEPROM Mode 1") md_std_eeprom_device::md_std_eeprom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock) @@ -102,6 +104,11 @@ md_eeprom_blara_device::md_eeprom_blara_device(const machine_config &mconfig, co { } +md_eeprom_mode1_device::md_eeprom_mode1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) + : md_std_eeprom_device(mconfig, MD_EEPROM_MODE1, tag, owner, clock) +{ +} + //------------------------------------------------- // device_add_mconfig - add device configuration @@ -142,6 +149,11 @@ void md_eeprom_blara_device::device_add_mconfig(machine_config &config) I2C_24C64(config, m_i2cmem); } +void md_eeprom_mode1_device::device_add_mconfig(machine_config &config) +{ + I2C_X24C01(config, m_i2cmem); +} + void md_std_eeprom_device::device_start() { save_item(NAME(m_i2c_mem)); @@ -166,7 +178,8 @@ uint16_t md_std_eeprom_device::read(offs_t offset) { if (offset == 0x200000/2) { - return m_i2cmem->read_sda(); + const uint8_t data = m_i2cmem->read_sda(); + return ((uint16_t)data << 8) | data; } if (offset < 0x400000/2) return m_rom[MD_ADDR(offset)]; diff --git a/src/devices/bus/megadrive/eeprom.h b/src/devices/bus/megadrive/eeprom.h index 73d693686ac..7f5b0e450a4 100644 --- a/src/devices/bus/megadrive/eeprom.h +++ b/src/devices/bus/megadrive/eeprom.h @@ -140,6 +140,19 @@ protected: virtual void write(offs_t offset, uint16_t data, uint16_t mem_mask = ~0) override; }; +// ======================> md_eeprom_mode1_device + +class md_eeprom_mode1_device : public md_std_eeprom_device +{ +public: + // construction/destruction + md_eeprom_mode1_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock); + +protected: + // device-level overrides + virtual void device_add_mconfig(machine_config &config) override; +}; + // device type definition DECLARE_DEVICE_TYPE(MD_STD_EEPROM, md_std_eeprom_device) @@ -149,6 +162,7 @@ DECLARE_DEVICE_TYPE(MD_EEPROM_CSLAM, md_eeprom_cslam_device) DECLARE_DEVICE_TYPE(MD_EEPROM_NFLQB, md_eeprom_nflqb_device) DECLARE_DEVICE_TYPE(MD_EEPROM_NHLPA, md_eeprom_nhlpa_device) DECLARE_DEVICE_TYPE(MD_EEPROM_BLARA, md_eeprom_blara_device) +DECLARE_DEVICE_TYPE(MD_EEPROM_MODE1, md_eeprom_mode1_device) diff --git a/src/devices/bus/megadrive/md_carts.cpp b/src/devices/bus/megadrive/md_carts.cpp index 7b2e8fa333d..412ae2a5d9c 100644 --- a/src/devices/bus/megadrive/md_carts.cpp +++ b/src/devices/bus/megadrive/md_carts.cpp @@ -32,7 +32,7 @@ void md_cart(device_slot_interface &device) device.option_add_internal("rom_sf001", MD_ROM_BEGGARP); device.option_add_internal("rom_sf002", MD_ROM_WUKONG); device.option_add_internal("rom_sf004", MD_ROM_STARODYS); -// EEPROM handling (not supported fully yet) +// EEPROM handling (most not supported fully yet) device.option_add_internal("rom_eeprom", MD_STD_EEPROM); device.option_add_internal("rom_nbajam", MD_EEPROM_NBAJAM); device.option_add_internal("rom_nbajamte", MD_EEPROM_NBAJAMTE); @@ -40,6 +40,7 @@ void md_cart(device_slot_interface &device) device.option_add_internal("rom_cslam", MD_EEPROM_CSLAM); device.option_add_internal("rom_nhlpa", MD_EEPROM_NHLPA); device.option_add_internal("rom_blara", MD_EEPROM_BLARA); + device.option_add_internal("rom_eeprom_mode1", MD_EEPROM_MODE1); // J-Cart controller (Sampras Tennis) device.option_add_internal("rom_jcart", MD_JCART); // J-Cart controller + EEPROM handling (not supported fully yet) |