src/mess/machine/mbc55x.c
| r10325 | r10326 | |
| 36 | 36 | #define DECODE_BIOS_RAW 0x0000004 |
| 37 | 37 | #define DECODE_DOS21 0x0000008 |
| 38 | 38 | |
| 39 | #define LOG_KEYBOARD 1 |
| 40 | |
| 41 | static void keyboard_reset(running_machine *machine); |
| 42 | static TIMER_CALLBACK(keyscan_callback); |
| 43 | static WRITE_LINE_DEVICE_HANDLER(pit8253_t2); |
| 44 | |
| 39 | 45 | static void decode_dos21(device_t *device,offs_t pc); |
| 40 | 46 | |
| 41 | 47 | |
| r10325 | r10326 | |
| 61 | 67 | //static void fdc_reset(running_machine *machine); |
| 62 | 68 | //static void set_disk_int(running_machine *machine, int state); |
| 63 | 69 | |
| 64 | | //static void keyboard_reset(running_machine *machine); |
| 65 | | //static TIMER_CALLBACK(keyscan_callback); |
| 66 | | |
| 67 | 70 | /* 8255 Configuration */ |
| 68 | 71 | |
| 69 | 72 | READ8_HANDLER(ppi8255_r) |
| 70 | 73 | { |
| 71 | 74 | device_t *ppi8255 = space->machine->device(PPI8255_TAG); |
| 72 | | |
| 75 | |
| 73 | 76 | switch(offset) |
| 74 | 77 | { |
| 75 | 78 | case 0 : return i8255a_r(ppi8255,0); break; |
| r10325 | r10326 | |
| 83 | 86 | WRITE8_HANDLER(ppi8255_w) |
| 84 | 87 | { |
| 85 | 88 | device_t *ppi8255 = space->machine->device(PPI8255_TAG); |
| 86 | | |
| 89 | |
| 87 | 90 | switch(offset) |
| 88 | 91 | { |
| 89 | 92 | case 0 : i8255a_w(ppi8255,0,data); break; |
| r10325 | r10326 | |
| 119 | 122 | WRITE8_DEVICE_HANDLER(mbc55x_ppi_portc_w) |
| 120 | 123 | { |
| 121 | 124 | device_t *wd17xx = device->machine->device(FDC_TAG); |
| 122 | | |
| 125 | |
| 123 | 126 | wd17xx_set_drive(wd17xx,(data & 0x03)); |
| 124 | 127 | wd17xx_set_side(wd17xx,((data & 0x04) >> 2)); |
| 125 | 128 | } |
| r10325 | r10326 | |
| 134 | 137 | DEVCB_HANDLER(mbc55x_ppi_portc_w) |
| 135 | 138 | }; |
| 136 | 139 | |
| 140 | /* Serial port USART, unimplemented as yet */ |
| 141 | |
| 142 | READ8_HANDLER(mbc55x_usart_r) |
| 143 | { |
| 144 | return 0; |
| 145 | } |
| 146 | |
| 147 | WRITE8_HANDLER(mbc55x_usart_w) |
| 148 | { |
| 149 | } |
| 150 | |
| 137 | 151 | /* PIC 8259 Configuration */ |
| 138 | 152 | |
| 139 | 153 | const struct pic8259_interface mbc55x_pic8259_config = |
| r10325 | r10326 | |
| 168 | 182 | static IRQ_CALLBACK(mbc55x_irq_callback) |
| 169 | 183 | { |
| 170 | 184 | device_t *pic8259 = device->machine->device(PIC8259_TAG); |
| 171 | | |
| 185 | |
| 172 | 186 | return pic8259_acknowledge( pic8259 ); |
| 173 | 187 | } |
| 174 | 188 | |
| r10325 | r10326 | |
| 178 | 192 | { |
| 179 | 193 | { |
| 180 | 194 | { |
| 181 | | PIT_C0_CLOCK, |
| 195 | PIT_C0_CLOCK, |
| 182 | 196 | DEVCB_NULL, |
| 183 | 197 | DEVCB_DEVICE_LINE(PIC8259_TAG, pic8259_ir0_w) |
| 184 | 198 | }, |
| 185 | 199 | { |
| 186 | | PIT_C1_CLOCK, |
| 200 | PIT_C1_CLOCK, |
| 187 | 201 | DEVCB_NULL, |
| 188 | 202 | DEVCB_DEVICE_LINE(PIC8259_TAG, pic8259_ir1_w) |
| 189 | 203 | }, |
| 190 | 204 | { |
| 191 | | PIT_C2_CLOCK, |
| 205 | PIT_C2_CLOCK, |
| 192 | 206 | DEVCB_NULL, |
| 193 | | DEVCB_NULL |
| 207 | DEVCB_LINE(pit8253_t2) |
| 194 | 208 | } |
| 195 | 209 | } |
| 196 | 210 | }; |
| r10325 | r10326 | |
| 198 | 212 | READ8_HANDLER(pit8253_r) |
| 199 | 213 | { |
| 200 | 214 | device_t *pit8253 = space->machine->device(PIT8253_TAG); |
| 201 | | |
| 215 | |
| 202 | 216 | switch(offset) |
| 203 | 217 | { |
| 204 | 218 | case 0 : return pit8253_r(pit8253,0); break; |
| r10325 | r10326 | |
| 212 | 226 | WRITE8_HANDLER(pit8253_w) |
| 213 | 227 | { |
| 214 | 228 | device_t *pit8253 = space->machine->device(PIT8253_TAG); |
| 215 | | |
| 229 | |
| 216 | 230 | switch(offset) |
| 217 | 231 | { |
| 218 | 232 | case 0 : pit8253_w(pit8253,0,data); break; |
| r10325 | r10326 | |
| 222 | 236 | } |
| 223 | 237 | } |
| 224 | 238 | |
| 239 | static WRITE_LINE_DEVICE_HANDLER(pit8253_t2) |
| 240 | { |
| 241 | device_t *msm8251_kb = device->machine->device(MSM8251A_KB_TAG); |
| 242 | |
| 243 | msm8251_transmit_clock(msm8251_kb); |
| 244 | msm8251_receive_clock(msm8251_kb); |
| 245 | } |
| 246 | |
| 225 | 247 | /* Video ram page register */ |
| 226 | 248 | |
| 227 | 249 | READ8_HANDLER(vram_page_r) |
| 228 | 250 | { |
| 229 | 251 | mbc55x_state *state = space->machine->driver_data<mbc55x_state>(); |
| 230 | | |
| 252 | |
| 231 | 253 | return state->vram_page; |
| 232 | 254 | } |
| 233 | 255 | |
| r10325 | r10326 | |
| 243 | 265 | READ8_HANDLER(mbc55x_disk_r) |
| 244 | 266 | { |
| 245 | 267 | device_t *wd17xx = space->machine->device(FDC_TAG); |
| 246 | | |
| 268 | |
| 247 | 269 | switch(offset) |
| 248 | 270 | { |
| 249 | 271 | case 0 : return wd17xx_status_r(wd17xx,0); break; |
| r10325 | r10326 | |
| 257 | 279 | WRITE8_HANDLER(mbc55x_disk_w) |
| 258 | 280 | { |
| 259 | 281 | device_t *wd17xx = space->machine->device(FDC_TAG); |
| 260 | | |
| 282 | |
| 261 | 283 | switch(offset) |
| 262 | 284 | { |
| 263 | 285 | case 0 : wd17xx_command_w(wd17xx,0,data); break; |
| r10325 | r10326 | |
| 275 | 297 | { |
| 276 | 298 | } |
| 277 | 299 | |
| 300 | /* |
| 301 | Keyboard emulation |
| 302 | |
| 303 | */ |
| 304 | |
| 305 | static void keyboard_reset(running_machine *machine) |
| 306 | { |
| 307 | mbc55x_state *state = machine->driver_data<mbc55x_state>(); |
| 308 | logerror("keyboard_reset()\n"); |
| 309 | |
| 310 | memset(state->keyboard.keyrows,0xFF,MBC55X_KEYROWS); |
| 311 | state->keyboard.key_special=0; |
| 312 | |
| 313 | // Setup timer to scan state->keyboard. |
| 314 | timer_adjust_periodic(state->keyboard.keyscan_timer, attotime::zero, 0, attotime::from_hz(50)); |
| 315 | } |
| 316 | |
| 317 | static void scan_keyboard(running_machine *machine) |
| 318 | |
| 319 | { |
| 320 | mbc55x_state *state = machine->driver_data<mbc55x_state>(); |
| 321 | device_t *msm8251 = machine->device(MSM8251A_KB_TAG); |
| 322 | UINT8 keyrow; |
| 323 | UINT8 row; |
| 324 | UINT8 bitno; |
| 325 | UINT8 mask; |
| 326 | |
| 327 | char key; |
| 328 | static const char *const keynames[] = { |
| 329 | "KEY0", "KEY1", "KEY2", "KEY3", "KEY4", |
| 330 | "KEY5", "KEY6", "KEY7", "KEY8", "KEY9", |
| 331 | "KEY10" |
| 332 | }; |
| 333 | |
| 334 | static const char keyvalues_normal[MBC55X_KEYROWS][8] = |
| 335 | { |
| 336 | { '1', '2', '3', '4' , '5', '6', '7', '8' }, |
| 337 | { '9', '0', '-', '=', '\\', 'q', 'w', 'e' }, |
| 338 | { 'r', 't', 'y', 'u', 'i', 'o', 'p', '[' }, |
| 339 | { ']', 'a', 's', 'd', 'f', 'g', 'h', 'j' }, |
| 340 | { 'k', 'l', ';', '\'', '`', 0x0D, 'z', 'x' }, |
| 341 | { 'c', 'v', 'b', 'n', 'm', ',', '.', '/', }, |
| 342 | { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ', } |
| 343 | |
| 344 | }; |
| 345 | |
| 346 | static const char keyvalues_shift[MBC55X_KEYROWS][8] = |
| 347 | { |
| 348 | { '!', '@', '#', '$' , '%', '^', '&', '*' }, |
| 349 | { '(', ')', '_', '+', '|', 'Q', 'W', 'E' }, |
| 350 | { 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{' }, |
| 351 | { '}', 'A', 'S', 'D', 'F', 'G', 'H', 'J' }, |
| 352 | { 'K', 'L', ':', '"', '~', 0x0d, 'Z', 'X' }, |
| 353 | { 'C', 'V', 'B', 'N', 'M', ',', '?', '/' }, |
| 354 | { ' ', ' ', ' ', ' ', ' ', ' ', ' ', ' ' } |
| 355 | }; |
| 356 | |
| 357 | // First read shift, control and graph |
| 358 | |
| 359 | state->keyboard.key_special=input_port_read(machine,KEY_SPECIAL_TAG); |
| 360 | |
| 361 | for(row=0;row<MBC55X_KEYROWS;row++) |
| 362 | { |
| 363 | keyrow=input_port_read(machine, keynames[row]); |
| 364 | |
| 365 | for(mask=0x80, bitno=7;mask>0;mask=mask>>1, bitno-=1) |
| 366 | { |
| 367 | if(!(keyrow & mask) && (state->keyboard.keyrows[row] & mask)) |
| 368 | { |
| 369 | if(state->keyboard.key_special & (KEY_BIT_LSHIFT | KEY_BIT_RSHIFT)) |
| 370 | key=keyvalues_shift[row][bitno]; |
| 371 | else |
| 372 | key=keyvalues_normal[row][bitno]; |
| 373 | |
| 374 | if (LOG_KEYBOARD) logerror("keypress %c\n",key); |
| 375 | msm8251_receive_character(msm8251,key); |
| 376 | } |
| 377 | } |
| 378 | |
| 379 | state->keyboard.keyrows[row]=keyrow; |
| 380 | } |
| 381 | } |
| 382 | |
| 383 | static TIMER_CALLBACK(keyscan_callback) |
| 384 | { |
| 385 | scan_keyboard(machine); |
| 386 | } |
| 387 | |
| 278 | 388 | /* msm8251 serial */ |
| 279 | 389 | |
| 280 | 390 | const msm8251_interface mbc55x_msm8251a_interface = |
| 281 | | { |
| 391 | { |
| 282 | 392 | DEVCB_NULL, |
| 283 | 393 | DEVCB_NULL, |
| 284 | 394 | DEVCB_NULL, |
| 285 | 395 | DEVCB_NULL, |
| 286 | 396 | DEVCB_NULL, |
| 397 | DEVCB_DEVICE_LINE(PIC8259_TAG, pic8259_ir3_w), |
| 287 | 398 | DEVCB_NULL, |
| 288 | 399 | DEVCB_NULL, |
| 289 | | DEVCB_NULL, |
| 290 | 400 | DEVCB_NULL |
| 291 | 401 | }; |
| 292 | 402 | |
| 293 | 403 | READ8_HANDLER(mbc55x_kb_usart_r) |
| 294 | 404 | { |
| 295 | | device_t *msm8251 = space->machine->device(MSM8251A_TAG); |
| 296 | | |
| 405 | mbc55x_state *state = space->machine->driver_data<mbc55x_state>(); |
| 406 | device_t *msm8251 = space->machine->device(MSM8251A_KB_TAG); |
| 407 | UINT8 result = 0; |
| 408 | |
| 297 | 409 | switch (offset) |
| 298 | 410 | { |
| 299 | | case 0 : return msm8251_data_r(msm8251,0); break; |
| 300 | | case 2 : return msm8251_status_r(msm8251,0); break; |
| 301 | | default : |
| 302 | | return 0; |
| 411 | case 0 : //logerror("%s read kb_uart\n",cpuexec_describe_context(space->machine)); |
| 412 | result=msm8251_data_r(msm8251,0); break; |
| 413 | |
| 414 | case 2 : result=msm8251_status_r(msm8251,0); |
| 415 | |
| 416 | if (state->keyboard.key_special & KEY_BIT_CTRL) // Parity error used to flag control down |
| 417 | result |= MSM8251_STATUS_PARITY_ERROR; |
| 418 | break; |
| 303 | 419 | } |
| 420 | |
| 421 | return result; |
| 304 | 422 | } |
| 305 | 423 | |
| 306 | 424 | WRITE8_HANDLER(mbc55x_kb_usart_w) |
| 307 | 425 | { |
| 308 | | device_t *msm8251 = space->machine->device(MSM8251A_TAG); |
| 426 | device_t *msm8251 = space->machine->device(MSM8251A_KB_TAG); |
| 309 | 427 | |
| 310 | 428 | switch (offset) |
| 311 | 429 | { |
| r10325 | r10326 | |
| 314 | 432 | } |
| 315 | 433 | } |
| 316 | 434 | |
| 317 | | DRIVER_INIT(mbc55x) |
| 318 | | { |
| 319 | | } |
| 320 | | |
| 321 | 435 | static void set_ram_size(running_machine *machine) |
| 322 | 436 | { |
| 323 | 437 | mbc55x_state *state = machine->driver_data<mbc55x_state>(); |
| 324 | | address_space *space = cputag_get_address_space( machine, MAINCPU_TAG, ADDRESS_SPACE_PROGRAM ); |
| 325 | | int ramsize = ram_get_size(machine->device(RAM_TAG)); |
| 438 | address_space *space = cputag_get_address_space( machine, MAINCPU_TAG, ADDRESS_SPACE_PROGRAM ); |
| 439 | int ramsize = ram_get_size(machine->device(RAM_TAG)); |
| 326 | 440 | int nobanks = ramsize / RAM_BANK_SIZE; |
| 327 | 441 | char bank[10]; |
| 328 | | int bankno; |
| 442 | int bankno; |
| 329 | 443 | UINT8 *ram = &ram_get_ptr(machine->device(RAM_TAG))[0]; |
| 330 | | UINT8 *map_base; |
| 444 | UINT8 *map_base; |
| 331 | 445 | int bank_base; |
| 332 | | |
| 333 | | |
| 446 | |
| 447 | |
| 334 | 448 | logerror("Ramsize is %d bytes\n",ramsize); |
| 335 | 449 | logerror("RAM_BANK_SIZE=%d, nobanks=%d\n",RAM_BANK_SIZE,nobanks); |
| 336 | | |
| 450 | |
| 337 | 451 | // Main memory mapping |
| 338 | | |
| 452 | |
| 339 | 453 | for(bankno=0; bankno<RAM_BANK_COUNT; bankno++) |
| 340 | 454 | { |
| 341 | 455 | sprintf(bank,"bank%x",bankno); |
| 342 | 456 | bank_base=bankno*RAM_BANK_SIZE; |
| 343 | 457 | map_base=&ram[bank_base]; |
| 344 | | |
| 458 | |
| 345 | 459 | if(bankno<nobanks) |
| 346 | 460 | { |
| 347 | 461 | memory_set_bankptr(machine, bank, map_base); |
| r10325 | r10326 | |
| 354 | 468 | logerror("Mapping bank %d at %05X to NOP\n",bankno,bank_base); |
| 355 | 469 | } |
| 356 | 470 | } |
| 357 | | |
| 471 | |
| 358 | 472 | // Graphics red and blue plane memory mapping, green is in main memory |
| 359 | 473 | memory_set_bankptr(machine, RED_PLANE_TAG, &state->video_mem[RED_PLANE_OFFSET]); |
| 360 | 474 | memory_install_readwrite_bank(space, RED_PLANE_MEMBASE, RED_PLANE_MEMBASE+(COLOUR_PLANE_SIZE-1), 0, 0, RED_PLANE_TAG); |
| r10325 | r10326 | |
| 362 | 476 | memory_install_readwrite_bank(space, BLUE_PLANE_MEMBASE, BLUE_PLANE_MEMBASE+(COLOUR_PLANE_SIZE-1), 0, 0, BLUE_PLANE_TAG); |
| 363 | 477 | } |
| 364 | 478 | |
| 479 | DRIVER_INIT(mbc55x) |
| 480 | { |
| 481 | } |
| 482 | |
| 365 | 483 | MACHINE_RESET( mbc55x ) |
| 366 | 484 | { |
| 367 | 485 | set_ram_size(machine); |
| 486 | keyboard_reset(machine); |
| 368 | 487 | cpu_set_irq_callback(machine->device(MAINCPU_TAG), mbc55x_irq_callback); |
| 369 | 488 | } |
| 370 | 489 | |
| r10325 | r10326 | |
| 374 | 493 | /* init cpu */ |
| 375 | 494 | // mbc55x_cpu_init(machine); |
| 376 | 495 | |
| 496 | |
| 377 | 497 | /* setup debug commands */ |
| 378 | 498 | if (machine->debug_flags & DEBUG_FLAG_ENABLED) |
| 379 | 499 | { |
| 380 | 500 | debug_console_register_command(machine, "mbc55x_debug", CMDFLAG_NONE, 0, 0, 1, mbc55x_debug); |
| 381 | | |
| 501 | |
| 382 | 502 | /* set up the instruction hook */ |
| 383 | 503 | machine->device(MAINCPU_TAG)->debug()->set_instruction_hook(instruction_hook); |
| 384 | 504 | } |
| 385 | 505 | |
| 386 | 506 | state->debug_machine=DEBUG_NONE; |
| 507 | |
| 508 | // Allocate keyscan timer |
| 509 | state->keyboard.keyscan_timer=machine->scheduler().timer_alloc(FUNC(keyscan_callback)); |
| 387 | 510 | } |
| 388 | 511 | |
| 389 | 512 | |
| 390 | 513 | static void mbc55x_debug(running_machine *machine, int ref, int params, const char *param[]) |
| 391 | 514 | { |
| 392 | 515 | mbc55x_state *state = machine->driver_data<mbc55x_state>(); |
| 393 | | if(params>0) |
| 394 | | { |
| 395 | | sscanf(param[0],"%d",&state->debug_machine); |
| 396 | | } |
| 397 | | else |
| 398 | | { |
| 399 | | debug_console_printf(machine,"Error usage : mbc55x_debug <debuglevel>\n"); |
| 400 | | debug_console_printf(machine,"Current debuglevel=%02X\n",state->debug_machine); |
| 401 | | } |
| 516 | if(params>0) |
| 517 | { |
| 518 | sscanf(param[0],"%d",&state->debug_machine); |
| 519 | } |
| 520 | else |
| 521 | { |
| 522 | debug_console_printf(machine,"Error usage : mbc55x_debug <debuglevel>\n"); |
| 523 | debug_console_printf(machine,"Current debuglevel=%02X\n",state->debug_machine); |
| 524 | } |
| 402 | 525 | } |
| 403 | 526 | |
| 404 | 527 | /*----------------------------------------------- |
| r10325 | r10326 | |
| 408 | 531 | static int instruction_hook(device_t &device, offs_t curpc) |
| 409 | 532 | { |
| 410 | 533 | mbc55x_state *state = device.machine->driver_data<mbc55x_state>(); |
| 411 | | address_space *space = cpu_get_address_space(&device, ADDRESS_SPACE_PROGRAM); |
| 412 | | UINT8 *addr_ptr; |
| 534 | address_space *space = cpu_get_address_space(&device, ADDRESS_SPACE_PROGRAM); |
| 535 | UINT8 *addr_ptr; |
| 413 | 536 | |
| 414 | | addr_ptr = (UINT8*)space->get_read_ptr(curpc); |
| 537 | addr_ptr = (UINT8*)space->get_read_ptr(curpc); |
| 415 | 538 | |
| 416 | 539 | if ((addr_ptr !=NULL) && (addr_ptr[0]==0xCD)) |
| 417 | 540 | { |
| 418 | 541 | // logerror("int %02X called\n",addr_ptr[1]); |
| 419 | | |
| 542 | |
| 420 | 543 | if(DEBUG_SET(DECODE_DOS21) && (addr_ptr[1]==0x21)) |
| 421 | | decode_dos21(&device,curpc); |
| 544 | decode_dos21(&device,curpc); |
| 422 | 545 | } |
| 423 | 546 | |
| 424 | | return 0; |
| 547 | return 0; |
| 425 | 548 | } |
| 426 | 549 | |
| 427 | 550 | static void decode_dos21(device_t *device,offs_t pc) |
| 428 | 551 | { |
| 429 | | device_t *cpu = device->machine->device(MAINCPU_TAG); |
| 552 | device_t *cpu = device->machine->device(MAINCPU_TAG); |
| 430 | 553 | |
| 431 | | UINT16 ax = cpu_get_reg(cpu,I8086_AX); |
| 432 | | UINT16 bx = cpu_get_reg(cpu,I8086_BX); |
| 433 | | UINT16 cx = cpu_get_reg(cpu,I8086_CX); |
| 554 | UINT16 ax = cpu_get_reg(cpu,I8086_AX); |
| 555 | UINT16 bx = cpu_get_reg(cpu,I8086_BX); |
| 556 | UINT16 cx = cpu_get_reg(cpu,I8086_CX); |
| 434 | 557 | UINT16 dx = cpu_get_reg(cpu,I8086_DX); |
| 435 | | UINT16 cs = cpu_get_reg(cpu,I8086_CS); |
| 558 | UINT16 cs = cpu_get_reg(cpu,I8086_CS); |
| 436 | 559 | UINT16 ds = cpu_get_reg(cpu,I8086_DS); |
| 437 | 560 | UINT16 es = cpu_get_reg(cpu,I8086_ES); |
| 438 | 561 | UINT16 ss = cpu_get_reg(cpu,I8086_SS); |
| 439 | | |
| 440 | | UINT16 si = cpu_get_reg(cpu,I8086_SI); |
| 441 | | UINT16 di = cpu_get_reg(cpu,I8086_DI); |
| 562 | |
| 563 | UINT16 si = cpu_get_reg(cpu,I8086_SI); |
| 564 | UINT16 di = cpu_get_reg(cpu,I8086_DI); |
| 442 | 565 | UINT16 bp = cpu_get_reg(cpu,I8086_BP); |
| 443 | 566 | |
| 444 | | logerror("=======================================================================\n"); |
| 445 | | logerror("DOS Int 0x21 call at %05X\n",pc); |
| 567 | logerror("=======================================================================\n"); |
| 568 | logerror("DOS Int 0x21 call at %05X\n",pc); |
| 446 | 569 | logerror("AX=%04X, BX=%04X, CX=%04X, DX=%04X\n",ax,bx,cx,dx); |
| 447 | 570 | logerror("CS=%04X, DS=%04X, ES=%04X, SS=%04X\n",cs,ds,es,ss); |
| 448 | 571 | logerror("SI=%04X, DI=%04X, BP=%04X\n",si,di,bp); |
| 449 | | logerror("=======================================================================\n"); |
| 450 | | |
| 572 | logerror("=======================================================================\n"); |
| 573 | |
| 451 | 574 | if((ax & 0xff00)==0x0900) |
| 452 | 575 | debugger_break(device->machine); |
| 453 | 576 | } |
src/mess/video/mbc55x.c
| r10325 | r10326 | |
| 82 | 82 | #include "mame.h" |
| 83 | 83 | |
| 84 | 84 | #define DEBUG_LINES 1 |
| 85 | #define DEBUG_VSYNC 2 |
| 85 | 86 | |
| 86 | | #define DEBUG_SET(flags) ((state->debug_video & (flags))==(flags)) |
| 87 | #define DEBUG_SET(flags) ((mstate->debug_video & (flags))==(flags)) |
| 87 | 88 | |
| 88 | 89 | static void video_debug(running_machine *machine, int ref, int params, const char *param[]); |
| 89 | 90 | static MC6845_UPDATE_ROW( vid_update_row ); |
| r10325 | r10326 | |
| 106 | 107 | |
| 107 | 108 | static void video_debug(running_machine *machine, int ref, int params, const char *param[]) |
| 108 | 109 | { |
| 109 | | mbc55x_state *state = machine->driver_data<mbc55x_state>(); |
| 110 | | if(params>0) |
| 111 | | { |
| 112 | | sscanf(param[0],"%d",&state->debug_video); |
| 113 | | } |
| 114 | | else |
| 115 | | { |
| 116 | | debug_console_printf(machine,"Error usage : mbc55x_vid_debug <debuglevel>\n"); |
| 117 | | debug_console_printf(machine,"Current debuglevel=%02X\n",state->debug_video); |
| 118 | | } |
| 110 | mbc55x_state *mstate = machine->driver_data<mbc55x_state>(); |
| 111 | if(params>0) |
| 112 | { |
| 113 | sscanf(param[0],"%d",&mstate->debug_video); |
| 114 | } |
| 115 | else |
| 116 | { |
| 117 | debug_console_printf(machine,"Error usage : mbc55x_vid_debug <debuglevel>\n"); |
| 118 | debug_console_printf(machine,"Current debuglevel=%02X\n",mstate->debug_video); |
| 119 | } |
| 119 | 120 | } |
| 120 | 121 | |
| 121 | 122 | static MC6845_UPDATE_ROW( vid_update_row ) |
| 122 | 123 | { |
| 123 | | mbc55x_state *state = device->machine->driver_data<mbc55x_state>(); |
| 124 | | |
| 124 | mbc55x_state *mstate = device->machine->driver_data<mbc55x_state>(); |
| 125 | |
| 125 | 126 | UINT8 *ram = &ram_get_ptr(device->machine->device(RAM_TAG))[0]; |
| 126 | | UINT8 *red = &state->video_mem[RED_PLANE_OFFSET]; |
| 127 | | UINT8 *blue = &state->video_mem[BLUE_PLANE_OFFSET]; |
| 127 | UINT8 *red = &mstate->video_mem[RED_PLANE_OFFSET]; |
| 128 | UINT8 *blue = &mstate->video_mem[BLUE_PLANE_OFFSET]; |
| 128 | 129 | UINT8 *green; |
| 129 | | int offset; |
| 130 | int offset; |
| 130 | 131 | UINT8 rpx,gpx,bpx; |
| 131 | 132 | UINT8 rb,gb,bb; |
| 132 | | |
| 133 | | int x_pos; |
| 134 | | int pixelno; |
| 133 | |
| 134 | int x_pos; |
| 135 | int pixelno; |
| 135 | 136 | UINT8 bitno; |
| 136 | 137 | UINT8 shifts; |
| 137 | 138 | UINT8 colour; |
| 138 | | |
| 139 | | switch(state->vram_page) |
| 139 | |
| 140 | switch(mstate->vram_page) |
| 140 | 141 | { |
| 141 | 142 | case 4 : green=&ram[0x08000]; break; |
| 142 | 143 | case 5 : green=&ram[0x1C000]; break; |
| r10325 | r10326 | |
| 145 | 146 | default : |
| 146 | 147 | green=&ram[0x0C000]; |
| 147 | 148 | } |
| 148 | | |
| 149 | |
| 149 | 150 | if(DEBUG_SET(DEBUG_LINES)) |
| 150 | 151 | logerror("MC6845_UPDATE_ROW: ma=%d, ra=%d, y=%d, x_count=%d\n",ma,ra,y,x_count); |
| 151 | | |
| 152 | | offset=(ra) + ((y/4)*(x_count*4)); |
| 153 | | |
| 152 | |
| 153 | offset=((ma*4) + ra) % COLOUR_PLANE_SIZE; |
| 154 | |
| 154 | 155 | if(DEBUG_SET(DEBUG_LINES)) |
| 155 | 156 | logerror("offset=%05X\n",offset); |
| 156 | | |
| 157 | |
| 157 | 158 | for(x_pos=0; x_pos<x_count; x_pos++) |
| 158 | 159 | { |
| 159 | 160 | rpx=red[offset+(x_pos*4)]; |
| 160 | 161 | gpx=green[offset+(x_pos*4)]; |
| 161 | 162 | bpx=blue[offset+(x_pos*4)]; |
| 162 | | |
| 163 | |
| 163 | 164 | bitno=0x80; |
| 164 | 165 | shifts=7; |
| 165 | | |
| 166 | |
| 166 | 167 | for(pixelno=0; pixelno<8; pixelno++) |
| 167 | 168 | { |
| 169 | |
| 168 | 170 | rb=(rpx & bitno) >> shifts; |
| 169 | 171 | gb=(gpx & bitno) >> shifts; |
| 170 | 172 | bb=(bpx & bitno) >> shifts; |
| 171 | | |
| 173 | |
| 172 | 174 | colour=(rb<<2) | (gb<<1) | (bb<<0); |
| 173 | | |
| 175 | |
| 174 | 176 | *BITMAP_ADDR16(bitmap, y, (x_pos*8)+pixelno)=colour; |
| 175 | 177 | //logerror("set pixel (%d,%d)=%d\n",y, ((x_pos*8)+pixelno),colour); |
| 176 | 178 | bitno=bitno>>1; |
| r10325 | r10326 | |
| 191 | 193 | READ8_HANDLER( mbc55x_video_io_r) |
| 192 | 194 | { |
| 193 | 195 | device_t *mc6845 = space->machine->device(VID_MC6845_NAME); |
| 194 | | |
| 196 | |
| 195 | 197 | switch(offset & 0x03) |
| 196 | 198 | { |
| 197 | 199 | case 0 : return mc6845_status_r(mc6845, 0); break; |
| r10325 | r10326 | |
| 203 | 205 | |
| 204 | 206 | WRITE8_HANDLER( mbc55x_video_io_w ) |
| 205 | 207 | { |
| 206 | | device_t *mc6845 = space->machine->device(VID_MC6845_NAME); |
| 207 | | |
| 208 | device_t *mc6845 = space->machine->device(VID_MC6845_NAME); |
| 209 | |
| 208 | 210 | switch(offset & 0x03) |
| 209 | 211 | { |
| 210 | | case 0 : mc6845_address_w(mc6845,0,data); |
| 211 | | case 2 : mc6845_register_w(mc6845,0,data); |
| 212 | case 0 : |
| 213 | mc6845_address_w(mc6845,0,data); |
| 214 | break; |
| 215 | case 2 : |
| 216 | mc6845_register_w(mc6845,0,data); |
| 217 | break; |
| 212 | 218 | } |
| 213 | 219 | } |
| 214 | 220 | |
| 215 | 221 | VIDEO_START( mbc55x ) |
| 216 | 222 | { |
| 217 | | mbc55x_state *state = machine->driver_data<mbc55x_state>(); |
| 218 | | state->debug_video=0; |
| 223 | mbc55x_state *mstate = machine->driver_data<mbc55x_state>(); |
| 224 | mstate->debug_video=0; |
| 219 | 225 | |
| 220 | | logerror("VIDEO_START\n"); |
| 226 | logerror("VIDEO_START\n"); |
| 221 | 227 | |
| 222 | 228 | if (machine->debug_flags & DEBUG_FLAG_ENABLED) |
| 223 | 229 | { |
| 224 | | debug_console_register_command(machine, "mbc55x_vid_debug", CMDFLAG_NONE, 0, 0, 1, video_debug); |
| 225 | | } |
| 230 | debug_console_register_command(machine, "mbc55x_vid_debug", CMDFLAG_NONE, 0, 0, 1, video_debug); |
| 231 | } |
| 226 | 232 | } |
| 227 | 233 | |
| 228 | 234 | VIDEO_RESET( mbc55x ) |
| 229 | 235 | { |
| 230 | | mbc55x_state *state = machine->driver_data<mbc55x_state>(); |
| 231 | | // When we reset clear the video registers and video memory. |
| 232 | | memset(&state->video_mem,0,sizeof(state->video_mem)); |
| 236 | mbc55x_state *mstate = machine->driver_data<mbc55x_state>(); |
| 237 | // When we reset clear the video registers and video memory. |
| 238 | memset(&mstate->video_mem,0,sizeof(mstate->video_mem)); |
| 233 | 239 | |
| 234 | | logerror("Video reset\n"); |
| 240 | logerror("Video reset\n"); |
| 235 | 241 | } |
| 236 | 242 | |
| 237 | 243 | VIDEO_EOF( mbc55x ) |
| 238 | 244 | { |
| 239 | | // logerror("VIDEO_EOF( mbc55x )\n"); |
| 245 | // logerror("VIDEO_EOF( mbc55x )\n"); |
| 240 | 246 | } |
| 241 | 247 | |
| 242 | 248 | VIDEO_UPDATE( mbc55x ) |
| r10325 | r10326 | |
| 244 | 250 | device_t *devconf = screen->machine->device(VID_MC6845_NAME); |
| 245 | 251 | mc6845_update( devconf, bitmap, cliprect); |
| 246 | 252 | |
| 247 | | #if 0 |
| 248 | | mbc55x_state *state = screen->machine->driver_data<mbc55x_state>(); |
| 249 | | int XCoord; |
| 250 | | int YCoord = screen->vpos(); |
| 251 | | |
| 252 | | for(XCoord=0;XCoord<SCREEN_WIDTH_PIXELS;XCoord++) |
| 253 | | { |
| 254 | | *BITMAP_ADDR16(bitmap, YCoord, XCoord)=state->video_mem[XCoord*YCoord]; |
| 255 | | } |
| 256 | | #endif |
| 257 | | return 0; |
| 253 | return 0; |
| 258 | 254 | } |
| 259 | 255 | |
src/mess/drivers/mbc55x.c
| r10325 | r10326 | |
| 27 | 27 | /*normal brightness */ |
| 28 | 28 | { 0x00,0x00,0x00 }, /* black */ |
| 29 | 29 | { 0x00,0x00,0x80 }, /* blue */ |
| 30 | | { 0x00,0x80,0x00 }, /* green */ |
| 31 | | { 0x00,0x80,0x80 }, /* cyan */ |
| 30 | { 0x00,0x80,0x00 }, /* green */ |
| 31 | { 0x00,0x80,0x80 }, /* cyan */ |
| 32 | 32 | { 0x80,0x00,0x00 }, /* red */ |
| 33 | | { 0x80,0x00,0x80 }, /* magenta */ |
| 33 | { 0x80,0x00,0x80 }, /* magenta */ |
| 34 | 34 | { 0x80,0x80,0x00 }, /* yellow */ |
| 35 | 35 | { 0x80,0x80,0x80 }, /* light grey */ |
| 36 | 36 | }; |
| r10325 | r10326 | |
| 48 | 48 | }; |
| 49 | 49 | |
| 50 | 50 | static ADDRESS_MAP_START(mbc55x_mem, ADDRESS_SPACE_PROGRAM, 8) |
| 51 | | AM_RANGE( 0x00000, 0x0FFFF ) AM_RAMBANK(RAM_BANK00_TAG) |
| 52 | | AM_RANGE( 0x10000, 0x1FFFF ) AM_RAMBANK(RAM_BANK01_TAG) |
| 53 | | AM_RANGE( 0x20000, 0x2FFFF ) AM_RAMBANK(RAM_BANK02_TAG) |
| 54 | | AM_RANGE( 0x30000, 0x3FFFF ) AM_RAMBANK(RAM_BANK03_TAG) |
| 55 | | AM_RANGE( 0x40000, 0x4FFFF ) AM_RAMBANK(RAM_BANK04_TAG) |
| 56 | | AM_RANGE( 0x50000, 0x5FFFF ) AM_RAMBANK(RAM_BANK05_TAG) |
| 57 | | AM_RANGE( 0x60000, 0x6FFFF ) AM_RAMBANK(RAM_BANK06_TAG) |
| 58 | | AM_RANGE( 0x70000, 0x7FFFF ) AM_RAMBANK(RAM_BANK07_TAG) |
| 59 | | AM_RANGE( 0x80000, 0x8FFFF ) AM_RAMBANK(RAM_BANK08_TAG) |
| 60 | | AM_RANGE( 0x90000, 0x9FFFF ) AM_RAMBANK(RAM_BANK09_TAG) |
| 61 | | AM_RANGE( 0xA0000, 0xAFFFF ) AM_RAMBANK(RAM_BANK0A_TAG) |
| 62 | | AM_RANGE( 0xB0000, 0xBFFFF ) AM_RAMBANK(RAM_BANK0B_TAG) |
| 63 | | AM_RANGE( 0xC0000, 0xCFFFF ) AM_RAMBANK(RAM_BANK0C_TAG) |
| 64 | | AM_RANGE( 0xD0000, 0xDFFFF ) AM_RAMBANK(RAM_BANK0D_TAG) |
| 65 | | AM_RANGE( 0xE0000, 0xEFFFF ) AM_RAMBANK(RAM_BANK0E_TAG) |
| 51 | AM_RANGE( 0x00000, 0x0FFFF ) AM_RAMBANK(RAM_BANK00_TAG) |
| 52 | AM_RANGE( 0x10000, 0x1FFFF ) AM_RAMBANK(RAM_BANK01_TAG) |
| 53 | AM_RANGE( 0x20000, 0x2FFFF ) AM_RAMBANK(RAM_BANK02_TAG) |
| 54 | AM_RANGE( 0x30000, 0x3FFFF ) AM_RAMBANK(RAM_BANK03_TAG) |
| 55 | AM_RANGE( 0x40000, 0x4FFFF ) AM_RAMBANK(RAM_BANK04_TAG) |
| 56 | AM_RANGE( 0x50000, 0x5FFFF ) AM_RAMBANK(RAM_BANK05_TAG) |
| 57 | AM_RANGE( 0x60000, 0x6FFFF ) AM_RAMBANK(RAM_BANK06_TAG) |
| 58 | AM_RANGE( 0x70000, 0x7FFFF ) AM_RAMBANK(RAM_BANK07_TAG) |
| 59 | AM_RANGE( 0x80000, 0x8FFFF ) AM_RAMBANK(RAM_BANK08_TAG) |
| 60 | AM_RANGE( 0x90000, 0x9FFFF ) AM_RAMBANK(RAM_BANK09_TAG) |
| 61 | AM_RANGE( 0xA0000, 0xAFFFF ) AM_RAMBANK(RAM_BANK0A_TAG) |
| 62 | AM_RANGE( 0xB0000, 0xBFFFF ) AM_RAMBANK(RAM_BANK0B_TAG) |
| 63 | AM_RANGE( 0xC0000, 0xCFFFF ) AM_RAMBANK(RAM_BANK0C_TAG) |
| 64 | AM_RANGE( 0xD0000, 0xDFFFF ) AM_RAMBANK(RAM_BANK0D_TAG) |
| 65 | AM_RANGE( 0xE0000, 0xEFFFF ) AM_RAMBANK(RAM_BANK0E_TAG) |
| 66 | 66 | AM_RANGE( 0xF0000, 0xF3FFF ) AM_RAMBANK(RED_PLANE_TAG) |
| 67 | 67 | AM_RANGE( 0xF4000, 0xF7FFF ) AM_RAMBANK(BLUE_PLANE_TAG) |
| 68 | 68 | AM_RANGE( 0xF8000, 0xFBFFF ) AM_NOP |
| 69 | | AM_RANGE( 0xFC000, 0xFFFFF ) AM_ROM AM_WRITENOP AM_REGION(MAINCPU_TAG, 0x0000) |
| 69 | AM_RANGE( 0xFC000, 0xFFFFF ) AM_ROM AM_WRITENOP AM_REGION(MAINCPU_TAG, 0x0000) AM_MIRROR(0x002000) |
| 70 | 70 | ADDRESS_MAP_END |
| 71 | 71 | |
| 72 | 72 | static ADDRESS_MAP_START(mbc55x_io, ADDRESS_SPACE_IO, 8) |
| 73 | 73 | AM_RANGE( 0X0000, 0X0003) AM_READWRITE( pic8259_r, pic8259_w) |
| 74 | | AM_RANGE( 0x0008, 0x000F) AM_READWRITE( mbc55x_disk_r, mbc55x_disk_w) |
| 74 | AM_RANGE( 0x0008, 0x000F) AM_READWRITE( mbc55x_disk_r, mbc55x_disk_w) |
| 75 | 75 | AM_RANGE( 0X0010, 0X0010) AM_READWRITE( vram_page_r, vram_page_w) |
| 76 | 76 | AM_RANGE( 0x0018, 0x001F) AM_READWRITE( ppi8255_r, ppi8255_w) |
| 77 | 77 | AM_RANGE( 0X0020, 0X0027) AM_READWRITE( pit8253_r, pit8253_w) |
| 78 | | AM_RANGE( 0x0030, 0x0033) AM_READWRITE( mbc55x_video_io_r, mbc55x_video_io_w) |
| 78 | AM_RANGE( 0x0028, 0x002B) AM_READWRITE( mbc55x_usart_r, mbc55x_usart_w) |
| 79 | AM_RANGE( 0x0030, 0x0033) AM_READWRITE( mbc55x_video_io_r, mbc55x_video_io_w) |
| 79 | 80 | AM_RANGE( 0x0038, 0x003B) AM_READWRITE( mbc55x_kb_usart_r, mbc55x_kb_usart_w) |
| 80 | 81 | ADDRESS_MAP_END |
| 81 | 82 | |
| 82 | 83 | static INPUT_PORTS_START( mbc55x ) |
| 83 | 84 | PORT_START("KEY0") /* Key row 0 scancodes 00..07 */ |
| 84 | 85 | //PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CHAR('1') |
| 85 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_UNUSED) |
| 86 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ESC") PORT_CODE(KEYCODE_ESC) PORT_CHAR(0x1B) |
| 87 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CHAR('1') |
| 88 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CHAR('2') |
| 89 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) PORT_CHAR('3') |
| 90 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) PORT_CHAR('4') |
| 91 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) PORT_CHAR('5') |
| 92 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) PORT_CHAR('6') |
| 93 | | |
| 86 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("1") PORT_CODE(KEYCODE_1) PORT_CHAR('1') |
| 87 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("2") PORT_CODE(KEYCODE_2) PORT_CHAR('2') |
| 88 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("3") PORT_CODE(KEYCODE_3) PORT_CHAR('3') |
| 89 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("4") PORT_CODE(KEYCODE_4) PORT_CHAR('4') |
| 90 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("5") PORT_CODE(KEYCODE_5) PORT_CHAR('5') |
| 91 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("6") PORT_CODE(KEYCODE_6) PORT_CHAR('6') |
| 92 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CHAR('7') |
| 93 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 94 | |
| 94 | 95 | PORT_START("KEY1") /* Key row 1 scancodes 08..0F */ |
| 95 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("7") PORT_CODE(KEYCODE_7) PORT_CHAR('7') |
| 96 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("8") PORT_CODE(KEYCODE_8) PORT_CHAR('8') |
| 97 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CHAR('9') |
| 98 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 99 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("-") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') |
| 100 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("=") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') |
| 101 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("BSPACE") PORT_CODE(KEYCODE_BACKSPACE) PORT_CHAR(0x08) |
| 102 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("TAB") PORT_CODE(KEYCODE_TAB) PORT_CHAR(0x09) |
| 96 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("9") PORT_CODE(KEYCODE_9) PORT_CHAR('9') |
| 97 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("0") PORT_CODE(KEYCODE_0) PORT_CHAR('0') |
| 98 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("-") PORT_CODE(KEYCODE_MINUS) PORT_CHAR('-') |
| 99 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("=") PORT_CODE(KEYCODE_EQUALS) PORT_CHAR('=') |
| 100 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("BSLASH") PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') |
| 101 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') |
| 102 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) PORT_CHAR('W') |
| 103 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 103 | 104 | |
| 104 | 105 | PORT_START("KEY2") /* Key row 2 scancodes 10..17 */ |
| 105 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Q") PORT_CODE(KEYCODE_Q) PORT_CHAR('Q') |
| 106 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("W") PORT_CODE(KEYCODE_W) PORT_CHAR('W') |
| 107 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("E") PORT_CODE(KEYCODE_E) PORT_CHAR('E') |
| 108 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) PORT_CHAR('R') |
| 109 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) PORT_CHAR('T') |
| 110 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') |
| 111 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) PORT_CHAR('U') |
| 112 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) PORT_CHAR('I') |
| 106 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("R") PORT_CODE(KEYCODE_R) PORT_CHAR('R') |
| 107 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("T") PORT_CODE(KEYCODE_T) PORT_CHAR('T') |
| 108 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Y") PORT_CODE(KEYCODE_Y) PORT_CHAR('Y') |
| 109 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("U") PORT_CODE(KEYCODE_U) PORT_CHAR('U') |
| 110 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("I") PORT_CODE(KEYCODE_I) PORT_CHAR('I') |
| 111 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) PORT_CHAR('O') |
| 112 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) PORT_CHAR('P') |
| 113 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("[") PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') |
| 113 | 114 | |
| 115 | |
| 114 | 116 | PORT_START("KEY3") /* Key row 3 scancodes 18..1F */ |
| 115 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("O") PORT_CODE(KEYCODE_O) PORT_CHAR('O') |
| 116 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("P") PORT_CODE(KEYCODE_P) PORT_CHAR('P') |
| 117 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("[") PORT_CODE(KEYCODE_OPENBRACE) PORT_CHAR('[') |
| 118 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("]") PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') |
| 119 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(0x0D) |
| 120 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) // Ether control |
| 121 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 122 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHAR('S') |
| 117 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("]") PORT_CODE(KEYCODE_CLOSEBRACE) PORT_CHAR(']') |
| 118 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("A") PORT_CODE(KEYCODE_A) PORT_CHAR('A') |
| 119 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("S") PORT_CODE(KEYCODE_S) PORT_CHAR('S') |
| 120 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 121 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 122 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 123 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) PORT_CHAR('H') |
| 124 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) PORT_CHAR('J') |
| 123 | 125 | |
| 124 | 126 | PORT_START("KEY4") /* Key row 4 scancodes 20..27 */ |
| 125 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("D") PORT_CODE(KEYCODE_D) PORT_CHAR('D') |
| 126 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F") PORT_CODE(KEYCODE_F) PORT_CHAR('F') |
| 127 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("G") PORT_CODE(KEYCODE_G) PORT_CHAR('G') |
| 128 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("H") PORT_CODE(KEYCODE_H) PORT_CHAR('H') |
| 129 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("J") PORT_CODE(KEYCODE_J) PORT_CHAR('J') |
| 130 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) PORT_CHAR('K') |
| 131 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHAR('L') |
| 132 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(";") PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') |
| 127 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("K") PORT_CODE(KEYCODE_K) PORT_CHAR('K') |
| 128 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("L") PORT_CODE(KEYCODE_L) PORT_CHAR('L') |
| 129 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(";") PORT_CODE(KEYCODE_COLON) PORT_CHAR(';') |
| 130 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("TILDE") PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') |
| 131 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("#") PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('#') |
| 132 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ENTER") PORT_CODE(KEYCODE_ENTER) PORT_CHAR(0x0D) |
| 133 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') |
| 134 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHAR('X') |
| 133 | 135 | |
| 136 | |
| 134 | 137 | PORT_START("KEY5") /* Key row 5 scancodes 28..2F */ |
| 135 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("#") PORT_CODE(KEYCODE_QUOTE) PORT_CHAR('#') |
| 138 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 139 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) PORT_CHAR('V') |
| 140 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 141 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) PORT_CHAR('N') |
| 142 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) PORT_CHAR('M') |
| 143 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(",") PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') |
| 144 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(".") PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') |
| 145 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("/") PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') |
| 146 | |
| 147 | PORT_START("KEY6") /* Key row 6 scancodes 30..37 */ |
| 148 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 149 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_UNUSED) |
| 150 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_UNUSED) |
| 151 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) |
| 152 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) |
| 153 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
| 154 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
| 155 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
| 156 | |
| 157 | #if 0 |
| 136 | 158 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("BACKSLASH") PORT_CODE(KEYCODE_BACKSLASH) PORT_CHAR('\\') |
| 137 | 159 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("LSHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 138 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("TILDE") PORT_CODE(KEYCODE_TILDE) PORT_CHAR('`') |
| 139 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) PORT_CHAR('Z') |
| 140 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("X") PORT_CODE(KEYCODE_X) PORT_CHAR('X') |
| 141 | | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("C") PORT_CODE(KEYCODE_C) PORT_CHAR('C') |
| 142 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("V") PORT_CODE(KEYCODE_V) PORT_CHAR('V') |
| 143 | 160 | |
| 144 | | PORT_START("KEY6") /* Key row 6 scancodes 30..37 */ |
| 145 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("B") PORT_CODE(KEYCODE_B) PORT_CHAR('B') |
| 146 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("N") PORT_CODE(KEYCODE_N) PORT_CHAR('N') |
| 147 | | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("M") PORT_CODE(KEYCODE_M) PORT_CHAR('M') |
| 148 | | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(",") PORT_CODE(KEYCODE_COMMA) PORT_CHAR(',') |
| 149 | | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME(".") PORT_CODE(KEYCODE_STOP) PORT_CHAR('.') |
| 150 | | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("/") PORT_CODE(KEYCODE_SLASH) PORT_CHAR('/') |
| 161 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) // Ether control |
| 162 | |
| 151 | 163 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("RSHIFT") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_2) |
| 152 | 164 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("PRSCR") PORT_CODE(KEYCODE_ASTERISK) PORT_CHAR('*') |
| 153 | 165 | |
| 154 | 166 | PORT_START("KEY7") /* Key row 7 scancodes 38..3F */ |
| 155 | | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ALT") PORT_CODE(KEYCODE_LALT) PORT_CODE(KEYCODE_RALT) |
| 156 | | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHAR(' ') |
| 167 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("ALT") PORT_CODE(KEYCODE_LALT) PORT_CODE(KEYCODE_RALT) |
| 157 | 168 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("CAPS") PORT_CODE(KEYCODE_CAPSLOCK) |
| 158 | 169 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F1") PORT_CODE(KEYCODE_F1) |
| 159 | 170 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F2") PORT_CODE(KEYCODE_F2) |
| r10325 | r10326 | |
| 161 | 172 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F4") PORT_CODE(KEYCODE_F4) |
| 162 | 173 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F5") PORT_CODE(KEYCODE_F5) |
| 163 | 174 | |
| 164 | | PORT_START("KEY8") /* Key row 8 scancodes 40..47 */ |
| 175 | |
| 176 | PORT_START("KEY8") /* Key row 8 scancodes 40..47 */ |
| 165 | 177 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F6") PORT_CODE(KEYCODE_F6) |
| 166 | 178 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F7") PORT_CODE(KEYCODE_F7) |
| 167 | 179 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F8") PORT_CODE(KEYCODE_F8) |
| r10325 | r10326 | |
| 169 | 181 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("F10") PORT_CODE(KEYCODE_F10) |
| 170 | 182 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("NUMLK") PORT_CODE(KEYCODE_NUMLOCK) |
| 171 | 183 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("SCRLK") PORT_CODE(KEYCODE_SCRLOCK) |
| 172 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("KP7") PORT_CODE(KEYCODE_7_PAD) PORT_CHAR('7') |
| 184 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("KP7") PORT_CODE(KEYCODE_7_PAD) PORT_CHAR('7') |
| 173 | 185 | |
| 174 | 186 | PORT_START("KEY9") /* Key row 9 scancodes 48..4F */ |
| 175 | 187 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("KP8") PORT_CODE(KEYCODE_8_PAD) //PORT_CHAR('8') |
| r10325 | r10326 | |
| 179 | 191 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("KP5") PORT_CODE(KEYCODE_5_PAD) //PORT_CHAR('5') |
| 180 | 192 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("KP6") PORT_CODE(KEYCODE_6_PAD) //PORT_CHAR('6') |
| 181 | 193 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("KP+") PORT_CODE(KEYCODE_PLUS_PAD) //PORT_CHAR('+') |
| 182 | | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("KP1") PORT_CODE(KEYCODE_1_PAD) //PORT_CHAR('1') |
| 194 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("KP1") PORT_CODE(KEYCODE_1_PAD) //PORT_CHAR('1') |
| 183 | 195 | |
| 184 | 196 | PORT_START("KEY10") /* Key row 10 scancodes 50..57 */ |
| 185 | 197 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("KP2") PORT_CODE(KEYCODE_2_PAD) //PORT_CHAR('2') |
| r10325 | r10326 | |
| 190 | 202 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
| 191 | 203 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
| 192 | 204 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
| 193 | | //PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("KP5") PORT_CODE(KEYCODE_5_PAD) PORT_CHAR('5') |
| 205 | //PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("KP5") PORT_CODE(KEYCODE_5_PAD) PORT_CHAR('5') |
| 194 | 206 | //PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("KP6") PORT_CODE(KEYCODE_6_PAD) PORT_CHAR('6') |
| 195 | 207 | //PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("KP+") PORT_CODE(KEYCODE_PLUS_PAD) PORT_CHAR('+') |
| 196 | | //PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("KP1") PORT_CODE(KEYCODE_1_PAD) PORT_CHAR('1') |
| 208 | //PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_KEYBOARD) PORT_NAME("KP1") PORT_CODE(KEYCODE_1_PAD) PORT_CHAR('1') |
| 209 | #endif |
| 210 | |
| 211 | PORT_START(KEY_SPECIAL_TAG) |
| 212 | PORT_BIT(KEY_BIT_LSHIFT, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("LSHIFT") PORT_CODE(KEYCODE_LSHIFT) PORT_CHAR(UCHAR_SHIFT_1) |
| 213 | PORT_BIT(KEY_BIT_RSHIFT, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("RSHIFT") PORT_CODE(KEYCODE_RSHIFT) PORT_CHAR(UCHAR_SHIFT_2) |
| 214 | PORT_BIT(KEY_BIT_CTRL, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("CTRL") PORT_CODE(KEYCODE_LCONTROL) PORT_CODE(KEYCODE_RCONTROL) // Ether control |
| 215 | PORT_BIT(KEY_BIT_GRAPH, IP_ACTIVE_HIGH, IPT_KEYBOARD) PORT_NAME("GRAPH") PORT_CODE(KEYCODE_LALT) PORT_CODE(KEYCODE_RALT) |
| 216 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) |
| 217 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
| 218 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) |
| 219 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) |
| 220 | |
| 197 | 221 | INPUT_PORTS_END |
| 198 | 222 | |
| 199 | 223 | |
| r10325 | r10326 | |
| 204 | 228 | logerror("initializing palette\n"); |
| 205 | 229 | |
| 206 | 230 | for ( colourno = 0; colourno < SCREEN_NO_COLOURS; colourno++ ) |
| 207 | | { |
| 231 | { |
| 208 | 232 | palette_set_color_rgb(machine, colourno, mbc55x_palette[colourno][RED], mbc55x_palette[colourno][GREEN], mbc55x_palette[colourno][BLUE]); |
| 209 | 233 | } |
| 210 | 234 | } |
| 211 | 235 | |
| 212 | 236 | |
| 213 | 237 | static MACHINE_CONFIG_START( mbc55x, mbc55x_state ) |
| 214 | | /* basic machine hardware */ |
| 238 | /* basic machine hardware */ |
| 239 | |
| 240 | MCFG_CPU_ADD(MAINCPU_TAG, I8088, 3600000) |
| 241 | MCFG_CPU_PROGRAM_MAP(mbc55x_mem) |
| 242 | MCFG_CPU_IO_MAP(mbc55x_io) |
| 215 | 243 | |
| 216 | | MCFG_CPU_ADD(MAINCPU_TAG, I8088, 3600000) |
| 217 | | MCFG_CPU_PROGRAM_MAP(mbc55x_mem) |
| 218 | | MCFG_CPU_IO_MAP(mbc55x_io) |
| 244 | MCFG_MACHINE_START( mbc55x ) |
| 219 | 245 | |
| 220 | | MCFG_MACHINE_START( mbc55x ) |
| 246 | MCFG_MACHINE_RESET(mbc55x) |
| 221 | 247 | |
| 222 | | MCFG_MACHINE_RESET(mbc55x) |
| 223 | | |
| 224 | 248 | MCFG_PIT8253_ADD( PIT8253_TAG, mbc55x_pit8253_config ) |
| 225 | 249 | MCFG_PIC8259_ADD( PIC8259_TAG, mbc55x_pic8259_config ) |
| 226 | 250 | MCFG_I8255A_ADD( PPI8255_TAG, mbc55x_ppi8255_interface ) |
| 227 | 251 | |
| 228 | | /* video hardware */ |
| 229 | | MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) |
| 252 | /* video hardware */ |
| 253 | MCFG_SCREEN_ADD(SCREEN_TAG, RASTER) |
| 230 | 254 | MCFG_SCREEN_FORMAT(BITMAP_FORMAT_INDEXED16) |
| 231 | 255 | MCFG_SCREEN_RAW_PARAMS(XTAL_14_31818MHz,896,0,300,262,0,200) |
| 232 | 256 | |
| 233 | | MCFG_PALETTE_LENGTH(SCREEN_NO_COLOURS * 3) |
| 257 | MCFG_PALETTE_LENGTH(SCREEN_NO_COLOURS * 3) |
| 234 | 258 | MCFG_PALETTE_INIT( mbc55x ) |
| 235 | 259 | |
| 236 | 260 | MCFG_MC6845_ADD(VID_MC6845_NAME, MC6845, XTAL_14_31818MHz/8, mb55x_mc6845_intf) |
| 237 | 261 | |
| 238 | | // MCFG_SCREEN_SIZE(650, 260) |
| 239 | | // MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 249) |
| 262 | // MCFG_SCREEN_SIZE(650, 260) |
| 263 | // MCFG_SCREEN_VISIBLE_AREA(0, 639, 0, 249) |
| 240 | 264 | |
| 241 | | MCFG_VIDEO_START(mbc55x) |
| 242 | | MCFG_VIDEO_UPDATE(mbc55x) |
| 243 | | MCFG_VIDEO_EOF(mbc55x) |
| 244 | | MCFG_VIDEO_RESET(mbc55x) |
| 265 | MCFG_VIDEO_START(mbc55x) |
| 266 | MCFG_VIDEO_UPDATE(mbc55x) |
| 267 | MCFG_VIDEO_EOF(mbc55x) |
| 268 | MCFG_VIDEO_RESET(mbc55x) |
| 245 | 269 | |
| 246 | | /* Backing storage */ |
| 270 | /* Backing storage */ |
| 247 | 271 | MCFG_WD1793_ADD(FDC_TAG, mbc55x_wd17xx_interface ) |
| 248 | 272 | MCFG_FLOPPY_4_DRIVES_ADD(mbc55x_floppy_config) |
| 249 | 273 | |
| 250 | | MCFG_RAM_ADD(RAM_TAG) |
| 274 | MCFG_RAM_ADD(RAM_TAG) |
| 251 | 275 | MCFG_RAM_DEFAULT_SIZE("128K") |
| 252 | 276 | MCFG_RAM_EXTRA_OPTIONS("128K,192K,256K,320K,384K,448K,512K,576K,640K") |
| 253 | 277 | |
| 254 | | /* Peripheral chips */ |
| 255 | | |
| 256 | | MCFG_MSM8251_ADD(MSM8251A_TAG,mbc55x_msm8251a_interface); |
| 257 | | |
| 278 | /* Peripheral chips */ |
| 279 | |
| 280 | MCFG_MSM8251_ADD(MSM8251A_KB_TAG,mbc55x_msm8251a_interface); |
| 281 | |
| 258 | 282 | /* sound hardware */ |
| 259 | 283 | MCFG_SPEAKER_STANDARD_MONO(MONO_TAG) |
| 260 | 284 | MCFG_SOUND_ADD(SPEAKER_TAG, SPEAKER_SOUND, 0) |
| r10325 | r10326 | |
| 263 | 287 | |
| 264 | 288 | |
| 265 | 289 | ROM_START( mbc55x ) |
| 266 | | ROM_REGION( 0x4000, MAINCPU_TAG, 0 ) |
| 290 | ROM_REGION( 0x4000, MAINCPU_TAG, 0 ) |
| 267 | 291 | |
| 268 | | ROM_SYSTEM_BIOS(0, "v120", "mbc55x BIOS v1.20 (1983)") |
| 269 | | ROMX_LOAD("mbc55x-v120.rom", 0x2000, 0x2000, CRC(b439b4b8) SHA1(6e8df0f3868e3fd0229a5c2720d6c01e46815cab), ROM_BIOS(1) ) |
| 292 | ROM_SYSTEM_BIOS(0, "v120", "mbc55x BIOS v1.20 (1983)") |
| 293 | ROMX_LOAD("mbc55x-v120.rom", 0x0000, 0x2000, CRC(b439b4b8) SHA1(6e8df0f3868e3fd0229a5c2720d6c01e46815cab), ROM_BIOS(1) ) |
| 270 | 294 | ROM_END |
| 271 | 295 | |
| 272 | 296 | |