Merge pull request #184 from Pokeglitch/intro-updates

Updated the intro
This commit is contained in:
Daniel Harding 2018-06-26 22:09:09 -05:00 committed by GitHub
commit 6ba3765c59
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 89 additions and 63 deletions

View file

@ -22,14 +22,6 @@ JOYPAD EQU 4
LY_VBLANK EQU 145 LY_VBLANK EQU 145
; OAM attribute flags
OAM_PALETTE EQU %111
OAM_TILE_BANK EQU 3
OAM_OBP_NUM EQU 4 ; Non CGB Mode Only
OAM_X_FLIP EQU 5
OAM_Y_FLIP EQU 6
OAM_PRIORITY EQU 7 ; 0: OBJ above BG, 1: OBJ behind BG (colors 1-3)
; serial ; serial
START_TRANSFER_EXTERNAL_CLOCK EQU $80 START_TRANSFER_EXTERNAL_CLOCK EQU $80
START_TRANSFER_INTERNAL_CLOCK EQU $81 START_TRANSFER_INTERNAL_CLOCK EQU $81

View file

@ -45,6 +45,8 @@ SCREEN_HEIGHT EQU 18
SCREEN_WIDTH_PIXELS EQU SCREEN_WIDTH * 8 SCREEN_WIDTH_PIXELS EQU SCREEN_WIDTH * 8
SCREEN_HEIGHT_PIXELS EQU SCREEN_HEIGHT * 8 SCREEN_HEIGHT_PIXELS EQU SCREEN_HEIGHT * 8
BYTES_PER_TILE EQU 16
BG_MAP_WIDTH EQU 32 BG_MAP_WIDTH EQU 32
BG_MAP_HEIGHT EQU 32 BG_MAP_HEIGHT EQU 32

View file

@ -5,5 +5,14 @@ OAMFLAG_VFLIPPED EQU %00100000 ; OAM flag flips the sprite vertically.
; Used for making left facing sprites face right and to alternate between left and right foot animation when walking up or down ; Used for making left facing sprites face right and to alternate between left and right foot animation when walking up or down
; OAM attribute flags ; OAM attribute flags
OAM_HFLIP EQU %00100000 ; horizontal flip OAM_PALETTE EQU %111
OAM_VFLIP EQU %01000000 ; vertical flip OAM_TILE_BANK EQU 3
OAM_OBP_NUM EQU 4 ; Non CGB Mode Only
OAM_X_FLIP EQU 5
OAM_Y_FLIP EQU 6
OAM_PRIORITY EQU 7 ; 0: OBJ above BG, 1: OBJ behind BG (colors 1-3)
; OAM attribute masks
OAM_HFLIP EQU 1 << OAM_X_FLIP ; horizontal flip
OAM_VFLIP EQU 1 << OAM_Y_FLIP ; vertical flip
OAM_BEHIND_BG EQU 1 << OAM_PRIORITY ; behind bg (except color 0)

View file

@ -1,3 +1,10 @@
; monochrome palette color ids
const_def
const WHITE
const LIGHT_GRAY
const DARK_GRAY
const BLACK
SET_PAL_BATTLE_BLACK EQU $00 SET_PAL_BATTLE_BLACK EQU $00
SET_PAL_BATTLE EQU $01 SET_PAL_BATTLE EQU $01
SET_PAL_TOWN_MAP EQU $02 SET_PAL_TOWN_MAP EQU $02

View file

