diff --git a/mgba b/mgba index e3a42c1..9a1560e 160000 --- a/mgba +++ b/mgba @@ -1 +1 @@ -Subproject commit e3a42c1e83e90b747dcf2bfad7a532f13933e7d2 +Subproject commit 9a1560ebc8c5da7d5283f354705f816825f2ae1d diff --git a/source/gba.c b/source/gba.c index cc150c0..078097a 100644 --- a/source/gba.c +++ b/source/gba.c @@ -98,7 +98,7 @@ static uint32_t GBAEncrypt(uint32_t addr, uint32_t val, uint32_t *key) { *key = *key * bswap32('Kawa') + 1; val ^= *key; - val ^= ~addr + 1; + val ^= -addr; val ^= bswap32(' by '); return val; } @@ -126,13 +126,13 @@ static void *thread_func(void *arg) case SI_GC_CONTROLLER: case SI_GC_WAVEBIRD: if (gc_controller.status[chan].err == PAD_ERR_NO_CONTROLLER) { - gc_controller.status[chan].err = PAD_ERR_NOT_READY; + gc_controller.status[chan].err = PAD_ERR_NOT_READY; reset |= SI_CHAN_BIT(chan); } break; case SI_GC_STEERING: if (gc_steering.status[chan].err == SI_STEERING_ERR_NO_CONTROLLER) - gc_steering.status[chan].err = SI_ResetSteering(chan); + gc_steering.status[chan].err = SI_ResetSteering(chan); break; case SI_N64_CONTROLLER: N64_ReadAsync(chan, &n64_controller.status[chan], NULL); diff --git a/source/gx.c b/source/gx.c index 90fbb45..0b8b6f8 100644 --- a/source/gx.c +++ b/source/gx.c @@ -415,8 +415,8 @@ void *GXOpenFile(const char *file) gzFile zfp = gzopen(file, "rb"); return funopen(zfp, - (int (*)(void *, char *, int))gzread, - (int (*)(void *, const char *, int))gzwrite, + (int (*)(void *, char *, size_t))gzread, + (int (*)(void *, const char *, size_t))gzwrite, (fpos_t (*)(void *, fpos_t, int))gzseek, (int (*)(void *))gzclose); } diff --git a/source/main.c b/source/main.c index 5638cb0..835a6a3 100644 --- a/source/main.c +++ b/source/main.c @@ -1020,7 +1020,7 @@ static void _drawFrame(struct mGUIRunner *runner, bool faded) dispsize[1] = GX_EndDispList(); } -static void _drawScreenshot(struct mGUIRunner *runner, const color_t *pixels, unsigned width, unsigned height, bool faded) +static void _drawScreenshot(struct mGUIRunner *runner, const mColor *pixels, unsigned width, unsigned height, bool faded) { rect_t planar_src = {0, 0, width, height}; rect_t prescale_src = {0, 0, planar_src.w * state.scale, planar_src.h * state.scale};