Previous 15994 Revisions Next

r6142 Tuesday 20th October, 2009 at 08:02:03 UTC by Harmony
[CDI] Fixing region control flags; Dark Castle now has graphics in-game. [Harmony]
[src/mess/drivers]cdi.c

src/mess/drivers/cdi.c
r6141r6142
4545
4646#define ENABLE_UART_PRINTING (0)
4747
48#define VERBOSE_LEVEL   (5)
48#define VERBOSE_LEVEL   (11)
4949
5050#define ENABLE_VERBOSE_LOG (0)
5151
r6141r6142
13531353      cdic_regs.audio_buffer |= 0x8000;
13541354   }
13551355
1356   // Set the CDIC interrupt line
1357   verboselog(machine, 0, "Setting CDIC interrupt line for soundmap decode\n" );
1358   cpu_set_input_line_vector(cputag_get_cpu(machine, "maincpu"), M68K_IRQ_4, 128);
1359   cputag_set_input_line(machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
1360
13611356   if(CDIC_IS_VALID_SAMPLE_BUF(cdic_regs.z_buffer & 0x3ffe))
13621357   {
13631358      attotime period;
13641359
13651360      verboselog(machine, 0, "Hit audio_sample_trigger, with cdic_regs.z_buffer == %04x, calling cdic_decode_audio_sector\n", cdic_regs.z_buffer );
13661361
1362      // Set the CDIC interrupt line
1363      verboselog(machine, 0, "Setting CDIC interrupt line for soundmap decode\n" );
1364      cpu_set_input_line_vector(cputag_get_cpu(machine, "maincpu"), M68K_IRQ_4, 128);
1365      cputag_set_input_line(machine, "maincpu", M68K_IRQ_4, ASSERT_LINE);
1366
13671367      // Decode the data at Z+4, the same offset as a normal CD sector.
13681368      cdic_decode_audio_sector(machine, ((UINT8*)cdram) + (cdic_regs.z_buffer & 0x3ffe) + 4, 1);
13691369
r6141r6142
13851385   }
13861386   else
13871387   {
1388      // Swap buffer positions to indicate our new buffer position at the next read
13881389      cdic_regs.z_buffer &= 0xfffe;
1390      cdic_regs.z_buffer += 0xa00;
1391      if(cdic_regs.z_buffer == 0x3c00)
1392      {
1393         cdic_regs.z_buffer = 0x2800;
1394      }
1395
1396      cdic_regs.z_buffer &= 0xfffe;
13891397      verboselog(machine, 0, "Data is not valid, stopping playback\n" );
13901398      timer_adjust_oneshot(cdic_regs.audio_sample_timer, attotime_never, 0);
13911399   }
r6141r6142
16471655            //printf("Clearing CDIC interrupt line\n" );
16481656         }
16491657         cdic_regs.data_buffer &= ~0x4000;
1658         if(cdic_regs.data_buffer & 0x8000)
1659         {
1660            if(cdic_regs.command == 0x2c)
1661            {
1662               cdic_regs.data_buffer &= ~0x8000;
1663            }
1664         }
16501665         return temp;
16511666      }
16521667      default:
r6141r6142
17761791                  break;
17771792               case 0x2c: // Seek
17781793                  cdic_regs.data_buffer &= 0x7fff;
1779                  //cdic_regs.x_buffer |= 0x8000;
17801794                  break;
17811795               default:
17821796                  verboselog(space->machine, 0, "Unknown CDIC command: %02x\n", cdic_regs.command );
r6141r6142
29542968{
29552969   int x = 0;
29562970
2957   static int latched_rf0 = 1;
2958   static int latched_rf1 = 1;
2971   static int latched_rf0 = 0;
2972   static int latched_rf1 = 0;
29592973   static int latched_wfa = 0;
29602974   static int latched_wfb = 0;
29612975   latched_wfa = mcd212.channel[0].weight_factor_a[0];
r6141r6142
35143528               plane_enable_a = mcd212.region_flag_1[x];
35153529               break;
35163530            case 5:
3517               plane_enable_a = (plane_a_r_cur != transparent_color_a_r || plane_a_g_cur != transparent_color_a_g || plane_a_b_cur != transparent_color_a_b || mcd212.region_flag_0[x] == 0);
3531               plane_enable_a = (plane_a_r_cur != transparent_color_a_r || plane_a_g_cur != transparent_color_a_g || plane_a_b_cur != transparent_color_a_b || mcd212.region_flag_0[x] == 1);
35183532               break;
35193533            case 6:
3520               plane_enable_a = (plane_a_r_cur != transparent_color_a_r || plane_a_g_cur != transparent_color_a_g || plane_a_b_cur != transparent_color_a_b || mcd212.region_flag_1[x] == 1);
3534               plane_enable_a = (plane_a_r_cur != transparent_color_a_r || plane_a_g_cur != transparent_color_a_g || plane_a_b_cur != transparent_color_a_b || mcd212.region_flag_1[x] == 0);
35213535               break;
35223536            case 8:
35233537               plane_enable_a = 1;

Previous 15994 Revisions Next


© 1998-2018 The MESS Team