mirror of
https://github.com/holub/mame
synced 2025-04-23 00:39:36 +03:00
bus/nes: Minor simplification to TQROM + update support status. (#9576)
This commit is contained in:
parent
63b78564fb
commit
b5c1ac55d1
@ -16496,7 +16496,7 @@ license:CC0
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<software name="highspedu" cloneof="highsped" supported="partial">
|
||||
<software name="highspedu" cloneof="highsped">
|
||||
<description>High Speed (USA)</description>
|
||||
<year>1991</year>
|
||||
<publisher>Tradewest</publisher>
|
||||
@ -16518,7 +16518,7 @@ license:CC0
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<software name="highsped" supported="partial">
|
||||
<software name="highsped">
|
||||
<description>High Speed (Euro)</description>
|
||||
<year>1994</year>
|
||||
<publisher>Tradewest</publisher>
|
||||
@ -28848,7 +28848,7 @@ license:CC0
|
||||
</part>
|
||||
</software>
|
||||
|
||||
<software name="pinbotu" cloneof="pinbot" supported="partial">
|
||||
<software name="pinbotu" cloneof="pinbot">
|
||||
<description>Pin-Bot (USA)</description>
|
||||
<year>1990</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
@ -28871,7 +28871,7 @@ license:CC0
|
||||
</software>
|
||||
|
||||
<!-- Glitched in NTSC -->
|
||||
<software name="pinbot" supported="partial">
|
||||
<software name="pinbot">
|
||||
<description>Pin-Bot (Euro)</description>
|
||||
<year>1990</year>
|
||||
<publisher>Nintendo</publisher>
|
||||
|
@ -250,12 +250,12 @@ void nes_event2_device::write_m(offs_t offset, u8 data)
|
||||
m_prgram[offset % m_prgram.size()] = data;
|
||||
}
|
||||
|
||||
void nes_event2_device::set_chr(u8 chr, int chr_base, int chr_mask)
|
||||
void nes_event2_device::chr_cb(int start, int bank, int source)
|
||||
{
|
||||
if (m_tqrom_mode)
|
||||
nes_tqrom_device::set_chr(chr, chr_base, chr_mask);
|
||||
nes_tqrom_device::chr_cb(start, bank, source);
|
||||
else
|
||||
nes_txrom_device::set_chr(chr, chr_base, chr_mask);
|
||||
nes_txrom_device::chr_cb(start, bank, source);
|
||||
}
|
||||
|
||||
|
||||
|
@ -51,6 +51,7 @@ public:
|
||||
virtual void write_l(offs_t offset, u8 data) override;
|
||||
virtual u8 read_m(offs_t offset) override;
|
||||
virtual void write_m(offs_t offset, u8 data) override;
|
||||
virtual void chr_cb(int start, int bank, int source) override;
|
||||
|
||||
virtual void pcb_reset() override;
|
||||
|
||||
@ -60,8 +61,6 @@ protected:
|
||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int param) override;
|
||||
virtual ioport_constructor device_input_ports() const override;
|
||||
|
||||
virtual void set_chr(u8 chr, int chr_base, int chr_mask) override;
|
||||
|
||||
required_ioport m_dsw;
|
||||
|
||||
bool m_tqrom_mode;
|
||||
|
@ -495,33 +495,18 @@ void nes_txsrom_device::write_h(offs_t offset, u8 data)
|
||||
|
||||
iNES: mapper 119
|
||||
|
||||
In MESS: Supported. It also uses mmc3_irq.
|
||||
In MAME: Supported. It also uses mmc3_irq.
|
||||
|
||||
-------------------------------------------------*/
|
||||
|
||||
void nes_tqrom_device::set_chr( uint8_t chr, int chr_base, int chr_mask )
|
||||
void nes_tqrom_device::chr_cb(int start, int bank, int source)
|
||||
{
|
||||
uint8_t chr_page = (m_latch & 0x80) >> 5;
|
||||
uint8_t src[6], mask[6];
|
||||
|
||||
// TQROM ignores the source, base and mask set by the MMC3 and determines them based on vrom bank bits
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
src[i] = (m_mmc_vrom_bank[i] & 0x40) ? CHRRAM : CHRROM;
|
||||
mask[i] = (m_mmc_vrom_bank[i] & 0x40) ? 0x07 : 0x3f;
|
||||
}
|
||||
|
||||
chr1_x(chr_page ^ 0, ((m_mmc_vrom_bank[0] & ~0x01) & mask[0]), src[0]);
|
||||
chr1_x(chr_page ^ 1, ((m_mmc_vrom_bank[0] | 0x01) & mask[0]), src[0]);
|
||||
chr1_x(chr_page ^ 2, ((m_mmc_vrom_bank[1] & ~0x01) & mask[1]), src[1]);
|
||||
chr1_x(chr_page ^ 3, ((m_mmc_vrom_bank[1] | 0x01) & mask[1]), src[1]);
|
||||
chr1_x(chr_page ^ 4, (m_mmc_vrom_bank[2] & mask[2]), src[2]);
|
||||
chr1_x(chr_page ^ 5, (m_mmc_vrom_bank[3] & mask[3]), src[3]);
|
||||
chr1_x(chr_page ^ 6, (m_mmc_vrom_bank[4] & mask[4]), src[4]);
|
||||
chr1_x(chr_page ^ 7, (m_mmc_vrom_bank[5] & mask[5]), src[5]);
|
||||
if (BIT(bank, 6))
|
||||
chr1_x(start, bank & 0x07, CHRRAM);
|
||||
else
|
||||
chr1_x(start, bank & 0x3f, CHRROM);
|
||||
}
|
||||
|
||||
|
||||
/*-------------------------------------------------
|
||||
|
||||
NES-QJ board (MMC3 variant for US 2-in-1 Nintendo cart
|
||||
|
@ -107,11 +107,11 @@ public:
|
||||
// construction/destruction
|
||||
nes_tqrom_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
virtual void chr_cb(int start, int bank, int source) override;
|
||||
|
||||
protected:
|
||||
// construction/destruction
|
||||
nes_tqrom_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, u32 clock);
|
||||
|
||||
virtual void set_chr(u8 chr, int chr_base, int chr_mask) override;
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user