@ -2588,21 +2588,21 @@ CopyTileIDs:
TileIDListPointerTable: TileIDListPointerTable:
dw Unknown_79b24 dw Unknown_79b24
db $77 dn 7, 7
dw Unknown_79b55 dw Unknown_79b55
db $57 dn 5, 7
dw Unknown_79b78 dw Unknown_79b78
db $37 dn 3, 7
dw Unknown_79b8d dw GengarIntroTiles1
db $77 dn 7, 7
dw Unknown_79bbe dw GengarIntroTiles2
db $77 dn 7, 7
dw Unknown_79bef dw GengarIntroTiles3
db $77 dn 7, 7
dw Unknown_79c20 dw Unknown_79c20
db $86 dn 8, 6
dw Unknown_79c50 dw Unknown_79c50
db $3C dn 3, 12
DownscaledMonTiles_5x5: DownscaledMonTiles_5x5:
db $31,$38,$46,$54,$5B db $31,$38,$46,$54,$5B
@ -2637,7 +2637,7 @@ Unknown_79b78:
db $02,$09,$10,$17,$1E,$25,$2C db $02,$09,$10,$17,$1E,$25,$2C
db $04,$0B,$12,$19,$20,$27,$2E db $04,$0B,$12,$19,$20,$27,$2E
Unknown_79b8d: GengarIntroTiles1:
db $00,$00,$00,$00,$00,$00,$00 db $00,$00,$00,$00,$00,$00,$00
db $00,$00,$00,$00,$00,$19,$00 db $00,$00,$00,$00,$00,$19,$00
db $02,$06,$0B,$10,$14,$1A,$00 db $02,$06,$0B,$10,$14,$1A,$00
@ -2646,7 +2646,7 @@ Unknown_79b8d:
db $04,$09,$0E,$13,$17,$1D,$1F db $04,$09,$0E,$13,$17,$1D,$1F
db $05,$0A,$0F,$01,$18,$1E,$20 db $05,$0A,$0F,$01,$18,$1E,$20
Unknown_79bbe: GengarIntroTiles2:
db $00,$00,$00,$30,$00,$37,$00 db $00,$00,$00,$30,$00,$37,$00
db $00,$00,$2B,$31,$34,$38,$3D db $00,$00,$2B,$31,$34,$38,$3D
db $21,$26,$2C,$01,$35,$39,$3E db $21,$26,$2C,$01,$35,$39,$3E
@ -2655,7 +2655,7 @@ Unknown_79bbe:
db $24,$29,$2F,$01,$01,$3B,$00 db $24,$29,$2F,$01,$01,$3B,$00
db $25,$2A,$01,$01,$01,$3C,$00 db $25,$2A,$01,$01,$01,$3C,$00
Unknown_79bef: GengarIntroTiles3:
db $00,$00,$00,$00,$00,$00,$00 db $00,$00,$00,$00,$00,$00,$00
db $00,$00,$47,$4D,$00,$00,$00 db $00,$00,$47,$4D,$00,$00,$00
db $00,$00,$48,$4E,$52,$56,$5B db $00,$00,$48,$4E,$52,$56,$5B

View file

