Skip to content

Commit

Permalink
replace GLOBAL with EXPORT for RGBDS 0.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
pinobatch committed Dec 5, 2020
1 parent aa58ab9 commit 8b894e4
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 29 deletions.
13 changes: 13 additions & 0 deletions src/global.inc
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,19 @@ MOVEB_JUMP equ 2
MOVEF_JUMP equ %00000100
MOVEF_DIRECTION equ %00000011

; It is not strictly necessary to completely clear the display list,
; as lcd_clear_oam writes a "hide this sprite" value to all unused
; sprites. But when Options > Exceptions > Unitialized RAM >
; break on read (reset) is on, BGB complains about copying
; uninitialized data to OAM even if said data is provably unused.
; So put "shut BGB up" commands behind a conditional.
bgbcompat equ 1

; In `di halt` scenarios, VisualBoyAdvance 1.7.2 can call the
; interrupt handler anyway. When this is turned on, include a
; do-nothing STAT handler.
vbacompat equ 1

; 1: show dead ends when map starts
; 0: hide dead ends until entered (release)
SHOW_UNENTERED_DEADENDS equ 0
Expand Down
13 changes: 0 additions & 13 deletions src/init.z80
Original file line number Diff line number Diff line change
Expand Up @@ -22,19 +22,6 @@
include "src/hardware.inc"
include "src/global.inc"

; It is not strictly necessary to completely clear the display list,
; as lcd_clear_oam writes a "hide this sprite" value to all unused
; sprites. But when Options > Exceptions > Unitialized RAM >
; break on read (reset) is on, BGB complains about copying
; uninitialized data to OAM even if said data is provably unused.
; So put "shut BGB up" commands behind a conditional.
bgbcompat equ 1

; In `di halt` scenarios, VisualBoyAdvance 1.7.2 can call the
; interrupt handler anyway. When this is turned on, include a
; do-nothing STAT handler.
vbacompat equ 1

; Like the NES and Super NES, DMA on the Game Boy takes access to RAM
; and ROM away from the CPU. But unlike those two, the CPU continues
; to run. So store a tiny subroutine in HRAM (tightly coupled
Expand Down
14 changes: 7 additions & 7 deletions src/metasprite.z80
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
include "src/hardware.inc"
include "src/global.inc"

TMARGIN = 16
LMARGIN = 8
SPRITEHT = 8 ; or 16?
SPRITEWID = 8
TMARGIN equ 16
LMARGIN equ 8
SPRITEHT equ 8 ; or 16?
SPRITEWID equ 8

; args
rsset hLocals
Expand All @@ -37,8 +37,8 @@ hmsprAttr rb 1
hmsprSheetID rb 1
hmsprFrame rb 1
hmsprBaseTile rb 1
global hmsprYLo, hmsprYHi, hmsprXLo, hmsprXHi
global hmsprAttr, hmsprSheetID, hmsprFrame, hmsprBaseTile
export hmsprYLo, hmsprYHi, hmsprXLo, hmsprXHi
export hmsprAttr, hmsprSheetID, hmsprFrame, hmsprBaseTile


; internal
Expand Down Expand Up @@ -254,4 +254,4 @@ sheet_msprtables:
dw fourbyfourCM_mspraddrs

Libbet_mspraddrs:
include "obj/gb/Libbet.z80"
include "obj/gb/Libbet.z80"
1 change: 1 addition & 0 deletions src/popslide.z80
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
;

include "src/hardware.inc"
include "src/global.inc"

; Each packet starts with a 4-byte header:
; dst low, dst high, count/flags, first byte
Expand Down
16 changes: 8 additions & 8 deletions src/statusbar.z80
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ STATUS_BLANK equ $F7
BIG_DIGIT_BASE equ $E0
SPRITE_BIG_DIGIT_BASE equ $60
STATUS_PERCENT equ $F4
STATUSBAR_CHR_COUNT = 40
global SPRITE_BIG_DIGIT_BASE
STATUSBAR_CHR_COUNT equ 40
export SPRITE_BIG_DIGIT_BASE

; The status bar is and occupies the last two rows of the tilemap
SCRN_STATUS equ SCRN_BG+32*16
Expand All @@ -39,12 +39,12 @@ COMBO_POS equ SCRN_STATUS+1
PCTAGE_POS equ SCRN_STATUS+9
DEBUGHEX_POS equ SCRN_STATUS+15

EARNED_LABEL_BASE = $8C
EARNED_LABEL_NTILES = 6
EARNED_BLANK = $91
EARNED_NAME_BASE = $80
EARNED_NAME_NTILES = 12
global EARNED_NAME_BASE, EARNED_NAME_NTILES
EARNED_LABEL_BASE equ $8C
EARNED_LABEL_NTILES equ 6
EARNED_BLANK equ $91
EARNED_NAME_BASE equ $80
EARNED_NAME_NTILES equ 12
export EARNED_NAME_BASE, EARNED_NAME_NTILES

COMBO_LABEL_BASE = $FC
COMBO_LABEL_NTILES = 4
Expand Down
2 changes: 1 addition & 1 deletion tools/extractcels.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ def emit_frames(framestrips, nt, framenames):
)

out.extend("FRAME_%s equ %d" % (n, i) for i, n in enumerate(framenames))
out.extend(" global FRAME_%s" % (n,) for n in framenames)
out.extend(" export FRAME_%s" % (n,) for n in framenames)
return "\n".join(out)

# CLI front end
Expand Down

0 comments on commit 8b894e4

Please sign in to comment.