all repos — mgba @ 7d4f1fb661eed317a70864ca5ece12cae8dc55df

mGBA Game Boy Advance Emulator

Fix loading too many states from a file
Jeffrey Pfau jeffrey@endrift.com
Sat, 19 Jul 2014 17:54:29 -0700
commit

7d4f1fb661eed317a70864ca5ece12cae8dc55df

parent

7172e6428cf6c880ae2c70ca35cfaf237e58cd7f

1 files changed, 6 insertions(+), 1 deletions(-)

jump to
M src/gba/gba-rr.csrc/gba/gba-rr.c

@@ -85,7 +85,11 @@ if (!inputs) {

return false; } - struct GBARRBlock block; + struct GBARRBlock block = { + .next = 0, + .numInputs = GBA_RR_BLOCK_SIZE + }; + ssize_t read; do { read = inputs->read(inputs, block.inputs, sizeof(block.inputs));

@@ -99,6 +103,7 @@ if (rr->currentBlock) {

rr->currentBlock->next = newBlock; } rr->currentBlock = newBlock; + newBlock->numInputs = read / sizeof(block.inputs[0]); } } while (read > 0);