src/mess/drivers/px4.c
| r0 | r4196 | |
| 1 | /***************************************************************************
|
| 2 | |
| 3 | Epson PX-4
|
| 4 | |
| 5 | Note: We are missing a dump of the slave 7508 CPU that controls
|
| 6 | the keyboard and some other things.
|
| 7 | |
| 8 | ***************************************************************************/
|
| 9 | |
| 10 | #include "driver.h"
|
| 11 | #include "cpu/z80/z80.h"
|
| 12 | #include "devices/cartslot.h"
|
| 13 | |
| 14 | |
| 15 | /***************************************************************************
|
| 16 | GAPNIT
|
| 17 | ***************************************************************************/
|
| 18 | |
| 19 | /* input capture register low command trigger */
|
| 20 | static READ8_HANDLER( px4_icrlc_r )
|
| 21 | {
|
| 22 | logerror("%s: px4_icrlc_r\n", cpuexec_describe_context(space->machine));
|
| 23 | return 0xff;
|
| 24 | }
|
| 25 | |
| 26 | /* control register 1 */
|
| 27 | static WRITE8_HANDLER( px4_ctrl1_w )
|
| 28 | {
|
| 29 | logerror("%s: px4_ctrl1_w (0x%02x)\n", cpuexec_describe_context(space->machine), data);
|
| 30 | }
|
| 31 | |
| 32 | /* input capture register high command trigger */
|
| 33 | static READ8_HANDLER( px4_icrhc_r )
|
| 34 | {
|
| 35 | logerror("%s: px4_icrhc_r\n", cpuexec_describe_context(space->machine));
|
| 36 | return 0xff;
|
| 37 | }
|
| 38 | |
| 39 | /* command register */
|
| 40 | static WRITE8_HANDLER( px4_cmdr_w )
|
| 41 | {
|
| 42 | logerror("%s: px4_cmdr_w (0x%02x)\n", cpuexec_describe_context(space->machine), data);
|
| 43 | }
|
| 44 | |
| 45 | /* barcode trigger */
|
| 46 | static READ8_HANDLER( px4_icrlb_r )
|
| 47 | {
|
| 48 | logerror("%s: px4_icrlb_r\n", cpuexec_describe_context(space->machine));
|
| 49 | return 0xff;
|
| 50 | }
|
| 51 | |
| 52 | /* control register 2 */
|
| 53 | static WRITE8_HANDLER( px4_ctrl2_w )
|
| 54 | {
|
| 55 | logerror("%s: px4_ctrl2_w (0x%02x)\n", cpuexec_describe_context(space->machine), data);
|
| 56 | }
|
| 57 | |
| 58 | /* barcode trigger */
|
| 59 | static READ8_HANDLER( px4_icrhb_r )
|
| 60 | {
|
| 61 | logerror("%s: px4_icrhb_r\n", cpuexec_describe_context(space->machine));
|
| 62 | return 0xff;
|
| 63 | }
|
| 64 | |
| 65 | /* interrupt status register */
|
| 66 | static READ8_HANDLER( px4_isr_r )
|
| 67 | {
|
| 68 | logerror("%s: px4_isr_r\n", cpuexec_describe_context(space->machine));
|
| 69 | return 0xff;
|
| 70 | }
|
| 71 | |
| 72 | /* interrupt enable register */
|
| 73 | static WRITE8_HANDLER( px4_ier_w )
|
| 74 | {
|
| 75 | logerror("%s: px4_ier_w (0x%02x)\n", cpuexec_describe_context(space->machine), data);
|
| 76 | }
|
| 77 | |
| 78 | /* status register */
|
| 79 | static READ8_HANDLER( px4_str_r )
|
| 80 | {
|
| 81 | logerror("%s: px4_str_r\n", cpuexec_describe_context(space->machine));
|
| 82 | return 0xff;
|
| 83 | }
|
| 84 | |
| 85 | /* bank register */
|
| 86 | static WRITE8_HANDLER( px4_bankr_w )
|
| 87 | {
|
| 88 | logerror("%s: px4_bankr_w (0x%02x)\n", cpuexec_describe_context(space->machine), data);
|
| 89 | |
| 90 | /* clock switch */
|
| 91 | switch (data & 0x02)
|
| 92 | {
|
| 93 | case 0x00:
|
| 94 | case 0x01:
|
| 95 | cpu_set_clock(space->machine->cpu[0], 3457600);
|
| 96 | break;
|
| 97 | |
| 98 | case 0x02:
|
| 99 | cpu_set_clock(space->machine->cpu[0], XTAL_3_6864MHz);
|
| 100 | break;
|
| 101 | |
| 102 | case 0x03:
|
| 103 | cpu_set_clock(space->machine->cpu[0], 3072000);
|
| 104 | break;
|
| 105 | }
|
| 106 | }
|
| 107 | |
| 108 | /* serial io register */
|
| 109 | static READ8_HANDLER( px4_sior_r )
|
| 110 | {
|
| 111 | logerror("%s: px4_sior_r\n", cpuexec_describe_context(space->machine));
|
| 112 | return 0xff;
|
| 113 | }
|
| 114 | |
| 115 | /* serial io register */
|
| 116 | static WRITE8_HANDLER( px4_sior_w )
|
| 117 | {
|
| 118 | logerror("%s: px4_sior_w (0x%02x)\n", cpuexec_describe_context(space->machine), data);
|
| 119 | }
|
| 120 | |
| 121 | |
| 122 | /***************************************************************************
|
| 123 | GAPNDI
|
| 124 | ***************************************************************************/
|
| 125 | |
| 126 | /* vram start address register */
|
| 127 | static WRITE8_HANDLER( px4_vadr_w )
|
| 128 | {
|
| 129 | logerror("%s: px4_vadr_w (0x%02x)\n", cpuexec_describe_context(space->machine), data);
|
| 130 | }
|
| 131 | |
| 132 | /* y offset register */
|
| 133 | static WRITE8_HANDLER( px4_yoff_w )
|
| 134 | {
|
| 135 | logerror("%s: px4_yoff_w (0x%02x)\n", cpuexec_describe_context(space->machine), data);
|
| 136 | }
|
| 137 | |
| 138 | /* frame register */
|
| 139 | static WRITE8_HANDLER( px4_fr_w )
|
| 140 | {
|
| 141 | logerror("%s: px4_fr_w (0x%02x)\n", cpuexec_describe_context(space->machine), data);
|
| 142 | }
|
| 143 | |
| 144 | /* speed-up register */
|
| 145 | static WRITE8_HANDLER( px4_spur_w )
|
| 146 | {
|
| 147 | logerror("%s: px4_spur_w (0x%02x)\n", cpuexec_describe_context(space->machine), data);
|
| 148 | }
|
| 149 | |
| 150 | |
| 151 | /***************************************************************************
|
| 152 | GAPNDL
|
| 153 | ***************************************************************************/
|
| 154 | |
| 155 | /* cartridge interface */
|
| 156 | static READ8_HANDLER( px4_ctgif_r )
|
| 157 | {
|
| 158 | logerror("%s: px4_ctgif_r @ 0x%02x\n", cpuexec_describe_context(space->machine), offset);
|
| 159 | return 0xff;
|
| 160 | }
|
| 161 | |
| 162 | /* cartridge interface */
|
| 163 | static WRITE8_HANDLER( px4_ctgif_w )
|
| 164 | {
|
| 165 | logerror("%s: px4_ctgif_w (0x%02x @ 0x%02x)\n", cpuexec_describe_context(space->machine), data, offset);
|
| 166 | }
|
| 167 | |
| 168 | /* art data input register */
|
| 169 | static READ8_HANDLER( px4_artdir_r )
|
| 170 | {
|
| 171 | logerror("%s: px4_artdir_r\n", cpuexec_describe_context(space->machine));
|
| 172 | return 0xff;
|
| 173 | }
|
| 174 | |
| 175 | /* art data output register */
|
| 176 | static WRITE8_HANDLER( px4_artdor_w )
|
| 177 | {
|
| 178 | logerror("%s: px4_artdor_w (0x%02x)\n", cpuexec_describe_context(space->machine), data);
|
| 179 | }
|
| 180 | |
| 181 | /* art status register */
|
| 182 | static READ8_HANDLER( px4_artsr_r )
|
| 183 | {
|
| 184 | logerror("%s: px4_artsr_r\n", cpuexec_describe_context(space->machine));
|
| 185 | return 0xff;
|
| 186 | }
|
| 187 | |
| 188 | /* art mode register */
|
| 189 | static WRITE8_HANDLER( px4_artmr_w )
|
| 190 | {
|
| 191 | logerror("%s: px4_artmr_w (0x%02x)\n", cpuexec_describe_context(space->machine), data);
|
| 192 | }
|
| 193 | |
| 194 | /* io status register */
|
| 195 | static READ8_HANDLER( px4_iostr_r )
|
| 196 | {
|
| 197 | logerror("%s: px4_iostr_r\n", cpuexec_describe_context(space->machine));
|
| 198 | return 0xff;
|
| 199 | }
|
| 200 | |
| 201 | /* art command register */
|
| 202 | static WRITE8_HANDLER( px4_artcr_w )
|
| 203 | {
|
| 204 | logerror("%s: px4_artcr_w (0x%02x)\n", cpuexec_describe_context(space->machine), data);
|
| 205 | }
|
| 206 | |
| 207 | /* printer data register */
|
| 208 | static WRITE8_HANDLER( px4_pdr_w )
|
| 209 | {
|
| 210 | logerror("%s: px4_pdr_w (0x%02x)\n", cpuexec_describe_context(space->machine), data);
|
| 211 | }
|
| 212 | |
| 213 | /* switch register */
|
| 214 | static WRITE8_HANDLER( px4_swr_w )
|
| 215 | {
|
| 216 | logerror("%s: px4_swr_w (0x%02x)\n", cpuexec_describe_context(space->machine), data);
|
| 217 | }
|
| 218 | |
| 219 | /* io control register */
|
| 220 | static WRITE8_HANDLER( px4_ioctlr_w )
|
| 221 | {
|
| 222 | logerror("%s: px4_ioctlr_w (0x%02x)\n", cpuexec_describe_context(space->machine), data);
|
| 223 | }
|
| 224 | |
| 225 | |
| 226 | /***************************************************************************
|
| 227 | DRIVER INIT
|
| 228 | ***************************************************************************/
|
| 229 | |
| 230 | static DRIVER_INIT( px4 )
|
| 231 | {
|
| 232 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM);
|
| 233 | |
| 234 | /* map os rom */
|
| 235 | memory_install_readwrite8_handler(space, 0x0000, 0x7fff, 0, 0, SMH_BANK(1), SMH_NOP);
|
| 236 | memory_set_bankptr(machine, 1, memory_region(machine, "os"));
|
| 237 | |
| 238 | /* memory */
|
| 239 | memory_install_readwrite8_handler(space, 0x8000, 0xffff, 0, 0, SMH_BANK(2), SMH_BANK(2));
|
| 240 | memory_set_bankptr(machine, 2, mess_ram);
|
| 241 | }
|
| 242 | |
| 243 | |
| 244 | /***************************************************************************
|
| 245 | ADDRESS MAPS
|
| 246 | ***************************************************************************/
|
| 247 | |
| 248 | static ADDRESS_MAP_START( px4_mem, ADDRESS_SPACE_PROGRAM, 8 )
|
| 249 | AM_RANGE(0x0000, 0x7fff) AM_ROMBANK(1)
|
| 250 | AM_RANGE(0x8000, 0xffff) AM_RAMBANK(2)
|
| 251 | ADDRESS_MAP_END
|
| 252 | |
| 253 | static ADDRESS_MAP_START( px4_io, ADDRESS_SPACE_IO, 8 )
|
| 254 | ADDRESS_MAP_GLOBAL_MASK(0xff)
|
| 255 | AM_RANGE(0x00, 0x00) AM_READWRITE(px4_icrlc_r, px4_ctrl1_w)
|
| 256 | AM_RANGE(0x01, 0x01) AM_READWRITE(px4_icrhc_r, px4_cmdr_w)
|
| 257 | AM_RANGE(0x02, 0x02) AM_READWRITE(px4_icrlb_r, px4_ctrl2_w)
|
| 258 | AM_RANGE(0x03, 0x03) AM_READ(px4_icrhb_r)
|
| 259 | AM_RANGE(0x04, 0x04) AM_READWRITE(px4_isr_r, px4_ier_w)
|
| 260 | AM_RANGE(0x05, 0x05) AM_READWRITE(px4_str_r, px4_bankr_w)
|
| 261 | AM_RANGE(0x06, 0x06) AM_READWRITE(px4_sior_r, px4_sior_w)
|
| 262 | AM_RANGE(0x07, 0x07) AM_NOP
|
| 263 | AM_RANGE(0x08, 0x08) AM_WRITE(px4_vadr_w)
|
| 264 | AM_RANGE(0x09, 0x09) AM_WRITE(px4_yoff_w)
|
| 265 | AM_RANGE(0x0a, 0x0a) AM_WRITE(px4_fr_w)
|
| 266 | AM_RANGE(0x0b, 0x0b) AM_WRITE(px4_spur_w)
|
| 267 | AM_RANGE(0x0c, 0x0f) AM_NOP
|
| 268 | AM_RANGE(0x10, 0x13) AM_READWRITE(px4_ctgif_r, px4_ctgif_w)
|
| 269 | AM_RANGE(0x14, 0x14) AM_READWRITE(px4_artdir_r, px4_artdor_w)
|
| 270 | AM_RANGE(0x15, 0x15) AM_READWRITE(px4_artsr_r, px4_artmr_w)
|
| 271 | AM_RANGE(0x16, 0x16) AM_READWRITE(px4_iostr_r, px4_artcr_w)
|
| 272 | AM_RANGE(0x17, 0x17) AM_WRITE(px4_pdr_w)
|
| 273 | AM_RANGE(0x18, 0x18) AM_WRITE(px4_swr_w)
|
| 274 | AM_RANGE(0x19, 0x19) AM_WRITE(px4_ioctlr_w)
|
| 275 | AM_RANGE(0x1a, 0x1f) AM_NOP
|
| 276 | AM_RANGE(0x20, 0xff) AM_NOP /* external i/o */
|
| 277 | ADDRESS_MAP_END
|
| 278 | |
| 279 | |
| 280 | /***************************************************************************
|
| 281 | INPUT PORTS
|
| 282 | ***************************************************************************/
|
| 283 | |
| 284 | /* The PX-4 has an exchangable keyboard. Available is a standard ASCII
|
| 285 | * keyboard and an "item" keyboard, as well as regional variants for
|
| 286 | * UK, France, Germany, Denmark, Sweden, Norway, Italy and Spain. |
| 287 | */
|
| 288 | static INPUT_PORTS_START( px4_ascii )
|
| 289 | INPUT_PORTS_END
|
| 290 | |
| 291 | |
| 292 | /***************************************************************************
|
| 293 | MACHINE DRIVERS
|
| 294 | ***************************************************************************/
|
| 295 | |
| 296 | static MACHINE_DRIVER_START( px4 )
|
| 297 | /* basic machine hardware */
|
| 298 | MDRV_CPU_ADD("main", Z80, XTAL_3_6864MHz) /* uPD70008 */
|
| 299 | MDRV_CPU_PROGRAM_MAP(px4_mem, 0)
|
| 300 | MDRV_CPU_IO_MAP(px4_io, 0)
|
| 301 | |
| 302 | /* video hardware */
|
| 303 | MDRV_SCREEN_ADD("main", LCD)
|
| 304 | MDRV_SCREEN_REFRESH_RATE(44)
|
| 305 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16)
|
| 306 | MDRV_SCREEN_SIZE(240, 64)
|
| 307 | MDRV_SCREEN_VISIBLE_AREA(0, 239, 0, 63)
|
| 308 | MDRV_PALETTE_LENGTH(2)
|
| 309 | MDRV_PALETTE_INIT(black_and_white)
|
| 310 | |
| 311 | /* rom capsules */
|
| 312 | MDRV_CARTSLOT_ADD("capsule1")
|
| 313 | MDRV_CARTSLOT_EXTENSION_LIST("bin")
|
| 314 | MDRV_CARTSLOT_NOT_MANDATORY
|
| 315 | MDRV_CARTSLOT_ADD("capsule2")
|
| 316 | MDRV_CARTSLOT_EXTENSION_LIST("bin")
|
| 317 | MDRV_CARTSLOT_NOT_MANDATORY
|
| 318 | MACHINE_DRIVER_END
|
| 319 | |
| 320 | |
| 321 | /***************************************************************************
|
| 322 | ROM DEFINITIONS
|
| 323 | ***************************************************************************/
|
| 324 | |
| 325 | ROM_START( px4 )
|
| 326 | ROM_REGION(0x8000, "os", 0)
|
| 327 | ROM_LOAD("po_px4.bin", 0x0000, 0x8000, CRC(62d60dc6) SHA1(3d32ec79a317de7c84c378302e95f48d56505502))
|
| 328 | |
| 329 | ROM_REGION(0x8000, "capsule1", 0)
|
| 330 | ROM_CART_LOAD("capsule1", 0x0000, 0x8000, ROM_OPTIONAL)
|
| 331 | |
| 332 | ROM_REGION(0x8000, "capsule2", 0)
|
| 333 | ROM_CART_LOAD("capsule2", 0x0000, 0x8000, ROM_OPTIONAL)
|
| 334 | ROM_END
|
| 335 | |
| 336 | ROM_START( px4p )
|
| 337 | ROM_REGION(0x8000, "os", 0)
|
| 338 | ROM_LOAD("b0_pxa.bin", 0x0000, 0x8000, CRC(d74b9ef5) SHA1(baceee076c12f5a16f7a26000e9bc395d021c455))
|
| 339 | |
| 340 | ROM_REGION(0x8000, "capsule1", 0)
|
| 341 | ROM_CART_LOAD("capsule1", 0x0000, 0x8000, ROM_OPTIONAL)
|
| 342 | |
| 343 | ROM_REGION(0x8000, "capsule2", 0)
|
| 344 | ROM_CART_LOAD("capsule2", 0x0000, 0x8000, ROM_OPTIONAL)
|
| 345 | ROM_END
|
| 346 | |
| 347 | |
| 348 | /***************************************************************************
|
| 349 | SYSTEM CONFIG
|
| 350 | ***************************************************************************/
|
| 351 | |
| 352 | static SYSTEM_CONFIG_START( px4 )
|
| 353 | CONFIG_RAM_DEFAULT(64 * 1024) /* 64KB RAM */
|
| 354 | SYSTEM_CONFIG_END
|
| 355 | |
| 356 | |
| 357 | /***************************************************************************
|
| 358 | GAME DRIVERS
|
| 359 | ***************************************************************************/
|
| 360 | |
| 361 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT CONFIG COMPANY FULLNAME FLAGS */
|
| 362 | COMP( 1985, px4, 0, 0, px4, px4_ascii, px4, px4, "Epson", "PX-4", GAME_NOT_WORKING )
|
| 363 | COMP( 1985, px4p, px4, 0, px4, px4_ascii, px4, px4, "Epson", "PX-4+", GAME_NOT_WORKING )
|