Merge pull request #133 from spannerisms/master

boss icons
This commit is contained in:
KatDevsGames
2021-07-06 17:44:24 -05:00
committed by GitHub
12 changed files with 271 additions and 29 deletions

View File

@@ -55,7 +55,7 @@ db #$20, #$19, #$08, #$31 ; year/month/day
!SRAM_SINK = "$7EF41E" ; <- change this (conflicts with Programmable item 3)
;$7EF418 - Goal Item Counter
;$7EF419 - Service Sequence
;$7EF420 - $7EF468 - Stat Tracking Bank 1 (overlaps with RNG Item Flags)
;$7EF420 - $7EF46D - Stat Tracking Bank 1 (overlaps with RNG Item Flags)
;$7EF450 - $7EF45F - RNG Item (Single) Flags
;$7EF4A0 - $7EF4A7 - Service Request Block
!FRESH_FILE_MARKER = "$7EF4F0" ; zero if fresh file
@@ -94,6 +94,8 @@ db #$20, #$19, #$08, #$31 ; year/month/day
!ONEMIND_ID = $7F5072
!ONEMIND_TIMER = $7F5073
function hexto555(h) = ((((h&$FF)/8)<<10)|(((h>>8&$FF)/8)<<5)|(((h>>16&$FF)/8)<<0))
;================================================================================
incsrc hooks.asm
@@ -206,6 +208,7 @@ incsrc toast.asm
incsrc darkroomitems.asm
incsrc fastcredits.asm
incsrc msu.asm
incsrc dungeonmap.asm
warnpc $A58000
;org $228000 ; contrib area
@@ -289,6 +292,10 @@ org $339000
incbin sheet178.gfx
warnpc $339600
org $339600
BossMapIconGFX:
incbin bossicons.4bpp
org $328000
Extra_Text_Table:
incsrc itemtext.asm

BIN
bossicons.4bpp Normal file

Binary file not shown.

View File

@@ -17,7 +17,7 @@ DrawDungeonCompassCounts:
LDX $040C : CPX.b #$FF : BEQ .done ; Skip if not in a dungeon
CMP.w #$0002 : BEQ ++ ; if CompassMode==2, we don't check for the compass
LDA $7EF364 : AND.l .item_masks, X ; Load compass values to A, mask with dungeon item masks
LDA $7EF364 : AND.l DungeonItemMasks, X ; Load compass values to A, mask with dungeon item masks
BEQ .done ; skip if we don't have compass
++
@@ -35,7 +35,7 @@ DrawDungeonCompassCounts:
.done
RTL
.item_masks ; these are dungeon correlations to $7EF364 - $7EF369 so it knows where to store compasses, etc
DungeonItemMasks: ; these are dungeon correlations to $7EF364 - $7EF369 so it knows where to store compasses, etc
dw $8000, $4000, $2000, $1000, $0800, $0400, $0200, $0100
dw $0080, $0040, $0020, $0010, $0008, $0004

149
dungeonmap.asm Normal file
View File

