2014-08-06 19:16:11 +00:00
|
|
|
;
|
|
|
|
; +-------------------------------------------------------------------------+
|
|
|
|
; | This file has been generated by The Interactive Disassembler (IDA) |
|
|
|
|
; | Copyright (c) 2009 by Hex-Rays, <support@hex-rays.com> |
|
|
|
|
; +-------------------------------------------------------------------------+
|
|
|
|
;
|
|
|
|
; Input MD5 : DE5454973591EBD937B11452A8B4882D
|
|
|
|
|
|
|
|
; File Name : th01/ZUNSOFT.COM
|
|
|
|
; Format : MS-DOS COM-file
|
|
|
|
; Base Address: 0h Range: 100h-2870h Loaded length: 2770h
|
|
|
|
; OS type : MS DOS
|
|
|
|
; Application type: Executable 16bit
|
|
|
|
|
2014-10-31 06:17:05 +00:00
|
|
|
.286 ; Force the .model directive to create 16-bit default segments...
|
2014-08-06 19:16:11 +00:00
|
|
|
.model tiny
|
2014-10-31 06:17:05 +00:00
|
|
|
__TINY__ equ 1
|
|
|
|
.386 ; ... then switch to what we actually need.
|
|
|
|
; And yes, we can't move this to an include file for some reason.
|
2014-08-06 19:16:11 +00:00
|
|
|
|
2014-08-22 15:06:33 +00:00
|
|
|
include ReC98.inc
|
2014-11-15 01:03:41 +00:00
|
|
|
include th01/th01.asm
|
Include RULES.ASI from every executable's dump file.
Having thought this over for a while, I've decided to stay with the "include
slice" model for now, due to various bugs and other reasons.
We need to compile for the 386 CPU, but this causes TASM to automatically
default every segment to 32-bit mode, which of course is not what we want (and
no, .MODEL USE16 sadly does not help either). Appending USE16 to every segment
declaration in all included files seems to work, but for some reason, this
messes up certain jump instructions. WTF? And even if it did work, we would
still have to do this for every single file we include.
The alternative would be to build proper libraries and let the linker merge
all the code. This would add a lot of unwarranted complexity to the build
process. Not to mention all the EXTERN statements we'd have to maintain.
Ultimately, all of the C runtime ASM code is going to vanish anyway once we've
completed the reduction step. Once we're there, we can simply link to the
original version of the library. These initial dumps are not pretty, and I see
no point in wasting time on making intermediary stages of development look
pretty.
Since including RULES.ASI from every slice seems a bit inefficient (and even
potentiall harmful, considering the age of the development tools we have to
work with), we'll only include it once at the top of every main dump file.
[Binary change] Relocations in TH01's REIIDEN.EXE, again.
2014-08-14 06:01:36 +00:00
|
|
|
|
2014-08-06 19:16:11 +00:00
|
|
|
; ===========================================================================
|
|
|
|
|
|
|
|
; Segment type: Pure code
|
2014-10-31 06:17:05 +00:00
|
|
|
_TEXT segment word public 'CODE' use16
|
|
|
|
assume cs:_TEXT
|
2014-08-06 19:16:11 +00:00
|
|
|
org 100h
|
2014-10-31 06:17:05 +00:00
|
|
|
assume es:nothing, ss:_TEXT, ds:_TEXT, fs:nothing, gs:nothing
|
2014-08-06 19:16:11 +00:00
|
|
|
|
2014-08-19 20:33:43 +00:00
|
|
|
include libs/BorlandC/c0.asm
|
2014-08-06 19:16:11 +00:00
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
sub_367 proc near
|
2014-08-06 19:16:11 +00:00
|
|
|
push bp
|
|
|
|
mov bp, sp
|
|
|
|
mov dx, 0A6h
|
|
|
|
mov al, 1
|
2014-09-18 15:20:12 +00:00
|
|
|
out dx, al
|
2014-08-27 04:03:08 +00:00
|
|
|
call graph_clear
|
2014-08-06 19:16:11 +00:00
|
|
|
mov dx, 0A6h
|
|
|
|
mov al, 0
|
2014-09-18 15:20:12 +00:00
|
|
|
out dx, al
|
2014-08-27 04:03:08 +00:00
|
|
|
call graph_clear
|
2014-08-06 19:16:11 +00:00
|
|
|
mov dx, 0A4h
|
|
|
|
mov al, 0
|
2014-09-18 15:20:12 +00:00
|
|
|
out dx, al
|
2014-08-06 19:16:11 +00:00
|
|
|
pop bp
|
|
|
|
retn
|
|
|
|
sub_367 endp
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
sub_384 proc near
|
2014-08-06 19:16:11 +00:00
|
|
|
push bp
|
|
|
|
mov bp, sp
|
2014-08-21 21:05:54 +00:00
|
|
|
call mem_assign_all
|
2014-08-27 23:16:54 +00:00
|
|
|
call graph_start
|
2014-08-23 12:01:53 +00:00
|
|
|
call key_beep_off
|
2014-08-20 14:27:28 +00:00
|
|
|
call text_systemline_hide
|
|
|
|
call text_cursor_hide
|
2014-08-20 20:24:05 +00:00
|
|
|
call egc_start
|
2014-08-06 19:16:11 +00:00
|
|
|
call sub_367
|
2014-08-20 14:45:24 +00:00
|
|
|
call text_clear
|
2014-08-06 19:16:11 +00:00
|
|
|
mov byte ptr ds:2870h, 0
|
|
|
|
mov byte ptr ds:2871h, 1
|
|
|
|
push 60h
|
|
|
|
push 64h
|
|
|
|
push 21Fh
|
|
|
|
push 12Bh
|
2014-08-31 06:36:33 +00:00
|
|
|
call grc_setclip
|
2014-08-27 23:05:11 +00:00
|
|
|
call graph_hide
|
2014-08-06 19:16:11 +00:00
|
|
|
push 21CEh
|
2014-08-23 16:07:02 +00:00
|
|
|
call super_entry_bfnt
|
2014-08-23 14:11:16 +00:00
|
|
|
call palette_show
|
2014-08-23 13:47:05 +00:00
|
|
|
mov PaletteTone, 0
|
2014-08-23 14:11:16 +00:00
|
|
|
call palette_show
|
2014-08-27 03:18:17 +00:00
|
|
|
call graph_show
|
2014-08-06 19:16:11 +00:00
|
|
|
pop bp
|
|
|
|
retn
|
|
|
|
sub_384 endp
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
sub_3D0 proc near
|
2014-08-06 19:16:11 +00:00
|
|
|
push bp
|
|
|
|
mov bp, sp
|
2014-08-22 21:45:21 +00:00
|
|
|
call super_free
|
2014-08-06 19:16:11 +00:00
|
|
|
call sub_367
|
2014-09-08 18:30:15 +00:00
|
|
|
call mem_unassign
|
2014-08-20 14:45:24 +00:00
|
|
|
call text_clear
|
2014-08-20 20:24:05 +00:00
|
|
|
call egc_start
|
2014-08-06 19:16:11 +00:00
|
|
|
pop bp
|
|
|
|
retn
|
|
|
|
sub_3D0 endp
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
sub_3E4 proc near
|
2014-08-06 19:16:11 +00:00
|
|
|
|
|
|
|
arg_0 = word ptr 4
|
|
|
|
arg_2 = byte ptr 6
|
|
|
|
arg_4 = word ptr 8
|
|
|
|
arg_6 = word ptr 0Ah
|
|
|
|
|
|
|
|
push bp
|
|
|
|
mov bp, sp
|
|
|
|
push si
|
|
|
|
push di
|
|
|
|
mov si, [bp+arg_6]
|
|
|
|
mov di, [bp+arg_4]
|
|
|
|
mov ax, [bp+arg_0]
|
|
|
|
cwd
|
|
|
|
mov bl, [bp+arg_2]
|
|
|
|
mov bh, 0
|
|
|
|
and bx, 0FFh
|
|
|
|
add bx, bx
|
|
|
|
push ax
|
|
|
|
mov ax, [bx+2368h]
|
|
|
|
push dx
|
|
|
|
cwd
|
|
|
|
pop cx
|
|
|
|
pop bx
|
|
|
|
call N_LXMUL@
|
|
|
|
mov cl, 8
|
|
|
|
call near ptr N_LXRSH@
|
|
|
|
mov [si], ax
|
|
|
|
mov ax, [bp+arg_0]
|
|
|
|
cwd
|
|
|
|
mov bl, [bp+arg_2]
|
|
|
|
mov bh, 0
|
|
|
|
and bx, 0FFh
|
|
|
|
add bx, bx
|
|
|
|
push ax
|
|
|
|
mov ax, [bx+22E8h]
|
|
|
|
push dx
|
|
|
|
cwd
|
|
|
|
pop cx
|
|
|
|
pop bx
|
|
|
|
call N_LXMUL@
|
|
|
|
mov cl, 8
|
|
|
|
call near ptr N_LXRSH@
|
|
|
|
mov [di], ax
|
|
|
|
pop di
|
|
|
|
pop si
|
|
|
|
pop bp
|
|
|
|
retn 8
|
|
|
|
sub_3E4 endp ; sp-analysis failed
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
sub_439 proc near
|
2014-08-06 19:16:11 +00:00
|
|
|
push bp
|
|
|
|
mov bp, sp
|
|
|
|
push si
|
|
|
|
mov word ptr ds:2878h, 80h
|
|
|
|
mov word ptr ds:2952h, 0FFF8h
|
|
|
|
mov word ptr ds:287Ah, 140h
|
|
|
|
mov word ptr ds:295Ah, 8
|
|
|
|
mov word ptr ds:287Ch, 100h
|
|
|
|
mov word ptr ds:2954h, 0FFF8h
|
|
|
|
mov word ptr ds:287Eh, 0F0h
|
|
|
|
mov word ptr ds:295Ch, 8
|
|
|
|
mov word ptr ds:2880h, 180h
|
|
|
|
mov word ptr ds:2956h, 0FFF8h
|
|
|
|
mov word ptr ds:2882h, 0A0h
|
|
|
|
mov word ptr ds:295Eh, 8
|
|
|
|
mov word ptr ds:2884h, 200h
|
|
|
|
mov word ptr ds:2958h, 0FFF8h
|
|
|
|
mov word ptr ds:2886h, 50h
|
|
|
|
mov word ptr ds:2960h, 8
|
|
|
|
mov word ptr ds:2950h, 0
|
|
|
|
mov byte ptr ds:2872h, 0
|
|
|
|
mov byte ptr ds:2873h, 0
|
|
|
|
mov byte ptr ds:2874h, 17h
|
|
|
|
mov byte ptr ds:2875h, 0
|
|
|
|
mov byte ptr ds:2876h, 0
|
|
|
|
xor si, si
|
|
|
|
jmp short loc_4F5
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_4C0:
|
2014-08-30 10:13:04 +00:00
|
|
|
call IRand
|
2014-08-06 19:16:11 +00:00
|
|
|
mov bx, 280h
|
|
|
|
cwd
|
|
|
|
idiv bx
|
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
mov [bx+2888h], dx
|
2014-08-30 10:13:04 +00:00
|
|
|
call IRand
|
2014-08-06 19:16:11 +00:00
|
|
|
mov bx, 190h
|
|
|
|
cwd
|
|
|
|
idiv bx
|
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
mov [bx+288Ah], dx
|
2014-08-30 10:13:04 +00:00
|
|
|
call IRand
|
2014-08-06 19:16:11 +00:00
|
|
|
mov bx, 20h
|
|
|
|
cwd
|
|
|
|
idiv bx
|
|
|
|
add dl, 6
|
|
|
|
mov [si+2963h], dl
|
|
|
|
inc si
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_4F5:
|
2014-08-06 19:16:11 +00:00
|
|
|
cmp si, 32h
|
|
|
|
jl short loc_4C0
|
|
|
|
mov byte ptr ds:2962h, 40h
|
|
|
|
pop si
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_500:
|
2014-08-06 19:16:11 +00:00
|
|
|
pop bp
|
|
|
|
retn
|
|
|
|
sub_439 endp
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
sub_502 proc near
|
2014-08-06 19:16:11 +00:00
|
|
|
push bp
|
|
|
|
mov bp, sp
|
|
|
|
push si
|
|
|
|
mov si, 3
|
|
|
|
jmp loc_5A6
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_50C:
|
2014-08-06 19:16:11 +00:00
|
|
|
push 0C0h
|
|
|
|
mov al, [si+21D9h]
|
|
|
|
cbw
|
|
|
|
push ax
|
2014-08-27 04:52:58 +00:00
|
|
|
call grcg_setcolor
|
2014-08-06 19:16:11 +00:00
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
push word ptr [bx+2878h]
|
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
push word ptr [bx+287Ah]
|
|
|
|
push 60h
|
2014-08-28 04:02:11 +00:00
|
|
|
call grcg_circlefill
|
2014-08-06 19:16:11 +00:00
|
|
|
mov bx, si
|
|
|
|
add bx, bx
|
|
|
|
mov ax, [bx+2952h]
|
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
add [bx+2878h], ax
|
|
|
|
mov bx, si
|
|
|
|
add bx, bx
|
|
|
|
mov ax, [bx+295Ah]
|
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
add [bx+287Ah], ax
|
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
cmp word ptr [bx+2878h], 20h
|
|
|
|
jle short loc_56A
|
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
cmp word ptr [bx+2878h], 25Fh
|
|
|
|
jle short loc_57B
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_56A:
|
2014-08-06 19:16:11 +00:00
|
|
|
mov bx, si
|
|
|
|
add bx, bx
|
|
|
|
mov dx, 0FFFFh
|
|
|
|
mov ax, [bx+2952h]
|
|
|
|
imul dx
|
|
|
|
mov [bx+2952h], ax
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_57B:
|
2014-08-06 19:16:11 +00:00
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
cmp word ptr [bx+287Ah], 20h
|
|
|
|
jle short loc_594
|
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
cmp word ptr [bx+287Ah], 16Fh
|
|
|
|
jle short loc_5A5
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_594:
|
2014-08-06 19:16:11 +00:00
|
|
|
mov bx, si
|
|
|
|
add bx, bx
|
|
|
|
mov dx, 0FFFFh
|
|
|
|
mov ax, [bx+295Ah]
|
|
|
|
imul dx
|
|
|
|
mov [bx+295Ah], ax
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_5A5:
|
2014-08-06 19:16:11 +00:00
|
|
|
dec si
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_5A6:
|
2014-08-06 19:16:11 +00:00
|
|
|
or si, si
|
|
|
|
jl short loc_5AD
|
|
|
|
jmp loc_50C
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_5AD:
|
2014-08-06 19:16:11 +00:00
|
|
|
mov dx, 7Ch
|
|
|
|
mov al, 0
|
|
|
|
out dx, al
|
|
|
|
pop si
|
|
|
|
pop bp
|
|
|
|
retn
|
|
|
|
sub_502 endp
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
sub_5B6 proc near
|
2014-08-06 19:16:11 +00:00
|
|
|
|
|
|
|
var_4 = word ptr -4
|
|
|
|
var_2 = word ptr -2
|
|
|
|
|
|
|
|
enter 4, 0
|
|
|
|
push si
|
|
|
|
push 0C0h
|
|
|
|
push 5
|
2014-08-27 04:52:58 +00:00
|
|
|
call grcg_setcolor
|
2014-08-06 19:16:11 +00:00
|
|
|
xor si, si
|
|
|
|
jmp loc_66E
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_5C8:
|
2014-08-06 19:16:11 +00:00
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
push word ptr [bx+2888h]
|
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
push word ptr [bx+288Ah]
|
2014-08-28 03:48:32 +00:00
|
|
|
call grcg_pset
|
2014-08-06 19:16:11 +00:00
|
|
|
lea ax, [bp+var_2]
|
|
|
|
push ax
|
|
|
|
lea ax, [bp+var_4]
|
|
|
|
push ax
|
|
|
|
push word ptr ds:2962h
|
|
|
|
mov al, [si+2963h]
|
|
|
|
mov ah, 0
|
|
|
|
push ax
|
|
|
|
call sub_3E4
|
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
mov ax, [bp+var_2]
|
|
|
|
add [bx+2888h], ax
|
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
mov ax, [bp+var_4]
|
|
|
|
add [bx+288Ah], ax
|
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
cmp word ptr [bx+2888h], 0
|
|
|
|
jge short loc_624
|
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
add word ptr [bx+2888h], 280h
|
|
|
|
jmp short loc_63C
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_624:
|
2014-08-06 19:16:11 +00:00
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
cmp word ptr [bx+2888h], 280h
|
|
|
|
jl short loc_63C
|
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
sub word ptr [bx+2888h], 280h
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_63C:
|
2014-08-06 19:16:11 +00:00
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
cmp word ptr [bx+288Ah], 0
|
|
|
|
jge short loc_655
|
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
add word ptr [bx+288Ah], 190h
|
|
|
|
jmp short loc_66D
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_655:
|
2014-08-06 19:16:11 +00:00
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
cmp word ptr [bx+288Ah], 190h
|
|
|
|
jl short loc_66D
|
|
|
|
mov bx, si
|
|
|
|
shl bx, 2
|
|
|
|
sub word ptr [bx+288Ah], 190h
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_66D:
|
2014-08-06 19:16:11 +00:00
|
|
|
inc si
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_66E:
|
2014-08-06 19:16:11 +00:00
|
|
|
cmp si, 32h
|
|
|
|
jge short loc_676
|
|
|
|
jmp loc_5C8
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_676:
|
2014-08-06 19:16:11 +00:00
|
|
|
inc byte ptr ds:2962h
|
|
|
|
mov dx, 7Ch
|
|
|
|
mov al, 0
|
|
|
|
out dx, al
|
|
|
|
pop si
|
|
|
|
leave
|
|
|
|
retn
|
|
|
|
sub_5B6 endp
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
sub_683 proc near
|
2014-08-06 19:16:11 +00:00
|
|
|
push bp
|
|
|
|
mov bp, sp
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_686:
|
2014-08-06 19:16:11 +00:00
|
|
|
out 5Fh, al
|
|
|
|
in al, 0A0h ; PIC 2 same as 0020 for PIC 1
|
|
|
|
test al, 20h
|
|
|
|
jnz short loc_686
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_68E:
|
2014-08-06 19:16:11 +00:00
|
|
|
out 5Fh, al
|
|
|
|
in al, 0A0h ; PIC 2 same as 0020 for PIC 1
|
|
|
|
test al, 20h
|
|
|
|
jz short loc_68E
|
|
|
|
pop bp
|
|
|
|
retn
|
|
|
|
sub_683 endp
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
sub_698 proc near
|
2014-08-06 19:16:11 +00:00
|
|
|
push bp
|
|
|
|
mov bp, sp
|
|
|
|
cmp word ptr ds:2950h, 32h
|
|
|
|
jge short loc_6A5
|
|
|
|
jmp loc_7CB
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_6A5:
|
2014-08-06 19:16:11 +00:00
|
|
|
cmp word ptr ds:2950h, 5Ah
|
|
|
|
jge short loc_6CD
|
|
|
|
cmp word ptr ds:2950h, 37h
|
|
|
|
jnz short loc_6B6
|
|
|
|
jmp loc_7A6
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_6B6:
|
2014-08-06 19:16:11 +00:00
|
|
|
cmp word ptr ds:2950h, 3Ch
|
|
|
|
jnz short loc_6C0
|
|
|
|
jmp loc_7A6
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_6C0:
|
2014-08-06 19:16:11 +00:00
|
|
|
cmp word ptr ds:2950h, 41h
|
|
|
|
jz short loc_6CA
|
|
|
|
jmp loc_7AE
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_6CA:
|
2014-08-06 19:16:11 +00:00
|
|
|
jmp loc_7A6
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_6CD:
|
2014-08-06 19:16:11 +00:00
|
|
|
cmp word ptr ds:2950h, 6Eh
|
|
|
|
jge short loc_720
|
|
|
|
push 100h
|
|
|
|
push 0C0h
|
|
|
|
mov al, ds:2873h
|
|
|
|
cbw
|
|
|
|
push ax
|
|
|
|
mov al, ds:2874h
|
|
|
|
cbw
|
|
|
|
push ax
|
|
|
|
push word ptr ds:2876h
|
|
|
|
mov al, ds:2875h
|
|
|
|
cbw
|
|
|
|
push ax
|
2014-09-06 23:56:57 +00:00
|
|
|
call super_wave_put
|
2014-08-06 19:16:11 +00:00
|
|
|
push 140h
|
|
|
|
push 0C0h
|
|
|
|
mov al, ds:2873h
|
|
|
|
cbw
|
|
|
|
inc ax
|
|
|
|
push ax
|
|
|
|
mov al, ds:2874h
|
|
|
|
cbw
|
|
|
|
push ax
|
|
|
|
push word ptr ds:2876h
|
|
|
|
mov al, ds:2875h
|
|
|
|
cbw
|
|
|
|
push ax
|
2014-09-06 23:56:57 +00:00
|
|
|
call super_wave_put
|
2014-08-06 19:16:11 +00:00
|
|
|
dec byte ptr ds:2874h
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_711:
|
2014-08-06 19:16:11 +00:00
|
|
|
mov al, ds:2875h
|
|
|
|
add al, 4
|
|
|
|
mov ds:2875h, al
|
|
|
|
mov al, ds:2876h
|
|
|
|
add al, 4
|
|
|
|
jmp short loc_781
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_720:
|
2014-08-06 19:16:11 +00:00
|
|
|
cmp word ptr ds:2950h, 82h
|
|
|
|
jge short loc_786
|
|
|
|
cmp word ptr ds:2950h, 6Eh
|
|
|
|
jnz short loc_737
|
|
|
|
mov al, ds:2873h
|
|
|
|
add al, 2
|
|
|
|
mov ds:2873h, al
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_737:
|
2014-08-06 19:16:11 +00:00
|
|
|
push 100h
|
|
|
|
push 0C0h
|
|
|
|
mov al, ds:2873h
|
|
|
|
cbw
|
|
|
|
push ax
|
|
|
|
mov al, ds:2874h
|
|
|
|
cbw
|
|
|
|
push ax
|
|
|
|
push word ptr ds:2876h
|
|
|
|
mov al, ds:2875h
|
|
|
|
cbw
|
|
|
|
push ax
|
2014-09-06 23:56:57 +00:00
|
|
|
call super_wave_put
|
2014-08-06 19:16:11 +00:00
|
|
|
push 140h
|
|
|
|
push 0C0h
|
|
|
|
mov al, ds:2873h
|
|
|
|
cbw
|
|
|
|
inc ax
|
|
|
|
push ax
|
|
|
|
mov al, ds:2874h
|
|
|
|
cbw
|
|
|
|
push ax
|
|
|
|
push word ptr ds:2876h
|
|
|
|
mov al, ds:2875h
|
|
|
|
cbw
|
|
|
|
push ax
|
2014-09-06 23:56:57 +00:00
|
|
|
call super_wave_put
|
2014-08-06 19:16:11 +00:00
|
|
|
inc byte ptr ds:2874h
|
|
|
|
mov al, ds:2875h
|
|
|
|
add al, 4
|
|
|
|
mov ds:2875h, al
|
|
|
|
mov al, ds:2876h
|
|
|
|
add al, 0FCh
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_781:
|
2014-08-06 19:16:11 +00:00
|
|
|
mov ds:2876h, al
|
|
|
|
pop bp
|
|
|
|
retn
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_786:
|
2014-08-06 19:16:11 +00:00
|
|
|
cmp word ptr ds:2950h, 0AAh
|
|
|
|
jge short loc_7CB
|
|
|
|
cmp word ptr ds:2950h, 9Bh
|
|
|
|
jz short loc_7A6
|
|
|
|
cmp word ptr ds:2950h, 0A0h
|
|
|
|
jz short loc_7A6
|
|
|
|
cmp word ptr ds:2950h, 0A5h
|
|
|
|
jnz short loc_7AE
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_7A6:
|
2014-08-06 19:16:11 +00:00
|
|
|
mov al, ds:2873h
|
|
|
|
add al, 2
|
|
|
|
mov ds:2873h, al
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_7AE:
|
2014-08-06 19:16:11 +00:00
|
|
|
push 100h
|
|
|
|
push 0C0h
|
|
|
|
mov al, ds:2873h
|
|
|
|
cbw
|
|
|
|
push ax
|
2014-08-28 04:31:32 +00:00
|
|
|
call super_put_8
|
2014-08-06 19:16:11 +00:00
|
|
|
push 140h
|
|
|
|
push 0C0h
|
|
|
|
mov al, ds:2873h
|
|
|
|
cbw
|
|
|
|
inc ax
|
|
|
|
push ax
|
2014-08-28 04:31:32 +00:00
|
|
|
call super_put_8
|
2014-08-06 19:16:11 +00:00
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_7CB:
|
2014-08-06 19:16:11 +00:00
|
|
|
pop bp
|
|
|
|
retn
|
|
|
|
sub_698 endp
|
|
|
|
|
|
|
|
|
|
|
|
; =============== S U B R O U T I N E =======================================
|
|
|
|
|
|
|
|
; Attributes: bp-based frame
|
|
|
|
|
|
|
|
; int __cdecl main(int argc, const char **argv, const char **envp)
|
2014-08-10 01:44:54 +00:00
|
|
|
_main proc near
|
2014-08-06 19:16:11 +00:00
|
|
|
|
|
|
|
_argc = word ptr 4
|
|
|
|
_argv = word ptr 6
|
|
|
|
_envp = word ptr 8
|
|
|
|
|
|
|
|
push bp
|
|
|
|
mov bp, sp
|
|
|
|
push si
|
|
|
|
push di
|
|
|
|
xor ax, ax
|
|
|
|
mov es, ax
|
2014-10-31 06:17:05 +00:00
|
|
|
test byte ptr es:[045Ch], 40h
|
2014-08-06 19:16:11 +00:00
|
|
|
jz short loc_7F0
|
|
|
|
mov al, 7
|
|
|
|
out 6Ah, al ; PC-98 GDC (6a):
|
|
|
|
;
|
|
|
|
mov al, 20h
|
|
|
|
out 6Ah, al ; PC-98 GDC (6a):
|
|
|
|
;
|
|
|
|
mov al, 6
|
|
|
|
out 6Ah, al ; PC-98 GDC (6a):
|
|
|
|
;
|
2014-08-21 22:17:53 +00:00
|
|
|
and byte ptr es:[54Dh], 7Fh
|
2014-08-06 19:16:11 +00:00
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_7F0:
|
2014-08-06 19:16:11 +00:00
|
|
|
call sub_384
|
|
|
|
call sub_439
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_7F6:
|
2014-08-06 19:16:11 +00:00
|
|
|
cmp word ptr ds:2950h, 0B4h
|
|
|
|
jle short loc_80C
|
|
|
|
cmp byte ptr ds:2872h, 0
|
|
|
|
jle short loc_873
|
|
|
|
mov al, ds:2872h
|
|
|
|
add al, 0FEh
|
|
|
|
jmp short loc_818
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_80C:
|
2014-08-06 19:16:11 +00:00
|
|
|
cmp byte ptr ds:2872h, 64h
|
|
|
|
jge short loc_822
|
|
|
|
mov al, ds:2872h
|
|
|
|
add al, 2
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_818:
|
2014-08-06 19:16:11 +00:00
|
|
|
mov ds:2872h, al
|
|
|
|
cbw
|
2014-08-23 13:47:05 +00:00
|
|
|
mov PaletteTone, ax
|
2014-08-23 14:11:16 +00:00
|
|
|
call palette_show
|
2014-08-06 19:16:11 +00:00
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_822:
|
2014-08-06 19:16:11 +00:00
|
|
|
push 0C0h
|
|
|
|
push 0
|
2014-08-27 04:52:58 +00:00
|
|
|
call grcg_setcolor
|
2014-08-06 19:16:11 +00:00
|
|
|
push 0Ch
|
|
|
|
push 64h
|
|
|
|
push 43h
|
|
|
|
push 12Bh
|
2014-08-27 21:20:37 +00:00
|
|
|
call grcg_byteboxfill_x
|
2014-08-06 19:16:11 +00:00
|
|
|
call sub_5B6
|
|
|
|
call sub_502
|
|
|
|
call sub_698
|
|
|
|
call sub_683
|
|
|
|
call sub_683
|
|
|
|
mov al, ds:2870h
|
|
|
|
mov ds:2871h, al
|
2014-09-18 15:20:12 +00:00
|
|
|
out 0A4h, al
|
2014-08-06 19:16:11 +00:00
|
|
|
xor byte ptr ds:2870h, 1
|
|
|
|
mov al, ds:2870h
|
2014-09-18 15:20:12 +00:00
|
|
|
out 0A6h, al
|
2014-08-06 19:16:11 +00:00
|
|
|
xor di, di
|
|
|
|
xor si, si
|
|
|
|
jmp short loc_864
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_85D:
|
2014-08-06 19:16:11 +00:00
|
|
|
push si
|
2014-08-30 07:56:49 +00:00
|
|
|
call key_sense
|
2014-08-06 19:16:11 +00:00
|
|
|
or di, ax
|
|
|
|
inc si
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_864:
|
2014-08-06 19:16:11 +00:00
|
|
|
cmp si, 8
|
|
|
|
jl short loc_85D
|
|
|
|
or di, di
|
|
|
|
jnz short loc_873
|
|
|
|
inc word ptr ds:2950h
|
|
|
|
jmp short loc_7F6
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
|
2014-08-10 01:44:54 +00:00
|
|
|
loc_873:
|
2014-08-06 19:16:11 +00:00
|
|
|
call sub_3D0
|
|
|
|
pop di
|
|
|
|
pop si
|
|
|
|
pop bp
|
|
|
|
retn
|
|
|
|
_main endp
|
|
|
|
|
2014-10-20 15:20:04 +00:00
|
|
|
include libs/master.lib/text_clear.asm
|
|
|
|
include libs/master.lib/txesc.asm
|
2014-08-27 22:58:40 +00:00
|
|
|
include libs/master.lib/graph_400line.asm
|
2014-08-27 04:03:08 +00:00
|
|
|
include libs/master.lib/graph_clear.asm
|
2014-08-27 23:05:11 +00:00
|
|
|
include libs/master.lib/graph_hide.asm
|
2014-08-27 03:18:17 +00:00
|
|
|
include libs/master.lib/graph_show.asm
|
2014-08-27 23:16:54 +00:00
|
|
|
include libs/master.lib/graph_start.asm
|
2014-08-23 14:11:16 +00:00
|
|
|
include libs/master.lib/palette_show.asm
|
2014-08-23 14:18:30 +00:00
|
|
|
include libs/master.lib/palette_init.asm
|
2014-08-23 12:01:53 +00:00
|
|
|
include libs/master.lib/keybeep.asm
|
2014-08-30 07:56:49 +00:00
|
|
|
include libs/master.lib/key_sense.asm
|
2014-08-23 10:08:48 +00:00
|
|
|
include libs/master.lib/bfnt_header_read.asm
|
2014-08-23 15:07:30 +00:00
|
|
|
include libs/master.lib/bfnt_entry_pat.asm
|
|
|
|
include libs/master.lib/bfnt_header_analysis.asm
|
2014-08-23 14:56:01 +00:00
|
|
|
include libs/master.lib/bfnt_palette_set.asm
|
2014-08-22 22:46:33 +00:00
|
|
|
include libs/master.lib/dos_close.asm
|
2014-08-21 20:07:58 +00:00
|
|
|
include libs/master.lib/dos_ropen.asm
|
2014-08-23 16:07:02 +00:00
|
|
|
include libs/master.lib/super_entry_bfnt.asm
|
2014-08-22 21:33:18 +00:00
|
|
|
include libs/master.lib/super_cancel_pat.asm
|
2014-08-22 22:17:59 +00:00
|
|
|
include libs/master.lib/super_entry_pat.asm
|
2014-08-28 04:31:32 +00:00
|
|
|
include libs/master.lib/super_put_8.asm
|
2014-08-22 21:45:21 +00:00
|
|
|
include libs/master.lib/super_free.asm
|
2014-08-22 21:56:33 +00:00
|
|
|
include libs/master.lib/super_entry_at.asm
|
2014-09-06 23:56:57 +00:00
|
|
|
include libs/master.lib/super_wave_put.asm
|
2014-08-23 15:07:30 +00:00
|
|
|
include libs/master.lib/smem_wget.asm
|
|
|
|
include libs/master.lib/smem_release.asm
|
2014-08-21 22:17:53 +00:00
|
|
|
include libs/master.lib/memheap.asm
|
2014-08-21 21:05:54 +00:00
|
|
|
include libs/master.lib/mem_assign.asm
|
2014-09-08 18:30:15 +00:00
|
|
|
include libs/master.lib/mem_unassign.asm
|
2014-08-31 06:36:33 +00:00
|
|
|
include libs/master.lib/grc_setclip.asm
|
2014-08-27 22:17:57 +00:00
|
|
|
include libs/master.lib/grcg_hline.asm
|
2014-08-27 04:52:58 +00:00
|
|
|
include libs/master.lib/grcg_setcolor.asm
|
2014-08-28 03:48:32 +00:00
|
|
|
include libs/master.lib/grcg_pset.asm
|
2014-08-20 20:24:05 +00:00
|
|
|
include libs/master.lib/egc.asm
|
2014-08-28 04:02:11 +00:00
|
|
|
include libs/master.lib/grcg_circlefill.asm
|
2014-08-27 21:20:37 +00:00
|
|
|
include libs/master.lib/grcg_byteboxfill_x.asm
|
2014-08-30 10:13:04 +00:00
|
|
|
include libs/master.lib/random.asm
|
2014-10-12 16:36:15 +00:00
|
|
|
include libs/BorlandC/_abort.asm
|
2014-08-19 22:36:43 +00:00
|
|
|
include libs/BorlandC/atexit.asm
|
2014-08-20 18:38:08 +00:00
|
|
|
include libs/BorlandC/errormsg.asm
|
2014-08-20 15:53:02 +00:00
|
|
|
include libs/BorlandC/exit.asm
|
2014-08-14 17:49:23 +00:00
|
|
|
include libs/BorlandC/H_LRSH.ASM
|
2014-10-20 15:20:04 +00:00
|
|
|
include libs/BorlandC/ioerror.asm
|
2014-08-14 14:50:20 +00:00
|
|
|
include libs/BorlandC/_isatty.asm
|
2014-08-21 23:55:05 +00:00
|
|
|
include libs/BorlandC/lseek.asm
|
2014-08-14 17:35:29 +00:00
|
|
|
include libs/BorlandC/N_LXMUL.ASM
|
2014-08-18 17:50:20 +00:00
|
|
|
include libs/BorlandC/setupio.asm
|
2014-08-19 17:54:53 +00:00
|
|
|
include libs/BorlandC/brk.asm
|
2014-08-19 17:14:52 +00:00
|
|
|
include libs/BorlandC/nearheap.asm
|
2014-08-20 17:46:47 +00:00
|
|
|
include libs/BorlandC/fflush.asm
|
2014-09-02 19:26:48 +00:00
|
|
|
include libs/BorlandC/flushall.asm
|
2014-09-02 18:41:48 +00:00
|
|
|
include libs/BorlandC/fseek.asm
|
2014-09-03 12:02:14 +00:00
|
|
|
include libs/BorlandC/setvbuf.asm
|
2014-08-10 03:57:11 +00:00
|
|
|
include libs/BorlandC/_strlen.asm
|
2014-08-22 17:28:05 +00:00
|
|
|
include libs/BorlandC/write.asm
|
2014-08-22 00:40:56 +00:00
|
|
|
include libs/BorlandC/writea.asm
|
2014-08-28 19:54:04 +00:00
|
|
|
include libs/BorlandC/xfflush.asm
|
2014-08-06 19:16:11 +00:00
|
|
|
|
|
|
|
; ---------------------------------------------------------------------------
|
|
|
|
db 0
|
|
|
|
db 0
|
|
|
|
db 0
|
2014-08-19 20:33:43 +00:00
|
|
|
include libs/BorlandC/c0[data].asm
|
2014-08-06 19:16:11 +00:00
|
|
|
aTouhou_dat db 'touhou.dat',0
|
|
|
|
db 4, 3, 2, 1, 0
|
2014-09-16 02:11:09 +00:00
|
|
|
include libs/master.lib/version[data].asm
|
2014-08-27 03:42:48 +00:00
|
|
|
include libs/master.lib/grp[data].asm
|
2014-08-23 13:47:05 +00:00
|
|
|
include libs/master.lib/pal[data].asm
|
2014-08-23 10:08:48 +00:00
|
|
|
include libs/master.lib/bfnt_id[data].asm
|
2014-08-21 20:07:58 +00:00
|
|
|
include libs/master.lib/dos_ropen[data].asm
|
2014-08-23 16:07:02 +00:00
|
|
|
include libs/master.lib/super_entry_bfnt[data].asm
|
2014-08-22 20:31:44 +00:00
|
|
|
include libs/master.lib/superpa[data].asm
|
2014-08-21 20:53:12 +00:00
|
|
|
include libs/master.lib/mem[data].asm
|
2014-08-27 20:57:18 +00:00
|
|
|
include libs/master.lib/clip[data].asm
|
2014-08-27 22:05:06 +00:00
|
|
|
include libs/master.lib/edges[data].asm
|
2014-08-28 05:54:38 +00:00
|
|
|
include libs/master.lib/sin8[data].asm
|
2014-08-28 05:16:43 +00:00
|
|
|
include libs/master.lib/sin7[data].asm
|
2014-08-30 10:13:04 +00:00
|
|
|
include libs/master.lib/rand[data].asm
|
2014-10-12 16:36:15 +00:00
|
|
|
include libs/BorlandC/_abort[data].asm
|
2014-08-19 22:36:43 +00:00
|
|
|
include libs/BorlandC/atexit[data].asm
|
2014-08-20 15:53:02 +00:00
|
|
|
include libs/BorlandC/exit[data].asm
|
2014-08-18 14:57:30 +00:00
|
|
|
include libs/BorlandC/files[data].asm
|
2014-08-19 20:33:43 +00:00
|
|
|
__heaplen dw 0
|
2014-10-20 15:20:04 +00:00
|
|
|
include libs/BorlandC/ioerror[data].asm
|
2014-10-19 21:21:01 +00:00
|
|
|
include libs/BorlandC/stklen[data].asm
|
2014-08-19 17:14:52 +00:00
|
|
|
include libs/BorlandC/nearheap[data].asm
|
2014-09-03 12:02:14 +00:00
|
|
|
include libs/BorlandC/setvbuf[data].asm
|
2014-08-14 13:49:41 +00:00
|
|
|
include libs/BorlandC/sysnerr[data].asm
|
2014-08-17 21:55:59 +00:00
|
|
|
|
|
|
|
InitStart label byte
|
2014-08-18 17:50:20 +00:00
|
|
|
include libs/BorlandC/setupio[initdata].asm
|
2014-08-17 21:55:59 +00:00
|
|
|
InitEnd label byte
|
|
|
|
|
|
|
|
ExitStart label byte
|
|
|
|
ExitEnd label byte
|
|
|
|
|
|
|
|
bdata@ label byte
|
2014-08-27 20:57:18 +00:00
|
|
|
; TODO: Missing clip[bss].asm (8 bytes) somewhere in there...
|
2014-08-23 13:47:05 +00:00
|
|
|
db 126h dup(?)
|
|
|
|
include libs/master.lib/pal[bss].asm
|
2014-08-22 20:31:44 +00:00
|
|
|
include libs/master.lib/superpa[bss].asm
|
2014-09-06 23:56:57 +00:00
|
|
|
include libs/master.lib/super_wave_put[bss].asm
|
2014-08-21 20:53:12 +00:00
|
|
|
include libs/master.lib/mem[bss].asm
|
|
|
|
dd ?
|
|
|
|
dd ?
|
|
|
|
dd ?
|
|
|
|
dd ?
|
2014-08-19 22:36:43 +00:00
|
|
|
include libs/BorlandC/atexit[bss].asm
|
2014-08-17 21:55:59 +00:00
|
|
|
edata@ label byte
|
|
|
|
|
2014-10-31 06:17:05 +00:00
|
|
|
_TEXT ends
|
2014-08-06 19:16:11 +00:00
|
|
|
|
|
|
|
|
2014-08-21 20:05:17 +00:00
|
|
|
end startx
|