Skip to content

Commit

Permalink
Levels folder cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Niko committed Dec 3, 2024
1 parent 5e64acf commit 8cde0ab
Show file tree
Hide file tree
Showing 123 changed files with 85 additions and 432 deletions.
15 changes: 0 additions & 15 deletions mods/Levels/2024_NewSetup/StepsToFollow.txt

This file was deleted.

4 changes: 0 additions & 4 deletions mods/Levels/2024_NewSetup/buildList.txt

This file was deleted.

1 change: 0 additions & 1 deletion mods/Levels/2024_NewSetup/sendToDuck.bat

This file was deleted.

Binary file removed mods/Levels/Automate/CTRFramework.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed mods/Levels/Automate/model_reader.exe
Binary file not shown.
Binary file removed mods/Levels/Automate/vrmtool.exe
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,48 @@ struct DramPointerMap
#define DRAM_GETOFFSETS(x) \
((char*)x + sizeof(struct DramPointerMap))

void wait()
{
while (*(int*)&pBuf[(0x8000c000) & 0xffffff] != 3)
{
// do nothing
}
}

void UploadToDuck(char** argv)
{
FILE* f = fopen("dataLEV.bin", "rb");
FILE* f;
int size;

// tell emu to pause, cause LEV is overwritten by VRM
*(int*)&pBuf[(0x8000c000) & 0xffffff] = 1;

// wait 0.1s for emu to actually stop
Sleep(100);

f = fopen("data.vrm", "rb");

fseek(f, 0, SEEK_END);
size = ftell(f);
rewind(f);

// read to 4mb on PS1
fread(&pBuf[0x200000], size, 1, f);

fclose(f);

// tell PS1 to load VRAM
*(int*)&pBuf[(0x8000c000) & 0xffffff] = 2;

// wait for VRAM to finish uploading
wait();

// ============================================

f = fopen("data.lev", "rb");

fseek(f, 0, SEEK_END);
int size = ftell(f);
size = ftell(f);
rewind(f);

// read to 2mb on PS1
Expand All @@ -63,21 +99,11 @@ void UploadToDuck(char** argv)
// set level file pointer
*(int*)&pBuf[(0x80096b20 + 0x160) & 0xffffff] = 0x80200004;

// ============================================

f = fopen("dataVRAM.bin", "rb");

fseek(f, 0, SEEK_END);
size = ftell(f);
rewind(f);

// read to 4mb on PS1
fread(&pBuf[0x400000], size, 1, f);
// tell PS1 to start level
*(int*)&pBuf[(0x8000c000) & 0xffffff] = 4;

fclose(f);
// ============================================

*(int*)&pBuf[(0x8000c000) & 0xffffff] = 1;

printf("Here\n");
system("pause");
exit(0);
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,27 @@ int LOAD_TenStages(struct GameTracker* gGT, int loadingStage, struct BigHeader*

MainInit_PrimMem(gGT);
MainInit_OTMem(gGT);

for(int i = 0; i < 2; i++)
{
struct PrimMem* primMem = &gGT->db[i].primMem;

void* pvVar1 = 0x80600000 + i*0x100000;

// 1MB, take away some padding
int size = 0x100000 - 0x1000;

primMem->size = size;
primMem->unk2 = (int)pvVar1;
primMem->curr = pvVar1;
primMem->start = pvVar1;

// skip alignment by & 0xfffffffc,
// all possible size inputs are already aligned
pvVar1 = (void*)((int)pvVar1 + size);
primMem->end = pvVar1;
primMem->endMin100 = (void*)((int)pvVar1 - 0x100);
}

// if cutscene, adventure arena, or credits
if
Expand Down Expand Up @@ -418,6 +439,10 @@ int LOAD_TenStages(struct GameTracker* gGT, int loadingStage, struct BigHeader*
if (*piVar15 != 0) *piVar15 += 4;
};

// for a test rom, dont do this,
// just load it somewhere in 8mb
#if 0

// If the world you're in is made of multiple LEV files
if ((gGT->gameMode2 & LEV_SWAP) != 0)
{
Expand Down Expand Up @@ -481,6 +506,8 @@ int LOAD_TenStages(struct GameTracker* gGT, int loadingStage, struct BigHeader*
// make all futuere allocations in subpacks
MEMPACK_SwapPacks(gGT->activeMempackIndex);
}

#endif

// game is now loading
sdata->load_inProgress = 1;
Expand Down Expand Up @@ -616,6 +643,7 @@ int LOAD_TenStages(struct GameTracker* gGT, int loadingStage, struct BigHeader*
}
iVar9 = 7;

#if 0
// podium reward
if (gGT->podiumRewardID != 0)
{
Expand Down Expand Up @@ -685,6 +713,7 @@ int LOAD_TenStages(struct GameTracker* gGT, int loadingStage, struct BigHeader*
// Disable LEV instances on Adv Hub, for podium scene
gGT->gameMode2 = gGT->gameMode2 | 0x100;
}
#endif

break;
case 8:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -179,19 +179,31 @@ void RunUpdateHook()
// this gets triggered by the injector
if(*(int*)0x8000c000 == 1)
{
*(int*)0x8000c000 = 0;
while(!ReadyToContinue(2)) {}

void FakeVramCallback();
FakeVramCallback();


// finished uploading
*(int*)0x8000c000 = 3;
while(!ReadyToContinue(4)) {}

gGT->visMem1 = gGT->level1->visMem;
gGT->visMem2 = gGT->visMem1;

*(int*)0x8000c000 = 0;
}
}

__attribute__((optimize("O0")))
int ReadyToContinue(int x)
{
return *(int*)0x8000c000 == x;
}

void FakeVramCallback()
{
int* vramBuf = 0x80400000;
int* vramBuf = 0x80200000;
struct VramHeader* vh = vramBuf;

// if multiple TIMs are packed together
Expand Down
File renamed without changes.
File renamed without changes.
Binary file removed mods/Levels/TileTrauma/src/dataVRAM.bin
Binary file not shown.
1 change: 0 additions & 1 deletion mods/Levels/WorkingLapTest/build.bat

This file was deleted.

Loading

0 comments on commit 8cde0ab

Please sign in to comment.