File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ int main(int argc, const char* argv[]) {
2525 psxe_screen_reload (screen );
2626
2727 psx_gpu_set_event_callback (gpu , GPU_EVENT_DMODE , psxe_gpu_dmode_event_cb );
28+ psx_gpu_set_event_callback (gpu , GPU_EVENT_VBLANK , psxe_gpu_vblank_event_cb );
2829 psx_gpu_set_udata (gpu , 0 , screen );
2930
3031 if (cfg -> exe ) {
@@ -36,9 +37,8 @@ int main(int argc, const char* argv[]) {
3637 }
3738
3839 while (psxe_screen_is_open (screen )) {
39- psx_run_frame (psx );
40-
41- psxe_screen_update (screen );
40+ // psx_run_frame(psx);
41+ psx_update (psx );
4242 }
4343
4444 psx_cpu_t * cpu = psx_get_cpu (psx );
Original file line number Diff line number Diff line change @@ -186,4 +186,10 @@ void psxe_gpu_dmode_event_cb(psx_gpu_t* gpu) {
186186 screen -> width * screen -> scale ,
187187 screen -> height * screen -> scale
188188 );
189+ }
190+
191+ void psxe_gpu_vblank_event_cb (psx_gpu_t * gpu ) {
192+ psxe_screen_t * screen = gpu -> udata [0 ];
193+
194+ psxe_screen_update (screen );
189195}
Original file line number Diff line number Diff line change @@ -35,5 +35,6 @@ void psxe_screen_toggle_debug_mode(psxe_screen_t*);
3535
3636// GPU event handlers
3737void psxe_gpu_dmode_event_cb (psx_gpu_t * );
38+ void psxe_gpu_vblank_event_cb (psx_gpu_t * );
3839
3940#endif
Original file line number Diff line number Diff line change @@ -889,6 +889,9 @@ void gpu_scanline_event(psx_gpu_t* gpu) {
889889 }
890890
891891 if (gpu -> line == GPU_SCANS_PER_VDRAW_NTSC ) {
892+ if (gpu -> event_cb_table [GPU_EVENT_VBLANK ])
893+ gpu -> event_cb_table [GPU_EVENT_VBLANK ](gpu );
894+
892895 psx_ic_irq (gpu -> ic , IC_VBLANK );
893896 } else if (gpu -> line == GPU_SCANS_PER_FRAME_NTSC ) {
894897 gpu -> line = 0 ;
You can’t perform that action at this time.
0 commit comments