Preliminary GD-Rom data transfer via PIO, makes Giga Wing to boot without sound

This commit is contained in:
Angelo Salese 2013-08-25 23:59:52 +00:00
parent 64e07159cd
commit fd57ef4210
3 changed files with 38 additions and 2 deletions

View File

@ -3170,7 +3170,6 @@ void powervr2_device::pvr_scanline_timer(int vpos)
{
int vbin_line = spg_vblank_int & 0x3ff;
int vbout_line = (spg_vblank_int >> 16) & 0x3ff;
int spg_hblank_int & 0x3ff
if(vbin_line == vpos)
irq_cb(VBL_IN_IRQ);

View File

@ -56,4 +56,6 @@ private:
UINT8 *atapi_data;
int atapi_data_ptr, atapi_data_len, atapi_xferlen, atapi_xferbase, atapi_cdata_wait, atapi_xfermod;
UINT8 xfer_mode;
int atapi_pio_ptr;
UINT8 pio_sector_buffer[2048];
};

View File

@ -452,8 +452,43 @@ READ32_MEMBER(dc_cons_state::dc_mess_gdrom_r)
}
else
{
/* GD-Rom transfer via PIO, preliminary */
UINT8 pio_tr_size;
if(atapi_pio_ptr == 0)
{
gdrom->ReadData( pio_sector_buffer, 2048 );
}
data = 0;
printf("Read from empty SCSI queue\n");
pio_tr_size = 0;
for(int i=0;i<4;i++)
{
if(mem_mask & (0xff << i*8))
{
data|= pio_sector_buffer[atapi_pio_ptr+pio_tr_size]<<i*8;
pio_tr_size++;
}
}
printf("Read from PIO SCSI queue %08x %08x %08x\n",atapi_xferlen,atapi_pio_ptr,mem_mask);
atapi_xferlen -= pio_tr_size;
atapi_pio_ptr += pio_tr_size;
atapi_pio_ptr &=0x7ff;
atapi_regs[ATAPI_REG_COUNTLOW] = atapi_xferlen & 0xff;
atapi_regs[ATAPI_REG_COUNTHIGH] = (atapi_xferlen>>8)&0xff;
if(atapi_pio_ptr == 0)
{
gdrom_set_status(ATAPI_STAT_DRDY,true);
gdrom_set_status(ATAPI_STAT_DRQ,false);
gdrom_set_status(ATAPI_STAT_BSY,false);
atapi_regs[ATAPI_REG_INTREASON] = ATAPI_INTREASON_IO | ATAPI_INTREASON_COMMAND;
atapi_regs[ATAPI_REG_SAMTAG] = GDROM_PAUSE_STATE | 0x80;
// g1bus_regs[SB_GDST]=0;
gdrom_raise_irq();
}
}
return data;