summaryrefslogtreecommitdiff
path: root/battle-e/enigmaberry.asm
blob: 36537ff35d4e8add9257085d8a9faebcca29abf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
SECTION "drashberry",ROM0[$100]
jp Start
db $00

UnknownPalette:
	RGB 18,  0,  0
	RGB  0,  0,  0
	RGB 31, 31, 31
	RGB 15, 31, 31
	RGB  6, 15, 29

BackgroundSprite:
	INCBIN "sprites/berrybackdrop.4bpp"
BackgroundTilemap:
	INCBIN "sprites/berrybackdrop.tilemap"
BackgroundPalette:
	INCLUDE "sprites/berrybackdrop.pal"

REPT 72
	db 0
ENDR

Prologue:
	INCBIN "prologue-{REGION_NAME}.bin"

DataPacket:
	INCBIN "berries/{BERRY}-{REGION_NAME}.mev"
	db 0,0

INCLUDE "../common/mem_struct.asm"

BackgroundSpriteData:
	dw BackgroundSprite, BackgroundPalette, BackgroundTilemap
	db $05,$00,$01,$00
BerrySpriteData:
	dw (DataPacket+$18+$1C),(DataPacket+$18+$49C)
	db $06,$06,$01,$01,$01,$01,$01

Instructions1: ; B65
	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: ; BE1
	db "Press the A Button on the Game Boy\n"
	db "Advance containing Pokémon Ruby or\n"
	db "Sapphire to send a BERRY.\0"
BerrySendingInProcess: ; C41
	db "BERRY sending in Process...\0"
ABerryWasSent: ; C5D
	db "A BERRY was sent.\n"
	db "\n"
	db "Press the A Button to resend.\n"
	db "Press the B Button to cancel.\0"

INCLUDE "../common/battle_e_transfer.asm"

AfterTransfer:
	ld hl, $5FFF
	LD_IND_HL Space_1
	ld hl, Space_1
	API $0C7

	wait $01
	ret

Start:
	API_121
	LoadCustomBackground BackgroundSpriteData, 0
	API_02C $1E06, $000E, 0
	pop bc

	CreateCustomSprite SpriteHandlePtr, $80, BerrySpriteData
	SetSpritePos SpriteHandlePtr, 376, 56

	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 $10, $0040, UnknownPalette

	FadeIn 16
	wait 16
	API $0C6

	DrawText RegionHandlePtr, Instructions1, 8, 4
	API $08D

INCLUDE "../common/wait_for_link.asm"

	API_084 SpriteHandlePtr, 120, 56, 16 ; sprite move and fade in?
	pop bc
	API $08D
	push af
	nop

	DrawText RegionHandlePtr, Instructions2, 8, 4

UNKNOWN_VALUE EQU $00F5
INCLUDE "../common/wait_for_ready.asm"

	DrawText RegionHandlePtr, BerrySendingInProcess, 8, 4

DATA_TRANSFER_LENGTH EQU 3072
INCLUDE "../common/transfer_data.asm"

	call AfterTransfer

	wait 128
	API $08D

	ld c, a
	nop
	API_084 SpriteHandlePtr, $FF78, 56, 16 ; sprite move and fade out?

	pop bc
	DrawText RegionHandlePtr, ABerryWasSent, 8, 4

INCLUDE "../common/wrap_up.asm"

INCLUDE "../common/word_shift_right.asm"

SomeVar1: EOF         ; EFA
SomeVar2: dw 0        ; EFB
RegionHandlePtr: db 0 ; EFD
SpriteHandlePtr: dw 0 ; EFE