summaryrefslogtreecommitdiff
path: root/main.asm
diff options
context:
space:
mode:
Diffstat (limited to 'main.asm')
-rw-r--r--main.asm456
1 files changed, 440 insertions, 16 deletions
diff --git a/main.asm b/main.asm
index df3dc81e..8dbeff40 100644
--- a/main.asm
+++ b/main.asm
@@ -7948,6 +7948,7 @@ Predef: ; 3E6D
ret
;loads hl from cc4f, de from cc51, and bc from cc53
+
Load16BitRegisters: ;3e94
ld a, [$cc4f]
ld h, a
@@ -7964,7 +7965,75 @@ Load16BitRegisters: ;3e94
ret
; 0x3ead
-INCBIN "baserom.gbc",$3EAD,$4000 - $3EAD
+INCBIN "baserom.gbc",$3EAD,$3F22 - $3EAD
+
+; 0x3F22
+ dw $66ee
+ dw $66f8
+ dw $5b8e
+ dw $5b81
+ dw $6960
+ dw $697e
+ dw $6983
+ dw $6cbd
+ dw $5bbe
+ dw $5ba8
+ dw $5bd4
+ dw $6453
+ dw $6458
+ dw $6511
+ dw $64a3
+ dw $64a8
+ dw $64ad
+ dw $64b2
+ dw $64d0
+ dw $64d5
+ dw $6502
+ dw $64da
+ dw $64df
+ dw $64e4
+ dw $64b7
+ dw $64bc
+ dw $64c1
+ dw $64c6
+ dw $64cb
+ dw $6508
+ dw $6529
+ dw $69aa
+ dw $5ced
+ dw $5865
+ dw $5878
+ dw FoundHiddenItemText
+ dw HiddenItemBagFullText
+ dw $5df7
+ dw $6a3d
+ dw $7e79
+ dw $7e7e
+ dw $7e83
+ dw FoundHiddenCoinsText
+ dw DroppedHiddenCoinsText
+ dw $6bdd
+ dw $6be2
+ dw $6c05
+ dw $6b69
+ dw $6a25
+ dw $7f37
+ dw $7f32
+ dw $5c29
+ dw $69a4
+ dw $6a2a
+ dw $6a10
+ dw $6a1d
+ dw $6953
+ dw $7bbf
+ dw $5ec8
+ dw $5edb
+ dw $5eef
+ dw $5f02
+ dw $7c12
+ dw $7be8
+ dw $7c0d
+ dw $7c45
SECTION "bank1",DATA,BANK[$1]
@@ -8334,7 +8403,7 @@ MainMenu: ; 0x5af2
ld hl,$D72E
res 6,[hl]
call ClearScreen
- call $3DED
+ call GoPAL_SET_CF1C
call LoadTextBoxTilePatterns
call LoadFontTilePatterns
ld hl,$D730
@@ -8416,7 +8485,7 @@ MainMenu: ; 0x5af2
jp nz,.next0\@
jr .next6\@
.next5\@
- call $3DD4
+ call GBPalWhiteOutWithDelay3
call ClearScreen
ld a,4
ld [$D52A],a
@@ -26936,7 +27005,7 @@ NameRaterText1: ; 0x1da56
ld [$cc35], a
call $13fc
push af
- call $3dd4
+ call GBPalWhiteOutWithDelay3
call $3dbe
call $20ba
pop af
@@ -45018,8 +45087,91 @@ RocketHideout2Script: ; 0x44e27
ret
; 0x44e3a
-RocketHideout2_Unknown44e3a: ; 0x44ea
-INCBIN "baserom.gbc",$44e3a,$28d
+RocketHideout2_Unknown44e3a: ; 0x44e3a
+INCBIN "baserom.gbc",$44e3a,$45023-$44e3a
+
+; 0x45023 XXX: it looks to me this is probably data for copying tiles into memory, maybe to mix and match a few tilesets, but I don't really know for sure
+ dw $5087 ;address from within tileset graphics
+ db 1 ;number of tiles to copy?
+ db $11 ;bank of tileset graphics
+ dw $9200 ;where to load in VRAM
+
+ dw $5097
+ db 1
+ db $11
+ dw $9210
+
+ dw $50A7
+ db 1
+ db $11
+ dw $9300
+
+ dw $50B7
+ db 1
+ db $11
+ dw $9310
+
+ dw Tset16_GFX + $200
+ db 1
+ db $1A
+ dw $9200
+
+ dw Tset16_GFX + $210
+ db 1
+ db $1A
+ dw $9210
+
+ dw Tset16_GFX + $300
+ db 1
+ db $1A
+ dw $9300
+
+ dw Tset16_GFX + $310
+ db 1
+ db $1A
+ dw $9310
+
+ dw $5097
+ db 1
+ db $11
+ dw $93C0
+
+ dw $50B7
+ db 1
+ db $11
+ dw $93D0
+
+ dw $5087
+ db 1
+ db $11
+ dw $94C0
+
+ dw $50A7
+ db 1
+ db $11
+ dw $94D0
+
+ dw Tset05_GFX + $3C0
+ db 1
+ db $1A
+ dw $93C0
+
+ dw Tset05_GFX + $3D0
+ db 1
+ db $1A
+ dw $93D0
+
+ dw Tset05_GFX + $4C0
+ db 1
+ db $1A
+ dw $94C0
+
+ dw Tset05_GFX + $4D0
+ db 1
+ db $1A
+ dw $94D0
+
+INCBIN "baserom.gbc",$45083,$450c7-$45083
RocketHideout2Texts: ; 0x450c7
dw RocketHideout2Text1, RocketHideout2Text2, RocketHideout2Text3, RocketHideout2Text4, RocketHideout2Text5
@@ -57994,7 +58146,7 @@ DayCareMText1: ; 0x56254
ld [$cc35], a
call $13fc
push af
- call $3dd4
+ call GBPalWhiteOutWithDelay3
call $3dbe
call $20ba
pop af
@@ -69835,20 +69987,20 @@ Unnamed_ASM_74872: ; 0x74872
; code similar to this appears in a lot of banks; this particular
; one is called after you beat the Rocket that gives you TM28 DIG.
; the screen then fades out, he disappears, and fades back in
- call $20EF
+ call GBFadeIn1
ld a, $07
ld [$CC4D], a
ld a, $15
- call $3E6D
+ call Predef
ld a, $09
ld [$CC4D], a
ld a, $11
- call $3E6D
+ call Predef
ld a, $06
ld [$CC4D], a
ld a, $11
call Predef
- call $20D1
+ call GBFadeOut1
ret
ViridianGym_h: ; 0x74897 to 0x748a3 (12 bytes) (id=45)
@@ -71180,7 +71332,14 @@ FuchsiaGymScript: ; 0x7543d
; 0x75453
FuchsiaGymScript_Unknown75453: ; 0x75453
-INCBIN "baserom.gbc",$75453,$12
+ ld hl, $D126
+ bit 6, [hl]
+ res 6, [hl]
+ ret z
+ ld hl, Gym5CityName
+ ld de, Gym5LeaderName
+ call $317F
+ ret
Gym5CityName: ; 0x75465
db "FUCHSIA CITY@"
@@ -71570,7 +71729,22 @@ CinnabarGymScript: ; 0x7574a
; 0x75759
CinnabarGymScript_Unknown75759: ; 0x75759
-INCBIN "baserom.gbc",$75759,$7577B - $75759
+ ld hl, $D126
+ bit 6, [hl]
+ res 6, [hl]
+ push hl
+ call nz, CinnabarGymScript_Unknown75772
+ pop hl
+ bit 5, [hl]
+ res 5, [hl]
+ call nz, $3EAD
+ ld hl, $D79B
+ res 7, [hl]
+ ret
+CinnabarGymScript_Unknown75772: ; 0x75772
+ ld hl, Gym7CityName
+ ld de, Gym7LeaderName
+ jp $317F
Gym7CityName: ; 0x7577B
db "CINNABAR ISLAND@"
@@ -72975,8 +73149,119 @@ AgathaObject: ; 0x76534 (size=44)
AgathaBlocks: ; 0x76560 30
INCBIN "maps/agatha.blk"
-Unknown_7657e: ;0x7657e (has to do with the hall of fame on the PC)
-INCBIN "baserom.gbc",$7657e,$76670 - $7657e
+Unknown_7657e: ; XXX: make better (has to do with the hall of fame on the PC) ; 0x7657e
+ ld hl, UnnamedText_76683
+ call PrintText
+ ld hl, $D730
+ set 6, [hl]
+ push hl
+ ld a, [$CFCB]
+ push af
+ ld a, [$FF00+$D7]
+ push af
+ xor a
+ ld [$FF00+$D7], a
+ ld [$D0AA], a
+ ld [$CFCB], a
+ ld [$CD41], a
+ ld [$CD42], a
+ ld a, [$D5A2]
+ ld b, a
+ cp a, $33
+ jr c, .first
+ ld b, $32
+ sub b
+ ld [$CD42], a
+.first
+ ld hl, $CD42
+ inc [hl]
+ push bc
+ ld a, [$CD41]
+ ld [$CD3D], a
+ ld b, $1C
+ ld hl, $7B3F
+ call Bankswitch
+ call Unknown_765e5
+ pop bc
+ jr c, .second
+ ld hl, $CD41
+ inc [hl]
+ ld a, [hl]
+ cp b
+ jr nz, .first
+.second
+ pop af
+ ld [$FF00+$D7], a
+ pop af
+ ld [$CFCB], a
+ pop hl
+ res 6, [hl]
+ call GBPalWhiteOutWithDelay3
+ call ClearScreen
+ call GoPAL_SET_CF1C
+ jp GBPalNormal
+Unknown_765e5: ; 0x765e5
+ ld c, 6
+.third
+ push bc
+ call Unknown_76610
+ call $3865
+ ld a, [$FF00+$B4]
+ bit 1, a
+ jr nz, .fifth
+ ld hl, $CC6B
+ ld de, $CC5B
+ ld bc, $0050
+ call CopyData
+ pop bc
+ ld a, [$CC5B]
+ cp a, $FF
+ jr z, .fourth
+ dec c
+ jr nz, .third
+.fourth
+ and a
+ ret
+.fifth
+ pop bc
+ scf
+ ret
+Unknown_76610: ; 0x76610
+ call GBPalWhiteOutWithDelay3
+ call ClearScreen
+ ld hl, $CC5B
+ ld a, [hli]
+ ld [$CD3D], a
+ ld [$CF91], a
+ ld [$D0B5], a
+ ld [$CFD9], a
+ ld [$CF1D], a
+ ld a, [hli]
+ ld [$CD3F], a
+ ld de, $CD6D
+ ld bc, $000B
+ call CopyData
+ ld b, $0B
+ ld c, 0
+ call GoPAL_SET
+ ld hl, $C410
+ call GetBaseStats
+ call $1389
+ call GBPalNormal
+ ld hl, $C4A4
+ ld b, 2
+ ld c, $12
+ call TextBoxBorder
+ ld hl, $C4CD
+ ld de, HallOfFameNoText
+ call PlaceString
+ ld hl, $C4DC
+ ld de, $CD42
+ ld bc, $0103
+ call PrintNumber
+ ld b, $1C
+ ld hl, $42F0
+ jp Bankswitch
HallOfFameNoText: ; 0x76670
db "HALL OF FAME No @"
@@ -74735,7 +75020,146 @@ INCBIN "baserom.gbc",$7B068,$7C000 - $7B068
SECTION "bank1F",DATA,BANK[$1F]
-INCBIN "baserom.gbc",$7C000,$4000
+INCBIN "baserom.gbc",$7C000,$7C45E-$7C000
+
+IF _RED
+UnknSong_md_7c45e: ;0x7C45E
+ mus_duty duty50
+ mus_note noteD, note4_16
+
+ db $f4
+
+ mus_note noteC, note16
+ mus_note noteC, note2
+ mus_note noteD, note4
+
+ mus_octave oct3
+ mus_note noteG#, note16
+ mus_note noteC, note4_8_16
+ mus_note noteD, note4
+
+ mus_octave oct3
+ mus_note noteRst, note16
+
+ mus_note noteC, note4_8_16
+ mus_note noteD, note4
+
+ mus_octave oct3
+ mus_note noteC, note16
+ mus_note noteC, note2
+ mus_note noteD, note8_16
+
+ mus_octave oct3
+ mus_note noteA#, note16
+ mus_note noteC, note2
+
+ mus_end
+UnknSong_md_7c475: ;0x7C475
+ mus_duty duty50
+ mus_note noteD, note4_16
+ mus_note noteC, note2_16
+ mus_note noteC, note16
+ mus_note noteC, note16
+ mus_note noteD, note4
+
+ db $d4
+
+ mus_note noteC, note8
+ mus_note noteC, note2
+ mus_note noteD, note4
+ mus_note noteRst, note4_16
+
+ mus_note noteG#, note8
+ mus_note noteC, note4_8_16
+ mus_note noteD, note4
+ mus_note noteRst, note4_16
+
+ mus_note noteRst, note8
+
+ mus_note noteC, note4_8_16
+ mus_note noteD, note4
+ mus_note noteRst, note4_16
+
+ mus_note noteC, note8
+ mus_note noteC, note2
+ mus_note noteD, note8_16
+ mus_note noteRst, note4_16
+
+ mus_note noteA#, note8
+ mus_note noteC, note2
+
+ mus_end
+ENDC
+IF _BLUE
+UnknSong_md_7c45e: ;0x7C45E
+ mus_duty duty50
+ mus_note noteD, note4
+
+ mus_octave oct3
+ mus_note noteC, note16
+ mus_note noteC, note4_8_16
+ mus_note noteD, note4
+
+ mus_octave oct3
+ mus_note noteG#, note16
+ mus_note noteC, note4_8_16
+ mus_note noteD, note4
+
+ mus_octave oct3
+ mus_note noteRst, note16
+
+ mus_note noteC, note4_8_16
+ mus_note noteD, note4
+
+ mus_octave oct3
+ mus_note noteC, note16
+ mus_note noteC, note2
+ mus_note noteD, note1
+
+ db $f2
+
+ mus_octave oct7
+ mus_note noteC, note2
+
+ mus_end
+UnknSong_md_7c475: ; 0x7C475
+ mus_duty duty50
+ mus_note noteD, note4
+ mus_note noteC, note2_16
+ mus_note noteC, note16
+ mus_note noteC, note16
+ mus_note noteD, note4
+ mus_note noteRst, note4_16
+
+ mus_note noteC, note8
+ mus_note noteC, note4_8_16
+ mus_note noteD, note4
+ mus_note noteRst, note4_16
+
+ mus_note noteG#, note8
+ mus_note noteC, note4_8_16
+ mus_note noteD, note4
+ mus_note noteRst, note4_16
+
+ mus_note noteRst, note8
+
+ mus_note noteC, note4_8_16
+ mus_note noteD, note4
+ mus_note noteRst, note4_16
+
+ mus_note noteC, note8
+ mus_note noteC, note2
+ mus_note noteD, note1
+
+ db $d2
+
+ mus_octave oct6
+ mus_note noteC, note2
+
+ mus_end
+ENDC
+
+INCBIN "baserom.gbc",$7C490,$80000-$7C490
SECTION "bank20",DATA,BANK[$20]