Merge remote-tracking branch 'libretro/master'

Signed-off-by: Rafael Kitover <rkitover@gmail.com>
This commit is contained in:
Rafael Kitover 2022-11-18 00:24:23 +00:00
commit 8f1b5dae90
No known key found for this signature in database
GPG Key ID: 08AB596679D86240
31 changed files with 2004 additions and 497 deletions

View File

@ -24,9 +24,9 @@ struct EmulatedSystem {
bool (*emuWriteBattery)(const char *); bool (*emuWriteBattery)(const char *);
#ifdef __LIBRETRO__ #ifdef __LIBRETRO__
// load state // load state
bool (*emuReadState)(const uint8_t *, unsigned); bool (*emuReadState)(const uint8_t *);
// load state // load state
unsigned (*emuWriteState)(uint8_t *, unsigned); unsigned (*emuWriteState)(uint8_t *);
#else #else
// load state // load state
bool (*emuReadState)(const char *); bool (*emuReadState)(const char *);

View File

@ -307,6 +307,7 @@ void utilPutWord(uint8_t *p, uint16_t value)
*p = (value >> 8) & 255; *p = (value >> 8) & 255;
} }
#ifndef __LIBRETRO__
bool utilWriteBMPFile(const char *fileName, int w, int h, uint8_t *pix) bool utilWriteBMPFile(const char *fileName, int w, int h, uint8_t *pix)
{ {
uint8_t writeBuffer[512 * 3]; uint8_t writeBuffer[512 * 3];
@ -425,6 +426,7 @@ bool utilWriteBMPFile(const char *fileName, int w, int h, uint8_t *pix)
return true; return true;
} }
#endif /* !__LIBRETRO__ */
extern bool cpuIsMultiBoot; extern bool cpuIsMultiBoot;

View File

@ -26,8 +26,10 @@ std::string get_xdg_user_config_home();
std::string get_xdg_user_data_home(); std::string get_xdg_user_data_home();
void utilReadScreenPixels(uint8_t *dest, int w, int h); void utilReadScreenPixels(uint8_t *dest, int w, int h);
#ifndef __LIBRETRO__
bool utilWritePNGFile(const char *, int, int, uint8_t *); bool utilWritePNGFile(const char *, int, int, uint8_t *);
bool utilWriteBMPFile(const char *, int, int, uint8_t *); bool utilWriteBMPFile(const char *, int, int, uint8_t *);
#endif
void utilApplyIPS(const char *ips, uint8_t **rom, int *size); void utilApplyIPS(const char *ips, uint8_t **rom, int *size);
bool utilIsGBAImage(const char *); bool utilIsGBAImage(const char *);
bool utilIsGBImage(const char *); bool utilIsGBImage(const char *);

View File

@ -218,6 +218,7 @@ void Gb_Apu::run_until_( blip_time_t end_time )
case 6: case 6:
// 128 Hz // 128 Hz
square1.clock_sweep(); square1.clock_sweep();
/* fallthrough */
case 0: case 0:
case 4: case 4:
// 256 Hz // 256 Hz

View File

@ -1582,7 +1582,7 @@ void gbWriteMemory(uint16_t address, uint8_t value)
} }
inBios = false; inBios = false;
} }
} } break;
// HDMA1 // HDMA1
case 0x51: { case 0x51: {
@ -1776,7 +1776,7 @@ void gbWriteMemory(uint16_t address, uint8_t value)
gbMemory[0xff70] = register_SVBK = value; gbMemory[0xff70] = register_SVBK = value;
return; return;
} }
} } break;
case 0x75: { case 0x75: {
gbMemory[0xff75] = 0x8f | value; gbMemory[0xff75] = 0x8f | value;
@ -4093,7 +4093,6 @@ bool gbReadSaveState(const char* name)
return res; return res;
} }
#endif // !__LIBRETRO__
bool gbWritePNGFile(const char* fileName) bool gbWritePNGFile(const char* fileName)
{ {
@ -4108,6 +4107,7 @@ bool gbWriteBMPFile(const char* fileName)
return utilWriteBMPFile(fileName, 256, 224, pix); return utilWriteBMPFile(fileName, 256, 224, pix);
return utilWriteBMPFile(fileName, 160, 144, pix); return utilWriteBMPFile(fileName, 160, 144, pix);
} }
#endif // !__LIBRETRO__
void gbCleanUp() void gbCleanUp()
{ {
@ -5521,7 +5521,7 @@ bool gbLoadRomData(const char* data, unsigned size)
#ifdef __LIBRETRO__ #ifdef __LIBRETRO__
#include <stddef.h> #include <stddef.h>
unsigned int gbWriteSaveState(uint8_t* data, unsigned) unsigned int gbWriteSaveState(uint8_t* data)
{ {
uint8_t* orig = data; uint8_t* orig = data;
@ -5589,7 +5589,7 @@ unsigned int gbWriteSaveState(uint8_t* data, unsigned)
return (ptrdiff_t)data - (ptrdiff_t)orig; return (ptrdiff_t)data - (ptrdiff_t)orig;
} }
bool gbReadSaveState(const uint8_t* data, unsigned) bool gbReadSaveState(const uint8_t* data)
{ {
int version = utilReadIntMem(data); int version = utilReadIntMem(data);
@ -5654,7 +5654,7 @@ bool gbReadSaveState(const uint8_t* data, unsigned)
utilReadMem(&IFF, data, 2); utilReadMem(&IFF, data, 2);
if (gbSgbMode) { if (gbSgbMode) {
gbSgbReadGame(data, version); gbSgbReadGame(data);
} else { } else {
gbSgbMask = 0; // loading a game at the wrong time causes no display gbSgbMask = 0; // loading a game at the wrong time causes no display
} }
@ -5796,7 +5796,7 @@ bool gbReadSaveState(const uint8_t* data, unsigned)
gbMemoryMap[0x0d] = &gbWram[value * 0x1000]; gbMemoryMap[0x0d] = &gbWram[value * 0x1000];
} }
gbSoundReadGame(data, version); gbSoundReadGame(data);
if (gbCgbMode && gbSgbMode) { if (gbCgbMode && gbSgbMode) {
gbSgbMode = 0; gbSgbMode = 0;
@ -5829,27 +5829,7 @@ bool gbReadSaveState(const uint8_t* data, unsigned)
return true; return true;
} }
#endif /* __LIBRETRO__ */
bool gbWriteMemSaveState(char*, int, long&)
{
return false;
}
bool gbReadMemSaveState(char*, int)
{
return false;
}
bool gbReadBatteryFile(const char*)
{
return false;
}
bool gbWriteBatteryFile(const char*)
{
return false;
}
#endif
struct EmulatedSystem GBSystem = { struct EmulatedSystem GBSystem = {
// emuMain // emuMain
@ -5858,6 +5838,16 @@ struct EmulatedSystem GBSystem = {
gbReset, gbReset,
// emuCleanUp // emuCleanUp
gbCleanUp, gbCleanUp,
#ifdef __LIBRETRO__
NULL, // emuReadBattery
NULL, // emuWriteBattery
gbReadSaveState, // emuReadState
gbWriteSaveState, // emuWriteState
NULL, // emuReadMemState
NULL, // emuWriteMemState
NULL, // emuWritePNG
NULL, // emuWriteBMP
#else
// emuReadBattery // emuReadBattery
gbReadBatteryFile, gbReadBatteryFile,
// emuWriteBattery // emuWriteBattery
@ -5874,6 +5864,7 @@ struct EmulatedSystem GBSystem = {
gbWritePNGFile, gbWritePNGFile,
// emuWriteBMP // emuWriteBMP
gbWriteBMPFile, gbWriteBMPFile,
#endif /* ! __LIBRETRO__ */
// emuUpdateCPSR // emuUpdateCPSR
NULL, NULL,
// emuHasDebugger // emuHasDebugger

View File

@ -99,7 +99,7 @@ void gbCheatsReadGameSkip(gzFile gzFile, int version)
} }
} }
} }
#endif #endif /* __LIBRETRO__ */
void gbCheatsSaveCheatList(const char* file) void gbCheatsSaveCheatList(const char* file)
{ {

View File

@ -1016,7 +1016,8 @@ mapperHuC3RTC gbRTCHuC3 = {
0, // DateTime 0, // DateTime
0, // WritingTime 0, // WritingTime
0, // ModeFlag 0, // ModeFlag
0 // ClockShift 0, // ClockShift
{ 0 }
}; };
void memoryUpdateHuC3Latch() { void memoryUpdateHuC3Latch() {

View File

@ -896,7 +896,7 @@ void gbSgbSaveGame(uint8_t*& data)
utilWriteMem(data, gbSgbATFList, 45 * 20 * 18); utilWriteMem(data, gbSgbATFList, 45 * 20 * 18);
} }
void gbSgbReadGame(const uint8_t*& data, int version) void gbSgbReadGame(const uint8_t*& data)
{ {
utilReadDataMem(data, gbSgbSaveStructV3); utilReadDataMem(data, gbSgbSaveStructV3);

View File

@ -10,7 +10,7 @@ void gbSgbDoBitTransfer(uint8_t);
void gbSgbRenderBorder(); void gbSgbRenderBorder();
#ifdef __LIBRETRO__ #ifdef __LIBRETRO__
void gbSgbSaveGame(uint8_t*&); void gbSgbSaveGame(uint8_t*&);
void gbSgbReadGame(const uint8_t*&, int); void gbSgbReadGame(const uint8_t*&);
#else #else
void gbSgbSaveGame(gzFile); void gbSgbSaveGame(gzFile);
void gbSgbReadGame(gzFile, int version); void gbSgbReadGame(gzFile, int version);

View File

@ -393,7 +393,7 @@ static void gbSoundReadGameOld(int version, gzFile gzFile)
memcpy(&s.regs[0x20], &gbMemory[0xFF30], 0x10); // wave memcpy(&s.regs[0x20], &gbMemory[0xFF30], 0x10); // wave
} }
#endif #endif // ! __LIBRETRO__
// New state format // New state format
static variable_desc gb_state[] = { static variable_desc gb_state[] = {
@ -429,11 +429,8 @@ static variable_desc gb_state[] = {
{ NULL, 0 } { NULL, 0 }
}; };
#ifdef __LIBRETRO__ #ifndef __LIBRETRO__
void gbSoundSaveGame(uint8_t*& out)
#else
void gbSoundSaveGame(gzFile out) void gbSoundSaveGame(gzFile out)
#endif
{ {
gb_apu->save_state(&state.apu); gb_apu->save_state(&state.apu);
@ -441,31 +438,43 @@ void gbSoundSaveGame(gzFile out)
memset(dummy_state, 0, sizeof dummy_state); memset(dummy_state, 0, sizeof dummy_state);
state.version = 1; state.version = 1;
#ifdef __LIBRETRO__
utilWriteDataMem(out, gb_state);
#else
utilWriteData(out, gb_state); utilWriteData(out, gb_state);
#endif
} }
#ifdef __LIBRETRO__
void gbSoundReadGame(const uint8_t*& in, int version)
#else
void gbSoundReadGame(int version, gzFile in) void gbSoundReadGame(int version, gzFile in)
#endif
{ {
// Prepare APU and default state // Prepare APU and default state
reset_apu(); reset_apu();
gb_apu->save_state(&state.apu); gb_apu->save_state(&state.apu);
#ifdef __LIBRETRO__
utilReadDataMem(in, gb_state);
#else
if (version > 11) if (version > 11)
utilReadData(in, gb_state); utilReadData(in, gb_state);
else else
gbSoundReadGameOld(version, in); gbSoundReadGameOld(version, in);
#endif
gb_apu->load_state(state.apu); gb_apu->load_state(state.apu);
} }
#endif // ! __LIBRETRO__
#ifdef __LIBRETRO__
void gbSoundSaveGame(uint8_t*& out)
{
gb_apu->save_state(&state.apu);
// Be sure areas for expansion get written as zero
memset(dummy_state, 0, sizeof dummy_state);
state.version = 1;
utilWriteDataMem(out, gb_state);
}
void gbSoundReadGame(const uint8_t*& in)
{
// Prepare APU and default state
reset_apu();
gb_apu->save_state(&state.apu);
utilReadDataMem(in, gb_state);
gb_apu->load_state(state.apu);
}
#endif // __LIBRETRO__

View File

@ -70,7 +70,7 @@ extern int soundTicks; // Number of 16.8 MHz clocks until gbSoundTick() will be
// Saves/loads emulator state // Saves/loads emulator state
#ifdef __LIBRETRO__ #ifdef __LIBRETRO__
void gbSoundSaveGame(uint8_t*&); void gbSoundSaveGame(uint8_t*&);
void gbSoundReadGame(const uint8_t*&, int); void gbSoundReadGame(const uint8_t*&);
#else #else
void gbSoundSaveGame(gzFile out); void gbSoundSaveGame(gzFile out);
void gbSoundReadGame(int version, gzFile in); void gbSoundReadGame(int version, gzFile in);

View File

@ -1086,10 +1086,11 @@ int cheatsCheckKeys(uint32_t keys, uint32_t extended)
break; break;
case GSA_32_BIT_WRITE_IOREGS: case GSA_32_BIT_WRITE_IOREGS:
if (cheatsList[i].address <= 0x3FF) { if (cheatsList[i].address <= 0x3FF) {
if (((cheatsList[i].address & 0x3FC) != 0x6) && ((cheatsList[i].address & 0x3FC) != 0x130)) uint32_t cheat_addr = cheatsList[i].address & 0x3FC;
ioMem[cheatsList[i].address & 0x3FC] = (cheatsList[i].value & 0xFFFF); if ((cheat_addr != 6) && (cheat_addr != 0x130))
if ((((cheatsList[i].address & 0x3FC) + 2) != 0x6) && ((cheatsList[i].address & 0x3FC) + 2) != 0x130) ioMem[cheat_addr] = (cheatsList[i].value & 0xFFFF);
ioMem[(cheatsList[i].address & 0x3FC) + 2] = ((cheatsList[i].value >> 16) & 0xFFFF); if (((cheat_addr + 2) != 0x6) && (cheat_addr + 2) != 0x130)
ioMem[cheat_addr + 2] = ((cheatsList[i].value >> 16) & 0xFFFF);
} }
break; break;
case GSA_8_BIT_IF_TRUE3: case GSA_8_BIT_IF_TRUE3:
@ -1352,6 +1353,7 @@ void cheatsDelete(int number, bool restore)
} else { } else {
CPUWriteMemory(cheatsList[x].address, cheatsList[x].oldValue); CPUWriteMemory(cheatsList[x].address, cheatsList[x].oldValue);
} }
/* fallthrough */
case GSA_16_BIT_ROM_PATCH: case GSA_16_BIT_ROM_PATCH:
if (cheatsList[x].status & 1) { if (cheatsList[x].status & 1) {
cheatsList[x].status &= ~1; cheatsList[x].status &= ~1;
@ -2823,9 +2825,9 @@ static uint8_t cheatsGetType(uint32_t address)
} }
#endif #endif
#ifdef BKPT_SUPPORT
void cheatsWriteMemory(uint32_t address, uint32_t value) void cheatsWriteMemory(uint32_t address, uint32_t value)
{ {
#ifdef BKPT_SUPPORT
if (cheatsNumber == 0) { if (cheatsNumber == 0) {
int type = cheatsGetType(address); int type = cheatsGetType(address);
uint32_t oldValue = debuggerReadMemory(address); uint32_t oldValue = debuggerReadMemory(address);
@ -2835,12 +2837,10 @@ void cheatsWriteMemory(uint32_t address, uint32_t value)
} }
debuggerWriteMemory(address, value); debuggerWriteMemory(address, value);
} }
#endif
} }
void cheatsWriteHalfWord(uint32_t address, uint16_t value) void cheatsWriteHalfWord(uint32_t address, uint16_t value)
{ {
#ifdef BKPT_SUPPORT
if (cheatsNumber == 0) { if (cheatsNumber == 0) {
int type = cheatsGetType(address); int type = cheatsGetType(address);
uint16_t oldValue = debuggerReadHalfWord(address); uint16_t oldValue = debuggerReadHalfWord(address);
@ -2850,12 +2850,10 @@ void cheatsWriteHalfWord(uint32_t address, uint16_t value)
} }
debuggerWriteHalfWord(address, value); debuggerWriteHalfWord(address, value);
} }
#endif
} }
void cheatsWriteByte(uint32_t address, uint8_t value) void cheatsWriteByte(uint32_t address, uint8_t value)
{ {
#ifdef BKPT_SUPPORT
if (cheatsNumber == 0) { if (cheatsNumber == 0) {
int type = cheatsGetType(address); int type = cheatsGetType(address);
uint8_t oldValue = debuggerReadByte(address); uint8_t oldValue = debuggerReadByte(address);
@ -2865,5 +2863,5 @@ void cheatsWriteByte(uint32_t address, uint8_t value)
} }
debuggerWriteByte(address, value); debuggerWriteByte(address, value);
} }
#endif
} }
#endif

