Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Robbbert committed Sep 11, 2024
2 parents b3e2b99 + 46a34c1 commit e1ada39
Show file tree
Hide file tree
Showing 31 changed files with 1,155 additions and 356 deletions.
69 changes: 44 additions & 25 deletions hash/supracan.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ license:CC0-1.0
<publisher>AV Artisan Corp.</publisher>
<notes><![CDATA[
[video] intro uses circular clipping effect
[video] layer 0 won't show left side character, scrollx = 0x0080 + global flip x
[video] wrong tilemap paging for layer 1 on game over
[sound] noisy channels 13-15 starting from character screen, supposed to release after a while (12 00 0f 79)
]]></notes>
<info name="serial" value="F001" />
<info name="alt_title" value="福爾摩沙大對決" />
<part name="cart" interface="supracan_cart">
<part name="cart" interface="superacan_cart">
<dataarea name="rom" width="16" endianness="big" size="0x100000">
<rom loadflag="load16_word_swap" name="Formosa Duel (Taiwan).bin" size="0x100000" crc="b2bf31dc" sha1="8d0680e1322af21b20d5cee2c100b05cf4217815" offset="0" />
</dataarea>
Expand All @@ -27,14 +27,13 @@ license:CC0-1.0
<year>1995</year>
<publisher>Panda Entertainment Technology</publisher>
<notes><![CDATA[
[video] sprites may need buffering (noticeable on gameplay jumps)
[video] sprites may need buffering (noticeable on gameplay jumps, verify)
[video] intro raster effect is slightly off (btanb)
[irq 5] 2nd fighter stage used with global flip y + mosaic (lake effect)
[video] enables clipping effect during ending and credits
]]></notes>
<info name="serial" value="F002" />
<info name="alt_title" value="三國志 武將爭霸" />
<part name="cart" interface="supracan_cart">
<part name="cart" interface="superacan_cart">
<dataarea name="rom" width="16" endianness="big" size="3145728">
<rom loadflag="load16_word_swap" name="sangofgt.bin" size="3145728" crc="a4de6dde" sha1="f4bed63775130a75eb9c50b32e0cf50d1a7b8f50" offset="0" />
</dataarea>
Expand All @@ -50,14 +49,17 @@ Uses [video] blending during attract and title screen
Wrong [video] ROZ paging for title screen
Broken [video] during intro, uses bitmap mode
[video] uses per-tile priority during gameplay
[sound] BGM during intro releases few keys too early (TODO: pinpoint which)
]]></notes>
<info name="serial" value="F003" />
<info name="alt_title" value="邪惡之子" />
<part name="cart" interface="supracan_cart">
<!-- TODO: sram -->
<part name="cart" interface="superacan_cart">
<dataarea name="rom" width="16" endianness="big" size="2097152">
<rom loadflag="load16_word_swap" name="16005.cu5" size="2097152" crc="9f6119a7" sha1="67ae9e7f99e1c3054ea54d53dbbba7792ef45134" offset="0" />
</dataarea>
<!-- TODO: unconfirmed size -->
<dataarea name="nvram" size="0x8000">
</dataarea>
</part>
</software>

Expand All @@ -68,11 +70,13 @@ Broken [video] during intro, uses bitmap mode
<notes><![CDATA[
[video] intro should sprite clip against active display area.
[video] title animation blanks some sprites.
[video] uses per-tile priority during gameplay
[video] uses per-tile priority during gameplay.
[sound] noisy channels 13-15 when jump occurs (12 00 0f 79)
[sound] jump (1f 0f 0e a9) and attack (1f 00 0f 69) channels 11-12 keeps repeating
]]></notes>
<info name="serial" value="F004" />
<info name="alt_title" value="音速飛龍" />
<part name="cart" interface="supracan_cart">
<part name="cart" interface="superacan_cart">
<dataarea name="rom" width="16" endianness="big" size="2097152">
<rom loadflag="load16_word_swap" name="speedydgn.bin" size="2097152" crc="f631383c" sha1="fbd62b5d287aa82ef27f400ab2a6b3da0308192a" offset="0" />
</dataarea>
Expand All @@ -84,15 +88,19 @@ Broken [video] during intro, uses bitmap mode
<year>1995</year>
<publisher>C&amp;E Soft</publisher>
<notes><![CDATA[
[video] ROZ is misaligned during intro, and initially concealed
[video] ROZ is misaligned during intro, and initially concealed (blending?).
[sound] missing crowd noise during gameplay, tries to play an empty buffer in the $2xxx range.
[sound] DMA driven samples cuts off too early.
]]></notes>
<info name="serial" value="F005" />
<info name="alt_title" value="超級中華職棒聯盟" />
<part name="cart" interface="supracan_cart">
<!-- TODO: sram -->
<part name="cart" interface="superacan_cart">
<dataarea name="rom" width="16" endianness="big" size="2097152">
<rom loadflag="load16_word_swap" name="16005.0" size="2097152" crc="ccf6829b" sha1="17a413803d8749fbe9643ca56d703afd64569b9f" offset="0" />
</dataarea>
<!-- TODO: unconfirmed size -->
<dataarea name="nvram" size="0x8000">
</dataarea>
</part>
</software>

