[Reduction] #454: respal_set_palettes

This commit is contained in:
nmlgc 2014-09-03 16:08:44 +02:00
parent b60d3a0f56
commit bf7fb83197
2 changed files with 71 additions and 38 deletions

View File

@ -0,0 +1,69 @@
; master library - PC98
;
; Description:
; Palettes,PaletteToneの値を常駐パレットに書き込む
;
; Function/Procedures:
; void respal_set_palettes( void ) ;
;
; Parameters:
; none
;
; Returns:
; none
;
; Binding Target:
; Microsoft-C / Turbo-C / Turbo Pascal
;
; Running Target:
; PC-9801V
;
; Requiring Resources:
; CPU: V30
;
; 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_SET_PALETTES
push SI
push DI
CLD
mov AX,ResPalSeg
or AX,AX
jz short @@IGNORE ; house keeping
mov ES,AX
mov AX,PaletteTone
mov ES:[10],AL
mov SI,offset Palettes
mov DI,16
mov CX,16
@@PLOOP:
lodsw
xchg AH,AL
shr AX,4
and AL,0fh
stosw
lodsb
shr AL,4
stosb
loop short @@PLOOP
@@IGNORE:
pop DI
pop SI
ret
endfunc

View File

@ -304,43 +304,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_2820 proc far
push si
push di
cld
mov ax, ResPalSeg
or ax, ax
jz short loc_284C
mov es, ax
mov ax, PaletteTone
mov es:0Ah, al
mov si, 141Eh
mov di, 10h
mov cx, 10h
loc_283C:
lodsw
xchg ah, al
shr ax, 4
and al, 0Fh
stosw
lodsb
shr al, 4
stosb
loop loc_283C
loc_284C:
pop di
pop si
retf
sub_2820 endp
; ---------------------------------------------------------------------------
nop
include libs/master.lib/respal_set_palettes.asm
; ---------------------------------------------------------------------------
dword_2850 dd 0
byte_2854 db 0, 90h
@ -3423,7 +3387,7 @@ loc_9C5E:
push offset unk_10316
push large [dword_102FE]
call graph_pi_free
call sub_2820
call respal_set_palettes
pop si
leave
retn