mirror of https://github.com/mgba-emu/mgba.git
Core: Frame counter should be unsigned
This commit is contained in:
parent
cb0af1b77b
commit
9a85fc8a5a
|
@ -106,7 +106,7 @@ struct mCore {
|
||||||
void (*addKeys)(struct mCore*, uint32_t keys);
|
void (*addKeys)(struct mCore*, uint32_t keys);
|
||||||
void (*clearKeys)(struct mCore*, uint32_t keys);
|
void (*clearKeys)(struct mCore*, uint32_t keys);
|
||||||
|
|
||||||
int32_t (*frameCounter)(const struct mCore*);
|
uint32_t (*frameCounter)(const struct mCore*);
|
||||||
int32_t (*frameCycles)(const struct mCore*);
|
int32_t (*frameCycles)(const struct mCore*);
|
||||||
int32_t (*frequency)(const struct mCore*);
|
int32_t (*frequency)(const struct mCore*);
|
||||||
|
|
||||||
|
|
|
@ -329,7 +329,7 @@ struct GBSerializedState {
|
||||||
uint32_t reserved;
|
uint32_t reserved;
|
||||||
uint32_t nextMode;
|
uint32_t nextMode;
|
||||||
int32_t dotCounter;
|
int32_t dotCounter;
|
||||||
int32_t frameCounter;
|
uint32_t frameCounter;
|
||||||
|
|
||||||
uint8_t vramCurrentBank;
|
uint8_t vramCurrentBank;
|
||||||
GBSerializedVideoFlags flags;
|
GBSerializedVideoFlags flags;
|
||||||
|
|
|
@ -163,7 +163,7 @@ struct GBVideo {
|
||||||
|
|
||||||
bool sgbBorders;
|
bool sgbBorders;
|
||||||
|
|
||||||
int32_t frameCounter;
|
uint32_t frameCounter;
|
||||||
int frameskip;
|
int frameskip;
|
||||||
int frameskipCounter;
|
int frameskipCounter;
|
||||||
};
|
};
|
||||||
|
|
|
@ -303,7 +303,7 @@ struct GBASerializedState {
|
||||||
int32_t nextEvent;
|
int32_t nextEvent;
|
||||||
int32_t reserved[5];
|
int32_t reserved[5];
|
||||||
GBASerializedVideoFlags flags;
|
GBASerializedVideoFlags flags;
|
||||||
int32_t frameCounter;
|
uint32_t frameCounter;
|
||||||
} video;
|
} video;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
|
|
@ -215,7 +215,7 @@ struct GBAVideo {
|
||||||
uint16_t* vram;
|
uint16_t* vram;
|
||||||
union GBAOAM oam;
|
union GBAOAM oam;
|
||||||
|
|
||||||
int32_t frameCounter;
|
uint32_t frameCounter;
|
||||||
int frameskip;
|
int frameskip;
|
||||||
int frameskipCounter;
|
int frameskipCounter;
|
||||||
};
|
};
|
||||||
|
|
|
@ -108,7 +108,7 @@ void mDebuggerRun(struct mDebugger* debugger) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void mDebuggerRunFrame(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 {
|
do {
|
||||||
mDebuggerRun(debugger);
|
mDebuggerRun(debugger);
|
||||||
} while (debugger->core->frameCounter(debugger->core) == frame);
|
} while (debugger->core->frameCounter(debugger->core) == frame);
|
||||||
|
|
|
@ -636,7 +636,7 @@ static void _GBCoreReset(struct mCore* core) {
|
||||||
|
|
||||||
static void _GBCoreRunFrame(struct mCore* core) {
|
static void _GBCoreRunFrame(struct mCore* core) {
|
||||||
struct GB* gb = core->board;
|
struct GB* gb = core->board;
|
||||||
int32_t frameCounter = gb->video.frameCounter;
|
uint32_t frameCounter = gb->video.frameCounter;
|
||||||
while (gb->video.frameCounter == frameCounter) {
|
while (gb->video.frameCounter == frameCounter) {
|
||||||
SM83Run(core->cpu);
|
SM83Run(core->cpu);
|
||||||
}
|
}
|
||||||
|
@ -688,7 +688,7 @@ static void _GBCoreClearKeys(struct mCore* core, uint32_t keys) {
|
||||||
gbcore->keys &= ~keys;
|
gbcore->keys &= ~keys;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t _GBCoreFrameCounter(const struct mCore* core) {
|
static uint32_t _GBCoreFrameCounter(const struct mCore* core) {
|
||||||
const struct GB* gb = core->board;
|
const struct GB* gb = core->board;
|
||||||
return gb->video.frameCounter;
|
return gb->video.frameCounter;
|
||||||
}
|
}
|
||||||
|
|
|
@ -665,7 +665,7 @@ static void _GBACoreReset(struct mCore* core) {
|
||||||
|
|
||||||
static void _GBACoreRunFrame(struct mCore* core) {
|
static void _GBACoreRunFrame(struct mCore* core) {
|
||||||
struct GBA* gba = core->board;
|
struct GBA* gba = core->board;
|
||||||
int32_t frameCounter = gba->video.frameCounter;
|
uint32_t frameCounter = gba->video.frameCounter;
|
||||||
uint32_t startCycle = mTimingCurrentTime(&gba->timing);
|
uint32_t startCycle = mTimingCurrentTime(&gba->timing);
|
||||||
while (gba->video.frameCounter == frameCounter && mTimingCurrentTime(&gba->timing) - startCycle < VIDEO_TOTAL_LENGTH + VIDEO_HORIZONTAL_LENGTH) {
|
while (gba->video.frameCounter == frameCounter && mTimingCurrentTime(&gba->timing) - startCycle < VIDEO_TOTAL_LENGTH + VIDEO_HORIZONTAL_LENGTH) {
|
||||||
ARMRunLoop(core->cpu);
|
ARMRunLoop(core->cpu);
|
||||||
|
@ -712,7 +712,7 @@ static void _GBACoreClearKeys(struct mCore* core, uint32_t keys) {
|
||||||
GBATestKeypadIRQ(gba);
|
GBATestKeypadIRQ(gba);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t _GBACoreFrameCounter(const struct mCore* core) {
|
static uint32_t _GBACoreFrameCounter(const struct mCore* core) {
|
||||||
const struct GBA* gba = core->board;
|
const struct GBA* gba = core->board;
|
||||||
return gba->video.frameCounter;
|
return gba->video.frameCounter;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue