Fix Test and LGJS patch
This commit is contained in:
parent
a1c71144f4
commit
9e85557edf
@ -358,8 +358,8 @@ int initConfig()
|
||||
config.width = 1024;
|
||||
config.height = 768;
|
||||
config.crc32 = elf_crc;
|
||||
config.region = US;
|
||||
config.freeplay = 1;
|
||||
config.region = -1;
|
||||
config.freeplay = -1;
|
||||
if (detectGame(config.crc32) != 0)
|
||||
{
|
||||
printf("Warning: Unsure what game this is, using default configuration values.\n");
|
||||
|
@ -6,7 +6,7 @@
|
||||
#include "eeprom_settings.h"
|
||||
#include "config.h"
|
||||
|
||||
#define I2C_SMBUS_BLOCK_MAX 32
|
||||
#define I2C_SMBUS_BLOCK_MAX 32
|
||||
#define I2C_GET_FUNCTIONS 0x705
|
||||
#define I2C_SMBUS_TRANSFER 0x720
|
||||
#define I2C_SET_SLAVE_MODE 0x703
|
||||
@ -15,17 +15,19 @@
|
||||
#define I2C_SEEK 2
|
||||
#define I2C_WRITE 3
|
||||
|
||||
union i2c_smbus_data {
|
||||
uint8_t byte;
|
||||
uint16_t word;
|
||||
uint8_t block[I2C_SMBUS_BLOCK_MAX + 2];
|
||||
union i2c_smbus_data
|
||||
{
|
||||
uint8_t byte;
|
||||
uint16_t word;
|
||||
uint8_t block[I2C_SMBUS_BLOCK_MAX + 2];
|
||||
};
|
||||
|
||||
struct i2c_smbus_ioctl_data {
|
||||
uint8_t read_write;
|
||||
uint8_t command;
|
||||
uint32_t size;
|
||||
union i2c_smbus_data *data;
|
||||
struct i2c_smbus_ioctl_data
|
||||
{
|
||||
uint8_t read_write;
|
||||
uint8_t command;
|
||||
uint32_t size;
|
||||
union i2c_smbus_data *data;
|
||||
};
|
||||
|
||||
FILE *eeprom = NULL;
|
||||
@ -47,19 +49,24 @@ int initEeprom()
|
||||
|
||||
eeprom = fopen(eepromPath, "rb+");
|
||||
|
||||
if(eepromSettingsInit(eeprom) !=0)
|
||||
if (eepromSettingsInit(eeprom) != 0)
|
||||
{
|
||||
printf("Error initializing eeprom settings.");
|
||||
fclose(eeprom);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if(getRegion() != getConfig()->region)
|
||||
setRegion(eeprom, getConfig()->region);
|
||||
|
||||
if(getFreeplay() != getConfig()->freeplay)
|
||||
setFreeplay(eeprom, getConfig()->freeplay);
|
||||
|
||||
if (getConfig->region != -1)
|
||||
{
|
||||
if (getRegion() != getConfig()->region)
|
||||
setRegion(eeprom, getConfig()->region);
|
||||
}
|
||||
|
||||
if (getConfig()->freeplay != -1)
|
||||
{
|
||||
if (getFreeplay() != getConfig()->freeplay)
|
||||
setFreeplay(eeprom, getConfig()->freeplay);
|
||||
}
|
||||
fseek(eeprom, 0, SEEK_SET);
|
||||
|
||||
return 0;
|
||||
|
@ -163,11 +163,9 @@ int XNextEvent(Display *display, XEvent *event_return)
|
||||
{
|
||||
case 28:
|
||||
setSwitch(SYSTEM, BUTTON_TEST, event_return->type == KeyPress);
|
||||
// securityBoardSetSwitch(BUTTON_TEST, event_return->type == KeyPress);
|
||||
break;
|
||||
case 39:
|
||||
setSwitch(PLAYER_1, BUTTON_SERVICE, event_return->type == KeyPress);
|
||||
// securityBoardSetSwitch(BUTTON_SERVICE, event_return->type == KeyPress);
|
||||
break;
|
||||
case 14:
|
||||
incrementCoin(PLAYER_1, event_return->type == KeyPress);
|
||||
|
@ -32,7 +32,7 @@ int initJVS()
|
||||
io.capabilities.players = 2;
|
||||
io.capabilities.analogueInBits = 8;
|
||||
io.capabilities.rightAlignBits = 0;
|
||||
io.capabilities.analogueInChannels = 20;
|
||||
io.capabilities.analogueInChannels = 8;
|
||||
io.capabilities.generalPurposeOutputs = 20;
|
||||
io.capabilities.commandVersion = 19;
|
||||
io.capabilities.jvsVersion = 48;
|
||||
@ -261,8 +261,6 @@ JVSStatus processPacket()
|
||||
outputPacket.data[outputPacket.length + 1] = io.state.inputSwitch[0];
|
||||
outputPacket.length += 2;
|
||||
|
||||
//printf("SW=%08d\r", io.state.inputSwitch[0]);
|
||||
|
||||
for (int i = 0; i < inputPacket.data[index + 1]; i++)
|
||||
{
|
||||
for (int j = 0; j < inputPacket.data[index + 2]; j++)
|
||||
|
@ -473,7 +473,7 @@ int initPatch()
|
||||
detourFunction(0x084e537d, amDongleUpdate);
|
||||
setVariable(0x080d1f02, 0x90909090); // Patch acpSystem::checkDongle
|
||||
setVariable(0x080d1f06, 0xE8C3C990); // Patch acpSystem::checkDongle
|
||||
setVariable(0x0807b76a, 0xc2839090); // Patch initializeArcadeBackup
|
||||
setVariable(0x0807b76d, 0xc2839090); // Patch initializeArcadeBackup
|
||||
// Fixes
|
||||
detourFunction(0x084e500e, amDipswGetData);
|
||||
detourFunction(0x084e5086, stubRetZero); // Stub amDipswSetLed
|
||||
@ -510,7 +510,8 @@ int initPatch()
|
||||
detourFunction(0x08510600, amDongleUpdate);
|
||||
setVariable(0x080dad63, 0x90909090); // Patch acpSystem::checkDongle
|
||||
setVariable(0x080dad67, 0xE8C3C990); // Patch acpSystem::checkDongle
|
||||
setVariable(0x0807e609, 0xc2839090); // Patch initializeArcadeBackup
|
||||
setVariable(0x0807e609, 0x90909090); // Patch initializeArcadeBackup
|
||||
setVariable(0x0807e60d, 0xc2839090); // Patch initializeArcadeBackup
|
||||
// Fixes
|
||||
detourFunction(0x08510256, amDipswGetData);
|
||||
detourFunction(0x085102ce, stubRetZero); // Stub amDipswSetLed
|
||||
@ -626,6 +627,8 @@ int initPatch()
|
||||
break;
|
||||
case VT3_TESTMODE:
|
||||
{
|
||||
// Debug
|
||||
detourFunction(0x08054d14, _putConsole); // Crashes the game sometimes.
|
||||
// Security
|
||||
detourFunction(0x0815f610, amDongleInit);
|
||||
detourFunction(0x0815f923, amDongleIsAvailable);
|
||||
|
Loading…
Reference in New Issue
Block a user