@ -1,6 +1,14 @@
MOVE_GENGAR_RIGHT EQU $00 const_value = -1
MOVE_GENGAR_LEFT EQU $01 const MOVE_NIDORINO_RIGHT
MOVE_NIDORINO_RIGHT EQU $ff const MOVE_GENGAR_RIGHT
const MOVE_GENGAR_LEFT
ANIMATION_END EQU 80
const_value = 3
const GENGAR_INTRO_TILES1
const GENGAR_INTRO_TILES2
const GENGAR_INTRO_TILES3
PlayIntro: PlayIntro:
xor a xor a
@ -20,13 +28,13 @@ PlayIntro:
PlayIntroScene: PlayIntroScene:
ld b, SET_PAL_NIDORINO_INTRO ld b, SET_PAL_NIDORINO_INTRO
call RunPaletteCommand call RunPaletteCommand
ld a, %11100100 ldPal a, BLACK, DARK_GRAY, LIGHT_GRAY, WHITE
ld [rBGP], a ld [rBGP], a
ld [rOBP0], a ld [rOBP0], a
ld [rOBP1], a ld [rOBP1], a
xor a xor a
ld [hSCX], a ld [hSCX], a
ld b, $3 ; Gengar tiles ld b, GENGAR_INTRO_TILES1
call IntroCopyTiles call IntroCopyTiles
ld a, 0 ld a, 0
ld [wBaseCoordX], a ld [wBaseCoordX], a
@ -50,7 +58,7 @@ PlayIntroScene:
call PlaySound call PlaySound
ld de, IntroNidorinoAnimation2 ld de, IntroNidorinoAnimation2
call AnimateIntroNidorino call AnimateIntroNidorino
ld c, $a ld c, 10
call CheckForUserInterruption call CheckForUserInterruption
ret c ret c
@ -64,23 +72,23 @@ PlayIntroScene:
call PlaySound call PlaySound
ld de, IntroNidorinoAnimation2 ld de, IntroNidorinoAnimation2
call AnimateIntroNidorino call AnimateIntroNidorino
ld c, $1e ld c, 30
call CheckForUserInterruption call CheckForUserInterruption
ret c ret c
; raise ; raise
ld b, $4 ld b, GENGAR_INTRO_TILES2
call IntroCopyTiles call IntroCopyTiles
ld a, SFX_INTRO_RAISE ld a, SFX_INTRO_RAISE
call PlaySound call PlaySound
lb de, 8 / 2, MOVE_GENGAR_LEFT lb de, 8 / 2, MOVE_GENGAR_LEFT
call IntroMoveMon call IntroMoveMon
ld c, $1e ld c, 30
call CheckForUserInterruption call CheckForUserInterruption
ret c ret c
; slash ; slash
ld b, $5 ld b, GENGAR_INTRO_TILES3
call IntroCopyTiles call IntroCopyTiles
ld a, SFX_INTRO_CRASH ld a, SFX_INTRO_CRASH
call PlaySound call PlaySound
@ -89,19 +97,19 @@ PlayIntroScene:
; hip ; hip
ld a, SFX_INTRO_HIP ld a, SFX_INTRO_HIP
call PlaySound call PlaySound
ld a, $24 ld a, (FightIntroFrontMon2 - FightIntroFrontMon) / BYTES_PER_TILE
ld [wIntroNidorinoBaseTile], a ld [wIntroNidorinoBaseTile], a
ld de, IntroNidorinoAnimation3 ld de, IntroNidorinoAnimation3
call AnimateIntroNidorino call AnimateIntroNidorino
ld c, $1e ld c, 30
call CheckForUserInterruption call CheckForUserInterruption
ret c ret c
lb de, 8 / 2, MOVE_GENGAR_LEFT lb de, 8 / 2, MOVE_GENGAR_LEFT
call IntroMoveMon call IntroMoveMon
ld b, $3 ld b, GENGAR_INTRO_TILES1
call IntroCopyTiles call IntroCopyTiles
ld c, $3c ld c, 60
call CheckForUserInterruption call CheckForUserInterruption
ret c ret c
@ -117,29 +125,29 @@ PlayIntroScene:
call PlaySound call PlaySound
ld de, IntroNidorinoAnimation5 ld de, IntroNidorinoAnimation5
call AnimateIntroNidorino call AnimateIntroNidorino
ld c, $14 ld c, 20
call CheckForUserInterruption call CheckForUserInterruption
ret c ret c
ld a, $24 ld a, (FightIntroFrontMon2 - FightIntroFrontMon) / BYTES_PER_TILE
ld [wIntroNidorinoBaseTile], a ld [wIntroNidorinoBaseTile], a
ld de, IntroNidorinoAnimation6 ld de, IntroNidorinoAnimation6
call AnimateIntroNidorino call AnimateIntroNidorino
ld c, $1e ld c, 30
call CheckForUserInterruption call CheckForUserInterruption
ret c ret c
; lunge ; lunge
ld a, SFX_INTRO_LUNGE ld a, SFX_INTRO_LUNGE
call PlaySound call PlaySound
ld a, $48 ld a, (FightIntroFrontMon3 - FightIntroFrontMon) / BYTES_PER_TILE
ld [wIntroNidorinoBaseTile], a ld [wIntroNidorinoBaseTile], a
ld de, IntroNidorinoAnimation7 ld de, IntroNidorinoAnimation7
jp AnimateIntroNidorino jp AnimateIntroNidorino
AnimateIntroNidorino: AnimateIntroNidorino:
ld a, [de] ld a, [de]
cp $50 cp ANIMATION_END
ret z ret z
ld [wBaseCoordY], a ld [wBaseCoordY], a
inc de inc de
@ -189,7 +197,7 @@ InitIntroNidorinoOAM:
ld [hli], a ; X ld [hli], a ; X
ld a, d ld a, d
ld [hli], a ; tile ld [hli], a ; tile
ld a, $80 ld a, OAM_BEHIND_BG
ld [hli], a ; attributes ld [hli], a ; attributes
inc d inc d
dec c dec c
@ -204,7 +212,7 @@ InitIntroNidorinoOAM:
IntroClearScreen: IntroClearScreen:
ld hl, vBGMap1 ld hl, vBGMap1
ld bc, $240 ld bc, BG_MAP_WIDTH * SCREEN_HEIGHT
jr IntroClearCommon jr IntroClearCommon
IntroClearMiddleOfScreen: IntroClearMiddleOfScreen:
@ -213,7 +221,7 @@ IntroClearMiddleOfScreen:
ld bc, SCREEN_WIDTH * 10 ld bc, SCREEN_WIDTH * 10
IntroClearCommon: IntroClearCommon:
ld [hl], $0 ld [hl], 0
inc hl inc hl
dec bc dec bc
ld a, b ld a, b
@ -222,7 +230,7 @@ IntroClearCommon:
ret ret
IntroPlaceBlackTiles: IntroPlaceBlackTiles:
ld a, $1 ld a, 1
.loop .loop
ld [hli], a ld [hli], a
dec c dec c
@ -231,11 +239,10 @@ IntroPlaceBlackTiles:
IntroMoveMon: IntroMoveMon:
; d = number of times to move the mon (2 pixels each time) ; d = number of times to move the mon (2 pixels each time)
; e: $00 = move Gengar right, $01 = move Gengar left, $ff = move Nidorino right
ld a, e ld a, e
cp $ff cp MOVE_NIDORINO_RIGHT
jr z, .moveNidorinoRight jr z, .moveNidorinoRight
cp $1 cp MOVE_GENGAR_LEFT
jr z, .moveGengarLeft jr z, .moveGengarLeft
; move Gengar right ; move Gengar right
ld a, [hSCX] ld a, [hSCX]
@ -286,7 +293,7 @@ LoadIntroGraphics:
ld a, BANK(FightIntroBackMon) ld a, BANK(FightIntroBackMon)
call FarCopyData2 call FarCopyData2
ld hl, GameFreakIntro ld hl, GameFreakIntro
ld de, vChars2 + $600 ld de, vChars2 + (FightIntroBackMonEnd - FightIntroBackMon)
ld bc, GameFreakIntroEnd - GameFreakIntro ld bc, GameFreakIntroEnd - GameFreakIntro
ld a, BANK(GameFreakIntro) ld a, BANK(GameFreakIntro)
call FarCopyData2 call FarCopyData2
@ -305,7 +312,7 @@ PlayShootingStar:
ld b, SET_PAL_GAME_FREAK_INTRO ld b, SET_PAL_GAME_FREAK_INTRO
call RunPaletteCommand call RunPaletteCommand
callba LoadCopyrightAndTextBoxTiles callba LoadCopyrightAndTextBoxTiles
ld a, %11100100 ldPal a, BLACK, DARK_GRAY, LIGHT_GRAY, WHITE
ld [rBGP], a ld [rBGP], a
ld c, 180 ld c, 180
call DelayFrames call DelayFrames
@ -348,10 +355,10 @@ IntroDrawBlackBars:
ld c, SCREEN_WIDTH * 4 ld c, SCREEN_WIDTH * 4
call IntroPlaceBlackTiles call IntroPlaceBlackTiles
ld hl, vBGMap1 ld hl, vBGMap1
ld c, $80 ld c, BG_MAP_WIDTH * 4
call IntroPlaceBlackTiles call IntroPlaceBlackTiles
ld hl, vBGMap1 + $1c0 ld hl, vBGMap1 + BG_MAP_WIDTH * 14
ld c, $80 ld c, BG_MAP_WIDTH * 4
jp IntroPlaceBlackTiles jp IntroPlaceBlackTiles
EmptyFunc4: EmptyFunc4:
@ -359,7 +366,7 @@ EmptyFunc4:
IntroNidorinoAnimation0: IntroNidorinoAnimation0:
db 0, 0 db 0, 0
db $50 db ANIMATION_END
IntroNidorinoAnimation1: IntroNidorinoAnimation1:
; This is a sequence of pixel movements for part of the Nidorino animation. This ; This is a sequence of pixel movements for part of the Nidorino animation. This
@ -370,7 +377,7 @@ IntroNidorinoAnimation1:
db -1, 2 db -1, 2
db 1, 2 db 1, 2
db 2, 2 db 2, 2
db $50 ; list terminator db ANIMATION_END
IntroNidorinoAnimation2: IntroNidorinoAnimation2:
; This is a sequence of pixel movements for part of the Nidorino animation. ; This is a sequence of pixel movements for part of the Nidorino animation.
@ -380,7 +387,7 @@ IntroNidorinoAnimation2:
db -1, -2 db -1, -2
db 1, -2 db 1, -2
db 2, -2 db 2, -2
db $50 ; list terminator db ANIMATION_END
IntroNidorinoAnimation3: IntroNidorinoAnimation3:
; This is a sequence of pixel movements for part of the Nidorino animation. ; This is a sequence of pixel movements for part of the Nidorino animation.
@ -390,7 +397,7 @@ IntroNidorinoAnimation3:
db -8, 6 db -8, 6
db 8, 6 db 8, 6
db 12, 6 db 12, 6
db $50 ; list terminator db ANIMATION_END
IntroNidorinoAnimation4: IntroNidorinoAnimation4:
; This is a sequence of pixel movements for part of the Nidorino animation. ; This is a sequence of pixel movements for part of the Nidorino animation.
@ -400,7 +407,7 @@ IntroNidorinoAnimation4:
db -4, -4 db -4, -4
db 4, -4 db 4, -4
db 8, -4 db 8, -4
db $50 ; list terminator db ANIMATION_END
IntroNidorinoAnimation5: IntroNidorinoAnimation5:
; This is a sequence of pixel movements for part of the Nidorino animation. ; This is a sequence of pixel movements for part of the Nidorino animation.
@ -410,7 +417,7 @@ IntroNidorinoAnimation5:
db -4, 4 db -4, 4
db 4, 4 db 4, 4
db 8, 4 db 8, 4
db $50 ; list terminator db ANIMATION_END
IntroNidorinoAnimation6: IntroNidorinoAnimation6:
; This is a sequence of pixel movements for part of the Nidorino animation. ; This is a sequence of pixel movements for part of the Nidorino animation.
@ -419,7 +426,7 @@ IntroNidorinoAnimation6:
db 2, 0 db 2, 0
db 2, 0 db 2, 0
db 0, 0 db 0, 0
db $50 ; list terminator db ANIMATION_END
IntroNidorinoAnimation7: IntroNidorinoAnimation7:
; This is a sequence of pixel movements for part of the Nidorino animation. ; This is a sequence of pixel movements for part of the Nidorino animation.
@ -428,7 +435,7 @@ IntroNidorinoAnimation7:
db -7, -14 db -7, -14
db -6, -12 db -6, -12
db -4, -10 db -4, -10
db $50 ; list terminator db ANIMATION_END
GameFreakIntro: GameFreakIntro:
INCBIN "gfx/gamefreak_intro.2bpp" INCBIN "gfx/gamefreak_intro.2bpp"
@ -444,12 +451,17 @@ FightIntroFrontMon:
IF DEF(_RED) IF DEF(_RED)
INCBIN "gfx/red/intro_nido_1.2bpp" INCBIN "gfx/red/intro_nido_1.2bpp"
FightIntroFrontMon2:
INCBIN "gfx/red/intro_nido_2.2bpp" INCBIN "gfx/red/intro_nido_2.2bpp"
FightIntroFrontMon3:
INCBIN "gfx/red/intro_nido_3.2bpp" INCBIN "gfx/red/intro_nido_3.2bpp"
ENDC ENDC
IF DEF(_BLUE) IF DEF(_BLUE)
INCBIN "gfx/blue/intro_purin_1.2bpp" INCBIN "gfx/blue/intro_purin_1.2bpp"
FightIntroFrontMon2:
INCBIN "gfx/blue/intro_purin_2.2bpp" INCBIN "gfx/blue/intro_purin_2.2bpp"
FightIntroFrontMon3:
INCBIN "gfx/blue/intro_purin_3.2bpp" INCBIN "gfx/blue/intro_purin_3.2bpp"
ENDC ENDC

View file

@ -186,3 +186,7 @@ tx_pre_jump: MACRO
tx_pre_id \1 tx_pre_id \1
jp PrintPredefTextID jp PrintPredefTextID
ENDM ENDM
ldPal: MACRO
ld \1, \2 << 6 | \3 << 4 | \4 << 2 | \5
ENDM