Previous 15994 Revisions Next

r6257 Monday 2nd November, 2009 at 13:19:11 UTC by Harmony
[CDI]
- Turned off verbose logging. [Harmony]
- Removed stray debugging output. [Harmony]
- Added init functions for all CDI hardware, this should fix most if not all multisession issues. [Harmony]
[src/mess/drivers]cdi.c

src/mess/drivers/cdi.c
r6256r6257
1313
1414STATUS:
1515
16Some games will start up, but fail horribly.
16Some games are playable, but many suffer from bugs and/or crashes.
1717
1818TODO:
1919
20-Proper handling of the 68070 (68k with 32 address lines instead of 24)
21 & handle the extra features properly (UART,DMA,Timers etc.)
20- Proper handling of the 68070's internal devices (UART,DMA,Timers etc.)
2221
23-Full emulation of the 66470 and/or MCD212 Video Chip (still many unhandled features)
22- Full emulation of the 66470 and/or MCD212 Video Chip
2423
25-Unknown sound chip (CD-i ADPCM);
26
2724*******************************************************************************/
2825
29
3026#define CLOCK_A   XTAL_30MHz
3127#define CLOCK_B   XTAL_19_6608MHz
3228
r6256r6257
4945
5046#define ENABLE_UART_PRINTING (0)
5147
52#define VERBOSE_LEVEL   (6)
48#define VERBOSE_LEVEL   (5)
5349
54#define ENABLE_VERBOSE_LOG (1)
50#define ENABLE_VERBOSE_LOG (0)
5551
5652#if ENABLE_VERBOSE_LOG
5753INLINE void verboselog(running_machine *machine, int n_level, const char *s_fmt, ...)
r6256r6257
310306typedef struct
311307{
312308   UINT16 lir;
309   UINT8 picr1;
310   UINT8 picr2;
311
313312   scc68070_i2c_regs_t i2c;
314313   scc68070_uart_regs_t uart;
315314   scc68070_timer_regs_t timers;
316   UINT8 picr1;
317   UINT8 picr2;
318315   scc68070_dma_regs_t dma;
319316   scc68070_mmu_regs_t mmu;
320317} scc68070_regs_t;
r6256r6257
885882   }
886883}
887884
885static void scc68070_init(running_machine *machine, scc68070_regs_t *scc68070)
886{
887   int index = 0;
888   scc68070->lir = 0;
889
890   scc68070->picr1 = 0;
891   scc68070->picr2 = 0;
892
893   scc68070->i2c.data_register = 0;
894   scc68070->i2c.address_register = 0;
895   scc68070->i2c.status_register = 0;
896   scc68070->i2c.control_register = 0;
897   scc68070->i2c.clock_control_register = 0;
898
899   scc68070->uart.mode_register = 0;
900   scc68070->uart.status_register = 0;
901   scc68070->uart.clock_select = 0;
902   scc68070->uart.command_register = 0;
903   scc68070->uart.transmit_holding_register = 0;
904   scc68070->uart.receive_holding_register = 0;
905
906   scc68070->timers.timer_status_register = 0;
907   scc68070->timers.timer_control_register = 0;
908   scc68070->timers.reload_register = 0;
909   scc68070->timers.timer0 = 0;
910   scc68070->timers.timer1 = 0;
911   scc68070->timers.timer2 = 0;
912
913   for(index = 0; index < 2; index++)
914   {
915      scc68070->dma.channel[index].channel_status = 0;
916      scc68070->dma.channel[index].channel_error = 0;
917      scc68070->dma.channel[index].device_control = 0;
918      scc68070->dma.channel[index].operation_control = 0;
919      scc68070->dma.channel[index].sequence_control = 0;
920      scc68070->dma.channel[index].channel_control = 0;
921      scc68070->dma.channel[index].transfer_counter = 0;
922      scc68070->dma.channel[index].memory_address_counter = 0;
923      scc68070->dma.channel[index].device_address_counter = 0;
924   }
925
926   scc68070->mmu.status = 0;
927   scc68070->mmu.control = 0;
928   for(index = 0; index < 8; index++)
929   {
930      scc68070->mmu.desc[index].attr = 0;
931      scc68070->mmu.desc[index].length = 0;
932      scc68070->mmu.desc[index].segment = 0;
933      scc68070->mmu.desc[index].base = 0;
934   }
935}
936
888937#if ENABLE_UART_PRINTING
889938static READ16_HANDLER( uart_loopback_enable )
890939{
r6256r6257
896945
897946typedef struct
898947{
899   UINT16 busy_clear_countdown;
900948   UINT16 command;          // CDIC Command Register (0x303c00)
901949   UINT32 time;            // CDIC Time Register (0x303c02)
902950   UINT16 file;            // CDIC File Register (0x303c06)
r6256r6257
910958   UINT16 interrupt_vector;   // CDIC Interrupt Vector Register (0x303ffc)
911959   UINT16 data_buffer;         // CDIC Data Buffer Register (0x303ffe)
912960
913   UINT8 buffer_target;
914
915961   emu_timer *interrupt_timer;
916962   cdrom_file *cd;
917963
r6256r6257
12271273   int bits = 4;
12281274   int index = 0;
12291275   INT16 samples[18*28*16+16];
1230   FILE* temp_adpcm = fopen("temp_adpcm.bin","ab");
1276   //FILE* temp_adpcm = fopen("temp_adpcm.bin","ab");
12311277
12321278   //printf( "%02x\n", hdr[2] & 0x3f );
12331279
r6256r6257
12351281   {
12361282      // Don't play
12371283      //timer_adjust_oneshot(cdic_regs.audio_sample_timer, attotime_never, 0);
1238      fclose(temp_adpcm);
1284      //fclose(temp_adpcm);
12391285      return;
12401286   }
12411287
12421288   verboselog(machine, 0, "cdic_decode_audio_sector, got header type %02x\n", hdr[2] );
12431289
1244   fseek(temp_adpcm, 0, SEEK_END);
1290   //fseek(temp_adpcm, 0, SEEK_END);
12451291   switch(hdr[2] & 0x3f)   // ignore emphasis and reserved bits
12461292   {
12471293      case 0:
r6256r6257
13281374               cdic_decode_xa_stereo(hdr + 4, samples);
13291375               samples[18*28*8 + 0] = samples[18*28*8 + 2] = samples[18*28*8 + 4] = samples[18*28*8 + 6] = samples[18*28*8 + 8] = samples[18*28*8 + 10] = samples[18*28*8 + 12] = samples[18*28*8 + 14] = samples[18*28*8 - 2];
13301376               samples[18*28*8 + 1] = samples[18*28*8 + 3] = samples[18*28*8 + 5] = samples[18*28*8 + 7] = samples[18*28*8 + 9] = samples[18*28*8 + 11] = samples[18*28*8 + 13] = samples[18*28*8 + 15] = samples[18*28*8 - 1];
1331               fwrite(samples, 1, 18*28*4*cdic_regs.audio_sample_size, temp_adpcm);
1377               //fwrite(samples, 1, 18*28*4*cdic_regs.audio_sample_size, temp_adpcm);
13321378               break;
13331379            case 8:
13341380               cdic_decode_xa_stereo8(hdr + 4, samples);
r6256r6257
13411387
13421388    dmadac_transfer(&dmadac[0], 2, 1, 2, 18*28*2*cdic_regs.audio_sample_size, samples);
13431389
1344   fclose(temp_adpcm);
1390   //fclose(temp_adpcm);
13451391}
13461392
13471393// After an appropriate delay for decoding to take place...
r6256r6257
20172063   }
20182064}
20192065
2066static void cdic_init(running_machine *machine, cdic_regs_t *cdic)
2067{
2068   cdic->command = 0;
2069   cdic->time = 0;
2070   cdic->file = 0;
2071   cdic->channel = 0xffffffff;
2072   cdic->audio_channel = 0xffff;
2073   cdic->audio_buffer = 0;
2074   cdic->x_buffer = 0;
2075   cdic->dma_control = 0;
2076   cdic->z_buffer = 0;
2077   cdic->interrupt_vector = 0;
2078   cdic->data_buffer = 0;
2079
2080   cdic->audio_sample_freq = 0;
2081   cdic->audio_sample_size = 0;
2082}
2083
20202084typedef struct
20212085{
20222086   UINT8 out_buf[4];
r6256r6257
23942458   }
23952459}
23962460
2461static void slave_init(running_machine *machine, slave_regs_t *slave)
2462{
2463   int index = 0;
2464   for(index = 0; index < 4; index++)
2465   {
2466      slave->channel[index].out_buf[0] = 0;
2467      slave->channel[index].out_buf[1] = 0;
2468      slave->channel[index].out_buf[2] = 0;
2469      slave->channel[index].out_buf[3] = 0;
2470      slave->channel[index].out_index = 0;
2471      slave->channel[index].out_count = 0;
2472      slave->channel[index].out_cmd = 0;
2473   }
2474
2475   memset(slave->in_buf, 0, 17);
2476   slave->in_index = 0;
2477   slave->in_count = 0;
2478
2479   slave->polling_active = 0;
2480
2481   slave->xbus_interrupt_enable = 0;
2482
2483   memset(slave->lcd_state, 0, 16);
2484
2485   slave->real_mouse_x = 0;
2486   slave->real_mouse_y = 0;
2487
2488   slave->fake_mouse_x = 0;
2489   slave->fake_mouse_y = 0;
2490}
2491
23972492/*************************
23982493*     Video Hardware     *
23992494*************************/
r6256r6257
24402535   emu_timer *scan_timer;
24412536   UINT8 region_flag_0[768];
24422537   UINT8 region_flag_1[768];
2443} mcd212_t;
2538} mcd212_regs_t;
24442539
2445static mcd212_t mcd212;
2540static mcd212_regs_t mcd212_regs;
24462541
24472542#define MCD212_CURCNT_COLOR         0x00000f   // Cursor color
24482543#define MCD212_CURCNT_CUW         0x008000   // Cursor width
r6256r6257
25782673      case 0x10/2:
25792674         if(ACCESSING_BITS_0_7)
25802675         {
2581            verboselog(space->machine, 12, "mcd212_r: Status Register %d: %02x & %04x\n", channel + 1, mcd212.channel[1 - (offset / 8)].csrr, mem_mask);
2676            verboselog(space->machine, 12, "mcd212_r: Status Register %d: %02x & %04x\n", channel + 1, mcd212_regs.channel[1 - (offset / 8)].csrr, mem_mask);
25822677            if(channel == 0)
25832678            {
2584               return mcd212.channel[0].csrr;
2679               return mcd212_regs.channel[0].csrr;
25852680            }
25862681            else
25872682            {
2588               UINT8 old_csr = mcd212.channel[1].csrr;
2683               UINT8 old_csr = mcd212_regs.channel[1].csrr;
25892684               UINT8 interrupt1 = (scc68070_regs.lir >> 4) & 7;
25902685               //UINT8 interrupt2 = scc68070_regs.lir & 7;
2591               mcd212.channel[1].csrr &= ~(MCD212_CSR2R_IT1 | MCD212_CSR2R_IT2);
2686               mcd212_regs.channel[1].csrr &= ~(MCD212_CSR2R_IT1 | MCD212_CSR2R_IT2);
25922687               if(interrupt1)
25932688               {
25942689                  cputag_set_input_line(space->machine, "maincpu", M68K_IRQ_1 + (interrupt1 - 1), CLEAR_LINE);
r6256r6257
26072702         break;
26082703      case 0x02/2:
26092704      case 0x12/2:
2610         verboselog(space->machine, 2, "mcd212_r: Display Command Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212.channel[1 - (offset / 8)].dcr, mem_mask);
2611         return mcd212.channel[1 - (offset / 8)].dcr;
2705         verboselog(space->machine, 2, "mcd212_r: Display Command Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212_regs.channel[1 - (offset / 8)].dcr, mem_mask);
2706         return mcd212_regs.channel[1 - (offset / 8)].dcr;
26122707      case 0x04/2:
26132708      case 0x14/2:
2614         verboselog(space->machine, 2, "mcd212_r: Video Start Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212.channel[1 - (offset / 8)].vsr, mem_mask);
2615         return mcd212.channel[1 - (offset / 8)].vsr;
2709         verboselog(space->machine, 2, "mcd212_r: Video Start Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212_regs.channel[1 - (offset / 8)].vsr, mem_mask);
2710         return mcd212_regs.channel[1 - (offset / 8)].vsr;
26162711      case 0x08/2:
26172712      case 0x18/2:
2618         verboselog(space->machine, 2, "mcd212_r: Display Decoder Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212.channel[1 - (offset / 8)].ddr, mem_mask);
2619         return mcd212.channel[1 - (offset / 8)].ddr;
2713         verboselog(space->machine, 2, "mcd212_r: Display Decoder Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212_regs.channel[1 - (offset / 8)].ddr, mem_mask);
2714         return mcd212_regs.channel[1 - (offset / 8)].ddr;
26202715      case 0x0a/2:
26212716      case 0x1a/2:
2622         verboselog(space->machine, 2, "mcd212_r: DCA Pointer Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212.channel[1 - (offset / 8)].dcp, mem_mask);
2623         return mcd212.channel[1 - (offset / 8)].dcp;
2717         verboselog(space->machine, 2, "mcd212_r: DCA Pointer Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, mcd212_regs.channel[1 - (offset / 8)].dcp, mem_mask);
2718         return mcd212_regs.channel[1 - (offset / 8)].dcp;
26242719      default:
26252720         verboselog(space->machine, 2, "mcd212_r: Unknown Register %d & %04x\n", (1 - (offset / 8)) + 1, mem_mask);
26262721         break;
r6256r6257
26352730    attoseconds_t period = video_screen_get_frame_period(machine->primary_screen).attoseconds;
26362731   int width = 0;
26372732
2638   if((mcd212.channel[0].dcr & (MCD212_DCR_CF | MCD212_DCR_FD)) && (mcd212.channel[0].csrw & MCD212_CSR1W_ST))
2733   if((mcd212_regs.channel[0].dcr & (MCD212_DCR_CF | MCD212_DCR_FD)) && (mcd212_regs.channel[0].csrw & MCD212_CSR1W_ST))
26392734   {
26402735      width = 360;
26412736   }
r6256r6257
26562751      case 0x00/2:
26572752      case 0x10/2:
26582753         verboselog(space->machine, 2, "mcd212_w: Status Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
2659         COMBINE_DATA(&mcd212.channel[1 - (offset / 8)].csrw);
2754         COMBINE_DATA(&mcd212_regs.channel[1 - (offset / 8)].csrw);
26602755         mcd212_update_visible_area(space->machine);
26612756         break;
26622757      case 0x02/2:
26632758      case 0x12/2:
26642759         verboselog(space->machine, 2, "mcd212_w: Display Command Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
2665         COMBINE_DATA(&mcd212.channel[1 - (offset / 8)].dcr);
2760         COMBINE_DATA(&mcd212_regs.channel[1 - (offset / 8)].dcr);
26662761         mcd212_update_visible_area(space->machine);
26672762         break;
26682763      case 0x04/2:
26692764      case 0x14/2:
26702765         verboselog(space->machine, 2, "mcd212_w: Video Start Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
2671         COMBINE_DATA(&mcd212.channel[1 - (offset / 8)].vsr);
2766         COMBINE_DATA(&mcd212_regs.channel[1 - (offset / 8)].vsr);
26722767         break;
26732768      case 0x08/2:
26742769      case 0x18/2:
26752770         verboselog(space->machine, 2, "mcd212_w: Display Decoder Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
2676         COMBINE_DATA(&mcd212.channel[1 - (offset / 8)].ddr);
2771         COMBINE_DATA(&mcd212_regs.channel[1 - (offset / 8)].ddr);
26772772         break;
26782773      case 0x0a/2:
26792774      case 0x1a/2:
26802775         verboselog(space->machine, 2, "mcd212_w: DCA Pointer Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
2681         COMBINE_DATA(&mcd212.channel[1 - (offset / 8)].dcp);
2776         COMBINE_DATA(&mcd212_regs.channel[1 - (offset / 8)].dcp);
26822777         break;
26832778      default:
26842779         verboselog(space->machine, 2, "mcd212_w: Unknown Register %d: %04x & %04x\n", (1 - (offset / 8)) + 1, data, mem_mask);
r6256r6257
26982793      case 0xa8: case 0xa9: case 0xaa: case 0xab: case 0xac: case 0xad: case 0xae: case 0xaf:
26992794      case 0xb0: case 0xb1: case 0xb2: case 0xb3: case 0xb4: case 0xb5: case 0xb6: case 0xb7:
27002795      case 0xb8: case 0xb9: case 0xba: case 0xbb: case 0xbc: case 0xbd: case 0xbe: case 0xbf:
2701         verboselog(machine, 11, "          %04xxxxx: %d: CLUT[%d] = %08x\n", channel * 0x20, channel, mcd212.channel[channel].clut_bank * 0x40 + (reg - 0x80), value );
2702         mcd212.channel[0].clut_r[mcd212.channel[channel].clut_bank * 0x40 + (reg - 0x80)] = (UINT8)(value >> 16) & 0xfc;
2703         mcd212.channel[0].clut_g[mcd212.channel[channel].clut_bank * 0x40 + (reg - 0x80)] = (UINT8)(value >>  8) & 0xfc;
2704         mcd212.channel[0].clut_b[mcd212.channel[channel].clut_bank * 0x40 + (reg - 0x80)] = (UINT8)(value >>  0) & 0xfc;
2796         verboselog(machine, 11, "          %04xxxxx: %d: CLUT[%d] = %08x\n", channel * 0x20, channel, mcd212_regs.channel[channel].clut_bank * 0x40 + (reg - 0x80), value );
2797         mcd212_regs.channel[0].clut_r[mcd212_regs.channel[channel].clut_bank * 0x40 + (reg - 0x80)] = (UINT8)(value >> 16) & 0xfc;
2798         mcd212_regs.channel[0].clut_g[mcd212_regs.channel[channel].clut_bank * 0x40 + (reg - 0x80)] = (UINT8)(value >>  8) & 0xfc;
2799         mcd212_regs.channel[0].clut_b[mcd212_regs.channel[channel].clut_bank * 0x40 + (reg - 0x80)] = (UINT8)(value >>  0) & 0xfc;
27052800         break;
27062801      case 0xc0: // Image Coding Method
27072802         if(channel == 0)
27082803         {
27092804            verboselog(machine, 6, "          %04xxxxx: %d: Image Coding Method = %08x\n", channel * 0x20, channel, value );
2710            mcd212.channel[channel].image_coding_method = value;
2805            mcd212_regs.channel[channel].image_coding_method = value;
27112806         }
27122807         break;
27132808      case 0xc1: // Transparency Control
27142809         if(channel == 0)
27152810         {
27162811            verboselog(machine, 6, "          %04xxxxx: %d: Transparency Control = %08x\n", channel * 0x20, channel, value );
2717            mcd212.channel[channel].transparency_control = value;
2812            mcd212_regs.channel[channel].transparency_control = value;
27182813         }
27192814         break;
27202815      case 0xc2: // Plane Order
27212816         if(channel == 0)
27222817         {
27232818            verboselog(machine, 6, "          %04xxxxx: %d: Plane Order = %08x\n", channel * 0x20, channel, value & 7);
2724            mcd212.channel[channel].plane_order = value & 0x00000007;
2819            mcd212_regs.channel[channel].plane_order = value & 0x00000007;
27252820         }
27262821         break;
27272822      case 0xc3: // CLUT Bank Register
27282823         verboselog(machine, 6, "          %04xxxxx: %d: CLUT Bank Register = %08x\n", channel * 0x20, channel, value & 3);
2729         mcd212.channel[channel].clut_bank = channel ? (2 | (value & 0x00000001)) : (value & 0x00000003);
2824         mcd212_regs.channel[channel].clut_bank = channel ? (2 | (value & 0x00000001)) : (value & 0x00000003);
27302825         break;
27312826      case 0xc4: // Transparent Color A
27322827         if(channel == 0)
27332828         {
27342829            verboselog(machine, 6, "          %04xxxxx: %d: Transparent Color A = %08x\n", channel * 0x20, channel, value );
2735            mcd212.channel[channel].transparent_color_a = value & 0xfcfcfc;
2830            mcd212_regs.channel[channel].transparent_color_a = value & 0xfcfcfc;
27362831         }
27372832         break;
27382833      case 0xc6: // Transparent Color B
27392834         if(channel == 1)
27402835         {
27412836            verboselog(machine, 6, "          %04xxxxx: %d: Transparent Color B = %08x\n", channel * 0x20, channel, value );
2742            mcd212.channel[channel].transparent_color_b = value & 0xfcfcfc;
2837            mcd212_regs.channel[channel].transparent_color_b = value & 0xfcfcfc;
27432838         }
27442839         break;
27452840      case 0xc7: // Mask Color A
27462841         if(channel == 0)
27472842         {
27482843            verboselog(machine, 6, "          %04xxxxx: %d: Mask Color A = %08x\n", channel * 0x20, channel, value );
2749            mcd212.channel[channel].mask_color_a = value & 0xfcfcfc;
2844            mcd212_regs.channel[channel].mask_color_a = value & 0xfcfcfc;
27502845         }
27512846         break;
27522847      case 0xc9: // Mask Color B
27532848         if(channel == 1)
27542849         {
27552850            verboselog(machine, 6, "          %04xxxxx: %d: Mask Color B = %08x\n", channel * 0x20, channel, value );
2756            mcd212.channel[channel].mask_color_b = value & 0xfcfcfc;
2851            mcd212_regs.channel[channel].mask_color_b = value & 0xfcfcfc;
27572852         }
27582853         break;
27592854      case 0xca: // Delta YUV Absolute Start Value A
27602855         if(channel == 0)
27612856         {
27622857            verboselog(machine, 6, "          %04xxxxx: %d: Delta YUV Absolute Start Value A = %08x\n", channel * 0x20, channel, value );
2763            mcd212.channel[channel].dyuv_abs_start_a = value;
2858            mcd212_regs.channel[channel].dyuv_abs_start_a = value;
27642859         }
27652860         break;
27662861      case 0xcb: // Delta YUV Absolute Start Value B
27672862         if(channel == 1)
27682863         {
27692864            verboselog(machine, 6, "          %04xxxxx: %d: Delta YUV Absolute Start Value B = %08x\n", channel * 0x20, channel, value );
2770            mcd212.channel[channel].dyuv_abs_start_b = value;
2865            mcd212_regs.channel[channel].dyuv_abs_start_b = value;
27712866         }
27722867         break;
27732868      case 0xcd: // Cursor Position
27742869         if(channel == 0)
27752870         {
27762871            verboselog(machine, 6, "          %04xxxxx: %d: Cursor Position = %08x\n", channel * 0x20, channel, value );
2777            mcd212.channel[channel].cursor_position = value;
2872            mcd212_regs.channel[channel].cursor_position = value;
27782873         }
27792874         break;
27802875      case 0xce: // Cursor Control
27812876         if(channel == 0)
27822877         {
27832878            verboselog(machine, 11, "          %04xxxxx: %d: Cursor Control = %08x\n", channel * 0x20, channel, value );
2784            mcd212.channel[channel].cursor_control = value;
2879            mcd212_regs.channel[channel].cursor_control = value;
27852880         }
27862881         break;
27872882      case 0xcf: // Cursor Pattern
27882883         if(channel == 0)
27892884         {
27902885            verboselog(machine, 11, "          %04xxxxx: %d: Cursor Pattern[%d] = %04x\n", channel * 0x20, channel, (value >> 16) & 0x000f, value & 0x0000ffff);
2791            mcd212.channel[channel].cursor_pattern[(value >> 16) & 0x000f] = value & 0x0000ffff;
2886            mcd212_regs.channel[channel].cursor_pattern[(value >> 16) & 0x000f] = value & 0x0000ffff;
27922887         }
27932888         break;
27942889      case 0xd0: // Region Control 0-7
r6256r6257
28002895      case 0xd6:
28012896      case 0xd7:
28022897         verboselog(machine, 6, "          %04xxxxx: %d: Region Control %d = %08x\n", channel * 0x20, channel, reg & 7, value );
2803         mcd212.channel[0].region_control[reg & 7] = value;
2898         mcd212_regs.channel[0].region_control[reg & 7] = value;
28042899         mcd212_update_region_arrays(machine);
28052900         break;
28062901      case 0xd8: // Backdrop Color
28072902         if(channel == 0)
28082903         {
28092904            verboselog(machine, 6, "          %04xxxxx: %d: Backdrop Color = %08x\n", channel * 0x20, channel, value );
2810            mcd212.channel[channel].backdrop_color = value;
2905            mcd212_regs.channel[channel].backdrop_color = value;
28112906         }
28122907         break;
28132908      case 0xd9: // Mosaic Pixel Hold Factor A
28142909         if(channel == 0)
28152910         {
28162911            verboselog(machine, 6, "          %04xxxxx: %d: Mosaic Pixel Hold Factor A = %08x\n", channel * 0x20, channel, value );
2817            mcd212.channel[channel].mosaic_hold_a = value;
2912            mcd212_regs.channel[channel].mosaic_hold_a = value;
28182913         }
28192914         break;
28202915      case 0xda: // Mosaic Pixel Hold Factor B
28212916         if(channel == 1)
28222917         {
28232918            verboselog(machine, 6, "          %04xxxxx: %d: Mosaic Pixel Hold Factor B = %08x\n", channel * 0x20, channel, value );
2824            mcd212.channel[channel].mosaic_hold_b = value;
2919            mcd212_regs.channel[channel].mosaic_hold_b = value;
28252920         }
28262921         break;
28272922      case 0xdb: // Weight Factor A
28282923         if(channel == 0)
28292924         {
28302925            verboselog(machine, 6, "          %04xxxxx: %d: Weight Factor A = %08x\n", channel * 0x20, channel, value );
2831            memset(mcd212.channel[channel].weight_factor_a, value & 0x000000ff, 768);
2926            memset(mcd212_regs.channel[channel].weight_factor_a, value & 0x000000ff, 768);
28322927            mcd212_update_region_arrays(machine);
28332928         }
28342929         break;
r6256r6257
28362931         if(channel == 1)
28372932         {
28382933            verboselog(machine, 6, "          %04xxxxx: %d: Weight Factor B = %08x\n", channel * 0x20, channel, value );
2839            memset(mcd212.channel[channel].weight_factor_b, value & 0x000000ff, 768);
2934            memset(mcd212_regs.channel[channel].weight_factor_b, value & 0x000000ff, 768);
28402935            mcd212_update_region_arrays(machine);
28412936         }
28422937         break;
r6256r6257
28452940
28462941static void mcd212_set_vsr(int channel, UINT32 value)
28472942{
2848   mcd212.channel[channel].vsr = value & 0x0000ffff;
2849   mcd212.channel[channel].dcr &= 0xffc0;
2850   mcd212.channel[channel].dcr |= (value >> 16) & 0x003f;
2943   mcd212_regs.channel[channel].vsr = value & 0x0000ffff;
2944   mcd212_regs.channel[channel].dcr &= 0xffc0;
2945   mcd212_regs.channel[channel].dcr |= (value >> 16) & 0x003f;
28512946}
28522947
28532948static UINT32 mcd212_get_vsr(int channel)
28542949{
2855   return ((mcd212.channel[channel].dcr & 0x3f) << 16) | mcd212.channel[channel].vsr;
2950   return ((mcd212_regs.channel[channel].dcr & 0x3f) << 16) | mcd212_regs.channel[channel].vsr;
28562951}
28572952
28582953static void mcd212_set_dcp(int channel, UINT32 value)
28592954{
2860   mcd212.channel[channel].dcp = value & 0x0000ffff;
2861   mcd212.channel[channel].ddr &= 0xffc0;
2862   mcd212.channel[channel].ddr |= (value >> 16) & 0x003f;
2955   mcd212_regs.channel[channel].dcp = value & 0x0000ffff;
2956   mcd212_regs.channel[channel].ddr &= 0xffc0;
2957   mcd212_regs.channel[channel].ddr |= (value >> 16) & 0x003f;
28632958}
28642959
28652960static UINT32 mcd212_get_dcp(int channel)
28662961{
2867   return ((mcd212.channel[channel].ddr & 0x3f) << 16) | mcd212.channel[channel].dcp;
2962   return ((mcd212_regs.channel[channel].ddr & 0x3f) << 16) | mcd212_regs.channel[channel].dcp;
28682963}
28692964
28702965static void mcd212_set_display_parameters(int channel, UINT8 value)
28712966{
2872   mcd212.channel[channel].ddr &= 0xf0ff;
2873   mcd212.channel[channel].ddr |= (value & 0x0f) << 8;
2874   mcd212.channel[channel].dcr &= 0xf7ff;
2875   mcd212.channel[channel].dcr |= (value & 0x10) << 7;
2967   mcd212_regs.channel[channel].ddr &= 0xf0ff;
2968   mcd212_regs.channel[channel].ddr |= (value & 0x0f) << 8;
2969   mcd212_regs.channel[channel].dcr &= 0xf7ff;
2970   mcd212_regs.channel[channel].dcr |= (value & 0x10) << 7;
28762971}
28772972
28782973static void mcd212_process_ica(running_machine *machine, int channel)
r6256r6257
29213016         case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: // INTERRUPT
29223017         case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f:
29233018            verboselog(machine, 11, "%08x: %08x: ICA %d: INTERRUPT\n", addr * 2 + channel * 0x200000, cmd, channel );
2924            mcd212.channel[1].csrr |= 1 << (2 - channel);
2925            if(mcd212.channel[1].csrr & (MCD212_CSR2R_IT1 | MCD212_CSR2R_IT2))
3019            mcd212_regs.channel[1].csrr |= 1 << (2 - channel);
3020            if(mcd212_regs.channel[1].csrr & (MCD212_CSR2R_IT1 | MCD212_CSR2R_IT2))
29263021            {
29273022               UINT8 interrupt = (scc68070_regs.lir >> 4) & 7;
29283023               if(interrupt)
r6256r6257
29323027               }
29333028            }
29343029            /*
2935            if(mcd212.channel[1].csrr & MCD212_CSR2R_IT2)
3030            if(mcd212_regs.channel[1].csrr & MCD212_CSR2R_IT2)
29363031            {
29373032               UINT8 interrupt = scc68070_regs.lir & 7;
29383033               if(interrupt)
r6256r6257
29613056static void mcd212_process_dca(running_machine *machine, int channel)
29623057{
29633058   UINT16 *dca = channel ? planeb : planea;
2964   UINT32 addr = (mcd212.channel[channel].dca & 0x0007ffff) / 2; //(mcd212_get_dcp(channel) & 0x0007ffff) / 2; // mcd212.channel[channel].dca / 2;
3059   UINT32 addr = (mcd212_regs.channel[channel].dca & 0x0007ffff) / 2; //(mcd212_get_dcp(channel) & 0x0007ffff) / 2; // mcd212_regs.channel[channel].dca / 2;
29653060   UINT32 cmd = 0;
29663061   UINT32 count = 0;
29673062   UINT32 max = 64;
r6256r6257
30103105         case 0x60: case 0x61: case 0x62: case 0x63: case 0x64: case 0x65: case 0x66: case 0x67: // INTERRUPT
30113106         case 0x68: case 0x69: case 0x6a: case 0x6b: case 0x6c: case 0x6d: case 0x6e: case 0x6f:
30123107            verboselog(machine, 11, "%08x: %08x: DCA %d: INTERRUPT\n", addr * 2 + channel * 0x200000, cmd, channel );
3013            mcd212.channel[1].csrr |= 1 << (2 - channel);
3014            if(mcd212.channel[1].csrr & (MCD212_CSR2R_IT1 | MCD212_CSR2R_IT2))
3108            mcd212_regs.channel[1].csrr |= 1 << (2 - channel);
3109            if(mcd212_regs.channel[1].csrr & (MCD212_CSR2R_IT1 | MCD212_CSR2R_IT2))
30153110            {
30163111               UINT8 interrupt = (scc68070_regs.lir >> 4) & 7;
30173112               if(interrupt)
r6256r6257
30213116               }
30223117            }
30233118            /*
3024            if(mcd212.channel[1].csrr & MCD212_CSR2R_IT2)
3119            if(mcd212_regs.channel[1].csrr & MCD212_CSR2R_IT2)
30253120            {
30263121               UINT8 interrupt = scc68070_regs.lir & 7;
30273122               if(interrupt)
r6256r6257
30523147         addr += (max - count) >> 1;
30533148      }
30543149   }
3055   mcd212.channel[channel].dca = addr * 2;
3150   mcd212_regs.channel[channel].dca = addr * 2;
30563151}
30573152
30583153typedef UINT8 BYTE68K;
r6256r6257
31433238
31443239   int latched_rf0 = 0;
31453240   int latched_rf1 = 0;
3146   int latched_wfa = mcd212.channel[0].weight_factor_a[0];
3147   int latched_wfb = mcd212.channel[1].weight_factor_b[0];
3241   int latched_wfa = mcd212_regs.channel[0].weight_factor_a[0];
3242   int latched_wfb = mcd212_regs.channel[1].weight_factor_b[0];
31483243   int reg = 0;
31493244   for(x = 0; x < 768; x++)
31503245   {
3151      if(mcd212.channel[0].image_coding_method & MCD212_ICM_NR)
3246      if(mcd212_regs.channel[0].image_coding_method & MCD212_ICM_NR)
31523247      {
31533248         int reg = 0;
31543249         int flag = 0;
r6256r6257
31573252         {
31583253            for(reg = 0; reg < 4; reg++)
31593254            {
3160               if(mcd212.channel[0].region_control[reg] == 0)
3255               if(mcd212_regs.channel[0].region_control[reg] == 0)
31613256               {
31623257                  break;
31633258               }
3164               if(x == (mcd212.channel[0].region_control[flag*4 + reg] & MCD212_RC_X))
3259               if(x == (mcd212_regs.channel[0].region_control[flag*4 + reg] & MCD212_RC_X))
31653260               {
3166                  switch((mcd212.channel[0].region_control[flag*4 + reg] & MCD212_RC_OP) >> MCD212_RC_OP_SHIFT)
3261                  switch((mcd212_regs.channel[0].region_control[flag*4 + reg] & MCD212_RC_OP) >> MCD212_RC_OP_SHIFT)
31673262                  {
31683263                     case 0: // End of region control for line
31693264                        break;
r6256r6257
31723267                     case 3: // Not used
31733268                        break;
31743269                     case 4: // Change weight of plane A
3175                        latched_wfa = (mcd212.channel[0].region_control[flag*4 + reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
3270                        latched_wfa = (mcd212_regs.channel[0].region_control[flag*4 + reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
31763271                        break;
31773272                     case 5:   // Not used
31783273                        break;
31793274                     case 6: // Change weight of plane B
3180                        latched_wfb = (mcd212.channel[0].region_control[flag*4 + reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
3275                        latched_wfb = (mcd212_regs.channel[0].region_control[flag*4 + reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
31813276                        break;
31823277                     case 7:   // Not used
31833278                        break;
r6256r6257
32053300                     case 11:   // Not used
32063301                        break;
32073302                     case 12: // Reset region flag and change weight of plane A
3208                        latched_wfa = (mcd212.channel[0].region_control[flag*4 + reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
3303                        latched_wfa = (mcd212_regs.channel[0].region_control[flag*4 + reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
32093304                        if(flag)
32103305                        {
32113306                           latched_rf1 = 0;
r6256r6257
32163311                        }
32173312                        break;
32183313                     case 13: // Set region flag and change weight of plane A
3219                        latched_wfa = (mcd212.channel[0].region_control[flag*4 + reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
3314                        latched_wfa = (mcd212_regs.channel[0].region_control[flag*4 + reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
32203315                        if(flag)
32213316                        {
32223317                           latched_rf1 = 1;
r6256r6257
32273322                        }
32283323                        break;
32293324                     case 14: // Reset region flag and change weight of plane B
3230                        latched_wfb = (mcd212.channel[0].region_control[flag*4 + reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
3325                        latched_wfb = (mcd212_regs.channel[0].region_control[flag*4 + reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
32313326                        if(flag)
32323327                        {
32333328                           latched_rf1 = 0;
r6256r6257
32383333                        }
32393334                        break;
32403335                     case 15: // Set region flag and change weight of plane B
3241                        latched_wfb = (mcd212.channel[0].region_control[flag*4 + reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
3336                        latched_wfb = (mcd212_regs.channel[0].region_control[flag*4 + reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
32423337                        if(flag)
32433338                        {
32443339                           latched_rf1 = 1;
r6256r6257
32573352      {
32583353         if(reg < 8)
32593354         {
3260            int flag = (mcd212.channel[0].region_control[reg] & MCD212_RC_RF) >> MCD212_RC_RF_SHIFT;
3261            if(!(mcd212.channel[0].region_control[reg] & MCD212_RC_OP))
3355            int flag = (mcd212_regs.channel[0].region_control[reg] & MCD212_RC_RF) >> MCD212_RC_RF_SHIFT;
3356            if(!(mcd212_regs.channel[0].region_control[reg] & MCD212_RC_OP))
32623357            {
32633358               for(; x < 768; x++)
32643359               {
3265                  mcd212.channel[0].weight_factor_a[x] = latched_wfa;
3266                  mcd212.channel[1].weight_factor_b[x] = latched_wfb;
3267                  mcd212.region_flag_0[x] = latched_rf0;
3268                  mcd212.region_flag_1[x] = latched_rf1;
3360                  mcd212_regs.channel[0].weight_factor_a[x] = latched_wfa;
3361                  mcd212_regs.channel[1].weight_factor_b[x] = latched_wfb;
3362                  mcd212_regs.region_flag_0[x] = latched_rf0;
3363                  mcd212_regs.region_flag_1[x] = latched_rf1;
32693364               }
32703365               break;
32713366            }
3272            if(x == (mcd212.channel[0].region_control[reg] & MCD212_RC_X))
3367            if(x == (mcd212_regs.channel[0].region_control[reg] & MCD212_RC_X))
32733368            {
3274               switch((mcd212.channel[0].region_control[reg] & MCD212_RC_OP) >> MCD212_RC_OP_SHIFT)
3369               switch((mcd212_regs.channel[0].region_control[reg] & MCD212_RC_OP) >> MCD212_RC_OP_SHIFT)
32753370               {
32763371                  case 0: // End of region control for line
32773372                     break;
r6256r6257
32803375                  case 3: // Not used
32813376                     break;
32823377                  case 4: // Change weight of plane A
3283                     latched_wfa = (mcd212.channel[0].region_control[reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
3378                     latched_wfa = (mcd212_regs.channel[0].region_control[reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
32843379                     break;
32853380                  case 5:   // Not used
32863381                     break;
32873382                  case 6: // Change weight of plane B
3288                     latched_wfb = (mcd212.channel[0].region_control[reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
3383                     latched_wfb = (mcd212_regs.channel[0].region_control[reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
32893384                     break;
32903385                  case 7:   // Not used
32913386                     break;
r6256r6257
33133408                  case 11:   // Not used
33143409                     break;
33153410                  case 12: // Reset region flag and change weight of plane A
3316                     latched_wfa = (mcd212.channel[0].region_control[reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
3411                     latched_wfa = (mcd212_regs.channel[0].region_control[reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
33173412                     if(flag)
33183413                     {
33193414                        latched_rf1 = 0;
r6256r6257
33243419                     }
33253420                     break;
33263421                  case 13: // Set region flag and change weight of plane A
3327                     latched_wfa = (mcd212.channel[0].region_control[reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
3422                     latched_wfa = (mcd212_regs.channel[0].region_control[reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
33283423                     if(flag)
33293424                     {
33303425                        latched_rf1 = 1;
r6256r6257
33353430                     }
33363431                     break;
33373432                  case 14: // Reset region flag and change weight of plane B
3338                     latched_wfb = (mcd212.channel[0].region_control[reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
3433                     latched_wfb = (mcd212_regs.channel[0].region_control[reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
33393434                     if(flag)
33403435                     {
33413436                        latched_rf1 = 0;
r6256r6257
33463441                     }
33473442                     break;
33483443                  case 15: // Set region flag and change weight of plane B
3349                     latched_wfb = (mcd212.channel[0].region_control[reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
3444                     latched_wfb = (mcd212_regs.channel[0].region_control[reg] & MCD212_RC_WF) >> MCD212_RC_WF_SHIFT;
33503445                     if(flag)
33513446                     {
33523447                        latched_rf1 = 1;
r6256r6257
33613456            }
33623457         }
33633458      }
3364      mcd212.channel[0].weight_factor_a[x] = latched_wfa;
3365      mcd212.channel[1].weight_factor_b[x] = latched_wfb;
3366      mcd212.region_flag_0[x] = latched_rf0;
3367      mcd212.region_flag_1[x] = latched_rf1;
3459      mcd212_regs.channel[0].weight_factor_a[x] = latched_wfa;
3460      mcd212_regs.channel[1].weight_factor_b[x] = latched_wfb;
3461      mcd212_regs.region_flag_0[x] = latched_rf0;
3462      mcd212_regs.region_flag_1[x] = latched_rf1;
33683463   }
33693464}
33703465
33713466static int mcd212_get_screen_width(running_machine *machine)
33723467{
3373   if((mcd212.channel[0].dcr & (MCD212_DCR_CF | MCD212_DCR_FD)) && (mcd212.channel[0].csrw & MCD212_CSR1W_ST))
3468   if((mcd212_regs.channel[0].dcr & (MCD212_DCR_CF | MCD212_DCR_FD)) && (mcd212_regs.channel[0].csrw & MCD212_CSR1W_ST))
33743469   {
33753470      return 720;
33763471   }
r6256r6257
33853480   int x = 0;
33863481   UINT32 icm_mask = channel ? MCD212_ICM_MODE2 : MCD212_ICM_MODE1;
33873482   UINT32 icm_shift = channel ? MCD212_ICM_MODE2_SHIFT : MCD212_ICM_MODE1_SHIFT;
3388   UINT8 icm = (mcd212.channel[0].image_coding_method & icm_mask) >> icm_shift;
3389   UINT8 *clut_r = mcd212.channel[0].clut_r;
3390   UINT8 *clut_g = mcd212.channel[0].clut_g;
3391   UINT8 *clut_b = mcd212.channel[0].clut_b;
3392   UINT8 mosaic_enable = ((mcd212.channel[channel].ddr & MCD212_DDR_FT) == MCD212_DDR_FT_MOSAIC);
3393   UINT8 mosaic_factor = 1 << (((mcd212.channel[channel].ddr & MCD212_DDR_MT) >> MCD212_DDR_MT_SHIFT) + 1);
3483   UINT8 icm = (mcd212_regs.channel[0].image_coding_method & icm_mask) >> icm_shift;
3484   UINT8 *clut_r = mcd212_regs.channel[0].clut_r;
3485   UINT8 *clut_g = mcd212_regs.channel[0].clut_g;
3486   UINT8 *clut_b = mcd212_regs.channel[0].clut_b;
3487   UINT8 mosaic_enable = ((mcd212_regs.channel[channel].ddr & MCD212_DDR_FT) == MCD212_DDR_FT_MOSAIC);
3488   UINT8 mosaic_factor = 1 << (((mcd212_regs.channel[channel].ddr & MCD212_DDR_MT) >> MCD212_DDR_MT_SHIFT) + 1);
33943489   int mosaic_index = 0;
33953490   int width = mcd212_get_screen_width(machine);
33963491
r6256r6257
34093504   {
34103505      UINT8 byte = data[(vsr & 0x0007ffff) ^ 1];
34113506      vsr++;
3412      switch(mcd212.channel[channel].ddr & MCD212_DDR_FT)
3507      switch(mcd212_regs.channel[channel].ddr & MCD212_DDR_FT)
34133508      {
34143509         case MCD212_DDR_FT_BMP:
34153510         case MCD212_DDR_FT_BMP2:
34163511         case MCD212_DDR_FT_MOSAIC:
3417            if(mcd212.channel[channel].dcr & MCD212_DCR_CM)
3512            if(mcd212_regs.channel[channel].dcr & MCD212_DCR_CM)
34183513            {
34193514               // 4-bit Bitmap
34203515               verboselog(machine, 0, "Unsupported display mode: 4-bit Bitmap\n" );
r6256r6257
34303525                  switch(channel)
34313526                  {
34323527                     case 0:
3433                        bY = (mcd212.channel[0].dyuv_abs_start_a >> 16) & 0x000000ff;
3434                        bU = (mcd212.channel[0].dyuv_abs_start_a >>  8) & 0x000000ff;
3435                        bV = (mcd212.channel[0].dyuv_abs_start_a >>  0) & 0x000000ff;
3528                        bY = (mcd212_regs.channel[0].dyuv_abs_start_a >> 16) & 0x000000ff;
3529                        bU = (mcd212_regs.channel[0].dyuv_abs_start_a >>  8) & 0x000000ff;
3530                        bV = (mcd212_regs.channel[0].dyuv_abs_start_a >>  0) & 0x000000ff;
34363531                        break;
34373532                     case 1:
3438                        bY = (mcd212.channel[1].dyuv_abs_start_b >> 16) & 0x000000ff;
3439                        bU = (mcd212.channel[1].dyuv_abs_start_b >>  8) & 0x000000ff;
3440                        bV = (mcd212.channel[1].dyuv_abs_start_b >>  0) & 0x000000ff;
3533                        bY = (mcd212_regs.channel[1].dyuv_abs_start_b >> 16) & 0x000000ff;
3534                        bU = (mcd212_regs.channel[1].dyuv_abs_start_b >>  8) & 0x000000ff;
3535                        bV = (mcd212_regs.channel[1].dyuv_abs_start_b >>  0) & 0x000000ff;
34413536                        break;
34423537                     default:
34433538                        bY = bU = bV = 0x80;
r6256r6257
35963691            done = 1;
35973692            break;
35983693         case MCD212_DDR_FT_RLE:
3599            if(mcd212.channel[channel].dcr & MCD212_DCR_CM)
3694            if(mcd212_regs.channel[channel].dcr & MCD212_DCR_CM)
36003695            {
36013696               verboselog(machine, 0, "Unsupported display mode: 4-bit RLE\n" );
36023697               done = 1;
r6256r6257
36863781
36873782static void mcd212_draw_cursor(running_machine *machine, UINT32 *scanline, int y)
36883783{
3689   if(mcd212.channel[0].cursor_control & MCD212_CURCNT_EN)
3784   if(mcd212_regs.channel[0].cursor_control & MCD212_CURCNT_EN)
36903785   {
3691      UINT16 curx =  mcd212.channel[0].cursor_position        & 0x3ff;
3692      UINT16 cury = ((mcd212.channel[0].cursor_position >> 12) & 0x3ff) + 22;
3786      UINT16 curx =  mcd212_regs.channel[0].cursor_position        & 0x3ff;
3787      UINT16 cury = ((mcd212_regs.channel[0].cursor_position >> 12) & 0x3ff) + 22;
36933788      UINT32 x = 0;
36943789      if(y >= cury && y < (cury + 16))
36953790      {
3696         UINT32 color = mcd212_4bpp_color[mcd212.channel[0].cursor_control & MCD212_CURCNT_COLOR];
3791         UINT32 color = mcd212_4bpp_color[mcd212_regs.channel[0].cursor_control & MCD212_CURCNT_COLOR];
36973792         y -= cury;
3698         if(mcd212.channel[0].cursor_control & MCD212_CURCNT_CUW)
3793         if(mcd212_regs.channel[0].cursor_control & MCD212_CURCNT_CUW)
36993794         {
37003795            for(x = curx; x < curx + 64 && x < 768; x++)
37013796            {
3702               if(mcd212.channel[0].cursor_pattern[y] & (1 << (15 - ((x - curx) >> 2))))
3797               if(mcd212_regs.channel[0].cursor_pattern[y] & (1 << (15 - ((x - curx) >> 2))))
37033798               {
37043799                  scanline[(x++)/2] = color;
37053800                  scanline[(x++)/2] = color;
r6256r6257
37153810         {
37163811            for(x = curx; x < curx + 32 && x < 768; x++)
37173812            {
3718               if(mcd212.channel[0].cursor_pattern[y] & (1 << (15 - ((x - curx) >> 1))))
3813               if(mcd212_regs.channel[0].cursor_pattern[y] & (1 << (15 - ((x - curx) >> 1))))
37193814               {
37203815                  scanline[(x++)/2] = color;
37213816                  scanline[x/2] = color;
r6256r6257
37323827static void mcd212_mix_lines(running_machine *machine, UINT8 *plane_a_r, UINT8 *plane_a_g, UINT8 *plane_a_b, UINT8 *plane_b_r, UINT8 *plane_b_g, UINT8 *plane_b_b, UINT32 *out)
37333828{
37343829   int x = 0;
3735   UINT32 backdrop = mcd212_4bpp_color[mcd212.channel[0].backdrop_color];
3736   UINT8 transparency_mode_a = (mcd212.channel[0].transparency_control >> 0) & 0x0f;
3737   UINT8 transparency_mode_b = (mcd212.channel[0].transparency_control >> 8) & 0x0f;
3738   UINT8 transparent_color_a_r = (UINT8)(mcd212.channel[0].transparent_color_a >> 16);
3739   UINT8 transparent_color_a_g = (UINT8)(mcd212.channel[0].transparent_color_a >>  8);
3740   UINT8 transparent_color_a_b = (UINT8)(mcd212.channel[0].transparent_color_a >>  0);
3741   UINT8 transparent_color_b_r = (UINT8)(mcd212.channel[1].transparent_color_b >> 16);
3742   UINT8 transparent_color_b_g = (UINT8)(mcd212.channel[1].transparent_color_b >>  8);
3743   UINT8 transparent_color_b_b = (UINT8)(mcd212.channel[1].transparent_color_b >>  0);
3744   UINT8 image_coding_method_a = mcd212.channel[0].image_coding_method & 0x0000000f;
3745   UINT8 image_coding_method_b = (mcd212.channel[0].image_coding_method >> 8) & 0x0000000f;
3830   UINT32 backdrop = mcd212_4bpp_color[mcd212_regs.channel[0].backdrop_color];
3831   UINT8 transparency_mode_a = (mcd212_regs.channel[0].transparency_control >> 0) & 0x0f;
3832   UINT8 transparency_mode_b = (mcd212_regs.channel[0].transparency_control >> 8) & 0x0f;
3833   UINT8 transparent_color_a_r = (UINT8)(mcd212_regs.channel[0].transparent_color_a >> 16);
3834   UINT8 transparent_color_a_g = (UINT8)(mcd212_regs.channel[0].transparent_color_a >>  8);
3835   UINT8 transparent_color_a_b = (UINT8)(mcd212_regs.channel[0].transparent_color_a >>  0);
3836   UINT8 transparent_color_b_r = (UINT8)(mcd212_regs.channel[1].transparent_color_b >> 16);
3837   UINT8 transparent_color_b_g = (UINT8)(mcd212_regs.channel[1].transparent_color_b >>  8);
3838   UINT8 transparent_color_b_b = (UINT8)(mcd212_regs.channel[1].transparent_color_b >>  0);
3839   UINT8 image_coding_method_a = mcd212_regs.channel[0].image_coding_method & 0x0000000f;
3840   UINT8 image_coding_method_b = (mcd212_regs.channel[0].image_coding_method >> 8) & 0x0000000f;
37463841   UINT8 dyuv_enable_a = (image_coding_method_a == 5);
37473842   UINT8 dyuv_enable_b = (image_coding_method_b == 5);
3748   UINT8 mosaic_enable_a = (mcd212.channel[0].mosaic_hold_a & 0x800000) >> 23;
3749   UINT8 mosaic_enable_b = (mcd212.channel[1].mosaic_hold_b & 0x800000) >> 23;
3750   UINT8 mosaic_count_a = (mcd212.channel[0].mosaic_hold_a & 0x0000ff) << 1;
3751   UINT8 mosaic_count_b = (mcd212.channel[1].mosaic_hold_b & 0x0000ff) << 1;
3843   UINT8 mosaic_enable_a = (mcd212_regs.channel[0].mosaic_hold_a & 0x800000) >> 23;
3844   UINT8 mosaic_enable_b = (mcd212_regs.channel[1].mosaic_hold_b & 0x800000) >> 23;
3845   UINT8 mosaic_count_a = (mcd212_regs.channel[0].mosaic_hold_a & 0x0000ff) << 1;
3846   UINT8 mosaic_count_b = (mcd212_regs.channel[1].mosaic_hold_b & 0x0000ff) << 1;
37523847   for(x = 0; x < 768; x++)
37533848   {
37543849      out[x] = backdrop;
3755      if(!(mcd212.channel[0].transparency_control & MCD212_TCR_DISABLE_MX))
3850      if(!(mcd212_regs.channel[0].transparency_control & MCD212_TCR_DISABLE_MX))
37563851      {
3757         UINT8 abr = MCD212_LIM(((MCD212_LIM((INT32)plane_a_r[x] - 16) * mcd212.channel[0].weight_factor_a[x]) >> 6) + ((MCD212_LIM((INT32)plane_b_r[x] - 16) * mcd212.channel[1].weight_factor_b[x]) >> 6) + 16);
3758         UINT8 abg = MCD212_LIM(((MCD212_LIM((INT32)plane_a_g[x] - 16) * mcd212.channel[0].weight_factor_a[x]) >> 6) + ((MCD212_LIM((INT32)plane_b_g[x] - 16) * mcd212.channel[1].weight_factor_b[x]) >> 6) + 16);
3759         UINT8 abb = MCD212_LIM(((MCD212_LIM((INT32)plane_a_b[x] - 16) * mcd212.channel[0].weight_factor_a[x]) >> 6) + ((MCD212_LIM((INT32)plane_b_b[x] - 16) * mcd212.channel[1].weight_factor_b[x]) >> 6) + 16);
3852         UINT8 abr = MCD212_LIM(((MCD212_LIM((INT32)plane_a_r[x] - 16) * mcd212_regs.channel[0].weight_factor_a[x]) >> 6) + ((MCD212_LIM((INT32)plane_b_r[x] - 16) * mcd212_regs.channel[1].weight_factor_b[x]) >> 6) + 16);
3853         UINT8 abg = MCD212_LIM(((MCD212_LIM((INT32)plane_a_g[x] - 16) * mcd212_regs.channel[0].weight_factor_a[x]) >> 6) + ((MCD212_LIM((INT32)plane_b_g[x] - 16) * mcd212_regs.channel[1].weight_factor_b[x]) >> 6) + 16);
3854         UINT8 abb = MCD212_LIM(((MCD212_LIM((INT32)plane_a_b[x] - 16) * mcd212_regs.channel[0].weight_factor_a[x]) >> 6) + ((MCD212_LIM((INT32)plane_b_b[x] - 16) * mcd212_regs.channel[1].weight_factor_b[x]) >> 6) + 16);
37603855         out[x] = (abr << 16) | (abg << 8) | abb;
37613856      }
37623857      else
r6256r6257
37783873               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);
37793874               break;
37803875            case 3:
3781               plane_enable_a = !mcd212.region_flag_0[x];
3876               plane_enable_a = !mcd212_regs.region_flag_0[x];
37823877               break;
37833878            case 4:
3784               plane_enable_a = !mcd212.region_flag_1[x];
3879               plane_enable_a = !mcd212_regs.region_flag_1[x];
37853880               break;
37863881            case 5:
3787               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) && (dyuv_enable_a || mcd212.region_flag_0[x] == 0);
3882               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) && (dyuv_enable_a || mcd212_regs.region_flag_0[x] == 0);
37883883               break;
37893884            case 6:
3790               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) && (dyuv_enable_a || mcd212.region_flag_1[x] == 0);
3885               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) && (dyuv_enable_a || mcd212_regs.region_flag_1[x] == 0);
37913886               break;
37923887            case 8:
37933888               plane_enable_a = 1;
r6256r6257
37963891               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);
37973892               break;
37983893            case 11:
3799               plane_enable_a = mcd212.region_flag_0[x];
3894               plane_enable_a = mcd212_regs.region_flag_0[x];
38003895               break;
38013896            case 12:
3802               plane_enable_a = mcd212.region_flag_1[x];
3897               plane_enable_a = mcd212_regs.region_flag_1[x];
38033898               break;
38043899            case 13:
3805               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) || dyuv_enable_a || mcd212.region_flag_0[x] == 1;
3900               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) || dyuv_enable_a || mcd212_regs.region_flag_0[x] == 1;
38063901               break;
38073902            case 14:
3808               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) || dyuv_enable_a || mcd212.region_flag_1[x] == 1;
3903               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) || dyuv_enable_a || mcd212_regs.region_flag_1[x] == 1;
38093904               break;
38103905            default:
38113906               verboselog(machine, 0, "Unhandled transparency mode for plane A: %d\n", transparency_mode_a);
r6256r6257
38213916               plane_enable_b = (plane_b_r_cur != transparent_color_b_r || plane_b_g_cur != transparent_color_b_g || plane_b_b_cur != transparent_color_b_b);
38223917               break;
38233918            case 3:
3824               plane_enable_b = !mcd212.region_flag_0[x];
3919               plane_enable_b = !mcd212_regs.region_flag_0[x];
38253920               break;
38263921            case 4:
3827               plane_enable_b = !mcd212.region_flag_1[x];
3922               plane_enable_b = !mcd212_regs.region_flag_1[x];
38283923               break;
38293924            case 5:
3830               plane_enable_b = (plane_b_r_cur != transparent_color_b_r || plane_b_g_cur != transparent_color_b_g || plane_b_b_cur != transparent_color_b_b) && (dyuv_enable_b || mcd212.region_flag_0[x] == 0);
3925               plane_enable_b = (plane_b_r_cur != transparent_color_b_r || plane_b_g_cur != transparent_color_b_g || plane_b_b_cur != transparent_color_b_b) && (dyuv_enable_b || mcd212_regs.region_flag_0[x] == 0);
38313926               break;
38323927            case 6:
3833               plane_enable_b = (plane_b_r_cur != transparent_color_b_r || plane_b_g_cur != transparent_color_b_g || plane_b_b_cur != transparent_color_b_b) && (dyuv_enable_b || mcd212.region_flag_1[x] == 0);
3928               plane_enable_b = (plane_b_r_cur != transparent_color_b_r || plane_b_g_cur != transparent_color_b_g || plane_b_b_cur != transparent_color_b_b) && (dyuv_enable_b || mcd212_regs.region_flag_1[x] == 0);
38343929               break;
38353930            case 8:
38363931               plane_enable_b = 1;
r6256r6257
38393934               plane_enable_b = (plane_b_r_cur == transparent_color_b_r && plane_b_g_cur == transparent_color_b_g && plane_b_b_cur == transparent_color_b_b);
38403935               break;
38413936            case 11:
3842               plane_enable_b = mcd212.region_flag_0[x];
3937               plane_enable_b = mcd212_regs.region_flag_0[x];
38433938               break;
38443939            case 12:
3845               plane_enable_b = mcd212.region_flag_1[x];
3940               plane_enable_b = mcd212_regs.region_flag_1[x];
38463941               break;
38473942            case 13:
3848               plane_enable_b = (plane_b_r_cur == transparent_color_b_r && plane_b_g_cur == transparent_color_b_g && plane_b_b_cur == transparent_color_b_b) || dyuv_enable_b || mcd212.region_flag_0[x] == 1;
3943               plane_enable_b = (plane_b_r_cur == transparent_color_b_r && plane_b_g_cur == transparent_color_b_g && plane_b_b_cur == transparent_color_b_b) || dyuv_enable_b || mcd212_regs.region_flag_0[x] == 1;
38493944               break;
38503945            case 14:
3851               plane_enable_b = (plane_b_r_cur == transparent_color_b_r && plane_b_g_cur == transparent_color_b_g && plane_b_b_cur == transparent_color_b_b) || dyuv_enable_b || mcd212.region_flag_1[x] == 1;
3946               plane_enable_b = (plane_b_r_cur == transparent_color_b_r && plane_b_g_cur == transparent_color_b_g && plane_b_b_cur == transparent_color_b_b) || dyuv_enable_b || mcd212_regs.region_flag_1[x] == 1;
38523947               break;
38533948            default:
38543949               verboselog(machine, 0, "Unhandled transparency mode for plane B: %d\n", transparency_mode_b);
38553950               plane_enable_b = 1;
38563951               break;
38573952         }
3858         plane_a_r_cur = MCD212_LIM(((MCD212_LIM((INT32)plane_a_r_cur - 16) * mcd212.channel[0].weight_factor_a[x]) >> 6) + 16);
3859         plane_a_g_cur = MCD212_LIM(((MCD212_LIM((INT32)plane_a_g_cur - 16) * mcd212.channel[0].weight_factor_a[x]) >> 6) + 16);
3860         plane_a_b_cur = MCD212_LIM(((MCD212_LIM((INT32)plane_a_b_cur - 16) * mcd212.channel[0].weight_factor_a[x]) >> 6) + 16);
3861         plane_b_r_cur = MCD212_LIM(((MCD212_LIM((INT32)plane_b_r_cur - 16) * mcd212.channel[1].weight_factor_b[x]) >> 6) + 16);
3862         plane_b_g_cur = MCD212_LIM(((MCD212_LIM((INT32)plane_b_g_cur - 16) * mcd212.channel[1].weight_factor_b[x]) >> 6) + 16);
3863         plane_b_b_cur = MCD212_LIM(((MCD212_LIM((INT32)plane_b_b_cur - 16) * mcd212.channel[1].weight_factor_b[x]) >> 6) + 16);
3864         switch(mcd212.channel[0].plane_order)
3953         plane_a_r_cur = MCD212_LIM(((MCD212_LIM((INT32)plane_a_r_cur - 16) * mcd212_regs.channel[0].weight_factor_a[x]) >> 6) + 16);
3954         plane_a_g_cur = MCD212_LIM(((MCD212_LIM((INT32)plane_a_g_cur - 16) * mcd212_regs.channel[0].weight_factor_a[x]) >> 6) + 16);
3955         plane_a_b_cur = MCD212_LIM(((MCD212_LIM((INT32)plane_a_b_cur - 16) * mcd212_regs.channel[0].weight_factor_a[x]) >> 6) + 16);
3956         plane_b_r_cur = MCD212_LIM(((MCD212_LIM((INT32)plane_b_r_cur - 16) * mcd212_regs.channel[1].weight_factor_b[x]) >> 6) + 16);
3957         plane_b_g_cur = MCD212_LIM(((MCD212_LIM((INT32)plane_b_g_cur - 16) * mcd212_regs.channel[1].weight_factor_b[x]) >> 6) + 16);
3958         plane_b_b_cur = MCD212_LIM(((MCD212_LIM((INT32)plane_b_b_cur - 16) * mcd212_regs.channel[1].weight_factor_b[x]) >> 6) + 16);
3959         switch(mcd212_regs.channel[0].plane_order)
38653960         {
38663961            case MCD212_POR_AB:
38673962               if(plane_enable_a)
r6256r6257
39114006static TIMER_CALLBACK( mcd212_perform_scan )
39124007{
39134008   int scanline = video_screen_get_vpos(machine->primary_screen);
3914   if(/*mcd212.channel[0].dcr & MCD212_DCR_DE*/1)
4009   if(/*mcd212_regs.channel[0].dcr & MCD212_DCR_DE*/1)
39154010   {
39164011      if(scanline == 0)
39174012      {
39184013         // Process ICA
39194014         int index = 0;
39204015         verboselog(machine, 6, "Frame Start\n" );
3921         mcd212.channel[0].csrr &= 0x7f;
4016         mcd212_regs.channel[0].csrr &= 0x7f;
39224017         for(index = 0; index < 2; index++)
39234018         {
3924            if(mcd212.channel[index].dcr & MCD212_DCR_ICA)
4019            if(mcd212_regs.channel[index].dcr & MCD212_DCR_ICA)
39254020            {
39264021               mcd212_process_ica(machine, index);
39274022            }
r6256r6257
39354030      else if(scanline >= 22)
39364031      {
39374032         int index = 0;
3938         mcd212.channel[0].csrr |= 0x80;
4033         mcd212_regs.channel[0].csrr |= 0x80;
39394034         // Process VSR
39404035         mcd212_draw_scanline(machine, scanline);
39414036         // Process DCA
39424037         for(index = 0; index < 2; index++)
39434038         {
3944            if(mcd212.channel[index].dcr & MCD212_DCR_DCA)
4039            if(mcd212_regs.channel[index].dcr & MCD212_DCR_DCA)
39454040            {
39464041               if(scanline == 22)
39474042               {
3948                  mcd212.channel[index].dca = mcd212_get_dcp(index);
4043                  mcd212_regs.channel[index].dca = mcd212_get_dcp(index);
39494044               }
39504045               mcd212_process_dca(machine, index);
39514046            }
39524047         }
39534048         if(scanline == 261)
39544049         {
3955            mcd212.channel[0].csrr ^= 0x20;
4050            mcd212_regs.channel[0].csrr ^= 0x20;
39564051         }
39574052      }
39584053   }
3959   timer_adjust_oneshot(mcd212.scan_timer, video_screen_get_time_until_pos(machine->primary_screen, ( scanline + 1 ) % 262, 0), 0);
4054   timer_adjust_oneshot(mcd212_regs.scan_timer, video_screen_get_time_until_pos(machine->primary_screen, ( scanline + 1 ) % 262, 0), 0);
39604055}
39614056
4057static void mcd212_init(running_machine *machine, mcd212_regs_t *mcd212)
4058{
4059   int index = 0;
4060   for(index = 0; index < 2; index++)
4061   {
4062      mcd212->channel[index].csrr = 0;
4063      mcd212->channel[index].csrw = 0;
4064      mcd212->channel[index].dcr = 0;
4065      mcd212->channel[index].vsr = 0;
4066      mcd212->channel[index].ddr = 0;
4067      mcd212->channel[index].dcp = 0;
4068      mcd212->channel[index].dca = 0;
4069      memset(mcd212->channel[index].clut_r, 0, 768);
4070      memset(mcd212->channel[index].clut_g, 0, 768);
4071      memset(mcd212->channel[index].clut_b, 0, 768);
4072      mcd212->channel[index].image_coding_method = 0;
4073      mcd212->channel[index].transparency_control = 0;
4074      mcd212->channel[index].plane_order = 0;
4075      mcd212->channel[index].clut_bank = 0;
4076      mcd212->channel[index].transparent_color_a = 0;
4077      mcd212->channel[index].transparent_color_b = 0;
4078      mcd212->channel[index].mask_color_a = 0;
4079      mcd212->channel[index].mask_color_b = 0;
4080      mcd212->channel[index].dyuv_abs_start_a = 0;
4081      mcd212->channel[index].dyuv_abs_start_b = 0;
4082      mcd212->channel[index].cursor_position = 0;
4083      mcd212->channel[index].cursor_control = 0;
4084      memset((UINT8*)&mcd212->channel[index].cursor_pattern, 0, 16 * sizeof(UINT32));
4085      memset((UINT8*)&mcd212->channel[index].region_control, 0, 8 * sizeof(UINT32));
4086      mcd212->channel[index].backdrop_color = 0;
4087      mcd212->channel[index].mosaic_hold_a = 0;
4088      mcd212->channel[index].mosaic_hold_b = 0;
4089      memset(mcd212->channel[index].weight_factor_a, 0, 768);
4090      memset(mcd212->channel[index].weight_factor_b, 0, 768);
4091   }
4092   memset(mcd212->region_flag_0, 0, 768);
4093   memset(mcd212->region_flag_1, 0, 768);
4094}
4095
39624096static VIDEO_START(cdi)
39634097{
39644098   WORD68K w = 0;
r6256r6257
39934127   }
39944128
39954129   VIDEO_START_CALL(generic_bitmapped);
3996   mcd212.channel[0].csrr = 0x00;
3997   mcd212.channel[1].csrr = 0x00;
3998   mcd212.channel[0].clut_bank = 0;
3999   mcd212.channel[1].clut_bank = 0;
4000   mcd212.scan_timer = timer_alloc(machine, mcd212_perform_scan, 0);
4001   timer_adjust_oneshot(mcd212.scan_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), 0);
4130   mcd212_init(machine, &mcd212_regs);
4131   mcd212_regs.scan_timer = timer_alloc(machine, mcd212_perform_scan, 0);
4132   timer_adjust_oneshot(mcd212_regs.scan_timer, video_screen_get_time_until_pos(machine->primary_screen, 0, 0), 0);
40024133
40034134   lcdbitmap = video_screen_auto_bitmap_alloc(devtag_get_device(machine, "lcd"));
40044135}
r6256r6257
40944225
40954226static MACHINE_RESET( cdi )
40964227{
4097   UINT16 *src   = (UINT16*)memory_region( machine, "maincpu" );
4228   UINT16 *src   = (UINT16*)memory_region(machine, "maincpu");
40984229   UINT16 *dst   = planea;
40994230   const device_config *cdrom_dev = devtag_get_device(machine, "cdrom");
41004231   memcpy(dst, src, 0x8);
41014232
4233   scc68070_init(machine, &scc68070_regs);
4234   cdic_init(machine, &cdic_regs);
4235   slave_init(machine, &slave_regs);
4236
41024237   scc68070_regs.timers.timer0_timer = timer_alloc(machine, scc68070_timer0_callback, 0);
41034238   timer_adjust_oneshot(scc68070_regs.timers.timer0_timer, attotime_never, 0);
41044239
r6256r6257
41144249   cdic_regs.audio_sample_timer = timer_alloc(machine, audio_sample_trigger, 0);
41154250   timer_adjust_oneshot(cdic_regs.audio_sample_timer, attotime_never, 0);
41164251
4117   /*
4118   memset(cdic_regs.audio_stream_samples, 0, 18*28*16*CDIC_BUFFERED_SECTORS * sizeof(INT16));
4119   cdic_regs.audio_stream_queued = 0;
4120   cdic_regs.audio_stream_index = 0;
4121   cdic_regs.audio_stream_end = 0;
4122   cdic_regs.audio_stream_playing = 0;
4123   */
4124
41254252   if( cdrom_dev )
41264253   {
41274254      cdic_regs.cd = mess_cd_get_cdrom_file(cdrom_dev);
r6256r6257
41304257
41314258   device_reset(cputag_get_cpu(machine, "maincpu"));
41324259
4133   cdic_regs.z_buffer = 0;
4134   cdic_regs.channel = 0xffffffff;
4135   cdic_regs.audio_channel = 0xffff;
4136
41374260   dmadac[0] = devtag_get_device(machine, "dac1");
41384261   dmadac[1] = devtag_get_device(machine, "dac2");
41394262

Previous 15994 Revisions Next


© 1998-2018 The MESS Team