Expand All @@ -101,11 +109,11 @@ Broken [video] during intro, uses bitmap mode
<year>1995</year>
<publisher>Funtech</publisher>
<notes><![CDATA[
Can potentially hang, [maincpu] tight loops for $e80300 bit 7 high
Can potentially hang, [maincpu] tight loops for $e80300 bit 7 high (verify)
]]></notes>
<info name="serial" value="F006" />
<info name="alt_title" value="嘻遊記" />
<part name="cart" interface="supracan_cart">
<part name="cart" interface="superacan_cart">
<dataarea name="rom" width="16" endianness="big" size="2097152">
<rom loadflag="load16_word_swap" name="16002.cu2" size="2097152" crc="cee25eea" sha1="fc82fc3a7d55571494cd62d8807160e22cf437bc" offset="0" />
</dataarea>
Expand All @@ -122,12 +130,15 @@ Can potentially hang, [maincpu] tight loops for $e80300 bit 7 high
]]></notes>
<info name="serial" value="F007" />
<info name="alt_title" value="超級光明戰史" />
<part name="cart" interface="supracan_cart">
<!-- TODO: sram -->
<part name="cart" interface="superacan_cart">
<dataarea name="rom" width="16" endianness="big" size="3145728">
<rom loadflag="load16_word_swap" name="16007.0" size="2097152" crc="56c1c3fb" sha1="249e2ad6d8d40ecd31eda5a1bd5e5d0f47174a27" offset="000000" />
<rom loadflag="load16_word_swap" name="08007.1" size="1048576" crc="fc79f05f" sha1="7ce2e23ea3fd25764935708be4d47bf1a9843938" offset="0x200000" />
</dataarea>

<!-- TODO: unconfirmed size -->
<dataarea name="nvram" size="0x8000">
</dataarea>
</part>
</software>

Expand All @@ -137,11 +148,14 @@ Can potentially hang, [maincpu] tight loops for $e80300 bit 7 high
<publisher>Panda Entertainment Technology</publisher>
<info name="serial" value="F008" />
<info name="alt_title" value="非洲探險" />
<part name="cart" interface="supracan_cart">
<!-- TODO: sram -->
<part name="cart" interface="superacan_cart">
<dataarea name="rom" width="16" endianness="big" size="1048576">
<rom loadflag="load16_word_swap" name="08003.bin" size="1048576" crc="dc3b7b84" sha1="6dcbd7923203da7892915595d65ee668afbf0339" offset="0" />
</dataarea>

<!-- TODO: unconfirmed size -->
<dataarea name="nvram" size="0x8000">
</dataarea>
</part>
</software>

Expand All @@ -150,16 +164,21 @@ Can potentially hang, [maincpu] tight loops for $e80300 bit 7 high
<year>1996</year>
<publisher>Funtech</publisher>
<notes><![CDATA[
[video] intro has a glitchy cloud row strip
[video] intro shows some vertical strips of garbage when title screen dragon appears
Erratic gameplay speed, controls [irq 3] as FRC, can potentially hang
[video] intro has a glitchy cloud row strip.
[video] intro shows some vertical strips of garbage when title screen dragon appears.
Erratic gameplay speed, controls [irq 3] as FRC, show [video] missing/glitched tiles in gameplay.
]]></notes>
<info name="serial" value="F009" />
<info name="alt_title" value="賭霸" />
<part name="cart" interface="supracan_cart">
<part name="cart" interface="superacan_cart">
<dataarea name="rom" width="16" endianness="big" size="2097152">
<rom loadflag="load16_word_swap" name="16006.bin" size="2097152" crc="ac4fa721" sha1="0fda223817f0b50f0ce9687076d29df3d1b86960" offset="0" />
</dataarea>

<!-- TODO: unconfirmed size and actual presence -->
<!-- Story mode would be impossible to run in one setting otherwise? -->
<dataarea name="nvram" size="0x8000">
</dataarea>
</part>
</software>

