(MESS) Cleaned up formatting a bit; no functional change (nw)

This commit is contained in:
Wilbert Pol 2012-12-29 12:25:41 +00:00
parent 94824e13d7
commit f0512fc021

View File

@ -16,17 +16,20 @@
static void odyssey2_switch_banks(running_machine &machine)
{
odyssey2_state *state = machine.driver_data<odyssey2_state>();
switch ( state->m_cart_size ) {
switch ( state->m_cart_size )
{
case 12288:
/* 12KB cart support (for instance, KTAA as released) */
state->membank( "bank1" )->set_base( machine.root_device().memregion("user1")->base() + (state->m_p1 & 0x03) * 0xC00 );
state->membank( "bank2" )->set_base( machine.root_device().memregion("user1")->base() + (state->m_p1 & 0x03) * 0xC00 + 0x800 );
break;
case 16384:
/* 16KB cart support (for instance, full sized version KTAA) */
state->membank( "bank1" )->set_base( machine.root_device().memregion("user1")->base() + (state->m_p1 & 0x03) * 0x1000 + 0x400 );
state->membank( "bank2" )->set_base( machine.root_device().memregion("user1")->base() + (state->m_p1 & 0x03) * 0x1000 + 0xC00 );
break;
default:
state->membank("bank1")->set_base(machine.root_device().memregion("user1")->base() + (state->m_p1 & 0x03) * 0x800);
state->membank("bank2")->set_base(state->memregion("user1")->base() + (state->m_p1 & 0x03) * 0x800 );
@ -34,12 +37,14 @@ static void odyssey2_switch_banks(running_machine &machine)
}
}
void odyssey2_the_voice_lrq_callback(device_t *device, int state) {
void odyssey2_the_voice_lrq_callback(device_t *device, int state)
{
odyssey2_state *drvstate = device->machine().driver_data<odyssey2_state>();
drvstate->m_the_voice_lrq_state = state;
}
READ8_MEMBER(odyssey2_state::odyssey2_t0_r){
READ8_MEMBER(odyssey2_state::odyssey2_t0_r)
{
return ( m_the_voice_lrq_state == ASSERT_LINE ) ? 0 : 1;
}
@ -85,40 +90,53 @@ void odyssey2_state::machine_reset()
READ8_MEMBER(odyssey2_state::odyssey2_bus_r)
{
if ((m_p1 & (P1_VDC_COPY_MODE_ENABLE | P1_VDC_ENABLE)) == 0)
{
return odyssey2_video_r(space, offset); /* seems to have higher priority than ram??? */
else if (!(m_p1 & P1_EXT_RAM_ENABLE))
}
if (!(m_p1 & P1_EXT_RAM_ENABLE))
{
return m_ram[offset];
}
return 0;
}
WRITE8_MEMBER(odyssey2_state::odyssey2_bus_w)
{
if ((m_p1 & (P1_EXT_RAM_ENABLE | P1_VDC_COPY_MODE_ENABLE)) == 0x00) {
if ((m_p1 & (P1_EXT_RAM_ENABLE | P1_VDC_COPY_MODE_ENABLE)) == 0x00)
{
m_ram[offset] = data;
if ( offset & 0x80 ) {
if ( data & 0x20 ) {
if ( offset & 0x80 )
{
if ( data & 0x20 )
{
logerror("voice write %02X, data = %02X (p1 = %02X)\n", offset, data, m_p1 );
sp0256_ALD_w( machine().device("sp0256_speech"), space, 0, offset & 0x7F );
} else {
}
else
{
/* TODO: Reset sp0256 in this case */
}
}
}
else if (!(m_p1 & P1_VDC_ENABLE))
{
odyssey2_video_w(space, offset, data);
}
}
READ8_MEMBER(odyssey2_state::g7400_bus_r)
{
if ((m_p1 & (P1_VDC_COPY_MODE_ENABLE | P1_VDC_ENABLE)) == 0) {
if ((m_p1 & (P1_VDC_COPY_MODE_ENABLE | P1_VDC_ENABLE)) == 0)
{
return odyssey2_video_r(space, offset); /* seems to have higher priority than ram??? */
}
else if (!(m_p1 & P1_EXT_RAM_ENABLE)) {
else if (!(m_p1 & P1_EXT_RAM_ENABLE))
{
return m_ram[offset];
} else {
}
else
{
//return ef9341_r( offset & 0x02, offset & 0x01 );
}
@ -127,12 +145,16 @@ READ8_MEMBER(odyssey2_state::g7400_bus_r)
WRITE8_MEMBER(odyssey2_state::g7400_bus_w)
{
if ((m_p1 & (P1_EXT_RAM_ENABLE | P1_VDC_COPY_MODE_ENABLE)) == 0x00) {
if ((m_p1 & (P1_EXT_RAM_ENABLE | P1_VDC_COPY_MODE_ENABLE)) == 0x00)
{
m_ram[offset] = data;
}
else if (!(m_p1 & P1_VDC_ENABLE)) {
else if (!(m_p1 & P1_VDC_ENABLE))
{
odyssey2_video_w(space, offset, data);
} else {
}
else
{
//ef9341_w( offset & 0x02, offset & 0x01, data );
}
}
@ -183,11 +205,14 @@ READ8_MEMBER(odyssey2_state::odyssey2_getp2)
}
if (h == 0xFF) /* active low inputs, so no keypresses */
{
m_p2 = m_p2 | 0xF0;
}
}
else
{
m_p2 = m_p2 | 0xF0;
}
logerror("%.6f p2 read %.2x\n", machine().time().as_double(), m_p2);
return m_p2;
@ -205,10 +230,14 @@ READ8_MEMBER(odyssey2_state::odyssey2_getbus)
UINT8 data = 0xff;
if ((m_p2 & P2_KEYBOARD_SELECT_MASK) == 1)
{
data &= ioport("JOY0")->read(); /* read joystick 1 */
}
if ((m_p2 & P2_KEYBOARD_SELECT_MASK) == 0)
{
data &= ioport("JOY1")->read(); /* read joystick 2 */
}
logerror("%.6f bus read %.2x\n", machine().time().as_double(), data);
return data;