bus/nes: Fixed 2A03PURITANS board not booting when <1024k. (#9210)

New working software list additions (nes.xml)
-----------------------------------
Famicompo Pico [rainwarrior]
This commit is contained in:
0kmg 2022-01-25 17:59:21 -09:00 committed by GitHub
parent a5dbadc2e5
commit 472785c2c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 27 additions and 11 deletions

View File

@ -79363,6 +79363,22 @@ be better to redump them properly. -->
</part>
</software>
<software name="famipico">
<description>Famicompo Pico</description>
<year>2014</year>
<publisher>Infinite NES Lives</publisher>
<part name="cart" interface="nes_cart">
<feature name="slot" value="2a03pur" />
<feature name="mirroring" value="horizontal" />
<dataarea name="prg" size="524288">
<rom name="pico.prg" size="524288" crc="0eb47d80" sha1="5a71e9936045df6408926fe9d5d97cd60af359b7" status="baddump" />
</dataarea>
<!-- 8k VRAM on cartridge -->
<dataarea name="vram" size="8192">
</dataarea>
</part>
</software>
<software name="glider">
<description>Glider</description>
<year>2008</year>

View File

@ -34,7 +34,7 @@
DEFINE_DEVICE_TYPE(NES_2A03PURITANS, nes_2a03pur_device, "nes_2a03pur", "NES Cart 2A03 Puritans Album PCB")
nes_2a03pur_device::nes_2a03pur_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
nes_2a03pur_device::nes_2a03pur_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock)
: nes_nrom_device(mconfig, NES_2A03PURITANS, tag, owner, clock)
{
}
@ -45,8 +45,8 @@ void nes_2a03pur_device::device_start()
{
common_start();
save_item(NAME(m_reg));
memset(m_reg, 0x00, sizeof(m_reg));
m_reg[7] = 0xff & ((m_prg_chunks << 2) - 1);
std::fill(std::begin(m_reg), std::end(m_reg), 0x00);
m_reg[7] = 0xff;
}
void nes_2a03pur_device::pcb_reset()
@ -93,17 +93,17 @@ void nes_2a03pur_device::pcb_reset()
This has been assigned to iNES mapper 31.
-------------------------------------------------*/
void nes_2a03pur_device::write_l(offs_t offset, uint8_t data)
void nes_2a03pur_device::write_l(offs_t offset, u8 data)
{
LOG_MMC(("2a03 puritans write_l, offset: %04x, data: %02x\n", offset, data));
offset += 0x100;
if (offset >= 0x1000)
m_reg[offset & 7] = data & ((m_prg_chunks << 2) - 1);
m_reg[offset & 7] = data;
}
uint8_t nes_2a03pur_device::read_h(offs_t offset)
u8 nes_2a03pur_device::read_h(offs_t offset)
{
LOG_MMC(("2a03 puritans read_h, offset: %04x\n", offset));
return m_prg[(m_reg[(offset >> 12) & 7] * 0x1000) + (offset & 0x0fff)];
return m_prg[((m_reg[BIT(offset, 12, 3)] * 0x1000) + (offset & 0x0fff)) & (m_prg_size - 1)];
}

View File

@ -14,10 +14,10 @@ class nes_2a03pur_device : public nes_nrom_device
{
public:
// construction/destruction
nes_2a03pur_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock);
nes_2a03pur_device(const machine_config &mconfig, const char *tag, device_t *owner, u32 clock);
virtual uint8_t read_h(offs_t offset) override;
virtual void write_l(offs_t offset, uint8_t data) override;
virtual u8 read_h(offs_t offset) override;
virtual void write_l(offs_t offset, u8 data) override;
virtual void pcb_reset() override;
@ -26,7 +26,7 @@ protected:
virtual void device_start() override;
private:
uint8_t m_reg[8];
u8 m_reg[8];
};