diff options
author | R. Belmont <rb6502@users.noreply.github.com> | 2013-01-09 01:10:44 +0000 |
---|---|---|
committer | R. Belmont <rb6502@users.noreply.github.com> | 2013-01-09 01:10:44 +0000 |
commit | 02eedee8f1bcc9586ed9a9d5c679869b1cd238b2 (patch) | |
tree | 82ab6f86f0a7fc5902d00100b0d7513cbeda5d83 | |
parent | 18184414ac1526d9dea283e0cc8fd0086fc5ad03 (diff) |
(MESS) Apollo fixes: [Hans Ostermeyer]
* fixed MLOG: machine -> machine()
* use the correct address space for dma (supplied space parameter is wrong; why?)
* minor fix for 64 Bit Ubuntu
* block_set_filemark() failed to set the filemark buffer; memcpy will now use 64 bit words (i.e. 8 byte chunks) for copying
-rw-r--r-- | src/mess/includes/apollo.h | 2 | ||||
-rw-r--r-- | src/mess/machine/apollo.c | 12 | ||||
-rw-r--r-- | src/mess/machine/apollo_eth.c | 2 | ||||
-rw-r--r-- | src/mess/machine/sc499.c | 7 |
4 files changed, 12 insertions, 11 deletions
diff --git a/src/mess/includes/apollo.h b/src/mess/includes/apollo.h index 38f5d97ab2e..efee72474fb 100644 --- a/src/mess/includes/apollo.h +++ b/src/mess/includes/apollo.h @@ -35,7 +35,7 @@ #define DLOG(x) { logerror ("%s - %s: ", apollo_cpu_context(device->machine().device(MAINCPU)), device->tag()); LOG(x) } #define DLOG1(x) { if (VERBOSE > 0) DLOG(x) } #define DLOG2(x) { if (VERBOSE > 1) DLOG(x) } -#define MLOG(x) { logerror ("%s: ", apollo_cpu_context(machine.device(MAINCPU))); LOG(x) } +#define MLOG(x) { logerror ("%s: ", apollo_cpu_context(machine().device(MAINCPU))); LOG(x) } #define MLOG1(x) { if (VERBOSE > 0) MLOG(x) } #define MLOG2(x) { if (VERBOSE > 1) MLOG(x) } #define SLOG(x) { logerror ("%s: ", apollo_cpu_context(&space.device())); LOG(x) } diff --git a/src/mess/machine/apollo.c b/src/mess/machine/apollo.c index df7eec84a63..0fa159d74c7 100644 --- a/src/mess/machine/apollo.c +++ b/src/mess/machine/apollo.c @@ -435,7 +435,7 @@ READ8_MEMBER(apollo_state::apollo_dma_read_byte){ offset &= 0x3ff; } - data = space.read_byte(page_offset + offset); + data = machine().firstcpu->space(AS_PROGRAM).read_byte(page_offset + offset); if (VERBOSE > 1 || offset < 4 || (offset & 0xff) == 0 || (offset & 0xff) == 0xff) { @@ -455,7 +455,7 @@ WRITE8_MEMBER(apollo_state::apollo_dma_write_byte){ offset &= 0x3ff; } // FIXME: MSB not available, writing only LSB - space.write_byte(page_offset + offset, data); + machine().firstcpu->space(AS_PROGRAM).write_byte(page_offset + offset, data); if (VERBOSE > 1 || offset < 4 || (offset & 0xff) == 0 || (offset & 0xff) == 0xff) { @@ -477,7 +477,7 @@ READ8_MEMBER(apollo_state::apollo_dma_read_word){ offset = (offset << 1) & 0x3ff; } - data = space.read_byte(page_offset + offset); + data = machine().firstcpu->space(AS_PROGRAM).read_byte(page_offset + offset); SLOG1(("dma read word at offset %x+%03x = %04x", page_offset, offset , data)); // FIXME: MSB will get lost @@ -501,7 +501,7 @@ WRITE8_MEMBER(apollo_state::apollo_dma_write_word){ offset = (offset << 1) & 0x3ff; } - space.write_byte(page_offset + offset, data); + machine().firstcpu->space(AS_PROGRAM).write_byte(page_offset + offset, data); SLOG1(("dma write word at offset %x+%03x = %02x", page_offset, offset, data)); } @@ -1104,6 +1104,7 @@ static TIMER_CALLBACK(kbd_timer_callback) #if defined(APOLLO_FOR_LINUX) device_t *device = (device_t *) ptr; + address_space &space = device->machine().device(MAINCPU)->memory().space(AS_PROGRAM); UINT8 data; #define SRA 0x01 @@ -1275,9 +1276,6 @@ static DEVICE_RESET(apollo_sio2) // machine/apollo_fdc.c - APOLLO DS3500 Floppy disk controller //########################################################################## -#undef VERBOSE -#define VERBOSE 0 - FLOPPY_FORMATS_MEMBER( apollo_state::floppy_formats ) FLOPPY_APOLLO_FORMAT FLOPPY_FORMATS_END diff --git a/src/mess/machine/apollo_eth.c b/src/mess/machine/apollo_eth.c index 059a50efddd..fe3e1b67ae0 100644 --- a/src/mess/machine/apollo_eth.c +++ b/src/mess/machine/apollo_eth.c @@ -115,7 +115,7 @@ static int apollo_eth_receive_packet(device_t *device) } else if (packet_len > sizeof(rx_buffer)) { - DLOG(("apollo_eth_receive_packet: data size (%d) exceeds rx buffer size (%d)!!!", packet_len, sizeof(rx_buffer))); + DLOG(("apollo_eth_receive_packet: data size (%d) exceeds rx buffer size (%d)!!!", packet_len, (int)sizeof(rx_buffer))); return -1; } diff --git a/src/mess/machine/sc499.c b/src/mess/machine/sc499.c index 257a3fe3fa9..cfdf233e3b6 100644 --- a/src/mess/machine/sc499.c +++ b/src/mess/machine/sc499.c @@ -1098,9 +1098,12 @@ int sc499_device::block_is_filemark() void sc499_device::block_set_filemark() { static const UINT8 fm_pattern[] = {0xDE, 0xAF, 0xFA, 0xED}; + int i; - memcpy(m_ctape_block_buffer, fm_pattern, 4); - memcpy(m_ctape_block_buffer+4, m_ctape_block_buffer, SC499_CTAPE_BLOCK_SIZE-4); + for (i = 0; i < SC499_CTAPE_BLOCK_SIZE; i += 4) + { + memcpy(m_ctape_block_buffer + i, fm_pattern, 4); + } } //************************************************************************** |