summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--compare.sh11
-rw-r--r--home.asm2
-rw-r--r--home/audio.asm6
-rw-r--r--home/copy2.asm1
-rw-r--r--home/overworld.asm32
-rw-r--r--home/play_time.asm2
-rw-r--r--home/text.asm10
-rw-r--r--home/vcopy.asm12
-rw-r--r--macros.asm1
-rwxr-xr-xwram.asm10
11 files changed, 51 insertions, 38 deletions
diff --git a/Makefile b/Makefile
index 641b6714..ecbeb32a 100644
--- a/Makefile
+++ b/Makefile
@@ -21,7 +21,7 @@ yellow_opt = $(cgb_opt) -t "POKEMON YELLOW"
PYTHON := python
# md5sum -c is used to compare rom hashes. The options may vary across platforms.
-MD5 := md5sum -c #--quiet
+MD5 := md5sum -c --quiet
# The compare target is a shortcut to check that the build matches the original roms exactly.
diff --git a/compare.sh b/compare.sh
new file mode 100644
index 00000000..6ef030bb
--- /dev/null
+++ b/compare.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+# Compares baserom.gbc and pokeyellow.gbc
+
+# create baserom.txt if necessary
+if [ ! -f baserom.txt ]; then
+ hexdump -C baserom.gbc > baserom.txt
+fi
+
+hexdump -C pokeyellow.gbc > pokeyellow.txt
+
+diff -u baserom.txt pokeyellow.txt | less \ No newline at end of file
diff --git a/home.asm b/home.asm
index f85cb91b..f97a402c 100644
--- a/home.asm
+++ b/home.asm
@@ -928,7 +928,7 @@ ZeroSpriteBuffer:: ; 14bc (0:14bc)
; de: output address
InterlaceMergeSpriteBuffers:: ; 14c7 (0:14c7)
ld a,$0
- ld [$4000], a
+ call SwitchSRAMBankAndLatchClockData
push de
ld hl, S_SPRITEBUFFER2 + (SPRITEBUFFERSIZE - 1) ; destination: end of buffer 2
ld de, S_SPRITEBUFFER1 + (SPRITEBUFFERSIZE - 1) ; source 2: end of buffer 1
diff --git a/home/audio.asm b/home/audio.asm
index e33c0d68..991dcd01 100644
--- a/home/audio.asm
+++ b/home/audio.asm
@@ -74,14 +74,15 @@ Func_21c8:: ; 21c8 (0:21c8)
scf
ret
-Func_21e5:: ; 21e5 (0:21e5)
+Func_21e3:: ; 21e5 (0:21e5)
+ ld c,$6
push bc
push hl
callba Music2_UpdateMusic ; 2:509d
pop hl
pop bc
dec c
- jr nz, Func_21e5
+ jr nz, Func_21e3
ret
;Func_235f:: ; 235f (0:235f)
@@ -203,6 +204,7 @@ PlaySound:: ; 2238 (0:2238)
ret
Func_2288:: ; 2288 (0:2288)
+ ld a,[H_LOADEDROMBANK]
push af
ld a, [wc0ef]
call BankswitchCommon
diff --git a/home/copy2.asm b/home/copy2.asm
index f5d3f796..086ebc1a 100644
--- a/home/copy2.asm
+++ b/home/copy2.asm
@@ -25,7 +25,6 @@ FarCopyDataDouble:: ; 15d4 (0:15d4)
inc de
ld [hli],a
ld [hli],a
- inc de
dec c
jr nz, .expandloop
dec b
diff --git a/home/overworld.asm b/home/overworld.asm
index d9bade65..42146e2f 100644
--- a/home/overworld.asm
+++ b/home/overworld.asm
@@ -46,6 +46,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245)
call DelayFrame
call IsSurfingPikachuInParty
call LoadGBPal
+ call HandleMidJump
ld a,[wWalkCounter]
and a
jp nz,.moveAhead ; if the player sprite has not yet completed the walking animation
@@ -58,7 +59,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245)
bit 3,[hl]
res 3,[hl]
jp nz,WarpFound2
- ld a,[wd732]
+ ld a,[wd730]
and a,1 << 4 | 1 << 3 ; fly warp or dungeon warp
jp nz,HandleFlyWarpOrDungeonWarp
ld a,[W_CUROPPONENT]
@@ -135,7 +136,6 @@ OverworldLoopLessDelay:: ; 0245 (0:0245)
xor a
ld [wd435], a
ld a, $1
- ld a,$01
ld [wcc4b],a
ld a,[wd528] ; the direction that was pressed last time
and a
@@ -174,6 +174,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245)
ld a,$01
ld [wSpriteStateData1 + 5],a
.handleDirectionButtonPress
+ ld a,$1
ld [wd52a],a ; new direction
ld a,[wd730]
bit 7,a ; are we simulating button presses?
@@ -187,7 +188,7 @@ OverworldLoopLessDelay:: ; 0245 (0:0245)
cp b
jr z,.noDirectionChange
ld a,$8
- ld [wd434],a
+ ld [wd435],a
; unlike in red/blue, yellow does not have the 180 degrees odd code
ld hl,wFlags_0xcd60
set 2,[hl]
@@ -662,10 +663,8 @@ PlayMapChangeSound:: ; 06ef (0:06ef)
jr z,.didNotGoThroughDoor
cp CEMETERY
jr z,.didNotGoThroughDoor
- cp UNDERGROUND
- jr nz,.didNotGoThroughDoor
aCoord 8, 8 ; upper left tile of the 4x4 square the player's sprite is standing on
- cp a,$0b ; door tile in tileset 0
+ cp UNDERGROUND ; door tile in tileset 0
jr nz,.didNotGoThroughDoor
ld a, $ad ; (SFX_02_57 - SFX_Headers_02) / 3
jr .playSound
@@ -758,7 +757,6 @@ HandleFlyWarpOrDungeonWarp:: ; 0794 (0:0794)
call Delay3
xor a
ld [wBattleResult], a
- ld [wWalkBikeSurfState], a
ld [W_ISINBATTLE], a
ld [wMapPalOffset], a
ld hl, wd732
@@ -1792,13 +1790,16 @@ LoadSurfingPlayerSpriteGraphics:: ; 0d83 (0:0d83)
jr LoadPlayerSpriteGraphicsCommon
LoadBikePlayerSpriteGraphics:: ; 0d8a (0:0d8a)
+ ld b,BANK(RedCyclingSprite)
ld de,RedCyclingSprite
LoadPlayerSpriteGraphicsCommon:: ; 0d8f (0:0d8f)
ld hl,vNPCSprites
push de
push hl
+ push bc
ld c, $c
call CopyVideoData
+ pop bc
pop hl
pop de
ld a,$c0
@@ -1906,7 +1907,7 @@ LoadMapHeader:: ; 0dab (0:0dab)
.loadSpriteData
ld a,[wd72e]
bit 5,a ; did a battle happen immediately before this?
- jp nz,.finishUp ; if so, skip this because battles don't destroy this data
+ jr nz,.finishUp ; if so, skip this because battles don't destroy this data
call InitSprites
.finishUp
predef LoadTilesetHeader
@@ -1995,12 +1996,11 @@ LoadMapData:: ; 1241 (0:1241)
ld a,[W_FLAGS_D733]
bit 1,a
jr nz,.restoreRomBank
- call Func_21e5 ; music related
+ call Func_21e3 ; music related
call Func_2176 ; music related
.restoreRomBank
pop af
- ld [H_LOADEDROMBANK],a
- ld [$2000],a
+ call BankswitchCommon
ret
LoadScreenRelatedData:: ; 0f0c (0:0f0c)
@@ -2089,6 +2089,8 @@ SwitchToMapRomBank:: ; 0f8b (0:0f8b)
add hl,bc
ld a,[hl]
ld [$ffe8],a ; save map ROM bank
+ call BankswitchBack
+ ld a,[$ffe8]
call BankswitchCommon
pop bc
pop hl
@@ -2136,11 +2138,10 @@ ForceBikeOrSurf:: ; 0fd6 (0:0fd6)
; a ledge in the overworld.
HandleMidJump:: ; 0fe1 (0:0fe1)
ld a,[wd736]
- bit 7,a ; jumping down a ledge?
+ bit 6,a ; jumping down a ledge?
ret z
- ld b, BANK(_HandleMidJump)
- ld hl, _HandleMidJump
- jp Bankswitch
+ callba _HandleMidJump
+ ret
IsSpinning:: ; 0ff0 (0:0ff0)
ld a,[wd736]
@@ -2159,7 +2160,6 @@ InitSprites:: ; 1006 (0:1006)
ld a,[hli]
ld [W_NUMSPRITES],a ; save the number of sprites
push hl
- push hl
push de
push bc
call ZeroSpriteStateData
diff --git a/home/play_time.asm b/home/play_time.asm
index 3d605a57..7b34491e 100644
--- a/home/play_time.asm
+++ b/home/play_time.asm
@@ -39,8 +39,8 @@ TrackPlayTime: ; 1ef5 (0:1ef5)
set 0, [hl]
.maxIGT
ld a, 59
- ld [W_PLAYTIMEMINUTES + 1], a
ld [W_PLAYTIMESECONDS], a
+ ld [W_PLAYTIMEMINUTES + 1], a
ld a, $ff
ld [W_PLAYTIMEHOURS + 1], a
ld [W_PLAYTIMEMINUTES], a
diff --git a/home/text.asm b/home/text.asm
index 03da172b..b520d74f 100644
--- a/home/text.asm
+++ b/home/text.asm
@@ -322,7 +322,7 @@ Char49:: ; 18a3 (0:18a3)
push hl
jp Next17B6
-Char4B:: ; 1af8 (0:1af8)
+Char4B:: ; 18d1 (0:18d1)
ld a,$EE
Coorda 18, 16
call ProtectedDelay3
@@ -332,7 +332,7 @@ Char4B:: ; 1af8 (0:1af8)
ld a,$7F
Coorda 18, 16
;fall through
-Char4C:: ; 1b0a (0:1b0a)
+Char4C:: ; 18e3 (0:18e3)
push de
call Next18F1 ; 18f1
call Next18F1
@@ -373,7 +373,7 @@ ProtectedDelay3:: ; 1913 (0:1913)
pop bc
ret
-TextCommandProcessor:: ; 1b40 (0:1b40)
+TextCommandProcessor:: ; 1919 (0:1919)
ld a,[wd358]
push af
set 1,a
@@ -386,7 +386,7 @@ TextCommandProcessor:: ; 1b40 (0:1b40)
ld a,b
ld [wcc3b],a
-NextTextCommand:: ; 1b55 (0:1b55)
+NextTextCommand:: ; 192e (0:192e)
ld a,[hli]
cp a, "@" ; terminator
jr nz,.doTextCommand
@@ -639,7 +639,7 @@ TextCommandSounds:: ; 1a3d (0:1a3d)
db $10,$89 ; (SFX_02_3b - SFX_Headers_02) / 3
db $11,$94 ; (SFX_02_42 - SFX_Headers_02) / 3
db $13,$98 ; (SFX_08_45 - SFX_Headers_08) / 3
- db $14,NIDORINA ; used in OakSpeech
+ db $14,PIKACHU ; used in OakSpeech
db $15,PIDGEOT ; used in SaffronCityText12
db $16,DEWGONG ; unused?
diff --git a/home/vcopy.asm b/home/vcopy.asm
index 33262b85..4ce297d2 100644
--- a/home/vcopy.asm
+++ b/home/vcopy.asm
@@ -185,9 +185,9 @@ TransferBgRows:: ; 1d9e (0:1d9e)
jr nz, TransferBgRows
ld a, [H_SPTEMP]
- ld h, a
- ld a, [H_SPTEMP + 1]
ld l, a
+ ld a, [H_SPTEMP + 1]
+ ld h, a
ld sp, hl
ret
@@ -274,9 +274,9 @@ VBlankCopyDouble:: ; 1bd1 (0:1bd1)
ld [H_VBCOPYDOUBLEDEST], sp
ld a, [H_SPTEMP]
- ld h, a
- ld a, [H_SPTEMP + 1]
ld l, a
+ ld a, [H_SPTEMP + 1]
+ ld h, a
ld sp, hl
ret
@@ -334,9 +334,9 @@ VBlankCopy:: ; 1c21 (0:1c21)
ld [H_VBCOPYDEST],sp
ld a, [H_SPTEMP]
- ld h, a
- ld a, [H_SPTEMP + 1]
ld l, a
+ ld a, [H_SPTEMP + 1]
+ ld h, a
ld sp, hl
ret
diff --git a/macros.asm b/macros.asm
index d1130eb9..4836bc93 100644
--- a/macros.asm
+++ b/macros.asm
@@ -45,6 +45,7 @@ homecall_jump_sf: MACRO
call BankswitchCommon
call \1
pop bc
+ ld a,b
jp BankswitchCommon
ENDM
diff --git a/wram.asm b/wram.asm
index 0828c9c1..c36880d0 100755
--- a/wram.asm
+++ b/wram.asm
@@ -938,9 +938,9 @@ wEnemyMonAttack:: dw
wEnemyMonDefense:: dw
wEnemyMonSpeed:: dw
wEnemyMonSpecial:: dw
-wEnemyMonPP:: ds 2 ; NUM_MOVES - 2
+wEnemyMonPP:: ds 3 ; NUM_MOVES - 2
SECTION "WRAM Bank 1", WRAMX, BANK[1]
- ds 2 ; NUM_MOVES - 2
+ ds 1 ; NUM_MOVES - 2
wEnemyMonBaseStats:: ds 5
wEnemyMonCatchRate:: ds 1
@@ -1655,7 +1655,7 @@ wExpressionNumber::
wd44a:: ds 1
wd44b:: ds 1
- ds 37
+ ds 36
wd470:: ds 1
wd471:: ds 1
@@ -1666,13 +1666,13 @@ wd473:: ds 1
wd47a:: ds 1
- ds 32
+ ds 31
wUnknownSerialFlag_d49a:: ds 1 ; d499
wUnknownSerialFlag_d49b:: ds 1 ; d49a
wd49c:: ds 1 ; d49b
- ds 20
+ ds 19
wd4b0:: ds 1 ; number of signs on the map
wd4b1:: ds 32 ; starting address for sign coords