diff options
author | snickerbockers <chimerasaurusrex@gmail.com> | 2018-06-10 02:54:02 -0700 |
---|---|---|
committer | snickerbockers <chimerasaurusrex@gmail.com> | 2018-06-10 02:54:02 -0700 |
commit | ca0722e41b98486bced3222d9f4fa1719caf2306 (patch) | |
tree | 075a0c500692a4821a9e5f0c1e5483e1af8982c1 | |
parent | a05aac02f5372d9e66bc791494807a20b9e57354 (diff) |
Dreamcast: GD_LEND should output number of bytes successfully DMA'd
With this commit, Daytona USA 2001 boots.
-rw-r--r-- | src/mame/includes/dccons.h | 3 | ||||
-rw-r--r-- | src/mame/machine/dccons.cpp | 5 |
2 files changed, 5 insertions, 3 deletions
diff --git a/src/mame/includes/dccons.h b/src/mame/includes/dccons.h index 142cb346aa8..127c46d558d 100644 --- a/src/mame/includes/dccons.h +++ b/src/mame/includes/dccons.h @@ -18,6 +18,7 @@ public: dc_cons_state(const machine_config &mconfig, device_type type, const char *tag) : dc_state(mconfig, type, tag) , m_ata(*this, "ata") + , atapi_xfercomplete(0) // , m_dcflash(*this, "dcflash") { } @@ -55,7 +56,7 @@ public: private: uint64_t PDTRA, PCTRA; emu_timer *atapi_timer; - int atapi_xferlen, atapi_xferbase; + int atapi_xferlen, atapi_xferbase, atapi_xfercomplete; }; #endif // MAME_INCLUDES_DCCONS_H diff --git a/src/mame/machine/dccons.cpp b/src/mame/machine/dccons.cpp index 7b252c32ea4..36f82433b2d 100644 --- a/src/mame/machine/dccons.cpp +++ b/src/mame/machine/dccons.cpp @@ -49,7 +49,7 @@ TIMER_CALLBACK_MEMBER(dc_cons_state::atapi_xfer_end ) //osd_printf_debug("ATAPI: xfer_end. xferlen = %d\n", atapi_xferlen); m_ata->write_dmack(1); - + atapi_xfercomplete = 0; while (atapi_xferlen > 0 ) { struct sh4_ddt_dma ddtdata; @@ -63,6 +63,7 @@ TIMER_CALLBACK_MEMBER(dc_cons_state::atapi_xfer_end ) } atapi_xferlen -= 2048; + atapi_xfercomplete += 2048; // perform the DMA ddtdata.destination = atapi_xferbase; // destination address @@ -125,7 +126,7 @@ READ32_MEMBER(dc_cons_state::dc_mess_g1_ctrl_r ) break; case SB_GDLEND: //machine().debug_break(); - return atapi_xferlen; // TODO: check me + return atapi_xfercomplete; case SB_SECUR_EADR: // always read 0xFF on hardware return 0x000000ff; case SB_SECUR_STATE: // state of BIOS checksum security system (R/O): |