diff --git a/libs/master.lib/pfgetc.asm b/libs/master.lib/pfgetc.asm new file mode 100644 index 00000000..bfcacf98 --- /dev/null +++ b/libs/master.lib/pfgetc.asm @@ -0,0 +1,148 @@ +; master library - (pf.lib) +; +; Description: +; 1バイト読み込み関数 +; +; Functions/Procedures: +; int pfgetc(pf_t pf) +; +; Parameters: +; +; +; Returns: +; +; +; Subroutines: +; 以下は内部関数 +; ※引き数は、ESレジスタに入れること +; int pfgetc1(pf_t pf) 圧縮タイプ1用のpfgetc() +; int pfgetx0(pf_t pf) 暗号なしのときの内部1byte読み出し関数 +; int pfgetx1(pf_t pf) 暗号を復号化するときの内部1byte読み出し関数 +; +; Binding Target: +; Microsoft-C / Turbo-C / Turbo Pascal +; +; Running Target: +; MS-DOS +; +; Requiring Resources: +; CPU: 186 +; +; Notes: +; +; +; Assembly Language Note: +; +; +; Compiler/Assembler: +; TASM 3.0 +; OPTASM 1.6 +; +; Author: +; iR +; 恋塚昭彦 +; +; Revision History: +; PFGETC.ASM 1,751 94-09-17 23:31 +; 95/ 1/10 Initial: pfgetc.asm/master.lib 0.23 +; 95/ 1/19 MODIFY: 内部1バイト読み込みルーチンをレジスタ渡しに変更 + +func PFGETC ; pfgetc() { + push BP + mov BP,SP + + ;arg pf:word + pf = (RETSIZE+1)*2 + + mov ES,[BP+pf] ; PFILE構造体のセグメント + call word ptr ES:[pf_getc] + + pop BP + ret (1)*2 +endfunc ; } + + +; 圧縮タイプ1用の pfgetc() + ; 圧縮方式: 同じデータが2バイト並んだら、続くバイトが長さ。 + ; 256バイト以上ならば、さらに同じバイト+長さで連続できる。 + public PFGETC1 +PFGETC1 proc near ; pfgetc1() { + cmp ES:[pf_cnt],0 + jz short @@PFGETC1_getx + dec ES:[pf_cnt] + add word ptr ES:[pf_loc],1 + adc word ptr ES:[pf_loc + 2],0 + mov AX,ES:[pf_ch] + ret + +@@PFGETC1_getx: + call word ptr ES:[pf_getx] ; 新しいバイトが + test AH,AH + jnz short @@PFGETC1_return + + cmp AX,ES:[pf_ch] ; 直前のバイトと同じ値なら + mov ES:[pf_ch],AX + jne short @@PFGETC1_return + + push AX + call word ptr ES:[pf_getx] ; くり返しだ。続くバイトが + test AH,AH + jnz short @@PFGETC1_return1 + mov ES:[pf_cnt],AX ; 長さね。 + sub word ptr ES:[pf_loc],1 + sbb word ptr ES:[pf_loc + 2],0 +@@PFGETC1_return1: + pop AX + +@@PFGETC1_return: + ret +PFGETC1 endp ; } + + +; 暗号なしのときの内部1byte読み出し関数 + public PFGETX0 +PFGETX0 proc near ; pfgetx0() { + mov AX,word ptr ES:[pf_read] + mov DX,word ptr ES:[pf_read + 2] + cmp DX,word ptr ES:[pf_size + 2] + jb short @@PFGETX0_getc + ja short @@PFGETX0_eof + cmp AX,word ptr ES:[pf_size] + jb short @@PFGETX0_getc +@@PFGETX0_eof: + mov AX,EOF + ret + +@@PFGETX0_getc: + add AX,1 + adc DX,0 + mov word ptr ES:[pf_read],AX + mov word ptr ES:[pf_read + 2],DX + + add word ptr ES:[pf_loc],1 + adc word ptr ES:[pf_loc + 2],0 + + push ES + push ES:[pf_bf] + _call BGETC + pop ES + + ret +PFGETX0 endp ; } + + +; 暗号を復号化するときの内部1byte読み出し関数 + public PFGETX1 +PFGETX1 proc near ; pfgetx1() { + call PFGETX0 + or AH,AH ; == EOF? + jnz short @@PFGETX1_return + + ; 復号化 + xor AL,ES:[pf_key] + ; Not used in Touhou +; ror AL,4 + +@@PFGETX1_return: + ret +PFGETX1 endp ; } diff --git a/th02_main.asm b/th02_main.asm index b993e8b4..6602064c 100644 --- a/th02_main.asm +++ b/th02_main.asm @@ -88,88 +88,8 @@ include libs/master.lib/iatan2.asm include libs/master.lib/key_sense.asm include libs/master.lib/palette_show.asm include libs/master.lib/pfclose.asm - -; --------------------------------------------------------------------------- - push bp - mov bp, sp - mov es, word ptr [bp+6] - call word ptr es:2 - pop bp - retf 2 -; --------------------------------------------------------------------------- - nop - cmp word ptr es:1Ah, 0 - jz short loc_2048 - dec word ptr es:1Ah - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - mov ax, es:1Ch - retn -; --------------------------------------------------------------------------- - -loc_2048: - call word ptr es:4 - test ah, ah - jnz short locret_2077 - cmp ax, es:1Ch - mov es:1Ch, ax - jnz short locret_2077 - push ax - call word ptr es:4 - test ah, ah - jnz short loc_2076 - mov es:1Ah, ax - sub word ptr es:12h, 1 - sbb word ptr es:14h, 0 - -loc_2076: - pop ax - -locret_2077: - retn - -; =============== S U B R O U T I N E ======================================= - - -sub_2078 proc near - mov ax, es:0Ah - mov dx, es:0Ch - cmp dx, es:8 - jb short loc_2095 - ja short loc_2091 - cmp ax, es:6 - jb short loc_2095 - -loc_2091: - mov ax, 0FFFFh - retn -; --------------------------------------------------------------------------- - -loc_2095: - add ax, 1 - adc dx, 0 - mov es:0Ah, ax - mov es:0Ch, dx - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - push es - push word ptr es:0 - call bgetc - pop es - retn -sub_2078 endp - -; --------------------------------------------------------------------------- - call sub_2078 - or ah, ah - jnz short locret_20C8 - xor al, es:1Eh - -locret_20C8: - retn -; --------------------------------------------------------------------------- +include libs/master.lib/pfgetc.asm db 0 - include libs/master.lib/pfread.asm include libs/master.lib/pfrewind.asm include libs/master.lib/pfseek.asm diff --git a/th02_maine.asm b/th02_maine.asm index 6d1649fe..a0bbbd8b 100644 --- a/th02_maine.asm +++ b/th02_maine.asm @@ -390,88 +390,8 @@ sub_1BDC endp include libs/master.lib/palette_show.asm include libs/master.lib/pfclose.asm - -; --------------------------------------------------------------------------- - push bp - mov bp, sp - mov es, word ptr [bp+6] - call word ptr es:2 - pop bp - retf 2 -; --------------------------------------------------------------------------- - nop - cmp word ptr es:1Ah, 0 - jz short loc_1D7E - dec word ptr es:1Ah - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - mov ax, es:1Ch - retn -; --------------------------------------------------------------------------- - -loc_1D7E: - call word ptr es:4 - test ah, ah - jnz short locret_1DAD - cmp ax, es:1Ch - mov es:1Ch, ax - jnz short locret_1DAD - push ax - call word ptr es:4 - test ah, ah - jnz short loc_1DAC - mov es:1Ah, ax - sub word ptr es:12h, 1 - sbb word ptr es:14h, 0 - -loc_1DAC: - pop ax - -locret_1DAD: - retn - -; =============== S U B R O U T I N E ======================================= - - -sub_1DAE proc near - mov ax, es:0Ah - mov dx, es:0Ch - cmp dx, es:8 - jb short loc_1DCB - ja short loc_1DC7 - cmp ax, es:6 - jb short loc_1DCB - -loc_1DC7: - mov ax, 0FFFFh - retn -; --------------------------------------------------------------------------- - -loc_1DCB: - add ax, 1 - adc dx, 0 - mov es:0Ah, ax - mov es:0Ch, dx - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - push es - push word ptr es:0 - call bgetc - pop es - retn -sub_1DAE endp - -; --------------------------------------------------------------------------- - call sub_1DAE - or ah, ah - jnz short locret_1DFE - xor al, es:1Eh - -locret_1DFE: - retn -; --------------------------------------------------------------------------- +include libs/master.lib/pfgetc.asm db 0 - include libs/master.lib/pfread.asm include libs/master.lib/pfrewind.asm include libs/master.lib/pfseek.asm diff --git a/th02_op.asm b/th02_op.asm index 649c249a..a6dcf9fd 100644 --- a/th02_op.asm +++ b/th02_op.asm @@ -278,88 +278,8 @@ include libs/master.lib/make_linework.asm include libs/master.lib/palette_init.asm include libs/master.lib/palette_show.asm include libs/master.lib/pfclose.asm - -; --------------------------------------------------------------------------- - push bp - mov bp, sp - mov es, word ptr [bp+6] - call word ptr es:2 - pop bp - retf 2 -; --------------------------------------------------------------------------- - nop - cmp word ptr es:1Ah, 0 - jz short loc_1E5C - dec word ptr es:1Ah - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - mov ax, es:1Ch - retn -; --------------------------------------------------------------------------- - -loc_1E5C: - call word ptr es:4 - test ah, ah - jnz short locret_1E8B - cmp ax, es:1Ch - mov es:1Ch, ax - jnz short locret_1E8B - push ax - call word ptr es:4 - test ah, ah - jnz short loc_1E8A - mov es:1Ah, ax - sub word ptr es:12h, 1 - sbb word ptr es:14h, 0 - -loc_1E8A: - pop ax - -locret_1E8B: - retn - -; =============== S U B R O U T I N E ======================================= - - -sub_1E8C proc near - mov ax, es:0Ah - mov dx, es:0Ch - cmp dx, es:8 - jb short loc_1EA9 - ja short loc_1EA5 - cmp ax, es:6 - jb short loc_1EA9 - -loc_1EA5: - mov ax, 0FFFFh - retn -; --------------------------------------------------------------------------- - -loc_1EA9: - add ax, 1 - adc dx, 0 - mov es:0Ah, ax - mov es:0Ch, dx - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - push es - push word ptr es:0 - call bgetc - pop es - retn -sub_1E8C endp - -; --------------------------------------------------------------------------- - call sub_1E8C - or ah, ah - jnz short locret_1EDC - xor al, es:1Eh - -locret_1EDC: - retn -; --------------------------------------------------------------------------- +include libs/master.lib/pfgetc.asm db 0 -; --------------------------------------------------------------------------- include libs/master.lib/pfread.asm include libs/master.lib/pfrewind.asm include libs/master.lib/pfseek.asm diff --git a/th03_main.asm b/th03_main.asm index 9b15e9ba..568abd2a 100644 --- a/th03_main.asm +++ b/th03_main.asm @@ -80,88 +80,8 @@ include libs/master.lib/js_end.asm include libs/master.lib/make_linework.asm include libs/master.lib/palette_show.asm include libs/master.lib/pfclose.asm - -; --------------------------------------------------------------------------- - push bp - mov bp, sp - mov es, word ptr [bp+6] - call word ptr es:2 - pop bp - retf 2 -; --------------------------------------------------------------------------- - nop - cmp word ptr es:1Ah, 0 - jz short loc_1DD0 - dec word ptr es:1Ah - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - mov ax, es:1Ch - retn -; --------------------------------------------------------------------------- - -loc_1DD0: - call word ptr es:4 - test ah, ah - jnz short locret_1DFF - cmp ax, es:1Ch - mov es:1Ch, ax - jnz short locret_1DFF - push ax - call word ptr es:4 - test ah, ah - jnz short loc_1DFE - mov es:1Ah, ax - sub word ptr es:12h, 1 - sbb word ptr es:14h, 0 - -loc_1DFE: - pop ax - -locret_1DFF: - retn - -; =============== S U B R O U T I N E ======================================= - - -sub_1E00 proc near - mov ax, es:0Ah - mov dx, es:0Ch - cmp dx, es:8 - jb short loc_1E1D - ja short loc_1E19 - cmp ax, es:6 - jb short loc_1E1D - -loc_1E19: - mov ax, 0FFFFh - retn -; --------------------------------------------------------------------------- - -loc_1E1D: - add ax, 1 - adc dx, 0 - mov es:0Ah, ax - mov es:0Ch, dx - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - push es - push word ptr es:0 - call bgetc - pop es - retn -sub_1E00 endp - -; --------------------------------------------------------------------------- - call sub_1E00 - or ah, ah - jnz short locret_1E50 - xor al, es:1Eh - -locret_1E50: - retn -; --------------------------------------------------------------------------- +include libs/master.lib/pfgetc.asm db 0 -; --------------------------------------------------------------------------- include libs/master.lib/pfread.asm include libs/master.lib/pfrewind.asm include libs/master.lib/pfseek.asm diff --git a/th03_mainl.asm b/th03_mainl.asm index 9406da61..5953a028 100644 --- a/th03_mainl.asm +++ b/th03_mainl.asm @@ -169,88 +169,8 @@ include libs/master.lib/iatan2.asm include libs/master.lib/js_end.asm include libs/master.lib/palette_show.asm include libs/master.lib/pfclose.asm - -; --------------------------------------------------------------------------- - push bp - mov bp, sp - mov es, word ptr [bp+6] - call word ptr es:2 - pop bp - retf 2 -; --------------------------------------------------------------------------- - nop - cmp word ptr es:1Ah, 0 - jz short loc_1922 - dec word ptr es:1Ah - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - mov ax, es:1Ch - retn -; --------------------------------------------------------------------------- - -loc_1922: - call word ptr es:4 - test ah, ah - jnz short locret_1951 - cmp ax, es:1Ch - mov es:1Ch, ax - jnz short locret_1951 - push ax - call word ptr es:4 - test ah, ah - jnz short loc_1950 - mov es:1Ah, ax - sub word ptr es:12h, 1 - sbb word ptr es:14h, 0 - -loc_1950: - pop ax - -locret_1951: - retn - -; =============== S U B R O U T I N E ======================================= - - -sub_1952 proc near - mov ax, es:0Ah - mov dx, es:0Ch - cmp dx, es:8 - jb short loc_196F - ja short loc_196B - cmp ax, es:6 - jb short loc_196F - -loc_196B: - mov ax, 0FFFFh - retn -; --------------------------------------------------------------------------- - -loc_196F: - add ax, 1 - adc dx, 0 - mov es:0Ah, ax - mov es:0Ch, dx - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - push es - push word ptr es:0 - call bgetc - pop es - retn -sub_1952 endp - -; --------------------------------------------------------------------------- - call sub_1952 - or ah, ah - jnz short locret_19A2 - xor al, es:1Eh - -locret_19A2: - retn -; --------------------------------------------------------------------------- +include libs/master.lib/pfgetc.asm db 0 -; --------------------------------------------------------------------------- include libs/master.lib/pfread.asm include libs/master.lib/pfrewind.asm include libs/master.lib/pfseek.asm diff --git a/th03_op.asm b/th03_op.asm index 56f354d5..f9a0ea7b 100644 --- a/th03_op.asm +++ b/th03_op.asm @@ -189,94 +189,8 @@ include libs/master.lib/make_linework.asm include libs/master.lib/palette_init.asm include libs/master.lib/palette_show.asm include libs/master.lib/pfclose.asm - -; --------------------------------------------------------------------------- - push bp - mov bp, sp - mov es, word ptr [bp+6] - call word ptr es:2 - pop bp - retf 2 -; --------------------------------------------------------------------------- - nop - cmp word ptr es:1Ah, 0 - jz short loc_1BF6 - dec word ptr es:1Ah - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - mov ax, es:1Ch - retn -; --------------------------------------------------------------------------- - -loc_1BF6: - call word ptr es:4 - test ah, ah - jnz short locret_1C25 - cmp ax, es:1Ch - mov es:1Ch, ax - jnz short locret_1C25 - push ax - call word ptr es:4 - test ah, ah - jnz short loc_1C24 - mov es:1Ah, ax - sub word ptr es:12h, 1 - sbb word ptr es:14h, 0 - -loc_1C24: - pop ax - -locret_1C25: - retn - -; =============== S U B R O U T I N E ======================================= - - -sub_1C26 proc near - mov ax, es:0Ah - mov dx, es:0Ch - cmp dx, es:8 - jb short loc_1C43 - ja short loc_1C3F - cmp ax, es:6 - jb short loc_1C43 - -loc_1C3F: - mov ax, 0FFFFh - retn -; --------------------------------------------------------------------------- - -loc_1C43: - add ax, 1 - adc dx, 0 - mov es:0Ah, ax - mov es:0Ch, dx - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - push es - push word ptr es:0 - call bgetc - pop es - retn -sub_1C26 endp - - -; =============== S U B R O U T I N E ======================================= - - -sub_1C6A proc near - call sub_1C26 - or ah, ah - jnz short locret_1C76 - xor al, es:1Eh - -locret_1C76: - retn -sub_1C6A endp - -; --------------------------------------------------------------------------- +include libs/master.lib/pfgetc.asm db 0 - include libs/master.lib/pfread.asm include libs/master.lib/pfrewind.asm include libs/master.lib/pfseek.asm @@ -786,7 +700,7 @@ loc_2F4D: or dl, dl jz short loc_2F82 mov es:1Eh, dl - mov ax, offset sub_1C6A + mov ax, offset pfgetx1 loc_2F82: mov es:4, ax diff --git a/th04_main.asm b/th04_main.asm index ce32dd85..e2eb939d 100644 --- a/th04_main.asm +++ b/th04_main.asm @@ -98,88 +98,8 @@ include libs/master.lib/large_byte.asm include libs/master.lib/super_large_put.asm include libs/master.lib/palette_show.asm include libs/master.lib/pfclose.asm - -; --------------------------------------------------------------------------- - push bp - mov bp, sp - mov es, word ptr [bp+6] - call word ptr es:2 - pop bp - retf 2 -; --------------------------------------------------------------------------- - nop - cmp word ptr es:1Ah, 0 - jz short loc_2056 - dec word ptr es:1Ah - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - mov ax, es:1Ch - retn -; --------------------------------------------------------------------------- - -loc_2056: - call word ptr es:4 - test ah, ah - jnz short locret_2085 - cmp ax, es:1Ch - mov es:1Ch, ax - jnz short locret_2085 - push ax - call word ptr es:4 - test ah, ah - jnz short loc_2084 - mov es:1Ah, ax - sub word ptr es:12h, 1 - sbb word ptr es:14h, 0 - -loc_2084: - pop ax - -locret_2085: - retn - -; =============== S U B R O U T I N E ======================================= - - -sub_2086 proc near - mov ax, es:0Ah - mov dx, es:0Ch - cmp dx, es:8 - jb short loc_20A3 - ja short loc_209F - cmp ax, es:6 - jb short loc_20A3 - -loc_209F: - mov ax, 0FFFFh - retn -; --------------------------------------------------------------------------- - -loc_20A3: - add ax, 1 - adc dx, 0 - mov es:0Ah, ax - mov es:0Ch, dx - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - push es - push word ptr es:0 - call bgetc - pop es - retn -sub_2086 endp - -; --------------------------------------------------------------------------- - call sub_2086 - or ah, ah - jnz short locret_20D6 - xor al, es:1Eh - -locret_20D6: - retn -; --------------------------------------------------------------------------- +include libs/master.lib/pfgetc.asm db 0 - include libs/master.lib/pfread.asm include libs/master.lib/pfrewind.asm include libs/master.lib/pfseek.asm diff --git a/th04_maine.asm b/th04_maine.asm index 5c9828c0..eb262221 100644 --- a/th04_maine.asm +++ b/th04_maine.asm @@ -87,88 +87,8 @@ include libs/master.lib/graph_show.asm include libs/master.lib/js_end.asm include libs/master.lib/palette_show.asm include libs/master.lib/pfclose.asm - -; --------------------------------------------------------------------------- - push bp - mov bp, sp - mov es, word ptr [bp+6] - call word ptr es:2 - pop bp - retf 2 -; --------------------------------------------------------------------------- - nop - cmp word ptr es:1Ah, 0 - jz short loc_1B3E - dec word ptr es:1Ah - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - mov ax, es:1Ch - retn -; --------------------------------------------------------------------------- - -loc_1B3E: - call word ptr es:4 - test ah, ah - jnz short locret_1B6D - cmp ax, es:1Ch - mov es:1Ch, ax - jnz short locret_1B6D - push ax - call word ptr es:4 - test ah, ah - jnz short loc_1B6C - mov es:1Ah, ax - sub word ptr es:12h, 1 - sbb word ptr es:14h, 0 - -loc_1B6C: - pop ax - -locret_1B6D: - retn - -; =============== S U B R O U T I N E ======================================= - - -sub_1B6E proc near - mov ax, es:0Ah - mov dx, es:0Ch - cmp dx, es:8 - jb short loc_1B8B - ja short loc_1B87 - cmp ax, es:6 - jb short loc_1B8B - -loc_1B87: - mov ax, 0FFFFh - retn -; --------------------------------------------------------------------------- - -loc_1B8B: - add ax, 1 - adc dx, 0 - mov es:0Ah, ax - mov es:0Ch, dx - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - push es - push word ptr es:0 - call bgetc - pop es - retn -sub_1B6E endp - -; --------------------------------------------------------------------------- - call sub_1B6E - or ah, ah - jnz short locret_1BBE - xor al, es:1Eh - -locret_1BBE: - retn -; --------------------------------------------------------------------------- +include libs/master.lib/pfgetc.asm db 0 -; --------------------------------------------------------------------------- include libs/master.lib/pfread.asm include libs/master.lib/pfrewind.asm include libs/master.lib/pfseek.asm diff --git a/th04_op.asm b/th04_op.asm index 22e0a71a..e769e488 100644 --- a/th04_op.asm +++ b/th04_op.asm @@ -89,88 +89,8 @@ include libs/master.lib/make_linework.asm include libs/master.lib/palette_init.asm include libs/master.lib/palette_show.asm include libs/master.lib/pfclose.asm - -; --------------------------------------------------------------------------- - push bp - mov bp, sp - mov es, word ptr [bp+6] - call word ptr es:2 - pop bp - retf 2 -; --------------------------------------------------------------------------- - nop - cmp word ptr es:1Ah, 0 - jz short loc_1F32 - dec word ptr es:1Ah - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - mov ax, es:1Ch - retn -; --------------------------------------------------------------------------- - -loc_1F32: - call word ptr es:4 - test ah, ah - jnz short locret_1F61 - cmp ax, es:1Ch - mov es:1Ch, ax - jnz short locret_1F61 - push ax - call word ptr es:4 - test ah, ah - jnz short loc_1F60 - mov es:1Ah, ax - sub word ptr es:12h, 1 - sbb word ptr es:14h, 0 - -loc_1F60: - pop ax - -locret_1F61: - retn - -; =============== S U B R O U T I N E ======================================= - - -sub_1F62 proc near - mov ax, es:0Ah - mov dx, es:0Ch - cmp dx, es:8 - jb short loc_1F7F - ja short loc_1F7B - cmp ax, es:6 - jb short loc_1F7F - -loc_1F7B: - mov ax, 0FFFFh - retn -; --------------------------------------------------------------------------- - -loc_1F7F: - add ax, 1 - adc dx, 0 - mov es:0Ah, ax - mov es:0Ch, dx - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - push es - push word ptr es:0 - call bgetc - pop es - retn -sub_1F62 endp - -; --------------------------------------------------------------------------- - call sub_1F62 - or ah, ah - jnz short locret_1FB2 - xor al, es:1Eh - -locret_1FB2: - retn -; --------------------------------------------------------------------------- +include libs/master.lib/pfgetc.asm db 0 -; --------------------------------------------------------------------------- include libs/master.lib/pfread.asm include libs/master.lib/pfrewind.asm include libs/master.lib/pfseek.asm diff --git a/th05_main.asm b/th05_main.asm index c7edb613..1a97909f 100644 --- a/th05_main.asm +++ b/th05_main.asm @@ -91,88 +91,8 @@ include libs/master.lib/super_large_put.asm include libs/master.lib/make_linework.asm include libs/master.lib/palette_show.asm include libs/master.lib/pfclose.asm - -; --------------------------------------------------------------------------- - push bp - mov bp, sp - mov es, word ptr [bp+6] - call word ptr es:2 - pop bp - retf 2 -; --------------------------------------------------------------------------- - nop - cmp word ptr es:1Ah, 0 - jz short loc_22AA - dec word ptr es:1Ah - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - mov ax, es:1Ch - retn -; --------------------------------------------------------------------------- - -loc_22AA: - call word ptr es:4 - test ah, ah - jnz short locret_22D9 - cmp ax, es:1Ch - mov es:1Ch, ax - jnz short locret_22D9 - push ax - call word ptr es:4 - test ah, ah - jnz short loc_22D8 - mov es:1Ah, ax - sub word ptr es:12h, 1 - sbb word ptr es:14h, 0 - -loc_22D8: - pop ax - -locret_22D9: - retn - -; =============== S U B R O U T I N E ======================================= - - -sub_22DA proc near - mov ax, es:0Ah - mov dx, es:0Ch - cmp dx, es:8 - jb short loc_22F7 - ja short loc_22F3 - cmp ax, es:6 - jb short loc_22F7 - -loc_22F3: - mov ax, 0FFFFh - retn -; --------------------------------------------------------------------------- - -loc_22F7: - add ax, 1 - adc dx, 0 - mov es:0Ah, ax - mov es:0Ch, dx - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - push es - push word ptr es:0 - call bgetc - pop es - retn -sub_22DA endp - -; --------------------------------------------------------------------------- - call sub_22DA - or ah, ah - jnz short locret_232A - xor al, es:1Eh - -locret_232A: - retn -; --------------------------------------------------------------------------- +include libs/master.lib/pfgetc.asm db 0 - include libs/master.lib/pfread.asm include libs/master.lib/pfrewind.asm include libs/master.lib/pfseek.asm diff --git a/th05_maine.asm b/th05_maine.asm index 0ab4323d..633bd2a3 100644 --- a/th05_maine.asm +++ b/th05_maine.asm @@ -89,88 +89,8 @@ include libs/master.lib/isqrt.asm include libs/master.lib/js_end.asm include libs/master.lib/palette_show.asm include libs/master.lib/pfclose.asm - -; --------------------------------------------------------------------------- - push bp - mov bp, sp - mov es, word ptr [bp+6] - call word ptr es:2 - pop bp - retf 2 -; --------------------------------------------------------------------------- - nop - cmp word ptr es:1Ah, 0 - jz short loc_1CDC - dec word ptr es:1Ah - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - mov ax, es:1Ch - retn -; --------------------------------------------------------------------------- - -loc_1CDC: - call word ptr es:4 - test ah, ah - jnz short locret_1D0B - cmp ax, es:1Ch - mov es:1Ch, ax - jnz short locret_1D0B - push ax - call word ptr es:4 - test ah, ah - jnz short loc_1D0A - mov es:1Ah, ax - sub word ptr es:12h, 1 - sbb word ptr es:14h, 0 - -loc_1D0A: - pop ax - -locret_1D0B: - retn - -; =============== S U B R O U T I N E ======================================= - - -sub_1D0C proc near - mov ax, es:0Ah - mov dx, es:0Ch - cmp dx, es:8 - jb short loc_1D29 - ja short loc_1D25 - cmp ax, es:6 - jb short loc_1D29 - -loc_1D25: - mov ax, 0FFFFh - retn -; --------------------------------------------------------------------------- - -loc_1D29: - add ax, 1 - adc dx, 0 - mov es:0Ah, ax - mov es:0Ch, dx - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - push es - push word ptr es:0 - call bgetc - pop es - retn -sub_1D0C endp - -; --------------------------------------------------------------------------- - call sub_1D0C - or ah, ah - jnz short locret_1D5C - xor al, es:1Eh - -locret_1D5C: - retn -; --------------------------------------------------------------------------- +include libs/master.lib/pfgetc.asm db 0 - include libs/master.lib/pfread.asm include libs/master.lib/pfrewind.asm include libs/master.lib/pfseek.asm diff --git a/th05_op.asm b/th05_op.asm index fd122132..3c94b632 100644 --- a/th05_op.asm +++ b/th05_op.asm @@ -82,88 +82,8 @@ include libs/master.lib/make_linework.asm include libs/master.lib/palette_init.asm include libs/master.lib/palette_show.asm include libs/master.lib/pfclose.asm - -; --------------------------------------------------------------------------- - push bp - mov bp, sp - mov es, word ptr [bp+6] - call word ptr es:2 - pop bp - retf 2 -; --------------------------------------------------------------------------- - nop - cmp word ptr es:1Ah, 0 - jz short loc_1B42 - dec word ptr es:1Ah - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - mov ax, es:1Ch - retn -; --------------------------------------------------------------------------- - -loc_1B42: - call word ptr es:4 - test ah, ah - jnz short locret_1B71 - cmp ax, es:1Ch - mov es:1Ch, ax - jnz short locret_1B71 - push ax - call word ptr es:4 - test ah, ah - jnz short loc_1B70 - mov es:1Ah, ax - sub word ptr es:12h, 1 - sbb word ptr es:14h, 0 - -loc_1B70: - pop ax - -locret_1B71: - retn - -; =============== S U B R O U T I N E ======================================= - - -sub_1B72 proc near - mov ax, es:0Ah - mov dx, es:0Ch - cmp dx, es:8 - jb short loc_1B8F - ja short loc_1B8B - cmp ax, es:6 - jb short loc_1B8F - -loc_1B8B: - mov ax, 0FFFFh - retn -; --------------------------------------------------------------------------- - -loc_1B8F: - add ax, 1 - adc dx, 0 - mov es:0Ah, ax - mov es:0Ch, dx - add word ptr es:12h, 1 - adc word ptr es:14h, 0 - push es - push word ptr es:0 - call bgetc - pop es - retn -sub_1B72 endp - -; --------------------------------------------------------------------------- - call sub_1B72 - or ah, ah - jnz short locret_1BC2 - xor al, es:1Eh - -locret_1BC2: - retn -; --------------------------------------------------------------------------- +include libs/master.lib/pfgetc.asm db 0 - include libs/master.lib/pfread.asm include libs/master.lib/pfrewind.asm include libs/master.lib/pfseek.asm