Commit Graph

706 Commits

Author SHA1 Message Date
nmlgc af5419e350 Fix the directory of the fperror() slices
(Damn, the other commit prepared for today is not getting done, why does IDA
have to be so terrible...!)

Anyway, here's a small consistency edit instead.
2014-11-11 23:42:56 +01:00
nmlgc 87a682dd4f [Reduction] #695-696: User entry points for read() and write()
That's it, segment 0 cleared out in all executables of TH01! Only missing that
last floating-point slice now...
2014-11-10 22:20:59 +01:00
nmlgc 7705bea1f9 [Reduction] #694: scanf 2014-11-10 21:42:09 +01:00
nmlgc 4c30e5e974 [Reduction] #693: scanner 2014-11-10 21:04:32 +01:00
nmlgc 8386db1cb9 [Reduction] #692: coreleft 2014-11-10 19:58:08 +01:00
nmlgc 6ab63bc2ab [Reduction] #691: farcoreleft 2014-11-10 19:19:33 +01:00
nmlgc dfc9361b33 [Reduction] #690: farcalloc 2014-11-10 19:11:34 +01:00
nmlgc 1681595338 [Reduction] #689: Long pointer+scalar addition
This file has been lying around there for almost three months now, because I
initially couldn't describe its functionality...
2014-11-10 19:10:46 +01:00
nmlgc f7cb71193b [Reduction] #686-688: scantod 2014-11-10 01:02:11 +01:00
nmlgc 84180b9cd9 [Reduction] #685: ldtrunc 2014-11-09 14:49:18 +01:00
nmlgc 03139534f7 [Reduction] #684: control87 2014-11-09 13:18:19 +01:00
nmlgc 13b10ef589 [Reduction] #683: access (the one that *actually* has no underscore) 2014-11-09 11:58:33 +01:00
nmlgc 986590f321 [Reduction] #682: ftol
And surprisingly, TH01's OP.EXE ends up as the first game executable that has
its seg000 cleared out.
2014-11-09 01:11:04 +01:00
nmlgc 97221c8bb5 Forgot text_fillca() in TH01's REIIDEN.EXE 2014-11-08 12:46:33 +01:00
nmlgc 408fe19952 [Reduction] #681: ungetc 2014-11-08 11:45:33 +01:00
nmlgc cab8db3ce2 [JWasm move] "addr" is a reserved word 2014-11-07 12:38:54 +01:00
nmlgc 52209cbcdf [JWasm move] Add symbol names to the ENDP and ENDS directives where necessary 2014-11-06 06:45:35 +01:00
nmlgc 4dc9b9ab4a [JWasm move] Don't use the DIST/CALLMODEL constants for procedures and labels
Once you've actually found the right syntax that makes the assembler just use
the default call type of the current memory model for both procedures (where
it's just "PROC" without anything else) and labels (where it's "LABEL PROC"),
these constants become completely unneccessary, even with TASM.
2014-11-05 18:20:02 +01:00
nmlgc 00bacc7af3 [Reduction] #673-680: BERO's Pi loader library
> randomly google "PC-98 ライブラリ"
> 3rd hit: http://www.vector.co.jp/soft/dos/prog/se037608.html
> Oh look, it's the mystery code at the beginning of the TH01 executables!

