shithub: pokecrystal

Download patch

ref: e32e5212af3783f530af884852570d8003e69486
parent: 45373ec601e5af5bc2be7a72b8556e4311efdc05
author: Rangi <remy.oukaour+rangi42@gmail.com>
date: Fri Feb 2 17:55:38 EST 2018

use "x + -1" not "x +- 1"
(TODO: use "x - 1" once rgbds allows it)

--- a/audio/engine.asm
+++ b/audio/engine.asm
@@ -1320,7 +1320,7 @@
 ; load ptr to sample header in NoiseSampleAddress
 	; are we on the last channel?
 	ld a, [CurChannel]
-	and NUM_MUSIC_CHANS +- 1
+	and NUM_MUSIC_CHANS + -1
 	cp CHAN4
 	; ret if not
 	ret nz
@@ -2102,7 +2102,7 @@
 ; e89e1
 
 Music_TempoRelative: ; e89e1
-; set global tempo to current channel tempo +- param
+; set global tempo to current channel tempo +/- param
 ; params: 1 signed
 	call GetMusicByte
 	ld e, a
--- a/constants/deco_constants.asm
+++ b/constants/deco_constants.asm
@@ -121,8 +121,7 @@
 	deco  GEODUDE_DOLL
 	deco  MACHOP_DOLL
 	deco  TENTACOOL_DOLL
+NUM_NON_TROPHY_DECOS = __enum__
 	deco  GOLD_TROPHY_DOLL
 	deco  SILVER_TROPHY_DOLL
-
 NUM_DECOS = __enum__
-NUM_NON_TROPHY_DECOS = NUM_DECOS +- 2
--- a/constants/item_constants.asm
+++ b/constants/item_constants.asm
@@ -288,7 +288,7 @@
 	add_mt FLAMETHROWER
 	add_mt THUNDERBOLT
 	add_mt ICE_BEAM
-NUM_TM_HM_TUTOR = __enum__ +- 1
+NUM_TM_HM_TUTOR = __enum__ + -1
 
 USE_SCRIPT_VAR EQU $00
 ITEM_FROM_MEM  EQU $ff
--- a/constants/pokemon_constants.asm
+++ b/constants/pokemon_constants.asm
@@ -271,7 +271,7 @@
 	const LUGIA      ; f9
 	const HO_OH      ; fa
 	const CELEBI     ; fb
-NUM_POKEMON EQU const_value +- 1
+NUM_POKEMON EQU const_value + -1
 	const MON_FC     ; fc
 	const EGG        ; fd
 	const MON_FE     ; fe
@@ -311,4 +311,4 @@
 	const UNOWN_X ; 24
 	const UNOWN_Y ; 25
 	const UNOWN_Z ; 26
-NUM_UNOWN EQU const_value +- 1 ; 26
+NUM_UNOWN EQU const_value + -1 ; 26
--- a/constants/pokemon_data_constants.asm
+++ b/constants/pokemon_data_constants.asm
@@ -125,7 +125,7 @@
 NUM_BOXES    EQU 14
 
 ; hall of fame
-HOF_MON_LENGTH = 1 + 2 + 2 + 1 + (MON_NAME_LENGTH +- 1) ; species, id, dvs, level, nick
+HOF_MON_LENGTH = 1 + 2 + 2 + 1 + (MON_NAME_LENGTH + -1) ; species, id, dvs, level, nick
 HOF_LENGTH = 1 + HOF_MON_LENGTH * PARTY_LENGTH + 1 ; win count, party, terminator
 NUM_HOF_TEAMS = 30
 
--- a/constants/script_constants.asm
+++ b/constants/script_constants.asm
@@ -200,7 +200,7 @@
 	const FRUITTREE_PEWTER_CITY_1 ; 1c
 	const FRUITTREE_PEWTER_CITY_2 ; 1d
 	const FRUITTREE_FUCHSIA_CITY  ; 1e
-NUM_FRUIT_TREES EQU const_value +- 1
+NUM_FRUIT_TREES EQU const_value + -1
 
 ; describedecoration arguments
 ; DescribeDecoration.JumpTable indexes (see engine/decorations.asm)
--- a/data/wild/roammon_maps.asm
+++ b/data/wild/roammon_maps.asm
@@ -4,7 +4,7 @@
 roam_map: MACRO
 	map \1
 	db _NARG - 1
-rept _NARG +- 1
+rept _NARG + -1
 	map \2
 	shift
 endr
--- a/docs/bugs_and_glitches.md
+++ b/docs/bugs_and_glitches.md
@@ -1110,7 +1110,7 @@
 
 	ld hl, PlayerName
 
-rept NAME_LENGTH_JAPANESE +- 2 ; should be PLAYER_NAME_LENGTH +- 2
+rept NAME_LENGTH_JAPANESE + -2 ; should be PLAYER_NAME_LENGTH + -2
 	ld a, [de]
 	cp [hl]
 	jr nz, .notfound