@@ -0,0 +1,149 @@
DoDungeonMapBossIcon:
LDA.b $14
CMP.b #$09
BEQ .dungeonmap
.cave
CMP.b #$01
RTL
.dungeonmap
LDX.w $040C
BMI .cave
; LDA.l DungeonMapIcons
; AND.b #$01
; BNE ++
;
; INC ; so it's not equal to $01
; BRA .cave
; get dungeon boss room
++ REP #$30
LDA.l $8AE817,X
ASL
TAX
; get sprite pointer for room
LDA.l $89D62E,X
INC ; to skip the "sort"
TAX
; get first byte to make sure it isn't an empty room
SEP #$20
LDA.l $890000,X
CMP.b #$FF
BNE ++
SEP #$30
BRA .cave
; check first sprite
++ LDA.l $890002,X
SEP #$10
; match boss id
LDX.b #$0B
-- CMP.l .boss_id,X
BEQ .match
DEX
BPL --
TXA
BRA .cave
.match
LDA.b #$80
STA.w $2121
REP #$30
TXA
ASL ; x32 for palette data
ASL
ASL
ASL
ASL
TAX
; prep dma
ASL ; x128 for graphics
ASL
ADC.w #BossMapIconGFX
STA.w $4312
PHY
LDY.w #32
SEP #$20
-- LDA.l .boss_palettes,X
STA.w $2122
INX
DEY
BNE --
PLY
; GFX DMA
REP #$20
SEP #$10
LDA.w #$1801
STA.w $4310
LDX.b #BossMapIconGFX>>16
STX.w $4314
LDA.w #$A060>>1
STA.w $2116
LDA.w #$0040
STA.w $4315
LDX.b #$02
STX.w $420B
STA.w $4315
LDA.w #$A260>>1
STA.w $2116
STX.w $420B
; done
SEP #$30
RTL
.boss_id
db $53 ; armos
db $54 ; lanmolas
db $09 ; moldorm
db $7A ; agahnim
db $92 ; helma king
db $8C ; arrghus
db $88 ; mothula
db $CE ; blind
db $A3 ; khold shell
db $BD ; vitreous
db $CB ; trinexx
db $D6 ; ganon
.boss_palettes
dw hexto555($000000), hexto555($F8F8F8), hexto555($D86060), hexto555($5070C8), hexto555($B090F8), hexto555($282828), hexto555($F0A068), hexto555($B06028), hexto555($B88820), hexto555($E8A800), hexto555($F8F8F8), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($50C090), hexto555($408858), hexto555($305830), hexto555($282828), hexto555($D8A800), hexto555($E06018), hexto555($787040), hexto555($585030), hexto555($484018), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($903018), hexto555($D85800), hexto555($F8A828), hexto555($282828), hexto555($E88068), hexto555($B04038), hexto555($F8D018), hexto555($C8B818), hexto555($A89818), hexto555($806818), hexto555($503818), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($C04080), hexto555($B08828), hexto555($E8C070), hexto555($282828), hexto555($90D038), hexto555($688020), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($4848B0), hexto555($7870E8), hexto555($A8A8F8), hexto555($282828), hexto555($F8F8F8), hexto555($181818), hexto555($A00028), hexto555($D03828), hexto555($E88820), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($903018), hexto555($D85800), hexto555($F8A828), hexto555($282828), hexto555($E88068), hexto555($B04038), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($4848B0), hexto555($7870E8), hexto555($A8A8F8), hexto555($282828), hexto555($F8A840), hexto555($D85820), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($903018), hexto555($D85800), hexto555($F8A828), hexto555($282828), hexto555($E88068), hexto555($B04038), hexto555($88D0F8), hexto555($7890F8), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($4828C8), hexto555($4828F0), hexto555($8070F8), hexto555($282828), hexto555($F8C8F8), hexto555($E088B0), hexto555($7098C0), hexto555($58B0E8), hexto555($D0F8F8), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($50C090), hexto555($408858), hexto555($305830), hexto555($282828), hexto555($D8A800), hexto555($E06018), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)
dw hexto555($000000), hexto555($F8F8F8), hexto555($4848B0), hexto555($7870E8), hexto555($A8A8F8), hexto555($282828), hexto555($989868), hexto555($78C0A8), hexto555($A00028), hexto555($D03828), hexto555($E88820), hexto555($503860), hexto555($505060), hexto555($788890), hexto555($484868), hexto555($707068)
dw hexto555($000000), hexto555($F8F8F8), hexto555($B090F8), hexto555($C0A028), hexto555($886008), hexto555($282828), hexto555($B83010), hexto555($E86040), hexto555($385088), hexto555($5088A8), hexto555($88C8A0), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000), hexto555($000000)

View File

