Commit Graph

115 Commits

Author SHA1 Message Date
lepelog 5c83d2532c
Decompile some SComponent data and some MSL_C.PPCEABI.bare.H headers (#115)
* data for c_angle

* data c_sxyz

* partially migrated c_xyz data

* c_xyz data

* c_xyz data decomp

* c_math data

* c_math data

* c_lib data, some cleanup

* rename some unnamed functions and create header for them

* header for string functions

* format and fix fabsf

* cleanup

* remove more unneded function prototypes

* move fpclassify to math.h
2021-02-19 10:51:02 -05:00
Pheenoh 63d4e517f7
split f_ap_game, fapGm_Execute ok, more changes to m_Do_main 2021-02-13 15:23:18 -05:00
lepelog aff4c171fc
f_op_actor_mng split & started decomp (#112)
* fop-actor-mng

* rodata

* more actor mng progress

* actor mng progress

* format

* cleanup

* fix Mtx function signatures

* PR suggestion

Co-authored-by: Pheenoh <pheenoh@gmail.com>
2021-02-12 19:47:46 -05:00
Pheenoh 4d1d865921
debugDisplay and Debug_console attemp 2021-02-07 17:20:16 -05:00
jdflyer f1924e91f4
d_kyeff, d_kyeff2, m_Do_printf, and m_Do_graphic (#109)
* Split d_kyeff

* Partially matched d_kyeff

* split d_kyeff2

* Match d_kyeff2

* split m_Do_printf

* m_Do_printf partially matched

* hotfix and clang-format

* split m_Do_graphic

* rename symbols in m_Do_graphic

* Match a few functions in m_Do_graphic

* Fix Merge Errors

* Delete sh.exe.stackdump

* Update OSReportInit
2021-01-31 20:03:38 -05:00
notyourav b8d0da505d
binary OK (#99)
Co-authored-by: Pheenoh <pheenoh@gmail.com>
2021-01-26 17:42:28 -05:00
LC c11228ea86
J2DPane: Add names for several unlabeled variables (#103)
Should make working on other classes adjacent to J2DPane a little more
descriptive in the decompilation process.
2021-01-26 17:04:10 -05:00
LC ec9b03241d
Z2AudioLib: Migrate declarations out of functions.h to respective files (#96)
Removes the strong dependency on a single header file and moves
declarations to their respective header file.

This allows for making dependencies explicit in cpp files and other
headers, and also makes it much easier to track where everything related
to a particular component is.

This change also creates a few header files that previously didn't
exist, making it much nicer for people implementing things, as they
won't need to create the header file, it'll just be there ready to go.

Ideally functions.h wouldn't even be a thing, as this header adds a lot
of preprocessing overhead due to its size, and will continue to grow
significantly larger over the lifespan of the project, which can also
impact the performance of editors that do dependency lookups and
context-aware syntax highlighting.
2021-01-25 12:57:46 -05:00
notyourav 6e7708652e
J2DPane.cpp (#91)
* split J2DPane.cpp

* J2DPane first pass

* consolidate headers and typedef mtx

* remove duplicate J2DScreen.h

Co-authored-by: Pheenoh <pheenoh@gmail.com>
2021-01-25 09:57:35 -05:00
jdflyer db79db103b Various Fixes 2021-01-21 22:20:43 -07:00
jdflyer b5bbe8d00d clang-format 2021-01-21 22:06:54 -07:00
jdflyer 37543ca29f Fix Merge and set maxerrors to 5 2021-01-21 21:59:24 -07:00
jdflyer 64bb8562fa Merge remote-tracking branch 'upstream/master' into m_Do_audio2 2021-01-21 21:58:53 -07:00
jdflyer ff7ac962f1 m_Do_audio 2021-01-21 21:47:28 -07:00
Erin Moon a072e71c33
Z2AudioLib misc decomp (#75)
* Z2SoundHandles: decomp portions

* start decomping: Z2SpeechMgr2, Z2SoundHandles

* Z2SoundHandles::stopAllSounds(): ok

* Z2SoundHandles::getHandleUserData(): ok

* Z2SoundInfo: header

* Z2SoundObjBase::framework(): ok

* Z2SoundObjBase::Z2SoundObjBase(), Z2SoundObjBase::init(): ok

* Z2SoundObjBase::~Z2SoundObjBase(): ok

* Z2SoundObjBase::stopOK(): ok

* Z2SoundObjBase::stopOK, incomplete Z2SoundObjBase::dispose()

* clang-format

* Z2SoundObjBase::dispose(): ok

* JAISound::operator->(): null assert

* JAIAudience: stub

* Z2SoundObject::{init, deleteObject, isAlive}: ok

* Z2SeMgr: elaborate struct (and decl JAISoundHandles to support this)

* start subclassing Z2SoundObjBase; nonmatching Z2SoundObjSimple::init()

* Z2SeMGr::{incrCrowdSize, decrCrowdSize}: ok

* Z2MultiSeMgr::resetMultiSePos(): ok

* Z2WolfHowlMgr.h: decls

* Z2SoundStarter: move to decls and fix postprocess.py symbol pass

* Z2AudioArcLoader: decls

* Z2SoundObjMgr: ok some fns
- deleteEnemyAll()
- isTwilightBattle()
- setGhostEnemyState()

additionally elaborates parts of the Z2Creature hierarchy

* delete unused .s files and add tool to find them (only runs on linux)

* run clang-format

* postprocess.py: comment out debugging

* add python step to ok-check workflow

* address review comments

* address review comments

Co-authored-by: notyourav <65437533+notyourav@users.noreply.github.com>

Co-authored-by: Pheenoh <pheenoh@gmail.com>
Co-authored-by: notyourav <65437533+notyourav@users.noreply.github.com>
2021-01-21 23:16:51 -05:00
notyourav 358469df03
fvb, functionvalue, vector (#77)
Co-authored-by: Pheenoh <pheenoh@gmail.com>
2021-01-18 14:27:25 -05:00
Erin Moon c70d485d35
normalize header guards to {tu_name}_H_ (#87)
i previously had a bad habit of using double underscores in include
guard macro names, which are implementation-reserved per
the C++98 standard (see 17.4.3.1.2 Global names).

Co-authored-by: Pheenoh <pheenoh@gmail.com>
2021-01-18 14:02:51 -05:00
Jonathan Wase 82d5e0f796
JKRAram and JKRAramStream (#80)
* before __register_global_object

* JKRThread::sThreadList, JKRHeap::sSystemHeap, etc.

* cleanup and started on JKRDvdArchive

* before changing JKRCompression

* more JKRDvdArchive, abs, and memset

* fixed JKRArchive::setExpandSize split

* JKRArchive::sCurrentDirID, JKRDvdFile::sDvdList, and matching JKRDvdFile constructors

* problems

* merge fixes and formatting

* updated clang version in clang-format-all to version 10

* Added OSPhysicalToCached and struct for global memory

* remove useless __attribute__

* changed from defines and macros to const variable and function

* changed FLAG_HAS to FLAG_ON

* JKRAram, linking problems

* fix JKRAram

* remove nonmatching stuff

* renamed static data

* more static class members

* JKRAramStream OK

* formatting

Co-authored-by: Julgodis <>
Co-authored-by: Pheenoh <pheenoh@gmail.com>
2021-01-09 20:15:52 -05:00
Pheenoh 52a53ba135
clang-format 2021-01-07 22:58:47 -05:00
Pheenoh c1d05bc46c
main01 attempt, fix dcomifg_play_c members 2021-01-07 22:56:08 -05:00
lepelog 6d946e8330
match some Z2Calc functions (#72)
* Z2Calc OK

* inline definitions in random.h and format

* set -enum int compiler flag and fix enum hacks

* note for get_ufloat_1 inline

* PR suggestions and UB note

Co-authored-by: Pheenoh <pheenoh@gmail.com>
2021-01-06 20:39:56 -05:00
notyourav b8ecef0ddb
Refactor JUTFont symbols (#71)
* fix JUTFont args

* fix

Co-authored-by: Pheenoh <pheenoh@gmail.com>
2021-01-06 20:36:27 -05:00
Jonathan Wase 88fca194f8
JKRSolidHeap (#69)
* JKRSolidHeap progress

* JKRSolidHeap, added const to virtual functions, and JKRHeap::TState

* fixed braces

* fix function overload

* clang-format

Co-authored-by: Julgodis <>
Co-authored-by: Pheenoh <pheenoh@gmail.com>
2021-01-06 20:33:03 -05:00
Jonathan Wase 792509e0a1
JKRFileCache matched 22/24 (#73)
* progress

* strlen, strcat, and strcchr

* more functions from JKRFileCache

* JKRFileCache 22/24 matched

Co-authored-by: Julgodis <>
2021-01-06 19:47:07 -05:00
notyourav 105c006948
TObject and JStudio internals (#57)
* TObject

* fix

Co-authored-by: Pheenoh <pheenoh@gmail.com>
2021-01-05 12:47:26 -05:00
Jonathan Wase d89fb99506
JKRMemArchive (#66)
* JKRArchivePri OK

* JKRArchivePub OK

* formatting

* removed unused asm files and tried to fixed setExpandSize and getExpandSize

* JKRMemArchive and created JKRCompression

Co-authored-by: Julgodis <>
2021-01-05 11:34:58 -05:00
Jonathan Wase b9ef1d7f4a
JKRArchive (#63)
* JKRArchivePri OK

* JKRArchivePub OK

* formatting

* removed unused asm files and tried to fixed setExpandSize and getExpandSize

Co-authored-by: Julgodis <>
2021-01-04 18:20:45 -05:00
Erin Moon 5c23199fe2
close-to-matching mDoCPd_c::convert() (#61) 2021-01-04 10:37:08 -05:00
Jonathan Wase 0be0a7ea94
JKRFileLoader, JKRFileFinder, and JKRThread (#60)
* JKRFileLoader OK

* JKRFileFinder progress

* JKRFileFinder OK

* JKRFileCache fix virtual function signatures

* added OSThread and OSContext types

* JKRThread fixed nonmatching functions

Co-authored-by: Julgodis <>
Co-authored-by: Pheenoh <pheenoh@gmail.com>
2021-01-03 22:48:07 -05:00
Jonathan Wase 5217a4189e
JKernel cleanup and DVD types (#59)
* JKRDecomp OK

* JKRFile and JKRDvdFile cleanup

* more DVD stuff and cleanup JKRDvdFile more

* formatting

* JKRHeap cleanup

* formatting

* JKRDisposer cleanup

* JKRAramBlock and JKRAramHeap cleanup

* fix merge error

* fixed comments

* forgot to save file...

* fix DVDCBcallback

Co-authored-by: Julgodis <>
2021-01-03 21:26:25 -05:00
Pheenoh 6f22d27503
swap in memcpy for func_80003540, correct some minor issues in dvd.h and JKRDVDFile.h 2021-01-03 21:08:33 -05:00
Pheenoh d8fdc85090
countUsed OK 2021-01-03 16:58:49 -05:00
Pheenoh f12c5050f3
HeapCheck::heapDisplay OK 2021-01-03 16:34:11 -05:00
Jonathan Wase 423fdadc32
JKRDecomp OK (#58)
* JKRDecomp OK

* clang-format tool

* JKRThread cleanup and fixed suggestions

Co-authored-by: Julgodis <>
Co-authored-by: Pheenoh <pheenoh@gmail.com>
2021-01-03 16:19:54 -05:00
Jonathan Wase 4309c3db5b
JKRAramHeap and JKRAramPiece (#53)
* renamed func_XXX to _savegpr_XX

* renamed func_XXX to _restgpr_XX

* renamed func_XXX to _savefpr_XX

* renamed func_XXX to _restfpr_XX

* cleanup functions.h and moved intrisics to mwcc.h

* formatting

* cleanup functions.h

* Added include/ar/ARQ.h

* renamed func_XXX to _savegpr_25

* removed JKRAramPiece asm files

* JKRAramHeap OK, JKRAramPiece OK

* formatting

* more formatting

* Added const and removed explicit this->

* fixed merge problems

* changed mMessages[1] to mMessage

* foramatting

Co-authored-by: Julgodis <>
Co-authored-by: Pheenoh <pheenoh@gmail.com>
2021-01-03 05:29:50 -05:00
Erin Moon 5c4ac052c3
decomp some small files, do some cleanup (#42)
* remove leftover asm: JSUList.s

* d_save_init: decomp

* JMath/random: decomp

* J3DUDL: fixup label

* JAUClusterSound: decomp

* c_API_controller_pad: decomp, elaborate globals/types

* clang-format

* don't add guards to functions.h

* semantic merge of m_cpadInfo stuff

* fix undef symbols

Co-authored-by: Pheenoh <pheenoh@gmail.com>
2021-01-03 01:04:15 -05:00
Jonathan Wase d2e9db3748
Fixed _savegpr etc. (#54)
* renamed func_XXX to _savegpr_XX

* renamed func_XXX to _restgpr_XX

* renamed func_XXX to _savefpr_XX

* renamed func_XXX to _restfpr_XX

* cleanup functions.h and moved intrisics to mwcc.h

* formatting

* cleanup functions.h

* fix bad-formatting from master

Co-authored-by: Julgodis <>
2021-01-02 23:15:12 -05:00
Pheenoh 609891bc25
adjust gameinfo sizing, rename inline register funcs 2021-01-02 19:09:04 -05:00
Pheenoh e375712d23
Merge branch 'master' of https://github.com/zeldaret/tp 2021-01-02 17:49:20 -05:00
Pheenoh 458be4d8cb
more d_save funcs OK, initial map out of dcomifg_play_c and it's classes 2021-01-02 17:47:43 -05:00
Jonathan Wase 54cef5c777
JKRAramBlock OK (#52)
Co-authored-by: Julgodis <>
2021-01-02 10:32:34 -05:00
Jonathan Wase c5b3cbaa08
JKRAssertHeap OK (#47)
* JKRAssertHeap OK

* removed JKRAssertHeap asm files.

Co-authored-by: Julgodis <>
2021-01-02 02:14:43 -05:00
jdflyer e42d44e6cb
M_do_controller_pad split and partially matched (#36)
* m_Do_controller_pad split

* Attempt to match and match mDoCPd_c::recalibrate

* Fix Merge Errors

* clang-format

Co-authored-by: Pheenoh <pheenoh@gmail.com>
2021-01-02 02:02:19 -05:00
lepelog 0555115de8
A few f_pc files (#26)
* f_pc_base, one non matching

* some of f_pc_manager

* f_pc_node OK

* f_pc_pause partly

* started node_req

* more progress

* most of node req

* delete unused asm

* node req header and param names

* param renaming

* header for manager

* review comment struct names

* fpcM_Management OK

* int -> s32

* merge master

* most of f_pc_create_iter

* f_pc_stdcreate_req OK

* f_pc_fstcreate OK

* f_pc_leaf OK

* f_pc_draw OK

* f_pc_deletor partly

* fix parameter type in f_pc_pause

* review

* review, use cPh enum and fix process_profile_definition struct

* convert f_pc files to C

* matched more functions

* fix global.h

* fix variable types

* format

* mpre Phs enum

* fix merge errors

* fix gamepad stopPatternedRumble

* format

* delete leftover files from merge

* move asm to correct folder

* revert f_pc from C to CPP

* remove C hacks and format

* format

* OK
2020-12-31 15:12:29 -05:00
Erin Moon 992cf48c7f
Split and decompile parts of JUTGamePad (#33)
* JUTGamePad.o: elaborate classes, split

* JUTGamePad::CButton: decompile functions:
- clear()
- clear(JUTGamePad*)
- setRepeat()

* elaborate PAD* types in new header

* decompile getNumBit()

* elaborate JUTGamePad fields

* move retyped externs from variables.h to JUTGamePad.h

* elaborate JUTGamePadLongPress

* JUTGamePad: decompile functions

- initList()
- init()
- clear()
- assign()
- checkResetCallback()
- checkResetSwitch()
- clearForReset()
- recalibrate()

JUTGamePad: decompile

* JUTGamePad::CStick::clear(): decompile

* JUTGamePad::CRumble: decompile functions

- startMotor()
- stopMotor()
- triggerPatternedRumble()
- startPatternedRumble()
- stopPatternedRumbleAtThePeriod()
- setEnabled()

* JUTGamePadLongPress::checkCallback(): decompile

* nonmatching: JUTGamePad::CRumble::update() and JUTGamePad::getGamePad

* JSUList<T>: allow access to JSUPtrList functions

* functions.h: clear out some func decls that are no longer used

* add notes in JUTGamePad.cpp

* clang-format + add back extern funcs

* fix some more extern labels

Co-authored-by: Pheenoh <pheenoh@gmail.com>
2020-12-29 20:22:18 -05:00
Erin Moon cba64289a4
JUTXfb: decompile (#38)
* m_Do_Reset: split and (some) decomp

decompiles:
- my_OSCancelAlarmAll()
- destroyVideo()

* mDoRst::reset(): decompile, plus some supporting code

* split DVD* functions to dvd.h

* mDoRst::resetCallBack(): decompile

* JUTXfb: split

* JUTXfb: decompile (except for almost-matching ctor)

Elaborates JUTVideo and some related stuff.
Decompiles the following functions:
- JUTXfb::initiate()
- JUTXfb::createManager()
- JUTXfb::common_init()
- JUTXfb::destroyManager()
- JUTXfb::~JUTXfb()
- JUTXfb::JUTXfb(): *almost* matching up to regalloc

* clang-format and extern label modifications

Co-authored-by: Pheenoh <pheenoh@gmail.com>
2020-12-29 18:01:48 -05:00
Pheenoh 9e442d11ca
move asm in TUs to files, add diff.py 2020-12-26 13:03:37 -05:00
Pheenoh 4c504d078d
run clang-format 2020-12-26 11:31:49 -05:00
TakaRikka e8315cdb81
begin splitting d_a_alink (#34)
* begin splitting d_a_alink

* fix

Co-authored-by: Pheenoh <pheenoh@gmail.com>
2020-12-25 21:03:10 -05:00
Erin Moon 58fc83c4f8
m_Do_Reset: OK (#35)
* m_Do_Reset: split and (some) decomp

decompiles:
- my_OSCancelAlarmAll()
- destroyVideo()

* mDoRst::reset(): decompile, plus some supporting code

* split DVD* functions to dvd.h

* mDoRst::resetCallBack(): decompile
2020-12-25 20:59:52 -05:00
TakaRikka c65c2dbb8f
Z2StatusMgr (#24)
* split Z2SeMgr / begin split of Z2SeqMgr

* Z2StatusMgr ok

most of Z2StatusMgr done, rest split

* name some class members

* name some Z2SceneMgr vars

Co-authored-by: Pheenoh <pheenoh@gmail.com>
2020-12-13 15:43:16 -05:00
unknown cbd06e5668
add d_meter2_info methods, addBottleNum OK, getBombNum OK, isLetterReadFlag OK 2020-12-06 20:46:16 -05:00
Jonathan Wase 86f892c3d3
JKernel (#20)
* JKRDvdArchive.s split

* JKRMemArchive.s split

* JKRAramArchive.s split

* JKRCompArchive.s split

* JKRDecomp.s split

* JKRDvdRipper.s split

* JKRAramBlock.s split

* JKRAramHeap.s split

* JKRAramPiece.s split

* JKRAramStream.s split

* removed unused .s files

* JKRDvdAramRipper.s split

* JKRAram.s split

* cleanup and making vtables easier to debug

* fixed merge errors

* fixed JKRFileLoader::fetchVolumeName

Co-authored-by: Pheenoh <pheenoh@gmail.com>
2020-12-06 15:02:25 -05:00
Jonathan Wase 59a3d00209
OS.h and JKRDvdFile (#19)
* OS header

* JKRFile and JKRDvdFile
2020-12-06 00:40:34 -05:00
Jonathan Wase fb1217e3f9
Types and functions for JKRThread, JKRFile, JKRDvdFile, JKRFileCache... (#17)
* Added JSUListIterator and decompiled JKRHeap::dispose_subroutine

* JKRDisposer!

* only 4 functions not OK in JKRHeap

* JKRThread asm functions

* more JKRThread

* JKRThreadSwitch

* JKRThread::JKRThread

* More JKRTHread functions and vtable

* fixed bad merge

* update JKRThread and JKRThreadSwitch to use new virtual inheritance

* save before asmsplit.py script

* JKRFile

* JKRDvdFile

* JKRFileCache

* JKRFileFinder

* JKRFileLoader

* JKRAssertHeap

* JKRExpHeap

* JKRSolidHeap

* fixed type and functions definitions

* JKRArchive (Pub)

* missed file

* JKRArchive

* forgot obj_files.mk

* fixed merge error and class members

* class members

* removed unused asm files

* added names to global variables

* class members for JKRHeap, JKRExpHeap, JKRSolidHeap, and JKRFileCache.
2020-12-05 12:45:10 -05:00
unknown 3dc3739ebd
initial class structure for dComIfG_inf_c 2020-12-04 00:04:41 -05:00
unknown 7ec9d6ec28
Merge branch 'master' of https://github.com/zeldaret/tp 2020-12-03 21:04:06 -05:00
unknown 1c7bf89fff
begin adding d_com_inf_game, add include guards to headers 2020-12-03 21:03:25 -05:00
Jonathan Wase 4adfed901e
JSUList.h templates and JKRHeap matches (#13)
* JSULink, JSUList, JSUTree and more matching in JKRHeap

* Added JSUListIterator and decompiled JKRHeap::dispose_subroutine

* more templates and JKRHeap functions

* JKRDisposer!

* only 4 functions not OK in JKRHeap

* fixed: *this->getObject()

Co-authored-by: Pheenoh <pheenoh@gmail.com>
2020-12-03 21:02:41 -05:00
notyourav 294858f751
JSystem Font classes, SComponent cBgW (#14)
* c_bg_w.cpp OK

* JUTFont and JUTResFont partially implemented

Co-authored-by: notyouraveragehooman <65437533+notyouraveragehooman@users.noreply.github.com>
Co-authored-by: Pheenoh <pheenoh@gmail.com>
2020-12-03 20:58:53 -05:00
Jonathan Wase ac6b191dc1
Improved handling of virtual inheritance. (#7)
* new system for handling vtables

* commented out non-matching JKRDisposer::~JKDisposer()

* removed artificial vtables and matched simple virtual-call functions

* better text on nonmatching functions

* reverted asmdiff.sh

* attempt 2

* Spelling

* banner and .gitignore for vtable artifacts

* move virtual function to the correct class

* remove unnecessary casts
2020-12-01 15:18:01 -05:00
Jonathan Wase 51b0260c80
JKRHeap functions (#6)
* becomeSystemHeap OK! becomeCurrentHeap OK!

* initArena OK!

* static-alloc OK! static-free OK! static-resize OK!

* operator new OK! operator delete OK!

* removed asm/d/file/sel/d_file_sel_info.o from obj_files.mk

* fixed vtable names
2020-11-30 17:24:05 -05:00
unknown 44b14ec128
migrate remaining d_save and m_Do_main asm to inline, add intial class mapping for dFile_select_c 2020-11-29 20:16:52 -05:00
unknown 58afa9ed78
add more sorting to inline'd asm for JSystem, move m_Do_main over to using newly defined JKRHeap and JKRExpHeap headers 2020-11-29 12:57:11 -05:00
unknown 92cfb378f3
Add better sorting for inline'd asm 2020-11-29 12:21:01 -05:00