Skip to content

Commit

Permalink
Merge pull request #138 from TheOnlyZac/theonlyzac-working
Browse files Browse the repository at this point in the history
Unblock StartupVU0 and StartupVU1
  • Loading branch information
TheOnlyZac authored Dec 5, 2024
2 parents df0c577 + 24ca25f commit fe2cb75
Show file tree
Hide file tree
Showing 7 changed files with 149 additions and 95 deletions.
18 changes: 8 additions & 10 deletions config/sly1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -339,20 +339,18 @@ segments:
#- [0x, data, P2/dialog]

- [0x162d70, data, P2/difficulty]
- [0x162f14, data]

#- [0x162f14, data, P2/dl]
#- [0x, data, P2/dmas]
#- [0x, data, P2/dsp]
#- [0x, data, P2/dysh]
#- [0x, data, P2/dzg]
#- [0x, data, P2/emitter]
#- [n/a, data, P2/dl]
- [0x162f14, data, P2/dmas]
#- [n/a, data, P2/dsp]
- [0x162f30, data, P2/dysh]
#- [n/a, data, P2/dzg]
- [0x162f80, data, P2/emitter]
#- [0x, data, P2/eyes]
#- [0x, data, P2/fader]
#- [0x, data] #? unknown file
#- [0x, data, P2/???] #? unknown file
#- [0x, data, P2/find]
#- [0x, data, P2/flash]
#- [0x, data, P2/fly]
- [0x163180, data, P2/fly]
#- [0x, data, P2/font]
#- [0x, data, P2/frm]
#- [0x, data, P2/freeze]
Expand Down
119 changes: 77 additions & 42 deletions config/symbol_addrs.txt
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// MISC/UNKNOWN
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
_start = 0x100008; // type:func
_exit = 0x1000B8; // type:func

////////////////////////////////////////////////////////////////
// UNKNOWN MISCELLANEOUS
////////////////////////////////////////////////////////////////
__builtin_delete = 0x18d778; // type:func
memcmp = 0x1F59C4; // type:func

PvAllocGlobalImpl__Fi = 0x18D4B0; // type:func

_gpReg = 0x2832F0;

g_chzCiphertext = 0x2483b8; // size:0x9
g_chzThePasswordIs = 0x24a848; // size:0x14

//g_rng = 0x276680; // size:0x5c
//g_prng = 0x27696c; // size:0x4

// start of .vutext section
D_00211E10 = 0x211E10; // size:0x4


////////////////////////////////////////////////////////////////
// Unknown file
Expand All @@ -24,18 +27,22 @@ UpdateSave__FP4SAVE = 0x18bdc8; // type:func
g_save = 0x264A40;


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// P2 ENGINE
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////
// P2/splice/method.cpp
////////////////////////////////////////////////////////////////
PmethodNew__Fv = 0x11AE78; // type:func
PmethodNew__Fv = 0x11AE78; // type:func


////////////////////////////////////////////////////////////////
// P2/splice/pair.cpp
////////////////////////////////////////////////////////////////
CloneTo__5CPairP5CPairP6CFrame = 0x11AEB8; // type:func
PpairNew__Fv = 0x11AF28; // type:func
DeletePair__FP5CPair = 0x11AF78; // type:func
CloneTo__5CPairP5CPairP6CFrame = 0x11AEB8; // type:func
PpairNew__Fv = 0x11AF28; // type:func
DeletePair__FP5CPair = 0x11AF78; // type:func


////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -728,6 +735,15 @@ g_difficultyHard = 0x261e30; // size:0x5c
g_difficultyEasy = 0x261e90; // size:0x5c
g_difficulty = 0x261ef0; // size:0x20

////////////////////////////////////////////////////////////////
// P2/dmas.c
////////////////////////////////////////////////////////////////
g_pdcVif0 = 0x261f14; // size:0x4
g_pdcVif1 = 0x261f18; // size:0x4
g_pdcGiftag = 0x261f1c; // size:0x4
g_pdcFromSpr = 0x261f20; // size:0x4
g_pdcToSpr = 0x261f24; // size:0x4

