ref: 12666e3c70deb3a8859a22d32e31967cb971b69d
parent: 603524b4896f38c2d6163308277a74b44d22be8f
parent: f52f20edb76fb40e183473ea23bf65acbe493c6c
author: Rangi <35663410+Rangi42@users.noreply.github.com>
date: Sat Oct 20 20:36:06 EDT 2018
Merge pull request #568 from mid-kid/master ゴロゴロ
--- a/.gitignore
+++ b/.gitignore
@@ -18,6 +18,8 @@
*.sav
*.rtc
*.sn*
+*.sa*
+*.sg1
# rgbds extras
*.map
@@ -44,4 +46,4 @@
gfx/pokemon/*/bitmask.asm
gfx/pokemon/*/frames.asm
!gfx/pokemon/unown/bitmask.asm
-!gfx/pokemon/unown/frames.asm
\ No newline at end of file
+!gfx/pokemon/unown/frames.asm
--- a/engine/overworld/events.asm
+++ b/engine/overworld/events.asm
@@ -248,7 +248,7 @@
call Dummy_CheckScriptFlags3Bit5 ; This is a waste of time
- call CheckTrainerBattle3
+ call CheckTrainerBattle_GetPlayerEvent
jr c, .ok
call CheckTileEvent
@@ -289,10 +289,10 @@
scf
ret
-CheckTrainerBattle3:
+CheckTrainerBattle_GetPlayerEvent:
nop
nop
- call CheckTrainerBattle2
+ call CheckTrainerBattle
jr nc, .nope
ld a, PLAYEREVENT_SEENBYTRAINER
--- a/home/flag.asm
+++ b/home/flag.asm
@@ -38,7 +38,7 @@
; 1 SET_FLAG set bit
; 2 CHECK_FLAG check bit
; de: bit number
-; hl: index within bit table
+; hl: pointer to the flag array
; get index within the byte
ld a, e
--- a/home/trainers.asm
+++ b/home/trainers.asm
@@ -1,9 +1,9 @@
-CheckTrainerBattle2::
+CheckTrainerBattle::
ldh a, [hROMBank]
push af
call SwitchToMapScriptsBank
- call CheckTrainerBattle
+ call _CheckTrainerBattle
pop bc
ld a, b
@@ -10,7 +10,7 @@
rst Bankswitch
ret
-CheckTrainerBattle::
+_CheckTrainerBattle::
; Check if any trainer on the map sees the player and wants to battle.
; Skip the player object.
@@ -35,7 +35,7 @@
add hl, de
ld a, [hl]
and $f
- cp $2
+ cp OBJECTTYPE_TRAINER
jr nz, .next
; Is visible on the map
--- a/hram.asm
+++ b/hram.asm
@@ -126,9 +126,7 @@
hTilesPerCycle:: db ; ffd3
hBGMapMode:: db ; ffd4
hBGMapThird:: db ; ffd5
-hBGMapAddress:: db ; ffd6
-
- ds 1
+hBGMapAddress:: dw ; ffd6
hOAMUpdate:: db ; ffd8
--- a/macros/scripts/movement.asm
+++ b/macros/scripts/movement.asm
@@ -1,5 +1,5 @@
; MovementPointers indexes (see engine/overworld/movement.asm)
- enum_start
+ enum_start 0, +4
; Directional movements
@@ -8,98 +8,72 @@
db movement_turn_head | \1
ENDM
-__enum__ = __enum__ + 3
-
enum movement_turn_step ; $04
turn_step: MACRO
db movement_turn_step | \1
ENDM
-__enum__ = __enum__ + 3
-
enum movement_slow_step ; $08
slow_step: MACRO
db movement_slow_step | \1
ENDM
-__enum__ = __enum__ + 3
-
enum movement_step ; $0c
step: MACRO
db movement_step | \1
ENDM
-__enum__ = __enum__ + 3
-
enum movement_big_step ; $10
big_step: MACRO
db movement_big_step | \1
ENDM
-__enum__ = __enum__ + 3
-
enum movement_slow_slide_step ; $14
slow_slide_step: MACRO
db movement_slow_slide_step | \1
ENDM
-__enum__ = __enum__ + 3
-
enum movement_slide_step ; $18
slide_step: MACRO
db movement_slide_step | \1
ENDM
-__enum__ = __enum__ + 3
-
enum movement_fast_slide_step ; $1c
fast_slide_step: MACRO
db movement_fast_slide_step | \1
ENDM
-__enum__ = __enum__ + 3
-
enum movement_turn_away ; $20
turn_away: MACRO
db movement_turn_away | \1
ENDM
-__enum__ = __enum__ + 3
-
enum movement_turn_in ; $24
turn_in: MACRO
db movement_turn_in | \1
ENDM
-__enum__ = __enum__ + 3
-
enum movement_turn_waterfall ; $28
turn_waterfall: MACRO
db movement_turn_waterfall | \1
ENDM
-__enum__ = __enum__ + 3
-
enum movement_slow_jump_step ; $2c
slow_jump_step: MACRO
db movement_slow_jump_step | \1
ENDM
-__enum__ = __enum__ + 3
-
enum movement_jump_step ; $30
jump_step: MACRO
db movement_jump_step | \1
ENDM
-__enum__ = __enum__ + 3
-
enum movement_fast_jump_step ; $34
fast_jump_step: MACRO
db movement_fast_jump_step | \1
ENDM
-__enum__ = __enum__ + 3
+__enumdir__ = +1
; Control
enum movement_remove_sliding ; $38