shithub: pokered

Download patch

ref: 01e314f4f5b7de2f5ad00dd017ad44514ba71e48
parent: a53b3ca5614855ab9be5991230a73f1f3d6cc442
parent: c3a5bb70d2c65b7fe6033ee9bfb8fe89b6a3e431
author: IIMarckus <iimarckus@gmail.com>
date: Tue Feb 3 19:51:25 EST 2015

Merge branch 'master' of /tmp/a/pokered

--- a/data/item_prices.asm
+++ b/data/item_prices.asm
@@ -1,98 +1,98 @@
 ItemPrices: ; 4608 (1:4608)
-	db $00,$00,$00
-	db $00,$12,$00
-	db $00,$06,$00
-	db $00,$02,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$10,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$01,$00
-	db $00,$02,$50
-	db $00,$02,$50
-	db $00,$02,$00
-	db $00,$02,$00
-	db $00,$30,$00
-	db $00,$25,$00
-	db $00,$15,$00
-	db $00,$07,$00
-	db $00,$03,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$05,$50
-	db $00,$03,$50
-	db $00,$00,$00
-	db $00,$21,$00
-	db $00,$21,$00
-	db $00,$21,$00
-	db $00,$98,$00
-	db $00,$98,$00
-	db $00,$98,$00
-	db $00,$98,$00
-	db $00,$98,$00
-	db $00,$48,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$09,$50
-	db $00,$21,$00
-	db $00,$00,$00
-	db $01,$00,$00
-	db $00,$98,$00
-	db $00,$10,$00
-	db $00,$06,$00
-	db $00,$15,$00
-	db $00,$40,$00
-	db $00,$07,$00
-	db $00,$05,$00
-	db $00,$07,$00
-	db $00,$06,$50
-	db $00,$00,$10
-	db $00,$02,$00
-	db $00,$03,$00
-	db $00,$03,$50
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$05,$00
-	db $00,$05,$50
-	db $00,$03,$50
-	db $00,$03,$50
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
-	db $00,$00,$00
+	money 0     ; MASTER_BALL
+	money 1200  ; ULTRA_BALL
+	money 600   ; GREAT_BALL
+	money 200   ; POKE_BALL
+	money 0     ; TOWN_MAP
+	money 0     ; BICYCLE
+	money 0     ; SURFBOARD
+	money 1000  ; SAFARI_BALL
+	money 0     ; POKEDEX
+	money 0     ; MOON_STONE
+	money 100   ; ANTIDOTE
+	money 250   ; BURN_HEAL
+	money 250   ; ICE_HEAL
+	money 200   ; AWAKENING
+	money 200   ; PARLYZ_HEAL
+	money 3000  ; FULL_RESTORE
+	money 2500  ; MAX_POTION
+	money 1500  ; HYPER_POTION
+	money 700   ; SUPER_POTION
+	money 300   ; POTION
+	money 0     ; BOULDERBADGE
+	money 0     ; CASCADEBADGE
+	money 0     ; THUNDERBADGE
+	money 0     ; RAINBOWBADGE
+	money 0     ; SOULBADGE
+	money 0     ; MARSHBADGE
+	money 0     ; VOLCANOBADGE
+	money 0     ; EARTHBADGE
+	money 550   ; ESCAPE_ROPE
+	money 350   ; REPEL
+	money 0     ; OLD_AMBER
+	money 2100  ; FIRE_STONE
+	money 2100  ; THUNDER_STONE
+	money 2100  ; WATER_STONE
+	money 9800  ; HP_UP
+	money 9800  ; PROTEIN
+	money 9800  ; IRON
+	money 9800  ; CARBOS
+	money 9800  ; CALCIUM
+	money 4800  ; RARE_CANDY
+	money 0     ; DOME_FOSSIL
+	money 0     ; HELIX_FOSSIL
+	money 0     ; SECRET_KEY
+	money 0     ; XXX
+	money 0     ; BIKE_VOUCHER
+	money 950   ; X_ACCURACY
+	money 2100  ; LEAF_STONE
+	money 0     ; CARD_KEY
+	money 10000 ; NUGGET
+	money 9800  ; XXX PP_UP
+	money 1000  ; POKE_DOLL
+	money 600   ; FULL_HEAL
+	money 1500  ; REVIVE
+	money 4000  ; MAX_REVIVE
+	money 700   ; GUARD_SPEC_
+	money 500   ; SUPER_REPEL
+	money 700   ; MAX_REPEL
+	money 650   ; DIRE_HIT
+	money 10    ; COIN
+	money 200   ; FRESH_WATER
+	money 300   ; SODA_POP
+	money 350   ; LEMONADE
+	money 0     ; S_S__TICKET
+	money 0     ; GOLD_TEETH
+	money 500   ; X_ATTACK
+	money 550   ; X_DEFEND
+	money 350   ; X_SPEED
+	money 350   ; X_SPECIAL
+	money 0     ; COIN_CASE
+	money 0     ; OAKS_PARCEL
+	money 0     ; ITEMFINDER
+	money 0     ; SILPH_SCOPE
+	money 0     ; POKE_FLUTE
+	money 0     ; LIFT_KEY
+	money 0     ; EXP__ALL
+	money 0     ; OLD_ROD
+	money 0     ; GOOD_ROD
+	money 0     ; SUPER_ROD
+	money 0     ; PP_UP
+	money 0     ; ETHER
+	money 0     ; MAX_ETHER
+	money 0     ; ELIXER
+	money 0     ; MAX_ELIXER
+	money 0     ; B2F
+	money 0     ; B1F
+	money 0     ; 1F
+	money 0     ; 2F
+	money 0     ; 3F
+	money 0     ; 4F
+	money 0     ; 5F
+	money 0     ; 6F
+	money 0     ; 7F
+	money 0     ; 8F
+	money 0     ; 9F
+	money 0     ; 10F
+	money 0     ; 11F
+	money 0     ; B4F
--- a/data/prizes.asm
+++ b/data/prizes.asm
@@ -21,16 +21,17 @@
 	db NIDORINO
 ENDC
 	db "@"
