Skip to content

Commit

Permalink
Require rgbds v0.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dannye committed Feb 4, 2024
1 parent 8f850ec commit 116df1c
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 29 deletions.
8 changes: 4 additions & 4 deletions src/macros/asserts.asm
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
; Macros to verify assumptions about the data or code

MACRO table_width
CURRENT_TABLE_WIDTH = \1
DEF CURRENT_TABLE_WIDTH = \1
IF _NARG == 2
REDEF CURRENT_TABLE_START EQUS "\2"
ELSE
Expand All @@ -11,19 +11,19 @@ ENDC
ENDM

MACRO assert_table_length
x = \1
DEF x = \1
ASSERT x * CURRENT_TABLE_WIDTH == @ - {CURRENT_TABLE_START}, \
"{CURRENT_TABLE_START}: expected {d:x} entries, each {d:CURRENT_TABLE_WIDTH} bytes"
ENDM

MACRO deck_list_start
x = 0
DEF x = 0
ENDM

; \1 = card ID
; \2 = quantity
MACRO card_item
x = x + \2
DEF x = x + \2
db \2, \1
ENDM

Expand Down
24 changes: 12 additions & 12 deletions src/macros/audio.asm
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
C_ EQU $1
C# EQU $2
D_ EQU $3
D# EQU $4
E_ EQU $5
F_ EQU $6
F# EQU $7
G_ EQU $8
G# EQU $9
A_ EQU $a
A# EQU $b
B_ EQU $c
DEF C_ EQU $1
DEF C# EQU $2
DEF D_ EQU $3
DEF D# EQU $4
DEF E_ EQU $5
DEF F_ EQU $6
DEF F# EQU $7
DEF G_ EQU $8
DEF G# EQU $9
DEF A_ EQU $a
DEF A# EQU $b
DEF B_ EQU $c

MACRO note
dn (\1), (\2) - 1 ; pitch, length
Expand Down
16 changes: 3 additions & 13 deletions src/rgbdscheck.asm
Original file line number Diff line number Diff line change
@@ -1,16 +1,6 @@
MAJOR EQU 0
MINOR EQU 6
PATCH EQU 1

WRONG_RGBDS EQUS "FAIL \"poketcg requires rgbds v0.6.1 or newer.\""

IF !DEF(__RGBDS_MAJOR__) || !DEF(__RGBDS_MINOR__) || !DEF(__RGBDS_PATCH__)
WRONG_RGBDS
ELSE
IF (__RGBDS_MAJOR__ < MAJOR) || \
(__RGBDS_MAJOR__ == MAJOR && __RGBDS_MINOR__ < MINOR) || \
(__RGBDS_MAJOR__ == MAJOR && __RGBDS_MINOR__ == MINOR && __RGBDS_PATCH__ < PATCH) || \
(__RGBDS_MAJOR__ == MAJOR && __RGBDS_MINOR__ == MINOR && __RGBDS_PATCH__ == PATCH && DEF(__RGBDS_RC__))
WRONG_RGBDS
fail "poketcg requires rgbds v0.7.0 or newer."
ENDC
IF __RGBDS_MAJOR__ == 0 && __RGBDS_MINOR__ < 7
fail "poketcg requires rgbds v0.7.0 or newer."
ENDC

0 comments on commit 116df1c

Please sign in to comment.