void pl_init(void)
{
extern unsigned int hSyncCount; // from psxcounters
+ extern unsigned int frame_counter;
pl_vout_w = pl_vout_h = 256;
pl_vout_bpp = 16;
tsdev = pl_gun_ts_init();
pl_rearmed_cbs.gpu_hcnt = &hSyncCount;
+ pl_rearmed_cbs.gpu_frame_count = &frame_counter;
}
#define noinline __attribute__((noinline))
#define gpu_log(fmt, ...) \
- printf("%d:%03d: " fmt, gpu.state.frame_count, *gpu.state.hcnt, ##__VA_ARGS__)
+ printf("%d:%03d: " fmt, *gpu.state.frame_count, *gpu.state.hcnt, ##__VA_ARGS__)
//#define log_io gpu_log
#define log_io(...)
ret = vout_init();
ret |= renderer_init();
- gpu.state.frame_count = 0;
+ gpu.state.frame_count = &gpu.zero;
gpu.state.hcnt = &gpu.zero;
do_reset();
return ret;
flush_cmd_buffer();
// ff7 sends it's main list twice, detect this
- if (gpu.state.frame_count == gpu.state.last_list.frame &&
- *gpu.state.hcnt - gpu.state.last_list.hcnt <= 1 &&
- gpu.state.last_list.words > 1024)
+ if (*gpu.state.frame_count == gpu.state.last_list.frame &&
+ *gpu.state.hcnt - gpu.state.last_list.hcnt <= 1 &&
+ gpu.state.last_list.words > 1024)
{
llist_entry = rambase + (gpu.state.last_list.addr & 0x1fffff) / 4;
*llist_entry |= 0x800000;
if (llist_entry)
*llist_entry &= ~0x800000;
- gpu.state.last_list.frame = gpu.state.frame_count;
+ gpu.state.last_list.frame = *gpu.state.frame_count;
gpu.state.last_list.hcnt = *gpu.state.hcnt;
gpu.state.last_list.words = dma_words;
gpu.state.last_list.addr = start_addr;
gpu.frameskip.active = 0;
gpu.frameskip.frame_ready = 1;
gpu.state.hcnt = cbs->gpu_hcnt;
+ gpu.state.frame_count = cbs->gpu_frame_count;
}
// vim:shiftwidth=2:expandtab