Overhaul the build system (#234)

* wip

* fix

* add disassembler

* Disasm builds OK

* Variable addends

* More wip

* Rodata migration implemented

* Cleanup old tools

* Try fix submodule -> subrepo merge

* git subrepo pull --force --remote=https://github.com/zeldaret/ZAPD.git tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "602e609"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "602e609"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

* Builds again but assets are totally broken

* git subrepo pull --force tools/asm-processor

subrepo:
  subdir:   "tools/asm-processor"
  merged:   "1ffdb08a"
upstream:
  origin:   "https://github.com/simonlindholm/asm-processor.git"
  branch:   "master"
  commit:   "1ffdb08a"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

* More cleanup, move functions.txt and variables.txt to tools/disasm and rm tables

* rm z64compress in preparation for subrepo

* git subrepo clone (merge) https://github.com/z64me/z64compress.git tools/z64compress

subrepo:
  subdir:   "tools/z64compress"
  merged:   "eb11085c"
upstream:
  origin:   "https://github.com/z64me/z64compress.git"
  branch:   "main"
  commit:   "eb11085c"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

* Fix asset extraction

* Fix diff-init make rule

* Split code bss

* Split assumed linker bug padding from assembly files

* add filelists for mm.us.rev1

* Maybe working, but I'm not sure

* add overlays to spec

* Add rodata to actos

* Everything compiles

* Make a lot of C files for code

* Add almost every file in code to spec

* whoops

* 3 code files left

* add scenes to spec

* More progress on progress.py

* Fix skelanime in spec

* audio files!

* Fix merge issues

* Fix some C files in code

* Fix remaining code files

* Use existing O1 C files in spec

* reorder boot order in spec

* update spec

* fault.c

* Convert relocs on completed actors, fixbaserom uses current rom name

* more boot files

* Add VT macros and script

* finish already existing boot files

* most of  libultra

* fix 64bits libultra files

* Use C files for libultra, wrap some functions in NON_MATCHING

* Remove duplicate of OS_CLOCK_RATE from fault.c

* C files for fbdemos

* delete dumb files

* bootstrap C files, still need to add them to the spec

* update fixbaserom

* boot OK?

* I forgot to commit the spec

* C for gamestates

* C for kaleido

* Change all includes to ""

* copy actor sizes script from oot

* I forgot to delete those files

* Basic C files for effects

* Add effects initvars names

* Remove mislabelled boot functions from header/txt

* Begin porting bootstrap_fx, some sizes

* Fix <>

* Fix enum

* Fix diff.py

* fix libultra stuff

* update regconvert

* update setup warnings

* add some missing ;

* Fix some makefile stuff and other fixes on some non_matching functions

* add executable flag in extract_baserom and fixbaserom

* fix relative path

* copy assist from oot

* fix map path

* another assist path fix

* Delete C files for handwritten files

* add code_801A51F0 to spec

* add gfxbuffers to spec

* Move rodata to top of each file when possible

* UNK_TYPEs for func_801A51F0

* Remove kaleido rodata from spec

* Update spec and undefined_syms for recent merge

* GCC warnings and fix errors in nonmatchings,

* round percentage numbers

* progress script: format changes

* progress: error on non-existing files

* fix warning in z_scene_table

* Match 2 nonmatchings in z_actor

* Warnings in lightswitch and invadepoh

* Fix warning in z_actor_dlftbls

* I though I fixed this one

* whoops

* Comment out CC_CHECK

* Removed redundant ultra64.h includes

* Update asm_processor, sorted boot_O1 into other folders, completed the fbdemo bootstrap, cleaned up undefined_syms

* Completed gamestates bootstrap

* Split kaleido_scope

* Remove section.h and segment.h, move keep object externs to a common location in variables.h

* Completed effects bootstrap

* Segmented address externs for effects, fbdemos, gamestates and kaleido

* Move actor data externs out of the if 0

* Segmented address externs for actors

* Prepare actionfunc detection

* fix script, how did it even work before

* Fix actionfunc script again, re-introduce some more intermediate prints to the disassembler

* Automated actionFunc detection in actors

* Segmented addresses from player .text

* rm old segment addrs script and fix build

* Move sizes folder to tools

* Make build.py executable

* New Jenkinsfile Prayge

* Remove numpy dependencies

* Add warnings_disasm_current.txt

* my bad

* Update spec and undefined_syms

* Add z_eff_ss_hahen to pametfrog

* git subrepo pull (merge) --force tools/z64compress

subrepo:
  subdir:   "tools/z64compress"
  merged:   "163ca2af"
upstream:
  origin:   "https://github.com/z64me/z64compress.git"
  branch:   "main"
  commit:   "163ca2af"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo"
  commit:   "2f68596"

* Make z64compress print to stdout

* sneeky commit to update warnings tooling

* test

* Another test

* Mark fixing overlay reloc generating as a TODO

* Update warnings stuff

* Communicate the return code from running z64compress back to the Makefile through the wrapper

* Run formatter, remove extra commented copy of function

* Re-fix some includes

* Convert atan to hex to conform to decided style

* Some tidying up, remove c for fp and the other two handwritten code files

* BSS in z_collision_check & z_scene_proc

* add static back in

* Fix timerintr bss, add file to spec, some cleanup

* Remove externs

* Newline

* Readd enums

* Typo

* Colours

* Comments for hitmark enum values

Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com>

* Improvements and suggestions

* Organize and remove unused imports and use env for python3 scripts, delete unused overlay.py

Co-authored-by: angie <angheloalf95@gmail.com>
Co-authored-by: Elliptic Ellipsis <elliptic.ellipsis@gmail.com>
Co-authored-by: engineer124 <engineer124engineer124@gmail.com>
Co-authored-by: EllipticEllipsis <73679967+EllipticEllipsis@users.noreply.github.com>
This commit is contained in:
Tharo
2021-08-04 04:21:31 +01:00
committed by GitHub
parent 60ff207982
commit 7743e5a2c4
1788 changed files with 88892 additions and 47119 deletions
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/__osMemcpy/__osMemcpy.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/__osMemset/__osMemset.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/__osStrcpy/__osStrcpy.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/afterprenmi/osAfterPreNMI.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/aisetfreq/osAiSetFrequency.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/bcopy/bcopy.s")
-30
View File
@@ -1,30 +0,0 @@
#include <ultra64.h>
#include <global.h>
UNK_RET func_80087900(UNK_PTR a0, UNK_TYPE a1, UNK_PTR a2) {
func_8008E050((UNK_TYPE(*)(UNK_TYPE, UNK_TYPE, UNK_TYPE))(*(u32*)a0), a0, a1, a2);
}
UNK_RET func_80087934(UNK_PTR a0, UNK_TYPE a1, UNK_PTR a2, UNK_TYPE a3) {
func_80087900(a0, a1, &a2);
}
UNK_RET func_80087960(UNK_ARGS a0) {
}
UNK_RET func_800879CC(u32 a0) {
func_80087960(func_800888A8(func_800889A8(a0, 3), 64));
}
UNK_RET func_80087A1C(u32 a0) {
func_80087960(func_800888A8(func_800889A8(a0, 3000), 64));
}
UNK_RET func_80087A6C(UNK_TYPE a0) {
func_80087960(func_800888A8(func_800889A8(a0, 0x02CB4178), 1000));
}
UNK_RET func_80087AC0(u32 a0) {
func_80087960(func_800889A8(a0, 0x02CB4178));
}
-61
View File
@@ -1,61 +0,0 @@
#include <ultra64.h>
#include <global.h>
OSPiHandle* func_80092920(void) {
u32 v0;
u32 temp;
u32 temp2;
u32 temp3;
u32 temp4;
UNK_TYPE func_ret;
func_8008C1E0();
if (D_800980D0 == 0) {
func_8008C224();
return &D_8009E610;
}
D_800980D0 = 0; // TODO volatile?
D_8009E610.type = 0;
D_8009E610.baseAddress = 0xB0000000;
D_8009E610.domain = 0;
D_8009E610.speed = 0;
func_80089630(&D_8009E624, 96);
while ((*(vu32*)0xA4600010) & 0x3);
temp = *(vu32*)0xA4600014;
temp2 = *(vu32*)0xA460001C;
temp3 = *(vu32*)0xA4600020;
temp4 = *(vu32*)0xA4600018;
*(vu32*)0xA4600014 = 255;
*(vu32*)0xA460001C = 0;
*(vu32*)0xA4600020 = 3;
*(vu32*)0xA4600018 = 255;
v0 = *(u32*)(D_8009E610.baseAddress | 0xA0000000);
D_8009E610.pageSize = (v0 >> 16) & 0xF;
D_8009E610.relDuration = (v0 >> 20) & 0xF;
D_8009E610.pulse = v0 >> 8;
D_8009E610.latency = v0;
*(vu32*)0xA4600014 = temp;
*(vu32*)0xA460001C = temp2;
*(vu32*)0xA4600020 = temp3;
*(vu32*)0xA4600018 = temp4;
func_ret = func_80091A60();
D_8009E610.next = osPiHandleListHead;
osPiHandleListHead = &D_8009E610;
func_80091AD0(func_ret);
func_8008C224();
return &D_8009E610;
}
+27
View File
@@ -0,0 +1,27 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/boot_80086760/func_80086760.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/boot_80086760/func_80086794.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/boot_80086760/func_800867B4.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/boot_80086760/func_800867D4.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/boot_80086760/func_800867F4.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/boot_80086760/func_80086814.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/boot_80086760/func_80086834.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/boot_80086760/func_80086880.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/boot_80086760/func_800869A4.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/boot_80086760/func_80086AF0.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/boot_80086760/func_80086B30.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/boot_80086760/func_80086C18.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/boot_80086760/func_80086C48.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/cartrominit/osCartRomInit.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/contchannelreset/__osContChannelReset.s")
+15
View File
@@ -0,0 +1,15 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/contpfs/__osSumcalc.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/contpfs/__osIdCheckSum.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/contpfs/__osRepairPackId.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/contpfs/__osCheckPackId.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/contpfs/__osGetId.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/contpfs/__osCheckId.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/contpfs/__osPfsRWInode.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/contramread/__osContRamRead.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/contramwrite/__osContRamWrite.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/cosf/__cosf.s")
+5
View File
@@ -0,0 +1,5 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/crc/__osContAddressCrc.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/crc/__osContDataCrc.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/devmgr/__osDevMgrMain.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/epilinkhandle/osEPiLinkHandle.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/epirawdma/osEPiRawStartDma.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/epirawread/osEPiRawReadIo.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/epiread/osEPiReadIo.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/epiwrite/osEPiWriteIo.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/fmodf/fmodf.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/getfpccsr/__osGetFpcCsr.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/guS2DInitBg/guS2DInitBg.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/invaldcache/osInvalDCache.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/invalicache/osInvalICache.s")
+7
View File
@@ -0,0 +1,7 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/loadfragment/Load_Relocate.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/loadfragment/Load_LoadOverlay.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/loadfragment/Load_AllocateAndLoad.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/memcmp/memcmp.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/normalize/guNormalize.s")
+5
View File
@@ -0,0 +1,5 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfsallocatefile/osPfsAllocateFile.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfsallocatefile/__osPfsDeclearPage.s")
+7
View File
@@ -0,0 +1,7 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfschecker/osPfsChecker.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfschecker/corrupted_init.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfschecker/corrupted.s")
+5
View File
@@ -0,0 +1,5 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfsdeletefile/osPfsDeleteFile.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfsdeletefile/__osPfsReleasePages.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfsfilestate/osPfsFileState.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfsfreeblocks/osPfsFreeBlocks.s")
+7
View File
@@ -0,0 +1,7 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfsgetstatus/__osPfsGetStatus.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfsgetstatus/__osPfsRequestOneChannel.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfsgetstatus/__osPfsGetOneChannelData.s")
+5
View File
@@ -0,0 +1,5 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfsinitpak/osPfsInitPak.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfsinitpak/__osPfsCheckRamArea.s")
+7
View File
@@ -0,0 +1,7 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfsisplug/osPfsIsPlug.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfsisplug/__osPfsRequestData.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfsisplug/__osPfsGetInitData.s")
+5
View File
@@ -0,0 +1,5 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfsreadwritefile/__osPfsGetNextPage.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfsreadwritefile/osPfsReadWriteFile.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfssearchfile/osPfsFindFile.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/pfsselectbank/__osPfsSelectBank.s")
+5
View File
@@ -0,0 +1,5 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/position/guPositionF.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/position/guPosition.s")
+15
View File
@@ -0,0 +1,15 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/printutils/PrintUtils_VPrintf.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/printutils/PrintUtils_Printf.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/printutils/Sleep_Cycles.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/printutils/Sleep_Nsec.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/printutils/Sleep_Usec.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/printutils/Sleep_Msec.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/printutils/Sleep_Sec.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/resetglobalintmask/__osResetGlobalIntMask.s")
+7
View File
@@ -0,0 +1,7 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/rumblepak/osSetRumble.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/rumblepak/osSetUpMempakWrite.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/rumblepak/osProbeRumblePak.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/setfpccsr/__osSetFpcCsr.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/setglobalintmask/__osSetGlobalIntMask.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/sethwinterrupt/__osSetHWIntrRoutine.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/sp/__osSpDeviceBusy.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/spsetpc/__osSpSetPc.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/sqrtf/sqrtf.s")
+21
View File
@@ -0,0 +1,21 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/system_malloc/StartHeap_Alloc.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/system_malloc/StartHeap_AllocR.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/system_malloc/StartHeap_Realloc.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/system_malloc/StartHeap_Free.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/system_malloc/StartHeap_Calloc.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/system_malloc/StartHeap_AnalyzeArena.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/system_malloc/StartHeap_CheckArena.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/system_malloc/StartHeap_InitArena.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/system_malloc/StartHeap_Cleanup.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/system_malloc/StartHeap_IsInitialized.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/vigetcurrframebuf/osViGetCurrentFramebuffer.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/viswapcontext/__osViSwapContext.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/voicecheckword/osVoiceCheckWord.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/voicecleardictionary/osVoiceClearDictionary.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/voicecontread2/__osVoiceContRead2.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/voicecontread36/__osVoiceContRead36.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/voicecontrolgain/osVoiceControlGain.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/voicecontwrite20/__osVoiceContWrite20.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/voicecontwrite4/__osVoiceContWrite4.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/voicecrc/__osVoiceContDataCrc.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/voicegetreaddata/osVoiceGetReadData.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/voiceinit/osVoiceInit.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/voicemaskdictionary/osVoiceMaskDictionary.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/voicesetadconverter/__osVoiceSetADConverter.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/voicestartreaddata/osVoiceStartReadData.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/voicestopread/osVoiceStopReadData.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/writebackdcache/osWritebackDCache.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/writebackdcacheall/osWritebackDCacheAll.s")
+7
View File
@@ -0,0 +1,7 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/xldtob/_Ldtob.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/xldtob/_Ldunscale.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/xldtob/_Genld.s")
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/xlitob/_Litob.s")
-6
View File
@@ -1,6 +0,0 @@
#include <ultra64.h>
#include <global.h>
void func_80087E00(u32 a0) {
__additional_scanline = a0;
}
+8 -7
View File
@@ -1,5 +1,4 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
#define FILL_ALLOCBLOCK (1 << 0)
#define FILL_FREEBLOCK (1 << 1)
@@ -16,6 +15,8 @@
extern OSMesg sArenaLockMsg[1];
#pragma GLOBAL_ASM("asm/non_matchings/boot/__osMalloc/D_80099110.s")
void ArenaImpl_LockInit(Arena* arena) {
osCreateMesgQueue(&arena->lock, sArenaLockMsg, ARRAY_COUNT(sArenaLockMsg));
}
@@ -28,7 +29,7 @@ void ArenaImpl_Unlock(Arena* arena) {
osRecvMesg(&arena->lock, NULL, OS_MESG_BLOCK);
}
ArenaNode* heap_get_tail(Arena* arena) {
ArenaNode* ArenaImpl_GetLastBlock(Arena* arena) {
ArenaNode* last;
ArenaNode* iter;
@@ -69,7 +70,7 @@ void __osMallocAddBlock(Arena* arena, void* start, s32 size) {
firstNode->isFree = 1;
firstNode->magic = NODE_MAGIC;
ArenaImpl_Lock(arena);
lastNode = heap_get_tail(arena);
lastNode = ArenaImpl_GetLastBlock(arena);
if (lastNode == NULL) {
arena->head = firstNode;
arena->start = start;
@@ -141,7 +142,7 @@ void* __osMallocR(Arena* arena, u32 size) {
size = ALIGN16(size);
ArenaImpl_Lock(arena);
iter = heap_get_tail(arena);
iter = ArenaImpl_GetLastBlock(arena);
while (iter != NULL) {
if (iter->isFree && iter->size >= size) {
@@ -216,7 +217,7 @@ end:
ArenaImpl_Unlock(arena);
}
#pragma GLOBAL_ASM("./asm/non_matchings/boot/__osMalloc/__osRealloc.asm")
#pragma GLOBAL_ASM("asm/non_matchings/boot/__osMalloc/__osRealloc.s")
void __osAnalyzeArena(Arena* arena, u32* outMaxFree, u32* outFree, u32* outAlloc) {
ArenaNode* iter;
@@ -244,4 +245,4 @@ void __osAnalyzeArena(Arena* arena, u32* outMaxFree, u32* outFree, u32* outAlloc
ArenaImpl_Unlock(arena);
}
#pragma GLOBAL_ASM("./asm/non_matchings/boot/__osMalloc/__osCheckArena.asm")
#pragma GLOBAL_ASM("asm/non_matchings/boot/__osMalloc/__osCheckArena.s")
@@ -1,7 +1,6 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
void assert_fail(const char* file, u32 lineNum) {
void __assert(const char* file, u32 lineNum) {
osGetThreadId(NULL);
Fault_AddHungupAndCrash(file, lineNum);
}
-20
View File
@@ -1,20 +0,0 @@
#include <ultra64.h>
#include <global.h>
#pragma GLOBAL_ASM("./asm/non_matchings/boot/boot_0x800862E0/StartHeap_AllocMin1.asm")
#pragma GLOBAL_ASM("./asm/non_matchings/boot/boot_0x800862E0/StartHeap_FreeNull.asm")
#pragma GLOBAL_ASM("./asm/non_matchings/boot/boot_0x800862E0/func_8008633C.asm")
#pragma GLOBAL_ASM("./asm/non_matchings/boot/boot_0x800862E0/func_800863AC.asm")
#pragma GLOBAL_ASM("./asm/non_matchings/boot/boot_0x800862E0/func_8008641C.asm")
#pragma GLOBAL_ASM("./asm/non_matchings/boot/boot_0x800862E0/func_800864EC.asm")
#pragma GLOBAL_ASM("./asm/non_matchings/boot/boot_0x800862E0/func_80086588.asm")
#pragma GLOBAL_ASM("./asm/non_matchings/boot/boot_0x800862E0/StartHeap_Init.asm")
#pragma GLOBAL_ASM("./asm/non_matchings/boot/boot_0x800862E0/func_80086620.asm")
@@ -1,10 +1,10 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
void func_80084940(void) {
u32 sp;
sp = __osSpGetStatus();
osDpGetStatus();
u32 spStatus = __osSpGetStatus();
u32 dpStatus = osDpGetStatus();
if (spStatus && dpStatus) {} // stubbed debug prints
}
void func_80084968(void) {
+17
View File
@@ -0,0 +1,17 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/boot_800862E0/StartHeap_AllocMin1.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/boot_800862E0/StartHeap_FreeNull.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/boot_800862E0/func_8008633C.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/boot_800862E0/func_800863AC.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/boot_800862E0/func_8008641C.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/boot_800862E0/func_800864EC.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/boot_800862E0/func_80086588.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/boot_800862E0/StartHeap_Init.s")
+4 -5
View File
@@ -1,5 +1,4 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
extern u16 sGfxPrintFontTLUT[64];
extern u16 sGfxPrintUnkTLUT[16];
@@ -109,10 +108,10 @@ void GfxPrint_PrintCharImpl(GfxPrint* this, u8 c) {
this->posX += 32;
}
#else
#pragma GLOBAL_ASM("./asm/non_matchings/boot/gfxprint/GfxPrint_PrintCharImpl.asm")
#pragma GLOBAL_ASM("asm/non_matchings/boot/gfxprint/GfxPrint_PrintCharImpl.s")
#endif
#pragma GLOBAL_ASM("./asm/non_matchings/boot/gfxprint/GfxPrint_PrintChar.asm")
#pragma GLOBAL_ASM("asm/non_matchings/boot/gfxprint/GfxPrint_PrintChar.s")
void GfxPrint_PrintStringWithSize(GfxPrint* this, const void* buffer, size_t charSize, size_t charCount) {
const char* str = (const char*)buffer;
@@ -173,7 +172,7 @@ Gfx* GfxPrint_Close(GfxPrint* this) {
}
void GfxPrint_VPrintf(GfxPrint* this, const char* fmt, va_list args) {
func_80087900(&this->callback, fmt, args);
PrintUtils_VPrintf(&this->callback, fmt, args);
}
void GfxPrint_Printf(GfxPrint* this, const char* fmt, ...) {
+7 -8
View File
@@ -1,12 +1,11 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
UNK_TYPE4 D_80096C30 = 2;
#ifdef NON_MATCHING
// This needs lots of work. Mostly regalloc and getting the address of D_80096C30 placed in s5 at the beginning of the
// function
void Load2_Relocate(u32 allocatedVRamAddr, OverlayBlockSizes* overlayInfo, u32 vRamStart) {
void Load2_Relocate(u32 allocatedVRamAddr, OverlayRelocationSection* overlayInfo, u32 vRamStart) {
s32 sectionLocations[4];
u32* regReferences[32];
u32 regValues[32];
@@ -22,7 +21,7 @@ void Load2_Relocate(u32 allocatedVRamAddr, OverlayBlockSizes* overlayInfo, u32 v
sectionLocations[1] = allocatedVRamAddr;
sectionLocations[2] = overlayInfo->textSize + allocatedVRamAddr;
sectionLocations[3] = sectionLocations[2] + overlayInfo->dataSize;
for (i = 0, relocationIndex = 0; i < overlayInfo->amountOfRelocations; relocationIndex++) {
for (i = 0, relocationIndex = 0; i < overlayInfo->nRelocations; relocationIndex++) {
relocation = overlayInfo->relocations[relocationIndex];
i++;
inst = (u32*)(sectionLocations[relocation >> 0x1e] + (relocation & 0xffffff));
@@ -59,7 +58,7 @@ void Load2_Relocate(u32 allocatedVRamAddr, OverlayBlockSizes* overlayInfo, u32 v
}
}
#else
#pragma GLOBAL_ASM("./asm/non_matchings/boot/loadfragment2/Load2_Relocate.asm")
#pragma GLOBAL_ASM("asm/non_matchings/boot/loadfragment2/Load2_Relocate.s")
#endif
#ifdef NON_MATCHING
@@ -69,7 +68,7 @@ s32 Load2_LoadOverlay(u32 vRomStart, u32 vRomEnd, u32 vRamStart, u32 vRamEnd, u3
u32 pad;
u32 size;
void* end;
OverlayBlockSizes* overlayInfo;
OverlayRelocationSection* overlayInfo;
size = vRomEnd - vRomStart;
@@ -80,7 +79,7 @@ s32 Load2_LoadOverlay(u32 vRomStart, u32 vRomEnd, u32 vRamStart, u32 vRamEnd, u3
DmaMgr_SendRequest0(allocatedVRamAddr, vRomStart, size);
end = (void*)(allocatedVRamAddr + size);
overlayInfo = (OverlayBlockSizes*)((int)end - *(int*)((int)end + -4));
overlayInfo = (OverlayRelocationSection*)((int)end - *(int*)((int)end + -4));
if (1) {
;
@@ -99,7 +98,7 @@ s32 Load2_LoadOverlay(u32 vRomStart, u32 vRomEnd, u32 vRamStart, u32 vRamEnd, u3
return nbytes;
}
#else
#pragma GLOBAL_ASM("./asm/non_matchings/boot/loadfragment2/Load2_LoadOverlay.asm")
#pragma GLOBAL_ASM("asm/non_matchings/boot/loadfragment2/Load2_LoadOverlay.s")
#endif
void* Load2_AllocateAndLoad(u32 vRomStart, u32 vRomEnd, u32 vRamStart, u32 vRamEnd) {
+1 -2
View File
@@ -1,5 +1,4 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
void MtxConv_F2L(MatrixInternal* m1, MtxF* m2) {
s32 i;
+3
View File
@@ -0,0 +1,3 @@
#include "global.h"
#pragma GLOBAL_ASM("asm/non_matchings/boot/padsetup/func_80086620.s")
+1 -2
View File
@@ -1,5 +1,4 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
void PadUtils_Init(Input* input) {
bzero(input, sizeof(Input));
@@ -1,5 +1,4 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
#define RAND_MULTIPLIER 1664525
#define RAND_INCREMENT 1013904223
+1 -2
View File
@@ -1,5 +1,4 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
StackEntry* sStackInfoListStart = NULL;
StackEntry* sStackInfoListEnd = NULL;
+1 -2
View File
@@ -1,5 +1,4 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
void CIC6105_Nop80081820(void) {
}
@@ -1,10 +1,9 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
/*
* Compare strings (strcmp).
*/
s32 func_800968B0(const char* str1, const char* str2) {
s32 __osMemcmp(const char* str1, const char* str2) {
char currentCharStr1;
char currentCharStr2;
do {
-11
View File
@@ -1,11 +0,0 @@
#include <ultra64.h>
#include <global.h>
// This file contains print functions that are used by fault.c, so they are placed in the fault module
void Fault_Nop80081920(UNK_TYPE4 param_1, ...) {
}
void Fault_Log(char* str, ...) {
}
void Fault_Nop80081958(UNK_TYPE4 param_1, ...) {
}
+1 -2
View File
@@ -1,5 +1,4 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
void bootproc(void) {
StackCheck_Init(&sBootThreadInfo, sBootThreadStack, sBootThreadStack + sizeof(sBootThreadStack), 0, -1, "boot");
@@ -1,8 +1,7 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
#include "vt.h"
// TODO move out
#define OS_CLOCK_RATE 62500000LL
#pragma GLOBAL_ASM("asm/non_matchings/boot/fault/D_800982B0.s")
void Fault_SleepImpl(u32 duration) {
u64 value = (duration * OS_CPU_COUNTER) / 1000ull;
@@ -38,7 +37,7 @@ end:
osSetIntMask(mask);
if (alreadyExists) {
Fault_Log(D_800984B4, client);
osSyncPrintf(VT_COL(RED, WHITE) "fault_AddClient: %08x は既にリスト中にある\n" VT_RST, client);
}
}
@@ -76,7 +75,7 @@ void Fault_RemoveClient(FaultClient* client) {
osSetIntMask(mask);
if (listIsEmpty) {
Fault_Log(D_800984EC, client);
osSyncPrintf(VT_COL(RED, WHITE) "fault_RemoveClient: %08x リスト不整合です\n" VT_RST, client);
}
}
@@ -106,7 +105,7 @@ end:
osSetIntMask(mask);
if (alreadyExists) {
Fault_Log(D_80098524, client);
osSyncPrintf(VT_COL(RED, WHITE) "fault_AddressConverterAddClient: %08x は既にリスト中にある\n" VT_RST, client);
}
}
@@ -144,7 +143,8 @@ void Fault_RemoveAddrConvClient(FaultAddrConvClient* client) {
osSetIntMask(mask);
if (listIsEmpty) {
Fault_Log(D_8009856C, client);
osSyncPrintf(VT_COL(RED, WHITE) "fault_AddressConverterRemoveClient: %08x は既にリスト中にある\n" VT_RST,
client);
}
}
@@ -247,20 +247,20 @@ void Fault_PrintFReg(s32 idx, f32* value) {
s32 v0 = ((raw & 0x7f800000) >> 0x17) - 0x7f;
if ((v0 >= -0x7e && v0 < 0x80) || raw == 0) {
FaultDrawer_Printf(D_800985B8, idx, *value);
FaultDrawer_Printf("F%02d:%14.7e ", idx, *value);
} else {
FaultDrawer_Printf(D_800985C8, idx, raw);
FaultDrawer_Printf("F%02d: %08x(16) ", idx, raw);
}
}
void Fault_LogFReg(s32 idx, f32* value) {
void osSyncPrintfFReg(s32 idx, f32* value) {
u32 raw = *(u32*)value;
s32 v0 = ((raw & 0x7F800000) >> 0x17) - 0x7F;
if ((v0 >= -0x7E && v0 < 0x80) || raw == 0) {
Fault_Log(D_800985DC, idx, *value);
osSyncPrintf("F%02d:%14.7e ", idx, *value);
} else {
Fault_Log(D_800985EC, idx, *(u32*)value);
osSyncPrintf("F%02d: %08x(16) ", idx, *(u32*)value);
}
}
@@ -268,25 +268,25 @@ void Fault_PrintFPCR(u32 value) {
s32 i;
u32 flag = 0x20000;
FaultDrawer_Printf(D_80098600, value);
FaultDrawer_Printf("FPCSR:%08xH ", value);
for (i = 0; i < ARRAY_COUNT(sExceptionNames); i++) {
if (value & flag) {
FaultDrawer_Printf(D_80098610, sExceptionNames[i]);
FaultDrawer_Printf("(%s)", sExceptionNames[i]);
break;
}
flag >>= 1;
}
FaultDrawer_Printf(D_80098618);
FaultDrawer_Printf("\n");
}
void Fault_LogFPCR(u32 value) {
void osSyncPrintfFPCR(u32 value) {
s32 i;
u32 flag = 0x20000;
Fault_Log(D_8009861C, value);
osSyncPrintf("FPCSR:%08xH ", value);
for (i = 0; i < ARRAY_COUNT(sExceptionNames); i++) {
if (value & flag) {
Fault_Log(D_8009862C, sExceptionNames[i]);
osSyncPrintf("(%s)\n", sExceptionNames[i]);
break;
}
flag >>= 1;
@@ -308,55 +308,55 @@ void Fault_PrintThreadContext(OSThread* t) {
FaultDrawer_SetCursor(0x16, 0x14);
ctx = &t->context;
FaultDrawer_Printf(D_80098634, t->id, causeStrIdx, D_80096B80[causeStrIdx]);
FaultDrawer_Printf("THREAD:%d (%d:%s)\n", t->id, causeStrIdx, D_80096B80[causeStrIdx]);
FaultDrawer_SetCharPad(-1, 0);
FaultDrawer_Printf(D_80098648, (u32)ctx->pc, (u32)ctx->sr, (u32)ctx->badvaddr);
FaultDrawer_Printf(D_80098664, (u32)ctx->at, (u32)ctx->v0, (u32)ctx->v1);
FaultDrawer_Printf(D_80098680, (u32)ctx->a0, (u32)ctx->a1, (u32)ctx->a2);
FaultDrawer_Printf(D_8009869C, (u32)ctx->a3, (u32)ctx->t0, (u32)ctx->t1);
FaultDrawer_Printf(D_800986B8, (u32)ctx->t2, (u32)ctx->t3, (u32)ctx->t4);
FaultDrawer_Printf(D_800986D4, (u32)ctx->t5, (u32)ctx->t6, (u32)ctx->t7);
FaultDrawer_Printf(D_800986F0, (u32)ctx->s0, (u32)ctx->s1, (u32)ctx->s2);
FaultDrawer_Printf(D_8009870C, (u32)ctx->s3, (u32)ctx->s4, (u32)ctx->s5);
FaultDrawer_Printf(D_80098728, (u32)ctx->s6, (u32)ctx->s7, (u32)ctx->t8);
FaultDrawer_Printf(D_80098744, (u32)ctx->t9, (u32)ctx->gp, (u32)ctx->sp);
FaultDrawer_Printf(D_80098760, (u32)ctx->s8, (u32)ctx->ra, (u32)ctx->lo);
FaultDrawer_Printf("PC:%08xH SR:%08xH VA:%08xH\n", (u32)ctx->pc, (u32)ctx->sr, (u32)ctx->badvaddr);
FaultDrawer_Printf("AT:%08xH V0:%08xH V1:%08xH\n", (u32)ctx->at, (u32)ctx->v0, (u32)ctx->v1);
FaultDrawer_Printf("A0:%08xH A1:%08xH A2:%08xH\n", (u32)ctx->a0, (u32)ctx->a1, (u32)ctx->a2);
FaultDrawer_Printf("A3:%08xH T0:%08xH T1:%08xH\n", (u32)ctx->a3, (u32)ctx->t0, (u32)ctx->t1);
FaultDrawer_Printf("T2:%08xH T3:%08xH T4:%08xH\n", (u32)ctx->t2, (u32)ctx->t3, (u32)ctx->t4);
FaultDrawer_Printf("T5:%08xH T6:%08xH T7:%08xH\n", (u32)ctx->t5, (u32)ctx->t6, (u32)ctx->t7);
FaultDrawer_Printf("S0:%08xH S1:%08xH S2:%08xH\n", (u32)ctx->s0, (u32)ctx->s1, (u32)ctx->s2);
FaultDrawer_Printf("S3:%08xH S4:%08xH S5:%08xH\n", (u32)ctx->s3, (u32)ctx->s4, (u32)ctx->s5);
FaultDrawer_Printf("S6:%08xH S7:%08xH T8:%08xH\n", (u32)ctx->s6, (u32)ctx->s7, (u32)ctx->t8);
FaultDrawer_Printf("T9:%08xH GP:%08xH SP:%08xH\n", (u32)ctx->t9, (u32)ctx->gp, (u32)ctx->sp);
FaultDrawer_Printf("S8:%08xH RA:%08xH LO:%08xH\n\n", (u32)ctx->s8, (u32)ctx->ra, (u32)ctx->lo);
Fault_PrintFPCR(ctx->fpcsr);
FaultDrawer_Printf(D_80098780);
FaultDrawer_Printf("\n");
Fault_PrintFReg(0, &ctx->fp0.f.f_even);
Fault_PrintFReg(2, &ctx->fp2.f.f_even);
FaultDrawer_Printf(D_80098784);
FaultDrawer_Printf("\n");
Fault_PrintFReg(4, &ctx->fp4.f.f_even);
Fault_PrintFReg(6, &ctx->fp6.f.f_even);
FaultDrawer_Printf(D_80098788);
FaultDrawer_Printf("\n");
Fault_PrintFReg(8, &ctx->fp8.f.f_even);
Fault_PrintFReg(0xA, &ctx->fp10.f.f_even);
FaultDrawer_Printf(D_8009878C);
FaultDrawer_Printf("\n");
Fault_PrintFReg(0xC, &ctx->fp12.f.f_even);
Fault_PrintFReg(0xE, &ctx->fp14.f.f_even);
FaultDrawer_Printf(D_80098790);
FaultDrawer_Printf("\n");
Fault_PrintFReg(0x10, &ctx->fp16.f.f_even);
Fault_PrintFReg(0x12, &ctx->fp18.f.f_even);
FaultDrawer_Printf(D_80098794);
FaultDrawer_Printf("\n");
Fault_PrintFReg(0x14, &ctx->fp20.f.f_even);
Fault_PrintFReg(0x16, &ctx->fp22.f.f_even);
FaultDrawer_Printf(D_80098798);
FaultDrawer_Printf("\n");
Fault_PrintFReg(0x18, &ctx->fp24.f.f_even);
Fault_PrintFReg(0x1A, &ctx->fp26.f.f_even);
FaultDrawer_Printf(D_8009879C);
FaultDrawer_Printf("\n");
Fault_PrintFReg(0x1C, &ctx->fp28.f.f_even);
Fault_PrintFReg(0x1E, &ctx->fp30.f.f_even);
FaultDrawer_Printf(D_800987A0);
FaultDrawer_Printf("\n");
FaultDrawer_SetCharPad(0, 0);
if (D_8009BE54 != 0) {
FaultDrawer_DrawText(0xA0, 0xD8, D_800987A4, D_8009BE54);
FaultDrawer_DrawText(0xA0, 0xD8, "%5.2f sec\n", D_8009BE54);
}
}
void Fault_LogThreadContext(OSThread* t) {
void osSyncPrintfThreadContext(OSThread* t) {
__OSThreadContext* ctx;
s32 causeStrIdx = (s32)((((u32)t->context.cause >> 2) & 0x1f) << 0x10) >> 0x10;
if (causeStrIdx == 0x17) {
@@ -367,47 +367,47 @@ void Fault_LogThreadContext(OSThread* t) {
}
ctx = &t->context;
Fault_Log(D_800987B0);
Fault_Log(D_800987B4, t->id, causeStrIdx, D_80096B80[causeStrIdx]);
osSyncPrintf("\n");
osSyncPrintf("THREAD ID:%d (%d:%s)\n", t->id, causeStrIdx, D_80096B80[causeStrIdx]);
Fault_Log(D_800987CC, (u32)ctx->pc, (u32)ctx->sr, (u32)ctx->badvaddr);
Fault_Log(D_800987EC, (u32)ctx->at, (u32)ctx->v0, (u32)ctx->v1);
Fault_Log(D_8009880C, (u32)ctx->a0, (u32)ctx->a1, (u32)ctx->a2);
Fault_Log(D_8009882C, (u32)ctx->a3, (u32)ctx->t0, (u32)ctx->t1);
Fault_Log(D_8009884C, (u32)ctx->t2, (u32)ctx->t3, (u32)ctx->t4);
Fault_Log(D_8009886C, (u32)ctx->t5, (u32)ctx->t6, (u32)ctx->t7);
Fault_Log(D_8009888C, (u32)ctx->s0, (u32)ctx->s1, (u32)ctx->s2);
Fault_Log(D_800988AC, (u32)ctx->s3, (u32)ctx->s4, (u32)ctx->s5);
Fault_Log(D_800988CC, (u32)ctx->s6, (u32)ctx->s7, (u32)ctx->t8);
Fault_Log(D_800988EC, (u32)ctx->t9, (u32)ctx->gp, (u32)ctx->sp);
Fault_Log(D_8009890C, (u32)ctx->s8, (u32)ctx->ra, (u32)ctx->lo);
Fault_Log(D_8009892C);
Fault_LogFPCR(ctx->fpcsr);
Fault_Log(D_80098930);
Fault_LogFReg(0, &ctx->fp0.f.f_even);
Fault_LogFReg(2, &ctx->fp2.f.f_even);
Fault_Log(D_80098934);
Fault_LogFReg(4, &ctx->fp4.f.f_even);
Fault_LogFReg(6, &ctx->fp6.f.f_even);
Fault_Log(D_80098938);
Fault_LogFReg(8, &ctx->fp8.f.f_even);
Fault_LogFReg(0xa, &ctx->fp10.f.f_even);
Fault_Log(D_8009893C);
Fault_LogFReg(0xc, &ctx->fp12.f.f_even);
Fault_LogFReg(0xe, &ctx->fp14.f.f_even);
Fault_Log(D_80098940);
Fault_LogFReg(0x10, &ctx->fp16.f.f_even);
Fault_LogFReg(0x12, &ctx->fp18.f.f_even);
Fault_Log(D_80098944);
Fault_LogFReg(0x14, &ctx->fp20.f.f_even);
Fault_LogFReg(0x16, &ctx->fp22.f.f_even);
Fault_Log(D_80098948);
Fault_LogFReg(0x18, &ctx->fp24.f.f_even);
Fault_LogFReg(0x1a, &ctx->fp26.f.f_even);
Fault_Log(D_8009894C);
Fault_LogFReg(0x1c, &ctx->fp28.f.f_even);
Fault_LogFReg(0x1e, &ctx->fp30.f.f_even);
Fault_Log(D_80098950);
osSyncPrintf("PC:%08xH SR:%08xH VA:%08xH\n", (u32)ctx->pc, (u32)ctx->sr, (u32)ctx->badvaddr);
osSyncPrintf("AT:%08xH V0:%08xH V1:%08xH\n", (u32)ctx->at, (u32)ctx->v0, (u32)ctx->v1);
osSyncPrintf("A0:%08xH A1:%08xH A2:%08xH\n", (u32)ctx->a0, (u32)ctx->a1, (u32)ctx->a2);
osSyncPrintf("A3:%08xH T0:%08xH T1:%08xH\n", (u32)ctx->a3, (u32)ctx->t0, (u32)ctx->t1);
osSyncPrintf("T2:%08xH T3:%08xH T4:%08xH\n", (u32)ctx->t2, (u32)ctx->t3, (u32)ctx->t4);
osSyncPrintf("T5:%08xH T6:%08xH T7:%08xH\n", (u32)ctx->t5, (u32)ctx->t6, (u32)ctx->t7);
osSyncPrintf("S0:%08xH S1:%08xH S2:%08xH\n", (u32)ctx->s0, (u32)ctx->s1, (u32)ctx->s2);
osSyncPrintf("S3:%08xH S4:%08xH S5:%08xH\n", (u32)ctx->s3, (u32)ctx->s4, (u32)ctx->s5);
osSyncPrintf("S6:%08xH S7:%08xH T8:%08xH\n", (u32)ctx->s6, (u32)ctx->s7, (u32)ctx->t8);
osSyncPrintf("T9:%08xH GP:%08xH SP:%08xH\n", (u32)ctx->t9, (u32)ctx->gp, (u32)ctx->sp);
osSyncPrintf("S8:%08xH RA:%08xH LO:%08xH\n", (u32)ctx->s8, (u32)ctx->ra, (u32)ctx->lo);
osSyncPrintf("\n");
osSyncPrintfFPCR(ctx->fpcsr);
osSyncPrintf("\n");
osSyncPrintfFReg(0, &ctx->fp0.f.f_even);
osSyncPrintfFReg(2, &ctx->fp2.f.f_even);
osSyncPrintf("\n");
osSyncPrintfFReg(4, &ctx->fp4.f.f_even);
osSyncPrintfFReg(6, &ctx->fp6.f.f_even);
osSyncPrintf("\n");
osSyncPrintfFReg(8, &ctx->fp8.f.f_even);
osSyncPrintfFReg(0xa, &ctx->fp10.f.f_even);
osSyncPrintf("\n");
osSyncPrintfFReg(0xc, &ctx->fp12.f.f_even);
osSyncPrintfFReg(0xe, &ctx->fp14.f.f_even);
osSyncPrintf("\n");
osSyncPrintfFReg(0x10, &ctx->fp16.f.f_even);
osSyncPrintfFReg(0x12, &ctx->fp18.f.f_even);
osSyncPrintf("\n");
osSyncPrintfFReg(0x14, &ctx->fp20.f.f_even);
osSyncPrintfFReg(0x16, &ctx->fp22.f.f_even);
osSyncPrintf("\n");
osSyncPrintfFReg(0x18, &ctx->fp24.f.f_even);
osSyncPrintfFReg(0x1a, &ctx->fp26.f.f_even);
osSyncPrintf("\n");
osSyncPrintfFReg(0x1c, &ctx->fp28.f.f_even);
osSyncPrintfFReg(0x1e, &ctx->fp30.f.f_even);
osSyncPrintf("\n");
}
OSThread* Fault_FindFaultedThread() {
@@ -464,12 +464,12 @@ void Fault_DrawMemDumpPage(char* title, u32* addr, u32 param_3) {
Fault_FillScreenBlack();
FaultDrawer_SetCharPad(-2, 0);
FaultDrawer_DrawText(0x24, 0x12, D_80098954, title ? title : D_8009895C, alignedAddr);
FaultDrawer_DrawText(0x24, 0x12, "%s %08x", title ? title : "PrintDump", alignedAddr);
if (alignedAddr >= (u32*)0x80000000 && alignedAddr < (u32*)0xC0000000) {
for (y = 0x1C; y != 0xE2; y += 9) {
FaultDrawer_DrawText(0x18, y, D_80098968, writeAddr);
FaultDrawer_DrawText(0x18, y, "%06x", writeAddr);
for (x = 0x52; x != 0x122; x += 0x34) {
FaultDrawer_DrawText(x, y, D_80098970, *writeAddr++);
FaultDrawer_DrawText(x, y, "%08x", *writeAddr++);
}
}
}
@@ -493,7 +493,7 @@ void Fault_DrawMemDump(u32 pc, u32 sp, u32 unk0, u32 unk1) {
}
addr &= ~0xF;
Fault_DrawMemDumpPage(D_80098978, (u32*)addr, 0);
Fault_DrawMemDumpPage("Dump", (u32*)addr, 0);
count = 600;
while (sFaultContext->faultActive) {
@@ -608,7 +608,7 @@ void Fault_FindNextStackCall(u32** sp, u32** pc, u32** ra) {
*ra = currentRa;
}
#else
#pragma GLOBAL_ASM("./asm/non_matchings/boot/fault/Fault_FindNextStackCall.asm")
#pragma GLOBAL_ASM("asm/non_matchings/boot/fault/Fault_FindNextStackCall.s")
#endif
void Fault_DrawStackTrace(OSThread* t, u32 flags) {
@@ -624,26 +624,26 @@ void Fault_DrawStackTrace(OSThread* t, u32 flags) {
pc = t->context.pc;
Fault_FillScreenBlack();
FaultDrawer_DrawText(0x78, 0x10, D_80098980);
FaultDrawer_DrawText(0x24, 0x18, D_8009898C);
FaultDrawer_DrawText(0x78, 0x10, "STACK TRACE");
FaultDrawer_DrawText(0x24, 0x18, "SP PC (VPC)");
for (y = 1; (y < 22) && (((ra != 0) || (sp != 0)) && (pc != (u32)__osCleanupThread)); y++) {
FaultDrawer_DrawText(0x24, y * 8 + 24, D_800989A4, sp, pc);
FaultDrawer_DrawText(0x24, y * 8 + 24, "%08x %08x", sp, pc);
if (flags & 1) {
convertedPc = (u32)Fault_ConvertAddress((void*)pc);
if (convertedPc != 0) {
FaultDrawer_Printf(D_800989B0, convertedPc);
FaultDrawer_Printf(" -> %08x", convertedPc);
}
} else {
FaultDrawer_Printf(D_800989BC);
FaultDrawer_Printf(" -> ????????");
}
Fault_FindNextStackCall((u32**)&sp, (u32**)&pc, (u32**)&ra);
}
}
void Fault_LogStackTrace(OSThread* t, u32 flags) {
void osSyncPrintfStackTrace(OSThread* t, u32 flags) {
s32 y;
u32 sp;
u32 ra;
@@ -654,21 +654,21 @@ void Fault_LogStackTrace(OSThread* t, u32 flags) {
ra = t->context.ra;
pc = t->context.pc;
Fault_Log(D_800989CC);
Fault_Log(D_800989D8);
osSyncPrintf("STACK TRACE");
osSyncPrintf("SP PC (VPC)\n");
for (y = 1; (y < 22) && (((ra != 0) || (sp != 0)) && (pc != (u32)__osCleanupThread)); y++) {
Fault_Log(D_800989F4, sp, pc);
osSyncPrintf("%08x %08x", sp, pc);
if (flags & 1) {
convertedPc = (u32)Fault_ConvertAddress((void*)pc);
if (convertedPc != 0) {
Fault_Log(D_80098A00, convertedPc);
osSyncPrintf(" -> %08x", convertedPc);
}
} else {
Fault_Log(D_80098A0C);
osSyncPrintf(" -> ????????");
}
Fault_Log(D_80098A1C);
osSyncPrintf("\n");
Fault_FindNextStackCall((u32**)&sp, (u32**)&pc, (u32**)&ra);
}
@@ -712,7 +712,7 @@ void Fault_ProcessClients(void) {
if (iter->callback) {
Fault_FillScreenBlack();
FaultDrawer_SetCharPad(-2, 0);
FaultDrawer_Printf(D_80098A20, idx++, iter, iter->param0, iter->param1);
FaultDrawer_Printf("8CallBack (%d) %08x %08x %08x\n7", idx++, iter, iter->param0, iter->param1);
FaultDrawer_SetCharPad(0, 0);
iter->callback(iter->param0, iter->param1);
Fault_WaitForInput();
@@ -746,18 +746,18 @@ void Fault_SetOptionsFromController3(void) {
FaultDrawer_SetOsSyncPrintfEnabled(faultCopyToLog);
}
if (CHECK_BTN_ALL(input3->press.button, BTN_A)) {
Fault_Log(D_80098A44, graphPC, graphRA, graphSP);
osSyncPrintf("GRAPH PC=%08x RA=%08x STACK=%08x\n", graphPC, graphRA, graphSP);
}
if (CHECK_BTN_ALL(input3->press.button, BTN_B)) {
FaultDrawer_SetDrawerFB(osViGetNextFramebuffer(), 0x140, 0xF0);
Fault_DrawRec(0, 0xD7, 0x140, 9, 1);
FaultDrawer_SetCharPad(-2, 0);
FaultDrawer_DrawText(0x20, 0xD8, D_80098A68, graphPC, graphRA, graphSP);
FaultDrawer_DrawText(0x20, 0xD8, "GRAPH PC %08x RA %08x SP %08x", graphPC, graphRA, graphSP);
}
}
}
#else
#pragma GLOBAL_ASM("./asm/non_matchings/boot/fault/Fault_SetOptionsFromController3.asm")
#pragma GLOBAL_ASM("asm/non_matchings/boot/fault/Fault_SetOptionsFromController3.s")
#endif
void Fault_SetOptions(void) {
@@ -778,24 +778,24 @@ void Fault_ThreadEntry(void* arg) {
if (msg == (OSMesg)1) {
sFaultContext->msgId = 1;
Fault_Log(D_80098A88);
osSyncPrintf("フォルトマネージャ:OS_EVENT_CPU_BREAKを受信しました\n");
} else if (msg == (OSMesg)2) {
sFaultContext->msgId = 2;
Fault_Log(D_80098AC0);
osSyncPrintf("フォルトマネージャ:OS_EVENT_FAULTを受信しました\n");
} else if (msg == (OSMesg)3) {
Fault_SetOptions();
faultedThread = NULL;
continue;
} else {
sFaultContext->msgId = 3;
Fault_Log(D_80098AF4);
osSyncPrintf("フォルトマネージャ:不明なメッセージを受信しました\n");
}
faultedThread = __osGetCurrFaultedThread();
Fault_Log(D_80098B28, faultedThread);
osSyncPrintf("__osGetCurrFaultedThread()=%08x\n", faultedThread);
if (!faultedThread) {
faultedThread = Fault_FindFaultedThread();
Fault_Log(D_80098B4C, faultedThread);
osSyncPrintf("FindFaultedThread()=%08x\n", faultedThread);
}
} while (faultedThread == NULL);
@@ -820,21 +820,21 @@ void Fault_ThreadEntry(void* arg) {
do {
Fault_PrintThreadContext(faultedThread);
Fault_LogThreadContext(faultedThread);
osSyncPrintfThreadContext(faultedThread);
Fault_WaitForInput();
Fault_DrawStackTrace(faultedThread, 0);
Fault_LogStackTrace(faultedThread, 0);
osSyncPrintfStackTrace(faultedThread, 0);
Fault_WaitForInput();
Fault_ProcessClients();
Fault_DrawMemDump((u32)(faultedThread->context.pc - 0x100), (u32)faultedThread->context.sp, 0, 0);
Fault_DrawStackTrace(faultedThread, 1);
Fault_LogStackTrace(faultedThread, 1);
osSyncPrintfStackTrace(faultedThread, 1);
Fault_WaitForInput();
Fault_FillScreenRed();
FaultDrawer_DrawText(0x40, 0x50, D_80098B68);
FaultDrawer_DrawText(0x40, 0x5A, D_80098B84);
FaultDrawer_DrawText(0x40, 0x64, D_80098BA0);
FaultDrawer_DrawText(0x40, 0x6E, D_80098BBC);
FaultDrawer_DrawText(0x40, 0x50, " CONGRATURATIONS! ");
FaultDrawer_DrawText(0x40, 0x5A, "All Pages are displayed.");
FaultDrawer_DrawText(0x40, 0x64, " THANK YOU! ");
FaultDrawer_DrawText(0x40, 0x6E, " You are great debugger!");
Fault_WaitForInput();
} while (!sFaultContext->exitDebugger);
@@ -866,18 +866,18 @@ void Fault_Start(void) {
sFaultContext->faultActive = 0;
gFaultStruct.faultHandlerEnabled = 1;
osCreateMesgQueue(&sFaultContext->queue, sFaultContext->msg, 1);
StackCheck_Init(&sFaultThreadInfo, sFaultStack, sFaultStack + sizeof(sFaultStack), 0, 0x100, faultThreadName);
StackCheck_Init(&sFaultThreadInfo, sFaultStack, sFaultStack + sizeof(sFaultStack), 0, 0x100, "fault");
osCreateThread(&sFaultContext->thread, 2, Fault_ThreadEntry, NULL, sFaultStack + sizeof(sFaultStack), 0x7F);
osStartThread(&sFaultContext->thread);
}
void Fault_HangupFaultClient(const char* arg0, char* arg1) {
Fault_Log(D_80098BE0, osGetThreadId(NULL));
Fault_Log(D_80098BF8, arg0 ? arg0 : D_80098BFC);
Fault_Log(D_80098C04, arg1 ? arg1 : D_80098C08);
FaultDrawer_Printf(D_80098C10, osGetThreadId(NULL));
FaultDrawer_Printf(D_80098C28, arg0 ? arg0 : D_80098C2C);
FaultDrawer_Printf(D_80098C34, arg1 ? arg1 : D_80098C38);
osSyncPrintf("HungUp on Thread %d\n", osGetThreadId(NULL));
osSyncPrintf("%s\n", arg0 ? arg0 : "(NULL)");
osSyncPrintf("%s\n", arg1 ? arg1 : "(NULL)");
FaultDrawer_Printf("HungUp on Thread %d\n", osGetThreadId(NULL));
FaultDrawer_Printf("%s\n", arg0 ? arg0 : "(NULL)");
FaultDrawer_Printf("%s\n", arg1 ? arg1 : "(NULL)");
}
void Fault_AddHungupAndCrashImpl(const char* arg0, char* arg1) {
@@ -889,6 +889,6 @@ void Fault_AddHungupAndCrashImpl(const char* arg0, char* arg1) {
void Fault_AddHungupAndCrash(const char* filename, u32 line) {
char msg[256];
sprintf(msg, D_80098C40, filename, line);
sprintf(msg, "HungUp %s:%d", filename, line);
Fault_AddHungupAndCrashImpl(msg, NULL);
}
@@ -1,5 +1,5 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
#include "vt.h"
FaultDrawer* sFaultDrawContext = &sFaultDrawerStruct;
FaultDrawer sFaultDrawerDefault = {
@@ -37,6 +37,8 @@ FaultDrawer sFaultDrawerDefault = {
NULL, // inputCallback
};
#pragma GLOBAL_ASM("asm/non_matchings/boot/fault_drawer/sFaultDrawerFont.s")
void FaultDrawer_SetOsSyncPrintfEnabled(u32 enabled) {
sFaultDrawContext->osSyncPrintfEnabled = enabled;
}
@@ -70,7 +72,7 @@ void FaultDrawer_DrawRecImpl(s32 xStart, s32 yStart, s32 xEnd, s32 yEnd, u16 col
}
}
#pragma GLOBAL_ASM("./asm/non_matchings/boot/fault_drawer/FaultDrawer_DrawChar.asm")
#pragma GLOBAL_ASM("asm/non_matchings/boot/fault_drawer/FaultDrawer_DrawChar.s")
s32 FaultDrawer_ColorToPrintColor(u16 color) {
s32 i;
@@ -87,14 +89,14 @@ void FaultDrawer_UpdatePrintColor() {
s32 idx;
if (sFaultDrawContext->osSyncPrintfEnabled) {
Fault_Log(D_80099050);
osSyncPrintf(VT_RST);
idx = FaultDrawer_ColorToPrintColor(sFaultDrawContext->foreColor);
if (idx >= 0 && idx < 8) {
Fault_Log(D_80099054, idx);
osSyncPrintf(VT_SGR("3%d"), idx);
}
idx = FaultDrawer_ColorToPrintColor(sFaultDrawContext->backColor);
if (idx >= 0 && idx < 8) {
Fault_Log(D_8009905C, idx);
osSyncPrintf(VT_SGR("4%d"), idx);
}
}
}
@@ -120,9 +122,9 @@ void FaultDrawer_SetCharPad(s8 padW, s8 padH) {
void FaultDrawer_SetCursor(s32 x, s32 y) {
if (sFaultDrawContext->osSyncPrintfEnabled) {
Fault_Log(D_80099064,
(y - sFaultDrawContext->yStart) / (sFaultDrawContext->charH + sFaultDrawContext->charHPad),
(x - sFaultDrawContext->xStart) / (sFaultDrawContext->charW + sFaultDrawContext->charWPad));
osSyncPrintf(VT_CUP("%d", "%d"),
(y - sFaultDrawContext->yStart) / (sFaultDrawContext->charH + sFaultDrawContext->charHPad),
(x - sFaultDrawContext->xStart) / (sFaultDrawContext->charW + sFaultDrawContext->charWPad));
}
sFaultDrawContext->cursorX = x;
sFaultDrawContext->cursorY = y;
@@ -130,7 +132,7 @@ void FaultDrawer_SetCursor(s32 x, s32 y) {
void FaultDrawer_FillScreen() {
if (sFaultDrawContext->osSyncPrintfEnabled) {
Fault_Log(D_80099070);
osSyncPrintf(VT_CLS);
}
FaultDrawer_DrawRecImpl(sFaultDrawContext->xStart, sFaultDrawContext->yStart, sFaultDrawContext->xEnd,
@@ -138,7 +140,9 @@ void FaultDrawer_FillScreen() {
FaultDrawer_SetCursor(sFaultDrawContext->xStart, sFaultDrawContext->yStart);
}
#pragma GLOBAL_ASM("./asm/non_matchings/boot/fault_drawer/FaultDrawer_FormatStringFunc.asm")
#pragma GLOBAL_ASM("asm/non_matchings/boot/fault_drawer/FaultDrawer_FormatStringFunc.s")
#pragma GLOBAL_ASM("asm/non_matchings/boot/fault_drawer/D_80099080.s")
void FaultDrawer_VPrintf(const char* str, char* args) { // va_list
_Printf((printf_func)FaultDrawer_FormatStringFunc, sFaultDrawContext, str, args);
+6 -7
View File
@@ -1,5 +1,4 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
u8 D_80096B20 = 1;
vu8 gViConfigUseDefault = 1;
@@ -35,8 +34,8 @@ void Idle_InitMemory(void) {
void* memEnd = (void*)(0x80000000 + osMemSize);
Idle_ClearMemory((void*)0x80000400, &gFramebuffer1);
Idle_ClearMemory(&D_80025D00, (int*)&boot_text_start);
Idle_ClearMemory(&code_bss_end, memEnd);
Idle_ClearMemory(&D_80025D00, (int*)&bootproc);
Idle_ClearMemory(&gGfxSPTaskYieldBuffer, memEnd);
}
#ifdef NON_MATCHING
@@ -52,7 +51,7 @@ void Idle_InitCodeAndMemory(void) {
oldSize = sDmaMgrDmaBuffSize;
sDmaMgrDmaBuffSize = 0;
DmaMgr_SendRequestImpl(&dmaReq, (u32)&code_text_start, (u32)_codeSegmentRomStart,
DmaMgr_SendRequestImpl(&dmaReq, (u32)_codeSegmentStart, (u32)_codeSegmentRomStart,
(u32)_codeSegmentRomEnd - (u32)_codeSegmentRomStart, 0, &queue, 0);
Idle_InitScreen();
Idle_InitMemory();
@@ -60,10 +59,10 @@ void Idle_InitCodeAndMemory(void) {
sDmaMgrDmaBuffSize = oldSize;
Idle_ClearMemory(&code_bss_start, &code_bss_end);
Idle_ClearMemory(_codeSegmentBssStart, _codeSegmentBssEnd);
}
#else
#pragma GLOBAL_ASM("./asm/non_matchings/boot/idle/Idle_InitCodeAndMemory.asm")
#pragma GLOBAL_ASM("asm/non_matchings/boot/idle/Idle_InitCodeAndMemory.s")
#endif
void Main_ThreadEntry(void* arg) {
+1 -2
View File
@@ -1,5 +1,4 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
vs32 gIrqMgrResetStatus = 0;
volatile OSTime sIrqMgrResetTime = 0;
+10
View File
@@ -0,0 +1,10 @@
#include "global.h"
// This file contains print functions that are used by fault.c, so they are placed in the fault module
void __osSyncVPrintf(UNK_TYPE4 param_1, ...) {
}
void osSyncPrintf(char* str, ...) {
}
void rmonPrintf(UNK_TYPE4 param_1, ...) {
}
+2 -3
View File
@@ -1,5 +1,4 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
void ViConfig_UpdateVi(u32 mode) {
if (mode != 0) {
@@ -27,7 +26,7 @@ void ViConfig_UpdateVi(u32 mode) {
osViSetMode(&gViConfigMode);
if (gViConfigAdditionalScanLines != 0) {
func_80087E00(gViConfigAdditionalScanLines);
osViExtendVStart(gViConfigAdditionalScanLines);
}
if (gViConfigFeatures != 0) {
+3 -4
View File
@@ -1,5 +1,4 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
u8 sYaz0DataBuffer[0x400];
u8* sYaz0CurDataEnd;
@@ -50,7 +49,7 @@ void* Yaz0_NextDMA(void* curSrcPos) {
} else {
oldPri = osGetThreadPri(NULL);
osSetThreadPri(NULL, 0x7F);
Fault_Log("圧縮展開異常\n");
osSyncPrintf("圧縮展開異常\n");
osSetThreadPri(NULL, oldPri);
}
@@ -131,7 +130,7 @@ void Yaz0_Decompress(u32 romStart, void* dst, u32 size) {
if (sYaz0CurDataEnd != NULL) {
while (sYaz0CurDataEnd != NULL) {
func_80087A1C(10);
Sleep_Usec(10);
}
}
+2 -5
View File
@@ -1,5 +1,4 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
u32 sDmaMgrDmaBuffSize = 0x2000;
@@ -203,8 +202,6 @@ s32 DmaMgr_SendRequest0(void* vramStart, u32 vromStart, u32 size) {
return 0;
}
const char dmamgrThreadName[] = "dmamgr";
#ifdef NON_MATCHING
// TODO missing a useless move initializing v0, and some reorderings
void DmaMgr_Start() {
@@ -226,7 +223,7 @@ void DmaMgr_Start() {
osStartThread(&sDmaMgrThread);
}
#else
#pragma GLOBAL_ASM("./asm/non_matchings/boot/z_std_dma/DmaMgr_Start.asm")
#pragma GLOBAL_ASM("asm/non_matchings/boot/z_std_dma/DmaMgr_Start.s")
#endif
void DmaMgr_Stop() {
+1 -2
View File
@@ -1,5 +1,4 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
u8 gGfxSPTaskYieldBuffer[OS_YIELD_DATA_SIZE];
+2 -3
View File
@@ -1,6 +1,5 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
u8 gAudioHeap[0x138000];
u32 gSystemHeap[UNK_SIZE];
u8 gSystemHeap[UNK_SIZE];
+7 -8
View File
@@ -1,5 +1,4 @@
#include <ultra64.h>
#include <global.h>
#include "global.h"
/**
* Assigns the "save" values in PreRender
@@ -148,7 +147,7 @@ void func_8017023C(PreRender* this, Gfx** gfxp, void* buf, void* bufSave) {
*gfxp = gfx;
}
#else
#pragma GLOBAL_ASM("./asm/non_matchings/code/PreRender/func_8017023C.asm")
#pragma GLOBAL_ASM("asm/non_matchings/code/PreRender/func_8017023C.s")
#endif
void func_8017057C(PreRender* this, Gfx** gfxp) {
@@ -249,7 +248,7 @@ void func_80170798(PreRender* this, Gfx** gfxp) {
}
}
#else
#pragma GLOBAL_ASM("./asm/non_matchings/code/PreRender/func_80170798.asm")
#pragma GLOBAL_ASM("asm/non_matchings/code/PreRender/func_80170798.s")
#endif
void func_80170AE0(PreRender* this, Gfx** gfxp, s32 alpha) {
@@ -397,9 +396,9 @@ void PreRender_ApplyAntiAliasingFilter(PreRender* this) {
}
}
#pragma GLOBAL_ASM("./asm/non_matchings/code/PreRender/func_801716C4.asm")
#pragma GLOBAL_ASM("asm/non_matchings/code/PreRender/func_801716C4.s")
#pragma GLOBAL_ASM("./asm/non_matchings/code/PreRender/func_801717F8.asm")
#pragma GLOBAL_ASM("asm/non_matchings/code/PreRender/func_801717F8.s")
/**
* Applies filters to the framebuffer prerender to make it look smoother
@@ -426,7 +425,7 @@ void PreRender_ApplyFiltersSlowlyInit(PreRender* this) {
}
this->unk_4D = 1;
StackCheck_Init(&slowlyStackEntry, slowlyStack, &slowlyStack[4096], 0, 0x100, D_801DFC60);
StackCheck_Init(&slowlyStackEntry, slowlyStack, &slowlyStack[4096], 0, 0x100, "slowly");
Slowly_Start(&D_801F6E00, &D_801F7FE8, PreRender_ApplyFilters, this, NULL);
D_801F6FC0 = true;
}
@@ -450,7 +449,7 @@ void func_801720C4(PreRender* this) {
}
}
#pragma GLOBAL_ASM("./asm/non_matchings/code/PreRender/func_801720FC.asm")
#pragma GLOBAL_ASM("asm/non_matchings/code/PreRender/func_801720FC.s")
void func_80172758(Gfx** gfxp, void* timg, void* tlut, u16 width, u16 height, u8 fmt, u8 siz, u16 tt, u16 arg8, f32 x,
f32 y, f32 xScale, f32 yScale, u32 flags) {

Some files were not shown because too many files have changed in this diff Show More