Expand All @@ -168,14 +187,14 @@ Erratic gameplay speed, controls [irq 3] as FRC, can potentially hang
<year>1996</year>
<publisher>Funtech</publisher>
<notes><![CDATA[
Erratic gameplay speed, controls [irq 3] as FRC
Erratic gameplay speed, controls [irq 3] as FRC, [sound] BGM plays random tune on title
[video] use layer 1 as clipping effect (sprites goes under it)
[video] character select has misaligned sprites
[video] billiard cue sprite cut off left side (should wraparound)
]]></notes>
<info name="serial" value="F010" />
<info name="alt_title" value="魔棒撞球" />
<part name="cart" interface="supracan_cart">
<part name="cart" interface="superacan_cart">
<dataarea name="rom" width="16" endianness="big" size="2097152">
<rom loadflag="load16_word_swap" name="08004.bin" size="2097152" crc="aed4e4f8" sha1="6be79db9006c46ea21f5dbe1add755ce2e413796" offset="0" />
</dataarea>
Expand All @@ -192,7 +211,7 @@ Uses [video] clipping for layer 1 during intro

<info name="serial" value="F011" />
<info name="alt_title" value="爆爆動物園" />
<part name="cart" interface="supracan_cart">
<part name="cart" interface="superacan_cart">
<dataarea name="rom" width="16" endianness="big" size="524288">
<rom loadflag="load16_word_swap" name="boomzoo.bin" size="524288" crc="6099bb44" sha1="0b5fbe2117bb77a827453c5489b3af691e5c7ade" offset="0" />
</dataarea>
Expand Down
16 changes: 16 additions & 0 deletions scripts/src/bus.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2010,6 +2010,8 @@ if (BUSES["MSX_SLOT"]~=null) then
MAME_DIR .. "src/devices/bus/msx/slot/music.h",
MAME_DIR .. "src/devices/bus/msx/slot/panasonic08.cpp",
MAME_DIR .. "src/devices/bus/msx/slot/panasonic08.h",
MAME_DIR .. "src/devices/bus/msx/slot/panasonic08r.cpp",
MAME_DIR .. "src/devices/bus/msx/slot/panasonic08r.h",
MAME_DIR .. "src/devices/bus/msx/slot/rom.cpp",
MAME_DIR .. "src/devices/bus/msx/slot/rom.h",
MAME_DIR .. "src/devices/bus/msx/slot/ram.cpp",
Expand Down Expand Up @@ -2576,6 +2578,20 @@ if (BUSES["SS50"]~=null) then
}
end

---------------------------------------------------
--
--@src/devices/bus/supracan/slot.h,BUSES["SUPRACAN"] = true
---------------------------------------------------

if (BUSES["SUPRACAN"]~=null) then
files {
MAME_DIR .. "src/devices/bus/supracan/slot.cpp",
MAME_DIR .. "src/devices/bus/supracan/slot.h",
MAME_DIR .. "src/devices/bus/supracan/rom.cpp",
MAME_DIR .. "src/devices/bus/supracan/rom.h",
}
end


---------------------------------------------------
--
Expand Down
5 changes: 3 additions & 2 deletions src/devices/bus/msx/slot/fs4600.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,11 @@ void msx_slot_fs4600_device::device_start()
fatalerror("Memory region '%s' is too small for the FS4600 firmware\n", m_rom_region.finder_tag());
}

m_sram.resize(SRAM_SIZE);
m_nvram->set_base(m_sram.data(), SRAM_SIZE);
m_sram = std::make_unique<u8[]>(SRAM_SIZE);
m_nvram->set_base(&m_sram[0], SRAM_SIZE);

save_item(NAME(m_sram_address));
save_pointer(NAME(m_sram), SRAM_SIZE);

for (int i = 0; i < 3; i++)
m_rombank[i]->configure_entries(0, 0x40, m_rom_region->base() + m_region_offset, 0x4000);
Expand Down
2 changes: 1 addition & 1 deletion src/devices/bus/msx/slot/fs4600.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class msx_slot_fs4600_device : public device_t, public msx_internal_slot_interfa
memory_view m_view[3];
u32 m_region_offset;
u32 m_sram_address;
std::vector<u8> m_sram;
std::unique_ptr<u8[]> m_sram;
};


Expand Down
22 changes: 12 additions & 10 deletions src/devices/bus/msx/slot/fsa1fm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,26 @@ void msx_slot_fsa1fm2_device::device_start()
fatalerror("Memory region '%s' is not the correct size for the FS-A1FM firmware\n", m_rom_region.finder_tag());
}

