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