trunk/src/mame/drivers/goupil.cpp
| r0 | r253202 | |
| 1 | // license:BSD-3-Clause |
| 2 | // copyright-holders:Jean-François DEL NERO |
| 3 | /*************************************************************************** |
| 4 | |
| 5 | SMT Goupil G1 driver |
| 6 | |
| 7 | Current state : |
| 8 | |
| 9 | -> CPU / ROM / RAM working |
| 10 | -> Video output working |
| 11 | -> Keyboard support working (need to be polished... ) |
| 12 | -> Floppy FDC not fully implemented. |
| 13 | -> Sound support missing. |
| 14 | |
| 15 | Software : |
| 16 | -> The Monitor is working |
| 17 | -> The internal Basic is working (-> 6800 0xC3 illegal opcode emulation needed). |
| 18 | |
| 19 | 02/04/2016 |
| 20 | Jean-François DEL NERO |
| 21 | |
| 22 | ****************************************************************************/ |
| 23 | |
| 24 | #include "emu.h" |
| 25 | #include "cpu/m6800/m6800.h" |
| 26 | #include "machine/6522via.h" |
| 27 | #include "machine/i8279.h" |
| 28 | #include "video/ef9364.h" |
| 29 | #include "video/mc6845.h" |
| 30 | #include "machine/6850acia.h" |
| 31 | #include "machine/wd_fdc.h" |
| 32 | |
| 33 | #include "softlist.h" |
| 34 | |
| 35 | #define MAIN_CLOCK XTAL_4MHz |
| 36 | #define VIDEO_CLOCK MAIN_CLOCK / 8 /* 1.75 Mhz */ |
| 37 | #define CPU_CLOCK MAIN_CLOCK / 4 /* 1 Mhz */ |
| 38 | |
| 39 | class goupil_g1_state : public driver_device |
| 40 | { |
| 41 | public: |
| 42 | goupil_g1_state(const machine_config &mconfig, device_type type, const char *tag) |
| 43 | : driver_device(mconfig, type, tag) |
| 44 | , m_acia(*this, "ef6850") |
| 45 | , m_ef9364(*this, "ef9364") |
| 46 | , m_maincpu(*this, "maincpu") |
| 47 | , m_via_video(*this, "m_via_video") |
| 48 | , m_via_keyb(*this, "m_via_keyb") |
| 49 | , m_via_modem(*this, "m_via_modem") |
| 50 | , m_fdc(*this, "fd1791") |
| 51 | , m_floppy0(*this, "fd1791:0") |
| 52 | , m_floppy1(*this, "fd1791:1") |
| 53 | , m_floppy(NULL) |
| 54 | { } |
| 55 | |
| 56 | DECLARE_WRITE8_MEMBER(via_video_pba_w); |
| 57 | DECLARE_WRITE8_MEMBER(via_video_pbb_w); |
| 58 | DECLARE_WRITE_LINE_MEMBER(via_video_ca2_w); |
| 59 | |
| 60 | DECLARE_READ8_MEMBER(kbd1_r); |
| 61 | DECLARE_READ8_MEMBER(kbd2_r); |
| 62 | DECLARE_READ8_MEMBER(shift_kb1_r); |
| 63 | DECLARE_READ8_MEMBER(shift_kb2_r); |
| 64 | DECLARE_READ8_MEMBER(ctrl_kb1_r); |
| 65 | DECLARE_READ8_MEMBER(ctrl_kb2_r); |
| 66 | |
| 67 | DECLARE_WRITE8_MEMBER(scanlines_kbd1_w); |
| 68 | DECLARE_WRITE8_MEMBER(scanlines_kbd2_w); |
| 69 | |
| 70 | DECLARE_READ_LINE_MEMBER(via_keyb_ca2_r); |
| 71 | |
| 72 | virtual void machine_start() override; |
| 73 | virtual void machine_reset() override; |
| 74 | |
| 75 | UINT8 m_row_kbd1; |
| 76 | UINT8 m_row_kbd2; |
| 77 | int old_state_ca2; |
| 78 | UINT8 via_video_pbb_data; |
| 79 | UINT8 cnttim; |
| 80 | UINT8 valkeyb; |
| 81 | TIMER_DEVICE_CALLBACK_MEMBER(goupil_scanline); |
| 82 | |
| 83 | private: |
| 84 | required_device<acia6850_device> m_acia; |
| 85 | required_device<ef9364_device> m_ef9364; |
| 86 | required_device<cpu_device> m_maincpu; |
| 87 | required_device<via6522_device> m_via_video; |
| 88 | required_device<via6522_device> m_via_keyb; |
| 89 | required_device<via6522_device> m_via_modem; |
| 90 | required_device<fd1791_t> m_fdc; |
| 91 | required_device<floppy_connector> m_floppy0; |
| 92 | required_device<floppy_connector> m_floppy1; |
| 93 | floppy_image_device *m_floppy; |
| 94 | }; |
| 95 | |
| 96 | /********************************** |
| 97 | * Floppy controller I/O Handlers * |
| 98 | ***********************************/ |
| 99 | // TODO |
| 100 | |
| 101 | /********************************** |
| 102 | * Keyboard I/O Handlers * |
| 103 | ***********************************/ |
| 104 | |
| 105 | TIMER_DEVICE_CALLBACK_MEMBER( goupil_g1_state::goupil_scanline ) |
| 106 | { |
| 107 | m_ef9364->update_scanline((UINT16)param); |
| 108 | } |
| 109 | |
| 110 | static ADDRESS_MAP_START(goupil_mem, AS_PROGRAM, 8, goupil_g1_state) |
| 111 | ADDRESS_MAP_UNMAP_HIGH |
| 112 | AM_RANGE(0x0000,0x3fff) AM_RAM |
| 113 | AM_RANGE(0x4000,0x7fff) AM_RAM |
| 114 | AM_RANGE(0xC000,0xE3FF) AM_ROM AM_REGION("maincpu", 0x1000) // Basic ROM (BASIC 1 up to BASIC 9). |
| 115 | |
| 116 | AM_RANGE(0xe400,0xe7ff) AM_RAM |
| 117 | AM_RANGE(0xE800,0xE80F) AM_DEVREADWRITE("ef6850", acia6850_device, data_r, data_w) |
| 118 | AM_RANGE(0xE810,0xE81F) AM_DEVREADWRITE("m_via_video", via6522_device, read, write) |
| 119 | |
| 120 | AM_RANGE(0xE820,0xE820) AM_DEVREADWRITE("i8279_kb1", i8279_device, data_r, data_w ) |
| 121 | AM_RANGE(0xE821,0xE821) AM_DEVREADWRITE("i8279_kb1", i8279_device, status_r, cmd_w ) |
| 122 | |
| 123 | AM_RANGE(0xE830,0xE830) AM_DEVREADWRITE("i8279_kb2", i8279_device, data_r, data_w ) |
| 124 | AM_RANGE(0xE831,0xE831) AM_DEVREADWRITE("i8279_kb2", i8279_device, status_r, cmd_w ) |
| 125 | |
| 126 | AM_RANGE(0xE840,0xE84F) AM_DEVREADWRITE("m_via_keyb", via6522_device, read, write) |
| 127 | |
| 128 | AM_RANGE(0xE860,0xE86F) AM_DEVREADWRITE("m_via_modem", via6522_device, read, write) |
| 129 | |
| 130 | AM_RANGE(0xe8f0,0xe8ff) AM_DEVREADWRITE("fd1791", fd1791_t, read, write) |
| 131 | //AM_RANGE(0xf08a,0xf08a) AM_READWRITE( fdc_sel0_r, fdc_sel0_w ) |
| 132 | //AM_RANGE(0xf08b,0xf08b) AM_READWRITE( fdc_sel1_r, fdc_sel1_w ) |
| 133 | |
| 134 | AM_RANGE(0xf400,0xf7ff) AM_ROM AM_REGION("maincpu", 0x0800) // Modem (MOD 3) |
| 135 | AM_RANGE(0xf800,0xffff) AM_ROM AM_REGION("maincpu", 0x0000) // Monitor (MON 1 + MON 2) |
| 136 | ADDRESS_MAP_END |
| 137 | |
| 138 | static ADDRESS_MAP_START( goupil_io, AS_IO, 8, goupil_g1_state) |
| 139 | ADDRESS_MAP_UNMAP_HIGH |
| 140 | ADDRESS_MAP_END |
| 141 | |
| 142 | WRITE8_MEMBER( goupil_g1_state::scanlines_kbd1_w ) |
| 143 | { |
| 144 | m_row_kbd1 = data; |
| 145 | } |
| 146 | |
| 147 | READ8_MEMBER( goupil_g1_state::ctrl_kb1_r ) |
| 148 | { |
| 149 | char kbdrow[6]; |
| 150 | unsigned char data; |
| 151 | |
| 152 | kbdrow[0] = 'C'; |
| 153 | kbdrow[1] = 'T'; |
| 154 | kbdrow[2] = 'R'; |
| 155 | kbdrow[3] = '0'; |
| 156 | kbdrow[4] = 0; |
| 157 | |
| 158 | data = ioport(kbdrow)->read(); |
| 159 | if( data & 0x02 ) |
| 160 | return 1; |
| 161 | else |
| 162 | return 0; |
| 163 | } |
| 164 | |
| 165 | READ8_MEMBER( goupil_g1_state::ctrl_kb2_r ) |
| 166 | { |
| 167 | return 1; |
| 168 | } |
| 169 | |
| 170 | READ8_MEMBER( goupil_g1_state::shift_kb1_r ) |
| 171 | { |
| 172 | char kbdrow[6]; |
| 173 | unsigned char data; |
| 174 | |
| 175 | kbdrow[0] = 'C'; |
| 176 | kbdrow[1] = 'T'; |
| 177 | kbdrow[2] = 'R'; |
| 178 | kbdrow[3] = '0'; |
| 179 | kbdrow[4] = 0; |
| 180 | |
| 181 | data = ioport(kbdrow)->read(); |
| 182 | if( data & 0x01 ) |
| 183 | return 1; |
| 184 | else |
| 185 | return 0; |
| 186 | } |
| 187 | |
| 188 | READ8_MEMBER( goupil_g1_state::shift_kb2_r ) |
| 189 | { |
| 190 | return 1; |
| 191 | } |
| 192 | |
| 193 | READ8_MEMBER( goupil_g1_state::kbd1_r ) |
| 194 | { |
| 195 | char kbdrow[6]; |
| 196 | UINT8 data = 0xff; |
| 197 | |
| 198 | kbdrow[0] = 'A'; |
| 199 | kbdrow[1] = 'X'; |
| 200 | kbdrow[2] = '0' + ( m_row_kbd1 & 7 ) ; |
| 201 | kbdrow[3] = 0; |
| 202 | |
| 203 | data = ioport(kbdrow)->read(); |
| 204 | |
| 205 | return data; |
| 206 | } |
| 207 | |
| 208 | WRITE8_MEMBER( goupil_g1_state::scanlines_kbd2_w ) |
| 209 | { |
| 210 | m_row_kbd2 = data & 7; |
| 211 | } |
| 212 | |
| 213 | READ_LINE_MEMBER( goupil_g1_state::via_keyb_ca2_r ) |
| 214 | { |
| 215 | return 0; |
| 216 | } |
| 217 | |
| 218 | READ8_MEMBER( goupil_g1_state::kbd2_r ) |
| 219 | { |
| 220 | char kbdrow[6]; |
| 221 | UINT8 data = 0xff; |
| 222 | |
| 223 | kbdrow[0] = 'B'; |
| 224 | kbdrow[1] = 'X'; |
| 225 | kbdrow[2] = '0' + ( m_row_kbd2 & 7 ) ; |
| 226 | kbdrow[3] = 0; |
| 227 | |
| 228 | data = ioport(kbdrow)->read(); |
| 229 | |
| 230 | return data; |
| 231 | } |
| 232 | |
| 233 | /* Input ports */ |
| 234 | static INPUT_PORTS_START( goupil_g1 ) |
| 235 | PORT_START("AX0") |
| 236 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') |
| 237 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') |
| 238 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') |
| 239 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') |
| 240 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) |
| 241 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') |
| 242 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
| 243 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') |
| 244 | PORT_START("AX1") |
| 245 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') |
| 246 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') |
| 247 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') |
| 248 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') |
| 249 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) |
| 250 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_B) PORT_CHAR('b') PORT_CHAR('B') |
| 251 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
| 252 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') |
| 253 | PORT_START("AX2") |
| 254 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') |
| 255 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') |
| 256 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') |
| 257 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') |
| 258 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) |
| 259 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') PORT_CHAR('?') |
| 260 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
| 261 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') |
| 262 | PORT_START("AX3") |
| 263 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 264 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') |
| 265 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_A) PORT_CHAR('a') PORT_CHAR('A') |
| 266 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) |
| 267 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) |
| 268 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') |
| 269 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F2) |
| 270 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F3) |
| 271 | PORT_START("AX4") |
| 272 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') |
| 273 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') |
| 274 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') |
| 275 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') |
| 276 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) |
| 277 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_STOP) PORT_CHAR(':') PORT_CHAR('/') |
| 278 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
| 279 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') PORT_CHAR('.') |
| 280 | PORT_START("AX5") |
| 281 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("TAB") PORT_CODE(KEYCODE_TAB) PORT_CHAR(UCHAR_MAMEKEY(TAB)) |
| 282 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Return") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 283 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) |
| 284 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) |
| 285 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("BS") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) |
| 286 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
| 287 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') PORT_CHAR('_') |
| 288 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 289 | PORT_START("AX6") |
| 290 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') |
| 291 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_QUOTE) PORT_CHAR(0x00F9) PORT_CHAR('%') |
| 292 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) |
| 293 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') |
| 294 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) |
| 295 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
| 296 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
| 297 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') PORT_CHAR('+') |
| 298 | PORT_START("AX7") |
| 299 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 300 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F1) |
| 301 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) |
| 302 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) |
| 303 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) |
| 304 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
| 305 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
| 306 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
| 307 | |
| 308 | PORT_START("CTR0") |
| 309 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Shift") PORT_CODE(KEYCODE_LSHIFT) |
| 310 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) |
| 311 | |
| 312 | PORT_START("BX0") |
| 313 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 314 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) |
| 315 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) |
| 316 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) |
| 317 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) |
| 318 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
| 319 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
| 320 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
| 321 | PORT_START("BX1") |
| 322 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 323 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) |
| 324 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) |
| 325 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) |
| 326 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) |
| 327 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
| 328 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
| 329 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
| 330 | PORT_START("BX2") |
| 331 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 332 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) |
| 333 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) |
| 334 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) |
| 335 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) |
| 336 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
| 337 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
| 338 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
| 339 | PORT_START("BX3") |
| 340 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 341 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) |
| 342 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') |
| 343 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') |
| 344 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 345 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
| 346 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
| 347 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') |
| 348 | PORT_START("BX4") |
| 349 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 350 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) |
| 351 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) |
| 352 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) |
| 353 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) |
| 354 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
| 355 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
| 356 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
| 357 | PORT_START("BX5") |
| 358 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 359 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) |
| 360 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) |
| 361 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) |
| 362 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) |
| 363 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
| 364 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
| 365 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
| 366 | PORT_START("BX6") |
| 367 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 368 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) |
| 369 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') |
| 370 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') |
| 371 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) |
| 372 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
| 373 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
| 374 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') |
| 375 | PORT_START("BX7") |
| 376 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 377 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) |
| 378 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') |
| 379 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') |
| 380 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) |
| 381 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
| 382 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
| 383 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 384 | INPUT_PORTS_END |
| 385 | |
| 386 | static SLOT_INTERFACE_START( goupil_floppies ) |
| 387 | SLOT_INTERFACE( "525qd", FLOPPY_525_QD ) |
| 388 | SLOT_INTERFACE_END |
| 389 | |
| 390 | void goupil_g1_state::machine_start() |
| 391 | { |
| 392 | std::string region_tag; |
| 393 | |
| 394 | m_floppy = NULL; |
| 395 | valkeyb = 0xFF; |
| 396 | } |
| 397 | |
| 398 | void goupil_g1_state::machine_reset() |
| 399 | { |
| 400 | } |
| 401 | |
| 402 | WRITE8_MEMBER(goupil_g1_state::via_video_pba_w) |
| 403 | { |
| 404 | #ifdef DBGMODE |
| 405 | printf("%s: write via_video_pba_w reg : 0x%X\n",machine().describe_context(),data); |
| 406 | #endif |
| 407 | m_ef9364->char_latch_w(data); |
| 408 | } |
| 409 | |
| 410 | WRITE8_MEMBER(goupil_g1_state::via_video_pbb_w) |
| 411 | { |
| 412 | #ifdef DBGMODE |
| 413 | printf("%s: write via_video_pbb_w reg : 0x%X\n",machine().describe_context(),data); |
| 414 | #endif |
| 415 | via_video_pbb_data = data; |
| 416 | } |
| 417 | |
| 418 | WRITE_LINE_MEMBER( goupil_g1_state::via_video_ca2_w ) |
| 419 | { |
| 420 | if(old_state_ca2==0 and state==1) |
| 421 | { |
| 422 | m_ef9364->command_w(via_video_pbb_data&0xF); |
| 423 | } |
| 424 | old_state_ca2 = state; |
| 425 | } |
| 426 | |
| 427 | static MACHINE_CONFIG_START( goupil_g1, goupil_g1_state ) |
| 428 | /* basic machine hardware */ |
| 429 | MCFG_CPU_ADD("maincpu",M6808, CPU_CLOCK) |
| 430 | MCFG_CPU_PROGRAM_MAP(goupil_mem) |
| 431 | MCFG_CPU_IO_MAP(goupil_io) |
| 432 | |
| 433 | /* sound hardware */ |
| 434 | // TODO ! |
| 435 | |
| 436 | MCFG_DEVICE_ADD ("ef6850", ACIA6850, 0) |
| 437 | |
| 438 | /* screen */ |
| 439 | MCFG_SCREEN_ADD("screen", RASTER) |
| 440 | MCFG_SCREEN_REFRESH_RATE(50) |
| 441 | MCFG_SCREEN_UPDATE_DEVICE("ef9364", ef9364_device, screen_update) |
| 442 | |
| 443 | MCFG_SCREEN_SIZE((64*8), (16*(8+4))) |
| 444 | MCFG_SCREEN_VISIBLE_AREA(0, (64*8)-1, 0, (16*(8+4))-1) |
| 445 | MCFG_PALETTE_ADD("palette", 16) |
| 446 | |
| 447 | MCFG_DEVICE_ADD("ef9364", EF9364, VIDEO_CLOCK) |
| 448 | MCFG_EF9364_PALETTE("palette") |
| 449 | MCFG_EF9364_PAGES_CNT(1); |
| 450 | MCFG_TIMER_DRIVER_ADD_SCANLINE("goupil_sl", goupil_g1_state, goupil_scanline, "screen", 0, 10) |
| 451 | |
| 452 | MCFG_DEVICE_ADD("m_via_video", VIA6522, 0) |
| 453 | MCFG_VIA6522_WRITEPA_HANDLER(WRITE8(goupil_g1_state, via_video_pba_w)) |
| 454 | MCFG_VIA6522_WRITEPB_HANDLER(WRITE8(goupil_g1_state, via_video_pbb_w)) |
| 455 | MCFG_VIA6522_CA2_HANDLER(WRITELINE(goupil_g1_state, via_video_ca2_w)) |
| 456 | |
| 457 | MCFG_DEVICE_ADD("m_via_keyb", VIA6522, 0) |
| 458 | MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE("maincpu", m6808_cpu_device, irq_line)) |
| 459 | |
| 460 | MCFG_DEVICE_ADD("m_via_modem", VIA6522, 0) |
| 461 | MCFG_VIA6522_IRQ_HANDLER(DEVWRITELINE("maincpu", m6808_cpu_device, irq_line)) |
| 462 | |
| 463 | /* Floppy */ |
| 464 | MCFG_FD1791_ADD("fd1791", XTAL_8MHz ) |
| 465 | MCFG_FLOPPY_DRIVE_ADD("fd1791:0", goupil_floppies, "525qd", floppy_image_device::default_floppy_formats) |
| 466 | MCFG_FLOPPY_DRIVE_ADD("fd1791:1", goupil_floppies, "525qd", floppy_image_device::default_floppy_formats) |
| 467 | MCFG_SOFTWARE_LIST_ADD("flop525_list", "goupil") |
| 468 | |
| 469 | MCFG_DEVICE_ADD("i8279_kb1", I8279, CPU_CLOCK) |
| 470 | MCFG_I8279_OUT_SL_CB(WRITE8(goupil_g1_state, scanlines_kbd1_w)) // scan SL lines |
| 471 | MCFG_I8279_IN_RL_CB(READ8(goupil_g1_state, kbd1_r)) // kbd RL lines |
| 472 | MCFG_I8279_IN_SHIFT_CB(READ8(goupil_g1_state, shift_kb1_r)) |
| 473 | MCFG_I8279_IN_CTRL_CB(READ8(goupil_g1_state, ctrl_kb1_r)) |
| 474 | MCFG_I8279_OUT_IRQ_CB(DEVWRITELINE("m_via_keyb", via6522_device, write_ca1)) |
| 475 | |
| 476 | MCFG_DEVICE_ADD("i8279_kb2", I8279, CPU_CLOCK) |
| 477 | MCFG_I8279_OUT_SL_CB(WRITE8(goupil_g1_state, scanlines_kbd2_w)) // scan SL lines |
| 478 | MCFG_I8279_IN_RL_CB(READ8(goupil_g1_state, kbd2_r)) // kbd RL lines |
| 479 | MCFG_I8279_IN_SHIFT_CB(READ8(goupil_g1_state, shift_kb2_r)) |
| 480 | MCFG_I8279_IN_CTRL_CB(READ8(goupil_g1_state, ctrl_kb2_r)) |
| 481 | |
| 482 | MACHINE_CONFIG_END |
| 483 | |
| 484 | /* ROM definition */ |
| 485 | ROM_START( goupilg1 ) |
| 486 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 487 | ROM_DEFAULT_BIOS("v1_0") |
| 488 | |
| 489 | ROM_SYSTEM_BIOS(0, "v1_0", "Version 1.0") |
| 490 | ROMX_LOAD( "SMT_Goupil_G1_MON_1.bin", 0x0000, 0x0400, CRC(98B7BE69) SHA1(69E83FE78A43FCF2B08FB0BCEFB0D217A57B1ECB), ROM_BIOS(1) ) |
| 491 | ROM_LOAD ( "SMT_Goupil_G1_MON_2.bin", 0x0400, 0x0400, CRC(19386B81) SHA1(E52F63FD29D374319781E9677DE6D3FD61A3684C) ) |
| 492 | |
| 493 | ROM_LOAD( "SMT_Goupil_G1_MOD_3.bin", 0x0800, 0x0400, CRC(E662F152) SHA1(11B91C5737E7572A2C18472B66BBD16B485132D5) ) |
| 494 | |
| 495 | ROMX_LOAD( "SMT_Goupil_G1_Basic_1.bin", 0x1000, 0x0400, CRC(AD105B12) SHA1(631CD4B997F76B57BF2509E4BFF30B1595C8BD13), ROM_BIOS(1) ) |
| 496 | ROMX_LOAD( "SMT_Goupil_G1_Basic_2.bin", 0x1400, 0x0400, CRC(0C5C309C) SHA1(F1CAB4B0F9191E53113790A95F1AB7108F9406A1), ROM_BIOS(1) ) |
| 497 | ROMX_LOAD( "SMT_Goupil_G1_Basic_3.bin", 0x1800, 0x0400, CRC(1F1EB127) SHA1(DBBB880C79D515ACBFCB2BE9A4C96962F3E4EDEA), ROM_BIOS(1) ) |
| 498 | ROMX_LOAD( "SMT_Goupil_G1_Basic_4.bin", 0x1C00, 0x0400, CRC(09BE48E4) SHA1(86CAE0D159583C1D572A5754F3BB6B4A2E479359), ROM_BIOS(1) ) |
| 499 | ROMX_LOAD( "SMT_Goupil_G1_Basic_5.bin", 0x2000, 0x0400, CRC(BDEB395C) SHA1(32A50468F1CA772EE45A1F5C61C66F3ECC774074), ROM_BIOS(1) ) |
| 500 | ROMX_LOAD( "SMT_Goupil_G1_Basic_6.bin", 0x2400, 0x0400, CRC(850A4000) SHA1(720F0BB3E45877835219B7E1D943EF4F19B9977D), ROM_BIOS(1) ) |
| 501 | ROMX_LOAD( "SMT_Goupil_G1_Basic_7.bin", 0x2800, 0x0400, CRC(586C7670) SHA1(13E2E96B9F1A53555CE0D55F657CF3C6B96F10A0), ROM_BIOS(1) ) |
| 502 | ROMX_LOAD( "SMT_Goupil_G1_Basic_8.bin", 0x2C00, 0x0400, CRC(33281300) SHA1(CE631FA8157A3F8869C5FEFE24B7F40E06696DF9), ROM_BIOS(1) ) |
| 503 | ROMX_LOAD( "SMT_Goupil_G1_Basic_9.bin", 0x3000, 0x0400, CRC(A3911201) SHA1(8623A0A2D83EB3A27A795030643C5C05A4350A9F), ROM_BIOS(1) ) |
| 504 | |
| 505 | ROM_REGION( 0x400, "ef9364", 0 ) |
| 506 | ROM_LOAD( "SMT_Goupil_G1_Charset.bin", 0x0000, 0x0400, CRC(8B6DA54B) SHA1(AC2204600F45C6DD0DF1E759B62ED25928F02A12) ) |
| 507 | ROM_END |
| 508 | |
| 509 | /* Driver */ |
| 510 | |
| 511 | /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ |
| 512 | COMP( 1979, goupilg1, 0, 0, goupil_g1, goupil_g1,driver_device, 0, "SMT", "Goupil G1", MACHINE_IS_SKELETON ) |