Skip to content

Commit

Permalink
Add code to load in current supplies into view supply screen
Browse files Browse the repository at this point in the history
Fixes: AB#22
  • Loading branch information
samcan committed Jul 14, 2020
1 parent 33e0e06 commit 4755510
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 1 deletion.
Binary file modified src/assets/bg_view_supply_screen.bin
Binary file not shown.
63 changes: 62 additions & 1 deletion src/display_new_screen_functions.asm
Original file line number Diff line number Diff line change
Expand Up @@ -1036,7 +1036,68 @@ DisplayViewSupplyScreen:

LoadRLEScreen bg_view_supply_screen, $00

; load numbers here into screen
; TODO I want to load the numbers into the background
; rather than drawing sprites. However, for ease right
; now, I'm going to do it as sprites.

; display cash
LDA cash
STA bcdNum
LDA cash+1
STA bcdNum+1
JSR SixteenBitHexToDec

LDA #$04
STA temp
DisplayNumberThousands temp, bcdResult+3, bcdResult+2, bcdResult+1, bcdResult, #VIEW_CASH_X, #VIEW_CASH_Y, %00000001

; display oxen
LDA oxen
STA htd_in
JSR EightBitHexToDec
LDA #$14
STA temp
DisplayNumberHundreds temp, htd_out+1, htd_out, #VIEW_OXEN_X, #VIEW_OXEN_Y, %00000001

; display food
LDA food
STA bcdNum
LDA food+1
STA bcdNum+1
JSR SixteenBitHexToDec

LDA #$20
STA temp
DisplayNumberThousands temp, bcdResult+3, bcdResult+2, bcdResult+1, bcdResult, #VIEW_FOOD_X, #VIEW_FOOD_Y, %00000001

; display clothes
LDA clothes
STA htd_in
JSR EightBitHexToDec
LDA #$30
STA temp
DisplayNumberHundreds temp, htd_out+1, htd_out, #VIEW_CLOTHES_X, #VIEW_CLOTHES_Y, %00000001

; display bullets
LDA bullets
STA bcdNum
LDA bullets+1
STA bcdNum+1
JSR SixteenBitHexToDec

LDA #$3C
STA temp
DisplayNumberThousands temp, bcdResult+3, bcdResult+2, bcdResult+1, bcdResult, #VIEW_BULLETS_X, #VIEW_BULLETS_Y, %00000001

; display spare parts
LDA spareparts
STA htd_in
JSR EightBitHexToDec
LDA #$4C
STA temp
DisplayNumberHundreds temp, htd_out+1, htd_out, #VIEW_SPAREPARTS_X, #VIEW_SPAREPARTS_Y, %00000001


JMP FinishLoadNewScreen

DisplayTravelingScreen:
Expand Down
14 changes: 14 additions & 0 deletions src/westward.asm
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,20 @@ BULLETS_MAX = 100
SPAREPARTS_INC = $01
SPAREPARTS_MAX = 99

; view supply screen
VIEW_CASH_X = 208
VIEW_CASH_Y = 40
VIEW_OXEN_X = 216
VIEW_OXEN_Y = 64
VIEW_FOOD_X = 208
VIEW_FOOD_Y = 88
VIEW_CLOTHES_X = 216
VIEW_CLOTHES_Y = 112
VIEW_BULLETS_X = 208
VIEW_BULLETS_Y = 136
VIEW_SPAREPARTS_X = 216
VIEW_SPAREPARTS_Y = 160

; start-month screen
MONTH_CURSOR_SPR = $3F
MONTH_X = $70
Expand Down

0 comments on commit 4755510

Please sign in to comment.