-
Notifications
You must be signed in to change notification settings - Fork 0
/
pre.asm
55 lines (45 loc) · 791 Bytes
/
pre.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
ifdef USEBASE
INCLUDE "inc-base.asm"
else
INCNES "base.nes"
endif
; ignore the base while generating the patch.
CLEARPATCH
; macros
SEEK EQU SEEKABS
SKIP EQU SKIPREL
MACRO SUPPRESS
ENUM $
ENDM
ENDSUPPRESS EQU ENDE
MACRO SKIPTO pos
if ($ >= 0)
SKIP pos - $
; just to be safe.
if ($ != pos)
ERROR "failed to skipto."
endif
endif
ENDM
FROM EQU SKIPTO
MACRO BANK bank
SEEK (bank * $4000) + $10
ENDM
MACRO BANK8 bank
SEEK (bank * $2000) + $10
ENDM
MACRO ATLEAST pos
if ($ < pos)
ERROR exceeded room! $ > pos
endif
ENDM
MACRO LIMIT pos
if ($ > pos)
ERROR exceeded room! $ > pos
endif
ENDM
MACRO EXACT pos
if ($ != pos)
ERROR Must be exact! $ != pos
endif
ENDM