trunk/src/mess/machine/sns_sa1.c
| r23875 | r23876 | |
| 28 | 28 | - test case for BWRAM & IRAM write protect (bsnes does not seem to ever protect either, so it's not implemented |
| 29 | 29 | for the moment) |
| 30 | 30 | - almost everything CPU related! |
| 31 | | |
| 31 | |
| 32 | Compatibility: |
| 33 | sdf1gpp, sdf1gp: corrupt menu gfx, hangs going into game (I think) |
| 34 | habumeij: boots, goes into game, on-screen timer counts down after SA-1 is enabled but controls aren't responsive |
| 35 | kirbysdb, kirbyss, kirbyfun, kirbysd, kirbysda: plays OK |
| 36 | kirby3j, kirby3: uses SA-1 DMA |
| 37 | itoibass: boots, some missing gfx |
| 38 | jl96drem: hangs entering gameplay with SA-1 disabled |
| 39 | haruaug3a, pebble, haruaug3: uses SA-1 DMA |
| 40 | miniyonk: corrupt gfx, can't get past press start |
| 41 | pgaeuro, pgaeurou, pga96, pga96u, pga, pgaj: plays OK |
| 42 | przeo, przeou: plays OK |
| 43 | sdgungnx: plays music and hangs, both CPUs are waiting for RAM locations to change |
| 44 | panicbw: plays OK |
| 45 | smrpgj, smrpg: boots, hangs with music playing and missing gfx |
| 46 | daisenx2: goes into game, garbage gfx, presuably uses SA-1 graphics functions |
| 47 | derbyjo2: plays OK, some garbage gfx, presuably uses SA-1 graphics functions |
| 48 | dbzhypd, dbzhypdj: plays OK |
| 49 | jikkpaaro: plays OK |
| 50 | jumpind: boots and runs, uses SA-1 DMA and character conversion |
| 51 | kakinoki: S-CPU crashes after pressing start |
| 52 | marvelou: locks up, not sure what's going on |
| 53 | shinshog: goes into game, seems to hang after you move a piece? |
| 54 | shogisai: plays OK |
| 55 | shogisa2: plays OK |
| 56 | srobotg: plays OK |
| 57 | |
| 32 | 58 | ***********************************************************************************************************/ |
| 33 | 59 | |
| 34 | 60 | |
| r23875 | r23876 | |
| 69 | 95 | { |
| 70 | 96 | memset(m_internal_ram, 0, 0x800); |
| 71 | 97 | |
| 72 | | m_sa1_ctrl = 0; |
| 98 | m_sa1_ctrl = 0x20; |
| 73 | 99 | m_scpu_ctrl = 0; |
| 74 | 100 | m_irq_vector = 0; |
| 75 | 101 | m_nmi_vector = 0; |
| r23875 | r23876 | |
| 120 | 146 | |
| 121 | 147 | void sns_sa1_device::recalc_irqs() |
| 122 | 148 | { |
| 123 | | #if 0 // how do we get the maincpu from here? |
| 124 | 149 | if (m_scpu_flags & m_scpu_sie & (SCPU_IRQ_SA1|SCPU_IRQ_CHARCONV)) |
| 125 | 150 | { |
| 126 | | set_input_line(G65816_LINE_IRQ, ASSERT_LINE); |
| 151 | machine().device("maincpu")->execute().set_input_line(G65816_LINE_IRQ, ASSERT_LINE); |
| 127 | 152 | } |
| 128 | 153 | else |
| 129 | 154 | { |
| 130 | | set_input_line(G65816_LINE_IRQ, CLEAR_LINE); |
| 155 | machine().device("maincpu")->execute().set_input_line(G65816_LINE_IRQ, CLEAR_LINE); |
| 131 | 156 | } |
| 132 | | #endif |
| 133 | 157 | |
| 134 | 158 | if (m_sa1_flags & m_sa1_sie & (SA1_IRQ_SCPU|SA1_IRQ_TIMER|SA1_IRQ_DMA)) |
| 135 | 159 | { |
| r23875 | r23876 | |
| 297 | 321 | { |
| 298 | 322 | case 0x000: |
| 299 | 323 | // SA-1 control flags |
| 324 | // printf("%02x to SA-1 control\n", data); |
| 300 | 325 | if ((BIT(data, 5)) && !(BIT(m_sa1_ctrl, 5))) |
| 301 | 326 | { |
| 302 | | printf("Engaging SA-1 reset\n"); |
| 327 | // printf("Engaging SA-1 reset\n"); |
| 303 | 328 | m_sa1->set_input_line(INPUT_LINE_HALT, ASSERT_LINE); |
| 304 | 329 | } |
| 305 | 330 | else if (!(BIT(data, 5)) && (BIT(m_sa1_ctrl, 5))) |
| 306 | 331 | { |
| 307 | | printf("Releasing SA-1 reset\n"); |
| 332 | // printf("Releasing SA-1 reset\n"); |
| 308 | 333 | m_sa1->set_input_line(INPUT_LINE_HALT, CLEAR_LINE); |
| 309 | 334 | m_sa1->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); |
| 310 | 335 | m_sa1->set_input_line(INPUT_LINE_RESET, CLEAR_LINE); |
| r23875 | r23876 | |
| 329 | 354 | case 0x001: |
| 330 | 355 | // SNES SIE 00h SNES CPU Int Enable (W) |
| 331 | 356 | m_scpu_sie = data; |
| 357 | // printf("S-CPU IE = %02x\n", data); |
| 332 | 358 | recalc_irqs(); |
| 333 | 359 | break; |
| 334 | 360 | case 0x002: |
| r23875 | r23876 | |
| 379 | 405 | if (m_scpu_ctrl & 0x80) |
| 380 | 406 | { |
| 381 | 407 | m_scpu_flags |= SCPU_IRQ_SA1; |
| 408 | // printf("SA-1 cause S-CPU IRQ\n"); |
| 382 | 409 | } |
| 383 | 410 | |
| 384 | 411 | // message to SA-1 |
| r23875 | r23876 | |
| 396 | 423 | case 0x00a: |
| 397 | 424 | // SA-1 CIE 00h SA-1 CPU Int Enable (W) |
| 398 | 425 | m_sa1_sie = data; |
| 426 | // printf("SA-1 IE = %02x\n", data); |
| 399 | 427 | recalc_irqs(); |
| 400 | 428 | break; |
| 401 | 429 | case 0x00b: |
| r23875 | r23876 | |
| 507 | 535 | break; |
| 508 | 536 | case 0x030: |
| 509 | 537 | // SA-1 DCNT 00h DMA Control (W) |
| 538 | // printf("%02x to SA-1 DMA control\n", data); |
| 510 | 539 | break; |
| 511 | 540 | case 0x031: |
| 512 | 541 | // Both CDMA 00h Character Conversion DMA Parameters (W) |