@@ -33,7 +33,7 @@ CalculateByrnaUsage:
PLX
++
LDA $7EF36E ; thing we wrote over
RTL
JML IncrementMagicUseCounterByrna
;--------------------------------------------------------------------------------
CalculateCapeUsage:
LDA $1B : BEQ ++
@@ -51,8 +51,7 @@ CalculateCapeUsage:
LDA.l HardModeExclusionCapeUsage, X : STA $4C ; set cape decrement timer
PLX
++
LDA $7EF36E ; thing we wrote over
RTL
JML IncrementMagicUseCounterOne
;--------------------------------------------------------------------------------
ActivateInvulnerabilityOrDont:
LDA $1B : BEQ .nowhere_special

View File

@@ -2662,4 +2662,20 @@ org $079506 : JSL IncrementDamageTakenCounter_Eight ; underworld pit
org $0780C6 : JSL IncrementDamageTakenCounter_Arb
org $07B0B1 : JSL IncrementMagicUseCounter
org $07B0B1 : JSL IncrementMagicUseCounter
;================================================================================
; Boss icons
org $0AEEDF : db $02 ; big icon
org $0AEAFF : db $48 ; X position
org $0AEED4 ; disable flashing
BRA ++ : NOP #6 : ++
org $0AEEF2
SBC.b #$03 : STA.w $0801,X
LDA.b #$03 : STA.w $0802,X
LDA.b #$31 : STA.w $0803,X
org $008BE5 ; hijack stripes for boss GFX transfer
JSL DoDungeonMapBossIcon

View File

@@ -131,9 +131,51 @@ SEP #$30
STA !KEY_ICON_ADDRESS
.done_keys
;--------------------------------------------------------------------------------
; Draw pendant/crystal icon
;--------------------------------------------------------------------------------
!PRIZE_ICON = $7EC742
!P_ICON = $296C
!C_ICON = $295F
SEP #$20
LDA.b $1B : BEQ .noprize
LDX.w $040C : BMI .noprize
REP #$20
LDA.l MapMode
BEQ .drawprize
LDA.l $7EF368
AND.l DungeonItemMasks,X
BEQ .doneprize
.drawprize
LDA.l CrystalPendantFlags_2, X
AND.w #$0040 : BNE .is_crystal
LDA.w #!P_ICON
BRA .doneprize
.is_crystal
LDA.w #!C_ICON
BRA .doneprize
.noprize
REP #$20
LDA.w #$207F
.doneprize
STA.l !PRIZE_ICON
;--------------------------------------------------------------------------------
; Draw Magic Meter
!INFINITE_MAGIC = "$7F50CA"
@@ -261,4 +303,4 @@ HudHexToDec2Digit:
DEC : BNE -
+
STY $07 ; Store 1s digit
RTS
RTS

View File

@@ -369,8 +369,8 @@ IncrementBigChestCounter:
PLA
RTL
;--------------------------------------------------------------------------------
!DAMAGE_COUNTER = "$FFFFFF"
!MAGIC_COUNTER = "$FFFFFF"
!DAMAGE_COUNTER = $7EF46A
!MAGIC_COUNTER = $7EF46C
IncrementDamageTakenCounter_Eight:
STA.l $7EF36D
PHA : PHP
@@ -378,10 +378,12 @@ IncrementDamageTakenCounter_Eight:
REP #$21
LDA.l !DAMAGE_COUNTER
ADC.w #$0008
STA.l !DAMAGE_COUNTER
BCC ++
LDA.w #$FFFF
++ STA.l !DAMAGE_COUNTER
+ PLP
PLA
RTL
RTL
IncrementDamageTakenCounter_Arb:
PHP
@@ -390,24 +392,41 @@ IncrementDamageTakenCounter_Arb:
LDA.b $00
AND.w #$00FF
ADC.l !DAMAGE_COUNTER
STA.l !DAMAGE_COUNTER
BCC ++
LDA.w #$FFFF
++ STA.l !DAMAGE_COUNTER
+ PLP
LDA.l $7EF36D
RTL
RTL
IncrementMagicUseCounter:
STA.l $7EF36E
IncrementMagicUseCounterByrna:
PHA : PHP
LDA !LOCK_STATS : BNE +
REP #$21
LDA.b $00
AND.w #$00FF
ADC.l !MAGIC_COUNTER
STA.l !MAGIC_COUNTER
BCC ++
LDA.w #$FFFF
++ STA.l !MAGIC_COUNTER
+ PLP : PLA
RTL
RTL
IncrementMagicUseCounterOne:
LDA !LOCK_STATS : BNE +
REP #$20
LDA.l !MAGIC_COUNTER
INC
BEQ ++
STA.l !MAGIC_COUNTER
++ SEP #$20
+ LDA.l $7EF36E
RTL
;--------------------------------------------------------------------------------
!OW_MIRROR_COUNTER = "$7EF43A"

