mirror of https://github.com/mgba-emu/mgba.git
DS GX: Properly reject invalid commands
This commit is contained in:
parent
2b4a4b5ab6
commit
0b0739f567
1
CHANGES
1
CHANGES
|
@ -14,6 +14,7 @@ Bugfixes:
|
||||||
- DS Slot-1: Reply to IR 0x08 command properly (fixes mgba.io/i/666)
|
- DS Slot-1: Reply to IR 0x08 command properly (fixes mgba.io/i/666)
|
||||||
- GBA Video: Fix mode 2 out-of-bounds VRAM crash
|
- GBA Video: Fix mode 2 out-of-bounds VRAM crash
|
||||||
- GBA Video: Fix regression adjusting brightness of backdrop
|
- GBA Video: Fix regression adjusting brightness of backdrop
|
||||||
|
- DS GX: Properly reject invalid commands
|
||||||
Misc:
|
Misc:
|
||||||
- DS GX: Clean up and unify texture mapping
|
- DS GX: Clean up and unify texture mapping
|
||||||
- DS Core: Add symbol loading
|
- DS Core: Add symbol loading
|
||||||
|
|
|
@ -1437,6 +1437,10 @@ static void DSGXWriteFIFO(struct DSGX* gx, struct DSGXEntry entry) {
|
||||||
gx->outstandingCommand[3] = 0;
|
gx->outstandingCommand[3] = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (entry.command >= DS_GX_CMD_MAX) {
|
||||||
|
mLOG(DS_GX, GAME_ERROR, "Wrote invalid command %02x to GX FIFO", entry.command);
|
||||||
|
return;
|
||||||
|
}
|
||||||
gx->outstandingParams[0] = _gxCommandParams[entry.command];
|
gx->outstandingParams[0] = _gxCommandParams[entry.command];
|
||||||
if (gx->outstandingParams[0]) {
|
if (gx->outstandingParams[0]) {
|
||||||
--gx->outstandingParams[0];
|
--gx->outstandingParams[0];
|
||||||
|
@ -1447,6 +1451,7 @@ static void DSGXWriteFIFO(struct DSGX* gx, struct DSGXEntry entry) {
|
||||||
}
|
}
|
||||||
uint32_t cycles = _gxCommandCycleBase[entry.command];
|
uint32_t cycles = _gxCommandCycleBase[entry.command];
|
||||||
if (!cycles) {
|
if (!cycles) {
|
||||||
|
mLOG(DS_GX, GAME_ERROR, "Wrote invalid command %02x to GX FIFO", entry.command);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (CircleBufferSize(&gx->fifo) == 0 && CircleBufferSize(&gx->pipe) < (DS_GX_PIPE_SIZE * sizeof(entry))) {
|
if (CircleBufferSize(&gx->fifo) == 0 && CircleBufferSize(&gx->pipe) < (DS_GX_PIPE_SIZE * sizeof(entry))) {
|
||||||
|
|
Loading…
Reference in New Issue