src/mess/drivers/a5105.c
| r10298 | r10299 | |
| 6 | 6 | |
| 7 | 7 | http://www.robotrontechnik.de/index.htm?/html/computer/a5105.htm |
| 8 | 8 | |
| 9 | - this looks like "somehow" inspired by the MSX1 machine? |
| 10 | |
| 9 | 11 | ****************************************************************************/ |
| 10 | 12 | |
| 11 | 13 | #include "emu.h" |
| r10298 | r10299 | |
| 18 | 20 | a5105_state(running_machine &machine, const driver_device_config_base &config) |
| 19 | 21 | : driver_device(machine, config) { } |
| 20 | 22 | |
| 23 | UINT16 pcg_addr; |
| 24 | UINT16 pcg_internal_addr; |
| 25 | UINT8 key_mux; |
| 21 | 26 | }; |
| 22 | 27 | |
| 23 | 28 | |
| 29 | static VIDEO_START( a5105 ) |
| 30 | { |
| 31 | } |
| 32 | |
| 33 | static VIDEO_UPDATE( a5105 ) |
| 34 | { |
| 35 | UINT8 *vram = screen->machine->region("vram")->base(); |
| 36 | //UINT8 *attr = screen->machine->region("attr")->base(); |
| 37 | int x,y; |
| 38 | int count; |
| 39 | const gfx_element *gfx = screen->machine->gfx[0]; |
| 40 | UINT8 tile; |
| 41 | |
| 42 | count = 0; |
| 43 | |
| 44 | for(y=0;y<32;y++) |
| 45 | { |
| 46 | for(x=0;x<40;x++) |
| 47 | { |
| 48 | tile = vram[count]; |
| 49 | |
| 50 | drawgfx_opaque(bitmap,cliprect,gfx,tile,0,0,0,x*8,y*8); |
| 51 | count++; |
| 52 | } |
| 53 | } |
| 54 | |
| 55 | |
| 56 | return 0; |
| 57 | } |
| 58 | |
| 24 | 59 | static ADDRESS_MAP_START(a5105_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 25 | 60 | ADDRESS_MAP_UNMAP_HIGH |
| 61 | AM_RANGE(0x0000, 0x7fff) AM_ROM |
| 62 | AM_RANGE(0x8000, 0x9fff) AM_ROM //ROM bank |
| 63 | AM_RANGE(0xc000, 0xefff) AM_RAM |
| 64 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| 26 | 65 | ADDRESS_MAP_END |
| 27 | 66 | |
| 67 | |
| 68 | /* |
| 69 | VDP sequence is: |
| 70 | - polls the command ($99) |
| 71 | - polls the params ($98) |
| 72 | */ |
| 73 | |
| 74 | static UINT8 vdp_cmd,vdp_index,vdp_param[0x10],vdp_stack[0x100]; |
| 75 | static UINT32 vdp_offset,vdp_read_stack; |
| 76 | |
| 77 | static READ8_HANDLER( vdp_status_r ) |
| 78 | { |
| 79 | /* |
| 80 | [0] |
| 81 | --x- ---- vblank |
| 82 | ---- --x- processed command? |
| 83 | */ |
| 84 | |
| 85 | return 0xdd | input_port_read(space->machine,"VBLANK"); |
| 86 | } |
| 87 | |
| 88 | static READ8_HANDLER( vdp_data_r ) |
| 89 | { |
| 90 | //printf("Read data port\n"); |
| 91 | UINT8 res; |
| 92 | //UINT8 *vram = space->machine->region("vram")->base(); |
| 93 | |
| 94 | res = vdp_stack[vdp_read_stack]; |
| 95 | |
| 96 | if(vdp_read_stack < 0x100) |
| 97 | vdp_read_stack++; |
| 98 | |
| 99 | //res = vdp_stack[vdp_offset+vdp_read_stack]; |
| 100 | //vdp_read_stack++; |
| 101 | //printf("%04x %04x %02x\n",vdp_offset,vram_read_stack,res); |
| 102 | |
| 103 | return res; |
| 104 | } |
| 105 | |
| 106 | static WRITE8_HANDLER( vdp_cmd_w ) |
| 107 | { |
| 108 | /* |
| 109 | |
| 110 | */ |
| 111 | |
| 112 | vdp_cmd = data; |
| 113 | vdp_index = 0; |
| 114 | |
| 115 | switch(data) |
| 116 | { |
| 117 | case 0x00: printf("VDP: Reset / screen param issued 0x00\n"); break; |
| 118 | case 0x20: printf("VDP: Put char command issued 0x20\n"); break; |
| 119 | case 0x49: printf("VDP: current videoram offset command issued 0x49\n"); break; |
| 120 | case 0x4c: printf("VDP: repeat command issued? 0x4c\n"); break; |
| 121 | case 0xa0: |
| 122 | vdp_read_stack = 0; |
| 123 | printf("VDP: get current videoram offset 0xa0 = %04x\n",vdp_offset); |
| 124 | vdp_stack[0] = vdp_offset & 0xff; |
| 125 | vdp_stack[1] = vdp_offset >> 8; |
| 126 | break; |
| 127 | |
| 128 | default: printf("VDP: Unknown command issued %02x\n",data); |
| 129 | } |
| 130 | |
| 131 | } |
| 132 | |
| 133 | static WRITE8_HANDLER( vdp_data_w ) |
| 134 | { |
| 135 | UINT8 *vram = space->machine->region("vram")->base(); |
| 136 | UINT8 *attr = space->machine->region("attr")->base(); |
| 137 | |
| 138 | /**/ |
| 139 | |
| 140 | vdp_param[vdp_index] = data; |
| 141 | |
| 142 | printf("%02x\n",data); |
| 143 | |
| 144 | if(vdp_index < 0x10) |
| 145 | vdp_index++; |
| 146 | |
| 147 | switch(vdp_cmd) |
| 148 | { |
| 149 | case 0x20: |
| 150 | if(vdp_index == 2) |
| 151 | { |
| 152 | vram[vdp_offset] = vdp_param[0]; |
| 153 | attr[vdp_offset] = vdp_param[1]; |
| 154 | vdp_offset++; |
| 155 | vdp_offset&=0xffff; //TODO: this is wrong |
| 156 | } |
| 157 | break; |
| 158 | case 0x49: |
| 159 | if(vdp_index == 2) |
| 160 | { |
| 161 | vdp_offset = (vdp_param[1]<<8)|(vdp_param[0]); |
| 162 | //vdp_offset++; |
| 163 | //vdp_offset&=0xffff; |
| 164 | } |
| 165 | if(vdp_index == 3) |
| 166 | vdp_offset = 0; |
| 167 | break; |
| 168 | case 0x4c: |
| 169 | if(vdp_index == 3) |
| 170 | { |
| 171 | if(vdp_param[0] == 2 && vdp_param[1] == 0x27 && vdp_param[2] == 0x00) |
| 172 | { |
| 173 | int i; |
| 174 | |
| 175 | for(i=1;i<0x50;i++) |
| 176 | { |
| 177 | vram[vdp_offset+i] = vram[vdp_offset]; |
| 178 | attr[vdp_offset+i] = attr[vdp_offset]; |
| 179 | } |
| 180 | } |
| 181 | } |
| 182 | break; |
| 183 | default: |
| 184 | break; |
| 185 | } |
| 186 | |
| 187 | |
| 188 | } |
| 189 | |
| 190 | static WRITE8_HANDLER( pcg_addr_w ) |
| 191 | { |
| 192 | a5105_state *state = space->machine->driver_data<a5105_state>(); |
| 193 | |
| 194 | state->pcg_addr = data << 3; |
| 195 | state->pcg_internal_addr = 0; |
| 196 | } |
| 197 | |
| 198 | static WRITE8_HANDLER( pcg_val_w ) |
| 199 | { |
| 200 | UINT8 *gfx_data = space->machine->region("pcg")->base(); |
| 201 | a5105_state *state = space->machine->driver_data<a5105_state>(); |
| 202 | |
| 203 | gfx_data[state->pcg_addr|state->pcg_internal_addr] = data; |
| 204 | |
| 205 | gfx_element_mark_dirty(space->machine->gfx[0], state->pcg_addr >> 3); |
| 206 | |
| 207 | state->pcg_internal_addr++; |
| 208 | state->pcg_internal_addr&=7; |
| 209 | } |
| 210 | |
| 211 | static READ8_HANDLER( key_r ) |
| 212 | { |
| 213 | a5105_state *state = space->machine->driver_data<a5105_state>(); |
| 214 | static const char *const keynames[] = { "KEY0", "KEY1", "KEY2", "KEY3", |
| 215 | "KEY4", "KEY5", "KEY6", "KEY7", |
| 216 | "KEY8", "KEY9", "KEYA", "UNUSED", |
| 217 | "UNUSED", "UNUSED", "UNUSED", "UNUSED" }; |
| 218 | |
| 219 | if((state->key_mux & 0xf0) == 0xf0) |
| 220 | return input_port_read(space->machine, keynames[state->key_mux & 0x0f]); |
| 221 | |
| 222 | return 0xff; |
| 223 | } |
| 224 | |
| 225 | static WRITE8_HANDLER( key_mux_w ) |
| 226 | { |
| 227 | a5105_state *state = space->machine->driver_data<a5105_state>(); |
| 228 | |
| 229 | state->key_mux = data; |
| 230 | } |
| 231 | |
| 28 | 232 | static ADDRESS_MAP_START( a5105_io , ADDRESS_SPACE_IO, 8) |
| 29 | 233 | ADDRESS_MAP_UNMAP_HIGH |
| 234 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 235 | AM_RANGE(0x98, 0x98) AM_READ(vdp_status_r) |
| 236 | AM_RANGE(0x99, 0x99) AM_READ(vdp_data_r) |
| 237 | |
| 238 | AM_RANGE(0x98, 0x98) AM_WRITE(vdp_data_w) |
| 239 | AM_RANGE(0x99, 0x99) AM_WRITE(vdp_cmd_w) |
| 240 | AM_RANGE(0x9c, 0x9c) AM_WRITE(pcg_val_w) |
| 241 | //0x9d palette? |
| 242 | AM_RANGE(0x9e, 0x9e) AM_WRITE(pcg_addr_w) |
| 243 | |
| 244 | //0xa8 is an i/o component (bankswitch lies there?) |
| 245 | AM_RANGE(0xa9, 0xa9) AM_READ(key_r) |
| 246 | AM_RANGE(0xaa, 0xaa) AM_READ(key_mux_w) |
| 247 | |
| 30 | 248 | ADDRESS_MAP_END |
| 31 | 249 | |
| 32 | 250 | /* Input ports */ |
| 33 | 251 | static INPUT_PORTS_START( a5105 ) |
| 252 | PORT_START("KEY0") |
| 253 | PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0) PORT_CHAR('0') PORT_CHAR(')') |
| 254 | PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1) PORT_CHAR('1') PORT_CHAR('!') |
| 255 | PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2) PORT_CHAR('2') PORT_CHAR('@') |
| 256 | PORT_BIT (0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_3) PORT_CHAR('3') PORT_CHAR('#') |
| 257 | PORT_BIT (0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_4) PORT_CHAR('4') PORT_CHAR('$') |
| 258 | PORT_BIT (0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5) PORT_CHAR('5') PORT_CHAR('%') |
| 259 | PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6) PORT_CHAR('6') PORT_CHAR('^') |
| 260 | PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7) PORT_CHAR('7') PORT_CHAR('&') |
| 261 | |
| 262 | PORT_START("KEY1") |
| 263 | PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_8) PORT_CHAR('8') PORT_CHAR('*') |
| 264 | PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_9) PORT_CHAR('9') PORT_CHAR('(') |
| 265 | PORT_BIT(0x04,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("<") //PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 266 | PORT_BIT(0x08,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("+") //PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 267 | /* TODO: following three aren't marked correctly */ |
| 268 | PORT_BIT(0x10,IP_ACTIVE_LOW,IPT_KEYBOARD) //PORT_NAME("ò") PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 269 | PORT_BIT(0x20,IP_ACTIVE_LOW,IPT_KEYBOARD) //PORT_NAME("à") PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 270 | PORT_BIT(0x40,IP_ACTIVE_LOW,IPT_KEYBOARD) //PORT_NAME("ù") PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 271 | PORT_BIT(0x80,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("#") //PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 272 | |
| 273 | PORT_START("KEY2") |
| 274 | PORT_BIT(0x01,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("'") //PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 275 | PORT_BIT(0x02,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("?") //PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 276 | PORT_BIT(0x04,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME(".") //PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 277 | PORT_BIT(0x08,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME(",") //PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 278 | PORT_BIT(0x10,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("-") //PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 279 | PORT_BIT (0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Dead Key?") PORT_CODE(KEYCODE_TILDE) \ |
| 280 | PORT_BIT(0x40,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("a") PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 281 | PORT_BIT(0x80,IP_ACTIVE_LOW,IPT_KEYBOARD) PORT_NAME("b") PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 282 | |
| 283 | PORT_START("KEY3") |
| 284 | PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_C) PORT_CHAR('c') PORT_CHAR('C') |
| 285 | PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_D) PORT_CHAR('d') PORT_CHAR('D') |
| 286 | PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_E) PORT_CHAR('e') PORT_CHAR('E') |
| 287 | PORT_BIT (0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_F) PORT_CHAR('f') PORT_CHAR('F') |
| 288 | PORT_BIT (0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_G) PORT_CHAR('g') PORT_CHAR('G') |
| 289 | PORT_BIT (0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_H) PORT_CHAR('h') PORT_CHAR('H') |
| 290 | PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_I) PORT_CHAR('i') PORT_CHAR('I') |
| 291 | PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_J) PORT_CHAR('j') PORT_CHAR('J') |
| 292 | |
| 293 | PORT_START("KEY4") |
| 294 | PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_K) PORT_CHAR('k') PORT_CHAR('K') |
| 295 | PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_L) PORT_CHAR('l') PORT_CHAR('L') |
| 296 | PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_M) PORT_CHAR('m') PORT_CHAR('M') |
| 297 | PORT_BIT (0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_N) PORT_CHAR('n') PORT_CHAR('N') |
| 298 | PORT_BIT (0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_O) PORT_CHAR('o') PORT_CHAR('O') |
| 299 | PORT_BIT (0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_P) PORT_CHAR('p') PORT_CHAR('P') |
| 300 | PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Q) PORT_CHAR('q') PORT_CHAR('Q') |
| 301 | PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_R) PORT_CHAR('r') PORT_CHAR('R') |
| 302 | |
| 303 | PORT_START("KEY5") |
| 304 | PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_S) PORT_CHAR('s') PORT_CHAR('S') |
| 305 | PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_T) PORT_CHAR('t') PORT_CHAR('T') |
| 306 | PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_U) PORT_CHAR('u') PORT_CHAR('U') |
| 307 | PORT_BIT (0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_V) PORT_CHAR('v') PORT_CHAR('V') |
| 308 | PORT_BIT (0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_W) PORT_CHAR('w') PORT_CHAR('W') |
| 309 | PORT_BIT (0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_X) PORT_CHAR('x') PORT_CHAR('X') |
| 310 | PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Y) PORT_CHAR('y') PORT_CHAR('Y') |
| 311 | PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_Z) PORT_CHAR('z') PORT_CHAR('Z') |
| 312 | |
| 313 | PORT_START("KEY6") |
| 314 | PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 315 | PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LCONTROL) PORT_CHAR(UCHAR_SHIFT_2) |
| 316 | PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("GRAPH") PORT_CODE(KEYCODE_PGUP) PORT_CHAR(UCHAR_MAMEKEY(F6)) |
| 317 | PORT_BIT (0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CAPS") PORT_CODE(KEYCODE_CAPSLOCK) PORT_CHAR(UCHAR_MAMEKEY(CAPSLOCK)) |
| 318 | PORT_BIT (0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CODE") PORT_CODE(KEYCODE_PGDN) PORT_CHAR(UCHAR_MAMEKEY(F7)) |
| 319 | PORT_BIT (0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F1 F6") PORT_CODE(KEYCODE_F1) PORT_CHAR(UCHAR_MAMEKEY(F1)) |
| 320 | PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F2 F7") PORT_CODE(KEYCODE_F2) PORT_CHAR(UCHAR_MAMEKEY(F2)) |
| 321 | PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F3 F8") PORT_CODE(KEYCODE_F3) PORT_CHAR(UCHAR_MAMEKEY(F3)) |
| 322 | |
| 323 | PORT_START("KEY7") |
| 324 | PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F4 F9") PORT_CODE(KEYCODE_F4) PORT_CHAR(UCHAR_MAMEKEY(F4)) |
| 325 | PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F5 F10") PORT_CODE(KEYCODE_F5) PORT_CHAR(UCHAR_MAMEKEY(F5)) |
| 326 | PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ESC) PORT_CHAR(UCHAR_MAMEKEY(ESC)) |
| 327 | PORT_BIT (0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_TAB) PORT_CHAR('\t') |
| 328 | PORT_BIT (0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("STOP") PORT_CODE(KEYCODE_RCONTROL) PORT_CHAR(UCHAR_MAMEKEY(F8)) |
| 329 | PORT_BIT (0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(8) |
| 330 | PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SELECT") PORT_CODE(KEYCODE_END) PORT_CHAR(UCHAR_MAMEKEY(F9)) |
| 331 | PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ENTER) PORT_CHAR(13) |
| 332 | |
| 333 | PORT_START("KEY8") |
| 334 | PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 335 | PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_HOME) PORT_CHAR(UCHAR_MAMEKEY(HOME)) |
| 336 | PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_INSERT) PORT_CHAR(UCHAR_MAMEKEY(INSERT)) |
| 337 | PORT_BIT (0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("DEL") PORT_CODE(KEYCODE_DEL) PORT_CHAR(UCHAR_MAMEKEY(DEL)) |
| 338 | PORT_BIT (0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_LEFT) PORT_CHAR(UCHAR_MAMEKEY(LEFT)) |
| 339 | PORT_BIT (0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_UP) PORT_CHAR(UCHAR_MAMEKEY(UP)) |
| 340 | PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_DOWN) PORT_CHAR(UCHAR_MAMEKEY(DOWN)) |
| 341 | PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_RIGHT) PORT_CHAR(UCHAR_MAMEKEY(RIGHT)) |
| 342 | |
| 343 | PORT_START("KEY9") |
| 344 | PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR(UCHAR_MAMEKEY(ASTERISK)) |
| 345 | PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(PLUS_PAD)) |
| 346 | PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_SLASH_PAD) PORT_CHAR(UCHAR_MAMEKEY(SLASH_PAD)) |
| 347 | PORT_BIT (0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_0_PAD) PORT_CHAR(UCHAR_MAMEKEY(0_PAD)) |
| 348 | PORT_BIT (0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_1_PAD) PORT_CHAR(UCHAR_MAMEKEY(1_PAD)) |
| 349 | PORT_BIT (0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_2_PAD) PORT_CHAR(UCHAR_MAMEKEY(2_PAD)) |
| 350 | PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_3_PAD) PORT_CHAR(UCHAR_MAMEKEY(3_PAD)) |
| 351 | PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_4_PAD) PORT_CHAR(UCHAR_MAMEKEY(4_PAD)) |
| 352 | |
| 353 | PORT_START("KEYA") |
| 354 | PORT_BIT (0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_5_PAD) PORT_CHAR(UCHAR_MAMEKEY(5_PAD)) |
| 355 | PORT_BIT (0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_6_PAD) PORT_CHAR(UCHAR_MAMEKEY(6_PAD)) |
| 356 | PORT_BIT (0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_7_PAD) PORT_CHAR(UCHAR_MAMEKEY(7_PAD)) |
| 357 | PORT_BIT (0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_8_PAD) PORT_CHAR(UCHAR_MAMEKEY(8_PAD)) |
| 358 | PORT_BIT (0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_9_PAD) PORT_CHAR(UCHAR_MAMEKEY(9_PAD)) |
| 359 | PORT_BIT (0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_MINUS_PAD) PORT_CHAR(UCHAR_MAMEKEY(MINUS_PAD)) |
| 360 | PORT_BIT (0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Keypad ,") PORT_CODE(KEYCODE_ENTER_PAD) |
| 361 | PORT_BIT (0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_CODE(KEYCODE_DEL_PAD) PORT_CHAR(UCHAR_MAMEKEY(DEL_PAD)) |
| 362 | |
| 363 | PORT_START("UNUSED") |
| 364 | PORT_BIT (0xff, IP_ACTIVE_LOW, IPT_UNUSED) |
| 365 | |
| 366 | PORT_START("VBLANK") |
| 367 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_VBLANK) |
| 34 | 368 | INPUT_PORTS_END |
| 35 | 369 | |
| 36 | 370 | |
| r10298 | r10299 | |
| 38 | 372 | { |
| 39 | 373 | } |
| 40 | 374 | |
| 41 | | static VIDEO_START( a5105 ) |
| 375 | |
| 376 | static const gfx_layout x1_chars_8x8 = |
| 42 | 377 | { |
| 43 | | } |
| 378 | 8,8, |
| 379 | RGN_FRAC(1,1), |
| 380 | 1, |
| 381 | { 0 }, |
| 382 | { 7, 6, 5, 4, 3, 2, 1, 0 }, |
| 383 | { 0*8, 1*8, 2*8, 3*8, 4*8, 5*8, 6*8, 7*8 }, |
| 384 | 8*8 |
| 385 | }; |
| 44 | 386 | |
| 45 | | static VIDEO_UPDATE( a5105 ) |
| 387 | /* decoded for debugging purpose, this will be nuked in the end... */ |
| 388 | static GFXDECODE_START( a5105 ) |
| 389 | GFXDECODE_ENTRY( "pcg", 0x00000, x1_chars_8x8, 0, 1 ) |
| 390 | GFXDECODE_END |
| 391 | |
| 392 | static INTERRUPT_GEN( a5105_vblank_irq ) |
| 46 | 393 | { |
| 47 | | return 0; |
| 394 | cpu_set_input_line_and_vector(device, 0, HOLD_LINE,0x44); |
| 48 | 395 | } |
| 49 | 396 | |
| 50 | 397 | static MACHINE_CONFIG_START( a5105, a5105_state ) |
| r10298 | r10299 | |
| 52 | 399 | MCFG_CPU_ADD("maincpu",Z80, XTAL_4MHz) |
| 53 | 400 | MCFG_CPU_PROGRAM_MAP(a5105_mem) |
| 54 | 401 | MCFG_CPU_IO_MAP(a5105_io) |
| 402 | MCFG_CPU_VBLANK_INT("screen",a5105_vblank_irq) |
| 55 | 403 | |
| 56 | 404 | MCFG_MACHINE_RESET(a5105) |
| 57 | 405 | |
| r10298 | r10299 | |
| 60 | 408 | MCFG_SCREEN_REFRESH_RATE(50) |
| 61 | 409 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500)) /* not accurate */ |
| 62 | 410 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 63 | | MCFG_SCREEN_SIZE(640, 480) |
| 64 | | MCFG_SCREEN_VISIBLE_AREA(0, 640-1, 0, 480-1) |
| 411 | MCFG_SCREEN_SIZE(40*8, 32*8) |
| 412 | MCFG_SCREEN_VISIBLE_AREA(0, 40*8-1, 0, 32*8-1) |
| 65 | 413 | MCFG_PALETTE_LENGTH(2) |
| 66 | 414 | MCFG_PALETTE_INIT(black_and_white) |
| 67 | 415 | |
| 416 | MCFG_GFXDECODE(a5105) |
| 417 | |
| 68 | 418 | MCFG_VIDEO_START(a5105) |
| 69 | 419 | MCFG_VIDEO_UPDATE(a5105) |
| 70 | 420 | MACHINE_CONFIG_END |
| r10298 | r10299 | |
| 73 | 423 | ROM_START( a5105 ) |
| 74 | 424 | ROM_REGION( 0x10000, "maincpu", ROMREGION_ERASEFF ) |
| 75 | 425 | ROM_LOAD( "k1505_00.rom", 0x0000, 0x8000, CRC(0ed5f556) SHA1(5c33139db9f59e50da5c76729752f8e653ae34ae)) |
| 76 | | ROM_LOAD( "k1505_80.rom", 0x0000, 0x2000, CRC(350e4958) SHA1(7e5b587c59676e8549561117ea0b70234f439a94)) |
| 426 | ROM_LOAD( "k1505_80.rom", 0x8000, 0x2000, CRC(350e4958) SHA1(7e5b587c59676e8549561117ea0b70234f439a94)) |
| 427 | |
| 428 | ROM_REGION( 0x800, "pcg", ROMREGION_ERASEFF ) |
| 429 | |
| 430 | ROM_REGION( 0x10000, "vram", ROMREGION_ERASE00 ) |
| 431 | |
| 432 | ROM_REGION( 0x10000, "attr", ROMREGION_ERASE00 ) |
| 433 | |
| 434 | ROM_REGION( 0x4000, "gfx2", ROMREGION_ERASEFF ) |
| 77 | 435 | ROM_LOAD( "k5651_40.rom", 0x0000, 0x2000, CRC(f4ad4739) SHA1(9a7bbe6f0d180dd513c7854f441cee986c8d9765)) |
| 78 | | ROM_LOAD( "k5651_60.rom", 0x0000, 0x2000, CRC(c77dde3f) SHA1(7c16226be6c4c71013e8008fba9d2e9c5640b6a7)) |
| 436 | ROM_LOAD( "k5651_60.rom", 0x2000, 0x2000, CRC(c77dde3f) SHA1(7c16226be6c4c71013e8008fba9d2e9c5640b6a7)) |
| 79 | 437 | ROM_END |
| 80 | 438 | |
| 81 | 439 | /* Driver */ |