hyperscan: added quickload support.

This commit is contained in:
Sandro Ronco 2022-08-23 19:57:35 +02:00
parent 74fa8ec158
commit c25246cd26
3 changed files with 24 additions and 1 deletions

View file

@ -285,7 +285,7 @@ Arch Linux
Youll need a few prerequisites from your distro:: Youll need a few prerequisites from your distro::
sudo pacman -S base-devel git sdl2 gconf sdl2_ttf gcc qt5 sudo pacman -S base-devel git sdl2_ttf python libxinerama libpulse alsa-lib qt5-base
Compilation is exactly as described above in All Platforms. Compilation is exactly as described above in All Platforms.

View file

@ -16,6 +16,7 @@ DEFINE_DEVICE_TYPE(SPG290_TIMER, spg290_timer_device, "spg290_timer", "SPG290 Ti
spg290_timer_device::spg290_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock) spg290_timer_device::spg290_timer_device(const machine_config &mconfig, const char *tag, device_t *owner, uint32_t clock)
: device_t(mconfig, SPG290_TIMER, tag, owner, clock) : device_t(mconfig, SPG290_TIMER, tag, owner, clock)
, m_irq_cb(*this) , m_irq_cb(*this)
, m_enabled(false)
{ {
} }

View file

@ -71,6 +71,7 @@
#include "emu.h" #include "emu.h"
#include "cpu/score/score.h" #include "cpu/score/score.h"
#include "imagedev/snapquik.h"
#include "machine/spg290_cdservo.h" #include "machine/spg290_cdservo.h"
#include "machine/spg290_i2c.h" #include "machine/spg290_i2c.h"
#include "machine/spg290_ppu.h" #include "machine/spg290_ppu.h"
@ -110,6 +111,8 @@ private:
uint32_t spg290_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect); uint32_t spg290_screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect);
DECLARE_QUICKLOAD_LOAD_MEMBER(quickload_hyper_exe);
void spg290_mem(address_map &map); void spg290_mem(address_map &map);
void spg290_bios_mem(address_map &map); void spg290_bios_mem(address_map &map);
@ -426,6 +429,23 @@ void spg29x_zone3d_game_state::machine_reset()
} }
QUICKLOAD_LOAD_MEMBER(spg29x_game_state::quickload_hyper_exe)
{
const uint32_t length = image.length();
std::unique_ptr<u8 []> ptr;
if (image.fread(ptr, length) != length)
return image_init_result::FAIL;
auto &space = m_maincpu->space(AS_PROGRAM);
for (uint32_t i = 0; i < length; i++)
space.write_byte(0xa00901fc + i, ptr[i]);
m_maincpu->set_state_int(SCORE_PC, 0xa0091000); // Game entry point
return image_init_result::PASS;
}
void spg29x_game_state::spg29x(machine_config &config) void spg29x_game_state::spg29x(machine_config &config)
{ {
/* basic machine hardware */ /* basic machine hardware */
@ -472,6 +492,8 @@ void spg29x_game_state::hyperscan(machine_config &config)
SOFTWARE_LIST(config, "cd_list").set_original("hyperscan"); SOFTWARE_LIST(config, "cd_list").set_original("hyperscan");
SOFTWARE_LIST(config, "card_list").set_original("hyperscan_card"); SOFTWARE_LIST(config, "card_list").set_original("hyperscan_card");
QUICKLOAD(config, "quickload", "exe").set_load_callback(FUNC(spg29x_game_state::quickload_hyper_exe));
} }
void spg29x_nand_game_state::nand_init(int blocksize, int blocksize_stripped) void spg29x_nand_game_state::nand_init(int blocksize, int blocksize_stripped)