Dreamcast: GD_LEND should output number of bytes successfully DMA'd

With this commit, Daytona USA 2001 boots.
This commit is contained in:
snickerbockers 2018-06-10 02:54:02 -07:00
parent a05aac02f5
commit ca0722e41b
2 changed files with 5 additions and 3 deletions

View File

@ -18,6 +18,7 @@ public:
dc_cons_state(const machine_config &mconfig, device_type type, const char *tag) dc_cons_state(const machine_config &mconfig, device_type type, const char *tag)
: dc_state(mconfig, type, tag) : dc_state(mconfig, type, tag)
, m_ata(*this, "ata") , m_ata(*this, "ata")
, atapi_xfercomplete(0)
// , m_dcflash(*this, "dcflash") // , m_dcflash(*this, "dcflash")
{ } { }
@ -55,7 +56,7 @@ public:
private: private:
uint64_t PDTRA, PCTRA; uint64_t PDTRA, PCTRA;
emu_timer *atapi_timer; emu_timer *atapi_timer;
int atapi_xferlen, atapi_xferbase; int atapi_xferlen, atapi_xferbase, atapi_xfercomplete;
}; };
#endif // MAME_INCLUDES_DCCONS_H #endif // MAME_INCLUDES_DCCONS_H

View File

@ -49,7 +49,7 @@ TIMER_CALLBACK_MEMBER(dc_cons_state::atapi_xfer_end )
//osd_printf_debug("ATAPI: xfer_end. xferlen = %d\n", atapi_xferlen); //osd_printf_debug("ATAPI: xfer_end. xferlen = %d\n", atapi_xferlen);
m_ata->write_dmack(1); m_ata->write_dmack(1);
atapi_xfercomplete = 0;
while (atapi_xferlen > 0 ) while (atapi_xferlen > 0 )
{ {
struct sh4_ddt_dma ddtdata; struct sh4_ddt_dma ddtdata;
@ -63,6 +63,7 @@ TIMER_CALLBACK_MEMBER(dc_cons_state::atapi_xfer_end )
} }
atapi_xferlen -= 2048; atapi_xferlen -= 2048;
atapi_xfercomplete += 2048;
// perform the DMA // perform the DMA
ddtdata.destination = atapi_xferbase; // destination address ddtdata.destination = atapi_xferbase; // destination address
@ -125,7 +126,7 @@ READ32_MEMBER(dc_cons_state::dc_mess_g1_ctrl_r )
break; break;
case SB_GDLEND: case SB_GDLEND:
//machine().debug_break(); //machine().debug_break();
return atapi_xferlen; // TODO: check me return atapi_xfercomplete;
case SB_SECUR_EADR: // always read 0xFF on hardware case SB_SECUR_EADR: // always read 0xFF on hardware
return 0x000000ff; return 0x000000ff;
case SB_SECUR_STATE: // state of BIOS checksum security system (R/O): case SB_SECUR_STATE: // state of BIOS checksum security system (R/O):