+
 PrizeMenuMon1Cost: ; 5285d (14:685d)
 IF DEF(_RED)
-	db $01,$80
-	db $05,$00
+	coins 180
+	coins 500
 ENDC
 IF DEF(_BLUE)
-	db $01,$20
-	db $07,$50
+	coins 120
+	coins 750
 ENDC
-	db $12,$00
+	coins 1200
 	db "@"
 
 PrizeMenuMon2Entries: ; 52864 (14:6864)
@@ -44,16 +45,17 @@
 ENDC
 	db PORYGON
 	db "@"
+
 PrizeMenuMon2Cost: ; 52868 (14:6868)
 IF DEF(_RED)
-	db $28,$00
-	db $55,$00
-	db $99,$99
+	coins 2800
+	coins 5500
+	coins 9999
 ENDC
 IF DEF(_BLUE)
-	db $25,$00
-	db $46,$00
-	db $65,$00
+	coins 2500
+	coins 4600
+	coins 6500
 ENDC
 	db "@"
 
@@ -62,8 +64,9 @@
 	db TM_15
 	db TM_50
 	db "@"
+
 PrizeMenuTMsCost: ; 52873 (14:6873)
-	db $33,$00 ; 3300 Coins
-	db $55,$00 ; 5500 Coins
-	db $77,$00 ; 7700 Coins
+	coins 3300
+	coins 5500
+	coins 7700
 	db "@"
--- a/data/tm_prices.asm
+++ b/data/tm_prices.asm
@@ -1,7 +1,27 @@
 TechnicalMachinePrices: ; 7bfa7 (1e:7fa7)
 ; In thousands (nybbles).
