trunk/src/mame/drivers/kenseim.c
| r30745 | r30746 | |
| 8 | 8 | |
| 9 | 9 | https://www.youtube.com/watch?v=wk71y7OGU-k |
| 10 | 10 | https://www.youtube.com/watch?v=mV00MMyBBXM |
| 11 | https://www.youtube.com/watch?v=yQpMvRL0FfM |
| 11 | 12 | |
| 12 | 13 | |
| 13 | 14 | |
| 14 | | |
| 15 | 15 | Additional PCB (todo, ascii layout) |
| 16 | 16 | |
| 17 | 17 | -------------------------- |
| r30745 | r30746 | |
| 30 | 30 | #include "cpu/z80/z80.h" |
| 31 | 31 | #include "machine/z80ctc.h" |
| 32 | 32 | #include "includes/cps1.h" |
| 33 | #include "machine/i8255.h" |
| 33 | 34 | |
| 35 | |
| 34 | 36 | class kenseim_state : public cps_state |
| 35 | 37 | { |
| 36 | 38 | public: |
| r30745 | r30746 | |
| 39 | 41 | |
| 40 | 42 | /* kenseim */ |
| 41 | 43 | DECLARE_READ16_MEMBER(cps1_kensei_r); |
| 44 | DECLARE_WRITE16_MEMBER(cps1_kensei_w); |
| 42 | 45 | DECLARE_DRIVER_INIT(kenseim); |
| 43 | 46 | |
| 44 | 47 | DECLARE_READ8_MEMBER(porta_default_r) { logerror("%s read port A but no handler assigned\n", machine().describe_context()); return 0xff; } |
| 45 | 48 | DECLARE_READ8_MEMBER(portb_default_r) { logerror("%s read port B but no handler assigned\n", machine().describe_context()); return 0xff; } |
| 46 | | DECLARE_READ8_MEMBER(portc_default_r) { logerror("%s read port C but no handler assigned\n", machine().describe_context()); return 0xff; } |
| 47 | | DECLARE_READ8_MEMBER(portd_default_r) { logerror("%s read port D but no handler assigned\n", machine().describe_context()); return 0xff; } |
| 49 | // DECLARE_READ8_MEMBER(portc_default_r) { logerror("%s read port C but no handler assigned\n", machine().describe_context()); return 0xff; } |
| 50 | DECLARE_READ8_MEMBER(portc_r); |
| 51 | // DECLARE_READ8_MEMBER(portd_default_r) { logerror("%s read port D but no handler assigned\n", machine().describe_context()); return 0xff; } |
| 52 | DECLARE_READ8_MEMBER(portd_r); |
| 48 | 53 | DECLARE_READ8_MEMBER(porte_default_r) { logerror("%s read port E but no handler assigned\n", machine().describe_context()); return 0xff; } |
| 49 | 54 | |
| 50 | 55 | DECLARE_WRITE8_MEMBER(porta_default_w) { logerror("%s write %02x to port A but no handler assigned\n", machine().describe_context(), data); } |
| r30745 | r30746 | |
| 53 | 58 | DECLARE_WRITE8_MEMBER(portd_default_w) { logerror("%s write %02x to port D but no handler assigned\n", machine().describe_context(), data); } |
| 54 | 59 | DECLARE_WRITE8_MEMBER(porte_default_w) { logerror("%s write %02x to port E but no handler assigned\n", machine().describe_context(), data); } |
| 55 | 60 | |
| 61 | DECLARE_READ8_MEMBER(i8255_porta_default_r) { logerror("%s i8255 read port A but no handler assigned\n", machine().describe_context()); return 0xff; } |
| 62 | DECLARE_READ8_MEMBER(i8255_portb_default_r) { logerror("%s i8255 read port B but no handler assigned\n", machine().describe_context()); return 0xff; } |
| 63 | DECLARE_READ8_MEMBER(i8255_portc_default_r) { logerror("%s i8255 read port C but no handler assigned\n", machine().describe_context()); return 0xff; } |
| 64 | |
| 65 | DECLARE_WRITE8_MEMBER(i8255_porta_default_w) { logerror("%s i8255 write %02x to port A but no handler assigned\n", machine().describe_context(), data); } |
| 66 | DECLARE_WRITE8_MEMBER(i8255_portb_default_w) { logerror("%s i8255 write %02x to port B but no handler assigned\n", machine().describe_context(), data); } |
| 67 | DECLARE_WRITE8_MEMBER(i8255_portc_default_w) { logerror("%s i8255 write %02x to port C but no handler assigned\n", machine().describe_context(), data); } |
| 56 | 68 | }; |
| 57 | 69 | |
| 58 | 70 | |
| 71 | READ8_MEMBER(kenseim_state::portd_r) |
| 72 | { |
| 73 | // comms port maybe? checks for 0x10 (bit 4,a) to be clear in a tight loop (092B) then for bit 0x80 to be set in another tight loop (0933) then at (0947) it checks that bits 0xe0 aren't set. |
| 74 | //logerror("%s read port D\n", machine().describe_context()); |
| 75 | return rand();// 0x80; |
| 76 | } |
| 59 | 77 | |
| 78 | READ8_MEMBER(kenseim_state::portc_r) |
| 79 | { |
| 80 | // bits 0x09 checked at 1171 |
| 81 | return rand(); |
| 82 | } |
| 60 | 83 | |
| 84 | |
| 61 | 85 | READ16_MEMBER(kenseim_state::cps1_kensei_r) |
| 62 | 86 | { |
| 87 | logerror("%s cps1_kensei_r (%04x)\n", machine().describe_context(), mem_mask); |
| 63 | 88 | return rand(); |
| 64 | 89 | } |
| 65 | 90 | |
| 91 | WRITE16_MEMBER(kenseim_state::cps1_kensei_w) |
| 92 | { |
| 93 | logerror("%s cps1_kensei_w %04x (%04x)\n", machine().describe_context(), data, mem_mask); |
| 94 | } |
| 95 | |
| 66 | 96 | /* |
| 67 | 97 | Manufacturer: Fujitsu |
| 68 | 98 | Part Number: MB89363 / MB89363B / MB89363R |
| r30745 | r30746 | |
| 138 | 168 | |
| 139 | 169 | static ADDRESS_MAP_START( kenseim_map, AS_PROGRAM, 8, kenseim_state ) |
| 140 | 170 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 171 | |
| 172 | AM_RANGE(0x8000, 0x81ff) AM_RAM // ? size unknown, code just wipes ram until the compare fails |
| 173 | |
| 141 | 174 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| 142 | 175 | ADDRESS_MAP_END |
| 143 | 176 | |
| 144 | 177 | static ADDRESS_MAP_START( kenseim_io_map, AS_IO, 8, kenseim_state ) |
| 145 | 178 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 146 | 179 | AM_RANGE(0x10, 0x13) AM_DEVREADWRITE("gamecpu_ctc", z80ctc_device, read, write) |
| 180 | |
| 181 | AM_RANGE(0x20, 0x23) AM_DEVREADWRITE("i8255", i8255_device, read, write) |
| 147 | 182 | ADDRESS_MAP_END |
| 148 | 183 | |
| 149 | 184 | |
| r30745 | r30746 | |
| 166 | 201 | MCFG_TMPZ84C011_PORTE_WRITE_CALLBACK(WRITE8(kenseim_state, porte_default_w)) |
| 167 | 202 | MCFG_TMPZ84C011_PORTA_READ_CALLBACK(READ8(kenseim_state, porta_default_r)) |
| 168 | 203 | MCFG_TMPZ84C011_PORTB_READ_CALLBACK(READ8(kenseim_state, portb_default_r)) |
| 169 | | MCFG_TMPZ84C011_PORTC_READ_CALLBACK(READ8(kenseim_state, portc_default_r)) |
| 170 | | MCFG_TMPZ84C011_PORTD_READ_CALLBACK(READ8(kenseim_state, portd_default_r)) |
| 204 | MCFG_TMPZ84C011_PORTC_READ_CALLBACK(READ8(kenseim_state, portc_r)) |
| 205 | MCFG_TMPZ84C011_PORTD_READ_CALLBACK(READ8(kenseim_state, portd_r)) |
| 171 | 206 | MCFG_TMPZ84C011_PORTE_READ_CALLBACK(READ8(kenseim_state, porte_default_r)) |
| 172 | 207 | MCFG_CPU_CONFIG(daisy_chain_gamecpu) |
| 173 | 208 | |
| 174 | 209 | MCFG_DEVICE_ADD("gamecpu_ctc", Z80CTC, XTAL_16MHz/2 ) // part of the tmpz84? |
| 175 | 210 | MCFG_Z80CTC_INTR_CB(INPUTLINE("gamecpu", INPUT_LINE_IRQ0)) |
| 211 | |
| 212 | MCFG_DEVICE_ADD("i8255", I8255, 0) // MB89363B! |
| 213 | MCFG_I8255_IN_PORTA_CB(READ8(kenseim_state, i8255_porta_default_r)) |
| 214 | MCFG_I8255_IN_PORTB_CB(READ8(kenseim_state, i8255_portb_default_r)) |
| 215 | MCFG_I8255_IN_PORTC_CB(READ8(kenseim_state, i8255_portc_default_r)) |
| 216 | MCFG_I8255_OUT_PORTA_CB(WRITE8(kenseim_state, i8255_porta_default_w)) |
| 217 | MCFG_I8255_OUT_PORTB_CB(WRITE8(kenseim_state, i8255_portb_default_w)) |
| 218 | MCFG_I8255_OUT_PORTC_CB(WRITE8(kenseim_state, i8255_portc_default_w)) |
| 176 | 219 | |
| 220 | MCFG_QUANTUM_PERFECT_CPU("maincpu") |
| 177 | 221 | MACHINE_CONFIG_END |
| 178 | 222 | |
| 179 | 223 | static INPUT_PORTS_START( kenseim ) |
| r30745 | r30746 | |
| 295 | 339 | DRIVER_INIT_MEMBER(kenseim_state,kenseim) |
| 296 | 340 | { |
| 297 | 341 | m_maincpu->space(AS_PROGRAM).install_read_handler(0x800000, 0x800007, read16_delegate(FUNC(kenseim_state::cps1_kensei_r),this)); |
| 342 | m_maincpu->space(AS_PROGRAM).install_write_handler(0x800030, 0x800037, write16_delegate(FUNC(kenseim_state::cps1_kensei_w),this)); |
| 343 | |
| 298 | 344 | DRIVER_INIT_CALL(cps1); |
| 299 | 345 | } |
| 300 | 346 | |