all repos — mgba @ b51710e92f0d9050666a531c060c0c4343e3e13f

mGBA Game Boy Advance Emulator

GBA: Use GBALog with appropriate GBA object in new GPIO code
Jeffrey Pfau jeffrey@endrift.com
Thu, 01 Jan 2015 16:04:05 -0800
commit

b51710e92f0d9050666a531c060c0c4343e3e13f

parent

6938c8bea670ec9d8dbdd7a892e20e83226c11e7

1 files changed, 6 insertions(+), 6 deletions(-)

jump to
M src/gba/gba-gpio.csrc/gba/gba-gpio.c

@@ -341,7 +341,7 @@ return;

} if (gpio->p1) { struct GBALuminanceSource* lux = gpio->p->luminanceSource; - GBALog(0, GBA_LOG_DEBUG, "[SOLAR] Got reset"); + GBALog(gpio->p, GBA_LOG_DEBUG, "[SOLAR] Got reset"); gpio->lightCounter = 0; if (lux) { lux->sample(lux);

@@ -357,7 +357,7 @@ gpio->lightEdge = !gpio->p0;

bool sendBit = gpio->lightCounter >= gpio->lightSample; _outputPins(gpio, sendBit << 3); - GBALog(0, GBA_LOG_DEBUG, "[SOLAR] Output %u with pins %u", gpio->lightCounter, gpio->pinState); + GBALog(gpio->p, GBA_LOG_DEBUG, "[SOLAR] Output %u with pins %u", gpio->lightCounter, gpio->pinState); } // == Tilt (not technically GPIO)

@@ -375,7 +375,7 @@ case 0x8000:

if (value == 0x55) { gpio->tiltState = 1; } else { - GBALog(0, GBA_LOG_GAME_ERROR, "Tilt sensor wrote wrong byte to %04x: %02x", address, value); + GBALog(gpio->p, GBA_LOG_GAME_ERROR, "Tilt sensor wrote wrong byte to %04x: %02x", address, value); } break; case 0x8100:

@@ -394,11 +394,11 @@ // Normalize to ~12 bits, focused on 0x3A0

gpio->tiltX = (x >> 21) + 0x3A0; // Crop off an extra bit so that we can't go negative gpio->tiltY = (y >> 21) + 0x3A0; } else { - GBALog(0, GBA_LOG_GAME_ERROR, "Tilt sensor wrote wrong byte to %04x: %02x", address, value); + GBALog(gpio->p, GBA_LOG_GAME_ERROR, "Tilt sensor wrote wrong byte to %04x: %02x", address, value); } break; default: - GBALog(0, GBA_LOG_GAME_ERROR, "Invalid tilt sensor write to %04x: %02x", address, value); + GBALog(gpio->p, GBA_LOG_GAME_ERROR, "Invalid tilt sensor write to %04x: %02x", address, value); break; } }

@@ -414,7 +414,7 @@ return gpio->tiltY & 0xFF;

case 0x8500: return (gpio->tiltY >> 8) & 0xF; default: - GBALog(0, GBA_LOG_GAME_ERROR, "Invalid tilt sensor read from %04x", address); + GBALog(gpio->p, GBA_LOG_GAME_ERROR, "Invalid tilt sensor read from %04x", address); break; } return 0xFF;