From 10cefb7c618df7745eae297bf4c68598683e7c92 Mon Sep 17 00:00:00 2001 From: Ian Curtis Date: Mon, 29 Jan 2018 19:31:23 +0000 Subject: [PATCH] Support both types of lightgun in lost world. 2nd type fixes some missing fx. Thanks to Any for pointing this out. To use the old type change analog_gun1 to gun1 in the xml file. --- Config/Games.xml | 4 ++-- Src/Model3/Model3.cpp | 18 +++++++++++++++--- Src/OSD/SDL/Main.cpp | 2 +- Src/Version.h | 2 +- 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Config/Games.xml b/Config/Games.xml index a531568..61b43e5 100644 --- a/Config/Games.xml +++ b/Config/Games.xml @@ -918,8 +918,8 @@ 1.5 - - + + diff --git a/Src/Model3/Model3.cpp b/Src/Model3/Model3.cpp index 276139b..9fabbe7 100644 --- a/Src/Model3/Model3.cpp +++ b/Src/Model3/Model3.cpp @@ -520,7 +520,12 @@ UINT8 CModel3::ReadInputs(unsigned reg) return serialFIFO2; case 0x34: // Serial FIFO full/empty flags - return 0x0C; + if (m_game.inputs & (Game::INPUT_GUN1 | Game::INPUT_GUN2)) { + return 0x0C; + } + else { + return 0; + } case 0x3C: // ADC @@ -541,12 +546,19 @@ UINT8 CModel3::ReadInputs(unsigned reg) adc[1] = (UINT8)Inputs->analogJoyX->value; } - if ((m_game.inputs & Game::INPUT_ANALOG_GUN1)||(m_game.inputs & Game::INPUT_ANALOG_GUN2)) + if (m_game.inputs & (Game::INPUT_ANALOG_GUN1 | Game::INPUT_ANALOG_GUN2)) { adc[0] = (UINT8)Inputs->analogGunX[0]->value; adc[2] = (UINT8)Inputs->analogGunY[0]->value; adc[1] = (UINT8)Inputs->analogGunX[1]->value; adc[3] = (UINT8)Inputs->analogGunY[1]->value; + + if (m_game.name == "lostwsga") { // to do, not a string compare + adc[0] = (UINT8)Inputs->analogGunX[0]->value; // order is different for some reason in lost world + adc[1] = 255 - (UINT8)Inputs->analogGunY[0]->value; // why are values inverted? is this the wrong place to fix this + adc[2] = (UINT8)Inputs->analogGunX[1]->value; + adc[3] = 255 - (UINT8)Inputs->analogGunY[1]->value; + } } if ((m_game.inputs & Game::INPUT_SKI)) @@ -850,7 +862,7 @@ void CModel3::WriteSystemRegister(unsigned reg, UINT8 data) case 0x0D: case 0x0E: case 0x0F: - case 0x1C: // LED control? + case 0x1C: // LED control break; default: //DebugLog("System register %02X=%02X\n", reg, data); diff --git a/Src/OSD/SDL/Main.cpp b/Src/OSD/SDL/Main.cpp index ec565bd..702ab15 100644 --- a/Src/OSD/SDL/Main.cpp +++ b/Src/OSD/SDL/Main.cpp @@ -1333,7 +1333,7 @@ static Util::Config::Node DefaultConfig() static void Title(void) { puts("Supermodel: A Sega Model 3 Arcade Emulator (Version " SUPERMODEL_VERSION ")"); - puts("Copyright 2011-2017 by Bart Trzynadlowski, Nik Henson, and Ian Curtis\n"); + puts("Copyright 2011-2018 by Bart Trzynadlowski, Nik Henson, Ian Curtis, Harry Tuttle and Spindizzi\n"); } static void Help(void) diff --git a/Src/Version.h b/Src/Version.h index e3ee7e5..60b7922 100644 --- a/Src/Version.h +++ b/Src/Version.h @@ -28,6 +28,6 @@ #ifndef INCLUDED_VERSION_H #define INCLUDED_VERSION_H -#define SUPERMODEL_VERSION "0.3a-WIP" +#define SUPERMODEL_VERSION "0.7-WIP" #endif // INCLUDED_SUPERMODEL_H