LC89515: Difference between revisions

From NeoGeo Development Wiki
Jump to navigation Jump to search
mNo edit summary
Line 9: Line 9:


Complete datasheet: [[http://megadrive.org/~elbarto/md/Docs/Official%20Sega%20CD%20Manual/LC8951/]]
Complete datasheet: [[http://megadrive.org/~elbarto/md/Docs/Official%20Sega%20CD%20Manual/LC8951/]]
==Notes==
If CD command FIFO is not empty, status FIFO[1] = 15 (busy ?).
*Command 0: Nop ?
*Command 1:
CDEmuStop();
NeoCDAssyStatus = 0x0E;
*Command 2:
status FIFO[1]=command FIFO[3]
**0:
UINT8* ChannelData = CDEmuReadQChannel();
NeoCDCommsStatusFIFO[2] = ChannelData[1] / 10;
NeoCDCommsStatusFIFO[3] = ChannelData[1] % 10;
NeoCDCommsStatusFIFO[4] = ChannelData[2] / 10;
NeoCDCommsStatusFIFO[5] = ChannelData[2] % 10;
NeoCDCommsStatusFIFO[6] = ChannelData[3] / 10;
NeoCDCommsStatusFIFO[7] = ChannelData[3] % 10;
NeoCDCommsStatusFIFO[8] = ChannelData[7];
**1:
UINT8* ChannelData = CDEmuReadQChannel();
NeoCDCommsStatusFIFO[2] = ChannelData[4] / 10;
NeoCDCommsStatusFIFO[3] = ChannelData[4] % 10;
NeoCDCommsStatusFIFO[4] = ChannelData[5] / 10;
NeoCDCommsStatusFIFO[5] = ChannelData[5] % 10;
NeoCDCommsStatusFIFO[6] = ChannelData[6] / 10;
NeoCDCommsStatusFIFO[7] = ChannelData[6] % 10;
NeoCDCommsStatusFIFO[8] = ChannelData[7];
**2:
UINT8* ChannelData = CDEmuReadQChannel();
NeoCDCommsStatusFIFO[2] = ChannelData[0] / 10;
NeoCDCommsStatusFIFO[3] = ChannelData[0] % 10;
NeoCDCommsStatusFIFO[8] = ChannelData[7];
**3:
UINT8* TOCEntry = CDEmuReadTOC(-2);
NeoCDCommsStatusFIFO[2] = TOCEntry[0] / 10;
NeoCDCommsStatusFIFO[3] = TOCEntry[0] % 10;
NeoCDCommsStatusFIFO[4] = TOCEntry[1] / 10;
NeoCDCommsStatusFIFO[5] = TOCEntry[1] % 10;
NeoCDCommsStatusFIFO[6] = TOCEntry[2] / 10;
NeoCDCommsStatusFIFO[7] = TOCEntry[2] % 10;
**4:
UINT8* TOCEntry = CDEmuReadTOC(-1);
NeoCDCommsStatusFIFO[2] = TOCEntry[0] / 10;
NeoCDCommsStatusFIFO[3] = TOCEntry[0] % 10;
NeoCDCommsStatusFIFO[4] = TOCEntry[1] / 10;
NeoCDCommsStatusFIFO[5] = TOCEntry[1] % 10;
**5:
NeoCDTrack = NeoCDCommsCommandFIFO[4] * 10 + NeoCDCommsCommandFIFO[5];
UINT8* TOCEntry = CDEmuReadTOC(NeoCDTrack);
NeoCDCommsStatusFIFO[2] = TOCEntry[0] / 10;
NeoCDCommsStatusFIFO[3] = TOCEntry[0] % 10;
NeoCDCommsStatusFIFO[4] = TOCEntry[1] / 10;
NeoCDCommsStatusFIFO[5] = TOCEntry[1] % 10;
NeoCDCommsStatusFIFO[6] = TOCEntry[2] / 10;
NeoCDCommsStatusFIFO[7] = TOCEntry[2] % 10;
// bit 3 of the 1st minutes digit indicates a data track
if (TOCEntry[3] & 4) {
NeoCDCommsStatusFIFO[6] |= 8;
}
NeoCDCommsStatusFIFO[8] = NeoCDTrack % 10;
**6:
UINT8* ChannelData = CDEmuReadQChannel();
NeoCDCommsStatusFIFO[8] = ChannelData[7];
**7:
NeoCDCommsStatusFIFO[2] = 0;
NeoCDCommsStatusFIFO[3] = 5;
NeoCDCommsStatusFIFO[4] = 0;
NeoCDCommsStatusFIFO[5] = 0;
NeoCDCommsStatusFIFO[6] = 0;
NeoCDCommsStatusFIFO[7] = 0;
*3:
if (LC8951RegistersW[10] & 4) {
if (CDEmuGetStatus() == playing) {
bprintf(PRINT_ERROR, _T("*** Switching CD mode to CD-ROM while in audio mode!(PC: 0x%06X)\n"), SekGetPC(-1));
}
NeoCDSectorLBA  = NeoCDCommsCommandFIFO[2] * (10 * CD_FRAMES_MINUTE);
NeoCDSectorLBA += NeoCDCommsCommandFIFO[3] * ( 1 * CD_FRAMES_MINUTE);
NeoCDSectorLBA += NeoCDCommsCommandFIFO[4] * (10 * CD_FRAMES_SECOND);
NeoCDSectorLBA += NeoCDCommsCommandFIFO[5] * ( 1 * CD_FRAMES_SECOND);
NeoCDSectorLBA += NeoCDCommsCommandFIFO[6] * (10                  );
NeoCDSectorLBA += NeoCDCommsCommandFIFO[7] * ( 1                  );
NeoCDSectorLBA -= CD_FRAMES_PREGAP;
CDEmuStartRead();
} else {
if (CDEmuGetStatus() == reading) {
bprintf(PRINT_ERROR, _T("*** Switching CD mode to audio while in CD-ROM mode!(PC: 0x%06X)\n"), SekGetPC(-1));
}
CDEmuPlay((NeoCDCommsCommandFIFO[2] * 10) + NeoCDCommsCommandFIFO[3], (NeoCDCommsCommandFIFO[4] * 10) + NeoCDCommsCommandFIFO[5], (NeoCDCommsCommandFIFO[6] * 10) + NeoCDCommsCommandFIFO[7]);
}
*4:CDEmuPause();
*6: NeoCDAssyStatus = 4;
bNeoCDLoadSector = false;
*7: NeoCDAssyStatus = 1;
bNeoCDLoadSector = true;


[[Category:Chips]]
[[Category:Chips]]

Revision as of 03:05, 25 December 2012

Sanyo LC89515 chip found on a CDM3-2 board.

CD-1 Host and error corrector. Used to load files in CD systems.

Datasheet

Incomplete official datasheet: [[1]] LC89510 (with register definitions): [[2]]

Complete datasheet: [[3]]

Notes

If CD command FIFO is not empty, status FIFO[1] = 15 (busy ?).

  • Command 0: Nop ?
  • Command 1:

CDEmuStop(); NeoCDAssyStatus = 0x0E;

  • Command 2:

status FIFO[1]=command FIFO[3]

    • 0:

UINT8* ChannelData = CDEmuReadQChannel();

NeoCDCommsStatusFIFO[2] = ChannelData[1] / 10; NeoCDCommsStatusFIFO[3] = ChannelData[1] % 10;

NeoCDCommsStatusFIFO[4] = ChannelData[2] / 10; NeoCDCommsStatusFIFO[5] = ChannelData[2] % 10;

NeoCDCommsStatusFIFO[6] = ChannelData[3] / 10; NeoCDCommsStatusFIFO[7] = ChannelData[3] % 10;

NeoCDCommsStatusFIFO[8] = ChannelData[7];

    • 1:

UINT8* ChannelData = CDEmuReadQChannel();

NeoCDCommsStatusFIFO[2] = ChannelData[4] / 10; NeoCDCommsStatusFIFO[3] = ChannelData[4] % 10;

NeoCDCommsStatusFIFO[4] = ChannelData[5] / 10; NeoCDCommsStatusFIFO[5] = ChannelData[5] % 10;

NeoCDCommsStatusFIFO[6] = ChannelData[6] / 10; NeoCDCommsStatusFIFO[7] = ChannelData[6] % 10;

NeoCDCommsStatusFIFO[8] = ChannelData[7];

    • 2:

UINT8* ChannelData = CDEmuReadQChannel();

NeoCDCommsStatusFIFO[2] = ChannelData[0] / 10; NeoCDCommsStatusFIFO[3] = ChannelData[0] % 10;


NeoCDCommsStatusFIFO[8] = ChannelData[7];

    • 3:

UINT8* TOCEntry = CDEmuReadTOC(-2);

NeoCDCommsStatusFIFO[2] = TOCEntry[0] / 10; NeoCDCommsStatusFIFO[3] = TOCEntry[0] % 10;

NeoCDCommsStatusFIFO[4] = TOCEntry[1] / 10; NeoCDCommsStatusFIFO[5] = TOCEntry[1] % 10;

NeoCDCommsStatusFIFO[6] = TOCEntry[2] / 10; NeoCDCommsStatusFIFO[7] = TOCEntry[2] % 10;

    • 4:

UINT8* TOCEntry = CDEmuReadTOC(-1);

NeoCDCommsStatusFIFO[2] = TOCEntry[0] / 10; NeoCDCommsStatusFIFO[3] = TOCEntry[0] % 10;

NeoCDCommsStatusFIFO[4] = TOCEntry[1] / 10; NeoCDCommsStatusFIFO[5] = TOCEntry[1] % 10;

    • 5:

NeoCDTrack = NeoCDCommsCommandFIFO[4] * 10 + NeoCDCommsCommandFIFO[5];

UINT8* TOCEntry = CDEmuReadTOC(NeoCDTrack);

NeoCDCommsStatusFIFO[2] = TOCEntry[0] / 10; NeoCDCommsStatusFIFO[3] = TOCEntry[0] % 10;

NeoCDCommsStatusFIFO[4] = TOCEntry[1] / 10; NeoCDCommsStatusFIFO[5] = TOCEntry[1] % 10;

NeoCDCommsStatusFIFO[6] = TOCEntry[2] / 10; NeoCDCommsStatusFIFO[7] = TOCEntry[2] % 10;

// bit 3 of the 1st minutes digit indicates a data track if (TOCEntry[3] & 4) { NeoCDCommsStatusFIFO[6] |= 8; }

NeoCDCommsStatusFIFO[8] = NeoCDTrack % 10;

    • 6:

UINT8* ChannelData = CDEmuReadQChannel();

NeoCDCommsStatusFIFO[8] = ChannelData[7];

    • 7:

NeoCDCommsStatusFIFO[2] = 0; NeoCDCommsStatusFIFO[3] = 5;

NeoCDCommsStatusFIFO[4] = 0; NeoCDCommsStatusFIFO[5] = 0;

NeoCDCommsStatusFIFO[6] = 0; NeoCDCommsStatusFIFO[7] = 0;

  • 3:

if (LC8951RegistersW[10] & 4) {

if (CDEmuGetStatus() == playing) { bprintf(PRINT_ERROR, _T("*** Switching CD mode to CD-ROM while in audio mode!(PC: 0x%06X)\n"), SekGetPC(-1)); }

NeoCDSectorLBA = NeoCDCommsCommandFIFO[2] * (10 * CD_FRAMES_MINUTE); NeoCDSectorLBA += NeoCDCommsCommandFIFO[3] * ( 1 * CD_FRAMES_MINUTE); NeoCDSectorLBA += NeoCDCommsCommandFIFO[4] * (10 * CD_FRAMES_SECOND); NeoCDSectorLBA += NeoCDCommsCommandFIFO[5] * ( 1 * CD_FRAMES_SECOND); NeoCDSectorLBA += NeoCDCommsCommandFIFO[6] * (10 ); NeoCDSectorLBA += NeoCDCommsCommandFIFO[7] * ( 1 );

NeoCDSectorLBA -= CD_FRAMES_PREGAP;

CDEmuStartRead(); } else {

if (CDEmuGetStatus() == reading) { bprintf(PRINT_ERROR, _T("*** Switching CD mode to audio while in CD-ROM mode!(PC: 0x%06X)\n"), SekGetPC(-1)); }

CDEmuPlay((NeoCDCommsCommandFIFO[2] * 10) + NeoCDCommsCommandFIFO[3], (NeoCDCommsCommandFIFO[4] * 10) + NeoCDCommsCommandFIFO[5], (NeoCDCommsCommandFIFO[6] * 10) + NeoCDCommsCommandFIFO[7]); }

  • 4:CDEmuPause();
  • 6: NeoCDAssyStatus = 4;

bNeoCDLoadSector = false;

  • 7: NeoCDAssyStatus = 1;

bNeoCDLoadSector = true;