DIRECT_GPU(GPUwriteDataMem),
DIRECT_GPU(GPUdmaChain),
DIRECT_GPU(GPUfreeze),
- DIRECT_GPU(GPUvBlank),
+// DIRECT_GPU(GPUvBlank), // unused
DIRECT_GPU(GPUrearmedCallbacks),
DUMMY_GPU(GPUdisplayText),
void pl_init(void)
{
+ extern unsigned int hSyncCount; // from psxcounters
+
pl_vout_w = pl_vout_h = 256;
pl_vout_bpp = 16;
tsdev = pl_gun_ts_init();
+
+ pl_rearmed_cbs.gpu_hcnt = &hSyncCount;
}
// gpu options
int frameskip;
int fskip_advice;
+ unsigned int *gpu_hcnt;
struct {
int iUseDither;
int dwActFixes;
typedef long (CALLBACK* GPUgetScreenPic)(unsigned char *);\r
typedef long (CALLBACK* GPUshowScreenPic)(unsigned char *);\r
typedef void (CALLBACK* GPUclearDynarec)(void (CALLBACK *callback)(void));\r
-typedef void (CALLBACK* GPUvBlank)(int, uint32_t *, uint32_t *);\r
+typedef void (CALLBACK* GPUvBlank)(int);\r
\r
// GPU function pointers\r
extern GPUupdateLace GPU_updateLace;\r
extern GPUgetScreenPic GPU_getScreenPic;\r
extern GPUshowScreenPic GPU_showScreenPic;\r
extern GPUclearDynarec GPU_clearDynarec;\r
-extern GPUvBlank GPU_vBlank;\r
+extern GPUvBlank GPU_vBlank; // unused\r
\r
// CD-ROM Functions\r
typedef long (CALLBACK* CDRinit)(void);\r
Rcnt rcnts[ CounterQuantity ];
-static u32 hSyncCount = 0;
+u32 hSyncCount = 0;
+u32 frame_counter = 0;
static u32 spuSyncCount = 0;
static u32 hsync_steps = 0;
-static u32 gpu_wants_hcnt = 0;
static u32 base_cycle = 0;
-static u32 frame_counter = 0;
u32 psxNextCounter = 0, psxNextsCounter = 0;
// VSync irq.
if( hSyncCount == VBlankStart[Config.PsxType] )
{
- GPU_vBlank( 1, &hSyncCount, &gpu_wants_hcnt );
//if( !(HW_GPU_STATUS & PSXGPU_ILACE) ) // hmh
HW_GPU_STATUS |= PSXGPU_LCF;
hSyncCount = 0;
frame_counter++;
- GPU_vBlank( 0, &hSyncCount, &gpu_wants_hcnt );
setIrq( 0x01 );
EmuUpdate();
hsync_steps = next_vsync;
if( next_lace && next_lace < hsync_steps )
hsync_steps = next_lace;
- if( gpu_wants_hcnt )
- hsync_steps = 1;
rcnts[3].cycleStart = cycle - leftover_cycles;
if (Config.PsxType)
BOOL bDoLazyUpdate=FALSE;
uint32_t lGPUInfoVals[16];
static int iFakePrimBusy=0;
-static uint32_t vBlank=0;
static const int *skip_advice;
////////////////////////////////////////////////////////////////////////
GPUIsReadyForCommands;
}
}
- return lGPUstatusRet | vBlank;
+ return lGPUstatusRet;
}
////////////////////////////////////////////////////////////////////////
return 1;
}
-void CALLBACK GPUvBlank(int val)
-{
- vBlank=val?0x80000000:0;
-}
-
// rearmed thing
#include "../../frontend/plugin_lib.h"
ret = vout_init();
ret |= renderer_init();
- gpu.lcf_hc = &gpu.zero;
gpu.state.frame_count = 0;
gpu.state.hcnt = &gpu.zero;
do_reset();
if (unlikely(gpu.cmd_len > 0))
flush_cmd_buffer();
- ret = gpu.status.reg | (*gpu.lcf_hc << 31);
+ ret = gpu.status.reg;
log_io("gpu_read_status %08x\n", ret);
return ret;
}
return 1;
}
-void GPUvBlank(int val, uint32_t *hcnt)
-{
- gpu.lcf_hc = &gpu.zero;
- if (gpu.status.interlace) {
- if (val)
- gpu.status.lcf ^= 1;
- }
- else {
- gpu.status.lcf = 0;
- if (!val)
- gpu.lcf_hc = hcnt;
- }
- if (!val)
- gpu.state.frame_count++;
-
- gpu.state.hcnt = hcnt;
-}
-
// vim:shiftwidth=2:expandtab
int offset;
} dma;
int cmd_len;
- const uint32_t *lcf_hc;
uint32_t zero;
struct {
uint32_t fb_dirty:1;
gpu.frameskip.advice = &cbs->fskip_advice;
gpu.frameskip.active = 0;
gpu.frameskip.frame_ready = 1;
+ gpu.state.hcnt = cbs->gpu_hcnt;
}
// vim:shiftwidth=2:expandtab