src/mess/machine/mz700.c
| r4180 | r4181 | |
| 17 | 17 | #include "machine/pit8253.h" |
| 18 | 18 | #include "machine/8255ppi.h" |
| 19 | 19 | #include "sound/speaker.h" |
| 20 | #include "machine/74145.h" |
| 20 | 21 | |
| 21 | 22 | #include "includes/mz700.h" |
| 22 | 23 | |
| r4180 | r4181 | |
| 83 | 84 | } |
| 84 | 85 | |
| 85 | 86 | |
| 86 | | |
| 87 | 87 | DRIVER_INIT( mz700 ) |
| 88 | 88 | { |
| 89 | 89 | videoram_size = 0x5000; |
| r4180 | r4181 | |
| 132 | 132 | |
| 133 | 133 | /************************ PIO ************************************************/ |
| 134 | 134 | |
| 135 | | static READ8_DEVICE_HANDLER ( pio_port_a_r ) |
| 135 | static READ8_DEVICE_HANDLER( pio_port_a_r ) |
| 136 | 136 | { |
| 137 | 137 | UINT8 data = pio_port_a_output; |
| 138 | 138 | LOG(2,"mz700_pio_port_a_r",("%02X\n", data),device->machine); |
| 139 | 139 | return data; |
| 140 | 140 | } |
| 141 | 141 | |
| 142 | | /* read keyboard row - indexed by a demux LS145 which is connected to PA0-3 */ |
| 143 | | static READ8_DEVICE_HANDLER ( pio_port_b_r ) |
| 142 | |
| 143 | static READ8_DEVICE_HANDLER( pio_port_b_r ) |
| 144 | 144 | { |
| 145 | | UINT8 demux_LS145, data = 0xff; |
| 146 | | static const char *const keynames[] = { "ROW0", "ROW1", "ROW2", "ROW3", "ROW4", "ROW5", |
| 147 | | "ROW6", "ROW7", "ROW8", "ROW9", "ROW10" }; |
| 145 | const device_config *ls145 = devtag_get_device(device->machine, TTL74145, "ls145"); |
| 146 | int key_line = ttl74145_r(ls145, 0, 0); |
| 147 | UINT8 data = 0xff; |
| 148 | 148 | |
| 149 | | demux_LS145 = pio_port_a_output & 15; |
| 150 | | data = input_port_read(device->machine, keynames[demux_LS145]); |
| 151 | | LOG(2,"mz700_pio_port_b_r",("%02X\n", data),device->machine); |
| 149 | if (BIT(key_line, 0)) data = input_port_read(device->machine, "ROW0"); |
| 150 | if (BIT(key_line, 1)) data = input_port_read(device->machine, "ROW1"); |
| 151 | if (BIT(key_line, 2)) data = input_port_read(device->machine, "ROW2"); |
| 152 | if (BIT(key_line, 3)) data = input_port_read(device->machine, "ROW3"); |
| 153 | if (BIT(key_line, 4)) data = input_port_read(device->machine, "ROW4"); |
| 154 | if (BIT(key_line, 5)) data = input_port_read(device->machine, "ROW5"); |
| 155 | if (BIT(key_line, 6)) data = input_port_read(device->machine, "ROW6"); |
| 156 | if (BIT(key_line, 7)) data = input_port_read(device->machine, "ROW7"); |
| 157 | if (BIT(key_line, 8)) data = input_port_read(device->machine, "ROW8"); |
| 158 | if (BIT(key_line, 9)) data = input_port_read(device->machine, "ROW9"); |
| 152 | 159 | |
| 153 | 160 | return data; |
| 154 | 161 | } |
| r4180 | r4181 | |
| 183 | 190 | |
| 184 | 191 | static WRITE8_DEVICE_HANDLER (pio_port_a_w ) |
| 185 | 192 | { |
| 193 | const device_config *ls145 = devtag_get_device(device->machine, TTL74145, "ls145"); |
| 194 | |
| 186 | 195 | LOG(2,"mz700_pio_port_a_w",("%02X\n", data),device->machine); |
| 196 | |
| 197 | /* the ls145 is connected to pa0-pa3 */ |
| 198 | ttl74145_w(ls145, 0, data & 0x07); |
| 199 | |
| 187 | 200 | pio_port_a_output = data; |
| 188 | 201 | } |
| 189 | 202 | |
| r4180 | r4181 | |
| 788 | 801 | { |
| 789 | 802 | UINT8 *mem = memory_region(machine, "main"); |
| 790 | 803 | const address_space *space = cpu_get_address_space(machine->cpu[0], ADDRESS_SPACE_PROGRAM); |
| 791 | | |
| 804 | |
| 792 | 805 | videoram_size = 0x5000; |
| 793 | 806 | videoram = auto_malloc(videoram_size); |
| 794 | 807 | colorram = auto_malloc(0x800); |
src/mess/drivers/mz700.c
| r4180 | r4181 | |
| 71 | 71 | #include "machine/8255ppi.h" |
| 72 | 72 | #include "includes/mz700.h" |
| 73 | 73 | #include "machine/pit8253.h" |
| 74 | #include "machine/74145.h" |
| 74 | 75 | |
| 75 | 76 | /* Devices */ |
| 76 | 77 | #include "devices/cassette.h" |
| r4180 | r4181 | |
| 130 | 131 | |
| 131 | 132 | Small note about natural keyboard support: currently, |
| 132 | 133 | - "Alpha" is mapped to 'F6' |
| 133 | | - "Graph" is mapped to 'F7' |
| 134 | - "Graph" is mapped to 'F7' |
| 134 | 135 | - "Break" is mapped to 'F8' */ |
| 135 | 136 | |
| 136 | 137 | static INPUT_PORTS_START( mz700 ) |
| r4180 | r4181 | |
| 230 | 231 | PORT_BIT(0x40, 0x40, IPT_KEYBOARD) PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2)) |
| 231 | 232 | PORT_BIT(0x80, 0x80, IPT_KEYBOARD) PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) |
| 232 | 233 | |
| 233 | | /* 2005-08 FP: why is this here? According to the Service Manual ROW9 is the last one */ |
| 234 | | PORT_START("ROW10") /* KEY ROW 10 */ |
| 235 | | |
| 236 | 234 | PORT_START("JOY") |
| 237 | 235 | PORT_BIT(0x01, 0x00, IPT_UNUSED) |
| 238 | 236 | PORT_BIT(0x02, 0x00, IPT_JOYSTICK_UP) PORT_8WAY |
| r4180 | r4181 | |
| 273 | 271 | |
| 274 | 272 | MDRV_MACHINE_RESET( mz700 ) |
| 275 | 273 | |
| 276 | | MDRV_PIT8253_ADD( "pit8253", mz700_pit8253_config ) |
| 277 | | |
| 278 | | MDRV_PPI8255_ADD( "ppi8255", mz700_ppi8255_interface ) |
| 279 | | |
| 280 | 274 | /* video hardware - include overscan */ |
| 281 | 275 | MDRV_SCREEN_ADD("main", RASTER) |
| 282 | 276 | MDRV_SCREEN_REFRESH_RATE(50) |
| r4180 | r4181 | |
| 287 | 281 | |
| 288 | 282 | MDRV_GFXDECODE(mz700) |
| 289 | 283 | MDRV_PALETTE_LENGTH(256*2) |
| 284 | MDRV_PALETTE_INIT(mz700) |
| 290 | 285 | |
| 291 | | MDRV_PALETTE_INIT(mz700) |
| 292 | 286 | MDRV_VIDEO_UPDATE(mz700) |
| 293 | 287 | |
| 288 | /* sound hardware */ |
| 294 | 289 | MDRV_SPEAKER_STANDARD_MONO("mono") |
| 295 | 290 | MDRV_SOUND_ADD("cassette", WAVE, 0) |
| 296 | 291 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 297 | 292 | MDRV_SOUND_ADD("speaker", SPEAKER, 0) |
| 298 | 293 | MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 299 | 294 | |
| 295 | /* devices */ |
| 296 | MDRV_PIT8253_ADD("pit8253", mz700_pit8253_config) |
| 297 | MDRV_PPI8255_ADD("ppi8255", mz700_ppi8255_interface) |
| 298 | MDRV_TTL74145_ADD("ls145") |
| 299 | |
| 300 | 300 | MDRV_CASSETTE_ADD( "cassette", mz700_cassette_config ) |
| 301 | 301 | MACHINE_DRIVER_END |
| 302 | 302 | |