summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/chihiro.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mame/drivers/chihiro.cpp')
-rw-r--r--src/mame/drivers/chihiro.cpp41
1 files changed, 19 insertions, 22 deletions
diff --git a/src/mame/drivers/chihiro.cpp b/src/mame/drivers/chihiro.cpp
index d705a2f97de..53072f144fd 100644
--- a/src/mame/drivers/chihiro.cpp
+++ b/src/mame/drivers/chihiro.cpp
@@ -540,8 +540,8 @@ class chihiro_state : public xbox_base_state
public:
chihiro_state(const machine_config &mconfig, device_type type, const char *tag) :
xbox_base_state(mconfig, type, tag),
- usbhack_index(-1),
- usbhack_counter(0),
+ hack_index(-1),
+ hack_counter(0),
dimm_board_memory(nullptr),
dimm_board_memory_size(0) { }
@@ -560,8 +560,8 @@ public:
bus_master_ide_controller_device *ide;
naomi_gdrom_board *dimmboard;
} chihiro_devs;
- int usbhack_index;
- int usbhack_counter;
+ int hack_index;
+ int hack_counter;
uint8_t *dimm_board_memory;
uint32_t dimm_board_memory_size;
@@ -731,26 +731,25 @@ void chihiro_state::hack_eeprom()
static const struct
{
const char *game_name;
- const bool disable_usb;
struct {
uint32_t address;
uint8_t write_byte;
} modify[16];
-} hacks[HACK_ITEMS] = { { "chihiro", false, { { 0x6a79f/*3f79f*/, 0x01 }, { 0x6a7a0/*3f7a0*/, 0x00 }, { 0x6b575/*40575*/, 0x00 }, { 0x6b576/*40576*/, 0x00 }, { 0x6b5af/*405af*/, 0x75 }, { 0x6b78a/*4078a*/, 0x75 }, { 0x6b7ca/*407ca*/, 0x00 }, { 0x6b7b8/*407b8*/, 0x00 }, { 0x8f5b2, 0x75 }, { 0x79a9e/*2ea9e*/, 0x74 }, { 0x79b80/*2eb80*/, 0xeb }, { 0x79b97/*2eb97*/, 0x74 }, { 0, 0 } } },
- { "outr2", false, { { 0, 0 } } },
- { "crtaxihr", false, { { 0x14ada5/*11fda5*/, 0x90 },{ 0x14ada6/*11fda6*/, 0x90 }, { 0, 0 } } },
- { "ghostsqu", false, { { 0x78833/*4d833*/, 0x90 },{ 0x78834/*4d834*/, 0x90 }, { 0, 0 } } },
- { "vcop3", false, { { 0x61a23/*36a23*/, 0x90 },{ 0x61a24/*36a24*/, 0x90 }, { 0, 0 } } },
+} hacks[HACK_ITEMS] = { { "chihiro", { { 0x6a79f/*3f79f*/, 0x01 }, { 0x6a7a0/*3f7a0*/, 0x00 }, { 0x6b575/*40575*/, 0x00 }, { 0x6b576/*40576*/, 0x00 }, { 0x6b5af/*405af*/, 0x75 }, { 0x6b78a/*4078a*/, 0x75 }, { 0x6b7ca/*407ca*/, 0x00 }, { 0x6b7b8/*407b8*/, 0x00 }, { 0x8f5b2, 0x75 }, { 0x79a9e/*2ea9e*/, 0x74 }, { 0x79b80/*2eb80*/, 0xeb }, { 0x79b97/*2eb97*/, 0x74 }, { 0, 0 } } },
+ { "outr2", { { 0, 0 } } },
+ { "crtaxihr", { { 0x14ada5/*11fda5*/, 0x90 }, { 0x14ada6/*11fda6*/, 0x90 }, { 0, 0 } } },
+ { "ghostsqu", { { 0x78833/*4d833*/, 0x90 }, { 0x78834/*4d834*/, 0x90 }, { 0, 0 } } },
+ { "vcop3", { { 0x61a23/*36a23*/, 0x90 }, { 0x61a24/*36a24*/, 0x90 }, { 0, 0 } } },
};
void chihiro_state::hack_usb()
{
int p;
- if ((usbhack_counter == 0) && (usb_hack_enabled))
- p = 0;
- else if (usbhack_counter == 1) // after game loaded
- p = usbhack_index;
+ if (hack_counter == 0)
+ p = 0; // need to patch the kernel
+ else if (hack_counter == 1)
+ p = hack_index; // need to patch the game
else
p = -1;
if (p >= 0) {
@@ -760,7 +759,7 @@ void chihiro_state::hack_usb()
m_maincpu->space(0).write_byte(hacks[p].modify[a].address, hacks[p].modify[a].write_byte);
}
}
- usbhack_counter++;
+ hack_counter++;
}
//**************************************************************************
@@ -1734,15 +1733,13 @@ void chihiro_state::machine_start()
using namespace std::placeholders;
machine().debugger().console().register_command("chihiro", CMDFLAG_NONE, 0, 1, 4, std::bind(&chihiro_state::debug_commands, this, _1, _2));
}
- usbhack_index = -1;
+ hack_index = -1;
for (int a = 1; a < HACK_ITEMS; a++)
if (strcmp(machine().basename(), hacks[a].game_name) == 0) {
- usbhack_index = a;
- if (hacks[a].disable_usb == true)
- usb_hack_enabled = true;
+ hack_index = a;
break;
}
- usbhack_counter = 0;
+ hack_counter = 0;
usb_device1 = machine().device<ohci_hlean2131qc_device>("ohci_hlean2131qc");
usb_device1->initialize(machine(), ohci_usb);
usb_device1->set_region_base(memregion(":others")->base()); // temporary
@@ -1752,7 +1749,7 @@ void chihiro_state::machine_start()
usb_device2->set_region_base(memregion(":others")->base() + 0x2080); // temporary
ohci_usb->usb_ohci_plug(2, usb_device2); // connect
// savestates
- save_item(NAME(usbhack_counter));
+ save_item(NAME(hack_counter));
}
static SLOT_INTERFACE_START(ide_baseboard)
@@ -1775,7 +1772,7 @@ static MACHINE_CONFIG_DERIVED_CLASS(chihiro_base, xbox_base, chihiro_state)
MCFG_DEVICE_ADD("ohci_hlean2131sc", OHCI_HLEAN2131SC, 0)
MCFG_DEVICE_ADD("jvs_master", JVS_MASTER, 0)
MCFG_SEGA_837_13551_DEVICE_ADD("837_13551", "jvs_master", ":TILT", ":P1", ":P2", ":A0", ":A1", ":A2", ":A3", ":A4", ":A5", ":A6", ":A7", ":OUTPUT")
- MACHINE_CONFIG_END
+MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED(chihirogd, chihiro_base)
MCFG_NAOMI_GDROM_BOARD_ADD("rom_board", ":gdrom", "^pic", nullptr, NOOP)