-	db $32, $21, $34, $24, $34
-	db $21, $45, $55, $32, $32
-	db $55, $52, $54, $52, $41
-	db $21, $12, $42, $25, $24
-	db $22, $52, $24, $34, $42
+	dn 3, 2  ; TM_01, TM_02
+	dn 2, 1  ; TM_03, TM_04
+	dn 3, 4  ; TM_05, TM_06
+	dn 2, 4  ; TM_07, TM_08
+	dn 3, 4  ; TM_09, TM_10
+	dn 2, 1  ; TM_11, TM_12
+	dn 4, 5  ; TM_13, TM_14
+	dn 5, 5  ; TM_15, TM_16
+	dn 3, 2  ; TM_17, TM_18
+	dn 3, 2  ; TM_19, TM_20
+	dn 5, 5  ; TM_21, TM_22
+	dn 5, 2  ; TM_23, TM_24
+	dn 5, 4  ; TM_25, TM_26
+	dn 5, 2  ; TM_27, TM_28
+	dn 4, 1  ; TM_29, TM_30
+	dn 2, 1  ; TM_31, TM_32
+	dn 1, 2  ; TM_33, TM_34
+	dn 4, 2  ; TM_35, TM_36
+	dn 2, 5  ; TM_37, TM_38
+	dn 2, 4  ; TM_39, TM_40
+	dn 2, 2  ; TM_41, TM_42
+	dn 5, 2  ; TM_43, TM_44
+	dn 2, 4  ; TM_45, TM_46
+	dn 3, 4  ; TM_47, TM_48
+	dn 4, 2  ; TM_49, TM_50
--- a/engine/battle/e.asm
+++ b/engine/battle/e.asm
@@ -435,145 +435,145 @@
 ; trainer pic pointers and base money.
 ; money received after battle = base money × level of highest-level enemy mon
 	dw YoungsterPic
-	db 0,$15,0
+	money 1500
 
 	dw BugCatcherPic
-	db 0,$10,0
+	money 1000
 
 	dw LassPic
-	db 0,$15,0
+	money 1500
 
 	dw SailorPic
-	db 0,$30,0
+	money 3000
 
 	dw JrTrainerMPic
-	db 0,$20,0
+	money 2000
 
 	dw JrTrainerFPic
-	db 0,$20,0
+	money 2000
 
 	dw PokemaniacPic
-	db 0,$50,0
+	money 5000
 
 	dw SuperNerdPic
-	db 0,$25,0
+	money 2500
 
 	dw HikerPic
-	db 0,$35,0
+	money 3500
 
 	dw BikerPic
-	db 0,$20,0
+	money 2000
 
 	dw BurglarPic
-	db 0,$90,0
+	money 9000
 
 	dw EngineerPic
-	db 0,$50,0
+	money 5000
 
 	dw JugglerPic
-	db 0,$35,0
+	money 3500
 
 	dw FisherPic
-	db 0,$35,0
+	money 3500
 
 	dw SwimmerPic
-	db 0,$05,0
+	money 500
 
 	dw CueBallPic
-	db 0,$25,0
+	money 2500
 
 	dw GamblerPic
-	db 0,$70,0
+	money 7000
 
 	dw BeautyPic
-	db 0,$70,0
+	money 7000
 
 	dw PsychicPic
-	db 0,$10,0
+	money 1000
 
 	dw RockerPic
-	db 0,$25,0
+	money 2500
 
 	dw JugglerPic
-	db 0,$35,0
+	money 3500
 
 	dw TamerPic
-	db 0,$40,0
+	money 4000
 
 	dw BirdKeeperPic
-	db 0,$25,0
+	money 2500
 
 	dw BlackbeltPic
-	db 0,$25,0
+	money 2500
 
 	dw Rival1Pic
-	db 0,$35,0
+	money 3500
 
 	dw ProfOakPic
-	db 0,$99,0
+	money 9900
 
 	dw ChiefPic
-	db 0,$30,0
+	money 3000
 
 	dw ScientistPic
-	db 0,$50,0
+	money 5000
 
 	dw GiovanniPic
-	db 0,$99,0
+	money 9900
 
 	dw RocketPic
-	db 0,$30,0
+	money 3000
 
 	dw CooltrainerMPic
-	db 0,$35,0
+	money 3500
 
 	dw CooltrainerFPic
-	db 0,$35,0
+	money 3500
 
 	dw BrunoPic
-	db 0,$99,0
+	money 9900
 
 	dw BrockPic
-	db 0,$99,0
+	money 9900
 
 	dw MistyPic
-	db 0,$99,0
+	money 9900
 
 	dw LtSurgePic
-	db 0,$99,0
+	money 9900
 
 	dw ErikaPic
-	db 0,$99,0
+	money 9900
 
 	dw KogaPic
-	db 0,$99,0
+	money 9900
 
 	dw BlainePic
