src/mess/drivers/ng_aes.c
| r0 | r4766 | |
| 1 | /*************************************************************************** |
| 2 | |
| 3 | Neo-Geo AES hardware |
| 4 | |
| 5 | Credits (from MAME neogeo.c, since this is just a minor edit of that driver): |
| 6 | * This driver was made possible by the research done by |
| 7 | Charles MacDonald. For a detailed description of the Neo-Geo |
| 8 | hardware, please visit his page at: |
| 9 | http://cgfm2.emuviews.com/temp/mvstech.txt |
| 10 | * Presented to you by the Shin Emu Keikaku team. |
| 11 | * The following people have all spent probably far |
| 12 | too much time on this: |
| 13 | AVDB |
| 14 | Bryan McPhail |
| 15 | Fuzz |
| 16 | Ernesto Corvi |
| 17 | Andrew Prime |
| 18 | Zsolt Vasvari |
| 19 | |
| 20 | Current status: |
| 21 | - There is no cart support, hence it's not possible to play anything. |
| 22 | ATM, this is simply the MAME driver stripped of the LED code |
| 23 | |
| 24 | ToDo : |
| 25 | - Change input code to allow selection of the mahjong panel in PORT_CATEGORY. |
| 26 | - Add xml support for carts (the system is useless without) |
| 27 | - Clean up code, to reduce duplication of MAME source |
| 28 | |
| 29 | ****************************************************************************/ |
| 30 | |
| 31 | #include "driver.h" |
| 32 | #include "cpu/m68000/m68000.h" |
| 33 | #include "neogeo.h" |
| 34 | #include "machine/pd4990a.h" |
| 35 | #include "cpu/z80/z80.h" |
| 36 | #include "sound/2610intf.h" |
| 37 | |
| 38 | |
| 39 | #define LOG_VIDEO_SYSTEM (0) |
| 40 | #define LOG_CPU_COMM (0) |
| 41 | #define LOG_MAIN_CPU_BANKING (0) |
| 42 | #define LOG_AUDIO_CPU_BANKING (0) |
| 43 | |
| 44 | |
| 45 | |
| 46 | /************************************* |
| 47 | * |
| 48 | * Global variables |
| 49 | * |
| 50 | *************************************/ |
| 51 | |
| 52 | static UINT8 display_position_interrupt_control; |
| 53 | static UINT32 display_counter; |
| 54 | static UINT32 vblank_interrupt_pending; |
| 55 | static UINT32 display_position_interrupt_pending; |
| 56 | static UINT32 irq3_pending; |
| 57 | static emu_timer *display_position_interrupt_timer; |
| 58 | static emu_timer *display_position_vblank_timer; |
| 59 | static emu_timer *vblank_interrupt_timer; |
| 60 | |
| 61 | static UINT8 controller_select; |
| 62 | |
| 63 | static UINT8 *memcard_data; |
| 64 | |
| 65 | static UINT32 main_cpu_bank_address; |
| 66 | static UINT8 main_cpu_vector_table_source; |
| 67 | |
| 68 | static UINT8 audio_result; |
| 69 | static UINT8 audio_cpu_banks[4]; |
| 70 | static UINT8 audio_cpu_rom_source; |
| 71 | static UINT8 audio_cpu_rom_source_last; |
| 72 | |
| 73 | static UINT16 *save_ram; |
| 74 | static UINT8 save_ram_unlocked; |
| 75 | |
| 76 | static UINT8 output_data; |
| 77 | static UINT8 output_latch; |
| 78 | static UINT8 el_value; |
| 79 | |
| 80 | |
| 81 | |
| 82 | /************************************* |
| 83 | * |
| 84 | * Forward declerations |
| 85 | * |
| 86 | *************************************/ |
| 87 | |
| 88 | static void calendar_clock(void); |
| 89 | |
| 90 | |
| 91 | |
| 92 | /************************************* |
| 93 | * |
| 94 | * Main CPU interrupt generation |
| 95 | * |
| 96 | *************************************/ |
| 97 | |
| 98 | #define IRQ2CTRL_ENABLE (0x10) |
| 99 | #define IRQ2CTRL_LOAD_RELATIVE (0x20) |
| 100 | #define IRQ2CTRL_AUTOLOAD_VBLANK (0x40) |
| 101 | #define IRQ2CTRL_AUTOLOAD_REPEAT (0x80) |
| 102 | |
| 103 | |
| 104 | static void adjust_display_position_interrupt_timer(running_machine *machine) |
| 105 | { |
| 106 | if ((display_counter + 1) != 0) |
| 107 | { |
| 108 | attotime period = attotime_mul(ATTOTIME_IN_HZ(NEOGEO_PIXEL_CLOCK), display_counter + 1); |
| 109 | if (LOG_VIDEO_SYSTEM) logerror("adjust_display_position_interrupt_timer current y: %02x current x: %02x target y: %x target x: %x\n", video_screen_get_vpos(machine->primary_screen), video_screen_get_hpos(machine->primary_screen), (display_counter + 1) / NEOGEO_HTOTAL, (display_counter + 1) % NEOGEO_HTOTAL); |
| 110 | |
| 111 | timer_adjust_oneshot(display_position_interrupt_timer, period, 0); |
| 112 | } |
| 113 | } |
| 114 | |
| 115 | |
| 116 | void neogeo_set_display_position_interrupt_control(UINT16 data) |
| 117 | { |
| 118 | display_position_interrupt_control = data; |
| 119 | } |
| 120 | |
| 121 | |
| 122 | void neogeo_set_display_counter_msb(const address_space *space, UINT16 data) |
| 123 | { |
| 124 | display_counter = (display_counter & 0x0000ffff) | ((UINT32)data << 16); |
| 125 | |
| 126 | if (LOG_VIDEO_SYSTEM) logerror("PC %06x: set_display_counter %08x\n", cpu_get_pc(space->cpu), display_counter); |
| 127 | } |
| 128 | |
| 129 | |
| 130 | void neogeo_set_display_counter_lsb(const address_space *space, UINT16 data) |
| 131 | { |
| 132 | display_counter = (display_counter & 0xffff0000) | data; |
| 133 | |
| 134 | if (LOG_VIDEO_SYSTEM) logerror("PC %06x: set_display_counter %08x\n", cpu_get_pc(space->cpu), display_counter); |
| 135 | |
| 136 | if (display_position_interrupt_control & IRQ2CTRL_LOAD_RELATIVE) |
| 137 | { |
| 138 | if (LOG_VIDEO_SYSTEM) logerror("AUTOLOAD_RELATIVE "); |
| 139 | adjust_display_position_interrupt_timer(space->machine); |
| 140 | } |
| 141 | } |
| 142 | |
| 143 | |
| 144 | static void update_interrupts(running_machine *machine) |
| 145 | { |
| 146 | cputag_set_input_line(machine, "maincpu", 1, vblank_interrupt_pending ? ASSERT_LINE : CLEAR_LINE); |
| 147 | cputag_set_input_line(machine, "maincpu", 2, display_position_interrupt_pending ? ASSERT_LINE : CLEAR_LINE); |
| 148 | cputag_set_input_line(machine, "maincpu", 3, irq3_pending ? ASSERT_LINE : CLEAR_LINE); |
| 149 | } |
| 150 | |
| 151 | |
| 152 | void neogeo_acknowledge_interrupt(running_machine *machine, UINT16 data) |
| 153 | { |
| 154 | if (data & 0x01) irq3_pending = 0; |
| 155 | if (data & 0x02) display_position_interrupt_pending = 0; |
| 156 | if (data & 0x04) vblank_interrupt_pending = 0; |
| 157 | |
| 158 | update_interrupts(machine); |
| 159 | } |
| 160 | |
| 161 | |
| 162 | static TIMER_CALLBACK( display_position_interrupt_callback ) |
| 163 | { |
| 164 | if (LOG_VIDEO_SYSTEM) logerror("--- Scanline @ %d,%d\n", video_screen_get_vpos(machine->primary_screen), video_screen_get_hpos(machine->primary_screen)); |
| 165 | if (display_position_interrupt_control & IRQ2CTRL_ENABLE) |
| 166 | { |
| 167 | if (LOG_VIDEO_SYSTEM) logerror("*** Scanline interrupt (IRQ2) *** y: %02x x: %02x\n", video_screen_get_vpos(machine->primary_screen), video_screen_get_hpos(machine->primary_screen)); |
| 168 | display_position_interrupt_pending = 1; |
| 169 | |
| 170 | update_interrupts(machine); |
| 171 | } |
| 172 | |
| 173 | if (display_position_interrupt_control & IRQ2CTRL_AUTOLOAD_REPEAT) |
| 174 | { |
| 175 | if (LOG_VIDEO_SYSTEM) logerror("AUTOLOAD_REPEAT "); |
| 176 | adjust_display_position_interrupt_timer(machine); |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | |
| 181 | static TIMER_CALLBACK( display_position_vblank_callback ) |
| 182 | { |
| 183 | if (display_position_interrupt_control & IRQ2CTRL_AUTOLOAD_VBLANK) |
| 184 | { |
| 185 | if (LOG_VIDEO_SYSTEM) logerror("AUTOLOAD_VBLANK "); |
| 186 | adjust_display_position_interrupt_timer(machine); |
| 187 | } |
| 188 | |
| 189 | /* set timer for next screen */ |
| 190 | timer_adjust_oneshot(display_position_vblank_timer, video_screen_get_time_until_pos(machine->primary_screen, NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS), 0); |
| 191 | } |
| 192 | |
| 193 | |
| 194 | static TIMER_CALLBACK( vblank_interrupt_callback ) |
| 195 | { |
| 196 | if (LOG_VIDEO_SYSTEM) logerror("+++ VBLANK @ %d,%d\n", video_screen_get_vpos(machine->primary_screen), video_screen_get_hpos(machine->primary_screen)); |
| 197 | |
| 198 | /* add a timer tick to the pd4990a */ |
| 199 | calendar_clock(); |
| 200 | |
| 201 | vblank_interrupt_pending = 1; |
| 202 | |
| 203 | update_interrupts(machine); |
| 204 | |
| 205 | /* set timer for next screen */ |
| 206 | timer_adjust_oneshot(vblank_interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, NEOGEO_VBSTART, 0), 0); |
| 207 | } |
| 208 | |
| 209 | |
| 210 | static void create_interrupt_timers(running_machine *machine) |
| 211 | { |
| 212 | display_position_interrupt_timer = timer_alloc(machine, display_position_interrupt_callback, NULL); |
| 213 | display_position_vblank_timer = timer_alloc(machine, display_position_vblank_callback, NULL); |
| 214 | vblank_interrupt_timer = timer_alloc(machine, vblank_interrupt_callback, NULL); |
| 215 | } |
| 216 | |
| 217 | |
| 218 | static void start_interrupt_timers(running_machine *machine) |
| 219 | { |
| 220 | timer_adjust_oneshot(vblank_interrupt_timer, video_screen_get_time_until_pos(machine->primary_screen, NEOGEO_VBSTART, 0), 0); |
| 221 | timer_adjust_oneshot(display_position_vblank_timer, video_screen_get_time_until_pos(machine->primary_screen, NEOGEO_VBSTART, NEOGEO_VBLANK_RELOAD_HPOS), 0); |
| 222 | } |
| 223 | |
| 224 | |
| 225 | |
| 226 | /************************************* |
| 227 | * |
| 228 | * Audio CPU interrupt generation |
| 229 | * |
| 230 | *************************************/ |
| 231 | |
| 232 | static void audio_cpu_irq(const device_config *device, int assert) |
| 233 | { |
| 234 | cputag_set_input_line(device->machine, "audiocpu", 0, assert ? ASSERT_LINE : CLEAR_LINE); |
| 235 | } |
| 236 | |
| 237 | |
| 238 | static void audio_cpu_assert_nmi(running_machine *machine) |
| 239 | { |
| 240 | cputag_set_input_line(machine, "audiocpu", INPUT_LINE_NMI, ASSERT_LINE); |
| 241 | } |
| 242 | |
| 243 | |
| 244 | static WRITE8_HANDLER( audio_cpu_clear_nmi_w ) |
| 245 | { |
| 246 | cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_NMI, CLEAR_LINE); |
| 247 | } |
| 248 | |
| 249 | |
| 250 | |
| 251 | /************************************* |
| 252 | * |
| 253 | * Input ports / Controllers |
| 254 | * |
| 255 | *************************************/ |
| 256 | |
| 257 | static void select_controller(UINT8 data) |
| 258 | { |
| 259 | controller_select = data; |
| 260 | } |
| 261 | |
| 262 | |
| 263 | #if 0 |
| 264 | static CUSTOM_INPUT( multiplexed_controller_r ) |
| 265 | { |
| 266 | int port = (FPTR)param; |
| 267 | |
| 268 | static const char *const cntrl[2][2] = |
| 269 | { |
| 270 | { "IN0-0", "IN0-1" }, { "IN1-0", "IN1-1" } |
| 271 | }; |
| 272 | |
| 273 | return input_port_read_safe(field->port->machine, cntrl[port][controller_select & 0x01], 0x00); |
| 274 | } |
| 275 | |
| 276 | |
| 277 | static CUSTOM_INPUT( mahjong_controller_r ) |
| 278 | { |
| 279 | UINT32 ret; |
| 280 | |
| 281 | /* |
| 282 | cpu #0 (PC=00C18B9A): unmapped memory word write to 00380000 = 0012 & 00FF |
| 283 | cpu #0 (PC=00C18BB6): unmapped memory word write to 00380000 = 001B & 00FF |
| 284 | cpu #0 (PC=00C18D54): unmapped memory word write to 00380000 = 0024 & 00FF |
| 285 | cpu #0 (PC=00C18D6C): unmapped memory word write to 00380000 = 0009 & 00FF |
| 286 | cpu #0 (PC=00C18C40): unmapped memory word write to 00380000 = 0000 & 00FF |
| 287 | */ |
| 288 | switch (controller_select) |
| 289 | { |
| 290 | default: |
| 291 | case 0x00: ret = 0x0000; break; /* nothing? */ |
| 292 | case 0x09: ret = input_port_read(field->port->machine, "MAHJONG1"); break; |
| 293 | case 0x12: ret = input_port_read(field->port->machine, "MAHJONG2"); break; |
| 294 | case 0x1b: ret = input_port_read(field->port->machine, "MAHJONG3"); break; /* player 1 normal inputs? */ |
| 295 | case 0x24: ret = input_port_read(field->port->machine, "MAHJONG4"); break; |
| 296 | } |
| 297 | |
| 298 | return ret; |
| 299 | } |
| 300 | |
| 301 | #endif |
| 302 | |
| 303 | static WRITE16_HANDLER( io_control_w ) |
| 304 | { |
| 305 | switch (offset) |
| 306 | { |
| 307 | case 0x00: select_controller(data & 0x00ff); break; |
| 308 | case 0x18: logerror("AES has written to output_latch: %d\n", data & 0x00ff); break; // LED-related in MVS. unused in AES? |
| 309 | case 0x20: logerror("AES has written to output_data: %d\n", data & 0x00ff); break; // LED-related in MVS. unused in AES? |
| 310 | case 0x28: pd4990a_control_16_w(space, 0, data, mem_mask); break; |
| 311 | // case 0x30: break; // coin counters |
| 312 | // case 0x31: break; // coin counters |
| 313 | // case 0x32: break; // coin lockout |
| 314 | // case 0x33: break; // coui lockout |
| 315 | |
| 316 | default: |
| 317 | logerror("PC: %x Unmapped I/O control write. Offset: %x Data: %x\n", cpu_get_pc(space->cpu), offset, data); |
| 318 | break; |
| 319 | } |
| 320 | } |
| 321 | |
| 322 | |
| 323 | |
| 324 | /************************************* |
| 325 | * |
| 326 | * Unmapped memory access |
| 327 | * |
| 328 | *************************************/ |
| 329 | |
| 330 | READ16_HANDLER( neogeo_unmapped_r ) |
| 331 | { |
| 332 | static UINT8 recurse = 0; |
| 333 | UINT16 ret; |
| 334 | |
| 335 | /* unmapped memory returns the last word on the data bus, which is almost always the opcode |
| 336 | of the next instruction due to prefetch */ |
| 337 | |
| 338 | /* prevent recursion */ |
| 339 | if (recurse) |
| 340 | ret = 0xffff; |
| 341 | else |
| 342 | { |
| 343 | recurse = 1; |
| 344 | ret = memory_read_word(space, cpu_get_pc(space->cpu)); |
| 345 | recurse = 0; |
| 346 | } |
| 347 | |
| 348 | return ret; |
| 349 | } |
| 350 | |
| 351 | |
| 352 | |
| 353 | /************************************* |
| 354 | * |
| 355 | * uPD4990A calendar chip |
| 356 | * |
| 357 | *************************************/ |
| 358 | |
| 359 | static void calendar_init(running_machine *machine) |
| 360 | { |
| 361 | /* set the celander IC to 'right now' */ |
| 362 | mame_system_time systime; |
| 363 | mame_system_tm time; |
| 364 | |
| 365 | mame_get_base_datetime(machine, &systime); |
| 366 | time = systime.local_time; |
| 367 | |
| 368 | pd4990a.seconds = ((time.second / 10) << 4) + (time.second % 10); |
| 369 | pd4990a.minutes = ((time.minute / 10) << 4) + (time.minute % 10); |
| 370 | pd4990a.hours = ((time.hour / 10) <<4 ) + (time.hour % 10); |
| 371 | pd4990a.days = ((time.mday / 10) << 4) + (time.mday % 10); |
| 372 | pd4990a.month = time.month + 1; |
| 373 | pd4990a.year = ((((time.year - 1900) % 100) / 10) << 4) + ((time.year - 1900) % 10); |
| 374 | pd4990a.weekday = time.weekday; |
| 375 | } |
| 376 | |
| 377 | |
| 378 | static void calendar_clock(void) |
| 379 | { |
| 380 | pd4990a_addretrace(); |
| 381 | } |
| 382 | |
| 383 | |
| 384 | static CUSTOM_INPUT( get_calendar_status ) |
| 385 | { |
| 386 | const address_space *space = cputag_get_address_space(field->port->machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 387 | return (pd4990a_databit_r(space, 0) << 1) | pd4990a_testbit_r(space, 0); |
| 388 | } |
| 389 | |
| 390 | |
| 391 | |
| 392 | /************************************* |
| 393 | * |
| 394 | * NVRAM (Save RAM) |
| 395 | * |
| 396 | *************************************/ |
| 397 | |
| 398 | static NVRAM_HANDLER( neogeo ) |
| 399 | { |
| 400 | if (read_or_write) |
| 401 | /* save the SRAM settings */ |
| 402 | mame_fwrite(file, save_ram, 0x2000); |
| 403 | else |
| 404 | { |
| 405 | /* load the SRAM settings */ |
| 406 | if (file) |
| 407 | mame_fread(file, save_ram, 0x2000); |
| 408 | else |
| 409 | memset(save_ram, 0, 0x10000); |
| 410 | } |
| 411 | } |
| 412 | |
| 413 | |
| 414 | static void set_save_ram_unlock(UINT8 data) |
| 415 | { |
| 416 | save_ram_unlocked = data; |
| 417 | } |
| 418 | |
| 419 | |
| 420 | static WRITE16_HANDLER( save_ram_w ) |
| 421 | { |
| 422 | if (save_ram_unlocked) |
| 423 | COMBINE_DATA(&save_ram[offset]); |
| 424 | } |
| 425 | |
| 426 | |
| 427 | |
| 428 | /************************************* |
| 429 | * |
| 430 | * Memory card |
| 431 | * |
| 432 | *************************************/ |
| 433 | |
| 434 | #define MEMCARD_SIZE 0x0800 |
| 435 | |
| 436 | |
| 437 | static CUSTOM_INPUT( get_memcard_status ) |
| 438 | { |
| 439 | /* D0 and D1 are memcard presence indicators, D2 indicates memcard |
| 440 | write protect status (we are always write enabled) */ |
| 441 | return (memcard_present() == -1) ? 0x07 : 0x00; |
| 442 | } |
| 443 | |
| 444 | |
| 445 | static READ16_HANDLER( memcard_r ) |
| 446 | { |
| 447 | UINT16 ret; |
| 448 | |
| 449 | if (memcard_present() != -1) |
| 450 | ret = memcard_data[offset] | 0xff00; |
| 451 | else |
| 452 | ret = 0xffff; |
| 453 | |
| 454 | return ret; |
| 455 | } |
| 456 | |
| 457 | |
| 458 | static WRITE16_HANDLER( memcard_w ) |
| 459 | { |
| 460 | if (ACCESSING_BITS_0_7) |
| 461 | { |
| 462 | if (memcard_present() != -1) |
| 463 | memcard_data[offset] = data; |
| 464 | } |
| 465 | } |
| 466 | |
| 467 | |
| 468 | static MEMCARD_HANDLER( neogeo ) |
| 469 | { |
| 470 | switch (action) |
| 471 | { |
| 472 | case MEMCARD_CREATE: |
| 473 | memset(memcard_data, 0, MEMCARD_SIZE); |
| 474 | mame_fwrite(file, memcard_data, MEMCARD_SIZE); |
| 475 | break; |
| 476 | |
| 477 | case MEMCARD_INSERT: |
| 478 | mame_fread(file, memcard_data, MEMCARD_SIZE); |
| 479 | break; |
| 480 | |
| 481 | case MEMCARD_EJECT: |
| 482 | mame_fwrite(file, memcard_data, MEMCARD_SIZE); |
| 483 | break; |
| 484 | } |
| 485 | } |
| 486 | |
| 487 | |
| 488 | |
| 489 | /************************************* |
| 490 | * |
| 491 | * Inter-CPU communications |
| 492 | * |
| 493 | *************************************/ |
| 494 | |
| 495 | static WRITE16_HANDLER( audio_command_w ) |
| 496 | { |
| 497 | /* accessing the LSB only is not mapped */ |
| 498 | if (mem_mask != 0x00ff) |
| 499 | { |
| 500 | soundlatch_w(space, 0, data >> 8); |
| 501 | |
| 502 | audio_cpu_assert_nmi(space->machine); |
| 503 | |
| 504 | /* boost the interleave to let the audio CPU read the command */ |
| 505 | cpuexec_boost_interleave(space->machine, attotime_zero, ATTOTIME_IN_USEC(50)); |
| 506 | |
| 507 | if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_command_w %04x - %04x\n", cpu_get_pc(space->cpu), data, mem_mask); |
| 508 | } |
| 509 | } |
| 510 | |
| 511 | |
| 512 | static READ8_HANDLER( audio_command_r ) |
| 513 | { |
| 514 | UINT8 ret = soundlatch_r(space, 0); |
| 515 | |
| 516 | if (LOG_CPU_COMM) logerror(" AUD CPU PC %04x: audio_command_r %02x\n", cpu_get_pc(space->cpu), ret); |
| 517 | |
| 518 | /* this is a guess */ |
| 519 | audio_cpu_clear_nmi_w(space, 0, 0); |
| 520 | |
| 521 | return ret; |
| 522 | } |
| 523 | |
| 524 | |
| 525 | static WRITE8_HANDLER( audio_result_w ) |
| 526 | { |
| 527 | if (LOG_CPU_COMM && (audio_result != data)) logerror(" AUD CPU PC %04x: audio_result_w %02x\n", cpu_get_pc(space->cpu), data); |
| 528 | |
| 529 | audio_result = data; |
| 530 | } |
| 531 | |
| 532 | |
| 533 | static CUSTOM_INPUT( get_audio_result ) |
| 534 | { |
| 535 | UINT32 ret = audio_result; |
| 536 | |
| 537 | // if (LOG_CPU_COMM) logerror("MAIN CPU PC %06x: audio_result_r %02x\n", cpu_get_pc(cputag_get_cpu(field->port->machine, "maincpu")), ret); |
| 538 | |
| 539 | return ret; |
| 540 | } |
| 541 | |
| 542 | |
| 543 | |
| 544 | /************************************* |
| 545 | * |
| 546 | * Main CPU banking |
| 547 | * |
| 548 | *************************************/ |
| 549 | |
| 550 | static void _set_main_cpu_vector_table_source(running_machine *machine) |
| 551 | { |
| 552 | memory_set_bank(machine, NEOGEO_BANK_VECTORS, main_cpu_vector_table_source); |
| 553 | } |
| 554 | |
| 555 | |
| 556 | static void set_main_cpu_vector_table_source(running_machine *machine, UINT8 data) |
| 557 | { |
| 558 | main_cpu_vector_table_source = data; |
| 559 | |
| 560 | _set_main_cpu_vector_table_source(machine); |
| 561 | } |
| 562 | |
| 563 | |
| 564 | static void _set_main_cpu_bank_address(running_machine *machine) |
| 565 | { |
| 566 | memory_set_bankptr(machine, NEOGEO_BANK_CARTRIDGE, &memory_region(machine, "maincpu")[main_cpu_bank_address]); |
| 567 | } |
| 568 | |
| 569 | |
| 570 | void neogeo_set_main_cpu_bank_address(const address_space *space, UINT32 bank_address) |
| 571 | { |
| 572 | if (LOG_MAIN_CPU_BANKING) logerror("MAIN CPU PC %06x: neogeo_set_main_cpu_bank_address %06x\n", cpu_get_pc(space->cpu), bank_address); |
| 573 | |
| 574 | main_cpu_bank_address = bank_address; |
| 575 | |
| 576 | _set_main_cpu_bank_address(space->machine); |
| 577 | } |
| 578 | |
| 579 | |
| 580 | static WRITE16_HANDLER( main_cpu_bank_select_w ) |
| 581 | { |
| 582 | UINT32 bank_address; |
| 583 | UINT32 len = memory_region_length(space->machine, "maincpu"); |
| 584 | |
| 585 | if ((len <= 0x100000) && (data & 0x07)) |
| 586 | logerror("PC %06x: warning: bankswitch to %02x but no banks available\n", cpu_get_pc(space->cpu), data); |
| 587 | else |
| 588 | { |
| 589 | bank_address = ((data & 0x07) + 1) * 0x100000; |
| 590 | |
| 591 | if (bank_address >= len) |
| 592 | { |
| 593 | logerror("PC %06x: warning: bankswitch to empty bank %02x\n", cpu_get_pc(space->cpu), data); |
| 594 | bank_address = 0x100000; |
| 595 | } |
| 596 | |
| 597 | neogeo_set_main_cpu_bank_address(space, bank_address); |
| 598 | } |
| 599 | } |
| 600 | |
| 601 | |
| 602 | static void main_cpu_banking_init(running_machine *machine) |
| 603 | { |
| 604 | const address_space *mainspace = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 605 | |
| 606 | /* create vector banks */ |
| 607 | memory_configure_bank(machine, NEOGEO_BANK_VECTORS, 0, 1, memory_region(machine, "mainbios"), 0); |
| 608 | memory_configure_bank(machine, NEOGEO_BANK_VECTORS, 1, 1, memory_region(machine, "maincpu"), 0); |
| 609 | |
| 610 | /* set initial main CPU bank */ |
| 611 | if (memory_region_length(machine, "maincpu") > 0x100000) |
| 612 | neogeo_set_main_cpu_bank_address(mainspace, 0x100000); |
| 613 | else |
| 614 | neogeo_set_main_cpu_bank_address(mainspace, 0x000000); |
| 615 | } |
| 616 | |
| 617 | |
| 618 | |
| 619 | /************************************* |
| 620 | * |
| 621 | * Audio CPU banking |
| 622 | * |
| 623 | *************************************/ |
| 624 | |
| 625 | static void set_audio_cpu_banking(running_machine *machine) |
| 626 | { |
| 627 | int region; |
| 628 | |
| 629 | for (region = 0; region < 4; region++) |
| 630 | memory_set_bank(machine, NEOGEO_BANK_AUDIO_CPU_CART_BANK + region, audio_cpu_banks[region]); |
| 631 | } |
| 632 | |
| 633 | |
| 634 | static void audio_cpu_bank_select(const address_space *space, int region, UINT8 bank) |
| 635 | { |
| 636 | if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: audio_cpu_bank_select: Region: %d Bank: %02x\n", cpu_get_pc(space->cpu), region, bank); |
| 637 | |
| 638 | audio_cpu_banks[region] = bank; |
| 639 | |
| 640 | set_audio_cpu_banking(space->machine); |
| 641 | } |
| 642 | |
| 643 | |
| 644 | static READ8_HANDLER( audio_cpu_bank_select_f000_f7ff_r ) |
| 645 | { |
| 646 | audio_cpu_bank_select(space, 0, offset >> 8); |
| 647 | |
| 648 | return 0; |
| 649 | } |
| 650 | |
| 651 | |
| 652 | static READ8_HANDLER( audio_cpu_bank_select_e000_efff_r ) |
| 653 | { |
| 654 | audio_cpu_bank_select(space, 1, offset >> 8); |
| 655 | |
| 656 | return 0; |
| 657 | } |
| 658 | |
| 659 | |
| 660 | static READ8_HANDLER( audio_cpu_bank_select_c000_dfff_r ) |
| 661 | { |
| 662 | audio_cpu_bank_select(space, 2, offset >> 8); |
| 663 | |
| 664 | return 0; |
| 665 | } |
| 666 | |
| 667 | |
| 668 | static READ8_HANDLER( audio_cpu_bank_select_8000_bfff_r ) |
| 669 | { |
| 670 | audio_cpu_bank_select(space, 3, offset >> 8); |
| 671 | |
| 672 | return 0; |
| 673 | } |
| 674 | |
| 675 | |
| 676 | static void _set_audio_cpu_rom_source(const address_space *space) |
| 677 | { |
| 678 | /* if (!memory_region(machine, "audiobios")) */ |
| 679 | audio_cpu_rom_source = 1; |
| 680 | |
| 681 | memory_set_bank(space->machine, NEOGEO_BANK_AUDIO_CPU_MAIN_BANK, audio_cpu_rom_source); |
| 682 | |
| 683 | /* reset CPU if the source changed -- this is a guess */ |
| 684 | if (audio_cpu_rom_source != audio_cpu_rom_source_last) |
| 685 | { |
| 686 | audio_cpu_rom_source_last = audio_cpu_rom_source; |
| 687 | |
| 688 | cputag_set_input_line(space->machine, "audiocpu", INPUT_LINE_RESET, PULSE_LINE); |
| 689 | |
| 690 | if (LOG_AUDIO_CPU_BANKING) logerror("Audio CPU PC %03x: selectign %s ROM\n", cpu_get_pc(space->cpu), audio_cpu_rom_source ? "CARTRIDGE" : "BIOS"); |
| 691 | } |
| 692 | } |
| 693 | |
| 694 | |
| 695 | static void set_audio_cpu_rom_source(const address_space *space, UINT8 data) |
| 696 | { |
| 697 | audio_cpu_rom_source = data; |
| 698 | |
| 699 | _set_audio_cpu_rom_source(space); |
| 700 | } |
| 701 | |
| 702 | |
| 703 | static void audio_cpu_banking_init(running_machine *machine) |
| 704 | { |
| 705 | int region; |
| 706 | int bank; |
| 707 | UINT8 *rgn; |
| 708 | UINT32 address_mask; |
| 709 | |
| 710 | /* audio bios/cartridge selection */ |
| 711 | if (memory_region(machine, "audiobios")) |
| 712 | memory_configure_bank(machine, NEOGEO_BANK_AUDIO_CPU_MAIN_BANK, 0, 1, memory_region(machine, "audiobios"), 0); |
| 713 | memory_configure_bank(machine, NEOGEO_BANK_AUDIO_CPU_MAIN_BANK, 1, 1, memory_region(machine, "audiocpu"), 0); |
| 714 | |
| 715 | /* audio banking */ |
| 716 | address_mask = memory_region_length(machine, "audiocpu") - 0x10000 - 1; |
| 717 | |
| 718 | rgn = memory_region(machine, "audiocpu"); |
| 719 | for (region = 0; region < 4; region++) |
| 720 | { |
| 721 | for (bank = 0; bank < 0x100; bank++) |
| 722 | { |
| 723 | UINT32 bank_address = 0x10000 + (((bank << (11 + region)) & 0x3ffff) & address_mask); |
| 724 | memory_configure_bank(machine, NEOGEO_BANK_AUDIO_CPU_CART_BANK + region, bank, 1, &rgn[bank_address], 0); |
| 725 | } |
| 726 | } |
| 727 | |
| 728 | /* set initial audio banks -- |
| 729 | how does this really work, or is it even neccessary? */ |
| 730 | audio_cpu_banks[0] = 0x1e; |
| 731 | audio_cpu_banks[1] = 0x0e; |
| 732 | audio_cpu_banks[2] = 0x06; |
| 733 | audio_cpu_banks[3] = 0x02; |
| 734 | |
| 735 | set_audio_cpu_banking(machine); |
| 736 | |
| 737 | audio_cpu_rom_source_last = 0; |
| 738 | set_audio_cpu_rom_source(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM), 0); |
| 739 | } |
| 740 | |
| 741 | |
| 742 | |
| 743 | /************************************* |
| 744 | * |
| 745 | * System control register |
| 746 | * |
| 747 | *************************************/ |
| 748 | |
| 749 | static WRITE16_HANDLER( system_control_w ) |
| 750 | { |
| 751 | if (ACCESSING_BITS_0_7) |
| 752 | { |
| 753 | UINT8 bit = (offset >> 3) & 0x01; |
| 754 | |
| 755 | switch (offset & 0x07) |
| 756 | { |
| 757 | default: |
| 758 | case 0x00: neogeo_set_screen_dark(space->machine, bit); break; |
| 759 | case 0x01: set_main_cpu_vector_table_source(space->machine, bit); |
| 760 | set_audio_cpu_rom_source(space, bit); /* this is a guess */ |
| 761 | break; |
| 762 | case 0x05: neogeo_set_fixed_layer_source(bit); break; |
| 763 | case 0x06: set_save_ram_unlock(bit); break; |
| 764 | case 0x07: neogeo_set_palette_bank(space->machine, bit); break; |
| 765 | |
| 766 | case 0x02: /* unknown - HC32 middle pin 1 */ |
| 767 | case 0x03: /* unknown - uPD4990 pin ? */ |
| 768 | case 0x04: /* unknown - HC32 middle pin 10 */ |
| 769 | logerror("PC: %x Unmapped system control write. Offset: %x Data: %x\n", cpu_get_pc(space->cpu), offset & 0x07, bit); |
| 770 | break; |
| 771 | } |
| 772 | |
| 773 | if (LOG_VIDEO_SYSTEM && ((offset & 0x07) != 0x06)) logerror("PC: %x System control write. Offset: %x Data: %x\n", cpu_get_pc(space->cpu), offset & 0x07, bit); |
| 774 | } |
| 775 | } |
| 776 | |
| 777 | |
| 778 | |
| 779 | /************************************* |
| 780 | * |
| 781 | * Watchdog |
| 782 | * |
| 783 | * |
| 784 | * - The watchdog timer will reset the system after ~0.13 seconds |
| 785 | * On an MV-1F MVS system, the following code was used to test: |
| 786 | * 000100 203C 0001 4F51 MOVE.L #0x14F51,D0 |
| 787 | * 000106 13C0 0030 0001 MOVE.B D0,0x300001 |
| 788 | * 00010C 5380 SUBQ.L #1,D0 |
| 789 | * 00010E 64FC BCC.S *-0x2 [0x10C] |
| 790 | * 000110 13C0 0030 0001 MOVE.B D0,0x300001 |
| 791 | * 000116 60F8 BRA.S *-0x6 [0x110] |
| 792 | * This code loops long enough to sometimes cause a reset, sometimes not. |
| 793 | * The move takes 16 cycles, subq 8, bcc 10 if taken and 8 if not taken, so: |
| 794 | * (0x14F51 * 18 + 14) cycles / 12000000 cycles per second = 0.128762 seconds |
| 795 | * Newer games force a reset using the following code (this from kof99): |
| 796 | * 009CDA 203C 0003 0D40 MOVE.L #0x30D40,D0 |
| 797 | * 009CE0 5380 SUBQ.L #1,D0 |
| 798 | * 009CE2 64FC BCC.S *-0x2 [0x9CE0] |
| 799 | * Note however that there is a valid code path after this loop. |
| 800 | * |
| 801 | * The watchdog is used as a form of protecetion on a number of games, |
| 802 | * previously this was implemented as a specific hack which locked a single |
| 803 | * address of SRAM. |
| 804 | * |
| 805 | * What actually happens is if the game doesn't find valid data in the |
| 806 | * backup ram it will initialize it, then sit in a loop. The watchdog |
| 807 | * should then reset the system while it is in this loop. If the watchdog |
| 808 | * fails to reset the system the code will continue and set a value in |
| 809 | * backup ram to indiate that the protection check has failed. |
| 810 | * |
| 811 | *************************************/ |
| 812 | |
| 813 | static WRITE16_HANDLER( watchdog_w ) |
| 814 | { |
| 815 | /* only an LSB write resets the watchdog */ |
| 816 | if (ACCESSING_BITS_0_7) |
| 817 | { |
| 818 | watchdog_reset16_w(space, offset, data, mem_mask); |
| 819 | } |
| 820 | } |
| 821 | |
| 822 | |
| 823 | |
| 824 | /************************************* |
| 825 | * |
| 826 | * Machine initialization |
| 827 | * |
| 828 | *************************************/ |
| 829 | |
| 830 | static STATE_POSTLOAD( aes_postload ) |
| 831 | { |
| 832 | _set_main_cpu_bank_address(machine); |
| 833 | _set_main_cpu_vector_table_source(machine); |
| 834 | set_audio_cpu_banking(machine); |
| 835 | _set_audio_cpu_rom_source(cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM)); |
| 836 | } |
| 837 | |
| 838 | static MACHINE_START( neogeo ) |
| 839 | { |
| 840 | /* set the BIOS bank */ |
| 841 | memory_set_bankptr(machine, NEOGEO_BANK_BIOS, memory_region(machine, "mainbios")); |
| 842 | |
| 843 | /* set the initial main CPU bank */ |
| 844 | main_cpu_banking_init(machine); |
| 845 | |
| 846 | /* set the initial audio CPU ROM banks */ |
| 847 | audio_cpu_banking_init(machine); |
| 848 | |
| 849 | create_interrupt_timers(machine); |
| 850 | |
| 851 | /* initialize the celander IC to 'right now' */ |
| 852 | calendar_init(machine); |
| 853 | |
| 854 | /* initialize the memcard data structure */ |
| 855 | memcard_data = auto_alloc_array_clear(machine, UINT8, MEMCARD_SIZE); |
| 856 | |
| 857 | /* start with an IRQ3 - but NOT on a reset */ |
| 858 | irq3_pending = 1; |
| 859 | |
| 860 | /* register state save */ |
| 861 | state_save_register_global(machine, display_position_interrupt_control); |
| 862 | state_save_register_global(machine, display_counter); |
| 863 | state_save_register_global(machine, vblank_interrupt_pending); |
| 864 | state_save_register_global(machine, display_position_interrupt_pending); |
| 865 | state_save_register_global(machine, irq3_pending); |
| 866 | state_save_register_global(machine, audio_result); |
| 867 | state_save_register_global(machine, controller_select); |
| 868 | state_save_register_global(machine, main_cpu_bank_address); |
| 869 | state_save_register_global(machine, main_cpu_vector_table_source); |
| 870 | state_save_register_global_array(machine, audio_cpu_banks); |
| 871 | state_save_register_global(machine, audio_cpu_rom_source); |
| 872 | state_save_register_global(machine, audio_cpu_rom_source_last); |
| 873 | state_save_register_global(machine, save_ram_unlocked); |
| 874 | state_save_register_global_pointer(machine, memcard_data, 0x800); |
| 875 | state_save_register_global(machine, output_data); |
| 876 | state_save_register_global(machine, output_latch); |
| 877 | state_save_register_global(machine, el_value); |
| 878 | |
| 879 | state_save_register_postload(machine, aes_postload, NULL); |
| 880 | } |
| 881 | |
| 882 | |
| 883 | |
| 884 | /************************************* |
| 885 | * |
| 886 | * Machine reset |
| 887 | * |
| 888 | *************************************/ |
| 889 | |
| 890 | static MACHINE_RESET( neogeo ) |
| 891 | { |
| 892 | offs_t offs; |
| 893 | const address_space *space = cputag_get_address_space(machine, "maincpu", ADDRESS_SPACE_PROGRAM); |
| 894 | |
| 895 | /* reset system control registers */ |
| 896 | for (offs = 0; offs < 8; offs++) |
| 897 | system_control_w(space, offs, 0, 0x00ff); |
| 898 | device_reset(cputag_get_cpu(machine, "maincpu")); |
| 899 | |
| 900 | neogeo_reset_rng(); |
| 901 | |
| 902 | start_interrupt_timers(machine); |
| 903 | |
| 904 | /* trigger the IRQ3 that was set by MACHINE_START */ |
| 905 | update_interrupts(machine); |
| 906 | } |
| 907 | |
| 908 | |
| 909 | |
| 910 | /************************************* |
| 911 | * |
| 912 | * Main CPU memory handlers |
| 913 | * |
| 914 | *************************************/ |
| 915 | |
| 916 | static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 16 ) |
| 917 | AM_RANGE(0x000000, 0x00007f) AM_ROMBANK(NEOGEO_BANK_VECTORS) |
| 918 | AM_RANGE(0x000080, 0x0fffff) AM_ROM |
| 919 | AM_RANGE(0x100000, 0x10ffff) AM_MIRROR(0x0f0000) AM_RAM |
| 920 | /* some games have protection devices in the 0x200000 region, it appears to map to cart space, not surprising, the ROM is read here too */ |
| 921 | AM_RANGE(0x200000, 0x2fffff) AM_ROMBANK(NEOGEO_BANK_CARTRIDGE) |
| 922 | AM_RANGE(0x2ffff0, 0x2fffff) AM_WRITE(main_cpu_bank_select_w) |
| 923 | AM_RANGE(0x300000, 0x300001) AM_MIRROR(0x01ff7e) AM_READ_PORT("IN0") |
| 924 | AM_RANGE(0x300080, 0x300081) AM_MIRROR(0x01ff7e) AM_READ_PORT("IN4") |
| 925 | AM_RANGE(0x300000, 0x300001) AM_MIRROR(0x01ffe0) AM_READWRITE(neogeo_unmapped_r, watchdog_w) |
| 926 | AM_RANGE(0x320000, 0x320001) AM_MIRROR(0x01fffe) AM_READ_PORT("IN3") AM_WRITE(audio_command_w) |
| 927 | AM_RANGE(0x340000, 0x340001) AM_MIRROR(0x01fffe) AM_READ_PORT("IN1") |
| 928 | AM_RANGE(0x360000, 0x37ffff) AM_READ(neogeo_unmapped_r) |
| 929 | AM_RANGE(0x380000, 0x380001) AM_MIRROR(0x01fffe) AM_READ_PORT("IN2") |
| 930 | AM_RANGE(0x380000, 0x38007f) AM_MIRROR(0x01ff80) AM_WRITE(io_control_w) |
| 931 | AM_RANGE(0x3a0000, 0x3a001f) AM_MIRROR(0x01ffe0) AM_READWRITE(neogeo_unmapped_r, system_control_w) |
| 932 | AM_RANGE(0x3c0000, 0x3c0007) AM_MIRROR(0x01fff8) AM_READ(neogeo_video_register_r) |
| 933 | AM_RANGE(0x3c0000, 0x3c000f) AM_MIRROR(0x01fff0) AM_WRITE(neogeo_video_register_w) |
| 934 | AM_RANGE(0x3e0000, 0x3fffff) AM_READ(neogeo_unmapped_r) |
| 935 | AM_RANGE(0x400000, 0x401fff) AM_MIRROR(0x3fe000) AM_READWRITE(neogeo_paletteram_r, neogeo_paletteram_w) |
| 936 | AM_RANGE(0x800000, 0x800fff) AM_READWRITE(memcard_r, memcard_w) |
| 937 | AM_RANGE(0xc00000, 0xc1ffff) AM_MIRROR(0x0e0000) AM_ROMBANK(NEOGEO_BANK_BIOS) |
| 938 | AM_RANGE(0xd00000, 0xd0ffff) AM_MIRROR(0x0f0000) AM_RAM_WRITE(save_ram_w) AM_BASE(&save_ram) |
| 939 | AM_RANGE(0xe00000, 0xffffff) AM_READ(neogeo_unmapped_r) |
| 940 | ADDRESS_MAP_END |
| 941 | |
| 942 | |
| 943 | |
| 944 | /************************************* |
| 945 | * |
| 946 | * Audio CPU memory handlers |
| 947 | * |
| 948 | *************************************/ |
| 949 | |
| 950 | static ADDRESS_MAP_START( audio_map, ADDRESS_SPACE_PROGRAM, 8 ) |
| 951 | AM_RANGE(0x0000, 0x7fff) AM_ROMBANK(NEOGEO_BANK_AUDIO_CPU_MAIN_BANK) |
| 952 | AM_RANGE(0x8000, 0xbfff) AM_ROMBANK(NEOGEO_BANK_AUDIO_CPU_CART_BANK + 3) |
| 953 | AM_RANGE(0xc000, 0xdfff) AM_ROMBANK(NEOGEO_BANK_AUDIO_CPU_CART_BANK + 2) |
| 954 | AM_RANGE(0xe000, 0xefff) AM_ROMBANK(NEOGEO_BANK_AUDIO_CPU_CART_BANK + 1) |
| 955 | AM_RANGE(0xf000, 0xf7ff) AM_ROMBANK(NEOGEO_BANK_AUDIO_CPU_CART_BANK + 0) |
| 956 | AM_RANGE(0xf800, 0xffff) AM_RAM |
| 957 | ADDRESS_MAP_END |
| 958 | |
| 959 | |
| 960 | |
| 961 | /************************************* |
| 962 | * |
| 963 | * Audio CPU port handlers |
| 964 | * |
| 965 | *************************************/ |
| 966 | |
| 967 | static ADDRESS_MAP_START( auido_io_map, ADDRESS_SPACE_IO, 8 ) |
| 968 | /*AM_RANGE(0x00, 0x00) AM_MIRROR(0xff00) AM_READWRITE(audio_command_r, audio_cpu_clear_nmi_w);*/ /* may not and NMI clear */ |
| 969 | AM_RANGE(0x00, 0x00) AM_MIRROR(0xff00) AM_READ(audio_command_r) |
| 970 | AM_RANGE(0x04, 0x07) AM_MIRROR(0xff00) AM_DEVREADWRITE("ym", ym2610_r, ym2610_w) |
| 971 | AM_RANGE(0x08, 0x08) AM_MIRROR(0xff00) /* write - NMI enable / acknowledge? (the data written doesn't matter) */ |
| 972 | AM_RANGE(0x08, 0x08) AM_MIRROR(0xfff0) AM_MASK(0xfff0) AM_READ(audio_cpu_bank_select_f000_f7ff_r) |
| 973 | AM_RANGE(0x09, 0x09) AM_MIRROR(0xfff0) AM_MASK(0xfff0) AM_READ(audio_cpu_bank_select_e000_efff_r) |
| 974 | AM_RANGE(0x0a, 0x0a) AM_MIRROR(0xfff0) AM_MASK(0xfff0) AM_READ(audio_cpu_bank_select_c000_dfff_r) |
| 975 | AM_RANGE(0x0b, 0x0b) AM_MIRROR(0xfff0) AM_MASK(0xfff0) AM_READ(audio_cpu_bank_select_8000_bfff_r) |
| 976 | AM_RANGE(0x0c, 0x0c) AM_MIRROR(0xff00) AM_WRITE(audio_result_w) |
| 977 | AM_RANGE(0x18, 0x18) AM_MIRROR(0xff00) /* write - NMI disable? (the data written doesn't matter) */ |
| 978 | ADDRESS_MAP_END |
| 979 | |
| 980 | |
| 981 | |
| 982 | /************************************* |
| 983 | * |
| 984 | * Audio interface |
| 985 | * |
| 986 | *************************************/ |
| 987 | |
| 988 | static const ym2610_interface ym2610_config = |
| 989 | { |
| 990 | audio_cpu_irq |
| 991 | }; |
| 992 | |
| 993 | |
| 994 | |
| 995 | /************************************* |
| 996 | * |
| 997 | * Standard Neo-Geo DIPs and |
| 998 | * input port definition |
| 999 | * |
| 1000 | *************************************/ |
| 1001 | |
| 1002 | #define STANDARD_DIPS \ |
| 1003 | PORT_DIPNAME( 0x0001, 0x0001, "Test Switch" ) PORT_DIPLOCATION("SW:1") \ |
| 1004 | PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) \ |
| 1005 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) \ |
| 1006 | PORT_DIPNAME( 0x0002, 0x0002, "Coin Chutes?" ) PORT_DIPLOCATION("SW:2") \ |
| 1007 | PORT_DIPSETTING( 0x0000, "1?" ) \ |
| 1008 | PORT_DIPSETTING( 0x0002, "2?" ) \ |
| 1009 | PORT_DIPNAME( 0x0004, 0x0004, "Autofire (in some games)" ) PORT_DIPLOCATION("SW:3") \ |
| 1010 | PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) \ |
| 1011 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) \ |
| 1012 | PORT_DIPNAME( 0x0018, 0x0018, "COMM Setting (Cabinet No.)" ) PORT_DIPLOCATION("SW:4,5") \ |
| 1013 | PORT_DIPSETTING( 0x0018, "1" ) \ |
| 1014 | PORT_DIPSETTING( 0x0008, "2" ) \ |
| 1015 | PORT_DIPSETTING( 0x0010, "3" ) \ |
| 1016 | PORT_DIPSETTING( 0x0000, "4" ) \ |
| 1017 | PORT_DIPNAME( 0x0020, 0x0020, "COMM Setting (Link Enable)" ) PORT_DIPLOCATION("SW:6") \ |
| 1018 | PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) \ |
| 1019 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) \ |
| 1020 | PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW:7") \ |
| 1021 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) \ |
| 1022 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) \ |
| 1023 | PORT_DIPNAME( 0x0080, 0x0080, "Freeze" ) PORT_DIPLOCATION("SW:8") \ |
| 1024 | PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) \ |
| 1025 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1026 | |
| 1027 | #define STANDARD_IN2 \ |
| 1028 | PORT_START("IN2") \ |
| 1029 | PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) \ |
| 1030 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_START1 ) \ |
| 1031 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Next Game") PORT_CODE(KEYCODE_7) \ |
| 1032 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_START2 ) \ |
| 1033 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Previous Game") PORT_CODE(KEYCODE_8) \ |
| 1034 | PORT_BIT( 0x7000, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_memcard_status, NULL) \ |
| 1035 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1036 | |
| 1037 | |
| 1038 | #define STANDARD_IN3 \ |
| 1039 | PORT_START("IN3") \ |
| 1040 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_COIN1 ) \ |
| 1041 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_COIN2 ) \ |
| 1042 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_SERVICE1 ) \ |
| 1043 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* having this ACTIVE_HIGH causes you to start with 2 credits using USA bios roms */ \ |
| 1044 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNKNOWN ) /* having this ACTIVE_HIGH causes you to start with 2 credits using USA bios roms */ \ |
| 1045 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_SPECIAL ) /* what is this? */ \ |
| 1046 | PORT_BIT( 0x00c0, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_calendar_status, NULL) \ |
| 1047 | PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(get_audio_result, NULL) |
| 1048 | |
| 1049 | |
| 1050 | #define STANDARD_IN4 \ |
| 1051 | PORT_START("IN4") \ |
| 1052 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \ |
| 1053 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \ |
| 1054 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \ |
| 1055 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \ |
| 1056 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \ |
| 1057 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, IPT_UNKNOWN ) \ |
| 1058 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SPECIAL ) /* what is this? */ \ |
| 1059 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_OTHER ) PORT_NAME("Enter BIOS") PORT_CODE(KEYCODE_F2) \ |
| 1060 | PORT_BIT( 0xff00, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1061 | |
| 1062 | static INPUT_PORTS_START( controller ) |
| 1063 | PORT_START("IN0") |
| 1064 | PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1065 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CATEGORY (1) |
| 1066 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CATEGORY (1) |
| 1067 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CATEGORY (1) |
| 1068 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CATEGORY (1) |
| 1069 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CATEGORY (1) |
| 1070 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CATEGORY (1) |
| 1071 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CATEGORY (1) |
| 1072 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_CATEGORY (1) |
| 1073 | |
| 1074 | |
| 1075 | PORT_START("IN1") |
| 1076 | PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1077 | PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CATEGORY (2) |
| 1078 | PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CATEGORY (2) |
| 1079 | PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CATEGORY (2) |
| 1080 | PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CATEGORY (2) |
| 1081 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CATEGORY (2) |
| 1082 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CATEGORY (2) |
| 1083 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CATEGORY (2) |
| 1084 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_CATEGORY (2) |
| 1085 | INPUT_PORTS_END |
| 1086 | |
| 1087 | static INPUT_PORTS_START( mjpanel ) |
| 1088 | PORT_START("MJ01_P1") |
| 1089 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1090 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1091 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1092 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1093 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1094 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1095 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1096 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1097 | PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1098 | |
| 1099 | PORT_START("MJ02_P1") |
| 1100 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1101 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1102 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1103 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1104 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1105 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1106 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1107 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1108 | PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1109 | |
| 1110 | PORT_START("MJ03_P1") |
| 1111 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1112 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1113 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1114 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1115 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1116 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1117 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1118 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1119 | PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1120 | |
| 1121 | PORT_START("MJ04_P1") |
| 1122 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1123 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1124 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1125 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1126 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(1) PORT_CATEGORY (3) |
| 1127 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1128 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1129 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1130 | PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1131 | |
| 1132 | PORT_START("MJ01_P2") |
| 1133 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_A ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1134 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_B ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1135 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_C ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1136 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_D ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1137 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_E ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1138 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_F ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1139 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_MAHJONG_G ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1140 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1141 | PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1142 | |
| 1143 | PORT_START("MJ02_P2") |
| 1144 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_H ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1145 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_I ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1146 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_J ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1147 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_K ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1148 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_L ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1149 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_MAHJONG_M ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1150 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_MAHJONG_N ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1151 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1152 | PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1153 | |
| 1154 | PORT_START("MJ03_P2") |
| 1155 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1156 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1157 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1158 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1159 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON1 ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1160 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1161 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1162 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1163 | PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1164 | |
| 1165 | PORT_START("MJ04_P2") |
| 1166 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_MAHJONG_PON ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1167 | PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_MAHJONG_CHI ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1168 | PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_MAHJONG_KAN ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1169 | PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_MAHJONG_RON ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1170 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_MAHJONG_REACH ) PORT_PLAYER(2) PORT_CATEGORY (4) |
| 1171 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1172 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1173 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 1174 | PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 1175 | INPUT_PORTS_END |
| 1176 | |
| 1177 | static INPUT_PORTS_START( aes ) |
| 1178 | // was there anyting in place of dipswitch in the home console? |
| 1179 | /* PORT_START("IN0") |
| 1180 | PORT_BIT( 0x00ff, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 1181 | // PORT_DIPNAME( 0x0001, 0x0001, "Test Switch" ) PORT_DIPLOCATION("SW:1") |
| 1182 | // PORT_DIPSETTING( 0x0001, DEF_STR( Off ) ) |
| 1183 | // PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1184 | // PORT_DIPNAME( 0x0002, 0x0002, "Coin Chutes?" ) PORT_DIPLOCATION("SW:2") |
| 1185 | // PORT_DIPSETTING( 0x0000, "1?" ) |
| 1186 | // PORT_DIPSETTING( 0x0002, "2?" ) |
| 1187 | // PORT_DIPNAME( 0x0004, 0x0000, "Mahjong Control Panel (or Auto Fire)" ) PORT_DIPLOCATION("SW:3") |
| 1188 | // PORT_DIPSETTING( 0x0004, DEF_STR( Off ) ) |
| 1189 | // PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1190 | // PORT_DIPNAME( 0x0018, 0x0018, "COMM Setting (Cabinet No.)" ) PORT_DIPLOCATION("SW:4,5") |
| 1191 | // PORT_DIPSETTING( 0x0018, "1" ) |
| 1192 | // PORT_DIPSETTING( 0x0008, "2" ) |
| 1193 | // PORT_DIPSETTING( 0x0010, "3" ) |
| 1194 | // PORT_DIPSETTING( 0x0000, "4" ) |
| 1195 | // PORT_DIPNAME( 0x0020, 0x0020, "COMM Setting (Link Enable)" ) PORT_DIPLOCATION("SW:6") |
| 1196 | // PORT_DIPSETTING( 0x0020, DEF_STR( Off ) ) |
| 1197 | // PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1198 | // PORT_DIPNAME( 0x0040, 0x0040, DEF_STR( Free_Play ) ) PORT_DIPLOCATION("SW:7") |
| 1199 | // PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 1200 | // PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1201 | // PORT_DIPNAME( 0x0080, 0x0080, "Freeze" ) PORT_DIPLOCATION("SW:8") |
| 1202 | // PORT_DIPSETTING( 0x0080, DEF_STR( Off ) ) |
| 1203 | // PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 1204 | PORT_BIT( 0xff00, IP_ACTIVE_HIGH, IPT_SPECIAL ) PORT_CUSTOM(aes_controller_r, NULL) */ |
| 1205 | |
| 1206 | PORT_START("CTRLSEL") /* Select Controller Type */ |
| 1207 | PORT_CATEGORY_CLASS( 0x0f, 0x01, "P1 Controller") |
| 1208 | PORT_CATEGORY_ITEM( 0x00, "Unconnected", 0 ) |
| 1209 | PORT_CATEGORY_ITEM( 0x01, "NeoGeo Controller", 1 ) |
| 1210 | PORT_CATEGORY_ITEM( 0x02, "NeoGeo Mahjong Panel", 3 ) |
| 1211 | PORT_CATEGORY_CLASS( 0xf0, 0x10, "P2 Controller") |
| 1212 | PORT_CATEGORY_ITEM( 0x00, "Unconnected", 0 ) |
| 1213 | PORT_CATEGORY_ITEM( 0x10, "NeoGeo Controller", 2 ) |
| 1214 | PORT_CATEGORY_ITEM( 0x20, "NeoGeo Mahjong Panel", 4 ) |
| 1215 | |
| 1216 | PORT_INCLUDE( controller ) |
| 1217 | |
| 1218 | PORT_INCLUDE( mjpanel ) |
| 1219 | |
| 1220 | // were some of these present in the AES?!? |
| 1221 | STANDARD_IN2 |
| 1222 | |
| 1223 | STANDARD_IN3 |
| 1224 | |
| 1225 | STANDARD_IN4 |
| 1226 | INPUT_PORTS_END |
| 1227 | |
| 1228 | |
| 1229 | |
| 1230 | /************************************* |
| 1231 | * |
| 1232 | * Machine driver |
| 1233 | * |
| 1234 | *************************************/ |
| 1235 | |
| 1236 | static MACHINE_DRIVER_START( neogeo ) |
| 1237 | |
| 1238 | /* basic machine hardware */ |
| 1239 | MDRV_CPU_ADD("maincpu", M68000, NEOGEO_MAIN_CPU_CLOCK) |
| 1240 | MDRV_CPU_PROGRAM_MAP(main_map) |
| 1241 | |
| 1242 | MDRV_CPU_ADD("audiocpu", Z80, NEOGEO_AUDIO_CPU_CLOCK) |
| 1243 | MDRV_CPU_PROGRAM_MAP(audio_map) |
| 1244 | MDRV_CPU_IO_MAP(auido_io_map) |
| 1245 | |
| 1246 | MDRV_WATCHDOG_TIME_INIT(USEC(128762)) |
| 1247 | |
| 1248 | MDRV_MACHINE_START(neogeo) |
| 1249 | MDRV_MACHINE_RESET(neogeo) |
| 1250 | MDRV_NVRAM_HANDLER(neogeo) |
| 1251 | MDRV_MEMCARD_HANDLER(neogeo) |
| 1252 | |
| 1253 | /* video hardware */ |
| 1254 | MDRV_VIDEO_START(neogeo) |
| 1255 | MDRV_VIDEO_RESET(neogeo) |
| 1256 | MDRV_VIDEO_UPDATE(neogeo) |
| 1257 | |
| 1258 | MDRV_SCREEN_ADD("screen", RASTER) |
| 1259 | MDRV_SCREEN_FORMAT(BITMAP_FORMAT_RGB32) |
| 1260 | MDRV_SCREEN_RAW_PARAMS(NEOGEO_PIXEL_CLOCK, NEOGEO_HTOTAL, NEOGEO_HBEND, NEOGEO_HBSTART, NEOGEO_VTOTAL, NEOGEO_VBEND, NEOGEO_VBSTART) |
| 1261 | |
| 1262 | /* audio hardware */ |
| 1263 | MDRV_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1264 | |
| 1265 | MDRV_SOUND_ADD("ym", YM2610, NEOGEO_YM2610_CLOCK) |
| 1266 | MDRV_SOUND_CONFIG(ym2610_config) |
| 1267 | MDRV_SOUND_ROUTE(0, "lspeaker", 0.60) |
| 1268 | MDRV_SOUND_ROUTE(0, "rspeaker", 0.60) |
| 1269 | MDRV_SOUND_ROUTE(1, "lspeaker", 1.0) |
| 1270 | MDRV_SOUND_ROUTE(2, "rspeaker", 1.0) |
| 1271 | |
| 1272 | // MDRV_AES_CARTRIDGE_ADD("aes_multicart") |
| 1273 | MACHINE_DRIVER_END |
| 1274 | |
| 1275 | /************************************* |
| 1276 | * |
| 1277 | * Driver initalization |
| 1278 | * |
| 1279 | *************************************/ |
| 1280 | |
| 1281 | static DRIVER_INIT( neogeo ) |
| 1282 | { |
| 1283 | } |
| 1284 | |
| 1285 | |
| 1286 | ROM_START( aes ) |
| 1287 | ROM_REGION16_BE( 0x80000, "mainbios", 0 ) |
| 1288 | ROM_SYSTEM_BIOS( 0, "jap-aes", "Japan AES" ) |
| 1289 | ROMX_LOAD("neo-po.bin", 0x00000, 0x020000, CRC(16d0c132) SHA1(4e4a440cae46f3889d20234aebd7f8d5f522e22c), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(1)) /* AES Console (Japan) Bios */ |
| 1290 | ROM_SYSTEM_BIOS( 1, "asia-aes", "Asia AES" ) |
| 1291 | ROMX_LOAD("neo-epo.bin", 0x00000, 0x020000, CRC(d27a71f1) SHA1(1b3b22092f30c4d1b2c15f04d1670eb1e9fbea07), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(2)) /* AES Console (Asia?) Bios */ |
| 1292 | #if 0 |
| 1293 | ROM_SYSTEM_BIOS( 2, "uni-bios_2_3","Universe Bios (Hack, Ver. 2.3)" ) |
| 1294 | ROMX_LOAD("uni-bios_2_3.rom", 0x00000, 0x020000, CRC(27664eb5) SHA1(5b02900a3ccf3df168bdcfc98458136fd2b92ac0), ROM_GROUPWORD | ROM_REVERSE | ROM_BIOS(3)) /* Universe Bios v2.3 (hack) */ |
| 1295 | #endif |
| 1296 | |
| 1297 | ROM_REGION( 0x100000, "maincpu", ROMREGION_ERASEFF ) |
| 1298 | |
| 1299 | ROM_REGION( 0x20000, "audiobios", 0 ) |
| 1300 | ROM_LOAD( "sm1.sm1", 0x00000, 0x20000, CRC(94416d67) SHA1(42f9d7ddd6c0931fd64226a60dc73602b2819dcf) ) |
| 1301 | |
| 1302 | ROM_REGION( 0x50000, "audiocpu", ROMREGION_ERASEFF ) |
| 1303 | |
| 1304 | ROM_REGION( 0x20000, "zoomy", 0 ) |
| 1305 | ROM_LOAD( "000-lo.lo", 0x00000, 0x20000, CRC(5a86cff2) SHA1(5992277debadeb64d1c1c64b0a92d9293eaf7e4a) ) |
| 1306 | |
| 1307 | ROM_REGION( 0x20000, "fixedbios", 0 ) |
| 1308 | ROM_LOAD( "sfix.sfix", 0x000000, 0x20000, CRC(c2ea0cfd) SHA1(fd4a618cdcdbf849374f0a50dd8efe9dbab706c3) ) |
| 1309 | |
| 1310 | ROM_REGION( 0x20000, "fixed", ROMREGION_ERASEFF ) |
| 1311 | |
| 1312 | ROM_REGION( 0x10000, "ym", ROMREGION_ERASEFF ) |
| 1313 | |
| 1314 | // NO_DELTAT_REGION |
| 1315 | |
| 1316 | ROM_REGION( 0x100000, "sprites", ROMREGION_DISPOSE | ROMREGION_ERASEFF ) |
| 1317 | ROM_END |
| 1318 | |
| 1319 | |
| 1320 | CONS( 1990, aes, 0, 0, neogeo, aes, neogeo, 0, "SNK", "Neo-Geo AES", 0 ) |