m_ram.resize(RAM_SIZE);
m_empty_bank.resize(8 * 1024);
m_ram = std::make_unique<u8[]>(RAM_SIZE);
m_empty_bank = std::make_unique<u8[]>(8 * 1024);
for (int i = 0; i < 8 * 1024; i++)
m_empty_bank[i] = 0xff;

save_item(NAME(m_selected_bank));
save_item(NAME(m_control));
save_item(NAME(m_ram_active));
save_pointer(m_ram.data(), "ram", RAM_SIZE);
save_pointer(NAME(m_ram), m_size);

for (int i = 0; i < 6; i++)
{
m_bank[i]->configure_entries(0, 0x80, m_rom_region->base() + m_region_offset, 0x2000);
m_bank[i]->configure_entries(0x80, 0x80, m_rom_region->base() + m_region_offset, 0x2000);
for (int j = 0; j < 4; j++)
{
m_bank[i]->configure_entry(0x80 + j, m_empty_bank.data()); // 0x80-0x83 empty
m_bank[i]->configure_entry(0x84 + j, m_ram.data()); // 0x84-0x87 ram
m_bank[i]->configure_entry(0x88 + j, m_empty_bank.data()); // 0x88-0x8b empty
m_bank[i]->configure_entry(0x8c + j, m_ram.data()); // 0x8c-0x8f ram
m_bank[i]->configure_entry(0x80 + j, &m_empty_bank[0]); // 0x80-0x83 empty
m_bank[i]->configure_entry(0x84 + j, &m_ram[0]); // 0x84-0x87 ram
m_bank[i]->configure_entry(0x88 + j, &m_empty_bank[0]); // 0x88-0x8b empty
m_bank[i]->configure_entry(0x8c + j, &m_ram[0]); // 0x8c-0x8f ram
}
}

Expand Down Expand Up @@ -182,14 +182,16 @@ void msx_slot_fsa1fm_device::device_start()
fatalerror("Memory region '%s' is not the correct size for the FS-A1FM firmware\n", m_rom_region.finder_tag());
}

m_sram.resize(SRAM_SIZE);
m_nvram->set_base(m_sram.data(), SRAM_SIZE);
m_sram = std::make_unique<u8[]>(SRAM_SIZE);
m_nvram->set_base(&m_sram[0], SRAM_SIZE);

save_pointer(NAME(m_sram), SRAM_SIZE);

m_rombank->configure_entries(0, 16, m_rom_region->base(), 0x2000);

page(1)->install_read_bank(0x4000, 0x5fff, m_rombank);
// SRAM is always visible?
page(1)->install_ram(0x6000, 0x7fff, m_sram.data());
page(1)->install_ram(0x6000, 0x7fff, &m_sram[0]);
page(1)->install_write_handler(0x7fc0, 0x7fc0, emu::rw_delegate(*m_i8251, FUNC(i8251_device::data_w)));
page(1)->install_read_handler(0x7fc0, 0x7fc0, emu::rw_delegate(*m_i8251, FUNC(i8251_device::data_r)));
page(1)->install_write_handler(0x7fc1, 0x7fc1, emu::rw_delegate(*m_i8251, FUNC(i8251_device::control_w)));
Expand Down
6 changes: 3 additions & 3 deletions src/devices/bus/msx/slot/fsa1fm.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ class msx_slot_fsa1fm2_device : public device_t, public msx_internal_slot_interf
uint8_t m_selected_bank[6];
bool m_ram_active[6];
uint8_t m_control;
std::vector<uint8_t> m_ram;
std::vector<uint8_t> m_empty_bank;
std::unique_ptr<u8[]> m_ram;
std::unique_ptr<u8[]> m_empty_bank;
};


Expand Down Expand Up @@ -76,7 +76,7 @@ class msx_slot_fsa1fm_device : public device_t, public msx_internal_slot_interfa
required_memory_region m_rom_region;
memory_bank_creator m_rombank;
u32 m_region_offset;
std::vector<u8> m_sram;
std::unique_ptr<u8[]> m_sram;
};


