[Reverse-engineering] [th02/th04/th05] Single-plane sprite display calls

Require understanding a hardware detail, so let's do them all at once.

Part of P0035, funded by zorg.
This commit is contained in:
nmlgc 2019-09-23 16:20:52 +02:00
parent 6f1f36722f
commit 68c9a3c79c
5 changed files with 74 additions and 194 deletions

View File

@ -60,6 +60,12 @@ twobyte_t struc
hi db ?
twobyte_t ends
; master.lib extensions
; ---------------------
; super_roll_put_1plane() plane_put constants
PLANE_PUT = 0FF00h or GC_RMW
; ---------------------
RES_X = 640
RES_Y = 400

View File

@ -51,6 +51,12 @@ graph_accesspage macro page:rest
outb 0A6h, page
endm
; スーパーインポーズ処理 --------------------------------------------------*
; 出典: super.lib(c)Kazumi supersfx.lib(c)iR
; $Id: super.h 0.36 93/02/19 20:23:11 Kazumi Rel $
PLANE_ERASE = 00c0h
; グラフィック画面への多角形描画処理 --------------------------------------
; 出典: gc_poly.h 0.16

View File

@ -12220,11 +12220,7 @@ loc_111AF:
mov bx, di
shl bx, 2
les bx, [bx+52ECh]
push word ptr es:[bx]
push si
push word_22D4C
pushd 0FFC0h
call super_roll_put_1plane
call super_roll_put_1plane pascal, word ptr es:[bx], si, word_22D4C, large PLANE_PUT or GC_BRGI
pop di
pop si
pop bp
@ -12866,7 +12862,7 @@ loc_11712:
mov bx, si
add bx, bx
push word ptr [bx+52DCh]
pushd 0FFC0h
pushd PLANE_PUT or GC_BRGI
call super_roll_put_1plane
mov byte ptr [si+2BF5h], 0
jmp short loc_1175C
@ -17376,11 +17372,7 @@ loc_13A1D:
loc_13A4B:
call _snd_se_play c, 4
mov bx, word_2065C
push word ptr [bx]
push si
push 940000h
push 0FFC0h
call super_roll_put_1plane
call super_roll_put_1plane pascal, word ptr [bx], si, (148 shl 16) or 0, PLANE_PUT or GC_BRGI
jmp short loc_13AB8
; ---------------------------------------------------------------------------
@ -17869,11 +17861,7 @@ var_2 = word ptr -2
cmp word_2065A, 8D4h
jg short loc_13F18
call _snd_se_play c, 4
push word_24E7C
push word_24E7E
push word_2064E
pushd 0FFC0h
call super_roll_put_1plane
call super_roll_put_1plane pascal, word_24E7C, word_24E7E, word_2064E, large PLANE_PUT or GC_BRGI
jmp short loc_13F2B
; ---------------------------------------------------------------------------
@ -18354,11 +18342,7 @@ loc_142E1:
jz loc_143D4
call _snd_se_play c, 4
mov bx, word_2065C
push word ptr [bx]
push si
push 880000h
push 0FFC0h
call super_roll_put_1plane
call super_roll_put_1plane pascal, word ptr [bx], si, (136 shl 16) or 0, PLANE_PUT or GC_BRGI
inc word_2065A
jmp loc_143E1
; ---------------------------------------------------------------------------
@ -18411,11 +18395,7 @@ loc_1435F:
loc_1438D:
call _snd_se_play c, 4
mov bx, word_2065C
push word ptr [bx]
push si
push 880000h
push 0FFC0h
call super_roll_put_1plane
call super_roll_put_1plane pascal, word ptr [bx], si, (136 shl 16) or 0, PLANE_PUT or GC_BRGI
jmp short loc_143E1
; ---------------------------------------------------------------------------
@ -18724,11 +18704,7 @@ loc_14628:
add word_2065A, ax
call _snd_se_play c, 4
mov bx, word_2065C
push word ptr [bx]
push si
push word_2064E
pushd 0FFC0h
call super_roll_put_1plane
call super_roll_put_1plane pascal, word ptr [bx], si, word_2064E, large PLANE_PUT or GC_BRGI
cmp word_2065A, 960h
jl short loc_14699
mov byte_2066A, 1
@ -19965,11 +19941,7 @@ loc_150D1:
mov bx, di
add bx, bx
add bx, [bp+var_6]
push word ptr [bx]
push [bp+var_4]
push 930000h
push 0FFC1h
call super_roll_put_1plane
call super_roll_put_1plane pascal, word ptr [bx], [bp+var_4], (147 shl 16) or 0, PLANE_PUT or GC_RGI
loc_150EA:
inc di
@ -24599,7 +24571,7 @@ loc_178C8:
mov bx, word_26C46
add ax, [bx+12h]
push ax
pushd 0FFC0h
pushd PLANE_PUT or GC_BRGI
call super_roll_put_1plane
jmp short loc_17964
; ---------------------------------------------------------------------------
@ -28698,11 +28670,7 @@ loc_19F72:
cmp byte_2066B, 0
jz short loc_19F9E
call _snd_se_play c, 4
push word_26D76
push si
push word_2064E
pushd 0FFC0h
call super_roll_put_1plane
call super_roll_put_1plane pascal, word_26D76, si, word_2064E, large PLANE_PUT or GC_BRGI
mov byte_2066B, 0
jmp short loc_19FAC
; ---------------------------------------------------------------------------
@ -30600,7 +30568,7 @@ loc_1B0E5:
push word ptr es:[bx]
lea ax, [si+8Ah]
push ax
pushd 0FFC0h
pushd PLANE_PUT or GC_BRGI
call super_put_1plane
loc_1B163:

View File

@ -3054,17 +3054,13 @@ loc_C836:
div bx
add dx, 93h
push dx
pushd 0FFC0h
pushd PLANE_PUT or GC_BRGI
call super_roll_put_1plane
mov ax, _midboss_pos.cur.y
add ax, (16 shl 4)
call main_01:scroll_subpixel_y_to_vram_seg1 pascal, ax
mov si, ax
push di
push ax
push 920000h
push 0FFC0h
call super_roll_put_1plane
call super_roll_put_1plane pascal, di, ax, (146 shl 16) or 0, PLANE_PUT or GC_BRGI
mov _midboss_damage_this_frame, 0
jmp short loc_C881
; ---------------------------------------------------------------------------
@ -3162,11 +3158,7 @@ loc_C91E:
; ---------------------------------------------------------------------------
loc_C931:
push di
push [bp+var_2]
push si
pushd 0FFC0h
call super_roll_put_1plane
call super_roll_put_1plane pascal, di, [bp+var_2], si, large PLANE_PUT or GC_BRGI
mov _midboss_damage_this_frame, 0
loc_C946:
@ -3614,11 +3606,7 @@ loc_CCAA:
; ---------------------------------------------------------------------------
loc_CCBD:
push di
push [bp+var_2]
push si
pushd 0FFC0h
call super_roll_put_1plane
call super_roll_put_1plane pascal, di, [bp+var_2], si, large PLANE_PUT or GC_BRGI
mov _midboss_damage_this_frame, 0
loc_CCD2:
@ -3814,11 +3802,7 @@ loc_CE5B:
; ---------------------------------------------------------------------------
loc_CE6E:
push di
push [bp+var_2]
push si
pushd 0FFC0h
call super_roll_put_1plane
call super_roll_put_1plane pascal, di, [bp+var_2], si, large PLANE_PUT or GC_BRGI
mov _midboss_damage_this_frame, 0
jmp short loc_CE8F
; ---------------------------------------------------------------------------
@ -7105,11 +7089,7 @@ loc_E8D8:
; ---------------------------------------------------------------------------
loc_E906:
push si
push di
push 800000h
push 0FFC0h
call super_put_1plane
call super_put_1plane pascal, si, di, (128 shl 16) or 0, PLANE_PUT or GC_BRGI
mov _boss_damage_this_frame, 0
jmp loc_EA5B
; ---------------------------------------------------------------------------
@ -7147,7 +7127,7 @@ loc_E961:
push si
push di
push [bp+var_2]
pushd 0FFC0h
pushd PLANE_PUT or GC_BRGI
call super_put_1plane
lea ax, [si+30h]
push ax
@ -7155,7 +7135,7 @@ loc_E961:
mov ax, [bp+var_2]
inc ax
push ax
pushd 0FFC0h
pushd PLANE_PUT or GC_BRGI
call super_put_1plane
mov _boss_damage_this_frame, 0
jmp loc_EA5B
@ -7650,11 +7630,7 @@ loc_ED01:
; ---------------------------------------------------------------------------
loc_ED4B:
push [bp+var_2]
push [bp+var_4]
push word ptr [si+6]
pushd 0FFC0h
call super_roll_put_1plane
call super_roll_put_1plane pascal, [bp+var_2], [bp+var_4], word ptr [si+6], large PLANE_PUT or GC_BRGI
mov word ptr [si+16h], 0
loc_ED64:
@ -7706,7 +7682,7 @@ loc_EDA6:
mov al, _boss_sprite
mov ah, 0
push ax
pushd 0FFC0h
pushd PLANE_PUT or GC_BRGI
call super_put_1plane
mov _boss_damage_this_frame, 0
@ -11019,7 +10995,7 @@ loc_107B7:
mov al, [bp+var_5]
mov ah, 0
push ax
pushd 0FFC0h
pushd PLANE_PUT or GC_BRGI
call super_roll_put_1plane
mov byte ptr [si+24h], 0
@ -11457,11 +11433,7 @@ loc_10C45:
jz short loc_10C65
cmp frame_mod4, 0
jnz short loc_10C65
push di
push [bp+var_2]
push si
pushd 0FFC0h
call super_roll_put_1plane
call super_roll_put_1plane pascal, di, [bp+var_2], si, large PLANE_PUT or GC_BRGI
jmp short loc_10C6F
; ---------------------------------------------------------------------------
@ -12284,7 +12256,7 @@ loc_1160F:
mov al, _boss_sprite
mov ah, 0
push ax
pushd 0FFC0h
pushd PLANE_PUT or GC_BRGI
call super_put_1plane
loc_11622:
@ -12489,11 +12461,7 @@ loc_1189B:
; ---------------------------------------------------------------------------
loc_118AE:
push si
push di
push [bp+var_2]
pushd 0FFC0h
call super_put_1plane
call super_put_1plane pascal, si, di, [bp+var_2], large PLANE_PUT or GC_BRGI
loc_118BE:
call main_01:grcg_setmode_rmw_1
@ -12683,11 +12651,7 @@ loc_11A12:
; ---------------------------------------------------------------------------
loc_11A57:
push si
push di
push [bp+var_2]
pushd 0FFC0h
call super_put_1plane
call super_put_1plane pascal, si, di, [bp+var_2], large PLANE_PUT or GC_BRGI
jmp short loc_11A90
; ---------------------------------------------------------------------------
@ -12851,7 +12815,7 @@ loc_11B8E:
and ax, 3
add ax, 0BAh
push ax
pushd 0FFC0h
pushd PLANE_PUT or GC_BRGI
call super_put_1plane
jmp short loc_11BCD
; ---------------------------------------------------------------------------
@ -12986,7 +12950,7 @@ loc_11CB1:
mov al, _boss_sprite
mov ah, 0
push ax
pushd 0FFCDh
pushd PLANE_PUT or GC_R
call super_put_1plane
lea ax, [si+30h]
push ax
@ -12995,7 +12959,7 @@ loc_11CB1:
mov ah, 0
inc ax
push ax
pushd 0FFCDh
pushd PLANE_PUT or GC_R
call super_put_1plane
loc_11CDB:
@ -13051,7 +13015,7 @@ loc_11D42:
mov al, _boss_sprite
mov ah, 0
push ax
pushd 0FFCDh
pushd PLANE_PUT or GC_R
call super_put_1plane
lea ax, [si+30h]
push ax
@ -13060,7 +13024,7 @@ loc_11D42:
mov ah, 0
inc ax
push ax
pushd 0FFCDh
pushd PLANE_PUT or GC_R
call super_put_1plane
loc_11D6C:
@ -13174,7 +13138,7 @@ loc_11E48:
mov al, _boss_sprite
mov ah, 0
push ax
pushd 0FFC0h
pushd PLANE_PUT or GC_BRGI
call super_put_1plane
jmp short loc_11E71
; ---------------------------------------------------------------------------
@ -15358,7 +15322,7 @@ var_2 = word ptr -2
mov al, _boss_sprite
mov ah, 0
push ax
pushd 0FFC6h
pushd PLANE_PUT or GC_BI
call super_put_1plane
loc_12ECF:
@ -15396,11 +15360,7 @@ loc_12EFE:
; ---------------------------------------------------------------------------
loc_12F14:
push si
push di
push [bp+var_2]
pushd 0FFC0h
call super_put_1plane
call super_put_1plane pascal, si, di, [bp+var_2], large PLANE_PUT or GC_BRGI
mov _boss_damage_this_frame, 0
loc_12F29:
@ -15546,7 +15506,7 @@ loc_1303C:
mov al, _boss_sprite
mov ah, 0
push ax
pushd 0FFC0h
pushd PLANE_PUT or GC_BRGI
call super_put_1plane
lea ax, [di+30h]
push ax
@ -15555,7 +15515,7 @@ loc_1303C:
mov ah, 0
inc ax
push ax
pushd 0FFC0h
pushd PLANE_PUT or GC_BRGI
call super_put_1plane
loc_13066:

View File

@ -2848,8 +2848,8 @@ loc_C683:
cwd
idiv bx
push ax
push 0B30000h
push 0C9h
push (179 shl 16) or 0
push PLANE_ERASE or GC_RG
call super_roll_put_1plane
sub di, 14h
mov ax, [di]
@ -2861,8 +2861,8 @@ loc_C683:
cwd
idiv bx
push ax
push 0B30000h
push 0C9h
push (179 shl 16) or 0
push PLANE_ERASE or GC_RG
call super_roll_put_1plane
sub di, 14h
mov ax, [di]
@ -2874,8 +2874,8 @@ loc_C683:
cwd
idiv bx
push ax
push 0B30000h
push 0C9h
push (179 shl 16) or 0
push PLANE_ERASE or GC_RG
call super_roll_put_1plane
mov ax, [si]
mov bx, 10h
@ -2886,8 +2886,8 @@ loc_C683:
cwd
idiv bx
push ax
push 0B30000h
push 0C8h
push (179 shl 16) or 0
push PLANE_ERASE or GC_BRG
call super_roll_put_1plane
add di, 82h
add si, 8Ch
@ -3559,11 +3559,7 @@ loc_CCB3:
jl short loc_CCFE
cmp word_242A4, 150h
jg short loc_CCFE
push word_242A2
push word_242A4
push 0B30000h
push 0FFC0h
call super_roll_put_1plane
call super_roll_put_1plane pascal, word_242A2, word_242A4, (179 shl 16) or 0, PLANE_PUT or GC_BRGI
loc_CCFE:
inc si
@ -7294,7 +7290,7 @@ loc_EC5B:
mov al, [bp+var_5]
mov ah, 0
push ax
pushd 0FFC0h
pushd PLANE_PUT or GC_BRGI
call super_roll_put_1plane
mov byte ptr [si+21h], 0
@ -10024,11 +10020,7 @@ loc_108C2:
mov si, ax
cmp _midboss_damage_this_frame, 0
jz short loc_108B6
push di
push [bp+var_2]
push si
pushd 0FFC0h
call super_roll_put_1plane
call super_roll_put_1plane pascal, di, [bp+var_2], si, large PLANE_PUT or GC_BRGI
mov _midboss_damage_this_frame, 0
jmp short loc_10900
; ---------------------------------------------------------------------------
@ -10127,11 +10119,7 @@ loc_10976:
; ---------------------------------------------------------------------------
loc_10989:
push di
push [bp+var_2]
push si
pushd 0FFC0h
call super_put_1plane
call super_put_1plane pascal, di, [bp+var_2], si, large PLANE_PUT or GC_BRGI
loc_10999:
call explosions_small_update_and_render
@ -10197,11 +10185,7 @@ loc_109F0:
; ---------------------------------------------------------------------------
loc_10A05:
push di
push [bp+var_2]
push si
pushd 0FFC0h
call super_roll_put_1plane
call super_roll_put_1plane pascal, di, [bp+var_2], si, large PLANE_PUT or GC_BRGI
mov _midboss_damage_this_frame, 0
jmp short loc_10A26
; ---------------------------------------------------------------------------
@ -10274,11 +10258,7 @@ loc_10A59:
; ---------------------------------------------------------------------------
loc_10A84:
push si
push di
push word ptr [bp-2]
pushd 0FFC0h
call super_put_1plane
call super_put_1plane pascal, si, di, word ptr [bp-2], large PLANE_PUT or GC_BRGI
loc_10A94:
call explosions_small_update_and_render
@ -10340,11 +10320,7 @@ loc_10AE3:
; ---------------------------------------------------------------------------
loc_10AF8:
push di
push [bp+var_2]
push si
pushd 0FFC0h
call super_roll_put_1plane
call super_roll_put_1plane pascal, di, [bp+var_2], si, large PLANE_PUT or GC_BRGI
mov _midboss_damage_this_frame, 0
jmp short loc_10B19
; ---------------------------------------------------------------------------
@ -10441,11 +10417,7 @@ loc_10BA1:
; ---------------------------------------------------------------------------
loc_10BB5:
push [bp+var_4]
push di
push [bp+var_6]
pushd 0FFC0h
call super_put_1plane
call super_put_1plane pascal, [bp+var_4], di, [bp+var_6], large PLANE_PUT or GC_BRGI
loc_10BC7:
mov ax, [si+4]
@ -10603,11 +10575,7 @@ loc_10CF4:
; ---------------------------------------------------------------------------
loc_10D09:
push di
push [bp+var_2]
push si
pushd 0FFC0h
call super_put_1plane
call super_put_1plane pascal, di, [bp+var_2], si, large PLANE_PUT or GC_BRGI
loc_10D19:
call sub_10B1D
@ -10663,11 +10631,7 @@ loc_10D49:
; ---------------------------------------------------------------------------
loc_10D5B:
push di
push [bp+arg_4]
push si
pushd 0FFC0h
call super_put_1plane
call super_put_1plane pascal, di, [bp+arg_4], si, large PLANE_PUT or GC_BRGI
loc_10D6B:
pop di
@ -10829,11 +10793,7 @@ var_2 = word ptr -2
; ---------------------------------------------------------------------------
loc_10E8D:
push si
push di
push [bp+var_2]
pushd 0FFC0h
call super_roll_put_1plane
call super_roll_put_1plane pascal, si, di, [bp+var_2], large PLANE_PUT or GC_BRGI
mov _midboss_damage_this_frame, 0
jmp short loc_10EAE
; ---------------------------------------------------------------------------
@ -10969,11 +10929,7 @@ loc_10F63:
; ---------------------------------------------------------------------------
loc_10F76:
push di
push [bp+var_2]
push si
pushd 0FFC0h
call super_put_1plane
call super_put_1plane pascal, di, [bp+var_2], si, large PLANE_PUT or GC_BRGI
loc_10F86:
call explosions_small_update_and_render
@ -11100,11 +11056,7 @@ loc_11029:
; ---------------------------------------------------------------------------
loc_11054:
push si
push di
push [bp+var_2]
pushd 0FFC0h
call super_put_1plane
call super_put_1plane pascal, si, di, [bp+var_2], large PLANE_PUT or GC_BRGI
loc_11064:
mov _boss_damage_this_frame, 0
@ -11233,11 +11185,7 @@ loc_11114:
; ---------------------------------------------------------------------------
loc_11134:
push si
push [bp+var_2]
push di
pushd 0FFC0h
call super_put_1plane
call super_put_1plane pascal, si, [bp+var_2], di, large PLANE_PUT or GC_BRGI
jmp short loc_11175
; ---------------------------------------------------------------------------
@ -11859,7 +11807,7 @@ loc_1166D:
mov al, _midboss_sprite
mov ah, 0
push ax
pushd 0FFC0h
pushd PLANE_PUT or GC_BRGI
call super_roll_put_1plane
mov _midboss_damage_this_frame, 0
jmp short loc_11691
@ -12094,11 +12042,7 @@ loc_11812:
; ---------------------------------------------------------------------------
loc_11825:
push di
push [bp+var_2]
push si
pushd 0FFC0h
call super_put_1plane
call super_put_1plane pascal, di, [bp+var_2], si, large PLANE_PUT or GC_BRGI
mov _boss_damage_this_frame, 0
loc_1183A:
@ -12166,7 +12110,7 @@ loc_118A9:
mov al, _midboss_sprite
mov ah, 0
push ax
pushd 0FFC0h
pushd PLANE_PUT or GC_BRGI
call super_roll_put_1plane
mov _midboss_damage_this_frame, 0
jmp short loc_118CD
@ -13110,11 +13054,7 @@ loc_122AB:
jz short loc_122CB
cmp frame_mod4, 0
jnz short loc_122CB
push di
push [bp+var_2]
push si
pushd 0FFC0h
call super_roll_put_1plane
call super_roll_put_1plane pascal, di, [bp+var_2], si, large PLANE_PUT or GC_BRGI
jmp short loc_122D5
; ---------------------------------------------------------------------------