diff --git a/include/mgba/core/core.h b/include/mgba/core/core.h index dcd9bffb1..59d75ebea 100644 --- a/include/mgba/core/core.h +++ b/include/mgba/core/core.h @@ -111,7 +111,7 @@ struct mCore { void (*setCursorLocation)(struct mCore*, int x, int y); void (*setCursorDown)(struct mCore*, bool down); - int32_t (*frameCounter)(const struct mCore*); + uint32_t (*frameCounter)(const struct mCore*); int32_t (*frameCycles)(const struct mCore*); int32_t (*frequency)(const struct mCore*); diff --git a/include/mgba/internal/gb/serialize.h b/include/mgba/internal/gb/serialize.h index 5191e0966..5a26a6937 100644 --- a/include/mgba/internal/gb/serialize.h +++ b/include/mgba/internal/gb/serialize.h @@ -329,7 +329,7 @@ struct GBSerializedState { uint32_t reserved; uint32_t nextMode; int32_t dotCounter; - int32_t frameCounter; + uint32_t frameCounter; uint8_t vramCurrentBank; GBSerializedVideoFlags flags; diff --git a/include/mgba/internal/gb/video.h b/include/mgba/internal/gb/video.h index da83ebc2a..31c54b089 100644 --- a/include/mgba/internal/gb/video.h +++ b/include/mgba/internal/gb/video.h @@ -163,7 +163,7 @@ struct GBVideo { bool sgbBorders; - int32_t frameCounter; + uint32_t frameCounter; int frameskip; int frameskipCounter; }; diff --git a/include/mgba/internal/gba/serialize.h b/include/mgba/internal/gba/serialize.h index b9bdcbea7..203c4fb0c 100644 --- a/include/mgba/internal/gba/serialize.h +++ b/include/mgba/internal/gba/serialize.h @@ -303,7 +303,7 @@ struct GBASerializedState { int32_t nextEvent; int32_t reserved[5]; GBASerializedVideoFlags flags; - int32_t frameCounter; + uint32_t frameCounter; } video; struct { diff --git a/include/mgba/internal/gba/video.h b/include/mgba/internal/gba/video.h index 3d90fc571..94ac19f3e 100644 --- a/include/mgba/internal/gba/video.h +++ b/include/mgba/internal/gba/video.h @@ -220,7 +220,7 @@ struct GBAVideo { uint16_t* vram; union GBAOAM oam; - int32_t frameCounter; + uint32_t frameCounter; int frameskip; int frameskipCounter; }; diff --git a/src/debugger/debugger.c b/src/debugger/debugger.c index 169123451..bdf7b1cab 100644 --- a/src/debugger/debugger.c +++ b/src/debugger/debugger.c @@ -108,7 +108,7 @@ void mDebuggerRun(struct mDebugger* debugger) { } void mDebuggerRunFrame(struct mDebugger* debugger) { - int32_t frame = debugger->core->frameCounter(debugger->core); + uint32_t frame = debugger->core->frameCounter(debugger->core); do { mDebuggerRun(debugger); } while (debugger->core->frameCounter(debugger->core) == frame); diff --git a/src/ds/core.c b/src/ds/core.c index 767d5e2c3..6fddeea31 100644 --- a/src/ds/core.c +++ b/src/ds/core.c @@ -466,7 +466,7 @@ static void _DSCoreSetCursorDown(struct mCore* core, bool down) { dscore->touchDown = down; } -static int32_t _DSCoreFrameCounter(const struct mCore* core) { +static uint32_t _DSCoreFrameCounter(const struct mCore* core) { struct DS* ds = core->board; return ds->video.frameCounter; } diff --git a/src/gb/core.c b/src/gb/core.c index 6e39bad68..f5fd6343a 100644 --- a/src/gb/core.c +++ b/src/gb/core.c @@ -648,7 +648,7 @@ static void _GBCoreReset(struct mCore* core) { static void _GBCoreRunFrame(struct mCore* core) { struct GB* gb = core->board; - int32_t frameCounter = gb->video.frameCounter; + uint32_t frameCounter = gb->video.frameCounter; while (gb->video.frameCounter == frameCounter) { SM83Run(core->cpu); } @@ -711,7 +711,7 @@ static void _GBCoreSetCursorDown(struct mCore* core, bool down) { UNUSED(down); } -static int32_t _GBCoreFrameCounter(const struct mCore* core) { +static uint32_t _GBCoreFrameCounter(const struct mCore* core) { const struct GB* gb = core->board; return gb->video.frameCounter; } diff --git a/src/gba/core.c b/src/gba/core.c index f24f4c5ec..90a64f0d2 100644 --- a/src/gba/core.c +++ b/src/gba/core.c @@ -676,7 +676,7 @@ static void _GBACoreReset(struct mCore* core) { static void _GBACoreRunFrame(struct mCore* core) { struct GBA* gba = core->board; - int32_t frameCounter = gba->video.frameCounter; + uint32_t frameCounter = gba->video.frameCounter; uint32_t startCycle = mTimingCurrentTime(&gba->timing); while (gba->video.frameCounter == frameCounter && mTimingCurrentTime(&gba->timing) - startCycle < VIDEO_TOTAL_LENGTH + VIDEO_HORIZONTAL_LENGTH) { ARMv4RunLoop(core->cpu); @@ -734,7 +734,7 @@ static void _GBACoreSetCursorDown(struct mCore* core, bool down) { UNUSED(down); } -static int32_t _GBACoreFrameCounter(const struct mCore* core) { +static uint32_t _GBACoreFrameCounter(const struct mCore* core) { const struct GBA* gba = core->board; return gba->video.frameCounter; }