Remove video vars serialization
This is not needed at all, since the variables are not updated between reload and end-of-frame (where we take our savestates). Added a reload call during gba_load_state() to initialize it from the I/O regs.
This commit is contained in:
parent
745b2ece2c
commit
7f7d066854
4 changed files with 18 additions and 12 deletions
|
@ -3122,8 +3122,7 @@ void memory_term(void)
|
||||||
input_##type##_savestate(); \
|
input_##type##_savestate(); \
|
||||||
main_##type##_savestate(); \
|
main_##type##_savestate(); \
|
||||||
memory_##type##_savestate(); \
|
memory_##type##_savestate(); \
|
||||||
sound_##type##_savestate(); \
|
sound_##type##_savestate();
|
||||||
video_##type##_savestate()
|
|
||||||
|
|
||||||
|
|
||||||
const u8 *state_mem_read_ptr;
|
const u8 *state_mem_read_ptr;
|
||||||
|
@ -3152,6 +3151,8 @@ void gba_load_state(const void* src)
|
||||||
convert_palette(current_color);
|
convert_palette(current_color);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
video_reload_counters();
|
||||||
|
|
||||||
// Oops, these contain raw pointers
|
// Oops, these contain raw pointers
|
||||||
for(i = 0; i < 4; i++)
|
for(i = 0; i < 4; i++)
|
||||||
gbc_sound_channel[i].sample_table_idx = 2;
|
gbc_sound_channel[i].sample_table_idx = 2;
|
||||||
|
|
9
main.c
9
main.c
|
@ -195,14 +195,7 @@ u32 update_gba(void)
|
||||||
irq_raised |= IRQ_VBLANK;
|
irq_raised |= IRQ_VBLANK;
|
||||||
}
|
}
|
||||||
|
|
||||||
affine_reference_x[0] =
|
video_reload_counters();
|
||||||
(s32)(readaddress32(io_registers, 0x28) << 4) >> 4;
|
|
||||||
affine_reference_y[0] =
|
|
||||||
(s32)(readaddress32(io_registers, 0x2C) << 4) >> 4;
|
|
||||||
affine_reference_x[1] =
|
|
||||||
(s32)(readaddress32(io_registers, 0x38) << 4) >> 4;
|
|
||||||
affine_reference_y[1] =
|
|
||||||
(s32)(readaddress32(io_registers, 0x3C) << 4) >> 4;
|
|
||||||
|
|
||||||
for(i = 0; i < 4; i++)
|
for(i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
|
|
13
video.c
13
video.c
|
@ -2336,6 +2336,19 @@ static void render_scanline_text_transparent_alpha(u32 layer,
|
||||||
s32 affine_reference_x[2];
|
s32 affine_reference_x[2];
|
||||||
s32 affine_reference_y[2];
|
s32 affine_reference_y[2];
|
||||||
|
|
||||||
|
void video_reload_counters()
|
||||||
|
{
|
||||||
|
/* This happens every Vblank */
|
||||||
|
affine_reference_x[0] = (s32)(read_ioreg(REG_BG2X_L) |
|
||||||
|
((read_ioreg(REG_BG2X_H) & 0xFFF) << 16));
|
||||||
|
affine_reference_y[0] = (s32)(read_ioreg(REG_BG2Y_L) |
|
||||||
|
((read_ioreg(REG_BG2Y_H) & 0xFFF) << 16));
|
||||||
|
affine_reference_x[1] = (s32)(read_ioreg(REG_BG3X_L) |
|
||||||
|
((read_ioreg(REG_BG3X_H) & 0xFFF) << 16));
|
||||||
|
affine_reference_y[1] = (s32)(read_ioreg(REG_BG3Y_L) |
|
||||||
|
((read_ioreg(REG_BG3Y_H) & 0xFFF) << 16));
|
||||||
|
}
|
||||||
|
|
||||||
#define affine_render_bg_pixel_normal() \
|
#define affine_render_bg_pixel_normal() \
|
||||||
current_pixel = palette_ram_converted[0] \
|
current_pixel = palette_ram_converted[0] \
|
||||||
|
|
||||||
|
|
3
video.h
3
video.h
|
@ -21,8 +21,7 @@
|
||||||
#define VIDEO_H
|
#define VIDEO_H
|
||||||
|
|
||||||
void update_scanline(void);
|
void update_scanline(void);
|
||||||
void video_write_savestate(void);
|
void video_reload_counters(void);
|
||||||
void video_read_savestate(void);
|
|
||||||
|
|
||||||
extern s32 affine_reference_x[2];
|
extern s32 affine_reference_x[2];
|
||||||
extern s32 affine_reference_y[2];
|
extern s32 affine_reference_y[2];
|
||||||
|
|
Loading…
Add table
Reference in a new issue