diff --git a/src/devices/machine/i8279.cpp b/src/devices/machine/i8279.cpp index 389397f8677..a1d083cf623 100644 --- a/src/devices/machine/i8279.cpp +++ b/src/devices/machine/i8279.cpp @@ -358,6 +358,13 @@ void i8279_device::timer_mainloop() } +READ8_MEMBER(i8279_device::read) +{ + // A0 = control/data select + return (offset & 1) ? status_r(space, 0) : data_r(space, 0); +} + + READ8_MEMBER( i8279_device::status_r ) { return m_status; @@ -432,6 +439,16 @@ READ8_MEMBER( i8279_device::data_r ) } +WRITE8_MEMBER(i8279_device::write) +{ + // A0 = control/data select + if (offset & 1) + cmd_w(space, 0, data); + else + data_w(space, 0, data); +} + + WRITE8_MEMBER( i8279_device::cmd_w ) {//printf("Command: %X=%X ",data>>5,data&31); uint8_t cmd = data >> 5; diff --git a/src/devices/machine/i8279.h b/src/devices/machine/i8279.h index 615e8dfdba2..8fcb73286db 100644 --- a/src/devices/machine/i8279.h +++ b/src/devices/machine/i8279.h @@ -15,17 +15,17 @@ RL6 7 | | 34 SL2 RL7 8 | | 33 SL1 RESET 9 | | 32 SL0 - /RD 10 | 8279 | 31 B0 - /WR 11 | | 30 B1 - DB0 12 | | 29 B2 - DB1 13 | | 28 B3 - DB2 14 | | 27 A0 - DB3 15 | | 26 A1 - DB4 16 | | 25 A2 - DB5 17 | | 24 A3 + /RD 10 | 8279 | 31 OUT B0 + /WR 11 | | 30 OUT B1 + DB0 12 | | 29 OUT B2 + DB1 13 | | 28 OUT B3 + DB2 14 | | 27 OUT A0 + DB3 15 | | 26 OUT A1 + DB4 16 | | 25 OUT A2 + DB5 17 | | 24 OUT A3 DB6 18 | | 23 /BD DB7 19 | | 22 /CS - Vss 20 |_____________| 21 CTRL/DATA + Vss 20 |_____________| 21 A0 (CTRL/DATA) ***************************************************************************/ @@ -85,8 +85,10 @@ public: template static devcb_base &set_in_ctrl_callback(device_t &device, _Object object) { return downcast(device).m_in_ctrl_cb.set_callback(object); } // read & write handlers + DECLARE_READ8_MEMBER(read); DECLARE_READ8_MEMBER(status_r); DECLARE_READ8_MEMBER(data_r); + DECLARE_WRITE8_MEMBER(write); DECLARE_WRITE8_MEMBER(cmd_w); DECLARE_WRITE8_MEMBER(data_w); void timer_mainloop(); @@ -110,7 +112,7 @@ private: devcb_write_line m_out_irq_cb; // IRQ devcb_write8 m_out_sl_cb; // Scanlines SL0-3 - devcb_write8 m_out_disp_cb; // B0-3,A0-3 + devcb_write8 m_out_disp_cb; // Display outputs B0-3, A0-3 devcb_write_line m_out_bd_cb; // BD devcb_read8 m_in_rl_cb; // kbd readlines RL0-7 devcb_read_line m_in_shift_cb; // Shift key diff --git a/src/mame/drivers/goupil.cpp b/src/mame/drivers/goupil.cpp index e932d0e30b0..c518e96783a 100644 --- a/src/mame/drivers/goupil.cpp +++ b/src/mame/drivers/goupil.cpp @@ -117,11 +117,8 @@ static ADDRESS_MAP_START(goupil_mem, AS_PROGRAM, 8, goupil_g1_state) AM_RANGE(0xE800,0xE80F) AM_DEVREADWRITE("ef6850", acia6850_device, data_r, data_w) AM_RANGE(0xE810,0xE81F) AM_DEVREADWRITE("m_via_video", via6522_device, read, write) - AM_RANGE(0xE820,0xE820) AM_DEVREADWRITE("i8279_kb1", i8279_device, data_r, data_w ) - AM_RANGE(0xE821,0xE821) AM_DEVREADWRITE("i8279_kb1", i8279_device, status_r, cmd_w ) - - AM_RANGE(0xE830,0xE830) AM_DEVREADWRITE("i8279_kb2", i8279_device, data_r, data_w ) - AM_RANGE(0xE831,0xE831) AM_DEVREADWRITE("i8279_kb2", i8279_device, status_r, cmd_w ) + AM_RANGE(0xe820, 0xe821) AM_DEVREADWRITE("i8279_kb1", i8279_device, read, write) + AM_RANGE(0xe830, 0xe831) AM_DEVREADWRITE("i8279_kb2", i8279_device, read, write) AM_RANGE(0xE840,0xE84F) AM_DEVREADWRITE("m_via_keyb", via6522_device, read, write) diff --git a/src/mame/drivers/i7000.cpp b/src/mame/drivers/i7000.cpp index ad4c4c666bd..acedd0a64c6 100644 --- a/src/mame/drivers/i7000.cpp +++ b/src/mame/drivers/i7000.cpp @@ -262,8 +262,7 @@ static ADDRESS_MAP_START( i7000_io , AS_IO, 8, i7000_state) // AM_RANGE(0x1f, 0x1f) AM_WRITE(i7000_io_printer_strobe_w) //self-test routine writes 0x08 and 0x09 (it seems that bit 0 is the strobe and bit 3 is an enable signal) // AM_RANGE(0x20, 0x21) AM_READWRITE(i7000_io_keyboard_r, i7000_io_keyboard_w) - AM_RANGE( 0x20, 0x20 ) AM_DEVREADWRITE("i8279", i8279_device, data_r, data_w) - AM_RANGE( 0x21, 0x21 ) AM_DEVREADWRITE("i8279", i8279_device, status_r, cmd_w) + AM_RANGE(0x20, 0x21) AM_DEVREADWRITE("i8279", i8279_device, read, write) // AM_RANGE(0x24, 0x24) AM_READ(i7000_io_?_r) // AM_RANGE(0x25, 0x25) AM_WRITE(i7000_io_?_w) diff --git a/src/mame/drivers/icecold.cpp b/src/mame/drivers/icecold.cpp index 1d7a310ea32..2a4087b180a 100644 --- a/src/mame/drivers/icecold.cpp +++ b/src/mame/drivers/icecold.cpp @@ -66,8 +66,7 @@ static ADDRESS_MAP_START( icecold_map, AS_PROGRAM, 8, icecold_state ) AM_RANGE(0x4010, 0x4013) AM_DEVREADWRITE("pia0", pia6821_device, read, write) AM_RANGE(0x4020, 0x4023) AM_DEVREADWRITE("pia1", pia6821_device, read, write) AM_RANGE(0x4040, 0x4043) AM_DEVREADWRITE("pia2", pia6821_device, read, write) // not used - AM_RANGE(0x4080, 0x4080) AM_DEVREADWRITE("i8279", i8279_device, data_r, data_w ) - AM_RANGE(0x4081, 0x4081) AM_DEVREADWRITE("i8279", i8279_device, status_r, cmd_w) + AM_RANGE(0x4080, 0x4081) AM_DEVREADWRITE("i8279", i8279_device, read, write) AM_RANGE(0x4100, 0x4100) AM_WRITE(motors_w) AM_RANGE(0xa000, 0xffff) AM_ROM ADDRESS_MAP_END diff --git a/src/mame/drivers/marywu.cpp b/src/mame/drivers/marywu.cpp index eff149e83f6..676d879dd8d 100644 --- a/src/mame/drivers/marywu.cpp +++ b/src/mame/drivers/marywu.cpp @@ -170,12 +170,11 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( io_map, AS_IO, 8, marywu_state ) AM_RANGE(0x8000, 0x87ff) AM_MIRROR(0x0800) AM_RAM /* HM6116: 2kbytes of Static RAM */ - AM_RANGE(0xb000, 0xb000) AM_MIRROR(0x0ffe) AM_DEVREADWRITE("i8279", i8279_device, data_r, data_w) - AM_RANGE(0xb001, 0xb001) AM_MIRROR(0x0ffe) AM_DEVREADWRITE("i8279", i8279_device, status_r, cmd_w) AM_RANGE(0x9000, 0x9000) AM_MIRROR(0x0ffc) AM_DEVWRITE("ay1", ay8910_device, data_address_w) AM_RANGE(0x9001, 0x9001) AM_MIRROR(0x0ffc) AM_DEVREADWRITE("ay1", ay8910_device, data_r, data_w) AM_RANGE(0x9002, 0x9002) AM_MIRROR(0x0ffc) AM_DEVWRITE("ay2", ay8910_device, data_address_w) AM_RANGE(0x9003, 0x9003) AM_MIRROR(0x0ffc) AM_DEVREADWRITE("ay2", ay8910_device, data_r, data_w) + AM_RANGE(0xb000, 0xb001) AM_MIRROR(0x0ffe) AM_DEVREADWRITE("i8279", i8279_device, read, write) AM_RANGE(0xf000, 0xf000) AM_NOP /* TODO: Investigate this. There's something going on at this address range. */ AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P3) AM_READ(port_r) ADDRESS_MAP_END diff --git a/src/mame/drivers/maygay1b.cpp b/src/mame/drivers/maygay1b.cpp index d2cbb15e55d..9b84183349d 100644 --- a/src/mame/drivers/maygay1b.cpp +++ b/src/mame/drivers/maygay1b.cpp @@ -479,9 +479,7 @@ static ADDRESS_MAP_START( m1_memmap, AS_PROGRAM, 8, maygay1b_state ) AM_RANGE(0x2020, 0x2020) AM_WRITE(reel56_w) // there is actually an 8279 and an 8051 (which I guess is the MCU?). - AM_RANGE(0x2030, 0x2030) AM_DEVREADWRITE("i8279", i8279_device, data_r, data_w ) - AM_RANGE(0x2031, 0x2031) AM_DEVREADWRITE("i8279", i8279_device, status_r, cmd_w) - + AM_RANGE(0x2030, 0x2031) AM_DEVREADWRITE("i8279", i8279_device, read, write) #ifdef USE_MCU //8051 @@ -489,8 +487,7 @@ static ADDRESS_MAP_START( m1_memmap, AS_PROGRAM, 8, maygay1b_state ) AM_RANGE(0x2041, 0x2041) AM_WRITE( main_to_mcu_1_w ) #else //8051 - AM_RANGE(0x2040, 0x2040) AM_DEVREADWRITE("i8279_2", i8279_device, data_r, data_w ) - AM_RANGE(0x2041, 0x2041) AM_DEVREADWRITE("i8279_2", i8279_device, status_r, cmd_w) + AM_RANGE(0x2040, 0x2041) AM_DEVREADWRITE("i8279_2", i8279_device, read, write) // AM_RANGE(0x2050, 0x2050)// SCAN on M1B #endif @@ -567,8 +564,7 @@ static ADDRESS_MAP_START( m1_nec_memmap, AS_PROGRAM, 8, maygay1b_state ) AM_RANGE(0x2020, 0x2020) AM_WRITE(reel56_w) // there is actually an 8279 and an 8051 (which I guess is the MCU?). - AM_RANGE(0x2030, 0x2030) AM_DEVREADWRITE("i8279", i8279_device, data_r, data_w ) - AM_RANGE(0x2031, 0x2031) AM_DEVREADWRITE("i8279", i8279_device, status_r, cmd_w) + AM_RANGE(0x2030, 0x2031) AM_DEVREADWRITE("i8279", i8279_device, read, write) #ifdef USE_MCU //8051 @@ -576,8 +572,7 @@ static ADDRESS_MAP_START( m1_nec_memmap, AS_PROGRAM, 8, maygay1b_state ) AM_RANGE(0x2041, 0x2041) AM_WRITE( main_to_mcu_1_w ) #else //8051 - AM_RANGE(0x2040, 0x2040) AM_DEVREADWRITE("i8279_2", i8279_device, data_r, data_w ) - AM_RANGE(0x2041, 0x2041) AM_DEVREADWRITE("i8279_2", i8279_device, status_r, cmd_w) + AM_RANGE(0x2040, 0x2041) AM_DEVREADWRITE("i8279_2", i8279_device, read, write) // AM_RANGE(0x2050, 0x2050)// SCAN on M1B #endif diff --git a/src/mame/drivers/peyper.cpp b/src/mame/drivers/peyper.cpp index b5019533721..55729c2df7a 100644 --- a/src/mame/drivers/peyper.cpp +++ b/src/mame/drivers/peyper.cpp @@ -198,8 +198,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( peyper_io, AS_IO, 8, peyper_state ) ADDRESS_MAP_UNMAP_HIGH ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("i8279", i8279_device, data_r, data_w ) - AM_RANGE(0x01, 0x01) AM_DEVREADWRITE("i8279", i8279_device, status_r, cmd_w) + AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("i8279", i8279_device, read, write) AM_RANGE(0x04, 0x04) AM_DEVWRITE("ay1", ay8910_device, address_w) AM_RANGE(0x06, 0x06) AM_DEVWRITE("ay1", ay8910_device, data_w) AM_RANGE(0x08, 0x08) AM_DEVWRITE("ay2", ay8910_device, address_w) diff --git a/src/mame/drivers/sdk86.cpp b/src/mame/drivers/sdk86.cpp index 51cd3faed24..939b0f680ce 100644 --- a/src/mame/drivers/sdk86.cpp +++ b/src/mame/drivers/sdk86.cpp @@ -68,8 +68,7 @@ static ADDRESS_MAP_START(sdk86_io, AS_IO, 16, sdk86_state) ADDRESS_MAP_UNMAP_HIGH AM_RANGE(0xfff0, 0xfff1) AM_MIRROR(4) AM_DEVREADWRITE8(I8251_TAG, i8251_device, data_r, data_w, 0xff) AM_RANGE(0xfff2, 0xfff3) AM_MIRROR(4) AM_DEVREADWRITE8(I8251_TAG, i8251_device, status_r, control_w, 0xff) - AM_RANGE(0xffe8, 0xffe9) AM_MIRROR(4) AM_DEVREADWRITE8("i8279", i8279_device, data_r, data_w, 0xff) - AM_RANGE(0xffea, 0xffeb) AM_MIRROR(4) AM_DEVREADWRITE8("i8279", i8279_device, status_r, cmd_w, 0xff) + AM_RANGE(0xffe8, 0xffeb) AM_MIRROR(4) AM_DEVREADWRITE8("i8279", i8279_device, read, write, 0xff) // FFF8-FFFF = 2 x 8255A i/o chips. chip 1 uses the odd addresses, chip 2 uses the even addresses. // ports are A,B,C,control in that order. ADDRESS_MAP_END diff --git a/src/mame/drivers/selz80.cpp b/src/mame/drivers/selz80.cpp index 6501a51e1c9..f4813520766 100644 --- a/src/mame/drivers/selz80.cpp +++ b/src/mame/drivers/selz80.cpp @@ -68,8 +68,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START(selz80_io, AS_IO, 8, selz80_state) ADDRESS_MAP_UNMAP_HIGH ADDRESS_MAP_GLOBAL_MASK(0xff) - AM_RANGE(0x00, 0x00) AM_DEVREADWRITE("i8279", i8279_device, data_r, data_w ) - AM_RANGE(0x01, 0x01) AM_DEVREADWRITE("i8279", i8279_device, status_r, cmd_w) + AM_RANGE(0x00, 0x01) AM_DEVREADWRITE("i8279", i8279_device, read, write) ADDRESS_MAP_END /* Input ports */ diff --git a/src/mame/drivers/turbo.cpp b/src/mame/drivers/turbo.cpp index 0bd3e580017..567af1825b6 100644 --- a/src/mame/drivers/turbo.cpp +++ b/src/mame/drivers/turbo.cpp @@ -510,8 +510,7 @@ static ADDRESS_MAP_START( turbo_map, AS_PROGRAM, 8, turbo_state ) AM_RANGE(0xf900, 0xf903) AM_MIRROR(0x00fc) AM_DEVREADWRITE("i8255_1", i8255_device, read, write) AM_RANGE(0xfa00, 0xfa03) AM_MIRROR(0x00fc) AM_DEVREADWRITE("i8255_2", i8255_device, read, write) AM_RANGE(0xfb00, 0xfb03) AM_MIRROR(0x00fc) AM_DEVREADWRITE("i8255_3", i8255_device, read, write) - AM_RANGE(0xfc00, 0xfc00) AM_MIRROR(0x00fe) AM_DEVREADWRITE("i8279", i8279_device, data_r, data_w ) - AM_RANGE(0xfc01, 0xfc01) AM_MIRROR(0x00fe) AM_DEVREADWRITE("i8279", i8279_device, status_r, cmd_w) + AM_RANGE(0xfc00, 0xfc01) AM_MIRROR(0x00fe) AM_DEVREADWRITE("i8279", i8279_device, read, write) AM_RANGE(0xfd00, 0xfdff) AM_READ_PORT("INPUT") AM_RANGE(0xfe00, 0xfeff) AM_READ(turbo_collision_r) ADDRESS_MAP_END @@ -537,8 +536,7 @@ static ADDRESS_MAP_START( subroc3d_map, AS_PROGRAM, 8, turbo_state ) AM_RANGE(0xe000, 0xe7ff) AM_RAM_WRITE(turbo_videoram_w) AM_SHARE("videoram") // FIX PAGE AM_RANGE(0xe800, 0xe803) AM_MIRROR(0x07fc) AM_DEVREADWRITE("i8255_0", i8255_device, read, write) AM_RANGE(0xf000, 0xf003) AM_MIRROR(0x07fc) AM_DEVREADWRITE("i8255_1", i8255_device, read, write) - AM_RANGE(0xf800, 0xf800) AM_MIRROR(0x07fe) AM_DEVREADWRITE("i8279", i8279_device, data_r, data_w ) - AM_RANGE(0xf801, 0xf801) AM_MIRROR(0x07fe) AM_DEVREADWRITE("i8279", i8279_device, status_r, cmd_w) + AM_RANGE(0xf800, 0xf801) AM_MIRROR(0x07fe) AM_DEVREADWRITE("i8279", i8279_device, read, write) ADDRESS_MAP_END @@ -554,8 +552,7 @@ static ADDRESS_MAP_START( buckrog_map, AS_PROGRAM, 8, turbo_state ) AM_RANGE(0xc000, 0xc7ff) AM_RAM_WRITE(turbo_videoram_w) AM_SHARE("videoram") // FIX PAGE AM_RANGE(0xc800, 0xc803) AM_MIRROR(0x07fc) AM_DEVREAD("i8255_0", i8255_device, read) AM_WRITE(buckrog_i8255_0_w) // 8255 AM_RANGE(0xd000, 0xd003) AM_MIRROR(0x07fc) AM_DEVREADWRITE("i8255_1", i8255_device, read, write) // 8255 - AM_RANGE(0xd800, 0xd800) AM_MIRROR(0x07fe) AM_DEVREADWRITE("i8279", i8279_device, data_r, data_w ) - AM_RANGE(0xd801, 0xd801) AM_MIRROR(0x07fe) AM_DEVREADWRITE("i8279", i8279_device, status_r, cmd_w) + AM_RANGE(0xd800, 0xd801) AM_MIRROR(0x07fe) AM_DEVREADWRITE("i8279", i8279_device, read, write) AM_RANGE(0xe000, 0xe3ff) AM_RAM AM_SHARE("spritepos") // CONT RAM AM_RANGE(0xe400, 0xe7ff) AM_RAM AM_SHARE("spriteram") // CONT RAM AM_RANGE(0xe800, 0xe800) AM_MIRROR(0x07fc) AM_READ_PORT("IN0") // INPUT