summaryrefslogtreecommitdiff
path: root/eonticket
diff options
context:
space:
mode:
authorHáčky <hatschky@gmail.com>2014-11-21 10:46:12 +0000
committerHáčky <hatschky@gmail.com>2014-11-21 10:46:12 +0000
commit2375d2c8db10447ae301176a2136bcad4bb42bb0 (patch)
tree00ca01a39e7bce0795a10b0c58f33e005ad4ef4c /eonticket
parent92c6af6c354d58d96d9590efee955e449a8f94c3 (diff)
Initial commit
Diffstat (limited to 'eonticket')
-rw-r--r--eonticket/00-C000.asm187
-rw-r--r--eonticket/Makefile24
-rw-r--r--eonticket/eonticket.asm124
-rwxr-xr-xeonticket/ticket.4bpp1
-rw-r--r--eonticket/ticket.pal5
5 files changed, 341 insertions, 0 deletions
diff --git a/eonticket/00-C000.asm b/eonticket/00-C000.asm
new file mode 100644
index 0000000..c90b15d
--- /dev/null
+++ b/eonticket/00-C000.asm
@@ -0,0 +1,187 @@
+INCLUDE "../macros.asm"
+
+SECTION "eonticket",ROM0[$100]
+jp Start
+db $00
+
+TicketSprite: ; 104
+ INCBIN "ticket.4bpp"
+TicketPalette: ; 1604
+ INCLUDE "ticket.pal"
+
+Prologue:
+ db "GameFreak inc."
+ db 0,0,0,0,0,0
+ dd 0
+ Text "e reader" ; no string terminator
+ db 0,0,0,0,$01,$55
+ db 0,0,0,0
+ db REGION_EN
+ db 0
+ db "GameFreak inc."
+ db 0,0
+
+DataPacket: ; 164a
+ Insert_Header REGION_EN
+ db MULTIPLE_DATA
+ INCBIN "eonticket.bin"
+ db 0,0,0 ; padding
+
+INCLUDE "../common/mem_struct.asm"
+
+SpriteData:
+ dw TicketSprite,TicketPalette
+ db $15,$08,$01,$01,$01,$01,$01 ; width 15, height 8
+
+Instructions1: ; 1921
+ db "Link e-Reader to Pokémon Ruby or \n"
+ db "Sapphire and select MYSTERY EVENTS\n"
+ db "on the game's main menu.\n"
+ db "Press the B Button to cancel.\0"
+
+Instructions2: ; 199d
+ db "Press the A Button on the Game Boy\n"
+ db "Advance containing Pokémon Ruby or\n"
+ db "Sapphire to begin sending the EON\n"
+ db "TICKET.\0"
+
+DeliveryInProcess: ; 1a0d
+ db "EON TICKET delivery in Process...\0"
+
+TicketDelivered: ; 1a2f
+ db "EON TICKET delivered!\n"
+ db "\n"
+ db "Press the A Button to resend.\n"
+ db "Press the B Button to cancel.\0"
+
+; this function is subtly different than the one
+; on the Battle e cards, for no apparent reason
+TransferData:
+ LD_IND_HL $1ca2
+ push de
+ ld hl, $bbbb
+ LD_IND_HL Space_1
+ EX_DE_HL
+ LD_IND_HL Space_2
+ API_0C7 Space_1
+
+ wait $01
+ pop hl
+ inc hl
+ ld b, $01
+ call WordShiftRight
+
+ LD_IND_HL $1ca7
+.asm_1aa1
+ LD_HL_IND $1ca7
+ ld a, l
+ or h
+ ret z
+
+ ld hl, $8888
+ LD_IND_HL Space_1
+ ld e, $01
+
+.asm_1aaf
+ ld a, e
+ cp $08
+ jr nc, .asm_1ad9
+
+ push de
+ LD_HL_IND $1ca2
+ ld c, [hl]
+ inc hl
+ ld b, [hl]
+ inc hl
+ LD_IND_HL $1ca2
+ ld l, e
+ ld h, $00
+ add hl, hl
+ ld de, Space_1
+ add hl, de
+ ld [hl], c
+ inc hl
+ ld [hl], b
+ pop de
+ LD_HL_IND $1ca7
+ dec hl
+ LD_IND_HL $1ca7
+ ld a, l
+ or h
+ jr z, .asm_1ad9
+
+ inc e
+ jr .asm_1aaf
+
+.asm_1ad9
+ API_0C7 Space_1
+ wait $01
+ jr .asm_1aa1
+
+Start: ; 1ae2
+ API_121
+
+ CreateCustomSprite SpriteHandlePtr, $80, SpriteData
+ SetSpritePos SpriteHandlePtr, 120, 64
+ SpriteHide SpriteHandlePtr
+
+ CreateRegion RegionHandlePtr, 30, 6, 0, 14, 0, 4
+
+ ld h, a
+ ld l, $00
+ SetTextSize
+
+ API_09B RegionHandlePtr, $0102
+ SetTextColor RegionHandlePtr, 2, 0
+ SetRegionColor RegionHandlePtr, 0
+ SetBackgroundPalette 16, $0040, TicketPalette
+
+ FadeIn 16
+ wait 16
+
+ API $0C6
+
+ DrawText RegionHandlePtr, Instructions1, 8, 4
+
+ API $08D
+
+INCLUDE "../common/wait_for_link.asm"
+
+ SpriteShow SpriteHandlePtr
+
+ DrawText RegionHandlePtr, Instructions2, 8, 4
+ API $08D
+
+ ld a, b
+ nop
+
+UNKNOWN_VALUE EQU $0078
+INCLUDE "../common/wait_for_ready.asm"
+
+ DrawText RegionHandlePtr, DeliveryInProcess, 8, 4
+
+DATA_TRANSFER_LENGTH EQU 6144
+INCLUDE "../common/transfer_data.asm"
+ ld hl, $5fff
+ LD_IND_HL Space_1
+ API_0C7 Space_1
+
+ wait $80
+
+ SpriteHide SpriteHandlePtr
+
+ DrawText RegionHandlePtr, TicketDelivered, 8, 4
+
+ API $08D
+ ld c, a
+ nop
+
+INCLUDE "../common/wrap_up.asm"
+
+INCLUDE "../common/word_shift_right.asm"
+
+EmulatorRAM: ; 1CA2
+ ds 2
+RegionHandlePtr: ds 1 ; 1CA4
+SpriteHandlePtr: ds 2 ; 1CA5
+SomeVar1: ds 2 ; 1CA7 \ No newline at end of file
diff --git a/eonticket/Makefile b/eonticket/Makefile
new file mode 100644
index 0000000..86be2c4
--- /dev/null
+++ b/eonticket/Makefile
@@ -0,0 +1,24 @@
+all: 00-C000.z80
+
+%.tx: %.asm
+ python ../scripts/charmap.py $< $@
+
+00-C000.o: 00-C000.tx eonticket.bin
+ rgbasm -o $@ $<
+eonticket.o: eonticket.tx
+ rgbasm -o $@ $<
+
+%.gbc: %.o
+ rgblink -o $@ $<
+
+# hack to use RGBDS for something other than its intended purpose
+00-C000.z80: 00-C000.gbc
+ dd if=$< of=$@ bs=1 skip=256 count=7074
+# cmp -b ../z80/$@ $@
+eonticket.z80: eonticket.gbc
+ dd if=$< of=$@ bs=1 skip=256 count=631
+eonticket.bin: eonticket.z80
+ python ../scripts/scriptchecksum.py $< $@
+
+clean:
+ rm -f *.tx *.o *.gbc *.z80 *.bin \ No newline at end of file
diff --git a/eonticket/eonticket.asm b/eonticket/eonticket.asm
new file mode 100644
index 0000000..152e9de
--- /dev/null
+++ b/eonticket/eonticket.asm
@@ -0,0 +1,124 @@
+INCLUDE "../macros.asm"
+INCLUDE "../constants/items.asm"
+INCLUDE "../constants/scriptcommands.asm"
+ScriptBaseAddress EQU ($100 - $1E)
+
+SECTION "packet",ROM0[$100]
+
+
+ db IN_GAME_SCRIPT
+ db 8,1 ; Petalburg Gym
+ db 1 ; Norman
+ GBAPTR ScriptBaseAddress, NormanScriptStart
+ GBAPTR ScriptBaseAddress, NormanScriptEnd
+
+
+ db MIX_RECORDS_ITEM
+ db 1 ; ???
+ db 30 ; distribution limit
+ dw EON_TICKET
+
+
+ db INSTANT_SCRIPT
+ GBAPTR ScriptBaseAddress, PreloadScriptStart
+
+
+ db VARIABLE_LENGTH
+GoSeeYourFather:
+ Text "Go see your father at the GYM in\n"
+ Text "PETALBURG.@"
+
+NormanScriptStart:
+ setvirtualaddress NormanScriptStart
+
+ checkitem EON_TICKET, 1
+ compare LASTRESULT, 1
+ virtualgotoif 1, KillScript
+ checkpcitem EON_TICKET, 1
+ compare LASTRESULT, 1
+ virtualgotoif 1, KillScript
+ checkflag $00CE
+ virtualgotoif 1, KillScript
+
+ lock
+ faceplayer
+ virtualmsgbox GoodToSeeYou
+ waitmsg
+ waitkeypress
+
+ checkitemroom EON_TICKET, 1
+ compare LASTRESULT, 0
+ virtualgotoif 1, NoRoomToGive
+
+ copyvarifnotzero $8000, EON_TICKET
+ copyvarifnotzero $8001, 1
+ callstd 0
+ setflag $0853
+ virtualmsgbox AppearsToBeAFerryTicket
+ waitmsg
+ waitkeypress
+ release
+KillScript:
+ killscript
+
+NoRoomToGive:
+ virtualmsgbox KeyItemsPocketIsFull
+ waitmsg
+ waitkeypress
+ release
+ end
+
+; whoever wrote this text obviously wasn’t
+; familiar with R/S’s character set…
+GoodToSeeYou:
+ Text "DAD“\v1! Good to see you!\n"
+ Text "There’s a letter here for you,\v1.@"
+AppearsToBeAFerryTicket:
+ Text "DAD“It appears to be a ferry TICKET.\n"
+ Text "but I’ve never seen one like it before.\l"
+ Text "You should visit LILYCOVE and ask\n"
+ Text "about it there.@"
+KeyItemsPocketIsFull:
+ Text "DAD“\v1’ the KEY ITEMS POCKET in\n"
+ Text "your BAG is full.\p"
+ Text "Move some key items for safekeeping\n"
+ Text "in your PC’ then come see me.@"
+NormanScriptEnd:
+
+
+PreloadScriptStart:
+ setvirtualaddress PreloadScriptStart
+
+ checkitem EON_TICKET, 1
+ compare LASTRESULT, 1
+ virtualgotoif 1, Ineligible
+ checkpcitem EON_TICKET, 1
+ compare LASTRESULT, 1
+ virtualgotoif 1, Ineligible
+ checkflag $00CE
+ virtualgotoif 1, Ineligible
+
+ checkitemroom EON_TICKET, 1
+ compare LASTRESULT, 0
+ virtualgotoif 1, NoRoomForEvent
+
+ virtualloadpointer GoSeeYourFather
+ setbyte 2
+ end
+
+Ineligible:
+ virtualloadpointer MayBeplayedOnlyOnce
+ setbyte 3
+ end
+
+NoRoomForEvent:
+ virtualloadpointer BagsKeyItemsPocketFull
+ setbyte 3
+ end
+
+; …or with the English language.
+MayBeplayedOnlyOnce:
+ Text "This EVENT may beplayed only once.@"
+
+BagsKeyItemsPocketFull:
+ Text "Your BAG’s KEY ITEMS POCKET is full.@" \ No newline at end of file
diff --git a/eonticket/ticket.4bpp b/eonticket/ticket.4bpp
new file mode 100755
index 0000000..678d42a
--- /dev/null
+++ b/eonticket/ticket.4bpp
@@ -0,0 +1 @@
+DDDDDDDDDDDDDDD3DDD3DDD3DDD3DDD3DDDDDDDDDDDD33333333333333333333DDDDDDDDDDDD33333333333C333C333CDDDDDDDDDDDD33333333DDDDDDDDD433DDDDDDDDDDDD3333333343CD43DD33DDDDDDDDDDDDDD33333333DD43DDD33DD3DDDDDDDDDDDD33333333CD43CDD3CDD3DDDDDDDDDDDD33333333DD33DD33DD33DDDDDDDDDDDD3333333333CD33CD3333DDDDDDDDDDDD33333333DDDDDDDDCD43DDDDDDDDDDDD3333333343DD43DD33DDDDDDDDDDDDDD3333333333DD3CDD3CD4DDDDDDDDDDDD33333333DD33DD43CD43DDDDDDDDDDDD33333333DD3DDD3DDD3DDDDDDDDDDDDD33333333D3CDD3CDD3CDDDDDDDDDDDDD33333333DDD4DDD44333DDDDDDDDDDDD333333333DDD3DDD333DDDDDDDDDDDDD33333333DDD3DDD3D333DDDDDDDDDDDD33333333333333333333DDDDDDDDDDDD33333333333333333333DDDDDDDDDDDD3DDD3DDD3DDD3DDD3DDDDDD3DDD3DDD3DDD3DDD3DDD3DDD3DDD333333333333333333333333333333333333C333C333C333C333C333C333C333CD433D433DDD4DDD4D433D433D433DDDD33DD33DD33DD33DD33DD33DD33DD43DD3DD33DD33DD33DD33DD33DD33DD3DDD3CDD4CDD4CDDDCD4DCD4DCD4CCD4CCD43DD33DD33DD33DD33DD33DD33DD33DD3333333333333333333333333333333333CD43CD43CD43CD43CD43CD43CD43CD4333DD33DD33DD33DD33DD33DD33DD33DD3CD43CD43CD43CD43CD43CD43CD43CDDCD43CD4333333333CD43CD43CD43DD43DD3DDDCDDDDDDDDDDDCDDD3DDD3DDD3DD3CD43CD33CD33CD43CDD3CDD3CDD3CD43334333DD43DD43433343334333DDD4333D333D333D333D333D333D333D333DD333D333D333D333D333D333D333D33333333333333333333333333333333333333333333333333333333333333333333DDD3DDD3DDD3DDD3DDD3DDD3DDD3DDDDDD3DDD3DDD3DDD3DDD3DDD3DDD3DDD33333333333333DDD3DDD3333333333D4333C33333333DDDDDDDD333333333CDCDDDD33333333DDDDDDDD33333333D3CD43CD33333333DDDDDDDD33333333CD3DDD4333333333DDDDDDDD33333333D43DCD4333333333DDDDDDDD33333333D4CDDD3333333333DDDDDDDD33333333CDCD333333333333DDDDDDDD33333333D433CD4333333333DDDDDDDD33333333333333DD33333333DDDDDDDD33333333333333DD33333333DDDDDDDD33333333333DDD3333333333DDDDDDDD33333333D43DDD3D33333333DDDDDDDD33333333D4CDD3CD33333333DDDDDDDD33333333CDCDDDD433333333DDDDDDDD33333333DDCD333D33333333DDDDDDDD33333333CDCDD33333333333DDDDDDDD33333333D4DD333333333333DDDDDDDD33333333D3D4333333333333DDD3DDD333333333CD333DDD3DDD3DDD3DDD3DDD3DDD3DDD3DDDDDD3DDD3DDD3DDD3DDD3DDD3DDD3DDD333D433D433D433D433D433D433D433DD3CDC3CDC3CDC3CDC3CDC3CDC3CDCDCDCD3CDD3CDD3CDD3CDD33DD33CD33CDD4CCDCDCDCDCDCDCDCDD4CDD3CDD3CDD3CDDDCDCDCD33CD33CD33CD33CDCDCDDDCDDDCDCDCDCDCDCDCDCDCDCDCDCDCDDD3DCDCDCDCDCDCDCDCDCDCDCDCDCDCDD4CDD43333333333D333D33333333333D43333333333333333333333333C333C333333333333333333333333D333DD33CDD333CD33CD33CD333D333333CD33CD33CDDDCDCDCD43CDD4CDDDCDCDCDCDCDDDCDDDCDCDCDCDCDCDCDCDCDCDCDCDCDDDCDCDCDCD3CCD3CCD3CCD3CCD3CCD3CDD3CDDCDD3CDD3CDD3CDD3CDD3CDD3CDD3CDCDCDCDCDCDCDDDCDDDCDCDCDCDCDCDCDD4DD33D433D4D3D4D3DD33DD33D4D4D4D4D4D4DDD4DDD4DDD3DDD3D4D4D4D4D4CD33CD33CD33DD33DD33DD33DD33CD333DDD3DDD3DDD3DDD3DDD3DDD3DDD3DDDDDD3DDD3DDD3DDD3DDD3DDD3DDD3DDD333DD3333333333333333333333333333DCDC3333333333333333333333333333DD4C333333333DD4CDDDCDCDCD33CD33D33D33333333CDCDCDCDCD3CCD3CCD3CD43D33333333DDCDDDCDD3CDD3CDD3CDD43C33333333CD33CD33CD33CD33CD33D3CD3333333333333333333333333333D433333C333C333333333333333333333333DDDDDDDD33333333333C333C33333CDDDDDDDDDD3CDDCDD3DD33D3333333333D4333433333333333333333333333D43D3333333333333333333333333333D43D33333333D4CDD4DDD4D4D4DDD4CDD43C33333333D3D4D4D4D4D433D4D3D4D3CD3333333333DD3CDD3CDC3CDC3CDCCDCD333333334CD3DCD3DCD4DCD4DCDDD4D433333333D4DDD4DDD4D4D4D4D4D4D4D433333333D333D433D433D433D433CD3333333333333333333333333333333DDD3DDD3DDD3DDD3DDD3DDD3DDD3DDDDDD3DDD3DDD3DDD3DDD3DDD3DDD3DDD33333333333333333333333333333333333333333333333333333333333333333CD33CD33CDCDCDDD3DD4333333333333CD3CCD3CCD3CCD3CCD3C333333333333D33DD33CD33CD33CD33C333333333333D433D333D333D333D333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333D43CD4D4D4D4D4DDD4CD333333333333D4D4D4D4D4D4D4DDD3DD3333333333333CDD3CDD3CDCDCDCDCDC333333333333DCDDDCDCDCDCDCD3DCD3333333333333D4D4D4D4D4D4D4DDD4DD333333333333D433D433D433D433D333333333333333333333333333333333333333333333333DDD3DDD3DDD3DDD3DDD3DDD3DDD3DDDDDD3DDD3DDD3DDD3DDD3DDD3DDD3DDD33333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333DD3CDD3CDC3CD433DD333D3CDC3333433CD33DD33D333D433CD333D33D3333DD33DD434D43D333DD33CD434D43333333333333333333333333333333333333DDD4DDD43D433D433D433D433D433333D4DDD4DDD4D4D4D4D4D4D4D4D4D43333D3CDD4DDD4D4D4D4D4D4D4DDD4DD3333D3D4D4D4D4D4D4D4D4D4D4D4D4D43333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333333DDD3DDD3DDD3DDD3DDD3DDD3DDD3DDDDDD3DDD3DDD3DDD3DDD3DDDDDDDDDDDD33333333333333333333DDDDDDDDDDDD33333333333333333333DDDDDDDDDDDD33333333333333333333DDDDDDDDDDDD33333333333333333333DDDDDDDDDDDD33333333333333333333DDDDDDDDDDDD3CDC3CDD33DD33333333DDDDDDDDDDDDD33DDC4D4C4C33333333DDDDDDDDDDDD4D43DD4DDD3D33333333DDDDDDDDDDDD33333333333333333333DDDDDDDDDDDD3D433D433D4333333333DDDDDDDDDDDDD4D4D4DDD4DD33333333DDDDDDDDDDDDD4D4D4D4D3D433333333DDDDDDDDDDDDD4D4D4DDD4DD33333333DDDDDDDDDDDD3333D333D33333333333DDDDDDDDDDDD33333333333333333333DDDDDDDDDDDD33333333333333333333DDDDDDDDDDDD33333333333333333333DDDDDDDDDDDD33333333333333333333DDDDDDDDDDDD33333333333333333333DDDDDDDDDDDD3DDD3DDD3DDD3DDD3DDDDDDDDDDDDDDD \ No newline at end of file
diff --git a/eonticket/ticket.pal b/eonticket/ticket.pal
new file mode 100644
index 0000000..c1a8373
--- /dev/null
+++ b/eonticket/ticket.pal
@@ -0,0 +1,5 @@
+ RGB 18, 0, 0
+ RGB 0, 0, 0
+ RGB 31, 31, 31
+ RGB 15, 31, 31
+ RGB 6, 15, 29 \ No newline at end of file