src/mess/machine/i82439tx.c
| r2771 | r2772 | |
| 102 | 102 | |
| 103 | 103 | |
| 104 | 104 | |
| 105 | | static void intel82439tx_configure_memory(UINT8 val, offs_t begin, offs_t end, int read_bank, write32_machine_func wh) |
| 105 | static void intel82439tx_configure_memory(running_machine *machine, UINT8 val, offs_t begin, offs_t end, int read_bank, write32_machine_func wh) |
| 106 | 106 | { |
| 107 | | memory_install_read_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, read_bank); |
| 107 | memory_install_read_handler(machine, 0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, read_bank); |
| 108 | 108 | if (val & 0x01) |
| 109 | 109 | memory_set_bankptr(read_bank, i82439tx->bios_ram + (begin - 0xC0000) / 4); |
| 110 | 110 | else |
| 111 | 111 | memory_set_bankptr(read_bank, memory_region(REGION_USER1) + (begin - 0xC0000)); |
| 112 | 112 | |
| 113 | 113 | if (val & 0x02) |
| 114 | | memory_install_write32_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, wh); |
| 114 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, wh); |
| 115 | 115 | else |
| 116 | | memory_install_write32_handler(Machine, 0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, SMH_NOP); |
| 116 | memory_install_write32_handler(machine, 0, ADDRESS_SPACE_PROGRAM, begin, end, 0, 0, SMH_NOP); |
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | |
| 120 | 120 | |
| 121 | 121 | static void intel82439tx_pci_write(int function, int offset, UINT32 data, UINT32 mem_mask) |
| 122 | 122 | { |
| 123 | running_machine *machine = Machine; |
| 124 | |
| 123 | 125 | if (function != 0) |
| 124 | 126 | return; |
| 125 | 127 | |
| r2771 | r2772 | |
| 157 | 159 | { |
| 158 | 160 | case 0x58: |
| 159 | 161 | if (!(mem_mask & 0x0000f000)) |
| 160 | | intel82439tx_configure_memory(data >> 12, 0xF0000, 0xFFFFF, BANK_F0000_R, bank_f0000_w); |
| 162 | intel82439tx_configure_memory(machine, data >> 12, 0xF0000, 0xFFFFF, BANK_F0000_R, bank_f0000_w); |
| 161 | 163 | if (!(mem_mask & 0x000f0000)) |
| 162 | | intel82439tx_configure_memory(data >> 16, 0xC0000, 0xC3FFF, BANK_C0000_R, bank_c0000_w); |
| 164 | intel82439tx_configure_memory(machine, data >> 16, 0xC0000, 0xC3FFF, BANK_C0000_R, bank_c0000_w); |
| 163 | 165 | if (!(mem_mask & 0x00f00000)) |
| 164 | | intel82439tx_configure_memory(data >> 20, 0xC4000, 0xC7FFF, BANK_C4000_R, bank_c4000_w); |
| 166 | intel82439tx_configure_memory(machine, data >> 20, 0xC4000, 0xC7FFF, BANK_C4000_R, bank_c4000_w); |
| 165 | 167 | if (!(mem_mask & 0x0f000000)) |
| 166 | | intel82439tx_configure_memory(data >> 24, 0xC8000, 0xCCFFF, BANK_C8000_R, bank_c8000_w); |
| 168 | intel82439tx_configure_memory(machine, data >> 24, 0xC8000, 0xCCFFF, BANK_C8000_R, bank_c8000_w); |
| 167 | 169 | if (!(mem_mask & 0xf0000000)) |
| 168 | | intel82439tx_configure_memory(data >> 28, 0xCC000, 0xCFFFF, BANK_CC000_R, bank_cc000_w); |
| 170 | intel82439tx_configure_memory(machine, data >> 28, 0xCC000, 0xCFFFF, BANK_CC000_R, bank_cc000_w); |
| 169 | 171 | break; |
| 170 | 172 | |
| 171 | 173 | case 0x5C: |
| 172 | 174 | if (!(mem_mask & 0x0000000f)) |
| 173 | | intel82439tx_configure_memory(data >> 0, 0xD0000, 0xD3FFF, BANK_D0000_R, bank_d0000_w); |
| 175 | intel82439tx_configure_memory(machine, data >> 0, 0xD0000, 0xD3FFF, BANK_D0000_R, bank_d0000_w); |
| 174 | 176 | if (!(mem_mask & 0x000000f0)) |
| 175 | | intel82439tx_configure_memory(data >> 4, 0xD4000, 0xD7FFF, BANK_D4000_R, bank_d4000_w); |
| 177 | intel82439tx_configure_memory(machine, data >> 4, 0xD4000, 0xD7FFF, BANK_D4000_R, bank_d4000_w); |
| 176 | 178 | if (!(mem_mask & 0x00000f00)) |
| 177 | | intel82439tx_configure_memory(data >> 8, 0xD8000, 0xDBFFF, BANK_D8000_R, bank_d8000_w); |
| 179 | intel82439tx_configure_memory(machine, data >> 8, 0xD8000, 0xDBFFF, BANK_D8000_R, bank_d8000_w); |
| 178 | 180 | if (!(mem_mask & 0x0000f000)) |
| 179 | | intel82439tx_configure_memory(data >> 12, 0xDC000, 0xDFFFF, BANK_DC000_R, bank_dc000_w); |
| 181 | intel82439tx_configure_memory(machine, data >> 12, 0xDC000, 0xDFFFF, BANK_DC000_R, bank_dc000_w); |
| 180 | 182 | if (!(mem_mask & 0x000f0000)) |
| 181 | | intel82439tx_configure_memory(data >> 16, 0xE0000, 0xE3FFF, BANK_E0000_R, bank_e0000_w); |
| 183 | intel82439tx_configure_memory(machine, data >> 16, 0xE0000, 0xE3FFF, BANK_E0000_R, bank_e0000_w); |
| 182 | 184 | if (!(mem_mask & 0x00f00000)) |
| 183 | | intel82439tx_configure_memory(data >> 20, 0xE4000, 0xE7FFF, BANK_E4000_R, bank_e4000_w); |
| 185 | intel82439tx_configure_memory(machine, data >> 20, 0xE4000, 0xE7FFF, BANK_E4000_R, bank_e4000_w); |
| 184 | 186 | if (!(mem_mask & 0x0f000000)) |
| 185 | | intel82439tx_configure_memory(data >> 24, 0xE8000, 0xECFFF, BANK_E8000_R, bank_e8000_w); |
| 187 | intel82439tx_configure_memory(machine, data >> 24, 0xE8000, 0xECFFF, BANK_E8000_R, bank_e8000_w); |
| 186 | 188 | if (!(mem_mask & 0xf0000000)) |
| 187 | | intel82439tx_configure_memory(data >> 28, 0xEC000, 0xEFFFF, BANK_EC000_R, bank_ec000_w); |
| 189 | intel82439tx_configure_memory(machine, data >> 28, 0xEC000, 0xEFFFF, BANK_EC000_R, bank_ec000_w); |
| 188 | 190 | break; |
| 189 | 191 | } |
| 190 | 192 | |
| r2771 | r2772 | |
| 230 | 232 | i82439tx->regs[0x04] = 0x02020202; |
| 231 | 233 | i82439tx->regs[0x05] = 0x00000002; |
| 232 | 234 | |
| 233 | | intel82439tx_configure_memory(0, 0xF0000, 0xFFFFF, BANK_F0000_R, bank_f0000_w); |
| 234 | | intel82439tx_configure_memory(0, 0xC0000, 0xC3FFF, BANK_C0000_R, bank_c0000_w); |
| 235 | | intel82439tx_configure_memory(0, 0xC4000, 0xC7FFF, BANK_C4000_R, bank_c4000_w); |
| 236 | | intel82439tx_configure_memory(0, 0xC8000, 0xCCFFF, BANK_C8000_R, bank_c8000_w); |
| 237 | | intel82439tx_configure_memory(0, 0xCC000, 0xCFFFF, BANK_CC000_R, bank_cc000_w); |
| 238 | | intel82439tx_configure_memory(0, 0xD0000, 0xD3FFF, BANK_D0000_R, bank_d0000_w); |
| 239 | | intel82439tx_configure_memory(0, 0xD4000, 0xD7FFF, BANK_D4000_R, bank_d4000_w); |
| 240 | | intel82439tx_configure_memory(0, 0xD8000, 0xDBFFF, BANK_D8000_R, bank_d8000_w); |
| 241 | | intel82439tx_configure_memory(0, 0xDC000, 0xDFFFF, BANK_DC000_R, bank_dc000_w); |
| 242 | | intel82439tx_configure_memory(0, 0xE0000, 0xE3FFF, BANK_E0000_R, bank_e0000_w); |
| 243 | | intel82439tx_configure_memory(0, 0xE4000, 0xE7FFF, BANK_E4000_R, bank_e4000_w); |
| 244 | | intel82439tx_configure_memory(0, 0xE8000, 0xECFFF, BANK_E8000_R, bank_e8000_w); |
| 245 | | intel82439tx_configure_memory(0, 0xEC000, 0xEFFFF, BANK_EC000_R, bank_ec000_w); |
| 235 | intel82439tx_configure_memory(Machine, 0, 0xF0000, 0xFFFFF, BANK_F0000_R, bank_f0000_w); |
| 236 | intel82439tx_configure_memory(Machine, 0, 0xC0000, 0xC3FFF, BANK_C0000_R, bank_c0000_w); |
| 237 | intel82439tx_configure_memory(Machine, 0, 0xC4000, 0xC7FFF, BANK_C4000_R, bank_c4000_w); |
| 238 | intel82439tx_configure_memory(Machine, 0, 0xC8000, 0xCCFFF, BANK_C8000_R, bank_c8000_w); |
| 239 | intel82439tx_configure_memory(Machine, 0, 0xCC000, 0xCFFFF, BANK_CC000_R, bank_cc000_w); |
| 240 | intel82439tx_configure_memory(Machine, 0, 0xD0000, 0xD3FFF, BANK_D0000_R, bank_d0000_w); |
| 241 | intel82439tx_configure_memory(Machine, 0, 0xD4000, 0xD7FFF, BANK_D4000_R, bank_d4000_w); |
| 242 | intel82439tx_configure_memory(Machine, 0, 0xD8000, 0xDBFFF, BANK_D8000_R, bank_d8000_w); |
| 243 | intel82439tx_configure_memory(Machine, 0, 0xDC000, 0xDFFFF, BANK_DC000_R, bank_dc000_w); |
| 244 | intel82439tx_configure_memory(Machine, 0, 0xE0000, 0xE3FFF, BANK_E0000_R, bank_e0000_w); |
| 245 | intel82439tx_configure_memory(Machine, 0, 0xE4000, 0xE7FFF, BANK_E4000_R, bank_e4000_w); |
| 246 | intel82439tx_configure_memory(Machine, 0, 0xE8000, 0xECFFF, BANK_E8000_R, bank_e8000_w); |
| 247 | intel82439tx_configure_memory(Machine, 0, 0xEC000, 0xEFFFF, BANK_EC000_R, bank_ec000_w); |
| 246 | 248 | } |
| 247 | 249 | |
src/mess/drivers/a2600.c
| r2771 | r2772 | |
| 132 | 132 | |
| 133 | 133 | // try to detect 2600 controller setup. returns 32bits with left/right controller info |
| 134 | 134 | |
| 135 | | static unsigned long detect_2600controllers(void) |
| 135 | static unsigned long detect_2600controllers(running_machine *machine) |
| 136 | 136 | { |
| 137 | 137 | #define JOYS 0x001 |
| 138 | 138 | #define PADD 0x002 |
| r2771 | r2772 | |
| 206 | 206 | return (left << 16) + right; |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | | static int detect_modeDC(void) |
| 209 | static int detect_modeDC(running_machine *machine) |
| 210 | 210 | { |
| 211 | 211 | int i,numfound = 0; |
| 212 | 212 | // signature is also in 'video reflex'.. maybe figure out that controller port someday... |
| r2771 | r2772 | |
| 225 | 225 | return 0; |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | | static int detect_modef6(void) |
| 228 | static int detect_modef6(running_machine *machine) |
| 229 | 229 | { |
| 230 | 230 | int i,numfound = 0; |
| 231 | 231 | static const unsigned char signature[3] = { 0x8d, 0xf6, 0xff }; |
| r2771 | r2772 | |
| 243 | 243 | return 0; |
| 244 | 244 | } |
| 245 | 245 | |
| 246 | | static int detect_mode3E(void) |
| 246 | static int detect_mode3E(running_machine *machine) |
| 247 | 247 | { |
| 248 | 248 | // this one is a little hacky.. looks for STY $3e, which is unique to |
| 249 | 249 | // 'not boulderdash', but is the only example i have (cow) |
| r2771 | r2772 | |
| 265 | 265 | return 0; |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | | static int detect_modeSS(void) |
| 268 | static int detect_modeSS(running_machine *machine) |
| 269 | 269 | { |
| 270 | 270 | int i,numfound = 0; |
| 271 | 271 | static const unsigned char signature[5] = { 0xbd, 0xe5, 0xff, 0x95, 0x81 }; |
| r2771 | r2772 | |
| 283 | 283 | return 0; |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | | static int detect_modeFE(void) |
| 286 | static int detect_modeFE(running_machine *machine) |
| 287 | 287 | { |
| 288 | 288 | int i,j,numfound = 0; |
| 289 | 289 | static const unsigned char signatures[][5] = { |
| r2771 | r2772 | |
| 308 | 308 | return 0; |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | | static int detect_modeE0(void) |
| 311 | static int detect_modeE0(running_machine *machine) |
| 312 | 312 | { |
| 313 | 313 | int i,j,numfound = 0; |
| 314 | 314 | static const unsigned char signatures[][3] = { |
| r2771 | r2772 | |
| 335 | 335 | return 0; |
| 336 | 336 | } |
| 337 | 337 | |
| 338 | | static int detect_modeCV(void) |
| 338 | static int detect_modeCV(running_machine *machine) |
| 339 | 339 | { |
| 340 | 340 | int i,j,numfound = 0; |
| 341 | 341 | static const unsigned char signatures[][3] = { |
| r2771 | r2772 | |
| 358 | 358 | return 0; |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | | static int detect_modeFV(void) |
| 361 | static int detect_modeFV(running_machine *machine) |
| 362 | 362 | { |
| 363 | 363 | int i,j,numfound = 0; |
| 364 | 364 | static const unsigned char signatures[][3] = { |
| r2771 | r2772 | |
| 381 | 381 | return 0; |
| 382 | 382 | } |
| 383 | 383 | |
| 384 | | static int detect_modeJVP(void) |
| 384 | static int detect_modeJVP(running_machine *machine) |
| 385 | 385 | { |
| 386 | 386 | int i,j,numfound = 0; |
| 387 | 387 | static const unsigned char signatures[][4] = { |
| r2771 | r2772 | |
| 404 | 404 | return 0; |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | | static int detect_modeE7(void) |
| 407 | static int detect_modeE7(running_machine *machine) |
| 408 | 408 | { |
| 409 | 409 | int i,j,numfound = 0; |
| 410 | 410 | static const unsigned char signatures[][3] = { |
| r2771 | r2772 | |
| 427 | 427 | return 0; |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | | static int detect_modeUA(void) |
| 430 | static int detect_modeUA(running_machine *machine) |
| 431 | 431 | { |
| 432 | 432 | int i,numfound = 0; |
| 433 | 433 | static const unsigned char signature[3] = { 0x8d, 0x40, 0x02 }; |
| r2771 | r2772 | |
| 445 | 445 | return 0; |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | | static int detect_8K_mode3F(void) |
| 448 | static int detect_8K_mode3F(running_machine *machine) |
| 449 | 449 | { |
| 450 | 450 | int i,numfound = 0; |
| 451 | 451 | static const unsigned char signature1[4] = { 0xa9, 0x01, 0x85, 0x3f }; |
| r2771 | r2772 | |
| 469 | 469 | return 0; |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | | static int detect_32K_mode3F(void) |
| 472 | static int detect_32K_mode3F(running_machine *machine) |
| 473 | 473 | { |
| 474 | 474 | int i,numfound = 0; |
| 475 | 475 | static const unsigned char signature[4] = { 0xa9, 0x0e, 0x85, 0x3f }; |
| r2771 | r2772 | |
| 487 | 487 | return 0; |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | | static int detect_super_chip(void) |
| 490 | static int detect_super_chip(running_machine *machine) |
| 491 | 491 | { |
| 492 | 492 | int i,j; |
| 493 | 493 | static const unsigned char signatures[][5] = { |
| r2771 | r2772 | |
| 559 | 559 | |
| 560 | 560 | image_fread(image, CART, cart_size); |
| 561 | 561 | |
| 562 | | if (!(cart_size == 0x4000 && detect_modef6())) { |
| 562 | if (!(cart_size == 0x4000 && detect_modef6(image->machine))) { |
| 563 | 563 | while (cart_size > 0x00800) { |
| 564 | 564 | if (!memcmp(CART, &CART[cart_size/2],cart_size/2)) cart_size /= 2; |
| 565 | 565 | else break; |
| r2771 | r2772 | |
| 585 | 585 | } |
| 586 | 586 | |
| 587 | 587 | |
| 588 | | static void modeF8_switch(UINT16 offset, UINT8 data) |
| 588 | static void modeF8_switch(running_machine *machine, UINT16 offset, UINT8 data) |
| 589 | 589 | { |
| 590 | 590 | bank_base[1] = CART + 0x1000 * offset; |
| 591 | 591 | memory_set_bankptr(1, bank_base[1]); |
| 592 | 592 | } |
| 593 | | static void modeFA_switch(UINT16 offset, UINT8 data) |
| 593 | static void modeFA_switch(running_machine *machine, UINT16 offset, UINT8 data) |
| 594 | 594 | { |
| 595 | 595 | bank_base[1] = CART + 0x1000 * offset; |
| 596 | 596 | memory_set_bankptr(1, bank_base[1]); |
| 597 | 597 | } |
| 598 | | static void modeF6_switch(UINT16 offset, UINT8 data) |
| 598 | static void modeF6_switch(running_machine *machine, UINT16 offset, UINT8 data) |
| 599 | 599 | { |
| 600 | 600 | bank_base[1] = CART + 0x1000 * offset; |
| 601 | 601 | memory_set_bankptr(1, bank_base[1]); |
| 602 | 602 | } |
| 603 | | static void modeF4_switch(UINT16 offset, UINT8 data) |
| 603 | static void modeF4_switch(running_machine *machine, UINT16 offset, UINT8 data) |
| 604 | 604 | { |
| 605 | 605 | bank_base[1] = CART + 0x1000 * offset; |
| 606 | 606 | memory_set_bankptr(1, bank_base[1]); |
| 607 | 607 | } |
| 608 | | static void mode3F_switch(UINT16 offset, UINT8 data) |
| 608 | static void mode3F_switch(running_machine *machine, UINT16 offset, UINT8 data) |
| 609 | 609 | { |
| 610 | 610 | bank_base[1] = CART + 0x800 * (data & (number_banks - 1)); |
| 611 | 611 | memory_set_bankptr(1, bank_base[1]); |
| 612 | 612 | } |
| 613 | | static void modeUA_switch(UINT16 offset, UINT8 data) |
| 613 | static void modeUA_switch(running_machine *machine, UINT16 offset, UINT8 data) |
| 614 | 614 | { |
| 615 | 615 | bank_base[1] = CART + (offset >> 6) * 0x1000; |
| 616 | 616 | memory_set_bankptr(1, bank_base[1]); |
| 617 | 617 | } |
| 618 | | static void modeE0_switch(UINT16 offset, UINT8 data) |
| 618 | static void modeE0_switch(running_machine *machine, UINT16 offset, UINT8 data) |
| 619 | 619 | { |
| 620 | 620 | int bank = 1 + (offset >> 3); |
| 621 | 621 | bank_base[bank] = CART + 0x400 * (offset & 7); |
| 622 | 622 | memory_set_bankptr(bank, bank_base[bank]); |
| 623 | 623 | } |
| 624 | | static void modeE7_switch(UINT16 offset, UINT8 data) |
| 624 | static void modeE7_switch(running_machine *machine, UINT16 offset, UINT8 data) |
| 625 | 625 | { |
| 626 | 626 | bank_base[1] = CART + 0x800 * offset; |
| 627 | 627 | memory_set_bankptr(1, bank_base[1]); |
| 628 | 628 | } |
| 629 | | static void modeE7_RAM_switch(UINT16 offset, UINT8 data) |
| 629 | static void modeE7_RAM_switch(running_machine *machine, UINT16 offset, UINT8 data) |
| 630 | 630 | { |
| 631 | 631 | memory_set_bankptr(9, extra_RAM + (4 + offset) * 256 ); |
| 632 | 632 | } |
| 633 | | static void modeDC_switch(UINT16 offset, UINT8 data) |
| 633 | static void modeDC_switch(running_machine *machine, UINT16 offset, UINT8 data) |
| 634 | 634 | { |
| 635 | 635 | bank_base[1] = CART + 0x1000 * next_bank(); |
| 636 | 636 | memory_set_bankptr(1, bank_base[1]); |
| 637 | 637 | } |
| 638 | | static void mode3E_switch(UINT16 offset, UINT8 data) |
| 638 | static void mode3E_switch(running_machine *machine, UINT16 offset, UINT8 data) |
| 639 | 639 | { |
| 640 | 640 | bank_base[1] = CART + 0x800 * (data & (number_banks - 1)); |
| 641 | 641 | memory_set_bankptr(1, bank_base[1]); |
| 642 | 642 | mode3E_ram_enabled = 0; |
| 643 | 643 | } |
| 644 | | static void mode3E_RAM_switch(UINT16 offset, UINT8 data) |
| 644 | static void mode3E_RAM_switch(running_machine *machine, UINT16 offset, UINT8 data) |
| 645 | 645 | { |
| 646 | 646 | ram_base = extra_RAM + 0x200 * ( data & 0x3F ); |
| 647 | 647 | memory_set_bankptr(1, ram_base ); |
| 648 | 648 | mode3E_ram_enabled = 1; |
| 649 | 649 | } |
| 650 | | static void modeFV_switch(UINT16 offset, UINT8 data) |
| 650 | static void modeFV_switch(running_machine *machine, UINT16 offset, UINT8 data) |
| 651 | 651 | { |
| 652 | 652 | //printf("ModeFV %04x\n",offset); |
| 653 | 653 | if (!FVlocked && ( activecpu_get_pc() & 0x1F00 ) == 0x1F00 ) { |
| r2771 | r2772 | |
| 657 | 657 | memory_set_bankptr(1, bank_base[1]); |
| 658 | 658 | } |
| 659 | 659 | } |
| 660 | | static void modeJVP_switch(UINT16 offset, UINT8 data) |
| 660 | static void modeJVP_switch(running_machine *machine, UINT16 offset, UINT8 data) |
| 661 | 661 | { |
| 662 | 662 | switch( offset ) { |
| 663 | 663 | case 0x00: |
| r2771 | r2772 | |
| 674 | 674 | |
| 675 | 675 | |
| 676 | 676 | /* These read handlers will return the byte from the new bank */ |
| 677 | | static READ8_HANDLER(modeF8_switch_r) { modeF8_switch(offset, 0); return bank_base[1][0xff8 + offset]; } |
| 678 | | static READ8_HANDLER(modeFA_switch_r) { modeFA_switch(offset, 0); return bank_base[1][0xff8 + offset]; } |
| 679 | | static READ8_HANDLER(modeF6_switch_r) { modeF6_switch(offset, 0); return bank_base[1][0xff6 + offset]; } |
| 680 | | static READ8_HANDLER(modeF4_switch_r) { modeF4_switch(offset, 0); return bank_base[1][0xff4 + offset]; } |
| 681 | | static READ8_HANDLER(modeE0_switch_r) { modeE0_switch(offset, 0); return bank_base[4][0x3e0 + offset]; } |
| 682 | | static READ8_HANDLER(modeE7_switch_r) { modeE7_switch(offset, 0); return bank_base[1][0xfe0 + offset]; } |
| 683 | | static READ8_HANDLER(modeE7_RAM_switch_r) { modeE7_RAM_switch(offset, 0); return 0; } |
| 684 | | static READ8_HANDLER(modeUA_switch_r) { modeUA_switch(offset, 0); return 0; } |
| 685 | | static READ8_HANDLER(modeDC_switch_r) { modeDC_switch(offset, 0); return bank_base[1][0xff0 + offset]; } |
| 686 | | static READ8_HANDLER(modeFV_switch_r) { modeFV_switch(offset, 0); return bank_base[1][0xfd0 + offset]; } |
| 687 | | static READ8_HANDLER(modeJVP_switch_r) { modeJVP_switch(offset, 0); return riot_ram[ 0x20 + offset ]; } |
| 677 | static READ8_HANDLER(modeF8_switch_r) { modeF8_switch(machine, offset, 0); return bank_base[1][0xff8 + offset]; } |
| 678 | static READ8_HANDLER(modeFA_switch_r) { modeFA_switch(machine, offset, 0); return bank_base[1][0xff8 + offset]; } |
| 679 | static READ8_HANDLER(modeF6_switch_r) { modeF6_switch(machine, offset, 0); return bank_base[1][0xff6 + offset]; } |
| 680 | static READ8_HANDLER(modeF4_switch_r) { modeF4_switch(machine, offset, 0); return bank_base[1][0xff4 + offset]; } |
| 681 | static READ8_HANDLER(modeE0_switch_r) { modeE0_switch(machine, offset, 0); return bank_base[4][0x3e0 + offset]; } |
| 682 | static READ8_HANDLER(modeE7_switch_r) { modeE7_switch(machine, offset, 0); return bank_base[1][0xfe0 + offset]; } |
| 683 | static READ8_HANDLER(modeE7_RAM_switch_r) { modeE7_RAM_switch(machine, offset, 0); return 0; } |
| 684 | static READ8_HANDLER(modeUA_switch_r) { modeUA_switch(machine, offset, 0); return 0; } |
| 685 | static READ8_HANDLER(modeDC_switch_r) { modeDC_switch(machine, offset, 0); return bank_base[1][0xff0 + offset]; } |
| 686 | static READ8_HANDLER(modeFV_switch_r) { modeFV_switch(machine, offset, 0); return bank_base[1][0xfd0 + offset]; } |
| 687 | static READ8_HANDLER(modeJVP_switch_r) { modeJVP_switch(machine, offset, 0); return riot_ram[ 0x20 + offset ]; } |
| 688 | 688 | |
| 689 | 689 | |
| 690 | | static WRITE8_HANDLER(modeF8_switch_w) { modeF8_switch(offset, data); } |
| 691 | | static WRITE8_HANDLER(modeFA_switch_w) { modeFA_switch(offset, data); } |
| 692 | | static WRITE8_HANDLER(modeF6_switch_w) { modeF6_switch(offset, data); } |
| 693 | | static WRITE8_HANDLER(modeF4_switch_w) { modeF4_switch(offset, data); } |
| 694 | | static WRITE8_HANDLER(modeE0_switch_w) { modeE0_switch(offset, data); } |
| 695 | | static WRITE8_HANDLER(modeE7_switch_w) { modeE7_switch(offset, data); } |
| 696 | | static WRITE8_HANDLER(modeE7_RAM_switch_w) { modeE7_RAM_switch(offset, data); } |
| 697 | | static WRITE8_HANDLER(mode3F_switch_w) { mode3F_switch(offset, data); } |
| 698 | | static WRITE8_HANDLER(modeUA_switch_w) { modeUA_switch(offset, data); } |
| 699 | | static WRITE8_HANDLER(modeDC_switch_w) { modeDC_switch(offset, data); } |
| 700 | | static WRITE8_HANDLER(mode3E_switch_w) { mode3E_switch(offset, data); } |
| 701 | | static WRITE8_HANDLER(mode3E_RAM_switch_w) { mode3E_RAM_switch(offset, data); } |
| 690 | static WRITE8_HANDLER(modeF8_switch_w) { modeF8_switch(machine, offset, data); } |
| 691 | static WRITE8_HANDLER(modeFA_switch_w) { modeFA_switch(machine, offset, data); } |
| 692 | static WRITE8_HANDLER(modeF6_switch_w) { modeF6_switch(machine, offset, data); } |
| 693 | static WRITE8_HANDLER(modeF4_switch_w) { modeF4_switch(machine, offset, data); } |
| 694 | static WRITE8_HANDLER(modeE0_switch_w) { modeE0_switch(machine, offset, data); } |
| 695 | static WRITE8_HANDLER(modeE7_switch_w) { modeE7_switch(machine, offset, data); } |
| 696 | static WRITE8_HANDLER(modeE7_RAM_switch_w) { modeE7_RAM_switch(machine, offset, data); } |
| 697 | static WRITE8_HANDLER(mode3F_switch_w) { mode3F_switch(machine, offset, data); } |
| 698 | static WRITE8_HANDLER(modeUA_switch_w) { modeUA_switch(machine, offset, data); } |
| 699 | static WRITE8_HANDLER(modeDC_switch_w) { modeDC_switch(machine, offset, data); } |
| 700 | static WRITE8_HANDLER(mode3E_switch_w) { mode3E_switch(machine, offset, data); } |
| 701 | static WRITE8_HANDLER(mode3E_RAM_switch_w) { mode3E_RAM_switch(machine, offset, data); } |
| 702 | 702 | static WRITE8_HANDLER(mode3E_RAM_w) { |
| 703 | 703 | if ( mode3E_ram_enabled ) { |
| 704 | 704 | ram_base[offset] = data; |
| 705 | 705 | } |
| 706 | 706 | } |
| 707 | | static WRITE8_HANDLER(modeFV_switch_w) { modeFV_switch(offset, data); } |
| 708 | | static WRITE8_HANDLER(modeJVP_switch_w) { modeJVP_switch(offset, data); riot_ram[ 0x20 + offset ] = data; } |
| 707 | static WRITE8_HANDLER(modeFV_switch_w) { modeFV_switch(machine, offset, data); } |
| 708 | static WRITE8_HANDLER(modeJVP_switch_w) { modeJVP_switch(machine, offset, data); riot_ram[ 0x20 + offset ] = data; } |
| 709 | 709 | |
| 710 | 710 | |
| 711 | 711 | static OPBASE_HANDLER( modeF6_opbase ) |
| r2771 | r2772 | |
| 1479 | 1479 | current_reset_bank_counter++; |
| 1480 | 1480 | |
| 1481 | 1481 | /* auto-detect special controllers */ |
| 1482 | | controltemp = detect_2600controllers(); |
| 1482 | controltemp = detect_2600controllers(machine); |
| 1483 | 1483 | set_controller( machine, STR_LEFT_CONTROLLER, controltemp >> 16 ); |
| 1484 | 1484 | set_controller( machine, STR_RIGHT_CONTROLLER, controltemp & 0xFFFF ); |
| 1485 | 1485 | |
| 1486 | 1486 | /* auto-detect bank mode */ |
| 1487 | 1487 | |
| 1488 | | if (banking_mode == 0xff) if (detect_modeDC()) banking_mode = modeDC; |
| 1489 | | if (banking_mode == 0xff) if (detect_mode3E()) banking_mode = mode3E; |
| 1490 | | if (banking_mode == 0xff) if (detect_modeFE()) banking_mode = modeFE; |
| 1491 | | if (banking_mode == 0xff) if (detect_modeSS()) banking_mode = modeSS; |
| 1492 | | if (banking_mode == 0xff) if (detect_modeE0()) banking_mode = modeE0; |
| 1493 | | if (banking_mode == 0xff) if (detect_modeCV()) banking_mode = modeCV; |
| 1494 | | if (banking_mode == 0xff) if (detect_modeFV()) banking_mode = modeFV; |
| 1495 | | if (banking_mode == 0xff) if (detect_modeJVP()) banking_mode = modeJVP; |
| 1496 | | if (banking_mode == 0xff) if (detect_modeUA()) banking_mode = modeUA; |
| 1497 | | if (banking_mode == 0xff) if (detect_8K_mode3F()) banking_mode = mode3F; |
| 1498 | | if (banking_mode == 0xff) if (detect_32K_mode3F()) banking_mode = mode3F; |
| 1499 | | if (banking_mode == 0xff) if (detect_modeE7()) banking_mode = modeE7; |
| 1488 | if (banking_mode == 0xff) if (detect_modeDC(machine)) banking_mode = modeDC; |
| 1489 | if (banking_mode == 0xff) if (detect_mode3E(machine)) banking_mode = mode3E; |
| 1490 | if (banking_mode == 0xff) if (detect_modeFE(machine)) banking_mode = modeFE; |
| 1491 | if (banking_mode == 0xff) if (detect_modeSS(machine)) banking_mode = modeSS; |
| 1492 | if (banking_mode == 0xff) if (detect_modeE0(machine)) banking_mode = modeE0; |
| 1493 | if (banking_mode == 0xff) if (detect_modeCV(machine)) banking_mode = modeCV; |
| 1494 | if (banking_mode == 0xff) if (detect_modeFV(machine)) banking_mode = modeFV; |
| 1495 | if (banking_mode == 0xff) if (detect_modeJVP(machine)) banking_mode = modeJVP; |
| 1496 | if (banking_mode == 0xff) if (detect_modeUA(machine)) banking_mode = modeUA; |
| 1497 | if (banking_mode == 0xff) if (detect_8K_mode3F(machine)) banking_mode = mode3F; |
| 1498 | if (banking_mode == 0xff) if (detect_32K_mode3F(machine)) banking_mode = mode3F; |
| 1499 | if (banking_mode == 0xff) if (detect_modeE7(machine)) banking_mode = modeE7; |
| 1500 | 1500 | |
| 1501 | 1501 | if (banking_mode == 0xff) { |
| 1502 | 1502 | switch (cart_size) |
| r2771 | r2772 | |
| 1538 | 1538 | |
| 1539 | 1539 | if (cart_size == 0x2000 || cart_size == 0x4000 || cart_size == 0x8000) |
| 1540 | 1540 | { |
| 1541 | | chip = detect_super_chip(); |
| 1541 | chip = detect_super_chip(machine); |
| 1542 | 1542 | } |
| 1543 | 1543 | |
| 1544 | 1544 | /* Super chip games: |