X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=Pico%2Fcd%2FLC89510.c;h=efad0055d9045fd9a694f66eb93cdcb070626baf;hb=4aed476f2475f40406b4c3da91b3e5e7323e87b2;hp=96d0966c5659842c5ae20e945c85345036606db1;hpb=672ad671130bb662f099b790fdaef4be85e6c146;p=picodrive.git diff --git a/Pico/cd/LC89510.c b/Pico/cd/LC89510.c index 96d0966..efad005 100644 --- a/Pico/cd/LC89510.c +++ b/Pico/cd/LC89510.c @@ -1,25 +1,16 @@ -#if 0 -#include -#include -#include "misc.h" -#include "lc89510.h" -#include "cd_aspi.h" -#include "Star_68k.h" -#include "mem_S68k.h" -#include "pcm.h" -#endif +/*********************************************************** + * * + * This source file was taken from the Gens project * + * Written by Stéphane Dallongeville * + * Copyright (c) 2002 by Stéphane Dallongeville * + * Modified/adapted for PicoDrive by notaz, 2007 * + * * + ***********************************************************/ #include "../PicoInt.h" -#define cdprintf printf -//#define cdprintf(x...) - - #define CDC_DMA_SPEED 256 -int CDC_Decode_Reg_Read; -static int Status_CDC; // internal status - static void CDD_Reset(void) { @@ -42,9 +33,7 @@ static void CDC_Reset(void) { // Reseting CDC - memset(Pico_mcd->cdc.Buffer, 0, (16 * 1024 * 2) + 2352); - - CDC_Update_Header(); + memset(Pico_mcd->cdc.Buffer, 0, sizeof(Pico_mcd->cdc.Buffer)); Pico_mcd->cdc.COMIN = 0; Pico_mcd->cdc.IFSTAT = 0xFF; @@ -58,153 +47,141 @@ static void CDC_Reset(void) Pico_mcd->cdc.IFCTRL = 0; Pico_mcd->cdc.CTRL.N = 0; - CDC_Decode_Reg_Read = 0; - Status_CDC = 0; + Pico_mcd->cdc.Decode_Reg_Read = 0; + Pico_mcd->scd.Status_CDC &= ~0x08; } -void LC89510_Reset(void) +PICO_INTERNAL void LC89510_Reset(void) { CDD_Reset(); CDC_Reset(); - Pico_mcd->cdc.Host_Data = 0; - Pico_mcd->cdc.DMA_Adr = 0; - Pico_mcd->cdc.Stop_Watch = 0; + // clear DMA_Adr & Stop_Watch + memset(Pico_mcd->s68k_regs + 0xA, 0, 4); } -#if 0 // TODO -void Update_CDC_TRansfer(void) -{ - unsigned int i, dep, lenght, add_dest; - unsigned char *dest; - - if ((Status_CDC & 0x08) == 0) return; - - switch(Pico_mcd->s68k_regs[4] & 7) - { - case 0x0200: // MAIN CPU - case 0x0300: // SUB CPU - Pico_mcd->s68k_regs[4] |= 0x40; // Data ready in host port - return; - - case 0x0400: // PCM RAM - dest = (unsigned char *) Ram_PCM; - dep = ((Pico_mcd->cdc.DMA_Adr & 0x03FF) << 2) + PCM_Chip.Bank; - add_dest = 2; - break; - - case 0x0500: // PRG RAM - dest = (unsigned char *) Ram_Prg; - dep = (Pico_mcd->cdc.DMA_Adr & 0xFFFF) << 3; - add_dest = 2; -// cdprintf("DMA transfer PRG RAM : adr = %.8X ", dep); - break; - case 0x0700: // WORD RAM - if (Ram_Word_State >= 2) - { - dest = (unsigned char *) Ram_Word_1M; - add_dest = 2; - if (Ram_Word_State & 1) dep = ((Pico_mcd->cdc.DMA_Adr & 0x3FFF) << 3); - else dep = ((Pico_mcd->cdc.DMA_Adr & 0x3FFF) << 3) + 0x20000; - } - else - { - dest = (unsigned char *) Ram_Word_2M; - dep = ((Pico_mcd->cdc.DMA_Adr & 0x7FFF) << 3); - add_dest = 2; - } - break; - - default: - return; - } +PICO_INTERNAL void Update_CDC_TRansfer(int which) +{ + unsigned int DMA_Adr, dep, length; + unsigned short *dest; + unsigned char *src; if (Pico_mcd->cdc.DBC.N <= (CDC_DMA_SPEED * 2)) { - lenght = (Pico_mcd->cdc.DBC.N + 1) >> 1; - Status_CDC &= ~0x08; // Last transfer - Pico_mcd->s68k_regs[4] |= 0x80; // End data transfer - Pico_mcd->s68k_regs[4] &= ~0x40; // no more data ready - Pico_mcd->cdc.IFSTAT |= 0x08; // No more data transfer in progress + length = (Pico_mcd->cdc.DBC.N + 1) >> 1; + Pico_mcd->scd.Status_CDC &= ~0x08; // Last transfer + Pico_mcd->s68k_regs[4] |= 0x80; // End data transfer + Pico_mcd->s68k_regs[4] &= ~0x40; // no more data ready + Pico_mcd->cdc.IFSTAT |= 0x08; // No more data transfer in progress - if (Pico_mcd->cdc.IFCTRL & 0x40) // DTEIEN = Data Trasnfer End Interrupt Enable ? + if (Pico_mcd->cdc.IFCTRL & 0x40) // DTEIEN = Data Trasnfer End Interrupt Enable ? { Pico_mcd->cdc.IFSTAT &= ~0x40; - if (Int_Mask_S68K & 0x20) sub68k_interrupt(5, -1); - - cdprintf("CDC - DTE interrupt\n"); + if (Pico_mcd->s68k_regs[0x33] & (1<<5)) + { + elprintf(EL_INTS, "cdc DTE irq 5"); + SekInterruptS68k(5); + } } } - else lenght = CDC_DMA_SPEED; + else length = CDC_DMA_SPEED; -// cdprintf("DMA lenght = %.4X\n", lenght); + // TODO: dst bounds checking? + src = Pico_mcd->cdc.Buffer + Pico_mcd->cdc.DAC.N; + DMA_Adr = (Pico_mcd->s68k_regs[0xA]<<8) | Pico_mcd->s68k_regs[0xB]; - if ((Pico_mcd->s68k_regs[4] & 7) == 4) // PCM DMA + if (which == 7) // WORD RAM { - __asm + if (Pico_mcd->s68k_regs[3] & 4) { - mov ecx, lenght - mov edi, dest - lea esi, Pico_mcd->cdc.Buffer - add edi, dep - add esi, Pico_mcd->cdc.DAC.N - mov ebx, add_dest - - Loop_DMA_PCM: - mov ax, [esi] - add esi, 2 - mov [edi], ax - add edi, ebx - dec ecx - jnz Loop_DMA_PCM + // test: Final Fight + int bank = !(Pico_mcd->s68k_regs[3]&1); + dep = ((DMA_Adr & 0x3FFF) << 3); + cdprintf("CD DMA # %04x -> word_ram1M # %06x, len=%i", + Pico_mcd->cdc.DAC.N, dep, length); + + dest = (unsigned short *) (Pico_mcd->word_ram1M[bank] + dep); + + memcpy16bswap(dest, src, length); + + /*{ // debug + unsigned char *b1 = Pico_mcd->word_ram1M[bank] + dep; + unsigned char *b2 = (unsigned char *)(dest+length) - 8; + dprintf("%02x %02x %02x %02x .. %02x %02x %02x %02x", + b1[0], b1[1], b1[4], b1[5], b2[0], b2[1], b2[4], b2[5]); + }*/ } - - lenght <<= 1; - Pico_mcd->cdc.DMA_Adr += lenght >> 2; - } - else // OTHER DMA - { - __asm + else { - mov ecx, lenght - mov edi, dest - lea esi, Pico_mcd->cdc.Buffer - add edi, dep - add esi, Pico_mcd->cdc.DAC.N - mov ebx, add_dest - - Loop_DMA: - mov ax, [esi] - add esi, 2 - rol ax, 8 - mov [edi], ax - add edi, ebx - dec ecx - jnz Loop_DMA + dep = ((DMA_Adr & 0x7FFF) << 3); + cdprintf("CD DMA # %04x -> word_ram2M # %06x, len=%i", + Pico_mcd->cdc.DAC.N, dep, length); + dest = (unsigned short *) (Pico_mcd->word_ram2M + dep); + + memcpy16bswap(dest, src, length); + + /*{ // debug + unsigned char *b1 = Pico_mcd->word_ram2M + dep; + unsigned char *b2 = (unsigned char *)(dest+length) - 4; + dprintf("%02x %02x %02x %02x .. %02x %02x %02x %02x", + b1[0], b1[1], b1[2], b1[3], b2[0], b2[1], b2[2], b2[3]); + }*/ } - - lenght <<= 1; - Pico_mcd->cdc.DMA_Adr += lenght >> 3; + } + else if (which == 4) // PCM RAM (check: popful Mail) + { + dep = (DMA_Adr & 0x03FF) << 2; + cdprintf("CD DMA # %04x -> PCM[%i] # %04x, len=%i", + Pico_mcd->cdc.DAC.N, Pico_mcd->pcm.bank, dep, length); + dest = (unsigned short *) (Pico_mcd->pcm_ram_b[Pico_mcd->pcm.bank] + dep); + + if (Pico_mcd->cdc.DAC.N & 1) /* unaligned src? */ + memcpy(dest, src, length*2); + else memcpy16(dest, (unsigned short *) src, length); + } + else if (which == 5) // PRG RAM + { + dep = DMA_Adr << 3; + dest = (unsigned short *) (Pico_mcd->prg_ram + dep); + cdprintf("CD DMA # %04x -> prg_ram # %06x, len=%i", + Pico_mcd->cdc.DAC.N, dep, length); + + memcpy16bswap(dest, src, length); + + /*{ // debug + unsigned char *b1 = Pico_mcd->prg_ram + dep; + unsigned char *b2 = (unsigned char *)(dest+length) - 4; + dprintf("%02x %02x %02x %02x .. %02x %02x %02x %02x", + b1[0], b1[1], b1[2], b1[3], b2[0], b2[1], b2[2], b2[3]); + }*/ } - Pico_mcd->cdc.DAC.N = (Pico_mcd->cdc.DAC.N + lenght) & 0xFFFF; - if (Status_CDC & 0x08) Pico_mcd->cdc.DBC.N -= lenght; + length <<= 1; + Pico_mcd->cdc.DAC.N = (Pico_mcd->cdc.DAC.N + length) & 0xFFFF; + if (Pico_mcd->scd.Status_CDC & 0x08) Pico_mcd->cdc.DBC.N -= length; else Pico_mcd->cdc.DBC.N = 0; + + // update DMA_Adr + length >>= 2; + if (which != 4) length >>= 1; + DMA_Adr += length; + Pico_mcd->s68k_regs[0xA] = DMA_Adr >> 8; + Pico_mcd->s68k_regs[0xB] = DMA_Adr; } -#endif -unsigned short Read_CDC_Host(int is_sub) +PICO_INTERNAL_ASM unsigned short Read_CDC_Host(int is_sub) { int addr; - if (!(Status_CDC & 0x08)) + if (!(Pico_mcd->scd.Status_CDC & 0x08)) { // Transfer data disabled + cdprintf("Read_CDC_Host FIXME: Transfer data disabled"); return 0; } @@ -212,6 +189,7 @@ unsigned short Read_CDC_Host(int is_sub) (!is_sub && (Pico_mcd->s68k_regs[4] & 7) != 2)) { // Wrong setting + cdprintf("Read_CDC_Host FIXME: Wrong setting"); return 0; } @@ -220,7 +198,7 @@ unsigned short Read_CDC_Host(int is_sub) if (Pico_mcd->cdc.DBC.N <= 0) { Pico_mcd->cdc.DBC.N = 0; - Status_CDC &= ~0x08; // Last transfer + Pico_mcd->scd.Status_CDC &= ~0x08; // Last transfer Pico_mcd->s68k_regs[4] |= 0x80; // End data transfer Pico_mcd->s68k_regs[4] &= ~0x40; // no more data ready Pico_mcd->cdc.IFSTAT |= 0x08; // No more data transfer in progress @@ -230,35 +208,25 @@ unsigned short Read_CDC_Host(int is_sub) Pico_mcd->cdc.IFSTAT &= ~0x40; if (Pico_mcd->s68k_regs[0x33]&(1<<5)) { - dprintf("m68k: s68k irq 5"); + elprintf(EL_INTS, "m68k: s68k irq 5"); SekInterruptS68k(5); } - cdprintf("CDC - DTE interrupt\n"); + cdprintf("CDC - DTE interrupt"); } } addr = Pico_mcd->cdc.DAC.N; Pico_mcd->cdc.DAC.N += 2; - return (Pico_mcd->cdc.Buffer[addr]<<8) | Pico_mcd->cdc.Buffer[addr+1]; -#if 0 - __asm - { - mov esi, Pico_mcd->cdc.DAC.N - lea ebx, Pico_mcd->cdc.Buffer -// and esi, 0x3FFF - mov ax, [ebx + esi] - add esi, 2 - rol ax, 8 - mov Pico_mcd->cdc.DAC.N, esi - mov val, ax - } -#endif + cdprintf("Read_CDC_Host sub=%i d=%04x dac=%04x dbc=%04x", is_sub, + (Pico_mcd->cdc.Buffer[addr]<<8) | Pico_mcd->cdc.Buffer[addr+1], Pico_mcd->cdc.DAC.N, Pico_mcd->cdc.DBC.N); + + return (Pico_mcd->cdc.Buffer[addr]<<8) | Pico_mcd->cdc.Buffer[addr+1]; } -void CDC_Update_Header(void) +PICO_INTERNAL void CDC_Update_Header(void) { if (Pico_mcd->cdc.CTRL.B.B1 & 0x01) // Sub-Header wanted ? { @@ -281,122 +249,120 @@ void CDC_Update_Header(void) } -unsigned char CDC_Read_Reg(void) +PICO_INTERNAL unsigned char CDC_Read_Reg(void) { unsigned char ret; - cdprintf("CDC read reg %.2d = ", Pico_mcd->s68k_regs[5] & 0xF); - switch(Pico_mcd->s68k_regs[5] & 0xF) { case 0x0: // COMIN - cdprintf("%.2X\n", Pico_mcd->cdc.COMIN); + cdprintf("CDC read reg 00 = %.2X", Pico_mcd->cdc.COMIN); Pico_mcd->s68k_regs[5] = 0x1; return Pico_mcd->cdc.COMIN; case 0x1: // IFSTAT - cdprintf("%.2X\n", Pico_mcd->cdc.IFSTAT); + cdprintf("CDC read reg 01 = %.2X", Pico_mcd->cdc.IFSTAT); - CDC_Decode_Reg_Read |= (1 << 1); // Reg 1 (decoding) + Pico_mcd->cdc.Decode_Reg_Read |= (1 << 1); // Reg 1 (decoding) Pico_mcd->s68k_regs[5] = 0x2; return Pico_mcd->cdc.IFSTAT; case 0x2: // DBCL - cdprintf("%.2X\n", Pico_mcd->cdc.DBC.B.L); + cdprintf("CDC read reg 02 = %.2X", Pico_mcd->cdc.DBC.B.L); Pico_mcd->s68k_regs[5] = 0x3; return Pico_mcd->cdc.DBC.B.L; case 0x3: // DBCH - cdprintf("%.2X\n", Pico_mcd->cdc.DBC.B.H); + cdprintf("CDC read reg 03 = %.2X", Pico_mcd->cdc.DBC.B.H); Pico_mcd->s68k_regs[5] = 0x4; return Pico_mcd->cdc.DBC.B.H; case 0x4: // HEAD0 - cdprintf("%.2X\n", Pico_mcd->cdc.HEAD.B.B0); + cdprintf("CDC read reg 04 = %.2X", Pico_mcd->cdc.HEAD.B.B0); - CDC_Decode_Reg_Read |= (1 << 4); // Reg 4 (decoding) + Pico_mcd->cdc.Decode_Reg_Read |= (1 << 4); // Reg 4 (decoding) Pico_mcd->s68k_regs[5] = 0x5; return Pico_mcd->cdc.HEAD.B.B0; case 0x5: // HEAD1 - cdprintf("%.2X\n", Pico_mcd->cdc.HEAD.B.B1); + cdprintf("CDC read reg 05 = %.2X", Pico_mcd->cdc.HEAD.B.B1); - CDC_Decode_Reg_Read |= (1 << 5); // Reg 5 (decoding) + Pico_mcd->cdc.Decode_Reg_Read |= (1 << 5); // Reg 5 (decoding) Pico_mcd->s68k_regs[5] = 0x6; return Pico_mcd->cdc.HEAD.B.B1; case 0x6: // HEAD2 - cdprintf("%.2X\n", Pico_mcd->cdc.HEAD.B.B2); + cdprintf("CDC read reg 06 = %.2X", Pico_mcd->cdc.HEAD.B.B2); - CDC_Decode_Reg_Read |= (1 << 6); // Reg 6 (decoding) + Pico_mcd->cdc.Decode_Reg_Read |= (1 << 6); // Reg 6 (decoding) Pico_mcd->s68k_regs[5] = 0x7; return Pico_mcd->cdc.HEAD.B.B2; case 0x7: // HEAD3 - cdprintf("%.2X\n", Pico_mcd->cdc.HEAD.B.B3); + cdprintf("CDC read reg 07 = %.2X", Pico_mcd->cdc.HEAD.B.B3); - CDC_Decode_Reg_Read |= (1 << 7); // Reg 7 (decoding) + Pico_mcd->cdc.Decode_Reg_Read |= (1 << 7); // Reg 7 (decoding) Pico_mcd->s68k_regs[5] = 0x8; return Pico_mcd->cdc.HEAD.B.B3; case 0x8: // PTL - cdprintf("%.2X\n", Pico_mcd->cdc.PT.B.L); + cdprintf("CDC read reg 08 = %.2X", Pico_mcd->cdc.PT.B.L); - CDC_Decode_Reg_Read |= (1 << 8); // Reg 8 (decoding) + Pico_mcd->cdc.Decode_Reg_Read |= (1 << 8); // Reg 8 (decoding) Pico_mcd->s68k_regs[5] = 0x9; return Pico_mcd->cdc.PT.B.L; case 0x9: // PTH - cdprintf("%.2X\n", Pico_mcd->cdc.PT.B.H); + cdprintf("CDC read reg 09 = %.2X", Pico_mcd->cdc.PT.B.H); - CDC_Decode_Reg_Read |= (1 << 9); // Reg 9 (decoding) + Pico_mcd->cdc.Decode_Reg_Read |= (1 << 9); // Reg 9 (decoding) Pico_mcd->s68k_regs[5] = 0xA; return Pico_mcd->cdc.PT.B.H; case 0xA: // WAL - cdprintf("%.2X\n", Pico_mcd->cdc.WA.B.L); + cdprintf("CDC read reg 10 = %.2X", Pico_mcd->cdc.WA.B.L); Pico_mcd->s68k_regs[5] = 0xB; return Pico_mcd->cdc.WA.B.L; case 0xB: // WAH - cdprintf("%.2X\n", Pico_mcd->cdc.WA.B.H); + cdprintf("CDC read reg 11 = %.2X", Pico_mcd->cdc.WA.B.H); Pico_mcd->s68k_regs[5] = 0xC; return Pico_mcd->cdc.WA.B.H; case 0xC: // STAT0 - cdprintf("%.2X\n", Pico_mcd->cdc.STAT.B.B0); + cdprintf("CDC read reg 12 = %.2X", Pico_mcd->cdc.STAT.B.B0); - CDC_Decode_Reg_Read |= (1 << 12); // Reg 12 (decoding) + Pico_mcd->cdc.Decode_Reg_Read |= (1 << 12); // Reg 12 (decoding) Pico_mcd->s68k_regs[5] = 0xD; return Pico_mcd->cdc.STAT.B.B0; case 0xD: // STAT1 - cdprintf("%.2X\n", Pico_mcd->cdc.STAT.B.B1); + cdprintf("CDC read reg 13 = %.2X", Pico_mcd->cdc.STAT.B.B1); - CDC_Decode_Reg_Read |= (1 << 13); // Reg 13 (decoding) + Pico_mcd->cdc.Decode_Reg_Read |= (1 << 13); // Reg 13 (decoding) Pico_mcd->s68k_regs[5] = 0xE; return Pico_mcd->cdc.STAT.B.B1; case 0xE: // STAT2 - cdprintf("%.2X\n", Pico_mcd->cdc.STAT.B.B2); + cdprintf("CDC read reg 14 = %.2X", Pico_mcd->cdc.STAT.B.B2); - CDC_Decode_Reg_Read |= (1 << 14); // Reg 14 (decoding) + Pico_mcd->cdc.Decode_Reg_Read |= (1 << 14); // Reg 14 (decoding) Pico_mcd->s68k_regs[5] = 0xF; return Pico_mcd->cdc.STAT.B.B2; case 0xF: // STAT3 - cdprintf("%.2X\n", Pico_mcd->cdc.STAT.B.B3); + cdprintf("CDC read reg 15 = %.2X", Pico_mcd->cdc.STAT.B.B3); ret = Pico_mcd->cdc.STAT.B.B3; Pico_mcd->cdc.IFSTAT |= 0x20; // decoding interrupt flag cleared if ((Pico_mcd->cdc.CTRL.B.B0 & 0x80) && (Pico_mcd->cdc.IFCTRL & 0x20)) { - if ((CDC_Decode_Reg_Read & 0x73F2) == 0x73F2) + if ((Pico_mcd->cdc.Decode_Reg_Read & 0x73F2) == 0x73F2) Pico_mcd->cdc.STAT.B.B3 = 0x80; } return ret; @@ -406,9 +372,9 @@ unsigned char CDC_Read_Reg(void) } -void CDC_Write_Reg(unsigned char Data) +PICO_INTERNAL void CDC_Write_Reg(unsigned char Data) { - cdprintf("CDC write reg%d = %.2X\n", Pico_mcd->s68k_regs[5] & 0xF, Data); + cdprintf("CDC write reg%02d = %.2X", Pico_mcd->s68k_regs[5] & 0xF, Data); switch (Pico_mcd->s68k_regs[5] & 0xF) { @@ -425,7 +391,7 @@ void CDC_Write_Reg(unsigned char Data) if ((Pico_mcd->cdc.IFCTRL & 0x02) == 0) // Stop data transfer { Pico_mcd->cdc.DBC.N = 0; - Status_CDC &= ~0x08; + Pico_mcd->scd.Status_CDC &= ~0x08; Pico_mcd->cdc.IFSTAT |= 0x08; // No more data transfer in progress } break; @@ -458,12 +424,12 @@ void CDC_Write_Reg(unsigned char Data) if (Pico_mcd->cdc.IFCTRL & 0x02) // Data transfer enable ? { Pico_mcd->cdc.IFSTAT &= ~0x08; // Data transfer in progress - Status_CDC |= 0x08; // Data transfer in progress + Pico_mcd->scd.Status_CDC |= 0x08; // Data transfer in progress Pico_mcd->s68k_regs[4] &= 0x7F; // A data transfer start - cdprintf("\n************** Starting Data Transfer ***********\n"); + cdprintf("************** Starting Data Transfer ***********"); cdprintf("RS0 = %.4X DAC = %.4X DBC = %.4X DMA adr = %.4X\n\n", Pico_mcd->s68k_regs[4]<<8, - Pico_mcd->cdc.DAC.N, Pico_mcd->cdc.DBC.N, Pico_mcd->cdc.DMA_Adr); + Pico_mcd->cdc.DAC.N, Pico_mcd->cdc.DBC.N, (Pico_mcd->s68k_regs[0xA]<<8) | Pico_mcd->s68k_regs[0xB]); } break; @@ -524,7 +490,7 @@ static int bswapwrite(int a, unsigned short d) return d + (d >> 8); } -void CDD_Export_Status(void) +PICO_INTERNAL void CDD_Export_Status(void) { unsigned int csum; @@ -540,12 +506,12 @@ void CDD_Export_Status(void) if (Pico_mcd->s68k_regs[0x33] & (1<<4)) { - dprintf("cdd export irq 4"); + elprintf(EL_INTS, "cdd export irq 4"); SekInterruptS68k(4); } - cdprintf("CDD exported status\n"); - cdprintf("Status =%.4X, Minute=%.4X, Second=%.4X, Frame=%.4X Checksum=%.4X\n", +// cdprintf("CDD exported status\n"); + cdprintf("out: Status=%.4X, Minute=%.4X, Second=%.4X, Frame=%.4X Checksum=%.4X", (Pico_mcd->s68k_regs[0x38+0] << 8) | Pico_mcd->s68k_regs[0x38+1], (Pico_mcd->s68k_regs[0x38+2] << 8) | Pico_mcd->s68k_regs[0x38+3], (Pico_mcd->s68k_regs[0x38+4] << 8) | Pico_mcd->s68k_regs[0x38+5], @@ -554,10 +520,10 @@ void CDD_Export_Status(void) } -void CDD_Import_Command(void) +PICO_INTERNAL void CDD_Import_Command(void) { - cdprintf("CDD importing command\n"); - cdprintf("Command=%.4X, Minute=%.4X, Second=%.4X, Frame=%.4X Checksum=%.4X\n", +// cdprintf("CDD importing command\n"); + cdprintf("in: Command=%.4X, Minute=%.4X, Second=%.4X, Frame=%.4X Checksum=%.4X", (Pico_mcd->s68k_regs[0x38+10+0] << 8) | Pico_mcd->s68k_regs[0x38+10+1], (Pico_mcd->s68k_regs[0x38+10+2] << 8) | Pico_mcd->s68k_regs[0x38+10+3], (Pico_mcd->s68k_regs[0x38+10+4] << 8) | Pico_mcd->s68k_regs[0x38+10+5], @@ -592,7 +558,7 @@ void CDD_Import_Command(void) Get_Current_Track_CDD_c22(); break; - case 0x3: // get total lenght (MSF format) + case 0x3: // get total length (MSF format) Pico_mcd->cdd.Status = (Pico_mcd->cdd.Status & 0xFF00) | 3; Get_Total_Lenght_CDD_c23(); break;