diff --git a/libs/BorlandC/mbjmsjis.asm b/libs/BorlandC/mbjmsjis.asm new file mode 100644 index 00000000..d4e970e8 --- /dev/null +++ b/libs/BorlandC/mbjmsjis.asm @@ -0,0 +1,45 @@ + public __mbcjmstojis +__mbcjmstojis proc DIST +@@c = word ptr 2 + dPtrSize + + push bp + mov bp, sp + push si + push di + mov ax, [bp+@@c] + cmp ah, 81h + jb short @@_invalid_jms + cmp ah, 0A0h + jb short @@_ok_H + cmp ah, 0E0h + jb short @@_invalid_jms + cmp ah, 0F0h + jnb short @@_invalid_jms + +@@_ok_H: + cmp al, 40h + jb short @@_invalid_jms + cmp al, 0FDh + jnb short @@_invalid_jms + cmp al, 7Fh + jz short @@_invalid_jms + cmp al, 80h + adc al, 61h + jb short @@_1 + sub al, 0A2h + +@@_1: + rcl ah, 1 + and ah, 7Fh + add ax, 1F21h + jmp short @@_rts + +@@_invalid_jms: + xor ax, ax + +@@_rts: + pop di + pop si + pop bp + ret +__mbcjmstojis endp diff --git a/th01_fuuin.asm b/th01_fuuin.asm index b6a070c8..e2836148 100644 --- a/th01_fuuin.asm +++ b/th01_fuuin.asm @@ -7692,58 +7692,7 @@ loc_9B9F: retn sub_9B78 endp - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_9BA2 proc far - -arg_0 = word ptr 6 - - push bp - mov bp, sp - push si - push di - mov ax, [bp+arg_0] - cmp ah, 81h ; '' - jb short loc_9BDC - cmp ah, 0A0h ; '' - jb short loc_9BBE - cmp ah, 0E0h ; '' - jb short loc_9BDC - cmp ah, 0F0h ; '' - jnb short loc_9BDC - -loc_9BBE: - cmp al, 40h ; '@' - jb short loc_9BDC - cmp al, 0FDh ; '' - jnb short loc_9BDC - cmp al, 7Fh ; '' - jz short loc_9BDC - cmp al, 80h ; '' - adc al, 61h ; 'a' - jb short loc_9BD2 - sub al, 0A2h ; '' - -loc_9BD2: - rcl ah, 1 - and ah, 7Fh - add ax, 1F21h - jmp short loc_9BDE -; --------------------------------------------------------------------------- - -loc_9BDC: - xor ax, ax - -loc_9BDE: - pop di - pop si - pop bp - retf -sub_9BA2 endp - +include libs/BorlandC/mbjmsjis.asm ; =============== S U B R O U T I N E ======================================= @@ -14524,7 +14473,7 @@ loc_CD1B: mov dh, 0 add ax, dx push ax - call sub_9BA2 + call __mbcjmstojis pop cx mov [bp+var_2], ax add word ptr [bp+arg_6], 2 @@ -17692,7 +17641,7 @@ loc_E1EB: mov dh, 0 add ax, dx push ax - call sub_9BA2 + call __mbcjmstojis pop cx mov [bp+var_2], ax add word ptr [bp+arg_6], 2 diff --git a/th01_op.asm b/th01_op.asm index c15be6a3..498f223d 100644 --- a/th01_op.asm +++ b/th01_op.asm @@ -7583,58 +7583,7 @@ loc_9E1A: pop si retn -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_9E1D proc far - ; sub_C948+125P - -arg_0 = word ptr 6 - - push bp - mov bp, sp - push si - push di - mov ax, [bp+arg_0] - cmp ah, 81h ; '' - jb short loc_9E57 - cmp ah, 0A0h ; '' - jb short loc_9E39 - cmp ah, 0E0h ; '' - jb short loc_9E57 - cmp ah, 0F0h ; '' - jnb short loc_9E57 - -loc_9E39: - cmp al, 40h ; '@' - jb short loc_9E57 - cmp al, 0FDh ; '' - jnb short loc_9E57 - cmp al, 7Fh ; '' - jz short loc_9E57 - cmp al, 80h ; '' - adc al, 61h ; 'a' - jb short loc_9E4D - sub al, 0A2h ; '' - -loc_9E4D: - rcl ah, 1 - and ah, 7Fh - add ax, 1F21h - jmp short loc_9E59 -; --------------------------------------------------------------------------- - -loc_9E57: - xor ax, ax - -loc_9E59: - pop di - pop si - pop bp - retf -sub_9E1D endp - +include libs/BorlandC/mbjmsjis.asm ; =============== S U B R O U T I N E ======================================= @@ -10781,7 +10730,7 @@ loc_B557: mov dh, 0 add ax, dx push ax - call sub_9E1D + call __mbcjmstojis pop cx mov [bp+var_2], ax add word ptr [bp+arg_6], 2 @@ -13783,7 +13732,7 @@ loc_CA27: mov dh, 0 add ax, dx push ax - call sub_9E1D + call __mbcjmstojis pop cx mov [bp+var_2], ax add word ptr [bp+arg_6], 2 diff --git a/th01_reiiden.asm b/th01_reiiden.asm index 3fb93c88..a976b37c 100644 --- a/th01_reiiden.asm +++ b/th01_reiiden.asm @@ -10948,58 +10948,7 @@ loc_B142: sub_B11B endp include libs/BorlandC/kbhit.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_B15B proc far - -arg_0 = word ptr 6 - - push bp - mov bp, sp - push si - push di - mov ax, [bp+arg_0] - cmp ah, 81h ; 'E - jb short loc_B195 - cmp ah, 0A0h ; '' - jb short loc_B177 - cmp ah, 0E0h ; 'E - jb short loc_B195 - cmp ah, 0F0h ; 'E - jnb short loc_B195 - -loc_B177: - cmp al, 40h ; '@' - jb short loc_B195 - cmp al, 0FDh ; '' - jnb short loc_B195 - cmp al, 7Fh ; '' - jz short loc_B195 - cmp al, 80h ; '' - adc al, 61h ; 'a' - jb short loc_B18B - sub al, 0A2h ; '' - -loc_B18B: - rcl ah, 1 - and ah, 7Fh - add ax, 1F21h - jmp short loc_B197 -; --------------------------------------------------------------------------- - -loc_B195: - xor ax, ax - -loc_B197: - pop di - pop si - pop bp - retf -sub_B15B endp - +include libs/BorlandC/mbjmsjis.asm ; =============== S U B R O U T I N E ======================================= @@ -17644,7 +17593,7 @@ loc_E652: mov dh, 0 add ax, dx push ax - call sub_B15B + call __mbcjmstojis pop cx mov [bp+var_2], ax add word ptr [bp+arg_6], 2 @@ -20826,7 +20775,7 @@ loc_FB22: mov dh, 0 add ax, dx push ax - call sub_B15B + call __mbcjmstojis pop cx mov [bp+var_2], ax add word ptr [bp+arg_6], 2 diff --git a/th02_maine.asm b/th02_maine.asm index 236bcd6c..41d119db 100644 --- a/th02_maine.asm +++ b/th02_maine.asm @@ -1428,58 +1428,7 @@ include libs/BorlandC/setenvp.asm include libs/BorlandC/ctor2.asm include libs/BorlandC/ctor3.asm include libs/BorlandC/strings.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_91FC proc far - -arg_0 = word ptr 6 - - push bp - mov bp, sp - push si - push di - mov ax, [bp+arg_0] - cmp ah, 81h ; '' - jb short loc_9236 - cmp ah, 0A0h ; '' - jb short loc_9218 - cmp ah, 0E0h ; '' - jb short loc_9236 - cmp ah, 0F0h ; '' - jnb short loc_9236 - -loc_9218: - cmp al, 40h ; '@' - jb short loc_9236 - cmp al, 0FDh ; '' - jnb short loc_9236 - cmp al, 7Fh ; '' - jz short loc_9236 - cmp al, 80h ; '' - adc al, 61h ; 'a' - jb short loc_922C - sub al, 0A2h ; '' - -loc_922C: - rcl ah, 1 - and ah, 7Fh - add ax, 1F21h - jmp short loc_9238 -; --------------------------------------------------------------------------- - -loc_9236: - xor ax, ax - -loc_9238: - pop di - pop si - pop bp - retf -sub_91FC endp - +include libs/BorlandC/mbjmsjis.asm ; =============== S U B R O U T I N E ======================================= @@ -5278,7 +5227,7 @@ loc_B235: mov dh, 0 add ax, dx push ax - call sub_91FC + call __mbcjmstojis pop cx mov [bp+var_2], ax add word ptr [bp+arg_6], 2 diff --git a/th02_op.asm b/th02_op.asm index 553e04fa..4fc21cca 100644 --- a/th02_op.asm +++ b/th02_op.asm @@ -1039,58 +1039,7 @@ include libs/BorlandC/setenvp.asm include libs/BorlandC/ctor2.asm include libs/BorlandC/ctor3.asm include libs/BorlandC/strings.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_9849 proc far - -arg_0 = word ptr 6 - - push bp - mov bp, sp - push si - push di - mov ax, [bp+arg_0] - cmp ah, 81h ; '' - jb short loc_9883 - cmp ah, 0A0h ; '' - jb short loc_9865 - cmp ah, 0E0h ; '' - jb short loc_9883 - cmp ah, 0F0h ; '' - jnb short loc_9883 - -loc_9865: - cmp al, 40h ; '@' - jb short loc_9883 - cmp al, 0FDh ; '' - jnb short loc_9883 - cmp al, 7Fh ; '' - jz short loc_9883 - cmp al, 80h ; '' - adc al, 61h ; 'a' - jb short loc_9879 - sub al, 0A2h ; '' - -loc_9879: - rcl ah, 1 - and ah, 7Fh - add ax, 1F21h - jmp short loc_9885 -; --------------------------------------------------------------------------- - -loc_9883: - xor ax, ax - -loc_9885: - pop di - pop si - pop bp - retf -sub_9849 endp - +include libs/BorlandC/mbjmsjis.asm ; =============== S U B R O U T I N E ======================================= @@ -3559,7 +3508,7 @@ loc_AB82: mov dh, 0 add ax, dx push ax - call sub_9849 + call __mbcjmstojis pop cx mov [bp+var_2], ax add word ptr [bp+arg_6], 2 diff --git a/th03_mainl.asm b/th03_mainl.asm index de243bc7..8e7c43e3 100644 --- a/th03_mainl.asm +++ b/th03_mainl.asm @@ -1151,58 +1151,7 @@ include libs/BorlandC/setenvp.asm include libs/BorlandC/ctor2.asm include libs/BorlandC/ctor3.asm include libs/BorlandC/strings.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_924C proc far - -arg_0 = word ptr 6 - - push bp - mov bp, sp - push si - push di - mov ax, [bp+arg_0] - cmp ah, 81h ; '' - jb short loc_9286 - cmp ah, 0A0h ; '' - jb short loc_9268 - cmp ah, 0E0h ; '' - jb short loc_9286 - cmp ah, 0F0h ; '' - jnb short loc_9286 - -loc_9268: - cmp al, 40h ; '@' - jb short loc_9286 - cmp al, 0FDh ; '' - jnb short loc_9286 - cmp al, 7Fh ; '' - jz short loc_9286 - cmp al, 80h ; '' - adc al, 61h ; 'a' - jb short loc_927C - sub al, 0A2h ; '' - -loc_927C: - rcl ah, 1 - and ah, 7Fh - add ax, 1F21h - jmp short loc_9288 -; --------------------------------------------------------------------------- - -loc_9286: - xor ax, ax - -loc_9288: - pop di - pop si - pop bp - retf -sub_924C endp - +include libs/BorlandC/mbjmsjis.asm ; =============== S U B R O U T I N E ======================================= @@ -9158,7 +9107,7 @@ loc_D1D0: mov dh, 0 add ax, dx push ax - call sub_924C + call __mbcjmstojis pop cx mov [bp+var_2], ax add word ptr [bp+arg_0], 2 diff --git a/th03_op.asm b/th03_op.asm index 0e781bb9..d91554f5 100644 --- a/th03_op.asm +++ b/th03_op.asm @@ -1234,58 +1234,7 @@ include libs/BorlandC/ctor3.asm include libs/BorlandC/strings.asm include libs/BorlandC/getch.asm include libs/BorlandC/kbhit.asm - -; =============== S U B R O U T I N E ======================================= - -; Attributes: bp-based frame - -sub_9561 proc far - -arg_0 = word ptr 6 - - push bp - mov bp, sp - push si - push di - mov ax, [bp+arg_0] - cmp ah, 81h ; '' - jb short loc_959B - cmp ah, 0A0h ; '' - jb short loc_957D - cmp ah, 0E0h ; '' - jb short loc_959B - cmp ah, 0F0h ; '' - jnb short loc_959B - -loc_957D: - cmp al, 40h ; '@' - jb short loc_959B - cmp al, 0FDh ; '' - jnb short loc_959B - cmp al, 7Fh ; '' - jz short loc_959B - cmp al, 80h ; '' - adc al, 61h ; 'a' - jb short loc_9591 - sub al, 0A2h ; '' - -loc_9591: - rcl ah, 1 - and ah, 7Fh - add ax, 1F21h - jmp short loc_959D -; --------------------------------------------------------------------------- - -loc_959B: - xor ax, ax - -loc_959D: - pop di - pop si - pop bp - retf -sub_9561 endp - +include libs/BorlandC/mbjmsjis.asm ; =============== S U B R O U T I N E ======================================= @@ -7724,7 +7673,7 @@ loc_C714: mov dh, 0 add ax, dx push ax - call sub_9561 + call __mbcjmstojis pop cx mov [bp+var_2], ax add word ptr [bp+arg_0], 2