diff --git a/core/hw/maple/maple_jvs.cpp b/core/hw/maple/maple_jvs.cpp index 73da76dd8..643857437 100644 --- a/core/hw/maple/maple_jvs.cpp +++ b/core/hw/maple/maple_jvs.cpp @@ -220,6 +220,20 @@ protected: digOutput = newOutput; } + virtual void read_lightgun(int playerNum, u32 buttons, u16& x, u16& y) + { + if ((buttons & NAOMI_RELOAD_KEY) != 0) + { + x = 0; + y = 0; + } + else + { + x = mapleInputState[playerNum].absPos.x; + y = mapleInputState[playerNum].absPos.y; + } + } + u32 player_count = 0; u32 digital_in_count = 0; u32 coin_input_count = 0; @@ -365,6 +379,19 @@ public: { light_gun_count = 1; } + + void read_lightgun(int playerNum, u32 buttons, u16& x, u16& y) override + { + jvs_837_13844::read_lightgun(playerNum, buttons, x, y); + + if ((buttons & NAOMI_BTN0_KEY) != 0) + { + // any >= 0x1000 value works after calibration (tduno, tduno2) + // no value seems to fully work before :( + x |= 0xf000; + y |= 0xf000; + } + } }; class jvs_837_13844_motor_board : public jvs_837_13844 @@ -1821,18 +1848,9 @@ u32 jvs_io_board::handle_jvs_message(u8 *buffer_in, u32 length_in, u8 *buffer_ou // Channel number (1-based) is in jvs_request[cmdi + 1] int playerNum = first_player + buffer_in[cmdi + 1] - 1; - s16 x; - s16 y; - if ((buttons[playerNum] & NAOMI_RELOAD_KEY) != 0) - { - x = 0; - y = 0; - } - else - { - x = mapleInputState[playerNum].absPos.x; - y = mapleInputState[playerNum].absPos.y; - } + u16 x; + u16 y; + read_lightgun(playerNum, buttons[playerNum], x, y); LOGJVS("lightgun %4x,%4x ", x, y); JVS_OUT(x >> 8); // X, MSB JVS_OUT(x); // X, LSB diff --git a/core/hw/naomi/naomi_roms.cpp b/core/hw/naomi/naomi_roms.cpp index 5c8f5075e..941112aa1 100644 --- a/core/hw/naomi/naomi_roms.cpp +++ b/core/hw/naomi/naomi_roms.cpp @@ -481,7 +481,10 @@ const Game Games[] = //ROM_LOAD( "25lc040.ic13s", 0, 0x200, CRC(6291605c) SHA1(44f757da4814b08108d1a4f431c9a39c38acecb2) ) { NULL, 0, 0 }, - } + }, + nullptr, + nullptr, + tduno2_eeprom_dump, }, // Virtua Tennis 2 / Power Smash 2 (Rev A) { @@ -3438,7 +3441,10 @@ const Game Games[] = //ROM_LOAD( "x76f100.ic37", 0x000000, 0x000084, CRC(c79251d5) SHA1(3e70bbbb6d28bade7eec7e27d716463045656f98) ) { NULL, 0, 0 }, - } + }, + nullptr, + nullptr, + tduno_eeprom_dump, }, // Tokyo Bus (Rev A) { diff --git a/core/hw/naomi/naomi_roms_eeprom.h b/core/hw/naomi/naomi_roms_eeprom.h index 3e880bc21..ec4719d3a 100644 --- a/core/hw/naomi/naomi_roms_eeprom.h +++ b/core/hw/naomi/naomi_roms_eeprom.h @@ -594,4 +594,28 @@ static u8 vtennisg_eeprom_dump[] { 0x00, 0x00, }; +// printer disabled, touchscreen calibrated +static u8 tduno_eeprom_dump[] { + 0x5f, 0xdc, 0x10, 0x42, 0x41, 0x50, 0x31, 0x09, 0x00, 0x1a, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, + 0x5f, 0xdc, 0x10, 0x42, 0x41, 0x50, 0x31, 0x09, 0x00, 0x1a, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, + 0xc4, 0x10, 0x18, 0x18, 0xc4, 0x10, 0x18, 0x18, 0x14, 0x00, 0x14, 0x00, 0x16, 0x00, 0x16, 0x00, 0x97, 0x6d, + 0x80, 0x3f, 0xa4, 0x4a, 0x80, 0x3f, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x14, 0x00, 0x14, 0x00, + 0x16, 0x00, 0x16, 0x00, 0x97, 0x6d, 0x80, 0x3f, 0xa4, 0x4a, 0x80, 0x3f, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, +}; + +// printer disabled, touchscreen calibrated +static u8 tduno2_eeprom_dump[] { + 0x8a, 0xd3, 0x10, 0x42, 0x42, 0x48, 0x32, 0x09, 0x00, 0x1a, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, + 0x8a, 0xd3, 0x10, 0x42, 0x42, 0x48, 0x32, 0x09, 0x00, 0x1a, 0x01, 0x01, 0x01, 0x00, 0x11, 0x11, 0x11, 0x11, + 0xd1, 0xbd, 0x18, 0x18, 0xd1, 0xbd, 0x18, 0x18, 0x28, 0x00, 0x28, 0x00, 0x2a, 0x00, 0x29, 0x00, 0xbe, 0xeb, + 0x80, 0x3f, 0xaa, 0xa4, 0x80, 0x3f, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x28, 0x00, 0x28, 0x00, + 0x2a, 0x00, 0x29, 0x00, 0xbe, 0xeb, 0x80, 0x3f, 0xaa, 0xa4, 0x80, 0x3f, 0x00, 0x00, 0x01, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x4c, 0x27, 0xab, 0x37, 0x7e, 0x03, 0x49, 0x54, 0x78, 0x45, 0x61, 0x7a, 0xa3, 0x52, 0xfc, 0xca, + 0xcb, 0x64, 0xbc, 0xe5, 0xa5, 0x68, 0x16, 0x42, 0x69, 0x4e, 0x4c, 0xe8, 0xfc, 0x82, 0x81, 0x78, 0xa6, 0x25, + 0x63, 0x46, +}; + #endif /* CORE_HW_NAOMI_NAOMI_ROMS_EEPROM_H_ */