////////////////////////////////////////////////////////////////
// P2/dl.c
////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1033,6 +1049,12 @@ g_chpzArgs = 0x264834; // size:0x4
g_aphzArgs = 0x264838; // size:0x4


////////////////////////////////////////////////////////////////
// P2/memory.c
////////////////////////////////////////////////////////////////
PvAllocGlobalImpl__Fi = 0x18D4B0; // type:func


////////////////////////////////////////////////////////////////
// P2/mpeg.c
////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -1472,57 +1494,75 @@ PostCameraLoad__FP6CAMERA = 0x1F4E48; // type:func
EnableCamera__FP6CAMERA = 0x1F4ED0; // type:func


////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// LIBRARIES
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////
// sce/ee/gcc/src/gcc/libgcc2.c
// ../../../../../../src/newlib/libc/machine/r5900/memcmp.S
////////////////////////////////////////////////////////////////
__main__Fv = 0x1fae18; // type:func
memcmp = 0x1F59C4; // type:func


////////////////////////////////////////////////////////////////
// sce/ee/gcc/src/newlib/libm/math/wf_atan2.c
// /usr/local/sce/ee/gcc/src/newlib/libc/stdlib/rand.c
////////////////////////////////////////////////////////////////
atan2f = 0x205778; // type:func
srand = 0x1F66F8; // type:func
rand = 0x1F6708; // type:func


////////////////////////////////////////////////////////////////
// sce/ee/gcc/src/newlib/libm/math/wf_atan2.c
// klib.s
////////////////////////////////////////////////////////////////
fmodf = 0x2058a0; // type:func
CreateThread = 0x1F6A10; // type:func
ChangeThreadPriority = 0x1F6A50; // type:func
GetThreadId = 0x1F6A90; // type:func
CreateSema = 0x1F6B20; // type:func
SignalSema = 0x1F6B40; // type:func
WaitSema = 0x1F6B60; // type:func
FlushCache = 0x1F6C20; // type:func


////////////////////////////////////////////////////////////////
// sce/dma.c
// filestub.c
////////////////////////////////////////////////////////////////
sceDmaGetChan = 0x2027A0; // type:func
sceDmaReset = 0x2027C8; // type:func
sceDmaSend = 0x202A80; // type:func
sceClose = 0x1f8c38; // type:func


////////////////////////////////////////////////////////////////
// sce/eecdvd.c
// /usr/local/sce/ee/gcc/src/newlib/libc/stdlib/rand.c
////////////////////////////////////////////////////////////////
sceCdBreak = 0x203e28; // type:func
__main__Fv = 0x1fae18; // type:func


////////////////////////////////////////////////////////////////
// sce/filestub.c
// /usr/local/sce/ee/gcc/build/gcc/dp-bit.c
////////////////////////////////////////////////////////////////
sceClose = 0x1f8c38; // type:func
dpcmp = 0x1FD308; // type:func
fptodp = 0x1FD868; // type:func


////////////////////////////////////////////////////////////////
// sce/klib.c
// libdma.c
////////////////////////////////////////////////////////////////
CreateThread = 0x1F6A10; // type:func
ChangeThreadPriority = 0x1F6A50; // type:func
GetThreadId = 0x1F6A90; // type:func
CreateSema = 0x1F6B20; // type:func
SignalSema = 0x1F6B40; // type:func
WaitSema = 0x1F6B60; // type:func
FlushCache = 0x1F6C20; // type:func
memclr = 0x202768; // type:func
sceDmaGetChan = 0x2027A0; // type:func
sceDmaReset = 0x2027C8; // type:func
sceDmaPutEnv = 0x2028a8; // type:func
sceDmaSend = 0x202A80; // type:func
sceDmaRecv = 0x202b68; // type:func
sceDmaSync = 0x202c38; // type:func