This library also has dedicated support for transparency, which is used in the
Konngara fight (BOSS8_D*.GRP) and which we couldn't edit during the
development of the static English patches.
But of course, ZUN just had to change the format magic in order to make it
seem unique.
2014-11-04 18:42:43 +01:00
nmlgc 66e293fe4d Forgot puts() in TH01's FUUIN.EXE
-_-
2014-11-03 06:59:02 +01:00
nmlgc 0b34460155 [Reduction] #670-672: e087_Trap
I guess this marks the final demystification of how segment declarations work
and how they are compiled. However, it only really makes sense for anything
outside the TEXT segment, like these floating-point functions. As long as the
slices aren't immediately next to each other, it would still be annoying to
have segment declarations inside of them, since we'd have to copy-paste these
declarations around every INCLUDE directive...
2014-11-02 20:11:20 +01:00
nmlgc 3a1c2fd679 Move the stack segment into its own slice
Saves 141 lines, and we'll need to ASSUME it in the upcoming floating-point
slices.
2014-11-02 19:44:02 +01:00
nmlgc a777ad2ad1 [Reduction] #668-669: pow10 2014-11-02 16:41:47 +01:00
nmlgc 0856fab827 [Reduction] #576-667: emu086.asm 2014-11-02 11:20:05 +01:00
nmlgc 7790ecdb7c [Reduction] #574-575: vprinter
And that would be the final function of the printf() family!
2014-11-02 09:01:46 +01:00
nmlgc 6d422052ca [Reduction] #570-573: realcvt 2014-11-02 08:27:17 +01:00
nmlgc 015ceec3e1 [Reduction] #569: xcvt
... and even with EMUL being set up and working, TASM still needs to be hacked
into actually emitting emulator calls for certain instructions.
2014-11-02 06:55:48 +01:00
nmlgc bbd8ff96ab [Reduction] #563-568: Floating-point emulator initialization
Finally - and there was indeed no way around switching to JWlink, as ALINK
v1.6 refuses to link the TH01 executables with a nondescript "Undefined base
seg" message once nec_fpinit.asm is included.
2014-11-01 17:09:13 +01:00
nmlgc ae6c844b25 Ensure the correct amount of padding between the TEXTC and DSEG segments
Since DSEG is *supposed* to be aligned to a paragraph boundary, this should
have never mattered. However, JWlink seems to not obey this segment alignment
in some layer of the linking process.
This now guarantees identical builds with TLINK, ALINK and JWlink.
2014-11-01 09:54:57 +01:00
nmlgc 4ac17ac2a5 Trick TASM into not creating 32-bit default segments
So that's the - admittedly rather weird - solution to the problem that has
been plaguing this project ever since the beginning of the reduction step.
Without any 32-bit dummy segments in the compiled object files, more linkers
will be able to build this project, one of them being JWlink
(http://sourceforge.net/projects/jwlink/).

Still can't rename dseg to _DATA though, as TASM stupidly refuses to accept
any ALIGN directives above a segment's alignment attribute value. TH01's
floating-point data slices already require larger alignments, and we're very
likely to have even more of those in the future.

Also, we're finally defining the Borland C++ model symbols directly in the
code, rather than in my unpublished build batch files. :)
2014-10-31 08:17:54 +01:00
nmlgc 48088875ca [Reduction] #561-562: scantol
Also finally getting a macro for the recurring "pop cx if LDATA" case.
2014-10-30 09:38:46 +01:00
nmlgc 696d7f9476 Identify the missing BSS slice of xxv.cpp
sigdata.c doesn't specify any alignment, so this is the only position that
makes sense.
2014-10-29 05:41:43 +01:00
nmlgc 935e68f35e [Reduction] #560: puts 2014-10-29 05:34:30 +01:00
nmlgc 2d62776e02 [Reduction] #559: printf 2014-10-28 03:01:42 +01:00
nmlgc c4aee8a236 [Reduction] #556-558: open 2014-10-27 02:50:32 +01:00
nmlgc ebd20ebc88 [Reduction] #554-555: __rtl_open/__open
Same situation as with __rtl_close/__close, __rtl_read/__read and
__rtl_write/__write.
2014-10-26 02:16:29 +02:00
nmlgc d7d9758fac [Reduction] #553: C++ vector_new 2014-10-25 02:53:27 +02:00
nmlgc 2c2977aa69 [Reduction] #552: Far new[] operator 2014-10-24 03:00:29 +02:00
nmlgc 0b6a824296 [Reduction] #551: Far new operator 2014-10-23 02:01:06 +02:00
nmlgc 4c12d226a4 [Reduction] #550: lrotr 2014-10-22 13:45:02 +02:00
nmlgc c9ee6b0aef [Reduction] #549: lrotl 2014-10-21 03:46:42 +02:00
nmlgc 340c8a792a General cleanup
Mostly moving spurious null bytes, which are actually supposed to denote
alignment, into their associated slices, but also prettying up some of the
very first slices.
2014-10-20 17:20:04 +02:00
nmlgc 1c72d7e242 [Reduction] #548: Floating-point emulation data
Well, we have to start reducing this mess somewhere. The actual reduced
initialization code I've been preparing still fails to compile, and the data
is shared with a number of other components anyway, so...
2014-10-19 23:37:46 +02:00
nmlgc 191fd5b76b [Reduction] #543-547: fgetc and friends 2014-10-18 02:20:40 +02:00
nmlgc 489ecc8a96 [Reduction] #542: fprintf 2014-10-17 18:26:56 +02:00
nmlgc 54968ed7a3 [Reduction] #541: Fake floating point conversion 2014-10-16 07:29:53 +02:00
nmlgc 16b4e1d240 [Reduction] #540: close
Now with DOS error codes.
2014-10-15 08:39:22 +02:00
nmlgc d6449b27cf [Reduction] #537-539: sprintf 2014-10-14 04:00:44 +02:00
nmlgc 3457818399 [Reduction] #533-536: fopen
More flags and constants, despite reminding me why exactly I haven't done this
all along.
2014-10-13 06:12:09 +02:00
nmlgc 658ed9e72b Move "Abnormal program termination" to its own slice
That was the very first function reduced, before I came up with the data slice
model in 59688e23fc.
2014-10-12 18:37:58 +02:00