Full savestating to memory
This commit is contained in:
15
lib/ppu.c
15
lib/ppu.c
@ -84,4 +84,19 @@ void ppu_vram_write(u16 address, u8 value){
|
||||
|
||||
u8 ppu_vram_read(u16 address){
|
||||
return ctx.vram[address - 0x8000];
|
||||
}
|
||||
|
||||
void ppu_save_state(ppu_state* state) {
|
||||
state->ctx = ctx;
|
||||
state->ctx.line_sprites = NULL;
|
||||
state->ctx.line_sprite_count = 0;
|
||||
state->ctx.pfc.pixel_fifo.size = 0;
|
||||
state->ctx.pfc.pixel_fifo.head = 0;
|
||||
state->ctx.pfc.pixel_fifo.tail = 0;
|
||||
}
|
||||
|
||||
void ppu_load_state(const ppu_state* state) {
|
||||
free(ctx.video_buffer);
|
||||
ctx = state->ctx;
|
||||
ctx.video_buffer = malloc(YRES * XRES * sizeof(u32));
|
||||
}
|
Reference in New Issue
Block a user