(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
This commit is contained in:
R. Belmont 2013-01-09 01:10:44 +00:00
parent 18184414ac
commit 02eedee8f1
4 changed files with 12 additions and 11 deletions

View file

@ -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) }

View file

@ -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

View file

@ -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;
}

View file

@ -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);
}
}
//**************************************************************************