View File

@ -33,9 +33,11 @@ void cheatsReadGameSkip(gzFile file, int version);
void cheatsSaveCheatList(const char* file); void cheatsSaveCheatList(const char* file);
bool cheatsLoadCheatList(const char* file); bool cheatsLoadCheatList(const char* file);
#endif #endif
#ifdef BKPT_SUPPORT
void cheatsWriteMemory(uint32_t address, uint32_t value); void cheatsWriteMemory(uint32_t address, uint32_t value);
void cheatsWriteHalfWord(uint32_t address, uint16_t value); void cheatsWriteHalfWord(uint32_t address, uint16_t value);
void cheatsWriteByte(uint32_t address, uint8_t value); void cheatsWriteByte(uint32_t address, uint8_t value);
#endif
int cheatsCheckKeys(uint32_t keys, uint32_t extended); int cheatsCheckKeys(uint32_t keys, uint32_t extended);
extern int cheatsNumber; extern int cheatsNumber;

View File

@ -51,16 +51,11 @@ void eepromSaveGame(uint8_t*& data)
utilWriteMem(data, eepromData, SIZE_EEPROM_8K); utilWriteMem(data, eepromData, SIZE_EEPROM_8K);
} }
void eepromReadGame(const uint8_t*& data, int version) void eepromReadGame(const uint8_t*& data)
{ {
utilReadDataMem(data, eepromSaveData); utilReadDataMem(data, eepromSaveData);
if (version >= SAVE_GAME_VERSION_3) { eepromSize = utilReadIntMem(data);
eepromSize = utilReadIntMem(data); utilReadMem(eepromData, data, SIZE_EEPROM_8K);
utilReadMem(eepromData, data, SIZE_EEPROM_8K);
} else {
// prior to 0.7.1, only 4K EEPROM was supported
eepromSize = SIZE_EEPROM_512;
}
} }
#else // !__LIBRETRO__ #else // !__LIBRETRO__

View File

@ -5,7 +5,7 @@
#ifdef __LIBRETRO__ #ifdef __LIBRETRO__
extern void eepromSaveGame(uint8_t*& data); extern void eepromSaveGame(uint8_t*& data);
extern void eepromReadGame(const uint8_t*& data, int version); extern void eepromReadGame(const uint8_t*& data);
#else // !__LIBRETRO__ #else // !__LIBRETRO__
extern void eepromSaveGame(gzFile _gzFile); extern void eepromSaveGame(gzFile _gzFile);
extern void eepromReadGame(gzFile _gzFile, int version); extern void eepromReadGame(gzFile _gzFile, int version);

View File

@ -228,7 +228,7 @@ void flashSaveGame(uint8_t*& data)
utilWriteDataMem(data, flashSaveData3); utilWriteDataMem(data, flashSaveData3);
} }
void flashReadGame(const uint8_t*& data, int) void flashReadGame(const uint8_t*& data)
{ {
utilReadDataMem(data, flashSaveData3); utilReadDataMem(data, flashSaveData3);
} }

View File

@ -7,7 +7,7 @@
#ifdef __LIBRETRO__ #ifdef __LIBRETRO__
extern void flashSaveGame(uint8_t*& data); extern void flashSaveGame(uint8_t*& data);
extern void flashReadGame(const uint8_t*& data, int); extern void flashReadGame(const uint8_t*& data);
#else #else
extern void flashSaveGame(gzFile _gzFile); extern void flashSaveGame(gzFile _gzFile);
extern void flashReadGame(gzFile _gzFile, int version); extern void flashReadGame(gzFile _gzFile, int version);

View File

