From 88c05e48e5faf927c41524e5bfd751b9b482db82 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Fri, 20 Sep 2019 21:56:31 +0200 Subject: [PATCH] [Maintenance] Move a few more ASM definitions to their own .inc files Part of P0032, funded by zorg. --- th02/hud/hud.inc | 3 +++ th02/score.inc | 1 + th02/th02.inc | 3 +++ th02_main.asm | 8 ++++---- th04/hud/popup.inc | 11 +++++++++++ th04/hud/popup[bss].asm | 4 ---- th04/hud/popup[data].asm | 8 -------- th04/score[bss].asm | 1 - th04/shared.inc | 2 ++ 9 files changed, 24 insertions(+), 17 deletions(-) create mode 100644 th02/hud/hud.inc create mode 100644 th02/score.inc create mode 100644 th04/hud/popup.inc diff --git a/th02/hud/hud.inc b/th02/hud/hud.inc new file mode 100644 index 00000000..9fb90485 --- /dev/null +++ b/th02/hud/hud.inc @@ -0,0 +1,3 @@ +HUD_X = 56 +HUD_TRAM_W = 8 +BAR_MAX = 128 diff --git a/th02/score.inc b/th02/score.inc new file mode 100644 index 00000000..0a74b717 --- /dev/null +++ b/th02/score.inc @@ -0,0 +1 @@ +SCORE_DIGITS = 8 diff --git a/th02/th02.inc b/th02/th02.inc index b505f83e..7236f06f 100644 --- a/th02/th02.inc +++ b/th02/th02.inc @@ -1,8 +1,11 @@ GAME = 2 include defconv_c.inc + include th02/hardware/input.inc include th02/math/randring_next.inc include th02/gaiji_boldfont.inc +include th02/hud/hud.inc +include th02/score.inc kajacall macro func, param := <0> call _snd_kaja_interrupt pascal, (func shl 8) or (param and 0ffh) diff --git a/th02_main.asm b/th02_main.asm index 62c8469c..376ef85b 100644 --- a/th02_main.asm +++ b/th02_main.asm @@ -6712,7 +6712,7 @@ arg_4 = word ptr 8 push si push di mov si, offset _POWERS_OF_10_LONG - mov di, 38h ; '8' + mov di, HUD_X jmp short loc_DC9A ; --------------------------------------------------------------------------- @@ -6732,7 +6732,7 @@ loc_DC65: add di, 2 loc_DC9A: - cmp di, 46h ; 'F' + cmp di, HUD_X + ((SCORE_DIGITS - 1) * 2) jl short loc_DC65 pop di pop si @@ -6761,9 +6761,9 @@ arg_2 = word ptr 6 mov si, 9 loc_DCB7: - lea ax, [si+0A0h] + lea ax, [si+GB_DIGITS] mov [bp+var_2], ax - call gaiji_putca pascal, 70, [bp+arg_2], ax, TX_WHITE + call gaiji_putca pascal, HUD_X + ((SCORE_DIGITS - 1) * 2), [bp+arg_2], ax, TX_WHITE pop si leave retn 4 diff --git a/th04/hud/popup.inc b/th04/hud/popup.inc new file mode 100644 index 00000000..e1cbda60 --- /dev/null +++ b/th04/hud/popup.inc @@ -0,0 +1,11 @@ +POPUP_TRAM_Y = 2 +POPUP_LEN = 8 +POPUP_DURATION = 128 + +POPUP_ID_HISCORE_ENTRY = 0 +POPUP_ID_EXTEND = 1 +POPUP_ID_BONUS = 2 +POPUP_ID_FULL_POWERUP = 3 +if GAME eq 5 +POPUP_ID_DREAMBONUS_MAX = 4 +endif diff --git a/th04/hud/popup[bss].asm b/th04/hud/popup[bss].asm index aec45fb0..2d9c8534 100644 --- a/th04/hud/popup[bss].asm +++ b/th04/hud/popup[bss].asm @@ -1,7 +1,3 @@ -POPUP_TRAM_Y = 2 -POPUP_LEN = 8 -POPUP_DURATION = 128 - public _popup_gaiji_len, _popup_id_cur, _popup_dest_reached, _popup_shiftbuf public _popup_cur_tram_x, _popup_dest_tram_x, _bgm_title_id, _popup_id_new public _overlay_text_fp, _popup_fp, _popup_byte_unknown, _popup_bonus diff --git a/th04/hud/popup[data].asm b/th04/hud/popup[data].asm index 48dc900f..1ed69014 100644 --- a/th04/hud/popup[data].asm +++ b/th04/hud/popup[data].asm @@ -1,11 +1,3 @@ -POPUP_ID_HISCORE_ENTRY = 0 -POPUP_ID_EXTEND = 1 -POPUP_ID_BONUS = 2 -POPUP_ID_FULL_POWERUP = 3 -if GAME eq 5 -POPUP_ID_DREAMBONUS_MAX = 4 -endif - gStage_1 db 0BCh, 0BDh, 0AAh, 0B0h, 0AEh, 2, 0A1h, 0 gFINAL_STAGE db 0AFh, 0B2h, 0B7h, 0AAh, 0B5h, 2, 0BCh, 0BDh, 0AAh, 0B0h, 0AEh, 0 gEXTRA_STAGE db 0AEh, 0C1h, 0BDh, 0BBh, 0AAh, 2, 0BCh, 0BDh, 0AAh, 0B0h, 0AEh, 0 diff --git a/th04/score[bss].asm b/th04/score[bss].asm index 4416b4ed..439d5655 100644 --- a/th04/score[bss].asm +++ b/th04/score[bss].asm @@ -3,7 +3,6 @@ ; which is then taken "times 10" ([score_delta] += 1 → 10 more on-screen ; points). -SCORE_DIGITS = 8 ; Also ignoring the last digit. (= 61,110 points) SCORE_DELTA_FRAME_LIMIT = 6111 diff --git a/th04/shared.inc b/th04/shared.inc index 0c164468..1f07e2fc 100644 --- a/th04/shared.inc +++ b/th04/shared.inc @@ -16,3 +16,5 @@ include th04/math/randring_next.inc include th04/math/motion.inc include th02/gaiji_boldfont.inc include th04/gaiji.inc +include th04/hud/popup.inc +include th02/score.inc