summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorRangi <remy.oukaour+rangi42@gmail.com>2021-04-19 16:31:37 -0400
committerRangi <remy.oukaour+rangi42@gmail.com>2021-04-19 16:31:37 -0400
commit316fa4b69558a1930a1a1ae44a40221a1ddd4f26 (patch)
tree4706eaec78ee5706e16e944eba4abfe1e7316168 /engine
parent35219230960f0dc85c0cb6a5723877b247609e46 (diff)
Use rgbds 0.5.0
Diffstat (limited to 'engine')
-rw-r--r--engine/events/battle_tower/battle_tower.asm4
-rw-r--r--engine/events/buena.asm10
-rw-r--r--engine/events/print_unown_2.asm16
-rw-r--r--engine/games/unown_puzzle.asm4
-rw-r--r--engine/gfx/pic_animation.asm10
-rw-r--r--engine/math/get_square_root.asm6
-rw-r--r--engine/menus/intro_menu.asm3
-rw-r--r--engine/movie/intro.asm12
-rw-r--r--engine/overworld/player_object.asm1
-rw-r--r--engine/pokegear/pokegear.asm6
-rw-r--r--engine/pokemon/bills_pc.asm6
11 files changed, 22 insertions, 56 deletions
diff --git a/engine/events/battle_tower/battle_tower.asm b/engine/events/battle_tower/battle_tower.asm
index 6b58203ca..55e65a126 100644
--- a/engine/events/battle_tower/battle_tower.asm
+++ b/engine/events/battle_tower/battle_tower.asm
@@ -386,11 +386,9 @@ ValidateBTParty: ; unreferenced
ld c, l
ld a, [hl]
and a
-x = $ff
-rept $ff - NUM_POKEMON
+for x, $ff, NUM_POKEMON, -1
jr z, .invalid
cp x
-x = x - 1
endr
jr nz, .valid
diff --git a/engine/events/buena.asm b/engine/events/buena.asm
index 62cb8bb4a..bc175d34f 100644
--- a/engine/events/buena.asm
+++ b/engine/events/buena.asm
@@ -43,10 +43,8 @@ BuenasPassword:
.PasswordIndices:
db NUM_PASSWORDS_PER_CATEGORY
-x = 0
-rept NUM_PASSWORDS_PER_CATEGORY
+for x, NUM_PASSWORDS_PER_CATEGORY
db x
-x = x + 1
endr
db -1
@@ -264,10 +262,8 @@ Buena_PrizeMenu:
.Prizes:
db NUM_BUENA_PRIZES
-x = 1
-rept NUM_BUENA_PRIZES
- db x
-x = x + 1
+for x, NUM_BUENA_PRIZES
+ db x + 1
endr
db -1
diff --git a/engine/events/print_unown_2.asm b/engine/events/print_unown_2.asm
index 4926bf532..aae80b11c 100644
--- a/engine/events/print_unown_2.asm
+++ b/engine/events/print_unown_2.asm
@@ -95,17 +95,9 @@ RotateUnownFrontpic:
jr nz, .loop_count
ret
-gbprinterrect: MACRO
-y = 0
-rept \1
-x = \1 * (\2 - 1) + y
-rept \2
- dw wGameboyPrinter2bppSource tile x
-x = x - \2
+UnownPrinter_GBPrinterRectangle:
+for y, 7
+for x, 7 - 1, -1, -1
+ dw wGameboyPrinter2bppSource tile (x * 7 + y)
endr
-y = y + 1
endr
-ENDM
-
-UnownPrinter_GBPrinterRectangle:
- gbprinterrect 7, 7
diff --git a/engine/games/unown_puzzle.asm b/engine/games/unown_puzzle.asm
index daf987380..d230c5347 100644
--- a/engine/games/unown_puzzle.asm
+++ b/engine/games/unown_puzzle.asm
@@ -721,10 +721,8 @@ ConvertLoadedPuzzlePieces:
ret
.EnlargedTiles:
-x = 0
-rept 16
+for x, 16
db ((x & %1000) * %11000) + ((x & %0100) * %1100) + ((x & %0010) * %110) + ((x & %0001) * %11)
-x = x + 1
endr
UnownPuzzle_AddPuzzlePieceBorders:
diff --git a/engine/gfx/pic_animation.asm b/engine/gfx/pic_animation.asm
index d3a176f29..c3ac84b1c 100644
--- a/engine/gfx/pic_animation.asm
+++ b/engine/gfx/pic_animation.asm
@@ -534,14 +534,10 @@ PokeAnim_CopyBitmaskToBuffer:
.Sizes: db 4, 5, 7
poke_anim_box: MACRO
-y = 7
-rept \1
-x = 7 - \1
-rept \1
- db x + y
-x = x + 1
+for y, 1, \1 + 1
+for x, 7 - \1, 7
+ db y * 7 + x
endr
-y = y + 7
endr
ENDM
diff --git a/engine/math/get_square_root.asm b/engine/math/get_square_root.asm
index 6791fd7b8..e63768547 100644
--- a/engine/math/get_square_root.asm
+++ b/engine/math/get_square_root.asm
@@ -25,8 +25,6 @@ GetSquareRoot:
ret
.Squares:
-x = 1
-rept NUM_SQUARE_ROOTS
- dw x * x
-x = x + 1
+for x, 1, NUM_SQUARE_ROOTS + 1
+ dw x**2
endr
diff --git a/engine/menus/intro_menu.asm b/engine/menus/intro_menu.asm
index b6f761d05..4c0354673 100644
--- a/engine/menus/intro_menu.asm
+++ b/engine/menus/intro_menu.asm
@@ -1309,8 +1309,7 @@ if \1 == 0 && \2 == 0
_dx = 0
endc
dbpixel \1, \2, _dx, 0
- shift
- shift
+ shift 2
endr
ENDM
; frame 0 y, x; frame 1 y, x
diff --git a/engine/movie/intro.asm b/engine/movie/intro.asm
index 2fcf20da6..31ab4747a 100644
--- a/engine/movie/intro.asm
+++ b/engine/movie/intro.asm
@@ -1310,26 +1310,20 @@ CrystalIntro_UnownFade:
.BWFade:
; Fade between black and white.
-hue = 0
-rept 32
+for hue, 32
RGB hue, hue, hue
-hue = hue + 1
endr
.BlackLBlueFade:
; Fade between black and light blue.
-hue = 0
-rept 32
+for hue, 32
RGB 0, hue / 2, hue
-hue = hue + 1
endr
.BlackBlueFade:
; Fade between black and blue.
-hue = 0
-rept 32
+for hue, 32
RGB 0, 0, hue
-hue = hue + 1
endr
Intro_Scene20_AppearUnown:
diff --git a/engine/overworld/player_object.asm b/engine/overworld/player_object.asm
index 84a2c4e16..5e701eabc 100644
--- a/engine/overworld/player_object.asm
+++ b/engine/overworld/player_object.asm
@@ -55,7 +55,6 @@ PlayerObjectTemplate:
; A dummy map object used to initialize the player object.
; Shorter than the actual amount copied by two bytes.
; Said bytes seem to be unused.
-_NUM_OBJECT_EVENTS = 0
object_event -4, -4, SPRITE_CHRIS, SPRITEMOVEDATA_PLAYER, 15, 15, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, 0, -1
CopyDECoordsToMapObject::
diff --git a/engine/pokegear/pokegear.asm b/engine/pokegear/pokegear.asm
index 2fb2c20a0..d3d270bc9 100644
--- a/engine/pokegear/pokegear.asm
+++ b/engine/pokegear/pokegear.asm
@@ -1004,11 +1004,9 @@ PokegearPhone_GetDPad:
PokegearPhone_UpdateCursor:
ld a, " "
-x = 4
-rept PHONE_DISPLAY_HEIGHT
- hlcoord 1, x
+for y, PHONE_DISPLAY_HEIGHT
+ hlcoord 1, 4 + y * 2
ld [hl], a
-x = x + 2
endr
hlcoord 1, 4
ld a, [wPokegearPhoneCursorPosition]
diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm
index 79842c06c..5ffa49b8a 100644
--- a/engine/pokemon/bills_pc.asm
+++ b/engine/pokemon/bills_pc.asm
@@ -2280,10 +2280,8 @@ _ChangeBox_MenuHeader:
.Boxes:
db NUM_BOXES
-x = 1
-rept NUM_BOXES
- db x
-x = x + 1
+for x, NUM_BOXES
+ db x + 1
endr
db -1