summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Angelo Salese <angelosa@users.noreply.github.com>2011-07-26 12:09:26 +0000
committer Angelo Salese <angelosa@users.noreply.github.com>2011-07-26 12:09:26 +0000
commit0f82225521c998be53fb49a06da87698e8d3cc3d (patch)
tree80372816d6a39a32113710d8a6754d76f83ec7a1
parentcf4ff0407ba64d4ea323df92391e40039272f4b5 (diff)
Port from MESS, nw
-rw-r--r--src/mame/machine/stvcd.c46
1 files changed, 37 insertions, 9 deletions
diff --git a/src/mame/machine/stvcd.c b/src/mame/machine/stvcd.c
index 2ee7372ebbb..bf80513f556 100644
--- a/src/mame/machine/stvcd.c
+++ b/src/mame/machine/stvcd.c
@@ -449,8 +449,37 @@ static UINT16 cd_readWord(UINT32 addr)
}
break;
- case XFERTYPE_FILEINFO_254:
- printf("STVCD: Unhandled xfer type 254\n");
+ case XFERTYPE_FILEINFO_254: // Lunar 2
+ if((xfercount % (6 * 2)) == 0)
+ {
+ UINT32 temp = 2 + (xfercount / (0x6 * 2));
+
+ // first 4 bytes = FAD
+ finfbuf[0] = (curdir[temp].firstfad>>24)&0xff;
+ finfbuf[1] = (curdir[temp].firstfad>>16)&0xff;
+ finfbuf[2] = (curdir[temp].firstfad>>8)&0xff;
+ finfbuf[3] = (curdir[temp].firstfad&0xff);
+ // second 4 bytes = length of file
+ finfbuf[4] = (curdir[temp].length>>24)&0xff;
+ finfbuf[5] = (curdir[temp].length>>16)&0xff;
+ finfbuf[6] = (curdir[temp].length>>8)&0xff;
+ finfbuf[7] = (curdir[temp].length&0xff);
+ finfbuf[8] = 0x00;
+ finfbuf[9] = 0x00;
+ finfbuf[10] = temp;
+ finfbuf[11] = curdir[temp].flags;
+ }
+
+ rv = finfbuf[xfercount % (6 * 2)]<<8 | finfbuf[(xfercount % (6 * 2)) +1];
+
+ xfercount += 2;
+ xferdnum += 2;
+
+ if (xfercount > (254 * 6 * 2))
+ {
+ xfercount = 0;
+ xfertype = XFERTYPE_INVALID;
+ }
break;
default:
@@ -560,6 +589,10 @@ static void cd_writeWord(running_machine &machine, UINT32 addr, UINT16 data)
case 0x0018:
case 0x001a:
// CDROM_LOG(("WW CR1: %04x\n", data))
+ /* these are ERRORS from our core and mustn't happen! */
+ if(data == 0x2100 || data == 0x2300)
+ debugger_break(machine);
+
cr1 = data;
cd_stat &= ~CD_STAT_PERI;
break;
@@ -893,12 +926,6 @@ static void cd_writeWord(running_machine &machine, UINT32 addr, UINT16 data)
hirqreg |= CMOK|DRDY;
break;
- /* these are ERRORS from our core and mustn't happen! */
- case 0x2100:
- case 0x2300:
- debugger_break(machine);
- break;
-
case 0x3000: // Set CD Device connection
{
UINT8 parm;
@@ -1399,7 +1426,8 @@ static void cd_writeWord(running_machine &machine, UINT32 addr, UINT16 data)
// - file #
// attributes flags
- cr3 = cr4 = 0;
+ cr3 = 0;
+ cr4 = 0;
// first 4 bytes = FAD
finfbuf[0] = (curdir[temp].firstfad>>24)&0xff;