Syntax error and fix for some games that do not support Freeplay.
This commit is contained in:
parent
711e27f489
commit
38f81fb887
BIN
src/libkswapapi/libkswapapi.o
Normal file
BIN
src/libkswapapi/libkswapapi.o
Normal file
Binary file not shown.
@ -430,8 +430,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 with CRC 0x%X is. Please submit this new game to the GitHub repository: https://github.com/bobbydilley/lindbergh-loader/issues/new?title=Please+add+new+game+0x%X&body=I+tried+to+launch+the+following+game:\n", config.crc32, config.crc32);
|
||||
|
@ -15,13 +15,15 @@
|
||||
#define I2C_SEEK 2
|
||||
#define I2C_WRITE 3
|
||||
|
||||
union i2c_smbus_data {
|
||||
union i2c_smbus_data
|
||||
{
|
||||
uint8_t byte;
|
||||
uint16_t word;
|
||||
uint8_t block[I2C_SMBUS_BLOCK_MAX + 2];
|
||||
};
|
||||
|
||||
struct i2c_smbus_ioctl_data {
|
||||
struct i2c_smbus_ioctl_data
|
||||
{
|
||||
uint8_t read_write;
|
||||
uint8_t command;
|
||||
uint32_t size;
|
||||
@ -54,11 +56,27 @@ int initEeprom()
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (getConfig()->region != -1)
|
||||
{
|
||||
if (getRegion() != getConfig()->region)
|
||||
setRegion(eeprom, getConfig()->region);
|
||||
}
|
||||
|
||||
if (getConfig()->freeplay != -1)
|
||||
{
|
||||
if (getFreeplay() != getConfig()->freeplay)
|
||||
setFreeplay(eeprom, getConfig()->freeplay);
|
||||
}
|
||||
|
||||
if ((getConfig()->game == LETS_GO_JUNGLE_SPECIAL) || (getConfig()->game == THE_HOUSE_OF_THE_DEAD_EX) || (getConfig()->game == THE_HOUSE_OF_THE_DEAD_4_SPECIAL))
|
||||
{
|
||||
if (fixCreditSection(eeprom) != 0)
|
||||
{
|
||||
printf("Error initializing eeprom settings.");
|
||||
fclose(eeprom);
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
fseek(eeprom, 0, SEEK_SET);
|
||||
|
||||
|
@ -199,6 +199,19 @@ int setFreeplay(FILE *eeprom, int freeplay)
|
||||
return 0;
|
||||
}
|
||||
|
||||
int fixCreditSection(FILE *eeprom)
|
||||
{
|
||||
eepromBuffer[eepromOffsetTable[CREDIT].offset + 36] = 0;
|
||||
eepromBuffer[eepromOffsetTable[CREDIT].offset + 39] = 0;
|
||||
addCRCtoBuffer(CREDIT);
|
||||
if (writeSectiontoFile(eeprom, CREDIT) != 0)
|
||||
{
|
||||
printf("Error setting Free Play.");
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int eepromSettingsInit( FILE *eeprom)
|
||||
{
|
||||
build_crc32_table();
|
||||
|
@ -3,3 +3,4 @@ int getRegion();
|
||||
int getFreeplay();
|
||||
int setRegion(FILE *eeprom, int region);
|
||||
int setFreeplay(FILE *eeprom, int freeplay);
|
||||
int fixCreditSection(FILE *eeprom);
|
||||
|
@ -35,7 +35,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;
|
||||
@ -266,8 +266,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++)
|
||||
@ -569,8 +567,6 @@ JVSStatus readPacket(JVSPacket *packet)
|
||||
*/
|
||||
JVSStatus writePacket(JVSPacket *packet)
|
||||
{
|
||||
|
||||
|
||||
/* Get pointer to raw data in packet */
|
||||
unsigned char *packetPointer = (unsigned char *)packet;
|
||||
|
||||
|
@ -494,7 +494,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
|
||||
@ -532,7 +532,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
|
||||
@ -648,6 +649,8 @@ int initPatch()
|
||||
break;
|
||||
case VIRTUA_TENNIS_3_TEST:
|
||||
{
|
||||
// Debug
|
||||
detourFunction(0x08054d14, _putConsole); // Crashes the game sometimes.
|
||||
// Security
|
||||
detourFunction(0x0815f610, amDongleInit);
|
||||
detourFunction(0x0815f923, amDongleIsAvailable);
|
||||
|
Loading…
Reference in New Issue
Block a user