-
Notifications
You must be signed in to change notification settings - Fork 1
/
constants.asm
83 lines (68 loc) · 1.26 KB
/
constants.asm
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
INCLUDE "constants/registers.asm"
INCLUDE "build/charmap.asm"
A_ EQU $0
B_ EQU $1
SELECT EQU $2
START EQU $3
RIGHT EQU $4
LEFT EQU $5
UP EQU $6
DOWN EQU $7
CHARACTER_NAME_LENGTH EQU 6
NAME_LENGTH EQU 4
PLAYER_NAME_LENGTH EQU NAME_LENGTH
PLAYER_NAME_LENGTH_CODE EQU PLAYER_NAME_LENGTH
START_MENU_WIDTH EQU 7
START_MENU_HEIGHT EQU 16
START_MENU_DIMENSIONS EQU START_MENU_WIDTH << 8 | START_MENU_HEIGHT
HUD_HEIGHT EQU 6
HUD_WIDTH EQU 20
HUD_DIMENSIONS EQU HUD_WIDTH << 8 | HUD_HEIGHT
DIALOGUE_STATE_OFF EQU 0
DIALOGUE_STATE_1 EQU 1
DIALOGUE_STATE_2 EQU 2
DIALOGUE_STATE_3 EQU 3
DIALOGUE_STATE_4 EQU 4
DIALOGUE_STATE_WAITA EQU 5
DIALOGUE_STATE_END EQU 6
DIALOGUE_STATE_ONCE EQU 7
DIALOGUE_DELAY_BIT EQU 7
DIALOGUE_DELAY_FRAMES EQU 4
MACRO jumptable
rst $0
ENDM
MACRO dwb
dw \1
db \2
ENDM
MACRO dbw
db \1
dw \2
ENDM
MACRO pwb
dwb \1, BANK(\1)
ENDM
MACRO farcall
ld hl, \1
ld a, BANK(\1)
call FarCall
ENDM
MACRO addhla
add l
ld l, a
jr nc, .nc\@
inc h
.nc\@
ENDM
MACRO adddea
add e
ld e, a
jr nc, .nc\@
inc d
.nc\@
ENDM
vtile EQUS "$8800 + $800 ^ $10 * "
; because I am particularly lazy
MACRO ORG
SECTION "Lazy Section \@", ROMX[\2], BANK[\1]
ENDM