shithub: pokecrystal

Download patch

ref: 1da2a7a5c4cf4e0aa19218c9a1afa4a1e1e39ec0
parent: 90c18c5cf320be70b0507deda0dd7611052f2bec
author: yenatch <[email protected]>
date: Sun Jul 7 21:35:41 EDT 2013

Outdoor sprites and sprite constants

--- a/constants/map_constants.asm
+++ b/constants/map_constants.asm
@@ -1583,3 +1583,162 @@
 WEST EQU 2
 SOUTH EQU 4
 NORTH EQU 8
+
+; sprites
+SPRITE_CHRIS                 EQU $01
+SPRITE_CHRIS_BIKE            EQU $02
+SPRITE_GAMEBOY_KID           EQU $03
+SPRITE_SILVER                EQU $04
+SPRITE_OAK                   EQU $05
+SPRITE_RED                   EQU $06
+SPRITE_BLUE                  EQU $07
+SPRITE_BILL                  EQU $08
+SPRITE_ELDER                 EQU $09
+SPRITE_JANINE                EQU $0a
+SPRITE_KURT                  EQU $0b
+SPRITE_MOM                   EQU $0c
+SPRITE_BLAINE                EQU $0d
+SPRITE_REDS_MOM              EQU $0e
+SPRITE_DAISY                 EQU $0f
+SPRITE_ELM                   EQU $10
+SPRITE_WILL                  EQU $11
+SPRITE_FALKNER               EQU $12
+SPRITE_WHITNEY               EQU $13
+SPRITE_BUGSY                 EQU $14
+SPRITE_MORTY                 EQU $15
+SPRITE_CHUCK                 EQU $16
+SPRITE_JASMINE               EQU $17
+SPRITE_PRYCE                 EQU $18
+SPRITE_CLAIR                 EQU $19
+SPRITE_BROCK                 EQU $1a
+SPRITE_KAREN                 EQU $1b
+SPRITE_BRUNO                 EQU $1c
+SPRITE_MISTY                 EQU $1d
+SPRITE_LANCE                 EQU $1e
+SPRITE_SURGE                 EQU $1f
+SPRITE_ERIKA                 EQU $20
+SPRITE_KOGA                  EQU $21
+SPRITE_SABRINA               EQU $22
+SPRITE_COOLTRAINER_M         EQU $23
+SPRITE_COOLTRAINER_F         EQU $24
+SPRITE_BUG_CATCHER           EQU $25
+SPRITE_TWIN                  EQU $26
+SPRITE_YOUNGSTER             EQU $27
+SPRITE_LASS                  EQU $28
+SPRITE_TEACHER               EQU $29
+SPRITE_BUENA                 EQU $2a
+SPRITE_SUPER_NERD            EQU $2b
+SPRITE_ROCKER                EQU $2c
+SPRITE_POKEFAN_M             EQU $2d
+SPRITE_POKEFAN_F             EQU $2e
+SPRITE_GRAMPS                EQU $2f
+SPRITE_GRANNY                EQU $30
+SPRITE_SWIMMER_GUY           EQU $31
+SPRITE_SWIMMER_GIRL          EQU $32
+SPRITE_BIG_SNORLAX           EQU $33
+SPRITE_SURFING_PIKACHU       EQU $34
+SPRITE_ROCKET                EQU $35
+SPRITE_ROCKET_GIRL           EQU $36
+SPRITE_NURSE                 EQU $37
+SPRITE_LINK_RECEPTIONIST     EQU $38
+SPRITE_CLERK                 EQU $39
+SPRITE_FISHER                EQU $3a
+SPRITE_FISHING_GURU          EQU $3b
+SPRITE_SCIENTIST             EQU $3c
+SPRITE_KIMONO_GIRL           EQU $3d
+SPRITE_SAGE                  EQU $3e
+SPRITE_UNUSED_GUY            EQU $3f
+SPRITE_GENTLEMAN             EQU $40
+SPRITE_BLACK_BELT            EQU $41
+SPRITE_RECEPTIONIST          EQU $42
+SPRITE_OFFICER               EQU $43
+SPRITE_CAL                   EQU $44
+SPRITE_SLOWPOKE              EQU $45
+SPRITE_CAPTAIN               EQU $46
+SPRITE_BIG_LAPRAS            EQU $47
+SPRITE_GYM_GUY               EQU $48
+SPRITE_SAILOR                EQU $49
+SPRITE_BIKER                 EQU $4a
+SPRITE_PHARMACIST            EQU $4b
+SPRITE_MONSTER               EQU $4c
+SPRITE_FAIRY                 EQU $4d
+SPRITE_BIRD                  EQU $4e
+SPRITE_DRAGON                EQU $4f
+SPRITE_BIG_ONIX              EQU $50
+SPRITE_N64                   EQU $51
+SPRITE_SUDOWOODO             EQU $52
+SPRITE_SURF                  EQU $53
+SPRITE_POKE_BALL             EQU $54
+SPRITE_POKEDEX               EQU $55
+SPRITE_PAPER                 EQU $56
+SPRITE_VIRTUAL_BOY           EQU $57
+SPRITE_OLD_LINK_RECEPTIONIST EQU $58
+SPRITE_ROCK                  EQU $59
+SPRITE_BOULDER               EQU $5a
+SPRITE_SNES                  EQU $5b
+SPRITE_FAMICOM               EQU $5c
+SPRITE_FRUIT_TREE            EQU $5d
+SPRITE_GOLD_TROPHY           EQU $5e
+SPRITE_SILVER_TROPHY         EQU $5f
+SPRITE_KRIS                  EQU $60
+SPRITE_KRIS_BIKE             EQU $61
+SPRITE_KURT_OUTSIDE          EQU $62
+SPRITE_SUICUNE               EQU $63
+SPRITE_ENTEI                 EQU $64
+SPRITE_RAIKOU                EQU $65
+SPRITE_STANDING_YOUNGSTER    EQU $66
+
+SPRITE_POKEMON EQU $80
+SPRITE_UNOWN      EQU $80
+SPRITE_GEODUDE    EQU $81
+SPRITE_GROWLITHE  EQU $82
+SPRITE_WEEDLE     EQU $83
+SPRITE_SHELLDER   EQU $84
+SPRITE_ODDISH     EQU $85
+SPRITE_GENGAR     EQU $86
+SPRITE_ZUBAT      EQU $87
+SPRITE_MAGIKARP   EQU $88
+SPRITE_SQUIRTLE   EQU $89
+SPRITE_TOGEPI     EQU $8a
+SPRITE_BUTTERFREE EQU $8b
+SPRITE_DIGLETT    EQU $8c
+SPRITE_POLIWAG    EQU $8d
+SPRITE_PIKACHU    EQU $8e
+SPRITE_CLEFAIRY   EQU $8f
+SPRITE_CHARMANDER EQU $90
+SPRITE_JYNX       EQU $91
+SPRITE_STARMIE    EQU $92
+SPRITE_BULBASAUR  EQU $93
+SPRITE_JIGGLYPUFF EQU $94
+SPRITE_GRIMER     EQU $95
+SPRITE_EKANS      EQU $96
+SPRITE_PARAS      EQU $97
+SPRITE_TENTACOOL  EQU $98
+SPRITE_TAUROS     EQU $99
+SPRITE_MACHOP     EQU $9a
+SPRITE_VOLTORB    EQU $9b
+SPRITE_LAPRAS     EQU $9c
+SPRITE_RHYDON     EQU $9d
+SPRITE_MOLTRES    EQU $9e
+SPRITE_SNORLAX    EQU $9f
+SPRITE_GYARADOS   EQU $a0
+SPRITE_LUGIA      EQU $a1
+SPRITE_HO_OH      EQU $a2
+
+SPRITE_DAYCARE_MON_1 EQU $e0
+SPRITE_DAYCARE_MON_2 EQU $e1
+
+SPRITE_VARS EQU $f0
+SPRITE_CONSOLE EQU $f0
+SPRITE_DOLL_1 EQU $f1
+SPRITE_DOLL_2 EQU $f2
+SPRITE_BIG_DOLL EQU $f3
+SPRITE_WEIRD_TREE EQU $f4
+SPRITE_OLIVINE_RIVAL EQU $f5
+SPRITE_AZALEA_ROCKET EQU $f6
+SPRITE_FUSCHIA_GYM_1 EQU $f7
+SPRITE_FUSCHIA_GYM_2 EQU $f8
+SPRITE_FUSCHIA_GYM_3 EQU $f9
+SPRITE_FUSCHIA_GYM_4 EQU $fa
+SPRITE_COPYCAT EQU $fb
+
--- a/main.asm
+++ b/main.asm
@@ -8756,8 +8756,10 @@
 
 SECTION "bank5",DATA,BANK[$5]
 
