mirror of
https://github.com/OpenDriver2/REDRIVER2.git
synced 2024-11-25 03:42:34 +01:00
- first attempt to do something
This commit is contained in:
parent
eba0bbff65
commit
bc9729b79c
@ -391,6 +391,17 @@ void /*$ra*/ LoadBankFromLump(int bank /*$s3*/, int lump /*$s2*/)
|
||||
static unsigned int blockLimit[73] = {0}; // address 0x10
|
||||
int length; // $s0
|
||||
char *name; // $s1
|
||||
|
||||
name = "SOUND\\VOICES2.BLK";
|
||||
|
||||
if (blockLimit[1] == 0)
|
||||
{
|
||||
LoadFileSeg(name, blockLimit[0], 0, 292);
|
||||
}
|
||||
|
||||
//LoadFileSeg(name, 0x8018, 0, 292);
|
||||
//LoadSoundBankDynamic(0x8018, );
|
||||
|
||||
} // line 21, address 0x52578
|
||||
/*
|
||||
* Offset 0x52578
|
||||
|
17
src/C/pad.c
17
src/C/pad.c
@ -1,4 +1,6 @@
|
||||
|
||||
#include "../decomp_defs.h"
|
||||
|
||||
char High_shake_data[] = { 1, 0xFF, 0xFF, 0xC8, 0x50, 0x50, 0x50, 0x50, 0x50, 0x46, 0x46, 0x46, 0x46, 0x46, 0xA, 0xA, 0xA, 0xA, 0xA, 0xA, 0 };
|
||||
|
||||
char Med_shake_data[] = { 1, 0xC8, 0xC8, 0x64, 0x46, 0x46, 0x46, 0x46, 0x46, 0xA, 0xA, 0xA, 0 };
|
||||
@ -14,10 +16,21 @@ char* shake_data[] = { High_shake_data, Med_shake_data, Low_shake_data };
|
||||
* Saved registers at address -4: s0 s1 s2 s3 s4 s5 s6 ra
|
||||
*/
|
||||
void /*$ra*/ InitControllers()
|
||||
{ // line 2, address 0x6b4e8
|
||||
{
|
||||
int i; // $s3
|
||||
int j; // $a1
|
||||
} // line 36, address 0x6b610
|
||||
|
||||
DuplicatePadData.buffer = NULL;
|
||||
DuplicatePadData.length = 0;
|
||||
|
||||
PadInitDirect(padbuffer[0], padbuffer[1]);
|
||||
PadStartCom();
|
||||
|
||||
// [U]: UNDONE
|
||||
|
||||
//Pads[0].mapnew
|
||||
//Pads[0].shakeptr
|
||||
}
|
||||
/*
|
||||
* Offset 0x6B610
|
||||
* D:\driver2\game\C\PAD.C (line 132)
|
||||
|
@ -3,6 +3,8 @@
|
||||
|
||||
long dummylong[3] = { 0, 0, 0 };
|
||||
|
||||
long banksize[2] = { 88064, 412672 };
|
||||
|
||||
/*
|
||||
* Offset 0x7914C
|
||||
* D:\driver2\game\C\SOUND.C (line 114)
|
||||
@ -10,8 +12,39 @@ long dummylong[3] = { 0, 0, 0 };
|
||||
* Saved registers at address -8: s0 s1 s2 s3 ra
|
||||
*/
|
||||
void /*$ra*/ InitSound()
|
||||
{ // line 2, address 0x7914c
|
||||
{
|
||||
int ct; // $s0
|
||||
|
||||
SpuInit();
|
||||
|
||||
SpuInitMalloc(0x7, banks);
|
||||
|
||||
SpuSetMute(1);
|
||||
|
||||
AllocateReverb(3, 16384);
|
||||
|
||||
for (ct = 0; ct < 2; ct++)
|
||||
{
|
||||
bankaddr[ct] = SpuMalloc(banksize[ct]);
|
||||
|
||||
if (bankaddr[ct] == -1)
|
||||
exit(-1);
|
||||
}
|
||||
|
||||
for (ct = 0; ct < 16; ct++)
|
||||
{
|
||||
channel_lookup[ct] = 1 << ct;
|
||||
}
|
||||
|
||||
ResetSound();
|
||||
|
||||
XM_OnceOffInit(1);
|
||||
|
||||
SetMasterVolume(gMasterVolume);
|
||||
|
||||
VSyncCallback(VsyncProc);
|
||||
|
||||
SpuSetMute(0);
|
||||
} // line 47, address 0x7923c
|
||||
/*
|
||||
* Offset 0x7923C
|
||||
@ -277,8 +310,23 @@ void /*$ra*/ SetChannelVolume(int channel /*$s0*/, int volume /*$t1*/, int proxi
|
||||
* Saved registers at address -8: s0 s1 ra
|
||||
*/
|
||||
void /*$ra*/ AllocateReverb(long mode /*$s1*/, long depth /*$s0*/)
|
||||
{ // line 1, address 0x7aba4
|
||||
{
|
||||
struct SpuReverbAttr r_attr; // stack address -40
|
||||
|
||||
int result = SpuReserveReverbWorkArea(1);
|
||||
|
||||
if (result == 1)
|
||||
{
|
||||
r_attr.mask = 0x7; // SPU_REV_MODE | SPU_REV_DEPTHL | SPU_REV_DEPTHR ???
|
||||
r_attr.mode = mode | 0x100; // SPU_REV_MODE_CLEAR_WA ???
|
||||
r_attr.depth.left = depth;
|
||||
r_attr.depth.right = depth;
|
||||
|
||||
SpuSetReverbModeParam(r_attr);
|
||||
|
||||
SpuSetReverbDepth(depth);
|
||||
SpuSetReverb(1);
|
||||
}
|
||||
} // line 16, address 0x7abfc
|
||||
/*
|
||||
* Offset 0x7AC10
|
||||
|
@ -189,6 +189,9 @@ void /*$ra*/ InitaliseDrawEnv(struct DB *pBuff /*$s0*/, int x /*$s4*/, int y /*$
|
||||
*/
|
||||
void /*$ra*/ Init_FileSystem()
|
||||
{
|
||||
CdInit();
|
||||
|
||||
VSync(3);
|
||||
}
|
||||
/*
|
||||
* Offset 0x7F8D8
|
||||
|
124
src/main.c
124
src/main.c
@ -236,22 +236,126 @@ void /*$ra*/ StepGame()
|
||||
{ // line 340, address 0x5b34c
|
||||
} // line 342, address 0x5b384
|
||||
} // line 351, address 0x5b3ec
|
||||
|
||||
#define PAL 0
|
||||
#define NTSC 1
|
||||
|
||||
#define RELEASE_REGION PAL
|
||||
#define RELEASE_CD_ID 0
|
||||
|
||||
/*
|
||||
* Offset 0x5B3EC
|
||||
* D:\driver2\game\C\MAIN.C (line 4767)
|
||||
* Stack frame base $sp, length 72
|
||||
* Saved registers at address -8: ra
|
||||
*/
|
||||
int /*$ra*/ main()
|
||||
{ // line 1, address 0x5b3ec
|
||||
{ // line 1, address 0x5b3ec
|
||||
{ // line 1, address 0x5b3ec
|
||||
char *PALScreenNames[4]; // stack address -24
|
||||
char *NTSCScreenNames[4]; // stack address -40
|
||||
char *OPMScreenNames[4]; // stack address -56
|
||||
} // line 1, address 0x5b3ec
|
||||
} // line 1, address 0x5b3ec
|
||||
} // line 101, address 0x5b5b4
|
||||
int main()
|
||||
{
|
||||
SetDispMask(0);
|
||||
VSyncCallbacks(0);
|
||||
ResetCallback(0);
|
||||
ResetGraph();
|
||||
SsSetSerialVol(0, 0, 0);
|
||||
|
||||
SetDispMask(0);
|
||||
SetGraphDebug(0);
|
||||
SetVideoMode(1);
|
||||
|
||||
CdInit();
|
||||
|
||||
SsSetSerialVol(0, 0, 0);
|
||||
|
||||
InitGeom();
|
||||
|
||||
SetGeomOffset(160,128);
|
||||
|
||||
scr_z = 256;
|
||||
SetGeomScreen(256);
|
||||
|
||||
MemCardInit(1);
|
||||
|
||||
InitControllers();
|
||||
|
||||
Init_FileSystem();
|
||||
|
||||
InitSound();
|
||||
|
||||
PlayFMV(99); // play Infogrames render
|
||||
|
||||
char *PALScreenNames[4] = {
|
||||
"GFX\\SPLASH2.TIM",
|
||||
"GFX\\SPLASH3.TIM",
|
||||
"GFX\\SPLASH1P.TIM",
|
||||
NULL
|
||||
};
|
||||
|
||||
char *NTSCScreenNames[4] = {
|
||||
"GFX\\SPLASH2.TIM",
|
||||
"GFX\\SPLASH3.TIM",
|
||||
"GFX\\SPLASH1N.TIM",
|
||||
NULL
|
||||
};
|
||||
|
||||
char *OPMScreenNames[4] = {
|
||||
"GFX\\OPM1.TIM",
|
||||
"GFX\\OPM2.TIM",
|
||||
"GFX\\OPM3.TIM",
|
||||
NULL
|
||||
};
|
||||
|
||||
char* screens[] = {
|
||||
OPMScreenNames[0],
|
||||
OPMScreenNames[1],
|
||||
OPMScreenNames[2],
|
||||
OPMScreenNames[3],
|
||||
|
||||
NTSCScreenNames[0],
|
||||
NTSCScreenNames[1],
|
||||
NTSCScreenNames[2],
|
||||
NTSCScreenNames[3],
|
||||
|
||||
PALScreenNames[0],
|
||||
PALScreenNames[1],
|
||||
PALScreenNames[2],
|
||||
PALScreenNames[3],
|
||||
};
|
||||
|
||||
#if RELEASE_REGION == NTSC
|
||||
char** hiresScreens = &screens[4];
|
||||
#else
|
||||
|
||||
#if RELEASE_REGION == PAL
|
||||
char** hiresScreens = &screens[8];
|
||||
#else
|
||||
char** hiresScreens = &screens[0];
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
ShowHiresScreens(hiresScreens, 300, 1);
|
||||
|
||||
// intro render
|
||||
PlayFMV(0);
|
||||
|
||||
CheckForCorrectDisc(RELEASE_CD_ID);
|
||||
|
||||
LoadFile("FRONTEND.BIN", 0x1C);
|
||||
|
||||
SpuSetMute(0);
|
||||
|
||||
LoadSoundBankDynamic(0, 0, 0);
|
||||
|
||||
// load menu bank
|
||||
LoadBankFromLump(1, 0);
|
||||
|
||||
InitialiseScoreTables();
|
||||
|
||||
DoFrontend();
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Offset 0x5B5B4
|
||||
* D:\driver2\game\C\MAIN.C (line 4893)
|
||||
|
Loading…
Reference in New Issue
Block a user