////////////////////////////////////////////////////////////////
// ../eecdvd.c
////////////////////////////////////////////////////////////////
sceCdBreak = 0x203e28; // type:func


////////////////////////////////////////////////////////////////
// sce/pad.c
// libpad.c
////////////////////////////////////////////////////////////////
scePadInit = 0x2040E8; // type:func
scePadPortOpen = 0x2042C8; // type:func
Expand All @@ -1536,20 +1576,15 @@ scePadEnterPressMode = 0x204D48; // type:func


////////////////////////////////////////////////////////////////
// sce/rand.c
// /usr/local/sce/ee/gcc/src/gcc/libgcc2.c
////////////////////////////////////////////////////////////////
srand = 0x1F66F8; // type:func
rand = 0x1F6708; // type:func

g_rng = 0x276680; // size:0x5c
g_prng = 0x27696c; // size:0x4
atan2f = 0x205778; // type:func


////////////////////////////////////////////////////////////////
// gcc/dp-bit.c
// sce/ee/gcc/src/newlib/libm/math/wf_atan2.c
////////////////////////////////////////////////////////////////
dpcmp = 0x1FD308; // type:func
fptodp = 0x1FD868; // type:func
fmodf = 0x2058a0; // type:func


////////////////////////////////////////////////////////////////
Expand Down
8 changes: 7 additions & 1 deletion include/dmas.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@
#ifndef DMAS_H
#define DMAS_H

#include <sdk/ee/dma.h>
#include <sce/libdma.h>
#include <sdk/ee/eekernel.h>
#include "common.h"
#include <shd.h>

extern sceDmaChan *g_pdcVif0;
extern sceDmaChan *g_pdcVif1;
extern sceDmaChan *g_pdcGif;
extern sceDmaChan *g_pdcFromSpr;
extern sceDmaChan *g_pdcToSpr;

class DMAS
{
uchar* m_pbMax;
Expand Down
14 changes: 14 additions & 0 deletions include/dysh.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/**
* @file dysh.h
*
* @brief Dynamic shader(?)
*/
#ifndef DYSH_H
#define DYSH_H

#include "common.h"
#include <mat.h>

static MATRIX4 s_matUvToClip;

#endif // DYSH_H
27 changes: 17 additions & 10 deletions include/sdk/ee/dma.h → include/sce/libdma.h
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* @file include/sdk/ee/libdma.h
* @file libdma.h
*
* @brief Direct Memory Access library.
* @brief Direct memory access library.
*/
#ifndef SCE_DMA_H
#define SCE_DMA_H
#ifndef LIBDMA_H
#define LIBDMA_H

typedef unsigned char u_char;
typedef unsigned short u_short;
Expand Down Expand Up @@ -61,6 +61,14 @@ extern "C"
u_int p8[3];
};

/**
* @brief Get a DMA channel structure by ID
*
* @param id Channel number
* @return sceDmaChan*
*/
sceDmaChan *sceDmaGetChan(int id);

/**
* @brief Reset the DMA controller
*
Expand All @@ -69,6 +77,8 @@ extern "C"
*/
int sceDmaReset(int mode);

// ...

/**
* @brief Start DMA transfer from memory to a device using Source Chain Mode.
*
Expand All @@ -78,12 +88,9 @@ extern "C"
void sceDmaSend(sceDmaChan *chan, void *tag);

/**
* @brief Get a DMA channel structure by ID
*
* @param id Channel number
* @return sceDmaChan*
* @todo Document this function.
*/
sceDmaChan *sceDmaGetChan(int id);
u_int sceDmaSync(sceDmaChan *pdmaChan, int mode, int timeout);
}

#endif // SCE_DMA_H
#endif // LIBDMA_H
3 changes: 0 additions & 3 deletions include/sce/rand.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ extern "C"
* @brief Generate a random number.
*/
u_int rand();

extern struct RNG g_rng;
extern struct RNG *g_prng;
};

#endif // RAND_H
Loading

0 comments on commit fe2cb75

Please sign in to comment.