Skip to content

Commit aeedfb2

Browse files
author
Niko
committed
pcdrv progress
1 parent 40bc428 commit aeedfb2

File tree

6 files changed

+17
-33
lines changed

6 files changed

+17
-33
lines changed

decompile/General/HOWL/h23_Bank_AssignSpuAddrs.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ int DECOMP_Bank_AssignSpuAddrs()
1616
{
1717
ret = DECOMP_LOAD_HowlSectorChainStart
1818
(
19-
(CdlFILE*)&sdata->KartHWL_CdLoc, // CdLoc of HOWL
19+
&sdata->KartHWL_CdFile, // CdLoc of HOWL
2020
(void*)sdata->ptrSampleBlock2, // destination in RAM for banks
2121
sdata->bankSectorOffset,// bank offset on disc, from CdLoc
2222
1 // one sector
@@ -75,7 +75,7 @@ int DECOMP_Bank_AssignSpuAddrs()
7575

7676
ret = DECOMP_LOAD_HowlSectorChainStart
7777
(
78-
(CdlFILE*)&sdata->KartHWL_CdLoc, // CdLoc of HOWL
78+
&sdata->KartHWL_CdFile, // CdLoc of HOWL
7979
(void*)((int)sdata->ptrSampleBlock2 + 0x800), // destination
8080
sdata->bankSectorOffset+1, // offset of howl
8181
sdata->numAudioSectors // number of sectors

decompile/General/HOWL/h34_howl_LoadHeader.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ void DECOMP_howl_LoadHeader(char* filename)
2323
#endif
2424

2525
v1 = PCopen("SOUNDS/KART.HWL", PCDRV_MODE_READ);
26-
sdata->fd_kartHwl = v1;
26+
int fd_kartHwl = v1;
2727

28-
v1 = PCread(sdata->fd_kartHwl, alloc, 0x800);
28+
v1 = PCread(fd_kartHwl, alloc, 0x800);
2929

3030
// allocate room for howlHeader + pointerTable
3131
howlHeaderSize = sizeof(struct HowlHeader) + alloc->headerSize;
@@ -35,7 +35,7 @@ void DECOMP_howl_LoadHeader(char* filename)
3535
DECOMP_MEMPACK_ReallocMem(numSector << 0xb);
3636

3737
char* byteOffset = (char*)alloc;
38-
PCread(sdata->fd_kartHwl, &byteOffset[0x800], howlHeaderSize-0x800);
38+
PCread(fd_kartHwl, &byteOffset[0x800], howlHeaderSize-0x800);
3939

4040
// allocate room for howlHeader + pointerTable
4141
howlHeaderSize = sizeof(struct HowlHeader) + alloc->headerSize;
@@ -49,14 +49,14 @@ void DECOMP_howl_LoadHeader(char* filename)
4949
// PS1
5050
#else
5151

52-
if (DECOMP_LOAD_FindFile(filename, (CdlFILE*)&sdata->KartHWL_CdLoc) == 0)
52+
if (DECOMP_LOAD_FindFile(filename, &sdata->KartHWL_CdFile) == 0)
5353
alloc = 0;
5454

5555
if (alloc != 0)
5656
{
5757
// read sector #1 of HOWL, just for header
5858
ret = DECOMP_LOAD_HowlHeaderSectors(
59-
(CdlFILE*)&sdata->KartHWL_CdLoc,
59+
&sdata->KartHWL_CdFile,
6060
alloc, 0, 1);
6161

6262
if(
@@ -85,7 +85,7 @@ void DECOMP_howl_LoadHeader(char* filename)
8585

8686
// read remaining sectors
8787
ret = DECOMP_LOAD_HowlHeaderSectors(
88-
(CdlFILE*)&sdata->KartHWL_CdLoc,
88+
&sdata->KartHWL_CdFile,
8989
(void*)((int)alloc + 0x800), 1, numSector - 1);
9090

9191
if (ret != 0)

decompile/General/HOWL/h36_howl_LoadSong.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ int DECOMP_howl_LoadSong()
1616
{
1717
ret = DECOMP_LOAD_HowlSectorChainStart
1818
(
19-
(CdlFILE*)&sdata->KartHWL_CdLoc, // CdLoc of HOWL
19+
&sdata->KartHWL_CdFile, // CdLoc of HOWL
2020
sdata->sampleBlock1, // destination in RAM for songs
2121
sdata->songSectorOffset,// song offset on disc, from CdLoc
2222
1 // one sector
@@ -42,7 +42,7 @@ int DECOMP_howl_LoadSong()
4242

4343
ret = DECOMP_LOAD_HowlSectorChainStart
4444
(
45-
(CdlFILE*)&sdata->KartHWL_CdLoc, // CdLoc of HOWL
45+
&sdata->KartHWL_CdFile, // CdLoc of HOWL
4646
sdata->tenSampleBlocks, // (sampleBlock1+0x800) RAM destination
4747
sdata->songSectorOffset+1,// song offset on disc, from CdLoc
4848
numSector-1

decompile/General/LOAD/LOAD_23_FindFile.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,10 @@ int DECOMP_LOAD_FindFile(char* filename, CdlFILE* cdlFile)
88
DECOMP_CDSYS_SetMode_StreamData();
99
DECOMP_LOAD_StringToUpper(filename);
1010

11+
#ifdef USE_PCDRV
12+
// for KART.HWL, cause CdSearchFile wont give size
13+
cdlFile->size = 0xbae694;
14+
#endif
15+
1116
return (CdSearchFile(cdlFile, filename) != 0);
1217
}

decompile/General/MAIN/MainMain.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -874,7 +874,7 @@ void StateZero()
874874
// "Start your engines, for Sony Computer..."
875875
DECOMP_CDSYS_XAPlay(CDSYS_XA_TYPE_EXTRA, 0x50);
876876

877-
#if !defined(REBUILD_PC) && !defined(USE_PCDRV)
877+
#if !defined(USE_PCDRV)
878878
while (sdata->XA_State != 0)
879879
{
880880
// WARNING: Read-only address (ram, 0x8008d888) is written

include/regionsEXE.h

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3615,9 +3615,6 @@ struct sData
36153615
// 8008d6b4
36163616
int bool_XnfLoaded;
36173617

3618-
// PS1
3619-
#ifndef USE_PCDRV
3620-
36213618
// 8008d6b8
36223619
// = 0, most of the time
36233620
// = 1, finished, set on IRQ
@@ -3635,16 +3632,6 @@ struct sData
36353632
// 8008d6c8
36363633
int XA_VolumeDeduct;
36373634

3638-
// PC
3639-
#else
3640-
3641-
int fd_bigfile;
3642-
int fd_kartHwl;
3643-
3644-
int willUseLater[3];
3645-
3646-
#endif
3647-
36483635
// 8008d6cc
36493636
int* ptrArray_numSongs;
36503637

@@ -4703,15 +4690,7 @@ struct sData
47034690
struct Song songPool[2];
47044691

47054692
// 80095e7c
4706-
// two CdlLoc files are here
4707-
CdlLOC KartHWL_CdLoc;
4708-
4709-
// 80095E80
4710-
int KartHWL_fileSize;
4711-
//instead of the two above variables (80095e7c and 80095e80), it's almost certainly a `CdlFILE` instead of a `CdlLOC` & `int`
4712-
4713-
// 80095E84
4714-
char KartHWL_filename[0x10];
4693+
CdlFILE KartHWL_CdFile;
47154694

47164695
// 80095e94
47174696
// backed up during pause

0 commit comments

Comments
 (0)