@@ -1132,7 +1132,7 @@
 	ret
 ```
 
-**Fix:** Change `rept NAME_LENGTH_JAPANESE +- 2` to `rept PLAYER_NAME_LENGTH +- 2`.
+**Fix:** Change `rept NAME_LENGTH_JAPANESE + -2` to `rept PLAYER_NAME_LENGTH + -2`.
 
 
 ## Catching a Transformed Pokémon always catches a Ditto
--- a/engine/battle_anims/anim_commands.asm
+++ b/engine/battle_anims/anim_commands.asm
@@ -263,7 +263,7 @@
 	ld a, [hl]
 	and $f0
 	ld [hli], a
-rept SPRITEOAMSTRUCT_LENGTH +- 1
+rept SPRITEOAMSTRUCT_LENGTH + -1
 	inc hl
 endr
 	dec c
--- a/engine/billspc.asm
+++ b/engine/billspc.asm
@@ -1510,7 +1510,7 @@
 	inc hl
 	ld [de], a ; y
 	inc de
-rept SPRITEOAMSTRUCT_LENGTH +- 1
+rept SPRITEOAMSTRUCT_LENGTH + -1
 	ld a, [hli]
 	ld [de], a
 	inc de
@@ -1560,7 +1560,7 @@
 	inc hl
 	ld [de], a ; y
 	inc de
-rept SPRITEOAMSTRUCT_LENGTH +- 1
+rept SPRITEOAMSTRUCT_LENGTH + -1
 	ld a, [hli]
 	ld [de], a
 	inc de
--- a/engine/events/battle_tower/battle_tower.asm
+++ b/engine/events/battle_tower/battle_tower.asm
@@ -408,10 +408,10 @@
 	ld a, [hl]
 	and a
 x = $ff
-rept ($ff +- NUM_POKEMON)
+rept ($ff + -NUM_POKEMON)
 	jr z, .invalid
 	cp x
-x = x +- 1
+x = x + -1
 endr
 	jr nz, .valid
 
--- a/engine/events/bug_contest/judging.asm
+++ b/engine/events/bug_contest/judging.asm
@@ -229,7 +229,7 @@
 CopyTempContestant: ; 138a0
 ; Could've just called CopyBytes.
 	ld de, wBugContestTempWinnerID
-rept BUG_CONTESTANT_SIZE +- 1
+rept BUG_CONTESTANT_SIZE + -1
 	ld a, [de]
 	inc de
 	ld [hli], a
--- a/engine/events/celebi.asm
+++ b/engine/events/celebi.asm
@@ -57,7 +57,7 @@
 	ld c, 4
 .OAMloop:
 	ld [hli], a ; tile id
-rept SPRITEOAMSTRUCT_LENGTH +- 1
+rept SPRITEOAMSTRUCT_LENGTH + -1
 	inc hl
 endr
 	inc a
--- a/engine/events/field_moves.asm
+++ b/engine/events/field_moves.asm
@@ -398,7 +398,7 @@
 	ld c, 4
 .OAMloop
 	ld [hli], a ; tile id
-rept SPRITEOAMSTRUCT_LENGTH +- 1
+rept SPRITEOAMSTRUCT_LENGTH + -1
 	inc hl
 endr
 	inc a
--- a/engine/events/print_unown_2.asm
+++ b/engine/events/print_unown_2.asm
@@ -98,10 +98,10 @@
 overworldmaprect: MACRO
 y = 0
 rept \1
-x = \1 * (\2 +- 1) + y
+x = \1 * (\2 + -1) + y
 rept \2
 	dw OverworldMap tile x
-x = x +- \2
+x = x + -\2
 endr
 y = y + 1
 endr
--- a/engine/evolution_animation.asm
+++ b/engine/evolution_animation.asm
@@ -352,7 +352,7 @@
 	ld a, [hl]
 	or b
 	ld [hli], a ; attributes
-rept SPRITEOAMSTRUCT_LENGTH +- 1
+rept SPRITEOAMSTRUCT_LENGTH + -1
 	inc hl
 endr
 	dec c
--- a/engine/options_menu.asm
+++ b/engine/options_menu.asm
@@ -120,7 +120,7 @@
 	ld a, c ; right pressed
 	cp OPT_TEXT_SPEED_SLOW
 	jr c, .Increase
-	ld c, OPT_TEXT_SPEED_FAST +- 1
+	ld c, OPT_TEXT_SPEED_FAST + -1
 
 .Increase:
 	inc c
--- a/engine/pic_animation.asm
+++ b/engine/pic_animation.asm
@@ -579,7 +579,7 @@
 poke_anim_box: MACRO
 y = 7
 rept \1
-x = 7 +- \1
+x = 7 + -\1
 rept \1
 	db x + y
 x = x + 1
--- a/engine/search.asm
+++ b/engine/search.asm
@@ -219,7 +219,7 @@
 
 	ld hl, PlayerName
 
-rept NAME_LENGTH_JAPANESE +- 2 ; should be PLAYER_NAME_LENGTH +- 2
+rept NAME_LENGTH_JAPANESE + -2 ; should be PLAYER_NAME_LENGTH + -2
 	ld a, [de]
 	cp [hl]
 	jr nz, .notfound
--- a/engine/slot_machine.asm
+++ b/engine/slot_machine.asm
@@ -267,7 +267,7 @@
 	ld a, [hl]
 	xor %00100000
 	ld [hli], a ; tile id
-rept SPRITEOAMSTRUCT_LENGTH +- 1
+rept SPRITEOAMSTRUCT_LENGTH + -1
 	inc hl
 endr
 	dec c
--- a/engine/stats_screen.asm
+++ b/engine/stats_screen.asm
@@ -2,7 +2,7 @@
 	const PINK_PAGE  ; 1
 	const GREEN_PAGE ; 2
 	const BLUE_PAGE  ; 3
-NUM_STAT_PAGES EQU const_value +- 1
+NUM_STAT_PAGES EQU const_value + -1
 
 BattleStatsScreenInit: ; 4dc7b (13:5c7b)
 	ld a, [wLinkMode]
--- a/engine/title.asm
+++ b/engine/title.asm
@@ -377,7 +377,7 @@
 	ld a, [hl]
 	add 2
 	ld [hli], a ; y
-rept SPRITEOAMSTRUCT_LENGTH +- 1
+rept SPRITEOAMSTRUCT_LENGTH + -1
 	inc hl
 endr
 	dec c
--- a/gfx/tilesets/palette_maps.asm
+++ b/gfx/tilesets/palette_maps.asm
@@ -2,7 +2,7 @@
 ; used in gfx/tilesets/*_palette_map.asm
 ; vram bank, pals
 x = \1 << OAM_TILE_BANK
-rept (_NARG +- 1) / 2
+rept (_NARG + -1) / 2
 	dn (x | PAL_BG_\3), (x | PAL_BG_\2)
 	shift
 	shift
--- a/macros/data.asm
+++ b/macros/data.asm
@@ -112,7 +112,7 @@
 
 
 sine_wave: MACRO
-x = 0
+x = 0.0
 rept \1
 	dw (sin(x) + (sin(x) & $ff)) >> 8 ; round up
 x = x + (32768.0 / \1) ; a circle has 65536.0 "degrees"
--- a/macros/scripts/gfx_anims.asm
+++ b/macros/scripts/gfx_anims.asm
@@ -4,7 +4,7 @@
 	db \1
 x = \2
 if _NARG > 2
-rept _NARG +- 2
+rept _NARG + -2
 x = x | (1 << (\3 + 1))
 	shift
 endr
--- a/macros/wram.asm
+++ b/macros/wram.asm
@@ -107,7 +107,7 @@
 \1Species::         ds MONS_PER_BOX + 1
 \1Mons::
 \1Mon1::            box_struct \1Mon1
-\1Mon2::            ds BOXMON_STRUCT_LENGTH * (MONS_PER_BOX +- 1)
+\1Mon2::            ds BOXMON_STRUCT_LENGTH * (MONS_PER_BOX + -1)
 \1MonOT::           ds NAME_LENGTH * MONS_PER_BOX
 \1MonNicknames::    ds MON_NAME_LENGTH * MONS_PER_BOX
 \1MonNicknamesEnd::
@@ -175,7 +175,7 @@
 ENDM
 
 battle_tower_struct: MACRO
-\1Name:: ds NAME_LENGTH +- 1
+\1Name:: ds NAME_LENGTH + -1
 \1TrainerClass:: ds 1
 \1Pkmn1:: party_struct \1Pkmn1
 \1Pkmn1Name:: ds MON_NAME_LENGTH
@@ -221,7 +221,7 @@
 \1ID::       dw
 \1DVs::      dw
 \1Level::    db
-\1Nickname:: ds MON_NAME_LENGTH +- 1
+\1Nickname:: ds MON_NAME_LENGTH + -1
 \1End::
 ENDM
 
@@ -237,7 +237,7 @@
 ENDM
 
 link_battle_record: MACRO
-\1Name::   ds NAME_LENGTH +- 1
+\1Name::   ds NAME_LENGTH + -1
 \1ID::     dw
 \1Wins::   dw
 \1Losses:: dw
--- a/mobile/fixed_words.asm
+++ b/mobile/fixed_words.asm
@@ -4120,7 +4120,7 @@
 ; 12 words per page (0-based indexing)
 x = \1 / 12
 if \1 % 12 == 0
-x = x +- 1
+x = x + -1
 endc
 	db x
 ENDM