diff --git a/libs/master.lib/respal_get_palettes.asm b/libs/master.lib/respal_get_palettes.asm new file mode 100644 index 00000000..9cbbfd52 --- /dev/null +++ b/libs/master.lib/respal_get_palettes.asm @@ -0,0 +1,74 @@ +; master library - PC98 +; +; Description: +; 常駐パレットからパレットを読み取り、Palettes,PaletteToneに設定する +; +; Function/Procedures: +; void respal_get_palettes( void ) ; +; +; Parameters: +; none +; +; Returns: +; none +; +; Binding Target: +; Microsoft-C / Turbo-C / Turbo Pascal +; +; Running Target: +; PC-9801 +; +; Requiring Resources: +; CPU: 8086 +; +; Notes: +;  常駐パレットが存在しない場合は何もしません。 +; +; Compiler/Assembler: +; TASM 3.0 +; OPTASM 1.6 +; +; Author: +; 恋塚昭彦 +; +; Revision History: +; 92/11/16 Initial +; 93/12/10 [M0.22] パレット幅 4bit->8bitに対応 + +func RESPAL_GET_PALETTES + nopcall RESPAL_EXIST + or AX,AX + jz short @@IGNORE ; house keeping + + push SI + push DI + push DS + push DS + pop ES + mov DS,AX + + mov AL,DS:[10] ; tone + xor AH,AH + mov ES:PaletteTone,AX + + mov SI,16 + mov DI,offset Palettes + mov CX,SI + mov BX,17 +@@PLOOP: + lodsw + xchg AH,AL + and AX,0f0fh + mul BX + stosw + lodsb + mul BL + stosb + loop short @@PLOOP + + pop DS + pop DI + pop SI +@@IGNORE: + ret +endfunc diff --git a/th03_main.asm b/th03_main.asm index 3bae6f58..ac0934b9 100644 --- a/th03_main.asm +++ b/th03_main.asm @@ -214,49 +214,7 @@ include libs/master.lib/super_entry_bfnt.asm include libs/master.lib/super_cancel_pat.asm include libs/master.lib/super_put.asm include libs/master.lib/respal_exist.asm - -; =============== S U B R O U T I N E ======================================= - - -sub_292E proc far - nopcall respal_exist - or ax, ax - jz short locret_2964 - push si - push di - push ds - push ds - pop es - assume es:dseg - mov ds, ax - mov al, ds:[10] - xor ah, ah - mov es:PaletteTone, ax - mov si, 10h - mov di, 11BAh - mov cx, si - mov bx, 11h - -loc_2952: - lodsw - xchg ah, al - and ax, 0F0Fh - mul bx - stosw - lodsb - mul bl - stosb - loop loc_2952 - pop ds - pop di - pop si - -locret_2964: - retf -sub_292E endp - -; --------------------------------------------------------------------------- - nop +include libs/master.lib/respal_get_palettes.asm ; --------------------------------------------------------------------------- dword_2966 dd 0 byte_296A db 0 @@ -4054,7 +4012,7 @@ sub_A4A1 proc near call sub_F0A6 push 3 call sub_F0A6 - call sub_292E + call respal_get_palettes call far ptr palette_show nop push cs