View File

@@ -563,7 +563,7 @@ CreditsLineBlank:
;===================================================================================================
print "Line number: !CLINE | Expected: 302"
print "Credits line number: !CLINE | Expected: 302"
if !CLINE > 302
error "Too many credits lines. !CLINE > 302"
@@ -639,11 +639,11 @@ endif
%blankline()
%blankline()
%bigcreditsleft("GT BIG KEY /22")
%bigcreditsleft("DAMAGE TAKEN")
%blankline()
%bigcreditsleft("CHEST TURNS")
%bigcreditsleft("MAGIC USED")
%blankline()
@@ -724,10 +724,10 @@ endif
!TEMPERED_SWORD_Y = 336
!GOLD_SWORD_X = 23
!GOLD_SWORD_Y = 339
!GT_BIG_KEY_X = 23
!GT_BIG_KEY_Y = 346
!CHEST_TURNS_X = 26
!CHEST_TURNS_Y = 349
!DAMAGETAKEN_X = 26
!DAMAGETAKEN_Y = 346
!MAGICUSED_X = 26
!MAGICUSED_Y = 349
!BONKS_X = 26
!BONKS_Y = 352
!SAVE_AND_QUITS_X = 26

View File

@@ -60,6 +60,7 @@ ValueCaps:
dw 99
dw 999
dw 9999
dw 9999 ; TODO - 5 digits need to be fixed at a later date
BitMasks:
dw $FFFF

View File

@@ -9,8 +9,8 @@
%AddStat($7EF425, 0, 0, 04, 2, !MASTER_SWORD_X, !MASTER_SWORD_Y)
%AddStat($7EF426, 0, 4, 04, 2, !TEMPERED_SWORD_X, !TEMPERED_SWORD_Y)
%AddStat($7EF426, 0, 0, 04, 2, !GOLD_SWORD_X, !GOLD_SWORD_Y)
%AddStat($7EF42A, 0, 0, 05, 2, !GT_BIG_KEY_X, !GT_BIG_KEY_Y)
%AddStat($7EF468, 0, 0, 08, 3, !CHEST_TURNS_X, !CHEST_TURNS_Y)
%AddStat($7EF46A, 0, 0, 16, 5, !DAMAGETAKEN_X, !DAMAGETAKEN_Y)
%AddStat($7EF46C, 0, 0, 16, 5, !MAGICUSED_X, !MAGICUSED_Y)
%AddStat($7EF420, 0, 0, 08, 3, !BONKS_X, !BONKS_Y)
%AddStat($7EF42D, 0, 0, 08, 2, !SAVE_AND_QUITS_X, !SAVE_AND_QUITS_Y)
%AddStat($7EF449, 0, 0, 08, 2, !DEATHS_X, !DEATHS_Y)

View File

@@ -421,7 +421,16 @@ org $30809B ; PC 0x18009B - 0x18009C
OneMindTimer:
dw 0
;--------------------------------------------------------------------------------
; 0x18009D - 0x18009F (unused)
; 0x18009D - Dungeon map icons
; .... ...b
;
; b - boss icon
;--------------------------------------------------------------------------------
org $30809D
DungeonMapIcons:
db $01
;--------------------------------------------------------------------------------
; 0x18009E - 0x18009F (unused)
;--------------------------------------------------------------------------------
org $3080A0 ; PC 0x1800A0 - 0x1800A4
Bugfix_MirrorlessSQToLW: