GBA: Fix GB Player features

This commit is contained in:
Vicki Pfau 2019-01-08 23:19:33 -08:00
parent 3dc30a13d1
commit 69014400db
3 changed files with 14 additions and 13 deletions

View File

@ -144,6 +144,7 @@ Bugfixes:
- GBA I/O: SOUNDCNT_HI is readable when sound is off
- SDL: Fix handling of invalid gamepads (fixes mgba.io/i/1239)
- Libretro: Fix adding codes with hooks
- GBA: Fix GB Player features
Misc:
- mGUI: Add SGB border configuration option
- mGUI: Add support for different settings types

View File

@ -539,9 +539,9 @@ void GBAHardwarePlayerUpdate(struct GBA* gba) {
uint16_t _gbpRead(struct mKeyCallback* callback) {
struct GBAGBPKeyCallback* gbpCallback = (struct GBAGBPKeyCallback*) callback;
if (gbpCallback->p->gbpInputsPosted == 2) {
return 0x30F;
return 0xF0;
}
return 0x3FF;
return 0;
}
uint16_t _gbpSioWriteRegister(struct GBASIODriver* driver, uint32_t address, uint16_t value) {

View File

@ -728,7 +728,7 @@ uint16_t GBAIORead(struct GBA* gba, uint32_t address) {
if (gba->rr && gba->rr->isPlaying(gba->rr)) {
return 0x3FF ^ gba->rr->queryInput(gba->rr);
} else {
uint16_t input = 0x3FF;
uint16_t input = 0;
if (gba->keyCallback) {
input = gba->keyCallback->readKeys(gba->keyCallback);
if (gba->keySource) {
@ -736,16 +736,16 @@ uint16_t GBAIORead(struct GBA* gba, uint32_t address) {
}
} else if (gba->keySource) {
input = *gba->keySource;
}
if (!gba->allowOpposingDirections) {
unsigned rl = input & 0x030;
unsigned ud = input & 0x0C0;
input &= 0x30F;
if (rl != 0x030) {
input |= rl;
}
if (ud != 0x0C0) {
input |= ud;
if (!gba->allowOpposingDirections) {
unsigned rl = input & 0x030;
unsigned ud = input & 0x0C0;
input &= 0x30F;
if (rl != 0x030) {
input |= rl;
}
if (ud != 0x0C0) {
input |= ud;
}
}
}
if (gba->rr && gba->rr->isRecording(gba->rr)) {