Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wireframe shield HUD color 4 #37

Open
wants to merge 4 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions SF/ASM/IRQ.ASM
Original file line number Diff line number Diff line change
Expand Up @@ -1105,29 +1105,29 @@ irqbit3 lda noirqbit3
bcs .skipt
dmacgram 0,5*16,thundercol,32
.skipt
IFNE shieldboostcolorbox
lda #2*16+4
sta cgadd
lda shieldup
beq .nope
lda #$e0
lda #wireframeshieldmetercolor&$FF
sta cgdata
lda #$7e
lda #wireframeshieldmetercolor>>8
sta cgdata
bra .conti
.nope
IFNE shieldboostcolorbox
;!! Unnecessary color write to palette line 2.
; This is the exact same as a color that is already
; loaded into CGRAM in most level palettes,
; and is used for the "colored boxes" that
; are used in the shield/boost box translucency effect.
; Removing this frees up line 2 of CGRAM for more background
; color palettes, if shieldboostcolorbox is off.
lda #$1f
sta cgdata
stz cgdata
ENDC
; Removing this allows you to use a different color in the shield box
; in each background, if shieldboostcolorbox is on.
; lda #$1f
; sta cgdata
; stz cgdata
.conti
ENDC

lda bg3scrollflag
beq .nobg3
Expand Down
1 change: 1 addition & 0 deletions SF/ASM/MAIN.ASM
Original file line number Diff line number Diff line change
Expand Up @@ -1836,6 +1836,7 @@ SetCharMapgame_l
bne .lolv

IFNE shieldboostcolorbox
; Change palette indices for damage and boost meters in BG1 tilemap
; why was this done in the first place? added a flag for vanilla game purposes
; witchcraft
lda.l m_meters
Expand Down
4 changes: 4 additions & 0 deletions SF/ASM/TRANS.ASM
Original file line number Diff line number Diff line change
Expand Up @@ -606,6 +606,10 @@ dmahpos ai8

;------------------------------------------------------------------------------
calcmeters a8i16
ifeq shieldboostcolorbox
lda shieldup
sta.l m_shieldup
endc
ldx pcboxobj_b
lda al_HP,x
bpl .ok
Expand Down
11 changes: 9 additions & 2 deletions SF/CONFIG/GRAPHICS.INC
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,18 @@ titlelogo equ 1
; [0 = NTSC, 1 = PAL] (DOES NOT AFFECT JP)
controlsscreenpal equ 0

; Enable colored window over shield and boost meters as in vanilla.
; Set this to 0 if moving meter positions.
; Enable colored window to change from palette line 7 to 2 over shield and boost meters as in vanilla.
; Set this to 0 if moving meter positions, or if using all 15 colors on palette line 2 instead of 12.
; If set to 1, palette line 2 color $d is the outlines' color,
; palette line 2 color 4 is the shield meter's color and palette line 2 color 7 is the boost meter's color.
; Those can be changed by changing the background palette.
; If set to 0, they instead use colors from palette line 7.
; [0 = off, 1 = on]
shieldboostcolorbox equ 0

; Shield meter's color when wireframe is activated. Have to set shieldboostcolorbox to 1 to work.
wireframeshieldmetercolor equ $7ee0

; Hides the HUD when a boss is defeated.
; [0 = off, 1 = on]
hidehudonbossdeath equ 1
Expand Down
3 changes: 3 additions & 0 deletions SF/EXT/MARIO.EXT
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
global m_planetstars,m_particlesON,m_defaultID
global m_hudcolour,m_hudflags
global mallrotzsort,mdrawsprite32
ifeq shieldboostcolorbox
global m_shieldup
endc


ifne mario_stats3d
Expand Down
16 changes: 16 additions & 0 deletions SF/MARIO/MDRAWLIS.MC
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
zmalc m_damage,2
zmalc m_boostcnt,2
zmalc m_boostanim,2
ifeq shieldboostcolorbox
zmalc m_shieldup,2
endc

rlistptr equr r1
rzstore equr r2
Expand Down Expand Up @@ -798,7 +801,11 @@ mboostmeter
move r2,#boosty+2
move r4,#boostheight-4

IFNE shieldboostcolorbox
move r0,#7
ELSEIF
move r0,#6
ENDC
mcall mdrawsolidbox
nop

Expand Down Expand Up @@ -902,7 +909,16 @@ mdamagemeter
IFNE shieldboostcolorbox
move r0,#4
ELSEIF
move r0,[m_shieldup] ; if wireframe shield activated:
dec r0 ; instruction above dosn't set zero flag
bne .nowireframe
nop
move r0,#7
bra .pickedcolor
nop
.nowireframe
move r0,#2
.pickedcolor
ENDC
mcall mdrawsolidbox
nop
Expand Down