Commit graph

51 commits

Author SHA1 Message Date
Gabriel Ravier
564d42dbd2 src: Change from using asprintf-based code to using std::string-based code
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-06-29 18:33:22 +02:00
Gabriel Ravier
32a879ca58 src: Removed MAX_PATH and made the path/string handling better in general (ported over from supportPathsAboveFilenameMax)
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2020-06-29 00:14:30 +02:00
Clownacy
2f682a102f Merge branch 'accurate' into portable 2020-05-04 18:17:39 +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
b89207b586 Merge branch 'accurate' into portable 2020-04-20 01:17:19 +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
b8de1cb5db Merge branch 'accurate' into portable 2020-03-31 14:07:21 +01:00
Clownacy
ca6538561f Document ActNpc061 (King) 2020-03-27 17:49:58 +00:00
Clownacy
9cbaa0be00 Merge branch 'accurate' into portable 2020-01-08 13:16:21 +00:00
Clownacy
63e855c7fa More-accurate NpChar.cpp variable arrangement 2020-01-07 20:48:21 +00:00
Clownacy
84626ea710 Merge branch 'accurate' into portable 2020-01-07 04:55:16 +00:00
Clownacy
58d7a45392 Empty Tags.h
There's no evidence Tags.h contained these variables (if anything, it
appears that Pixel manually declared them in every file that used
them).

gg Pixel
2020-01-06 21:20:17 +00:00
Clownacy
0ec5d85d56 Merge branch 'accurate' into portable 2019-11-17 18:30:44 +00:00
Clownacy
58bd3533d9 Clean-up NpChar.cpp 2019-11-14 02:22:29 +00:00
Clownacy
8344716548 Merge branch 'accurate' into portable 2019-11-09 14:24:55 +00:00
Gabriel Ravier
f96b7fa566 Use "memcmp(a, b) != 0" instead of "memcmp(a, b)" so it's clearer we're searching for a difference
Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2019-11-05 17:25:08 +01:00
Clownacy
006a20b914 Merge branch 'accurate' into portable 2019-10-21 20:25:48 +01:00
Clownacy
b1418f7fae Remove a leftover unsigned literal 2019-10-21 19:33:49 +01:00
Clownacy
5b5d5ae729 Revert "Restore the Windows-style path separators"
This reverts commit 42e1b36fd8.
2019-09-05 14:19:17 +01:00
Clownacy
84c3cd825e Merge branch 'accurate' into portable 2019-09-05 14:18:42 +01:00
Clownacy
42e1b36fd8 Restore the Windows-style path separators 2019-09-05 14:05:27 +01:00
Clownacy
4e50046d4b Remove WINDOWS and NONPORTABLE
Now that the portable stuff gets its own branch, these are unneeded
2019-09-04 02:14:15 +01:00
Clownacy
73e18b4610 Removed the WINDOWS and NONPORTABLE stuff
Now that all the ASM-accurate stuff is in its own branch, we don't
need these anymore.
2019-09-04 00:54:11 +01:00
Clownacy
5ea356a3bd Weed out a lot of the Windows dependency
Storytime: Cucky's original SDL2 port work involved using SDL2's
threading API to emulate the original WinAPI threading.

