doldecomp / melee Goto Github PK
View Code? Open in Web Editor NEWA decompilation of Super Smash Bros Melee brought to you by a bunch of clever folks.
A decompilation of Super Smash Bros Melee brought to you by a bunch of clever folks.
I wrote this comment probably 6 years ago, and I don't remember what I was thinking here but the vtxcount is clear a 16 bit value due to :
melee/src/sysdolphin/baselib/pobj.c
Line 707 in 8fb93d4
As discussed on Discord, the ObjUpdate functions of various HSD types were changed to have enum_t
for the type
argument, when it is in fact an unsigned int
that uses a list of #define
rather than an enum. An example of this is MObjUpdateFunc
.
This branch addresses some of that in commits as well as incorrect prototype declarations that were part of CObj, if someone wants to cherry-pick them. master...PsiLupan:melee:cobj-match
Normally I'm not picky about how floats are written, and I usually prefer to leave off as much as I can like f32 x = 0;
. But since we're trying to match exactly, I think it would be useful to standardize all of our literals to be suffixed with either F
or L
. I know 0.0
is explicitly a double in C, but having the extra L
should make it easier to scan the code.
Some existing literals use lowercase f
so I think we should agree on one or the other.
So I don't forget.
dolphin
gx
GXFifo
Line 133 in 346f267
GXLight
melee/src/dolphin/gx/GXLight.c
Line 3 in 346f267
sysdolphin
baselib
mtx
melee/src/sysdolphin/baselib/mtx.c
Line 70 in 346f267
shadow
melee/src/sysdolphin/baselib/shadow.c
Line 38 in 346f267
melee
ft
fighter
Line 47 in 346f267
Line 89 in 346f267
Line 123 in 346f267
Line 140 in 346f267
Line 824 in 346f267
Line 1198 in 346f267
Line 2222 in 346f267
Line 2269 in 346f267
Line 2313 in 346f267
ftbosslib
melee/src/melee/ft/ftbosslib.c
Line 11 in 346f267
melee/src/melee/ft/ftbosslib.c
Line 36 in 346f267
ftdata
Line 2176 in 346f267
chara/ftIceClimber/fticeclimber2_nana
chara/ftKirby/ftkirby
chara/ftMasterHand/ftMasterHand_2
chara/ftMasterHand/ftMasterHand_8
chara/ftSamus/ftsamus3
melee/src/melee/ft/chara/ftSamus/ftsamus3.c
Line 142 in 346f267
gr
ground
mp
mpcoll
pl
player
Author: @VetriTheRetri
ftcoll
lbcollision
ftaction
Progress:
Code sections: 731049 / 3882272 bytes in src (18.830443%)
Data sections: 182474 / 1223369 bytes in src (14.915696%)
You have 55 of 293 Trophies and completed 7 of 51 Event Matches.
Code bytes to go for next trophy: 10956
b0d2f6a (directly after):
Progress:
Code sections: 724977 / 3882272 bytes in src (18.674039%)
Data sections: 182393 / 1223369 bytes in src (14.909075%)
You have 54 of 293 Trophies and completed 7 of 51 Event Matches.
Code bytes to go for next trophy: 3778
This is the source permuter we usually use for helping us finish decompilations. The idea is that we have C code that is logically equivalent to the solution -- however, there are optimizations that the compiler will do or heuristics to change the output assembly in a way that is hard to guess every time. The permuter just does random operations and hopes the score will go down. I think that this is actually a good use case for ML if we're able to express the problem correctly. Working on expressing the problem -- once we do that, we can train on the corpus of this repo and self-generated variations via the permuter :).
https://decomp.me/scratch/uCVeJ
Author: @Ka-lua
Co-authors: @ribbanya, @r-burns, @ProjectRevoTPP
You do not need to make a formal PR to get your matching decompilation merged, and you don't need to finish a whole file. Simply create a new issue with any number of scratches and a maintainer will integrate your code into master
.
See our Getting Started guide for more information.
Author: @EstexNT
Such as pi, degrees-to-radians, etc. GAS supports predefined floats via .define
so those should also be replaced.
Ideally also remove "private" module functions from the "public" headers and use __module_name.h
for those instead.
In particular at the time of writing:
ftpikachu.h
ftzelda.h
#768
func_8007C114
: https://decomp.me/scratch/QP6Eg
Checks if the fighter has an item, if it does and it's the hammer it checks if the head should fall off (by calling func_800C555C
). Then it sets a bit flag.
func_800C555C
: https://decomp.me/scratch/XPrfZHSD_GObj
is holding should have its head fall off by calling func_8026C16C
.https://decomp.me/scratch/5YZak
In cm/cmsnap.s
void func_80031640(HSD_GObj* arg0, s32 arg1) {
switch (lbl_80453060[0]) {
case 1:
func_800122C8(&lbl_80453060[1], 0, 0, 0);
lbl_80453060[0] = 2;
return;
case 2:
case 3:
case 4:
lbl_80453060[0] += 1;
case 0:
default:
return;
}
}
This looks like
union_type_dobj
or some type of inline, given it shows up multiple times.
Originally posted by @PsiLupan in #528 (comment)
melee/src/sysdolphin/baselib/jobj.c
Line 179 in eb0e098
it_802C01AC
it_802C027C
it_802C02E4
it_802C031C
it_802C0368
<- rtburns & Revo, 99.78%it_802C0490
it_802C0498
it_802C04B8
it_802C04C0
it_802C04C8
it_802C04D0
it_802C04F0
db.c
(#320)dsp.c
(#209, #507)dsp_debug.c
(#320)Author: @ProjectRevoTPP
I'm thinking something like
// calcprogress force
asm static void __init_registers(void)
{ // clang-format off
nofralloc
lis r1, _stack_addr@h
ori r1, r1, _stack_addr@l
lis r2, _SDA2_BASE_@h
ori r2, r2, _SDA2_BASE_@l
lis r13, _SDA_BASE_@h
ori r13, r13, _SDA_BASE_@l
blr
} // clang-format on
// calcprogress restore
Discussed a bit over Discord. Creating this as a placeholder for further discussion.
Hi, this is a really great start. I have a couple questions, though.
Left these comments on functions I don't know the names of, which exist in KAR but are stripped in melee because their only uses are auto-inlined. Maybe Psi knows what to call them.
Originally posted by @r-burns in #475 (comment)
Every function of math has been fully matched and decompiled except for func_803265A8. (which I'll do very soon, unless one of you wants to pick it up for themselves)
The currently linked math.o file is from the asm so this has to be changed as well as soon as func_803265A8 is matched.
- Match func_803265A8
- Rename variables to what they do
- Reformat function bodies/Remove comments
- Rename functions to what they do
- Link math.o from "src"
Originally posted by @FluentCoding in #235 (comment)
melee/include/common_structs.h
Lines 30 to 33 in 5542402
And also give that enum a name.
The reason it's mixed usage is because of me copy-pasting from structs in FRAY, which I think was done here. It's been something I've tried to cleanup as I actually decompile files themselves.
I was using this style because of Intellisense at the time and changed to match how other projects handle it with
/* 0xA */
, but we should settle on which needs to be done if that's the case.
Originally posted by @PsiLupan in #556 (comment)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.