shithub: pokecrystal

Download patch

ref: 93ed0ed19ce615f99a36062cd2133e8ee2e75cc1
parent: 3540578cb3452944d6c60bc13db16bc1f19b3586
parent: 58b377f25bf673702f26551824b329fb4675f64d
author: Rangi <35663410+Rangi42@users.noreply.github.com>
date: Thu Apr 16 05:48:30 EDT 2020

Merge pull request #711 from Rangi42/master

Fix #709 miscellaneous issues

--- a/engine/events/odd_egg.asm
+++ b/engine/events/odd_egg.asm
@@ -23,13 +23,13 @@
 .not_done
 
 	; Break when [hRandom] <= de.
-	ldh a, [hRandom + 1]
+	ldh a, [hRandomSub]
 	cp d
 	jr c, .done
 	jr z, .ok
 	jr .next
 .ok
-	ldh a, [hRandom + 0]
+	ldh a, [hRandomAdd]
 	cp e
 	jr c, .done
 	jr z, .done
--- a/engine/link/mystery_gift.asm
+++ b/engine/link/mystery_gift.asm
@@ -985,7 +985,7 @@
 	cpl
 	ld b, a
 	xor a
-	ldh [hMGJoypadPressed + 2], a
+	ldh [hMGPrevTIMA], a
 	call Function104d86
 .asm_104fd2
 	inc b
@@ -1008,10 +1008,10 @@
 	bit 1, a
 	jr nz, .asm_104fe5
 .asm_104fed
-	ldh a, [hMGJoypadPressed + 2]
+	ldh a, [hMGPrevTIMA]
 	ld d, a
 	ldh a, [rTIMA]
-	ldh [hMGJoypadPressed + 2], a
+	ldh [hMGPrevTIMA], a
 	sub d
 	cp $12
 	jr c, .asm_104ffd
--- a/engine/overworld/events.asm
+++ b/engine/overworld/events.asm
@@ -813,7 +813,7 @@
 CheckMenuOW:
 	xor a
 	ldh [hMenuReturn], a
-	ldh [hMenuReturn + 1], a
+	ldh [hUnusedFFA1], a
 	ldh a, [hJoyPressed]
 
 	bit SELECT_F, a
--- a/engine/overworld/player_object.asm
+++ b/engine/overworld/player_object.asm
@@ -20,10 +20,10 @@
 	ld a, -1
 	ld [wObjectFollow_Leader], a
 	ld [wObjectFollow_Follower], a
-	ld a, $0
+	ld a, PLAYER
 	ld hl, PlayerObjectTemplate
 	call CopyPlayerObjectTemplate
-	ld b, $0
+	ld b, PLAYER
 	call PlayerSpawn_ConvertCoords
 	ld a, PLAYER_OBJECT
 	call GetMapObject
--- a/home/joypad.asm
+++ b/home/joypad.asm
@@ -1,5 +1,5 @@
 Joypad::
-; Replaced by Joypad, called from VBlank instead of the useless
+; Replaced by UpdateJoypad, called from VBlank instead of the useless
 ; joypad interrupt.
 
 ; This is a placeholder in case the interrupt is somehow enabled.
--- a/home/menu.asm
+++ b/home/menu.asm
@@ -517,9 +517,9 @@
 	ret
 
 SetUpMenu::
-	call DrawVariableLengthMenuBox ; ???
+	call DrawVariableLengthMenuBox
 	call MenuWriteText
-	call InitMenuCursorAndButtonPermissions ; set up selection pointer
+	call InitMenuCursorAndButtonPermissions
 	ld hl, w2DMenuFlags1
 	set 7, [hl]
 	ret
--- a/hram.asm
+++ b/hram.asm
@@ -33,7 +33,7 @@
 hMapEntryMethod:: db ; ff9f
 hMenuReturn:: db ; ffa0
 
-	ds 1
+hUnusedFFA1:: db ; ffa1
 
 hJoypadReleased:: db ; ffa2
 hJoypadPressed::  db ; ffa3
@@ -107,6 +107,7 @@
 NEXTU ; ffc3
 hMGJoypadPressed::  db ; ffc3
 hMGJoypadReleased:: db ; ffc4
+hMGPrevTIMA::       db ; ffc5
 ENDU ; ffc6
 
 hLCDCPointer::     db ; ffc6
--- a/maps/PlayersHouse2F.asm
+++ b/maps/PlayersHouse2F.asm
@@ -9,7 +9,7 @@
 
 	db 2 ; callbacks
 	callback MAPCALLBACK_NEWMAP, .InitializeRoom
-	callback MAPCALLBACK_TILES, .SetSpawn
+	callback MAPCALLBACK_TILES, .SetUpTileDecorations
 
 ; unused
 .Null:
@@ -26,7 +26,7 @@
 .SkipInitialization:
 	return
 
-.SetSpawn:
+.SetUpTileDecorations:
 	special ToggleMaptileDecorations
 	return