I can't be assed with that stuff, so I used the same trick Cucky did
for the Wii port, and hooked Organya up to the SDL2 audio callback.
This actually opens up the possibility for perfectly-synchronised
Organya playback. By that I mean, instead of needing a super
low-latency audio callback, I can have the callback synchronise its
audio mixing with Organya itself. I haven't done it yet, I plan to
soon.
2019-09-04 00:28:23 +01:00
Clownacy
35344c5f4f Fixes
What is it with Pixel's official code, and relying on non-standard
stuff? Even his PxTone library had portability issues.
2019-09-02 02:02:25 +01:00
Clownacy
03e513365b PATH_LENGTH is actually Windows's MAX_PATH
When MAX_PATH isn't available, use FILENAME_MAX. This might be a bad
idea.
2019-08-31 01:44:53 +01:00
Clownacy
3e34136f69 Overhauled the NPC_flags, and applied them everywhere
No more raw values floating about in the decompiled code.
Been wanting to do this for ages.
2019-08-21 17:59:06 +00:00
Clownacy
64598dc2a5 Rename Surface_Ids to SurfaceID
For code style consistency (this isn't a vanilla enum name - I don't
think there even was an enum for this in the original source code)
2019-08-21 16:18:55 +00:00
Clownacy
5167a341aa Made NpChar.cpp ASM-accurate
SetBulletObject has a commented-out if, it seems, and the leftover
braces affected the ASM.
2019-06-30 00:57:19 +01:00
Gabriel Ravier
06e65cad6e
Revamped NpChar, NpcHit and NpcTbl
Also changed regex to "((//|\;)[^
\t\n]|(for|while|if|while|do|void|int|bool)\((for|while|if|while|do)\
\(.*\)\;|\(\ |\ \)|//\ [a-z]|\ \ )|break;\n[\t]*[^\n\t\}(\/\/
Fallthrough]|[^\t\n]\{[^\n]|[^\n\t]\}[^\n]"

Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2019-06-13 20:39:46 +02:00
Clownacy
676ee004fe Removed the dependency on stdint.h
This doesn't exist in MSVC2003, and nothing in the Linux port's debug
symbols indicate Pixel used it.
2019-05-13 15:18:33 +01:00
Clownacy
fb87b8dd57 Made NpChar.cpp almost ASM-accurate
For some damn reason I can't replicate SetBulletObject stack frame
layout.
2019-05-12 23:47:31 +01:00
Clownacy
f8d4ae7014 Made Stage.cpp ASM-accurate 2019-05-07 13:52:50 +01:00
Gabriel Ravier
960fa6f456 Removed all trailing spaces and added newline at EOF (when not present)
Also changed a "linux" to "Linux"

Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
2019-05-07 11:55:42 +02:00
Clownacy
25e68bfb9d Mark string pointers as const 2019-05-06 20:18:24 +01:00
Clownacy
3e5f44f8de Changed some things to BOOL/BOOLEAN, for ASM-accuracy 2019-02-22 22:23:57 +00:00
Clownacy
55f1d3a9fe Fixed some problems found while compiling most of this with VC++2003
I could compile most of this, but not link it (SDL2's .lib files must
be too new).
2019-02-20 03:55:05 +00:00
Clownacy
84945aa898 Removed some old unimplemented-function stuff that we no longer need 2019-02-19 00:55:01 +00:00
Clownacy
0bb9760d87 Rearranged #includes 2019-02-18 21:30:22 +00:00
Clownacy
809fb95b26 Fix Surface_Ids crash 2019-02-18 20:40:51 +00:00
Clownacy
e5caff593c Removed the SDL dependency from Draw.h
Should make compiling with VC++ 2003 simpler
2019-02-18 20:40:07 +00:00
Clownacy
c44186d93a Ditched SDL's file IO for stdio and our own convenience functions
ASM-accurate file stuff can come later.
2019-02-15 20:33:08 +00:00
cuckydev
66e96f47b7 omega 2019-02-02 01:19:12 -05:00
cuckydev
eee18d71a3 Finally, bullets murder NPCS, also fixed SetExpObjects to not crash... oops! 2019-01-30 18:44:31 -05:00
Clownacy
81f22c2bb8 Added more NPCs
Mostly, if not all, Egg Corridor.
2019-01-29 18:48:43 +00:00
cuckydev
10d946aca2 map system doesn't work 2019-01-29 09:17:13 -05:00
cuckydev
11bbcde9f8 worked on tsc some more, fixed Surface2Surface, blah blah blah happy birthday to me 2019-01-27 01:28:14 -05:00
zxin
50ca5e37a2 Fixed NPC000. 2019-01-26 15:55:53 +00:00
cuckydev
cbc5542cca added some stuff 2019-01-24 22:19:56 -05:00
cuckydev
51638079c7 worked on npc stuff 2019-01-22 22:04:35 -05:00