[Separate translation units] [th03] CDG: Non-alpha display (undecompilable)

Reason: Self-modifying. -.-

Part of P0114, funded by Lmocinemod.
This commit is contained in:
nmlgc 2020-09-06 01:40:03 +02:00
parent 97ce07bfc9
commit 5a6ac29f50
7 changed files with 37 additions and 15 deletions

View File

@ -83,7 +83,7 @@ bin\th03\res_yume.com: th03\res_yume.cpp
$**
| masters.lib
bin\th03\op.exe: bin\th03\op.obj bin\hfliplut.obj bin\frmdely2.obj
bin\th03\op.exe: bin\th03\op.obj bin\th03\cdg_p_na.obj bin\hfliplut.obj bin\frmdely2.obj
$(CC) $(CFLAGS) -ml -DGAME=3 -nbin\th03\ -eOP.EXE @&&|
$**
|
@ -93,7 +93,7 @@ bin\th03\main.exe: bin\th03\main.obj th03\main_01.cpp th03\sprite16.cpp
$**
|
bin\th03\mainl.exe: bin\th03\mainl.obj bin\hfliplut.obj
bin\th03\mainl.exe: bin\th03\mainl.obj bin\th03\cdg_p_na.obj bin\hfliplut.obj
$(CC) $(CFLAGS) -ml -DGAME=3 -nbin\th03\ -eMAINL.EXE @&&|
$**
|

View File

@ -36,6 +36,7 @@ BMP2ARR = bin\\Pipeline\\bmp2arr.exe
: th05/sprites/piano_l.bmp |> !bmp2arr -sym _sPIANO_LABEL_FONT -of asm -sw 8 -sh 8 |> th05/sprites/piano_l.asp
!as = |> $(AS) %f %o |> bin\\%B.obj
!as3 = |> $(AS) /dGAME=3 th03\%b %o |> bin\\th03\\%B.obj
!as4 = |> $(AS) /dGAME=4 th04\%b %o |> bin\\th04\\%B.obj
!as5 = |> $(AS) /dGAME=5 th05\%b %o |> bin\\th05\\%B.obj
@ -63,6 +64,7 @@ BMP2ARR = bin\\Pipeline\\bmp2arr.exe
: th02_maine.asm |> !as |> bin\\th02\\maine.obj
: libs/sprite16/sprite16.asm |> $(AS) /DTHIEF libs\sprite16\sprite16.asm %o |> bin\\th03\\zunsp.obj
: th03\\cdg_p_na.asm |> !as3 |>
: th03_op.asm |> !as |> bin\\th03\\op.obj
: th03_main.asm | \
th03/sprites/score.asp \

View File

@ -25,6 +25,7 @@ tasm32 /m /mx /kh32768 /t th02_op.asm bin\th02\op.obj
tasm32 /m /mx /kh32768 /t th02_main.asm bin\th02\main.obj
tasm32 /m /mx /kh32768 /t th02_maine.asm bin\th02\maine.obj
tasm32 /m /mx /kh32768 /t /DTHIEF libs\sprite16\sprite16.asm bin\th03\zunsp.obj
tasm32 /m /mx /kh32768 /t /dGAME=3 th03\cdg_p_na.asm bin\th03\cdg_p_na.obj
tasm32 /m /mx /kh32768 /t th03_op.asm bin\th03\op.obj
tasm32 /m /mx /kh32768 /t th03_main.asm bin\th03\main.obj
tasm32 /m /mx /kh32768 /t th03_mainl.asm bin\th03\mainl.obj

View File

@ -1,7 +1,14 @@
; Displays the CDG image in the given [slot] at (⌊left/8⌋*8, top),
; disregarding its alpha plane.
.386
locals
include pc98.inc
include th03/formats/cdg.inc
extrn _cdg_slots:cdg_t:CDG_SLOT_COUNT
SEG2 segment word public 'CODE' use16
assume cs:SEG2
; void pascal cdg_put_noalpha(screen_x_t left, vram_y_t top, int slot);
public CDG_PUT_NOALPHA
cdg_put_noalpha proc far
@ -9,39 +16,41 @@ cdg_put_noalpha proc far
@@top = word ptr 8
@@left = word ptr 10
@@vram_offset_at_bottom_left equ <bx>
push bp
mov bp, sp
push si
push di
mov si, [bp+@@slot]
shl si, 4
shl si, 4 ; *= size cdg_t
add si, offset _cdg_slots
mov ax, [bp+@@left]
sar ax, 3
add ax, [si+cdg_t.offset_at_bottom_left]
mov di, ax
mov ax, [si+cdg_t.vram_dword_w]
mov word ptr cs:@@width+1, ax
mov word ptr cs:@@width, ax
jmp short $+2
shl ax, 2
add ax, (640 / 8)
add ax, ROW_SIZE
mov dx, ax
mov ax, [bp+@@top]
mov bx, ax
shl ax, 2
add ax, bx
add ax, 0A800h
add ax, SEG_PLANE_B
mov es, ax
push ds
mov ax, [si+cdg_t.seg_colors]
mov ds, ax
xor si, si
mov bx, di
mov @@vram_offset_at_bottom_left, di
cld
nop
even
@@row_loop:
@@width:
@@width = word ptr $+1
mov cx, 1234h
rep movsd
sub di, dx
@ -56,4 +65,7 @@ cdg_put_noalpha proc far
pop bp
retf 6
cdg_put_noalpha endp
align 2
even
SEG2 ends
end

View File

@ -70,4 +70,11 @@ void pascal cdg_free(int slot);
// Frees the CDG images in all slots.
void pascal cdg_free_all(void);
// -------------------
// Blitting
// --------
// Displays the CDG image in the given [slot] at (⌊left/8⌋*8, top),
// disregarding its alpha plane.
void pascal cdg_put_noalpha(screen_x_t left, vram_y_t top, int slot);
// --------
/// ---------------------------------------------------------------------------

View File

@ -5587,7 +5587,7 @@ include th03/formats/pi_slot_put_quarter.asm
include th03/hardware/input_modes.asm
include th03/hardware/input_wait.asm
db 0
include th03/formats/cdg_put_noalpha.asm
extern CDG_PUT_NOALPHA:proc
extern _hflip_lut_generate:proc
seg2 ends

View File

@ -3641,7 +3641,7 @@ include th02/formats/pi_slot_load.asm
include th03/hardware/input_modes.asm
include th03/hardware/input_wait.asm
db 0
include th03/formats/cdg_put_noalpha.asm
extern CDG_PUT_NOALPHA:proc
extern _hflip_lut_generate:proc
extern FRAME_DELAY_2:proc
seg2 ends