+
 INCBIN "baserom.gbc", $14000, $14032 - $14000
 
+
 GetTimeOfDay: ; 14032
 ; get time of day based on the current hour
 	ld a, [hHours] ; hour
@@ -8791,8 +8793,1022 @@
 	db 24, NITE
 ; 1404c
 
-INCBIN "baserom.gbc", $1404c, $152ab - $1404c
 
+INCBIN "baserom.gbc", $1404c, $14183 - $1404c
+
+
+GetPlayerSprite: ; 14183
+; Get Chris or Kris's sprite.
+
+	ld hl, .Chris
+	ld a, [$d45b]
+	bit 2, a
+	jr nz, .go
+	ld a, [PlayerGender]
+	bit 0, a
+	jr z, .go
+	ld hl, .Kris
+
+.go
+	ld a, [PlayerState]
+	ld c, a
+.loop
+	ld a, [hli]
+	cp c
+	jr z, .asm_141ac
+	inc hl
+	cp $ff
+	jr nz, .loop
+
+; Any player state not in the array defaults to Chris's sprite.
+	xor a ; ld a, PLAYER_NORMAL
+	ld [PlayerState], a
+	ld a, SPRITE_CHRIS
+	jr .asm_141ad
+
+.asm_141ac
+	ld a, [hl]
+
+.asm_141ad
+	ld [UsedSprites + 0], a
+	ld [$d4d6], a
+	ld [$d71f], a
+	ret
+
+.Chris
+	db PLAYER_NORMAL, SPRITE_CHRIS
+	db PLAYER_BIKE, SPRITE_CHRIS_BIKE
+	db PLAYER_SURF, SPRITE_SURF
+	db PLAYER_SURF_PIKA, SPRITE_SURFING_PIKACHU
+	db $ff
+
+.Kris
+	db PLAYER_NORMAL, SPRITE_KRIS
+	db PLAYER_BIKE, SPRITE_KRIS_BIKE
+	db PLAYER_SURF, SPRITE_SURF
+	db PLAYER_SURF_PIKA, SPRITE_SURFING_PIKACHU
+	db $ff
+; 141c9
+
+
+; 141c9
+	call $2c8a
+	call $22ee
+	jr z, .outdoor
+
+	call IndoorSpriteGFX
+	ret
+
+.outdoor
+	call OutdoorSpriteGFX
+	ret
+; 141d9
+
+
+IndoorSpriteGFX: ; 141d9
+	ld hl, MapObjects + 1 * OBJECT_LENGTH + 1 ; sprite
+	ld a, 1
+.loop
+	push af
+	ld a, [hl]
+	call AddSpriteGFX
+	ld de, OBJECT_LENGTH
+	add hl, de
+	pop af
+	inc a
+	cp NUM_OBJECTS
+	jr nz, .loop
+	ret
+; 141ee
+
+
+OutdoorSpriteGFX: ; 141ee
+	ld a, [MapGroup]
+	dec a
+	ld c, a
+	ld b, 0
+	ld hl, OutdoorSprites
+	add hl, bc
+	add hl, bc
+	ld a, [hli]
+	ld h, [hl]
+	ld l, a
+	ld c, $17
+.loop
+	push bc
+	ld a, [hli]
+	call AddSpriteGFX
+	pop bc
+	dec c
+	jr nz, .loop
+	ret
+; 14209
+
+
+INCBIN "baserom.gbc", $14209, $1423c - $14209
+
+
+GetSprite: ; 1423c
+	call GetMonSprite
+	ret c
+
+	ld hl, $4736
+	dec a
+	ld c, a
+	ld b, 0
+	ld a, 6
+	call AddNTimes
+	ld a, [hli]
+	ld e, a
+	ld a, [hli]
+	ld d, a
+	ld a, [hli]
+	swap a
+	ld c, a
+	ld b, [hl]
+	ld a, [hli]
+	ld l, [hl]
+	ld h, a
+	ret
+; 14259
+
+
+GetMonSprite: ; 14259
+; Return carry if a monster sprite was loaded.
+
+	cp SPRITE_POKEMON
+	jr c, .Normal
+	cp SPRITE_DAYCARE_MON_1
+	jr z, .BreedMon1
+	cp SPRITE_DAYCARE_MON_2
+	jr z, .BreedMon2
+	cp SPRITE_VARS
+	jr nc, .Variable
+	jr .Icon
+
+.Normal
+	and a
+	ret
+
+.Icon
+	sub SPRITE_POKEMON
+	ld e, a
+	ld d, 0
+	ld hl, SpriteMons
+	add hl, de
+	ld a, [hl]
+	jr .Mon
+
+.BreedMon1
+	ld a, [BreedMon1Species]
+	jr .Mon
+
+.BreedMon2
+	ld a, [BreedMon2Species]
+
+.Mon
+	ld e, a
+	and a
+	jr z, .asm_1429f
+
+	ld a, $23
+	ld hl, $682b
+	rst FarCall ; callba LoadMonSprite
+
+	ld l, 1
+	ld h, 0
+	scf
+	ret
+
+.Variable
+	sub SPRITE_VARS
+	ld e, a
+	ld d, 0
+	ld hl, VariableSprites
+	add hl, de
+	ld a, [hl]
+	and a
+	jp nz, GetMonSprite
+
+.asm_1429f
+	ld a, 1
+	ld l, 1
+	ld h, 0
+	and a
+	ret
+; 142a7
+
+
+INCBIN "baserom.gbc", $142a7, $142e5 - $142a7
+
+
+AddSpriteGFX: ; 142e5
+; Add any new sprite ids to a list of graphics to be loaded.
+; Return carry if the list is full.
+
+	push hl
+	push bc
+	ld b, a
+	ld hl, UsedSprites + 2
+	ld c, $1f
+.loop
+	ld a, [hl]
+	cp b
+	jr z, .exists
+	and a
+	jr z, .new
+	inc hl
+	inc hl
+	dec c
+	jr nz, .loop
+
+	pop bc
+	pop hl
+	scf
+	ret
+
+.exists
+	pop bc
+	pop hl
+	and a
+	ret
+
+.new
+	ld [hl], b
+	pop bc
+	pop hl
+	and a
+	ret
+; 14306
+
+
+LoadSpriteGFX: ; 14306
+
+	ld hl, UsedSprites
+	ld b, $20
+.loop
+	ld a, [hli]
+	and a
+	jr z, .done
+	push hl
+	call .LoadSprite
+	pop hl
+	ld [hli], a
+	dec b
+	jr nz, .loop
+
+.done
+	ret
+
+.LoadSprite
+	call GetSprite
+	ld a, l
+	ret
+; 1431e
+
+
+INCBIN "baserom.gbc", $1431e, $14495 - $1431e
+
+
+SpriteMons: ; 14495
+	db UNOWN
+	db GEODUDE
+	db GROWLITHE
+	db WEEDLE
+	db SHELLDER
+	db ODDISH
+	db GENGAR
+	db ZUBAT
+	db MAGIKARP
+	db SQUIRTLE
+	db TOGEPI
+	db BUTTERFREE
+	db DIGLETT
+	db POLIWAG
+	db PIKACHU
+	db CLEFAIRY
+	db CHARMANDER
+	db JYNX
+	db STARMIE
+	db BULBASAUR
+	db JIGGLYPUFF
+	db GRIMER
+	db EKANS
+	db PARAS
+	db TENTACOOL
+	db TAUROS
+	db MACHOP
+	db VOLTORB
+	db LAPRAS
+	db RHYDON
+	db MOLTRES
+	db SNORLAX
+	db GYARADOS
+	db LUGIA
+	db HO_OH
+; 144b8
+	
+
+OutdoorSprites: ; 144b8
+; Valid sprite IDs for each map group.
+
+	dw Group1Sprites
+	dw Group2Sprites
+	dw Group3Sprites
+	dw Group4Sprites
+	dw Group5Sprites
+	dw Group6Sprites
+	dw Group7Sprites
+	dw Group8Sprites
+	dw Group9Sprites
+	dw Group10Sprites
+	dw Group11Sprites
+	dw Group12Sprites
+	dw Group13Sprites
+	dw Group14Sprites
+	dw Group15Sprites
+	dw Group16Sprites
+	dw Group17Sprites
+	dw Group18Sprites
+	dw Group19Sprites
+	dw Group20Sprites
+	dw Group21Sprites
+	dw Group22Sprites
+	dw Group23Sprites
+	dw Group24Sprites
+	dw Group25Sprites
+	dw Group26Sprites
+; 144ec
+
+
+Group13Sprites: ; 144ec
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_BIG_LAPRAS
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_TEACHER
+	db SPRITE_FISHER
+	db SPRITE_YOUNGSTER
+	db SPRITE_BLUE
+	db SPRITE_GRAMPS
+	db SPRITE_BUG_CATCHER
+	db SPRITE_COOLTRAINER_F
+	db SPRITE_SWIMMER_GIRL
+	db SPRITE_SWIMMER_GUY
+	db SPRITE_POKE_BALL
+	db SPRITE_FRUIT_TREE
+; 14503
+
+Group23Sprites: ; 14503
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_BIG_LAPRAS
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_TEACHER
+	db SPRITE_FISHER
+	db SPRITE_YOUNGSTER
+	db SPRITE_BLUE
+	db SPRITE_GRAMPS
+	db SPRITE_BUG_CATCHER
+	db SPRITE_COOLTRAINER_F
+	db SPRITE_SWIMMER_GIRL
+	db SPRITE_SWIMMER_GUY
+	db SPRITE_POKE_BALL
+	db SPRITE_FRUIT_TREE
+; 1451a
+
+Group14Sprites: ; 1451a
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_BIG_LAPRAS
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_TEACHER
+	db SPRITE_FISHER
+	db SPRITE_YOUNGSTER
+	db SPRITE_BLUE
+	db SPRITE_GRAMPS
+	db SPRITE_BUG_CATCHER
+	db SPRITE_COOLTRAINER_F
+	db SPRITE_SWIMMER_GIRL
+	db SPRITE_SWIMMER_GUY
+	db SPRITE_POKE_BALL
+	db SPRITE_FRUIT_TREE
+; 14531
+
+Group6Sprites: ; 14531
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_BIG_LAPRAS
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_TEACHER
+	db SPRITE_FISHER
+	db SPRITE_YOUNGSTER
+	db SPRITE_BLUE
+	db SPRITE_GRAMPS
+	db SPRITE_BUG_CATCHER
+	db SPRITE_COOLTRAINER_F
+	db SPRITE_SWIMMER_GIRL
+	db SPRITE_SWIMMER_GUY
+	db SPRITE_POKE_BALL
+	db SPRITE_FRUIT_TREE
+; 14548
+
+Group7Sprites: ; 14548
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_BIG_LAPRAS
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_COOLTRAINER_M
+	db SPRITE_SUPER_NERD
+	db SPRITE_COOLTRAINER_F
+	db SPRITE_FISHER
+	db SPRITE_YOUNGSTER
+	db SPRITE_LASS
+	db SPRITE_POKEFAN_M
+	db SPRITE_ROCKET
+	db SPRITE_MISTY
+	db SPRITE_POKE_BALL
+	db SPRITE_SLOWPOKE
+; 1455f
+
+Group25Sprites: ; 1455f
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_BIG_LAPRAS
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_COOLTRAINER_M
+	db SPRITE_SUPER_NERD
+	db SPRITE_COOLTRAINER_F
+	db SPRITE_FISHER
+	db SPRITE_YOUNGSTER
+	db SPRITE_LASS
+	db SPRITE_POKEFAN_M
+	db SPRITE_ROCKET
+	db SPRITE_MISTY
+	db SPRITE_POKE_BALL
+	db SPRITE_SLOWPOKE
+; 14576
+
+Group21Sprites: ; 14576
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_BIG_LAPRAS
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_FISHER
+	db SPRITE_POLIWAG
+	db SPRITE_TEACHER
+	db SPRITE_GRAMPS
+	db SPRITE_YOUNGSTER
+	db SPRITE_LASS
+	db SPRITE_BIKER
+	db SPRITE_SILVER
+	db SPRITE_BLUE
+	db SPRITE_POKE_BALL
+	db SPRITE_FRUIT_TREE
+; 1458d
+
+Group18Sprites: ; 1458d
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_BIG_LAPRAS
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_POKEFAN_M
+	db SPRITE_MACHOP
+	db SPRITE_GRAMPS
+	db SPRITE_YOUNGSTER
+	db SPRITE_FISHER
+	db SPRITE_TEACHER
+	db SPRITE_SUPER_NERD
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_BIKER
+	db SPRITE_POKE_BALL
+	db SPRITE_FRUIT_TREE
+; 145a4
+
+Group12Sprites: ; 145a4
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_BIG_LAPRAS
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_POKEFAN_M
+	db SPRITE_MACHOP
+	db SPRITE_GRAMPS
+	db SPRITE_YOUNGSTER
+	db SPRITE_FISHER
+	db SPRITE_TEACHER
+	db SPRITE_SUPER_NERD
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_BIKER
+	db SPRITE_POKE_BALL
+	db SPRITE_FRUIT_TREE
+; 145bb
+
+Group17Sprites: ; 145bb
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_BIG_LAPRAS
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_POKEFAN_M
+	db SPRITE_MACHOP
+	db SPRITE_GRAMPS
+	db SPRITE_YOUNGSTER
+	db SPRITE_FISHER
+	db SPRITE_TEACHER
+	db SPRITE_SUPER_NERD
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_BIKER
+	db SPRITE_POKE_BALL
+	db SPRITE_FRUIT_TREE
+; 145d2
+
+Group16Sprites: ; 145d2
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_BIG_LAPRAS
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_POKEFAN_M
+	db SPRITE_BUENA
+	db SPRITE_GRAMPS
+	db SPRITE_YOUNGSTER
+	db SPRITE_FISHER
+	db SPRITE_TEACHER
+	db SPRITE_SUPER_NERD
+	db SPRITE_MACHOP
+	db SPRITE_BIKER
+	db SPRITE_POKE_BALL
+	db SPRITE_BOULDER
+; 145e9
+
+Group24Sprites: ; 145e9
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_BIG_LAPRAS
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_SILVER
+	db SPRITE_TEACHER
+	db SPRITE_FISHER
+	db SPRITE_COOLTRAINER_M
+	db SPRITE_YOUNGSTER
+	db SPRITE_MONSTER
+	db SPRITE_GRAMPS
+	db SPRITE_BUG_CATCHER
+	db SPRITE_COOLTRAINER_F
+	db SPRITE_POKE_BALL
+	db SPRITE_FRUIT_TREE
+; 14600
+
+Group26Sprites: ; 14600
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_BIG_LAPRAS
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_SILVER
+	db SPRITE_TEACHER
+	db SPRITE_FISHER
+	db SPRITE_COOLTRAINER_M
+	db SPRITE_YOUNGSTER
+	db SPRITE_MONSTER
+	db SPRITE_GRAMPS
+	db SPRITE_BUG_CATCHER
+	db SPRITE_COOLTRAINER_F
+	db SPRITE_POKE_BALL
+	db SPRITE_FRUIT_TREE
+; 14617
+
+Group19Sprites: ; 14617
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_BIG_LAPRAS
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_SILVER
+	db SPRITE_TEACHER
+	db SPRITE_FISHER
+	db SPRITE_COOLTRAINER_M
+	db SPRITE_YOUNGSTER
+	db SPRITE_MONSTER
+	db SPRITE_GRAMPS
+	db SPRITE_BUG_CATCHER
+	db SPRITE_COOLTRAINER_F
+	db SPRITE_POKE_BALL
+	db SPRITE_FRUIT_TREE
+; 1462e
+
+Group10Sprites: ; 1462e
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_BIG_LAPRAS
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_FISHER
+	db SPRITE_LASS
+	db SPRITE_OFFICER
+	db SPRITE_GRAMPS
+	db SPRITE_YOUNGSTER
+	db SPRITE_COOLTRAINER_M
+	db SPRITE_BUG_CATCHER
+	db SPRITE_SUPER_NERD
+	db SPRITE_WEIRD_TREE
+	db SPRITE_POKE_BALL
+	db SPRITE_FRUIT_TREE
+; 14645
+
+Group4Sprites: ; 14645
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_BIG_LAPRAS
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_FISHER
+	db SPRITE_LASS
+	db SPRITE_OFFICER
+	db SPRITE_GRAMPS
+	db SPRITE_YOUNGSTER
+	db SPRITE_COOLTRAINER_M
+	db SPRITE_BUG_CATCHER
+	db SPRITE_SUPER_NERD
+	db SPRITE_WEIRD_TREE
+	db SPRITE_POKE_BALL
+	db SPRITE_FRUIT_TREE
+; 1465c
+
+Group8Sprites: ; 1465c
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_KURT_OUTSIDE
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_GRAMPS
+	db SPRITE_YOUNGSTER
+	db SPRITE_OFFICER
+	db SPRITE_POKEFAN_M
+	db SPRITE_BLACK_BELT
+	db SPRITE_TEACHER
+	db SPRITE_AZALEA_ROCKET
+	db SPRITE_LASS
+	db SPRITE_SILVER
+	db SPRITE_FRUIT_TREE
+	db SPRITE_SLOWPOKE
+; 14673
+
+Group11Sprites: ; 14673
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_POKE_BALL
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_BIG_LAPRAS
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_GRAMPS
+	db SPRITE_YOUNGSTER
+	db SPRITE_OFFICER
+	db SPRITE_POKEFAN_M
+	db SPRITE_DAYCARE_MON_1
+	db SPRITE_COOLTRAINER_F
+	db SPRITE_ROCKET
+	db SPRITE_LASS
+	db SPRITE_DAYCARE_MON_2
+	db SPRITE_FRUIT_TREE
+	db SPRITE_SLOWPOKE
+; 1468a
+
+Group22Sprites: ; 1468a
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_STANDING_YOUNGSTER
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_OLIVINE_RIVAL
+	db SPRITE_POKEFAN_M
+	db SPRITE_LASS
+	db SPRITE_BUENA
+	db SPRITE_SWIMMER_GIRL
+	db SPRITE_SAILOR
+	db SPRITE_POKEFAN_F
+	db SPRITE_SUPER_NERD
+	db SPRITE_TAUROS
+	db SPRITE_FRUIT_TREE
+	db SPRITE_ROCK
+; 146a1
+
+Group1Sprites: ; 146a1
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_STANDING_YOUNGSTER
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_OLIVINE_RIVAL
+	db SPRITE_POKEFAN_M
+	db SPRITE_LASS
+	db SPRITE_BUENA
+	db SPRITE_SWIMMER_GIRL
+	db SPRITE_SAILOR
+	db SPRITE_POKEFAN_F
+	db SPRITE_SUPER_NERD
+	db SPRITE_TAUROS
+	db SPRITE_FRUIT_TREE
+	db SPRITE_ROCK
+; 146b8
+
+Group9Sprites: ; 146b8
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_BIG_LAPRAS
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_LANCE
+	db SPRITE_GRAMPS
+	db SPRITE_SUPER_NERD
+	db SPRITE_COOLTRAINER_F
+	db SPRITE_FISHER
+	db SPRITE_COOLTRAINER_M
+	db SPRITE_LASS
+	db SPRITE_YOUNGSTER
+	db SPRITE_GYARADOS
+	db SPRITE_FRUIT_TREE
+	db SPRITE_POKE_BALL
+; 146cf
+
+Group2Sprites: ; 146cf
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_BIG_LAPRAS
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_GRAMPS
+	db SPRITE_YOUNGSTER
+	db SPRITE_LASS
+	db SPRITE_SUPER_NERD
+	db SPRITE_COOLTRAINER_M
+	db SPRITE_POKEFAN_M
+	db SPRITE_BLACK_BELT
+	db SPRITE_COOLTRAINER_F
+	db SPRITE_FISHER
+	db SPRITE_FRUIT_TREE
+	db SPRITE_POKE_BALL
+; 146e6
+
+Group5Sprites: ; 146e6
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_BIG_LAPRAS
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_GRAMPS
+	db SPRITE_YOUNGSTER
+	db SPRITE_LASS
+	db SPRITE_SUPER_NERD
+	db SPRITE_COOLTRAINER_M
+	db SPRITE_POKEFAN_M
+	db SPRITE_BLACK_BELT
+	db SPRITE_COOLTRAINER_F
+	db SPRITE_FISHER
+	db SPRITE_FRUIT_TREE
+	db SPRITE_POKE_BALL
+; 146fd
+
+Group3Sprites: ; 146fd
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_GAMEBOY_KID
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_LASS
+	db SPRITE_POKEFAN_F
+	db SPRITE_TEACHER
+	db SPRITE_YOUNGSTER
+	db SPRITE_GROWLITHE
+	db SPRITE_POKEFAN_M
+	db SPRITE_ROCKER
+	db SPRITE_FISHER
+	db SPRITE_SCIENTIST
+	db SPRITE_POKE_BALL
+	db SPRITE_BOULDER
+; 14714
+
+Group15Sprites: ; 14714
+	db SPRITE_SUICUNE
+	db SPRITE_SILVER_TROPHY
+	db SPRITE_FAMICOM
+	db SPRITE_POKEDEX
+	db SPRITE_WILL
+	db SPRITE_KAREN
+	db SPRITE_NURSE
+	db SPRITE_OLD_LINK_RECEPTIONIST
+	db SPRITE_BIG_LAPRAS
+	db SPRITE_BIG_ONIX
+	db SPRITE_SUDOWOODO
+	db SPRITE_BIG_SNORLAX
+	db SPRITE_SAILOR
+	db SPRITE_FISHING_GURU
+	db SPRITE_GENTLEMAN
+	db SPRITE_SUPER_NERD
+	db SPRITE_HO_OH
+	db SPRITE_TEACHER
+	db SPRITE_COOLTRAINER_F
+	db SPRITE_YOUNGSTER
+	db SPRITE_FAIRY
+	db SPRITE_POKE_BALL
+	db SPRITE_ROCK
+; 1472b
+
+Group20Sprites: ; 1472b
+	db SPRITE_OAK
+	db SPRITE_FISHER
+	db SPRITE_TEACHER
+	db SPRITE_TWIN
+	db SPRITE_POKEFAN_M
+	db SPRITE_GRAMPS
+	db SPRITE_FAIRY
+	db SPRITE_SILVER
+	db SPRITE_FISHING_GURU
+	db SPRITE_POKE_BALL
+	db SPRITE_POKEDEX
+; 14736
+
+
+INCBIN "baserom.gbc", $14736, $152ab - $14736
+
+
 BlackoutPoints: ; 0x152ab
 	db GROUP_KRISS_HOUSE_2F, MAP_KRISS_HOUSE_2F, 3, 3
 	db GROUP_VIRIDIAN_POKECENTER_1F, MAP_VIRIDIAN_POKECENTER_1F, 5, 3 ; unused
@@ -14992,7 +16008,7 @@
 	push bc
 	ld a, PLAYER_NORMAL
 	ld [PlayerState], a
-	call $e4a ; GetPlayerSprite
+	call $e4a ; UpdateSprites
 	pop bc
 	ret
 ; 80404
--- a/wram.asm
+++ b/wram.asm
@@ -1082,6 +1082,10 @@
 	ds 1
 
 
+SECTION "UsedSprites",BSS[$d154]
+UsedSprites: ; d154
+	ds 32
+
 SECTION "connections",BSS[$d1a9]
 
 MapConnections:
@@ -1658,6 +1662,11 @@
 	ds OBJECT_LENGTH * NUM_OBJECTS
 
 
+SECTION "VariableSprites",BSS[$d82e]
+VariableSprites: ; d82e
+	ds $10
+
+
 SECTION "Status",BSS[$d841]
 TimeOfDayPal: ; d841
 	ds 1
@@ -1985,7 +1994,7 @@
 BreedMon1OT: ; df01
 	ds 11
 BreedMon1Stats:
-Breedmon1Species: ; df0c
+BreedMon1Species: ; df0c
 	ds 1
 	ds 31