@ -595,7 +595,7 @@ void CPUUpdateRenderBuffers(bool force)
#ifdef __LIBRETRO__ #ifdef __LIBRETRO__
#include <stddef.h> #include <stddef.h>
unsigned int CPUWriteState(uint8_t* data, unsigned size) unsigned int CPUWriteState(uint8_t* data)
{ {
uint8_t* orig = data; uint8_t* orig = data;
@ -625,12 +625,7 @@ unsigned int CPUWriteState(uint8_t* data, unsigned size)
return (ptrdiff_t)data - (ptrdiff_t)orig; return (ptrdiff_t)data - (ptrdiff_t)orig;
} }
bool CPUWriteMemState(char* memory, int available, long& reserved) bool CPUReadState(const uint8_t* data)
{
return false;
}
bool CPUReadState(const uint8_t* data, unsigned size)
{ {
// Don't really care about version. // Don't really care about version.
int version = utilReadIntMem(data); int version = utilReadIntMem(data);
@ -667,9 +662,9 @@ bool CPUReadState(const uint8_t* data, unsigned size)
utilReadMem(pix, data, SIZE_PIX); utilReadMem(pix, data, SIZE_PIX);
utilReadMem(ioMem, data, SIZE_IOMEM); utilReadMem(ioMem, data, SIZE_IOMEM);
eepromReadGame(data, version); eepromReadGame(data);
flashReadGame(data, version); flashReadGame(data);
soundReadGame(data, version); soundReadGame(data);
rtcReadGame(data); rtcReadGame(data);
//// Copypasta stuff ... //// Copypasta stuff ...
@ -1276,6 +1271,7 @@ bool CPUReadBatteryFile(const char* fileName)
return true; return true;
} }
#ifndef __LIBRETRO__
bool CPUWritePNGFile(const char* fileName) bool CPUWritePNGFile(const char* fileName)
{ {
return utilWritePNGFile(fileName, 240, 160, pix); return utilWritePNGFile(fileName, 240, 160, pix);
@ -1285,6 +1281,7 @@ bool CPUWriteBMPFile(const char* fileName)
{ {
return utilWriteBMPFile(fileName, 240, 160, pix); return utilWriteBMPFile(fileName, 240, 160, pix);
} }
#endif /* !__LIBRETRO__ */
bool CPUIsZipFile(const char* file) bool CPUIsZipFile(const char* file)
{ {
@ -2290,7 +2287,8 @@ void CPUSoftwareInterrupt(int comment)
break; break;
case 0x2A: case 0x2A:
BIOS_SndDriverJmpTableCopy(); BIOS_SndDriverJmpTableCopy();
// let it go, because we don't really emulate this function // let it go, because we don't really emulate this function
/* fallthrough */
default: default:
#ifdef GBA_LOGGING #ifdef GBA_LOGGING
if (systemVerbose & VERBOSE_SWI) { if (systemVerbose & VERBOSE_SWI) {
@ -4284,6 +4282,16 @@ struct EmulatedSystem GBASystem = {
CPUReset, CPUReset,
// emuCleanUp // emuCleanUp
CPUCleanUp, CPUCleanUp,
#ifdef __LIBRETRO__
NULL, // emuReadBattery
NULL, // emuReadState
CPUReadState, // emuReadState
CPUWriteState, // emuWriteState
NULL, // emuReadMemState
NULL, // emuWriteMemState
NULL, // emuWritePNG
NULL, // emuWriteBMP
#else
// emuReadBattery // emuReadBattery
CPUReadBatteryFile, CPUReadBatteryFile,
// emuWriteBattery // emuWriteBattery
@ -4292,18 +4300,15 @@ struct EmulatedSystem GBASystem = {
CPUReadState, CPUReadState,
// emuWriteState // emuWriteState
CPUWriteState, CPUWriteState,
// emuReadMemState // emuReadMemState
#ifdef __LIBRETRO__
NULL,
#else
CPUReadMemState, CPUReadMemState,
#endif
// emuWriteMemState // emuWriteMemState
CPUWriteMemState, CPUWriteMemState,
// emuWritePNG // emuWritePNG
CPUWritePNGFile, CPUWritePNGFile,
// emuWriteBMP // emuWriteBMP
CPUWriteBMPFile, CPUWriteBMPFile,
#endif
// emuUpdateCPSR // emuUpdateCPSR
CPUUpdateCPSR, CPUUpdateCPSR,
// emuHasDebugger // emuHasDebugger

View File

@ -136,7 +136,7 @@ extern void CPUUpdateRenderBuffers(bool);
extern bool CPUReadMemState(char*, int); extern bool CPUReadMemState(char*, int);
extern bool CPUWriteMemState(char*, int); extern bool CPUWriteMemState(char*, int);
#ifdef __LIBRETRO__ #ifdef __LIBRETRO__
extern bool CPUReadState(const uint8_t*, unsigned); extern bool CPUReadState(const uint8_t*);
extern unsigned int CPUWriteState(uint8_t* data, unsigned int size); extern unsigned int CPUWriteState(uint8_t* data, unsigned int size);
#else #else
extern bool CPUReadState(const char*); extern bool CPUReadState(const char*);

View File

@ -155,7 +155,7 @@ static inline uint32_t CPUReadMemory(uint32_t address)
value = flashRead(address) * 0x01010101; value = flashRead(address) * 0x01010101;
break; break;
} }
// default /* fallthrough */
default: default:
unreadable: unreadable:
#ifdef GBA_LOGGING #ifdef GBA_LOGGING
@ -305,8 +305,7 @@ static inline uint32_t CPUReadHalfWord(uint32_t address)
value = flashRead(address) * 0x0101; value = flashRead(address) * 0x0101;
break; break;
} }
break; /* fallthrough */
// default
default: default:
unreadable: unreadable:
if (cpuDmaHack) { if (cpuDmaHack) {
@ -432,7 +431,7 @@ static inline uint8_t CPUReadByte(uint32_t address)
case 0x8500: case 0x8500:
return DowncastU8(systemGetSensorY() >> 8); return DowncastU8(systemGetSensorY() >> 8);
} }
// default /* fallthrough */
default: default:
unreadable: unreadable:
#ifdef GBA_LOGGING #ifdef GBA_LOGGING
@ -652,7 +651,7 @@ static inline void CPUWriteHalfWord(uint32_t address, uint16_t value)
(*cpuSaveGameFunc)(address, (uint8_t)value); (*cpuSaveGameFunc)(address, (uint8_t)value);
break; break;
} }
// fallthrough /* fallthrough */
default: default:
unwritable: unwritable:
#ifdef GBA_LOGGING #ifdef GBA_LOGGING

View File

@ -337,13 +337,16 @@ static void end_frame(blip_time_t time)
stereo_buffer->end_frame(time); stereo_buffer->end_frame(time);
} }
#ifdef __LIBRETRO__
void flush_samples(Multi_Buffer* buffer) void flush_samples(Multi_Buffer* buffer)
{ {
#ifdef __LIBRETRO__
int numSamples = buffer->read_samples((blip_sample_t*)soundFinalWave, buffer->samples_avail()); int numSamples = buffer->read_samples((blip_sample_t*)soundFinalWave, buffer->samples_avail());
soundDriver->write(soundFinalWave, numSamples); soundDriver->write(soundFinalWave, numSamples);
systemOnWriteDataToSoundBuffer(soundFinalWave, numSamples); systemOnWriteDataToSoundBuffer(soundFinalWave, numSamples);
}
#else #else
void flush_samples(Multi_Buffer* buffer)
{
// We want to write the data frame by frame to support legacy audio drivers // We want to write the data frame by frame to support legacy audio drivers
// that don't use the length parameter of the write method. // that don't use the length parameter of the write method.
// TODO: Update the Win32 audio drivers (DS, OAL, XA2), and flush all the // TODO: Update the Win32 audio drivers (DS, OAL, XA2), and flush all the
@ -365,8 +368,8 @@ void flush_samples(Multi_Buffer* buffer)
soundDriver->write(soundFinalWave, soundBufferLen); soundDriver->write(soundFinalWave, soundBufferLen);
systemOnWriteDataToSoundBuffer(soundFinalWave, soundBufferLen); systemOnWriteDataToSoundBuffer(soundFinalWave, soundBufferLen);
} }
#endif
} }
#endif // ! __LIBRETRO__
static void apply_filtering() static void apply_filtering()
{ {
@ -733,25 +736,17 @@ static variable_desc gba_state[] = {
{ NULL, 0 } { NULL, 0 }
}; };
#ifdef __LIBRETRO__ #ifndef __LIBRETRO__
void soundSaveGame(uint8_t*& out)
#else
void soundSaveGame(gzFile out) void soundSaveGame(gzFile out)
#endif
{ {
gb_apu->save_state(&state.apu); gb_apu->save_state(&state.apu);
// Be sure areas for expansion get written as zero // Be sure areas for expansion get written as zero
memset(dummy_state, 0, sizeof dummy_state); memset(dummy_state, 0, sizeof dummy_state);
#ifdef __LIBRETRO__
utilWriteDataMem(out, gba_state);
#else
utilWriteData(out, gba_state); utilWriteData(out, gba_state);
#endif
} }
#ifndef __LIBRETRO__
// Reads and discards count bytes from in // Reads and discards count bytes from in
static void skip_read(gzFile in, int count) static void skip_read(gzFile in, int count)
{ {
@ -801,31 +796,49 @@ static void soundReadGameOld(gzFile in, int version)
(void)utilReadInt(in); // ignore quality (void)utilReadInt(in); // ignore quality
} }
#endif
#include <stdio.h> #include <stdio.h>
#ifdef __LIBRETRO__
void soundReadGame(const uint8_t*& in, int version)
#else
void soundReadGame(gzFile in, int version) void soundReadGame(gzFile in, int version)
#endif
{ {
// Prepare APU and default state // Prepare APU and default state
reset_apu(); reset_apu();
gb_apu->save_state(&state.apu); gb_apu->save_state(&state.apu);
#ifdef __LIBRETRO__
utilReadDataMem(in, gba_state);
#else
if (version > SAVE_GAME_VERSION_9) if (version > SAVE_GAME_VERSION_9)
utilReadData(in, gba_state); utilReadData(in, gba_state);
else else
soundReadGameOld(in, version); soundReadGameOld(in, version);
#endif
gb_apu->load_state(state.apu); gb_apu->load_state(state.apu);
write_SGCNT0_H(READ16LE(&ioMem[SGCNT0_H]) & 0x770F); write_SGCNT0_H(READ16LE(&ioMem[SGCNT0_H]) & 0x770F);
apply_muting(); apply_muting();
} }
#endif // !__LIBRETRO__
#ifdef __LIBRETRO__
void soundSaveGame(uint8_t*& out)
{
gb_apu->save_state(&state.apu);
// Be sure areas for expansion get written as zero
memset(dummy_state, 0, sizeof dummy_state);
utilWriteDataMem(out, gba_state);
}
void soundReadGame(const uint8_t*& in)
{
// Prepare APU and default state
reset_apu();
gb_apu->save_state(&state.apu);
utilReadDataMem(in, gba_state);
gb_apu->load_state(state.apu);
write_SGCNT0_H(READ16LE(&ioMem[SGCNT0_H]) & 0x770F);
apply_muting();
}
#endif // __LIBRETRO__

View File

@ -78,7 +78,7 @@ extern int soundTicks;
// Saves/loads emulator state // Saves/loads emulator state
#ifdef __LIBRETRO__ #ifdef __LIBRETRO__
void soundSaveGame(uint8_t*&); void soundSaveGame(uint8_t*&);
void soundReadGame(const uint8_t*& in, int version); void soundReadGame(const uint8_t*& in);
#else #else
void soundSaveGame(gzFile); void soundSaveGame(gzFile);
void soundReadGame(gzFile, int version); void soundReadGame(gzFile, int version);

View File

@ -1194,14 +1194,14 @@ static void BIOS_SndDriver_b4c(uint32_t r0, uint32_t r1, uint32_t r2) // 0xb4c
static int32_t BIOS_SndDriver_3e4(uint32_t const r0a, uint32_t const r1a) // 0x3e4 static int32_t BIOS_SndDriver_3e4(uint32_t const r0a, uint32_t const r1a) // 0x3e4
{ {
int32_t r0 = r1a; int32_t r0 = (int32_t)r1a;
int32_t r1 = r0a; int32_t r1 = (int32_t)r0a;
uint32_t v5 = r0 & 0x80000000; uint32_t v5 = r0 & 0x80000000;
int32_t r12; int32_t r12;
int32_t r2; int32_t r2;
bool gtr; bool gtr;
if ((r1 & 0x80000000 & 0x80000000) != 0) if ((r1 & 0x80000000) != 0)
r1 = -r1; r1 = -r1;
r12 = r0; //v5 ^ (r0 >> 32); r12 = r0; //v5 ^ (r0 >> 32);
if (r0 < 0) if (r0 < 0)
@ -1209,8 +1209,9 @@ static int32_t BIOS_SndDriver_3e4(uint32_t const r0a, uint32_t const r1a) // 0x3
r2 = r1; r2 = r1;
do { do {
gtr = (r2 >= r0 >> 1); int32_t r0_rsh = ((uint32_t)r0 >> 1);
if (r2 <= r0 >> 1) gtr = (r2 >= r0_rsh);
if (r2 <= r0_rsh)
r2 *= 2; r2 *= 2;
} while (!gtr); } while (!gtr);
@ -1220,13 +1221,13 @@ static int32_t BIOS_SndDriver_3e4(uint32_t const r0a, uint32_t const r1a) // 0x3
r0 -= r2; r0 -= r2;
if (r2 == r1) if (r2 == r1)
break; break;
r2 >>= 1; r2 = ((uint32_t)r2 >> 1);
} }
if ((r12 << 1) == 0) if ((r12 << 1) == 0)
return 0 - v5; return -v5;
else
return v5; return v5;
} }
static void BIOS_SndDriverSub1(uint32_t p1) // 0x170a static void BIOS_SndDriverSub1(uint32_t p1) // 0x170a