-	db 0,$99,0
+	money 9900
 
 	dw SabrinaPic
-	db 0,$99,0
+	money 9900
 
 	dw GentlemanPic
-	db 0,$70,0
+	money 7000
 
 	dw Rival2Pic
-	db 0,$65,0
+	money 6500
 
 	dw Rival3Pic
-	db 0,$99,0
+	money 9900
 
 	dw LoreleiPic
-	db 0,$99,0
+	money 9900
 
 	dw ChannelerPic
-	db 0,$30,0
+	money 3000
 
 	dw AgathaPic
-	db 0,$99,0
+	money 9900
 
 	dw LancePic
-	db 0,$99,0
+	money 9900
 
 INCLUDE "text/trainer_names.asm"
 
--- a/engine/items/tm_prices.asm
+++ b/engine/items/tm_prices.asm
@@ -1,5 +1,8 @@
 GetMachinePrice: ; 7bf86 (1e:7f86)
-	ld a, [wcf91]
+; Input:  [wcf91] = Item Id of a TM
+; Output: Stores the 2-byte TM price in [H_DOWNARROWBLINKCNT1] and [H_DOWNARROWBLINKCNT2]
+;         as a BCD
+	ld a, [wcf91] ; a contains TM item id
 	sub TM_01
 	ret c
 	ld d, a
@@ -8,11 +11,11 @@
 	ld c, a
 	ld b, 0
 	add hl, bc
-	ld a, [hl]
+	ld a, [hl] ; a contains byte whose high or low nybble is the TM price (in thousands)
 	srl d
-	jr nc, .asm_7bf9d
+	jr nc, .highNybbleIsPrice ; is TM id odd?
 	swap a
-.asm_7bf9d
+.highNybbleIsPrice
 	and $f0
 	ld [H_DOWNARROWBLINKCNT2], a ; $ff8c
 	xor a
--- a/engine/menu/prize_menu.asm
+++ b/engine/menu/prize_menu.asm
@@ -6,7 +6,7 @@
 	jp PrintText
 .havingCoinCase
 	ld hl,wd730
-	set 6,[hl]
+	set 6,[hl] ; disable letter-printing delay
 	ld hl,ExchangeCoinsForPrizesTextPtr
 	call PrintText
 ; the following are the menu settings
--- a/home.asm
+++ b/home.asm
@@ -3335,6 +3335,8 @@
 	ret
 
 GetItemPrice:: ; 37df (0:37df)
+; Stores item's price as BCD in [H_DOWNARROWBLINKCNT1] and [[H_DOWNARROWBLINKCNT2]
+; Input: [wcf91] = item id
 	ld a, [H_LOADEDROMBANK]
 	push af
 	ld a, [wListMenuID] ; wListMenuID
@@ -3349,9 +3351,9 @@
 	ld a, [hli]
 	ld h, [hl]
 	ld l, a
-	ld a, [wcf91]
+	ld a, [wcf91] ; a contains item id
 	cp HM_01
-	jr nc, .asm_3812
+	jr nc, .getTMPrice
 	ld bc, $3
 .asm_3802
 	add hl, bc
@@ -3365,7 +3367,7 @@
 	ld a, [hl]
 	ld [H_DOWNARROWBLINKCNT1], a ; $ff8b
 	jr .asm_381c
-.asm_3812
+.getTMPrice
 	ld a, Bank(GetMachinePrice)
 	ld [H_LOADEDROMBANK], a
 	ld [$2000], a
--- a/macros.asm
+++ b/macros.asm
@@ -49,6 +49,20 @@
 	call Bankswitch
 	ENDM
 
+bcd2: MACRO
+    dn ((\1) / 1000) % 10, ((\1) / 100) % 10
+    dn ((\1) / 10) % 10, (\1) % 10
+    ENDM
+
+bcd3: MACRO
+    dn ((\1) / 100000) % 10, ((\1) / 10000) % 10
+    dn ((\1) / 1000) % 10, ((\1) / 100) % 10
+    dn ((\1) / 10) % 10, (\1) % 10
+    ENDM
+
+coins equs "bcd2"
+money equs "bcd3"
+
 ;\1 = X
 ;\2 = Y
 hlCoord: MACRO