Commit graph

1065 commits

Author SHA1 Message Date
Clownacy
d6bbb013f9 Deobfuscate some BOOLs 2020-07-08 02:57:00 +01:00
Clownacy
788e5ea2d8 Add some sound fixes and documentation 2020-07-08 02:07:22 +01:00
Clownacy
85ccda7829 Add missing functions to header 2020-07-08 01:57:15 +01:00
Clownacy
220f48a98b Backport some undefined-behaviour fixes 2020-07-06 15:11:45 +01:00
Clownacy
ffa4b16376 Deobfustate some NPC_MAX values 2020-07-02 20:20:12 +01:00
Clownacy
90de32a83d
Fix bugs in bugfix
These checks would leak the FILE*. Also did some pedantic style tweaks.
2020-07-02 15:52:37 +01:00
Gabriel Ravier
ff25ddfef0 src/TextScr.cpp: Do not crash when TSC files are too big with FIX_BUGS
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-07-02 16:43:13 +02:00
Clownacy
143f3b9646 Backport header improvements from #133
Thanks to GabrielRavier for these
2020-07-02 14:42:53 +01:00
Clownacy
5983b8e234 Don't mark out as static
Causes it to be put in the wrong part of the EXE for some reason,
even though we know from the Mac port that it *was* static.
2020-07-01 21:57:57 +01:00
Gabriel Ravier
bede1a16f5 src/Sound.cpp: Remove duplicate stddef.h include
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-06-30 23:48:34 +02:00
Gabriel Ravier
08062e9823 Merge branch 'accurate' into accurateAddStddefWhenNeeded
# Conflicts:
#	src/Sound.cpp
2020-06-30 23:47:23 +02:00
Clownacy
1bf110269c Correct some constants
Have been incorrect since f43a3c1130
2020-06-30 21:30:56 +01:00
Gabriel Ravier
3092c34681 src: Add #include <stddef.h> where appropriate in order to have NULL/size_t and others from the proper header
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-06-30 18:26:44 +02:00
Gabriel Ravier
a62141e185 src: Added back stddef.h where accurate to get NULL/size_t properly (stdio.h provides them, but it's for file I/O, not essential definitions and types)
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-06-30 01:52:38 +02:00
Gabriel Ravier
66e4995135 src: Remove unnecessary includes
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-06-30 00:12:17 +02:00
Clownacy
a5bf854408 Document gMC.equip
All raw values have been replaced with enums
2020-06-27 19:27:57 +01:00
Clownacy
70a3badc0d Cleanup 2020-05-04 18:21:44 +01:00
Clownacy
4000615b45 This is also likely more accurate to the source 2020-05-03 22:13:28 +01:00
Clownacy
124aebaaa2 This is likely more accurate to the original code 2020-05-03 22:07:18 +01:00
Clownacy
e1af3336aa Fix compilation 2020-05-03 22:05:39 +01:00
Clownacy
496a50c272 More static function stuff
This time I'm using the Linux debug data
2020-05-03 21:52:37 +01:00
Clownacy
95b29bb516 Mark some functions as static
Mac debug data confirms these
2020-05-03 21:52:36 +01:00
Clownacy
486cf37161 Mark a char as signed
Might revert, not sure. I'm just doing this for consistency with
other bits of code.
2020-05-03 21:52:29 +01:00
Clownacy
03250d62a0 Make variables more accurate
This commit changes which variables are static: the Mac (and
presumably the Linux) debug data tells you what variables are static,
by prefixing their names with double_underscores.

The variable names themselves also hint at this: global variables are
prefixed with 'g', and use upper-camelcase, while static variables
use whatever_you_call_this.
2020-05-03 20:28:56 +01:00
Clownacy
43c0b670ab Figured out the mystery values in RestoreSurfaces
They're ASCII characters.
2020-04-26 00:07:45 +01:00
Clownacy
c52812664e Fix bosses flicking across the screen when hurt
The Wii U's wacky PowerPC architecture highlighted a cool
platform-dependency: the boss rendering code only properly works on
platforms where `char` is signed by default.

Granted, it's possible Pixel explicitly marked this variable as
signed. Who knows. Either way, CSE2 didn't, and now that's been
fixed.
2020-04-19 22:40:03 +01:00
Clownacy
1898633602 Found a name for nameless_flag! 2020-04-16 15:28:57 +01:00
Clownacy
ff45da6a0e Mark a static function as static
Both the Linux and Mac debug data indicate this is static (they both
prefix static function names with an extra underscore)
2020-04-16 14:45:08 +01:00
Clownacy
8f49276d5e Note some not-so-authentic variable names 2020-04-16 14:44:53 +01:00
Clownacy
4c910dbee6 Correct variable name
I must have guessed this one, and not left a comment saying it was
fake... dammit.
2020-04-16 13:52:00 +01:00
Clownacy
8a9f70875c More authentic variable/function names 2020-04-16 13:48:36 +01:00
Clownacy
47740fe88d Note some weird code 2020-04-16 13:47:17 +01:00
Clownacy
b83b7f25fc Found the real name for DummiedOutLogFunction..? 2020-04-16 13:47:17 +01:00
Clownacy
b8c0581ee4 Found the original Config.cpp variable names
Thank you, Mac port...
2020-04-16 13:47:17 +01:00
Clownacy
624adbdab8 Remove junk widescreen code
This doesn't belong in here. Also, this code was overhauled in the
enhanced branch, so this version is useless.
2020-04-15 19:59:13 +01:00
Clownacy
2a0570df94 Make bugfix consistent with official code 2020-04-07 18:18:45 +01:00
Clownacy
409453a6a1 Note some null characters 2020-04-07 14:03:15 +01:00
Clownacy
ae66ede214
Merge pull request #105 from GabrielRavier/accuratePortableBugs2SisterPR
Noted a bunch of npc->cond = 0 bugs and gTS.data-related crashes
2020-04-06 13:51:52 +01:00
Clownacy
fbf9332c9a Fix compiler error with DEBUG_SAVE enabled 2020-04-05 18:25:35 +01:00
Clownacy
f75859b759 Change constant ordering
This was bugging the hell out of me
2020-04-05 03:35:43 +01:00
Clownacy
bd280414ea Cleanup 2020-04-04 00:43:06 +01:00
Clownacy
5d37391882 Document bullets a little 2020-04-04 00:13:20 +01:00
Clownacy
90714cb7a4 Apply some missing BOOL constants 2020-04-03 23:16:40 +01:00
Clownacy
ca6538561f Document ActNpc061 (King) 2020-03-27 17:49:58 +00:00
Clownacy
7820926bfd Remove outdated comments 2020-03-22 15:37:00 +00:00
Clownacy
c34a7fc354 Fix build error 2020-03-22 15:35:59 +00:00
Clownacy
b374a8046c Add some missing global/static variable names
Also from the Mac port.
2020-03-22 15:31:28 +00:00
Clownacy
f6606b7748 Add some missing function names
These were retrieved from the Mac port (v0.0.7), which kept these
functions.

Unfortunately, this port is missing local variable names, so we can't
use it to make InitBack accurate.
2020-03-22 15:31:28 +00:00
Gabriel Ravier
6f114d0da5 Bullet, Caret, NpcAct1{2,4,8}0, TextScr: Add a note about some overflow bugs 2020-03-17 15:31:02 +01:00
Clownacy
169a755ec3 Wrap UTF-8 strings in C89-style comments
This should prevent compilation errors when compilers don't read the
source files as UTF-8.

MSVC in certain codepages previously misread some UTF-8 comments as
containing newlines, causing it to try to process the rest of the
comment as code. This was fixed by forcing MSVC to read the files as
UTF-8 using the `/utf-8` flag, but this doesn't seem to be supported
in older versions.

Since the issue was caused by newlines being added where they didn't
belong, using C89-style comments instead should avoid the problem
altogether.

I'll still keep the utf-8 flag around for supported compilers - just
in case.
2020-03-14 14:12:53 +00:00