View File

@ -456,7 +456,7 @@ void BIOS_EReader_ScanCard(int swi_num)
THUMB_PREFETCH THUMB_PREFETCH
} else if ((swi_num == 0xE3) || (swi_num == 0xE5)) //Dotcode data } else if ((swi_num == 0xE3) || (swi_num == 0xE5)) //Dotcode data
{ {
if (reg[0].I <= 0x10) { if (((int)reg[0].I >= 0) && (reg[0].I <= 0x10)) {
if (decodestate == 0) { if (decodestate == 0) {
for (i = 0x17; i >= 0; i--) { for (i = 0x17; i >= 0; i--) {
if ((0x17 - i) < 8) if ((0x17 - i) < 8)

View File

@ -1,6 +1,7 @@
LIBRETRO_COMMON := $(CORE_DIR)/libretro/libretro-common LIBRETRO_COMMON := $(CORE_DIR)/libretro/libretro-common
INCFLAGS := -I$(CORE_DIR) -I$(LIBRETRO_COMMON)/include INCFLAGS := -I$(CORE_DIR) -I$(LIBRETRO_COMMON)/include
VBA_DEFINES := -D__LIBRETRO__ -DFINAL_VERSION -DC_CORE -DNO_DEBUGGER VBA_DEFINES := -D__LIBRETRO__ -DFINAL_VERSION -DC_CORE -DNO_DEBUGGER
VBA_DEFINES += -DNO_PNG
ifeq ($(TILED_RENDERING), 1) ifeq ($(TILED_RENDERING), 1)
VBA_DEFINES += -DTILED_RENDERING VBA_DEFINES += -DTILED_RENDERING

View File

@ -43,11 +43,6 @@ bool cpuIsMultiBoot = false;
const char* loadDotCodeFile; const char* loadDotCodeFile;
const char* saveDotCodeFile; const char* saveDotCodeFile;
bool utilWritePNGFile(const char* fileName, int w, int h, uint8_t* pix)
{
return false;
}
void utilPutDword(uint8_t* p, uint32_t value) void utilPutDword(uint8_t* p, uint32_t value)
{ {
*p++ = value & 255; *p++ = value & 255;
@ -62,11 +57,6 @@ void utilPutWord(uint8_t* p, uint16_t value)
*p = (value >> 8) & 255; *p = (value >> 8) & 255;
} }
bool utilWriteBMPFile(const char* fileName, int w, int h, uint8_t* pix)
{
return false;
}
extern bool cpuIsMultiBoot; extern bool cpuIsMultiBoot;
bool utilIsGBAImage(const char* file) bool utilIsGBAImage(const char* file)

File diff suppressed because it is too large Load Diff

View File

@ -1,4 +1,4 @@
/* Copyright (C) 2010-2018 The RetroArch team /* Copyright (C) 2010-2020 The RetroArch team
* *
* --------------------------------------------------------------------------------------- * ---------------------------------------------------------------------------------------
* The following license statement only applies to this file (retro_inline.h). * The following license statement only applies to this file (retro_inline.h).

View File

@ -48,6 +48,7 @@ static retro_input_poll_t poll_cb;
static retro_input_state_t input_cb; static retro_input_state_t input_cb;
static retro_environment_t environ_cb; static retro_environment_t environ_cb;
static retro_set_rumble_state_t rumble_cb; static retro_set_rumble_state_t rumble_cb;
static retro_audio_sample_t audio_cb;
retro_audio_sample_batch_t audio_batch_cb; retro_audio_sample_batch_t audio_batch_cb;
static char retro_system_directory[2048]; static char retro_system_directory[2048];
@ -59,7 +60,6 @@ static bool option_sndInterpolation = true;
static bool option_useBios = false; static bool option_useBios = false;
static bool option_colorizerHack = false; static bool option_colorizerHack = false;
static bool option_forceRTCenable = false; static bool option_forceRTCenable = false;
static bool option_showAdvancedOptions = false;
static double option_sndFiltering = 0.5; static double option_sndFiltering = 0.5;
static unsigned option_gbPalette = 0; static unsigned option_gbPalette = 0;
static bool option_lcdfilter = false; static bool option_lcdfilter = false;
@ -376,6 +376,7 @@ void retro_set_video_refresh(retro_video_refresh_t cb)
void retro_set_audio_sample(retro_audio_sample_t cb) void retro_set_audio_sample(retro_audio_sample_t cb)
{ {
audio_cb = cb;
} }
void retro_set_audio_sample_batch(retro_audio_sample_batch_t cb) void retro_set_audio_sample_batch(retro_audio_sample_batch_t cb)
@ -510,7 +511,8 @@ void retro_set_controller_port_device(unsigned port, unsigned device)
void retro_set_environment(retro_environment_t cb) void retro_set_environment(retro_environment_t cb)
{ {
environ_cb = cb; environ_cb = cb;
libretro_set_core_options(environ_cb); bool categoriesSupported;
libretro_set_core_options(environ_cb, &categoriesSupported);
} }
void retro_get_system_info(struct retro_system_info *info) void retro_get_system_info(struct retro_system_info *info)
@ -970,7 +972,7 @@ static bool option_swapAnalogSticks;
static void update_variables(bool startup) static void update_variables(bool startup)
{ {
struct retro_variable var = {0}; struct retro_variable var = { NULL, NULL };
char key[256] = {0}; char key[256] = {0};
int disabled_layers = 0; int disabled_layers = 0;
int sound_enabled = 0x30F; int sound_enabled = 0x30F;
@ -1205,39 +1207,6 @@ static void update_variables(bool startup)
else else
ifb_filter_func = NULL; ifb_filter_func = NULL;
var.key = "vbam_show_advanced_options";
var.value = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_VARIABLE, &var) && var.value) {
bool newval = (!strcmp(var.value, "enabled")) ? true : false;
if ((option_showAdvancedOptions != newval) || startup) {
option_showAdvancedOptions = newval;
struct retro_core_option_display option_display;
unsigned i;
char options[][13] = {
"vbam_sound_1",
"vbam_sound_2",
"vbam_sound_3",
"vbam_sound_4",
"vbam_sound_5",
"vbam_sound_6",
"vbam_layer_1",
"vbam_layer_2",
"vbam_layer_3",
"vbam_layer_4",
"vbam_layer_5",
"vbam_layer_6",
"vbam_layer_7",
"vbam_layer_8"
};
option_display.visible = option_showAdvancedOptions;
for (i = 0; i < (sizeof(options) / sizeof(options[0])); i++) {
option_display.key = options[i];
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_DISPLAY, &option_display);
}
}
}
// Hide some core options depending on rom image type // Hide some core options depending on rom image type
if (startup) { if (startup) {
unsigned i; unsigned i;
@ -1469,14 +1438,14 @@ size_t retro_serialize_size(void)
bool retro_serialize(void* data, size_t size) bool retro_serialize(void* data, size_t size)
{ {
if (size == serialize_size) if (size == serialize_size)
return core->emuWriteState((uint8_t*)data, size); return core->emuWriteState((uint8_t*)data);
return false; return false;
} }
bool retro_unserialize(const void* data, size_t size) bool retro_unserialize(const void* data, size_t size)
{ {
if (size == serialize_size) if (size == serialize_size)
return core->emuReadState((uint8_t*)data, size); return core->emuReadState((uint8_t*)data);
return false; return false;
} }
@ -1709,7 +1678,7 @@ bool retro_load_game(const struct retro_game_info *game)
update_input_descriptors(); // Initialize input descriptors and info update_input_descriptors(); // Initialize input descriptors and info
update_variables(false); update_variables(false);
uint8_t* state_buf = (uint8_t*)malloc(2000000); uint8_t* state_buf = (uint8_t*)malloc(2000000);
serialize_size = core->emuWriteState(state_buf, 2000000); serialize_size = core->emuWriteState(state_buf);
free(state_buf); free(state_buf);
emulating = 1; emulating = 1;

View File

@ -13,9 +13,10 @@
/* /*
******************************** ********************************
* VERSION: 1.3 * VERSION: 2.0
******************************** ********************************
* *
* - 2.0: Add support for core options v2 interface
* - 1.3: Move translations to libretro_core_options_intl.h * - 1.3: Move translations to libretro_core_options_intl.h
* - libretro_core_options_intl.h includes BOM and utf-8 * - libretro_core_options_intl.h includes BOM and utf-8
* fix for MSVC 2010-2013 * fix for MSVC 2010-2013
@ -48,31 +49,43 @@ extern "C" {
* - Will be used as a fallback for any missing entries in * - Will be used as a fallback for any missing entries in
* frontend language definition */ * frontend language definition */
struct retro_core_option_definition option_defs_us[] = { struct retro_core_option_v2_category option_cats_us[] = {
{ {
"vbam_solarsensor", "system",
"Solar Sensor Level", "System",
"Adjusts simulated solar level in Boktai games. L2/R2 buttons can also be used to quickly change levels.", "Configure system options."
{ },
{ "0", NULL }, {
{ "1", NULL }, "video",
{ "2", NULL }, "Video",
{ "3", NULL }, "Configure video options."
{ "4", NULL }, },
{ "5", NULL }, {
{ "6", NULL }, "audio",
{ "7", NULL }, "Audio",
{ "8", NULL }, "Configure audio options."
{ "9", NULL }, },
{ "10", NULL }, {
{ NULL, NULL }, "input",
}, "Input",
"0" "Configure input options."
}, },
{
"advanced",
"Advanced options",
"Configure advanced options which can enable or disable sound channels and graphics layers."
},
{ NULL, NULL, NULL },
};
struct retro_core_option_v2_definition option_defs_us[] = {
{ {
"vbam_usebios", "vbam_usebios",
"Use Official BIOS (If Available)", "Use Official BIOS (If Available)",
NULL,
"Use official BIOS when available. Core needs to be restarted for changes to apply.", "Use official BIOS when available. Core needs to be restarted for changes to apply.",
NULL,
"system",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -83,7 +96,10 @@ struct retro_core_option_definition option_defs_us[] = {
{ {
"vbam_forceRTCenable", "vbam_forceRTCenable",
"Force-Enable RTC", "Force-Enable RTC",
NULL,
"Forces the internal real-time clock to be enabled regardless of rom. Usuable for rom patches that requires clock to be enabled (aka Pokemon).", "Forces the internal real-time clock to be enabled regardless of rom. Usuable for rom patches that requires clock to be enabled (aka Pokemon).",
NULL,
"system",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -91,10 +107,124 @@ struct retro_core_option_definition option_defs_us[] = {
}, },
"disabled" "disabled"
}, },
{
"vbam_gbHardware",
"(GB) Emulated Hardware (Needs Restart)",
NULL,
"Sets the Game Boy hardware type to emulate. Restart core to apply.",
NULL,
"system",
{
{ "gbc", "Game Boy Color" },
{ "auto", "Automatic" },
{ "sgb", "Super Game Boy" },
{ "gb", "Game Boy" },
{ "gba", "Game Boy Advance" },
{ "sgb2", "Super Game Boy 2" },
{ NULL, NULL },
},
"gbc"
},
{
"vbam_allowcolorizerhack",
"(GB) Enable Colorizer Hack (Needs Restart)",
NULL,
"Allows Colorizer hacked GB games (e.g. DX patched games) to normally run in GBC/GBA hardware type. This also disables the use of bios file. NOT RECOMMENDED for use on non-colorized games.",
NULL,
"system",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_palettes",
"(GB) Color Palette",
NULL,
"Set Game Boy palettes to use.",
NULL,
"video",
{
{ "black and white", NULL },
{ "blue sea", NULL },
{ "dark knight", NULL },
{ "green forest", NULL },
{ "hot desert", NULL },
{ "pink dreams", NULL },
{ "wierd colors", NULL },
{ "original gameboy", NULL },
{ "gba sp", NULL },
{ NULL, NULL },
},
"standard"
},
{
"vbam_showborders",
"(GB) Show Borders",
NULL,
"When enabled, if loaded content is SGB compatible, this will show the border from the game if available.",
NULL,
"video",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ "auto", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_gbcoloroption",
"(GB) Color Correction",
NULL,
"Applies color correction which fixes colors in some games.",
NULL,
"video",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_lcdfilter",
"LCD Color Filter",
NULL,
"Darkens the onscreen colors by applying a screen filter.",
NULL,
"video",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_interframeblending",
"Interframe Blending",
NULL,
"Simulates LCD ghosting effects. 'Smart' attempts to detect screen flickering, and only performs a 50:50 mix on affected pixels, while 'Motion Blur' mimics natural LCD response times by combining multiple buffered frames. 'Smart' blending is required when playing games that aggressively exploit LCD ghosting for transparency effects (Wave Race, Chikyuu Kaihou Gun ZAS, F-Zero, the Boktai series...).",
NULL,
"video",
{
{ "disabled", NULL },
{ "smart", "Smart" },
{ "motion blur", "Motion Blur" },
{ NULL, NULL },
},
"disabled"
},
{ {
"vbam_soundinterpolation", "vbam_soundinterpolation",
"Sound Interpolation", "Sound Interpolation",
NULL,
"Enable or disable sound filtering.", "Enable or disable sound filtering.",
NULL,
"audio",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -105,7 +235,10 @@ struct retro_core_option_definition option_defs_us[] = {
{ {
"vbam_soundfiltering", "vbam_soundfiltering",
"Sound Filtering", "Sound Filtering",
NULL,
"Sets the amount of filtering to use. Higher value reduces higher frequencies.", "Sets the amount of filtering to use. Higher value reduces higher frequencies.",
NULL,
"audio",
{ {
{ "0", NULL }, { "0", NULL },
{ "1", NULL }, { "1", NULL },
@ -122,100 +255,13 @@ struct retro_core_option_definition option_defs_us[] = {
}, },
"5" "5"
}, },
{
"vbam_palettes",
"(GB) Color Palette",
"Set Game Boy palettes to use.",
{
{ "black and white", NULL },
{ "blue sea", NULL },
{ "dark knight", NULL },
{ "green forest", NULL },
{ "hot desert", NULL },
{ "pink dreams", NULL },
{ "wierd colors", NULL },
{ "original gameboy", NULL },
{ "gba sp", NULL },
{ NULL, NULL },
},
"standard"
},
{
"vbam_gbHardware",
"(GB) Emulated Hardware (Needs Restart)",
"Sets the Game Boy hardware type to emulate. Restart core to apply.",
{
{ "gbc", "Game Boy Color" },
{ "auto", "Automatic" },
{ "sgb", "Super Game Boy" },
{ "gb", "Game Boy" },
{ "gba", "Game Boy Advance" },
{ "sgb2", "Super Game Boy 2" },
{ NULL, NULL },
},
"gbc"
},
{
"vbam_allowcolorizerhack",
"(GB) Enable Colorizer Hack (Needs Restart)",
"Allows Colorizer hacked GB games (e.g. DX patched games) to normally run in GBC/GBA hardware type. This also disables the use of bios file. NOT RECOMMENDED for use on non-colorized games.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_showborders",
"(GB) Show Borders",
"When enabled, if loaded content is SGB compatible, this will show the border from the game if available.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ "auto", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_gbcoloroption",
"(GB) Color Correction",
"Applies color correction which fixes colors in some games.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_lcdfilter",
"LCD Color Filter",
"Darkens the onscreen colors by applying a screen filter.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_interframeblending",
"Interframe Blending",
"Simulates LCD ghosting effects. 'Smart' attempts to detect screen flickering, and only performs a 50:50 mix on affected pixels, while 'Motion Blur' mimics natural LCD response times by combining multiple buffered frames. 'Smart' blending is required when playing games that aggressively exploit LCD ghosting for transparency effects (Wave Race, Chikyuu Kaihou Gun ZAS, F-Zero, the Boktai series...).",
{
{ "disabled", NULL },
{ "smart", "Smart" },
{ "motion blur", "Motion Blur" },
{ NULL, NULL },
},
"disabled"
},
{ {
"vbam_turboenable", "vbam_turboenable",
"Enable Turbo Buttons", "Enable Turbo Buttons",
NULL,
"Enable or disable gamepad turbo buttons.", "Enable or disable gamepad turbo buttons.",
NULL,
"input",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -226,7 +272,10 @@ struct retro_core_option_definition option_defs_us[] = {
{ {
"vbam_turbodelay", "vbam_turbodelay",
"Turbo Delay (in frames)", "Turbo Delay (in frames)",
NULL,
"Repeat rate of turbo triggers in frames. Higher value triggers more.", "Repeat rate of turbo triggers in frames. Higher value triggers more.",
NULL,
"input",
{ {
{ "1", NULL }, { "1", NULL },
{ "2", NULL }, { "2", NULL },
@ -247,10 +296,36 @@ struct retro_core_option_definition option_defs_us[] = {
}, },
"3" "3"
}, },
{
"vbam_solarsensor",
"Solar Sensor Level",
NULL,
"Adjusts simulated solar level in Boktai games. L2/R2 buttons can also be used to quickly change levels.",
NULL,
"input",
{
{ "0", NULL },
{ "1", NULL },
{ "2", NULL },
{ "3", NULL },
{ "4", NULL },
{ "5", NULL },
{ "6", NULL },
{ "7", NULL },
{ "8", NULL },
{ "9", NULL },
{ "10", NULL },
{ NULL, NULL },
},
"0"
},
{ {
"vbam_astick_deadzone", "vbam_astick_deadzone",
"Sensors Deadzone (%)", "Sensors Deadzone (%)",
NULL,
"Set deadzone (in percent) of analog sticks.", "Set deadzone (in percent) of analog sticks.",
NULL,
"input",
{ {
{ "0", NULL }, { "0", NULL },
{ "5", NULL }, { "5", NULL },
@ -266,7 +341,10 @@ struct retro_core_option_definition option_defs_us[] = {
{ {
"vbam_gyro_sensitivity", "vbam_gyro_sensitivity",
"Sensor Sensitivity (Gyroscope) (%)", "Sensor Sensitivity (Gyroscope) (%)",
NULL,
"Default bind is left analog. Used to adjust sensitivity level for gyro-enabled games.", "Default bind is left analog. Used to adjust sensitivity level for gyro-enabled games.",
NULL,
"input",
{ {
{ "10", NULL }, { "10", NULL },
{ "15", NULL }, { "15", NULL },
@ -298,7 +376,10 @@ struct retro_core_option_definition option_defs_us[] = {
{ {
"vbam_tilt_sensitivity", "vbam_tilt_sensitivity",
"Sensor Sensitivity (Tilt) (%)", "Sensor Sensitivity (Tilt) (%)",
NULL,
"Default bind is right analog. Used to adjust sensitivity level for gyro-enabled games.", "Default bind is right analog. Used to adjust sensitivity level for gyro-enabled games.",
NULL,
"input",
{ {
{ "10", NULL }, { "10", NULL },
{ "15", NULL }, { "15", NULL },
@ -330,18 +411,10 @@ struct retro_core_option_definition option_defs_us[] = {
{ {
"vbam_swap_astick", "vbam_swap_astick",
"Swap Left/Right Analog", "Swap Left/Right Analog",
NULL,
"Swaps left and right analog stick function for gyro and tilt.", "Swaps left and right analog stick function for gyro and tilt.",
{ NULL,
{ "disabled", NULL }, "input",
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_show_advanced_options",
"Show Advanced Options",
"Show advanced options which can enable or disable sound channels and graphics layers.",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -352,7 +425,10 @@ struct retro_core_option_definition option_defs_us[] = {
{ {
"vbam_sound_1", "vbam_sound_1",
"Sound Channel 1", "Sound Channel 1",
NULL,
"Enables or disables tone & sweep sound channel.", "Enables or disables tone & sweep sound channel.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -363,7 +439,10 @@ struct retro_core_option_definition option_defs_us[] = {
{ {
"vbam_sound_2", "vbam_sound_2",
"Sound Channel 2", "Sound Channel 2",
NULL,
"Enables or disables tone sound channel.", "Enables or disables tone sound channel.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -374,7 +453,10 @@ struct retro_core_option_definition option_defs_us[] = {
{ {
"vbam_sound_3", "vbam_sound_3",
"Sound Channel 3", "Sound Channel 3",
NULL,
"Enables or disables wave output sound channel.", "Enables or disables wave output sound channel.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -385,7 +467,10 @@ struct retro_core_option_definition option_defs_us[] = {
{ {
"vbam_sound_4", "vbam_sound_4",
"Sound Channel 4", "Sound Channel 4",
NULL,
"Enables or disables noise audio channel.", "Enables or disables noise audio channel.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -396,7 +481,10 @@ struct retro_core_option_definition option_defs_us[] = {
{ {
"vbam_sound_5", "vbam_sound_5",
"Sound DMA Channel A", "Sound DMA Channel A",
NULL,
"Enables or disables DMA sound channel A.", "Enables or disables DMA sound channel A.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -407,7 +495,10 @@ struct retro_core_option_definition option_defs_us[] = {
{ {
"vbam_sound_6", "vbam_sound_6",
"Sound DMA Channel B", "Sound DMA Channel B",
NULL,
"Enables or disables DMA sound channel B.", "Enables or disables DMA sound channel B.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -418,7 +509,10 @@ struct retro_core_option_definition option_defs_us[] = {
{ {
"vbam_layer_1", "vbam_layer_1",
"Show Background Layer 1", "Show Background Layer 1",
NULL,
"Shows or hides background layer 1.", "Shows or hides background layer 1.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -429,7 +523,10 @@ struct retro_core_option_definition option_defs_us[] = {
{ {
"vbam_layer_2", "vbam_layer_2",
"Show Background Layer 2", "Show Background Layer 2",
NULL,
"Shows or hides background layer 2.", "Shows or hides background layer 2.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -440,7 +537,10 @@ struct retro_core_option_definition option_defs_us[] = {
{ {
"vbam_layer_3", "vbam_layer_3",
"Show Background Layer 3", "Show Background Layer 3",
NULL,
"Shows or hides background layer 3.", "Shows or hides background layer 3.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -451,7 +551,10 @@ struct retro_core_option_definition option_defs_us[] = {
{ {
"vbam_layer_4", "vbam_layer_4",
"Show Background Layer 4", "Show Background Layer 4",
NULL,
"Shows or hides background layer 4.", "Shows or hides background layer 4.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -462,7 +565,10 @@ struct retro_core_option_definition option_defs_us[] = {
{ {
"vbam_layer_5", "vbam_layer_5",
"Show Sprite Layer", "Show Sprite Layer",
NULL,
"Shows or hides sprite layer.", "Shows or hides sprite layer.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -473,7 +579,10 @@ struct retro_core_option_definition option_defs_us[] = {
{ {
"vbam_layer_6", "vbam_layer_6",
"Show Window Layer 1", "Show Window Layer 1",
NULL,
"Shows or hides window layer 1.", "Shows or hides window layer 1.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -484,7 +593,10 @@ struct retro_core_option_definition option_defs_us[] = {
{ {
"vbam_layer_7", "vbam_layer_7",
"Show Window Layer 2", "Show Window Layer 2",
NULL,
"Shows or hides window layer 2.", "Shows or hides window layer 2.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -495,7 +607,10 @@ struct retro_core_option_definition option_defs_us[] = {
{ {
"vbam_layer_8", "vbam_layer_8",
"Show Sprite Window Layer", "Show Sprite Window Layer",
NULL,
"Shows or hides sprite window layer.", "Shows or hides sprite window layer.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -503,8 +618,12 @@ struct retro_core_option_definition option_defs_us[] = {
}, },
"enabled" "enabled"
}, },
{ NULL, NULL, NULL, NULL, NULL, NULL, { { NULL, NULL } }, NULL },
};
{ NULL, NULL, NULL, {{0}}, NULL } struct retro_core_options_v2 options_us = {
option_cats_us,
option_defs_us
}; };
/* /*
@ -514,8 +633,8 @@ struct retro_core_option_definition option_defs_us[] = {
*/ */
#ifndef HAVE_NO_LANGEXTRA #ifndef HAVE_NO_LANGEXTRA
struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = { struct retro_core_options_v2 *options_intl[RETRO_LANGUAGE_LAST] = {
option_defs_us, /* RETRO_LANGUAGE_ENGLISH */ &options_us, /* RETRO_LANGUAGE_ENGLISH */
NULL, /* RETRO_LANGUAGE_JAPANESE */ NULL, /* RETRO_LANGUAGE_JAPANESE */
NULL, /* RETRO_LANGUAGE_FRENCH */ NULL, /* RETRO_LANGUAGE_FRENCH */
NULL, /* RETRO_LANGUAGE_SPANISH */ NULL, /* RETRO_LANGUAGE_SPANISH */
@ -533,7 +652,7 @@ struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
NULL, /* RETRO_LANGUAGE_VIETNAMESE */ NULL, /* RETRO_LANGUAGE_VIETNAMESE */
NULL, /* RETRO_LANGUAGE_ARABIC */ NULL, /* RETRO_LANGUAGE_ARABIC */
NULL, /* RETRO_LANGUAGE_GREEK */ NULL, /* RETRO_LANGUAGE_GREEK */
option_defs_tr, /* RETRO_LANGUAGE_TURKISH */ &options_tr, /* RETRO_LANGUAGE_TURKISH */
}; };
#endif #endif
@ -551,39 +670,61 @@ struct retro_core_option_definition *option_defs_intl[RETRO_LANGUAGE_LAST] = {
* be as painless as possible for core devs) * be as painless as possible for core devs)
*/ */
static INLINE void libretro_set_core_options(retro_environment_t environ_cb) static INLINE void libretro_set_core_options(retro_environment_t environ_cb,
bool *categories_supported)
{ {
unsigned version = 0; unsigned version = 0;
#ifndef HAVE_NO_LANGEXTRA
unsigned language = 0;
#endif
if (!environ_cb) if (!environ_cb || !categories_supported)
return; return;
if (environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version) && (version >= 1)) *categories_supported = false;
if (!environ_cb(RETRO_ENVIRONMENT_GET_CORE_OPTIONS_VERSION, &version))
version = 0;
if (version >= 2)
{ {
#ifndef HAVE_NO_LANGEXTRA #ifndef HAVE_NO_LANGEXTRA
struct retro_core_options_intl core_options_intl; struct retro_core_options_v2_intl core_options_intl;
unsigned language = 0;
core_options_intl.us = option_defs_us; core_options_intl.us = &options_us;
core_options_intl.local = NULL; core_options_intl.local = NULL;
if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) && if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
(language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH)) (language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH))
core_options_intl.local = option_defs_intl[language]; core_options_intl.local = options_intl[language];
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_intl); *categories_supported = environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2_INTL,
&core_options_intl);
#else #else
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, &option_defs_us); *categories_supported = environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_V2,
&options_us);
#endif #endif
} }
else else
{ {
size_t i; size_t i, j;
size_t option_index = 0;
size_t num_options = 0; size_t num_options = 0;
struct retro_core_option_definition
*option_v1_defs_us = NULL;
#ifndef HAVE_NO_LANGEXTRA
size_t num_options_intl = 0;
struct retro_core_option_v2_definition
*option_defs_intl = NULL;
struct retro_core_option_definition
*option_v1_defs_intl = NULL;
struct retro_core_options_intl
core_options_v1_intl;
#endif
struct retro_variable *variables = NULL; struct retro_variable *variables = NULL;
char **values_buf = NULL; char **values_buf = NULL;
/* Determine number of options */ /* Determine total number of options */
while (true) while (true)
{ {
if (option_defs_us[num_options].key) if (option_defs_us[num_options].key)
@ -592,86 +733,187 @@ static INLINE void libretro_set_core_options(retro_environment_t environ_cb)
break; break;
} }
/* Allocate arrays */ if (version >= 1)
variables = (struct retro_variable *)calloc(num_options + 1, sizeof(struct retro_variable));
values_buf = (char **)calloc(num_options, sizeof(char *));
if (!variables || !values_buf)
goto error;
/* Copy parameters from option_defs_us array */
for (i = 0; i < num_options; i++)
{ {
const char *key = option_defs_us[i].key; /* Allocate US array */
const char *desc = option_defs_us[i].desc; option_v1_defs_us = (struct retro_core_option_definition *)
const char *default_value = option_defs_us[i].default_value; calloc(num_options + 1, sizeof(struct retro_core_option_definition));
struct retro_core_option_value *values = option_defs_us[i].values;
size_t buf_len = 3;
size_t default_index = 0;
values_buf[i] = NULL; /* Copy parameters from option_defs_us array */
for (i = 0; i < num_options; i++)
if (desc)
{ {
size_t num_values = 0; struct retro_core_option_v2_definition *option_def_us = &option_defs_us[i];
struct retro_core_option_value *option_values = option_def_us->values;
struct retro_core_option_definition *option_v1_def_us = &option_v1_defs_us[i];
struct retro_core_option_value *option_v1_values = option_v1_def_us->values;
/* Determine number of values */ option_v1_def_us->key = option_def_us->key;
option_v1_def_us->desc = option_def_us->desc;
option_v1_def_us->info = option_def_us->info;
option_v1_def_us->default_value = option_def_us->default_value;
/* Values must be copied individually... */
while (option_values->value)
{
option_v1_values->value = option_values->value;
option_v1_values->label = option_values->label;
option_values++;
option_v1_values++;
}
}
#ifndef HAVE_NO_LANGEXTRA
if (environ_cb(RETRO_ENVIRONMENT_GET_LANGUAGE, &language) &&
(language < RETRO_LANGUAGE_LAST) && (language != RETRO_LANGUAGE_ENGLISH) &&
options_intl[language])
option_defs_intl = options_intl[language]->definitions;
if (option_defs_intl)
{
/* Determine number of intl options */
while (true) while (true)
{ {
if (values[num_values].value) if (option_defs_intl[num_options_intl].key)
{ num_options_intl++;
/* Check if this is the default value */
if (default_value)
if (strcmp(values[num_values].value, default_value) == 0)
default_index = num_values;
buf_len += strlen(values[num_values].value);
num_values++;
}
else else
break; break;
} }
/* Build values string */ /* Allocate intl array */
if (num_values > 0) option_v1_defs_intl = (struct retro_core_option_definition *)
calloc(num_options_intl + 1, sizeof(struct retro_core_option_definition));
/* Copy parameters from option_defs_intl array */
for (i = 0; i < num_options_intl; i++)
{ {
size_t j; struct retro_core_option_v2_definition *option_def_intl = &option_defs_intl[i];
struct retro_core_option_value *option_values = option_def_intl->values;
struct retro_core_option_definition *option_v1_def_intl = &option_v1_defs_intl[i];
struct retro_core_option_value *option_v1_values = option_v1_def_intl->values;
buf_len += num_values - 1; option_v1_def_intl->key = option_def_intl->key;
buf_len += strlen(desc); option_v1_def_intl->desc = option_def_intl->desc;
option_v1_def_intl->info = option_def_intl->info;
option_v1_def_intl->default_value = option_def_intl->default_value;
values_buf[i] = (char *)calloc(buf_len, sizeof(char)); /* Values must be copied individually... */
if (!values_buf[i]) while (option_values->value)
goto error;
strcpy(values_buf[i], desc);
strcat(values_buf[i], "; ");
/* Default value goes first */
strcat(values_buf[i], values[default_index].value);
/* Add remaining values */
for (j = 0; j < num_values; j++)
{ {
if (j != default_index) option_v1_values->value = option_values->value;
{ option_v1_values->label = option_values->label;
strcat(values_buf[i], "|");
strcat(values_buf[i], values[j].value); option_values++;
} option_v1_values++;
} }
} }
} }
variables[i].key = key; core_options_v1_intl.us = option_v1_defs_us;
variables[i].value = values_buf[i]; core_options_v1_intl.local = option_v1_defs_intl;
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS_INTL, &core_options_v1_intl);
#else
environ_cb(RETRO_ENVIRONMENT_SET_CORE_OPTIONS, option_v1_defs_us);
#endif
}
else
{
/* Allocate arrays */
variables = (struct retro_variable *)calloc(num_options + 1,
sizeof(struct retro_variable));
values_buf = (char **)calloc(num_options, sizeof(char *));
if (!variables || !values_buf)
goto error;
/* Copy parameters from option_defs_us array */
for (i = 0; i < num_options; i++)
{
const char *key = option_defs_us[i].key;
const char *desc = option_defs_us[i].desc;
const char *default_value = option_defs_us[i].default_value;
struct retro_core_option_value *values = option_defs_us[i].values;
size_t buf_len = 3;
size_t default_index = 0;
values_buf[i] = NULL;
if (desc)
{
size_t num_values = 0;
/* Determine number of values */
while (true)
{
if (values[num_values].value)
{
/* Check if this is the default value */
if (default_value)
if (strcmp(values[num_values].value, default_value) == 0)
default_index = num_values;
buf_len += strlen(values[num_values].value);
num_values++;
}
else
break;
}
/* Build values string */
if (num_values > 0)
{
buf_len += num_values - 1;
buf_len += strlen(desc);
values_buf[i] = (char *)calloc(buf_len, sizeof(char));
if (!values_buf[i])
goto error;
strcpy(values_buf[i], desc);
strcat(values_buf[i], "; ");
/* Default value goes first */
strcat(values_buf[i], values[default_index].value);
/* Add remaining values */
for (j = 0; j < num_values; j++)
{
if (j != default_index)
{
strcat(values_buf[i], "|");
strcat(values_buf[i], values[j].value);
}
}
}
}
variables[option_index].key = key;
variables[option_index].value = values_buf[i];
option_index++;
}
/* Set variables */
environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
} }
/* Set variables */
environ_cb(RETRO_ENVIRONMENT_SET_VARIABLES, variables);
error: error:
/* Clean up */ /* Clean up */
if (option_v1_defs_us)
{
free(option_v1_defs_us);
option_v1_defs_us = NULL;
}
#ifndef HAVE_NO_LANGEXTRA
if (option_v1_defs_intl)
{
free(option_v1_defs_intl);
option_v1_defs_intl = NULL;
}
#endif
if (values_buf) if (values_buf)
{ {
for (i = 0; i < num_options; i++) for (i = 0; i < num_options; i++)

View File

@ -73,31 +73,43 @@ extern "C" {
/* RETRO_LANGUAGE_TURKISH */ /* RETRO_LANGUAGE_TURKISH */
struct retro_core_option_definition option_defs_tr[] = { struct retro_core_option_v2_category option_cats_tr[] = {
{ {
"vbam_solarsensor", "system",
"Solar Sensör Seviyesi", NULL,
"Boktai oyunlarında simüle güneş seviyesini ayarlar. L2 / R2 düğmeleri ayrıca seviyeleri hızlıca değiştirmek için de kullanılabilir.", NULL,
{ },
{ "0", NULL }, {
{ "1", NULL }, "video",
{ "2", NULL }, NULL,
{ "3", NULL }, NULL,
{ "4", NULL }, },
{ "5", NULL }, {
{ "6", NULL }, "audio",
{ "7", NULL }, NULL,
{ "8", NULL }, NULL,
{ "9", NULL }, },
{ "10", NULL }, {
{ NULL, NULL }, "input",
}, NULL,
"0" NULL,
}, },
{
"advanced",
NULL,
NULL,
},
{ NULL, NULL, NULL },
};
struct retro_core_option_v2_definition option_defs_tr[] = {
{ {
"vbam_usebios", "vbam_usebios",
"Resmi BIOS'u kullanın (Varsa)", "Resmi BIOS'u kullanın (Varsa)",
NULL,
"Mümkün olduğunda resmi BIOS kullanın. Değişikliklerin uygulanabilmesi için çekirdeğin yeniden başlatılması gerekiyor.", "Mümkün olduğunda resmi BIOS kullanın. Değişikliklerin uygulanabilmesi için çekirdeğin yeniden başlatılması gerekiyor.",
NULL,
"system",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -108,7 +120,92 @@ struct retro_core_option_definition option_defs_tr[] = {
{ {
"vbam_forceRTCenable", "vbam_forceRTCenable",
"RTC'yi Etkinleştir", "RTC'yi Etkinleştir",
NULL,
"RAM'den bağımsız olarak dahili gerçek zamanlı saati etkinleştirmeye zorlar. Saatin etkinleştirilmesini gerektiren rom yamalar için kullanılabilir (Pokemon gibi).", "RAM'den bağımsız olarak dahili gerçek zamanlı saati etkinleştirmeye zorlar. Saatin etkinleştirilmesini gerektiren rom yamalar için kullanılabilir (Pokemon gibi).",
NULL,
"system",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_gbHardware",
"(GB) Öykünülmüş Donanım (Yeniden Başlatılması Gerekiyor)",
NULL,
"Game Boy donanım tipini taklit edecek şekilde ayarlar. Uygulamak için çekirdeği yeniden başlatın.",
NULL,
"system",
{
{ "gbc", "Game Boy Color" },
{ "auto", "Automatic" },
{ "sgb", "Super Game Boy" },
{ "gb", "Game Boy" },
{ "gba", "Game Boy Advance" },
{ "sgb2", "Super Game Boy 2" },
{ NULL, NULL },
},
"gbc"
},
{
"vbam_allowcolorizerhack",
"(GB) Colorizer Hack'i Etkinleştir (Yeniden Başlatılması Gerekiyor)",
NULL,
"Colorizer'ın saldırıya uğramış GB oyunlarının (örn. DX yamalı oyunlar) normalde GBC / GBA donanım türünde çalışmasına izin verir. Bu ayrıca bios dosyasının kullanımını da devre dışı bırakır. Renklendirilmemiş oyunlarda kullanılması tavsiye edilmez.",
NULL,
"system",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_palettes",
"(GB) Renk Paleti",
NULL,
"Game Boy paletlerini kullanmak için ayarlayın.",
NULL,
"video",
{
{ "black and white", NULL },
{ "blue sea", NULL },
{ "dark knight", NULL },
{ "green forest", NULL },
{ "hot desert", NULL },
{ "pink dreams", NULL },
{ "wierd colors", NULL },
{ "original gameboy", NULL },
{ "gba sp", NULL },
{ NULL, NULL },
},
"standard"
},
{
"vbam_showborders",
"(GB) Sınırları Göster",
NULL,
"Etkinleştirildiğinde, yüklü içerik SGB uyumluysa, bu durum oyundaki sınırı gösterir.",
NULL,
"video",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ "auto", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_gbcoloroption",
"(GB) Renk Düzeltme",
NULL,
"Bazı oyunlarda renkleri düzelten renk düzeltmesini uygular.",
NULL,
"video",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -119,7 +216,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{ {
"vbam_soundinterpolation", "vbam_soundinterpolation",
"Ses Enterpolasyonu", "Ses Enterpolasyonu",
NULL,
"Ses filtresini etkinleştirin veya devre dışı bırakın.", "Ses filtresini etkinleştirin veya devre dışı bırakın.",
NULL,
"audio",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -130,7 +230,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{ {
"vbam_soundfiltering", "vbam_soundfiltering",
"Ses Filtreleme", "Ses Filtreleme",
NULL,
"Kullanılacak filtreleme miktarını ayarlar. Yüksek değer, yüksek frekansları azaltır.", "Kullanılacak filtreleme miktarını ayarlar. Yüksek değer, yüksek frekansları azaltır.",
NULL,
"audio",
{ {
{ "0", NULL }, { "0", NULL },
{ "1", NULL }, { "1", NULL },
@ -147,77 +250,13 @@ struct retro_core_option_definition option_defs_tr[] = {
}, },
"5" "5"
}, },
{
"vbam_palettes",
"(GB) Renk Paleti",
"Game Boy paletlerini kullanmak için ayarlayın.",
{
{ "black and white", NULL },
{ "blue sea", NULL },
{ "dark knight", NULL },
{ "green forest", NULL },
{ "hot desert", NULL },
{ "pink dreams", NULL },
{ "wierd colors", NULL },
{ "original gameboy", NULL },
{ "gba sp", NULL },
{ NULL, NULL },
},
"standard"
},
{
"vbam_gbHardware",
"(GB) Öykünülmüş Donanım (Yeniden Başlatılması Gerekiyor)",
"Game Boy donanım tipini taklit edecek şekilde ayarlar. Uygulamak için çekirdeği yeniden başlatın.",
{
{ "gbc", "Game Boy Color" },
{ "auto", "Automatic" },
{ "sgb", "Super Game Boy" },
{ "gb", "Game Boy" },
{ "gba", "Game Boy Advance" },
{ "sgb2", "Super Game Boy 2" },
{ NULL, NULL },
},
"gbc"
},
{
"vbam_allowcolorizerhack",
"(GB) Colorizer Hack'i Etkinleştir (Yeniden Başlatılması Gerekiyor)",
"Colorizer'ın saldırıya uğramış GB oyunlarının (örn. DX yamalı oyunlar) normalde GBC / GBA donanım türünde çalışmasına izin verir. Bu ayrıca bios dosyasının kullanımını da devre dışı bırakır. Renklendirilmemiş oyunlarda kullanılması tavsiye edilmez.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_showborders",
"(GB) Sınırları Göster",
"Etkinleştirildiğinde, yüklü içerik SGB uyumluysa, bu durum oyundaki sınırı gösterir.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ "auto", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_gbcoloroption",
"(GB) Renk Düzeltme",
"Bazı oyunlarda renkleri düzelten renk düzeltmesini uygular.",
{
{ "disabled", NULL },
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{ {
"vbam_turboenable", "vbam_turboenable",
"Turbo Düğmelerini Etkinleştir", "Turbo Düğmelerini Etkinleştir",
NULL,
"Gamepad turbo düğmelerini etkinleştirin veya devre dışı bırakın.", "Gamepad turbo düğmelerini etkinleştirin veya devre dışı bırakın.",
NULL,
"input",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -228,7 +267,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{ {
"vbam_turbodelay", "vbam_turbodelay",
"Turbo Gecikme (kare cinsinden)", "Turbo Gecikme (kare cinsinden)",
NULL,
"Karelerde turbo tetikleyicilerin oranını tekrarlayın. Daha yüksek değer daha fazla tetikler.", "Karelerde turbo tetikleyicilerin oranını tekrarlayın. Daha yüksek değer daha fazla tetikler.",
NULL,
"input",
{ {
{ "1", NULL }, { "1", NULL },
{ "2", NULL }, { "2", NULL },
@ -249,10 +291,36 @@ struct retro_core_option_definition option_defs_tr[] = {
}, },
"3" "3"
}, },
{
"vbam_solarsensor",
"Solar Sensör Seviyesi",
NULL,
"Boktai oyunlarında simüle güneş seviyesini ayarlar. L2 / R2 düğmeleri ayrıca seviyeleri hızlıca değiştirmek için de kullanılabilir.",
NULL,
"input",
{
{ "0", NULL },
{ "1", NULL },
{ "2", NULL },
{ "3", NULL },
{ "4", NULL },
{ "5", NULL },
{ "6", NULL },
{ "7", NULL },
{ "8", NULL },
{ "9", NULL },
{ "10", NULL },
{ NULL, NULL },
},
"0"
},
{ {
"vbam_astick_deadzone", "vbam_astick_deadzone",
"Sensörlerin Ölü Bölgesi (%)", "Sensörlerin Ölü Bölgesi (%)",
NULL,
"Analog çubukların ölü bölgesini (yüzde olarak) ayarlayın.", "Analog çubukların ölü bölgesini (yüzde olarak) ayarlayın.",
NULL,
"input",
{ {
{ "0", NULL }, { "0", NULL },
{ "5", NULL }, { "5", NULL },
@ -268,7 +336,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{ {
"vbam_gyro_sensitivity", "vbam_gyro_sensitivity",
"Sensör Hassasiyeti (Jiroskop) (%)", "Sensör Hassasiyeti (Jiroskop) (%)",
NULL,
"Varsayılan konumlandırma, sol analogdur. Gyro özellikli oyunlar için hassasiyet seviyesini ayarlamak için kullanılır.", "Varsayılan konumlandırma, sol analogdur. Gyro özellikli oyunlar için hassasiyet seviyesini ayarlamak için kullanılır.",
NULL,
"input",
{ {
{ "10", NULL }, { "10", NULL },
{ "15", NULL }, { "15", NULL },
@ -300,7 +371,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{ {
"vbam_tilt_sensitivity", "vbam_tilt_sensitivity",
"Sensör Hassasiyeti (Eğim) (%)", "Sensör Hassasiyeti (Eğim) (%)",
NULL,
"Varsayılan konumlandırma sağ analogdur. Gyro özellikli oyunlar için hassasiyet seviyesini ayarlamak için kullanılır.", "Varsayılan konumlandırma sağ analogdur. Gyro özellikli oyunlar için hassasiyet seviyesini ayarlamak için kullanılır.",
NULL,
"input",
{ {
{ "10", NULL }, { "10", NULL },
{ "15", NULL }, { "15", NULL },
@ -332,18 +406,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{ {
"vbam_swap_astick", "vbam_swap_astick",
"Sol / Sağ Analog Değiştirme", "Sol / Sağ Analog Değiştirme",
NULL,
"Döndürme ve eğme için sola ve sağa analog çubuk işlevini değiştirir.", "Döndürme ve eğme için sola ve sağa analog çubuk işlevini değiştirir.",
{ NULL,
{ "disabled", NULL }, "input",
{ "enabled", NULL },
{ NULL, NULL },
},
"disabled"
},
{
"vbam_show_advanced_options",
"Gelişmiş Ayarları Göster",
"Ses kanallarını ve grafik katmanlarını etkinleştirebilen veya devre dışı bırakabilen gelişmiş seçenekleri gösterin.",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -354,7 +420,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{ {
"vbam_sound_1", "vbam_sound_1",
"Ses Kanalı 1", "Ses Kanalı 1",
NULL,
"Tonlu ve tarama ses kanalını etkinleştirir veya devre dışı bırakır.", "Tonlu ve tarama ses kanalını etkinleştirir veya devre dışı bırakır.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -365,7 +434,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{ {
"vbam_sound_2", "vbam_sound_2",
"Ses Kanalı 2", "Ses Kanalı 2",
NULL,
"Tonlu ses kanalını etkinleştirir veya devre dışı bırakır.", "Tonlu ses kanalını etkinleştirir veya devre dışı bırakır.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -376,7 +448,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{ {
"vbam_sound_3", "vbam_sound_3",
"Ses Kanalı 3", "Ses Kanalı 3",
NULL,
"Dalga çıkışı ses kanalını etkinleştirir veya devre dışı bırakır.", "Dalga çıkışı ses kanalını etkinleştirir veya devre dışı bırakır.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -387,7 +462,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{ {
"vbam_sound_4", "vbam_sound_4",
"Ses Kanalı 4", "Ses Kanalı 4",
NULL,
"Gürültü ses kanalını etkinleştirir veya devre dışı bırakır.", "Gürültü ses kanalını etkinleştirir veya devre dışı bırakır.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -398,7 +476,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{ {
"vbam_sound_5", "vbam_sound_5",
"DMA Ses Kanalı A", "DMA Ses Kanalı A",
NULL,
"DMA ses kanalı A'yı etkinleştirir veya devre dışı bırakır.", "DMA ses kanalı A'yı etkinleştirir veya devre dışı bırakır.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -409,7 +490,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{ {
"vbam_sound_6", "vbam_sound_6",
"DMA Ses Kanalı B", "DMA Ses Kanalı B",
NULL,
"DMA ses kanalı B'yi etkinleştirir veya devre dışı bırakır.", "DMA ses kanalı B'yi etkinleştirir veya devre dışı bırakır.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -420,7 +504,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{ {
"vbam_layer_1", "vbam_layer_1",
"Arka Plan Katmanını Göster 1", "Arka Plan Katmanını Göster 1",
NULL,
"1. arka plan katmanını gösterir veya gizler.", "1. arka plan katmanını gösterir veya gizler.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -431,7 +518,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{ {
"vbam_layer_2", "vbam_layer_2",
"Arka Plan Katmanını Göster 2", "Arka Plan Katmanını Göster 2",
NULL,
"2. arka plan katmanını gösterir veya gizler.", "2. arka plan katmanını gösterir veya gizler.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -442,7 +532,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{ {
"vbam_layer_3", "vbam_layer_3",
"Arka Plan Katmanını Göster 3", "Arka Plan Katmanını Göster 3",
NULL,
"3. arka plan katmanını gösterir veya gizler.", "3. arka plan katmanını gösterir veya gizler.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -453,7 +546,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{ {
"vbam_layer_4", "vbam_layer_4",
"Arka Plan Katmanını Göster 4", "Arka Plan Katmanını Göster 4",
NULL,
"4. arka plan katmanını gösterir veya gizler.", "4. arka plan katmanını gösterir veya gizler.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -464,7 +560,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{ {
"vbam_layer_5", "vbam_layer_5",
"Sprite Katmanını Göster", "Sprite Katmanını Göster",
NULL,
"Sprite katmanını gösterir veya gizler.", "Sprite katmanını gösterir veya gizler.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -475,7 +574,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{ {
"vbam_layer_6", "vbam_layer_6",
"Pencere Katmanını Göster 1", "Pencere Katmanını Göster 1",
NULL,
"Pencere katmanı 1'i gösterir veya gizler.", "Pencere katmanı 1'i gösterir veya gizler.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -486,7 +588,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{ {
"vbam_layer_7", "vbam_layer_7",
"Pencere Katmanını Göster 2", "Pencere Katmanını Göster 2",
NULL,
"Pencere katmanı 2'yi gösterir veya gizler.", "Pencere katmanı 2'yi gösterir veya gizler.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -497,7 +602,10 @@ struct retro_core_option_definition option_defs_tr[] = {
{ {
"vbam_layer_8", "vbam_layer_8",
"Sprite Pencere Katmanını Göster", "Sprite Pencere Katmanını Göster",
NULL,
"Sprite pencere katmanını gösterir veya gizler.", "Sprite pencere katmanını gösterir veya gizler.",
NULL,
"advanced",
{ {
{ "disabled", NULL }, { "disabled", NULL },
{ "enabled", NULL }, { "enabled", NULL },
@ -506,7 +614,12 @@ struct retro_core_option_definition option_defs_tr[] = {
"enabled" "enabled"
}, },
{ NULL, NULL, NULL, {{0}}, NULL } { NULL, NULL, NULL, NULL, NULL, NULL, { { NULL, NULL } }, NULL },
};
struct retro_core_options_v2 options_tr = {
option_cats_tr,
option_defs_tr
}; };
#ifdef __cplusplus #ifdef __cplusplus