[Reduction] #453: respal_get_palettes

This commit is contained in:
nmlgc 2014-09-03 15:57:32 +02:00
parent 3f7a29acc6
commit b60d3a0f56
2 changed files with 76 additions and 44 deletions

View File

@ -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

View File

@ -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