Expand Down
19 changes: 10 additions & 9 deletions src/devices/bus/msx/slot/msx_rs232.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,21 +255,21 @@ void msx_slot_rs232_sony_device::device_start()
{
msx_slot_rs232_base_device::device_start();

m_ram.resize(RAM_SIZE);
save_item(NAME(m_ram));
m_ram = std::make_unique<u8[]>(RAM_SIZE);
save_pointer(NAME(m_ram), RAM_SIZE);

// TODO unmap rom from page 0
page(0)->install_ram(0x2000, 0x27ff, m_ram.data());
page(0)->install_ram(0x2000, 0x27ff, &m_ram[0]);
page(1)->install_rom(0x4000, 0x5fff, m_rom_region->base() + m_region_offset);
page(1)->install_ram(0x6000, 0x67ff, m_ram.data());
page(2)->install_ram(0xa000, 0xa7ff, m_ram.data());
page(1)->install_ram(0x6000, 0x67ff, &m_ram[0]);
page(2)->install_ram(0xa000, 0xa7ff, &m_ram[0]);
page(2)->install_read_handler(0xbff8, 0xbff9, emu::rw_delegate(*m_i8251, FUNC(i8251_device::read)));
page(2)->install_write_handler(0xbff8, 0xbff9, emu::rw_delegate(*m_i8251, FUNC(i8251_device::write)));
page(2)->install_read_handler(0xbffa, 0xbffa, emu::rw_delegate(*this, FUNC(msx_slot_rs232_sony_device::status_r)));
page(2)->install_write_handler(0xbffa, 0xbffa, emu::rw_delegate(*this, FUNC(msx_slot_rs232_sony_device::irq_mask_w)));
page(2)->install_read_handler(0xbffc, 0xbfff, emu::rw_delegate(*m_i8253, FUNC(pit8253_device::read)));
page(2)->install_write_handler(0xbffc, 0xbfff, emu::rw_delegate(*m_i8253, FUNC(pit8253_device::write)));
page(3)->install_ram(0xe000, 0xe7ff, m_ram.data());
page(3)->install_ram(0xe000, 0xe7ff, &m_ram[0]);
}

u8 msx_slot_rs232_sony_device::status_r(offs_t offset)
Expand Down Expand Up @@ -454,18 +454,19 @@ void msx_slot_rs232_toshiba_hx3x_device::device_start()
io_space().install_readwrite_handler(0x82, 0x82, emu::rw_delegate(*this, FUNC(msx_slot_rs232_toshiba_hx3x_device::status_r)), emu::rw_delegate(*this, FUNC(msx_slot_rs232_toshiba_hx3x_device::irq_mask_w)));
io_space().install_readwrite_handler(0x84, 0x87, emu::rw_delegate(*m_i8253, FUNC(pit8253_device::read)), emu::rw_delegate(*m_i8253, FUNC(pit8253_device::write)));

m_sram.resize(SRAM_SIZE);
m_nvram->set_base(m_sram.data(), SRAM_SIZE);
m_sram = std::make_unique<u8[]>(SRAM_SIZE);
m_nvram->set_base(&m_sram[0], SRAM_SIZE);

save_item(NAME(m_bank_reg));
save_pointer(NAME(m_sram), SRAM_SIZE);

m_rombank->configure_entries(0, 4, m_rom_region->base() + m_region_offset + 0x4000, 0x4000);

page(1)->install_write_handler(0x7fff, 0x7fff, emu::rw_delegate(*this, FUNC(msx_slot_rs232_toshiba_hx3x_device::bank_w)));
page(1)->install_read_handler(0x7fff, 0x7fff, emu::rw_delegate(*this, FUNC(msx_slot_rs232_toshiba_hx3x_device::bank_r)));
page(2)->install_view(0x8000, 0xbfff, m_view);
m_view[0].install_read_bank(0x8000, 0xbfff, m_rombank);
m_view[1].install_ram(0x8000, 0x87ff, 0x3800, m_sram.data());
m_view[1].install_ram(0x8000, 0x87ff, 0x3800, &m_sram[0]);
}

void msx_slot_rs232_toshiba_hx3x_device::device_reset()
Expand Down
4 changes: 2 additions & 2 deletions src/devices/bus/msx/slot/msx_rs232.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class msx_slot_rs232_sony_device : public msx_slot_rs232_base_device
static constexpr size_t RAM_SIZE = 0x800;

required_ioport m_switch_port;
std::vector<u8> m_ram;
std::unique_ptr<u8[]> m_ram;
};


Expand Down Expand Up @@ -152,7 +152,7 @@ class msx_slot_rs232_toshiba_hx3x_device : public msx_slot_rs232_base_device
required_device<nvram_device> m_nvram;
memory_bank_creator m_rombank;
memory_view m_view;
std::vector<u8> m_sram;
std::unique_ptr<u8[]> m_sram;
u8 m_bank_reg;
};

Expand Down
Loading

0 comments on commit e1ada39

Please sign in to comment.