diff options
author | 2013-05-13 14:29:50 +0000 | |
---|---|---|
committer | 2013-05-13 14:29:50 +0000 | |
commit | 8c510ba3696269000572928d49e3e699ba2bbac5 (patch) | |
tree | 2231470bc27c167ca9cbca71f2e92f5c7bb4b586 /src | |
parent | 591f8de3da268063bea9d597c7044cdad9a93829 (diff) |
(MESS) nes.c: added a new fds conversion dump found in a big chinese pack. emulation
is only partial, unfortunately. nw.
Diffstat (limited to 'src')
-rw-r--r-- | src/mess/includes/nes.h | 3 | ||||
-rw-r--r-- | src/mess/machine/nes_bootleg.c | 101 | ||||
-rw-r--r-- | src/mess/machine/nes_bootleg.h | 30 | ||||
-rw-r--r-- | src/mess/machine/nes_ines.c | 2 | ||||
-rw-r--r-- | src/mess/machine/nes_mmc3_clones.c | 192 | ||||
-rw-r--r-- | src/mess/machine/nes_mmc3_clones.h | 3 | ||||
-rw-r--r-- | src/mess/machine/nes_pcb.c | 3 | ||||
-rw-r--r-- | src/mess/machine/nes_slot.h | 2 | ||||
-rw-r--r-- | src/mess/machine/nes_unif.c | 1 |
9 files changed, 238 insertions, 99 deletions
diff --git a/src/mess/includes/nes.h b/src/mess/includes/nes.h index 102d96f7202..c10f5a2f4f3 100644 --- a/src/mess/includes/nes.h +++ b/src/mess/includes/nes.h @@ -285,6 +285,7 @@ static SLOT_INTERFACE_START(nes_cart) SLOT_INTERFACE_INTERNAL("unl_2708", NES_2708) // mapper 103 SLOT_INTERFACE_INTERNAL("unl_lh32", NES_LH32) // used by Monty no Doki Doki Daidassou FDS conversion SLOT_INTERFACE_INTERNAL("unl_lh10", NES_LH10) // used in Fuuun Shaolin Kyo (FDS Conversion) + SLOT_INTERFACE_INTERNAL("unl_lh53", NES_LH53) // used in Nazo no Murasamejou (FDS Conversion) SLOT_INTERFACE_INTERNAL("unl_ac08", NES_AC08) // used by Green Beret FDS conversion SLOT_INTERFACE_INTERNAL("unl_bb", NES_UNL_BB) // used by a few FDS conversions SLOT_INTERFACE_INTERNAL("sgpipe", NES_SHUIGUAN) // mapper 183 @@ -313,7 +314,6 @@ static SLOT_INTERFACE_START(nes_cart) SLOT_INTERFACE_INTERNAL("gouder", NES_GOUDER) SLOT_INTERFACE_INTERNAL("sa9602b", NES_SA9602B) SLOT_INTERFACE_INTERNAL("unl_shero", NES_SACHEN_SHERO) - SLOT_INTERFACE_INTERNAL("a9746", NES_A9746) // mapper 219 // misc multigame cart boards SLOT_INTERFACE_INTERNAL("benshieng", NES_BENSHIENG) SLOT_INTERFACE_INTERNAL("action52", NES_ACTION52) @@ -392,6 +392,7 @@ static SLOT_INTERFACE_START(nes_cart) SLOT_INTERFACE_INTERNAL("unl_3d_block", NES_NROM) // [mentioned in FCEUMM source - we need more info] - UNSUPPORTED SLOT_INTERFACE_INTERNAL("unl_c_n22m", NES_NROM) // [mentioned in FCEUMM source - we need more info] - UNSUPPORTED SLOT_INTERFACE_INTERNAL("unl_pec_586", NES_NROM) // [mentioned in FCEUMM source - we need more info] - UNSUPPORTED + SLOT_INTERFACE_INTERNAL("a9746", NES_NROM) // mapper 219 - UNSUPPORTED (no dump available) // legacy boards for FFE copier mappers (are there images available to fix/improve emulation?) SLOT_INTERFACE_INTERNAL("ffe3", NES_FFE3) SLOT_INTERFACE_INTERNAL("ffe4", NES_FFE4) diff --git a/src/mess/machine/nes_bootleg.c b/src/mess/machine/nes_bootleg.c index be9d4471635..6916240c468 100644 --- a/src/mess/machine/nes_bootleg.c +++ b/src/mess/machine/nes_bootleg.c @@ -53,6 +53,7 @@ const device_type NES_09034A = &device_creator<nes_09034a_device>; const device_type NES_TOBIDASE = &device_creator<nes_tobidase_device>; const device_type NES_LH32 = &device_creator<nes_lh32_device>; const device_type NES_LH10 = &device_creator<nes_lh10_device>; +const device_type NES_LH53 = &device_creator<nes_lh53_device>; const device_type NES_2708 = &device_creator<nes_2708_device>; const device_type NES_AC08 = &device_creator<nes_ac08_device>; const device_type NES_UNL_BB = &device_creator<nes_unl_bb_device>; @@ -130,6 +131,11 @@ nes_lh10_device::nes_lh10_device(const machine_config &mconfig, const char *tag, { } +nes_lh53_device::nes_lh53_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) + : nes_nrom_device(mconfig, NES_LH53, "NES Cart LH-53 Pirate PCB", tag, owner, clock, "nes_lh53", __FILE__) +{ +} + nes_2708_device::nes_2708_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) : nes_nrom_device(mconfig, NES_2708, "NES Cart BTL-2708 Pirate PCB", tag, owner, clock, "nes_2708", __FILE__) { @@ -419,6 +425,30 @@ void nes_lh10_device::pcb_reset() m_latch = 0; } +void nes_lh53_device::device_start() +{ + common_start(); + irq_timer = timer_alloc(TIMER_IRQ); + irq_timer->adjust(attotime::zero, 0, machine().device<cpu_device>("maincpu")->cycles_to_attotime(1)); + + save_item(NAME(m_irq_enable)); + save_item(NAME(m_irq_count)); + save_item(NAME(m_reg)); +} + +void nes_lh53_device::pcb_reset() +{ + chr8(0, CHRRAM); + + prg8_89(0xc); + prg8_ab(0xd); // last 2K are overlayed by WRAM + prg8_cd(0xe); // first 6K are overlayed by WRAM + prg8_ef(0xf); + m_reg = 0; + m_irq_count = 0; + m_irq_enable = 0; +} + void nes_2708_device::device_start() { common_start(); @@ -1275,6 +1305,77 @@ WRITE8_MEMBER(nes_lh10_device::write_h) } /*------------------------------------------------- + + UNL-LH53 + + Games: Nazo no Murasamejou (FDS conversion) + + This PCB maps WRAM (w/battery) in 0xb800-0xd7ff and + PRG in 0x6000-0x7fff + + iNES: + + In MESS: Preliminar Support only. + + -------------------------------------------------*/ + +void nes_lh53_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) +{ + if (id == TIMER_IRQ) + { + if (m_irq_enable) + { + m_irq_count++; + if (m_irq_count > 7560)//value from FCEUMM... + { + m_irq_count = 0; + machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, ASSERT_LINE); + } + } + } +} + +READ8_MEMBER(nes_lh53_device::read_m) +{ + LOG_MMC(("lh53 read_m, offset: %04x\n", offset)); + return m_prg[(m_reg * 0x2000) + (offset & 0x1fff)]; +} + +READ8_MEMBER(nes_lh53_device::read_h) +{ + LOG_MMC(("lh53 read_h, offset: %04x\n", offset)); + + if (offset >= 0x3800 && offset < 0x5800) + return m_battery[offset & 0x1fff]; + + return hi_access_rom(offset); +} + +WRITE8_MEMBER(nes_lh53_device::write_h) +{ + LOG_MMC(("lh53 write_h, offset: %04x, data: %02x\n", offset, data)); + + if (offset >= 0x3800 && offset < 0x5800) + m_battery[offset & 0x1fff] = data; + + else + { + switch (offset & 0x7000) + { + case 0x6000: + m_irq_enable = BIT(data, 1); + m_irq_count = 0; + if (!m_irq_enable) + machine().device("maincpu")->execute().set_input_line(M6502_IRQ_LINE, CLEAR_LINE); + break; + case 0x7000: + m_reg = data & 0x0f; + break; + } + } +} + +/*------------------------------------------------- BTL-2708 diff --git a/src/mess/machine/nes_bootleg.h b/src/mess/machine/nes_bootleg.h index 6f7311b8c70..da87dfa8b77 100644 --- a/src/mess/machine/nes_bootleg.h +++ b/src/mess/machine/nes_bootleg.h @@ -320,6 +320,35 @@ private: }; +// ======================> nes_lh53_device + +class nes_lh53_device : public nes_nrom_device +{ +public: + // construction/destruction + nes_lh53_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); + + // device-level overrides + virtual void device_start(); + virtual void device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr); + virtual DECLARE_READ8_MEMBER(read_m); + virtual DECLARE_READ8_MEMBER(read_h); + virtual DECLARE_WRITE8_MEMBER(write_m) {} + virtual DECLARE_WRITE8_MEMBER(write_h); + + virtual void pcb_reset(); + +private: + UINT16 m_irq_count; + int m_irq_enable; + UINT8 m_reg; + + static const device_timer_id TIMER_IRQ = 0; + emu_timer *irq_timer; + attotime timer_freq; +}; + + // ======================> nes_2708_device class nes_2708_device : public nes_nrom_device @@ -438,6 +467,7 @@ extern const device_type NES_09034A; extern const device_type NES_TOBIDASE; extern const device_type NES_LH32; extern const device_type NES_LH10; +extern const device_type NES_LH53; extern const device_type NES_2708; extern const device_type NES_AC08; extern const device_type NES_UNL_BB; diff --git a/src/mess/machine/nes_ines.c b/src/mess/machine/nes_ines.c index 4a68cab657a..ca80c476669 100644 --- a/src/mess/machine/nes_ines.c +++ b/src/mess/machine/nes_ines.c @@ -250,7 +250,7 @@ static const nes_mmc mmc_list[] = { 216, RCM_GS2015 }, { 217, BMC_GOLDENCARD_6IN1 }, // 218 Unused - { 216, UNL_A9746 }, + // 219 UNL-A9746 (according to Cah4e3's code, no dump available (yet) // 220 Unused { 221, UNL_N625092 }, { 222, BTL_DRAGONNINJA }, diff --git a/src/mess/machine/nes_mmc3_clones.c b/src/mess/machine/nes_mmc3_clones.c index 7cb164d57c3..9b57cfb9816 100644 --- a/src/mess/machine/nes_mmc3_clones.c +++ b/src/mess/machine/nes_mmc3_clones.c @@ -49,7 +49,7 @@ const device_type NES_SF3 = &device_creator<nes_sf3_device>; const device_type NES_GOUDER = &device_creator<nes_gouder_device>; const device_type NES_SA9602B = &device_creator<nes_sa9602b_device>; const device_type NES_SACHEN_SHERO = &device_creator<nes_sachen_shero_device>; -const device_type NES_A9746 = &device_creator<nes_a9746_device>; +//const device_type NES_A9746 = &device_creator<nes_a9746_device>; const device_type NES_FK23C = &device_creator<nes_fk23c_device>; const device_type NES_FK23CA = &device_creator<nes_fk23ca_device>; @@ -166,10 +166,10 @@ nes_sachen_shero_device::nes_sachen_shero_device(const machine_config &mconfig, { } -nes_a9746_device::nes_a9746_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) - : nes_txrom_device(mconfig, NES_A9746, "NES Cart A-9746 PCB", tag, owner, clock, "nes_bmc_a9746", __FILE__) -{ -} +//nes_a9746_device::nes_a9746_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) +// : nes_txrom_device(mconfig, NES_A9746, "NES Cart A-9746 PCB", tag, owner, clock, "nes_bmc_a9746", __FILE__) +//{ +//} nes_fk23c_device::nes_fk23c_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : nes_txrom_device(mconfig, type, name, tag, owner, clock, shortname, source) @@ -434,22 +434,6 @@ void nes_sachen_shero_device::pcb_reset() mmc3_common_initialize(0xff, 0x1ff, 0); } -void nes_a9746_device::device_start() -{ - mmc3_start(); - save_item(NAME(m_reg)); -} - -void nes_a9746_device::pcb_reset() -{ - m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; - - m_reg[0] = 0; - m_reg[1] = 0; - m_reg[2] = 0; - mmc3_common_initialize(0x7f, 0xff, 0); -} - void nes_fk23c_device::device_start() { mmc3_start(); @@ -1801,79 +1785,6 @@ READ8_MEMBER( nes_sachen_shero_device::read_l ) } -/*------------------------------------------------- - - UNL-A9746 - - - MMC3 clone - - - In MESS: Very Preliminary Support - - -------------------------------------------------*/ - -void nes_a9746_device::update_banks(UINT8 value) -{ - UINT8 bank = BITSWAP8(value & 0x3c,7,6,0,1,2,3,4,5); - - switch (m_reg[0]) - { - case 0x26: prg8_89(bank); break; - case 0x25: prg8_ab(bank); break; - case 0x24: prg8_cd(bank); break; - case 0x23: prg8_ef(bank); break; - } - - switch (m_reg[1]) - { - case 0x08: case 0x0a: case 0x0c: case 0x0e: - case 0x10: case 0x12: case 0x14: case 0x16: - case 0x18: case 0x1a: case 0x1c: case 0x1e: - m_reg[2] = (value << 4); - break; - case 0x09: chr1_0(m_reg[2] | (value >> 1), m_chr_source); break; - case 0x0b: chr1_1(m_reg[2] | (value >> 1) | 1, m_chr_source); break; - case 0x0d: chr1_2(m_reg[2] | (value >> 1), m_chr_source); break; - case 0x0f: chr1_3(m_reg[2] | (value >> 1) | 1, m_chr_source); break; - case 0x11: chr1_4(m_reg[2] | (value >> 1), m_chr_source); break; - case 0x15: chr1_5(m_reg[2] | (value >> 1), m_chr_source); break; - case 0x19: chr1_6(m_reg[2] | (value >> 1), m_chr_source); break; - case 0x1d: chr1_7(m_reg[2] | (value >> 1), m_chr_source); break; - } -} - -WRITE8_MEMBER(nes_a9746_device::write_h) -{ - LOG_MMC(("unl_a9746 write_h, offset: %04x, data: %02x\n", offset, data)); - - switch (offset & 0x6003) - { - case 0x0000: - m_reg[1] = data; - m_reg[0] = 0; - break; - case 0x0001: - update_banks(data); - break; - case 0x0002: - m_reg[0] = data; - m_reg[1] = 0; - break; - - case 0x0003: - case 0x2000: - case 0x2001: - case 0x2002: - case 0x2003: - break; - - default: - txrom_write(space, offset, data, mem_mask); - break; - } -} - /*------------------------------------------------- @@ -2584,3 +2495,96 @@ WRITE8_MEMBER(nes_pjoy84_device::write_m) break; } } + +#ifdef UNUSED_FUNCTION +/*------------------------------------------------- + + UNL-A9746 + + + MMC3 clone + + + Preliminary emulation based on Cah4e3's code + No dump is available (yet) for this. + + -------------------------------------------------*/ + +void nes_a9746_device::device_start() +{ + mmc3_start(); + save_item(NAME(m_reg)); +} + +void nes_a9746_device::pcb_reset() +{ + m_chr_source = m_vrom_chunks ? CHRROM : CHRRAM; + + m_reg[0] = 0; + m_reg[1] = 0; + m_reg[2] = 0; + mmc3_common_initialize(0x7f, 0xff, 0); +} + +void nes_a9746_device::update_banks(UINT8 value) +{ + UINT8 bank = BITSWAP8(value & 0x3c,7,6,0,1,2,3,4,5); + + switch (m_reg[0]) + { + case 0x26: prg8_89(bank); break; + case 0x25: prg8_ab(bank); break; + case 0x24: prg8_cd(bank); break; + case 0x23: prg8_ef(bank); break; + } + + switch (m_reg[1]) + { + case 0x08: case 0x0a: case 0x0c: case 0x0e: + case 0x10: case 0x12: case 0x14: case 0x16: + case 0x18: case 0x1a: case 0x1c: case 0x1e: + m_reg[2] = (value << 4); + break; + case 0x09: chr1_0(m_reg[2] | (value >> 1), m_chr_source); break; + case 0x0b: chr1_1(m_reg[2] | (value >> 1) | 1, m_chr_source); break; + case 0x0d: chr1_2(m_reg[2] | (value >> 1), m_chr_source); break; + case 0x0f: chr1_3(m_reg[2] | (value >> 1) | 1, m_chr_source); break; + case 0x11: chr1_4(m_reg[2] | (value >> 1), m_chr_source); break; + case 0x15: chr1_5(m_reg[2] | (value >> 1), m_chr_source); break; + case 0x19: chr1_6(m_reg[2] | (value >> 1), m_chr_source); break; + case 0x1d: chr1_7(m_reg[2] | (value >> 1), m_chr_source); break; + } +} + +WRITE8_MEMBER(nes_a9746_device::write_h) +{ + LOG_MMC(("unl_a9746 write_h, offset: %04x, data: %02x\n", offset, data)); + + switch (offset & 0x6003) + { + case 0x0000: + m_reg[1] = data; + m_reg[0] = 0; + break; + case 0x0001: + update_banks(data); + break; + case 0x0002: + m_reg[0] = data; + m_reg[1] = 0; + break; + + case 0x0003: + case 0x2000: + case 0x2001: + case 0x2002: + case 0x2003: + break; + + default: + txrom_write(space, offset, data, mem_mask); + break; + } +} +#endif + diff --git a/src/mess/machine/nes_mmc3_clones.h b/src/mess/machine/nes_mmc3_clones.h index 77ae276b271..28ff9392a45 100644 --- a/src/mess/machine/nes_mmc3_clones.h +++ b/src/mess/machine/nes_mmc3_clones.h @@ -383,7 +383,7 @@ private: UINT8 m_reg; }; - +#ifdef UNUSED_FUNCTION // ======================> nes_a9746_device class nes_a9746_device : public nes_txrom_device @@ -402,6 +402,7 @@ private: void update_banks(UINT8 value); UINT8 m_reg[3]; }; +#endif // ======================> nes_fk23c_device diff --git a/src/mess/machine/nes_pcb.c b/src/mess/machine/nes_pcb.c index 1398da275b1..2ab6b78a9a1 100644 --- a/src/mess/machine/nes_pcb.c +++ b/src/mess/machine/nes_pcb.c @@ -288,9 +288,9 @@ static const nes_pcb pcb_list[] = { "ks7013b", KAISER_KS7013B }, { "mmalee2", UNL_MMALEE }, { "unl_2708", UNL_2708 }, - { "a9746", UNL_A9746 }, { "unl_lh10", UNL_LH10 }, { "unl_lh32", UNL_LH32 }, + { "unl_lh53", UNL_LH53 }, { "unl_ac08", UNL_AC08 }, { "unl_bb", UNL_BB }, { "unl_malisb", UNL_MALISB }, @@ -307,6 +307,7 @@ static const nes_pcb pcb_list[] = { "unl_dance", UNSUPPORTED_BOARD }, { "bmc_hik_kof", UNSUPPORTED_BOARD }, { "onebus", UNSUPPORTED_BOARD }, + { "a9746", UNSUPPORTED_BOARD }, { "test", TEST_BOARD }, { "unknown", UNKNOWN_BOARD } // a few pirate dumps uses the wrong mapper... }; diff --git a/src/mess/machine/nes_slot.h b/src/mess/machine/nes_slot.h index b5dd78494a2..c0bb3d7ce97 100644 --- a/src/mess/machine/nes_slot.h +++ b/src/mess/machine/nes_slot.h @@ -95,7 +95,7 @@ enum UNL_8237, UNL_CC21, UNL_AX5705, UNL_KOF97, UNL_KS7057, UNL_N625092, UNL_SC127, UNL_SMB2J, UNL_T230, UNL_MMALEE, UNL_UXROM, UNL_MK2, UNL_XIAOZY, UNL_KOF96, - UNL_SF3, UNL_RACERMATE, UNL_EDU2K, UNL_LH32, UNL_LH10, + UNL_SF3, UNL_RACERMATE, UNL_EDU2K, UNL_LH53, UNL_LH32, UNL_LH10, UNL_STUDYNGAME, UNL_603_5052, UNL_H2288, UNL_2708, UNL_MALISB, UNL_BB, UNL_AC08, UNL_A9746, UNL_WORLDHERO, UNL_43272, UNL_TF1201, UNL_CITYFIGHT, diff --git a/src/mess/machine/nes_unif.c b/src/mess/machine/nes_unif.c index 11016f6e33d..f93ceb33a87 100644 --- a/src/mess/machine/nes_unif.c +++ b/src/mess/machine/nes_unif.c @@ -126,6 +126,7 @@ static const unif unif_list[] = { "UNL-AC08", 0, 0, CHRRAM_0, UNL_AC08}, { "UNL-BB", 0, 0, CHRRAM_0, UNL_BB}, { "UNL-LH32", 0, 0, CHRRAM_0, UNL_LH32}, + { "UNL-LH53", 0, 0, CHRRAM_0, UNL_LH53}, { "BMC-G-146", 0, 0, CHRRAM_0, BMC_G146}, { "BMC-11160", 0, 0, CHRRAM_0, BMC_11160}, { "UNL-MALISB", 0, 0, CHRRAM_0, UNL_MALISB}, |