Previous 199869 Revisions Next

r23876 Sunday 23rd June, 2013 at 12:44:54 UTC by R. Belmont
(MESS) SNES SA-1: fixed initial SA-1 status and added preliminary SA-1 to S-CPU IRQ. [R. Belmont]
[src/mess/machine]sns_sa1.c

trunk/src/mess/machine/sns_sa1.c
r23875r23876
2828 - test case for BWRAM & IRAM write protect (bsnes does not seem to ever protect either, so it's not implemented
2929   for the moment)
3030 - 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 
3258 ***********************************************************************************************************/
3359
3460
r23875r23876
6995{
7096   memset(m_internal_ram, 0, 0x800);
7197
72   m_sa1_ctrl = 0;
98   m_sa1_ctrl = 0x20;
7399   m_scpu_ctrl = 0;
74100   m_irq_vector = 0;
75101   m_nmi_vector = 0;
r23875r23876
120146
121147void sns_sa1_device::recalc_irqs()
122148{
123   #if 0   // how do we get the maincpu from here?
124149   if (m_scpu_flags & m_scpu_sie & (SCPU_IRQ_SA1|SCPU_IRQ_CHARCONV))
125150   {
126      set_input_line(G65816_LINE_IRQ, ASSERT_LINE);
151      machine().device("maincpu")->execute().set_input_line(G65816_LINE_IRQ, ASSERT_LINE);
127152   }
128153   else
129154   {
130      set_input_line(G65816_LINE_IRQ, CLEAR_LINE);
155      machine().device("maincpu")->execute().set_input_line(G65816_LINE_IRQ, CLEAR_LINE);
131156   }
132   #endif
133157
134158   if (m_sa1_flags & m_sa1_sie & (SA1_IRQ_SCPU|SA1_IRQ_TIMER|SA1_IRQ_DMA))
135159   {
r23875r23876
297321   {
298322      case 0x000:
299323         // SA-1 control flags
324//         printf("%02x to SA-1 control\n", data);
300325         if ((BIT(data, 5)) && !(BIT(m_sa1_ctrl, 5)))
301326         {
302            printf("Engaging SA-1 reset\n");
327//            printf("Engaging SA-1 reset\n");
303328            m_sa1->set_input_line(INPUT_LINE_HALT, ASSERT_LINE);
304329         }
305330         else if (!(BIT(data, 5)) && (BIT(m_sa1_ctrl, 5)))
306331         {
307            printf("Releasing SA-1 reset\n");
332//            printf("Releasing SA-1 reset\n");
308333            m_sa1->set_input_line(INPUT_LINE_HALT, CLEAR_LINE);
309334            m_sa1->set_input_line(INPUT_LINE_RESET, ASSERT_LINE);
310335            m_sa1->set_input_line(INPUT_LINE_RESET, CLEAR_LINE);
r23875r23876
329354      case 0x001:
330355         // SNES  SIE   00h   SNES CPU Int Enable (W)
331356         m_scpu_sie = data;
357//         printf("S-CPU IE = %02x\n", data);
332358         recalc_irqs();
333359         break;
334360      case 0x002:
r23875r23876
379405         if (m_scpu_ctrl & 0x80)
380406         {
381407            m_scpu_flags |= SCPU_IRQ_SA1;
408//            printf("SA-1 cause S-CPU IRQ\n");
382409         }
383410
384411         // message to SA-1
r23875r23876
396423      case 0x00a:
397424         // SA-1  CIE   00h   SA-1 CPU Int Enable (W)
398425         m_sa1_sie = data;
426//         printf("SA-1 IE = %02x\n", data);
399427         recalc_irqs();
400428         break;
401429      case 0x00b:
r23875r23876
507535         break;
508536      case 0x030:
509537         // SA-1  DCNT  00h   DMA Control (W)
538//         printf("%02x to SA-1 DMA control\n", data);
510539         break;
511540      case 0x031:
512541         // Both  CDMA  00h   Character Conversion DMA Parameters (W)

Previous 199869 Revisions Next


© 1997-2024 The MAME Team