mirror of
https://github.com/libretro/mgba.git
synced 2024-11-30 11:40:28 +00:00
GBA Video: Remove lastHblank, as it is implied
This commit is contained in:
parent
3a15553c09
commit
d490f9a013
1
CHANGES
1
CHANGES
@ -36,6 +36,7 @@ Misc:
|
|||||||
- GBA BIOS: Implement RegisterRamReset for SIO registers
|
- GBA BIOS: Implement RegisterRamReset for SIO registers
|
||||||
- GBA: Additional savestate sanity checks
|
- GBA: Additional savestate sanity checks
|
||||||
- All: Reset next event to cycles instead of zero to interrupt
|
- All: Reset next event to cycles instead of zero to interrupt
|
||||||
|
- GBA Video: Remove lastHblank, as it is implied
|
||||||
|
|
||||||
0.3.0: (2015-08-16)
|
0.3.0: (2015-08-16)
|
||||||
Features:
|
Features:
|
||||||
|
@ -71,7 +71,6 @@ void GBAVideoReset(struct GBAVideo* video) {
|
|||||||
}
|
}
|
||||||
video->p->memory.io[REG_VCOUNT >> 1] = video->vcount;
|
video->p->memory.io[REG_VCOUNT >> 1] = video->vcount;
|
||||||
|
|
||||||
video->lastHblank = 0;
|
|
||||||
video->nextHblank = VIDEO_HDRAW_LENGTH;
|
video->nextHblank = VIDEO_HDRAW_LENGTH;
|
||||||
video->nextEvent = video->nextHblank;
|
video->nextEvent = video->nextHblank;
|
||||||
video->eventDiff = 0;
|
video->eventDiff = 0;
|
||||||
@ -120,7 +119,6 @@ int32_t GBAVideoProcessEvents(struct GBAVideo* video, int32_t cycles) {
|
|||||||
video->eventDiff += cycles;
|
video->eventDiff += cycles;
|
||||||
if (video->nextEvent <= 0) {
|
if (video->nextEvent <= 0) {
|
||||||
int32_t lastEvent = video->nextEvent;
|
int32_t lastEvent = video->nextEvent;
|
||||||
video->lastHblank -= video->eventDiff;
|
|
||||||
video->nextHblank -= video->eventDiff;
|
video->nextHblank -= video->eventDiff;
|
||||||
video->nextHblankIRQ -= video->eventDiff;
|
video->nextHblankIRQ -= video->eventDiff;
|
||||||
video->nextVcounterIRQ -= video->eventDiff;
|
video->nextVcounterIRQ -= video->eventDiff;
|
||||||
@ -178,8 +176,7 @@ int32_t GBAVideoProcessEvents(struct GBAVideo* video, int32_t cycles) {
|
|||||||
} else {
|
} else {
|
||||||
// Begin Hblank
|
// Begin Hblank
|
||||||
dispstat = GBARegisterDISPSTATFillInHblank(dispstat);
|
dispstat = GBARegisterDISPSTATFillInHblank(dispstat);
|
||||||
video->lastHblank = video->nextHblank;
|
video->nextEvent = video->nextHblank + VIDEO_HBLANK_LENGTH;
|
||||||
video->nextEvent = video->lastHblank + VIDEO_HBLANK_LENGTH;
|
|
||||||
video->nextHblank = video->nextEvent + VIDEO_HDRAW_LENGTH;
|
video->nextHblank = video->nextEvent + VIDEO_HDRAW_LENGTH;
|
||||||
video->nextHblankIRQ = video->nextHblank;
|
video->nextHblankIRQ = video->nextHblank;
|
||||||
|
|
||||||
@ -278,7 +275,7 @@ void GBAVideoSerialize(const struct GBAVideo* video, struct GBASerializedState*
|
|||||||
memcpy(state->pram, video->palette, SIZE_PALETTE_RAM);
|
memcpy(state->pram, video->palette, SIZE_PALETTE_RAM);
|
||||||
state->video.nextEvent = video->nextEvent;
|
state->video.nextEvent = video->nextEvent;
|
||||||
state->video.eventDiff = video->eventDiff;
|
state->video.eventDiff = video->eventDiff;
|
||||||
state->video.lastHblank = video->lastHblank;
|
state->video.lastHblank = video->nextHblank - VIDEO_HBLANK_LENGTH;
|
||||||
state->video.nextHblank = video->nextHblank;
|
state->video.nextHblank = video->nextHblank;
|
||||||
state->video.nextHblankIRQ = video->nextHblankIRQ;
|
state->video.nextHblankIRQ = video->nextHblankIRQ;
|
||||||
state->video.nextVblankIRQ = video->nextVblankIRQ;
|
state->video.nextVblankIRQ = video->nextVblankIRQ;
|
||||||
@ -300,7 +297,6 @@ void GBAVideoDeserialize(struct GBAVideo* video, const struct GBASerializedState
|
|||||||
}
|
}
|
||||||
video->nextEvent = state->video.nextEvent;
|
video->nextEvent = state->video.nextEvent;
|
||||||
video->eventDiff = state->video.eventDiff;
|
video->eventDiff = state->video.eventDiff;
|
||||||
video->lastHblank = state->video.lastHblank;
|
|
||||||
video->nextHblank = state->video.nextHblank;
|
video->nextHblank = state->video.nextHblank;
|
||||||
video->nextHblankIRQ = state->video.nextHblankIRQ;
|
video->nextHblankIRQ = state->video.nextHblankIRQ;
|
||||||
video->nextVblankIRQ = state->video.nextVblankIRQ;
|
video->nextVblankIRQ = state->video.nextVblankIRQ;
|
||||||
|
@ -185,7 +185,6 @@ struct GBAVideo {
|
|||||||
// VCOUNT
|
// VCOUNT
|
||||||
int vcount;
|
int vcount;
|
||||||
|
|
||||||
int32_t lastHblank;
|
|
||||||
int32_t nextHblank;
|
int32_t nextHblank;
|
||||||
int32_t nextEvent;
|
int32_t nextEvent;
|
||||||
int32_t eventDiff;
|
int32_t eventDiff;
|
||||||
|
Loading…
Reference in New Issue
Block a user