Skip to content

Commit

Permalink
distinguish addresses (:=) from constants (=)
Browse files Browse the repository at this point in the history
Per https://cc65.github.io/doc/ca65.html#ss6.1
defining a symbol with `:=` marks it as a "label" in debug info
so that the debugger can treat it differently from a constant.
  • Loading branch information
pinobatch committed May 23, 2022
1 parent 5c7c8f3 commit c3a0d21
Show file tree
Hide file tree
Showing 6 changed files with 207 additions and 207 deletions.
2 changes: 1 addition & 1 deletion src/bg.s
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,5 @@ palette:
.word RGB( 0, 0,15),RGB(15,15, 0),RGB(23,23, 8),RGB(31,31,16)
palette_size = * - palette

layer1_palette = palette
layer1_palette := palette
layer1_palette_size = palette_size
14 changes: 7 additions & 7 deletions src/init.s
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@
.smart

; Mask off low byte to allow use of $000000-$00000F as local variables
ZEROPAGE_BASE = __ZEROPAGE_RUN__ & $FF00
ZEROPAGE_BASE := __ZEROPAGE_RUN__ & $FF00

; Make sure these conform to the linker script (e.g. lorom256.cfg).
STACK_BASE = $0100
STACK_BASE := $0100
STACK_SIZE = $0100
LAST_STACK_ADDR = STACK_BASE + STACK_SIZE - 1
LAST_STACK_ADDR := STACK_BASE + STACK_SIZE - 1

PPU_BASE = $2100
CPUIO_BASE = $4200
PPU_BASE := $2100
CPUIO_BASE := $4200

; MMIO is mirrored into $21xx, $42xx, and $43xx of all banks $00-$3F
; and $80-$BF. To make it work no matter the current data bank, we
; can use a long address in a nonzero bank.
; Bit 0 of MEMSEL enables fast ROM access above $808000.
MEMSEL = $80420D
MEMSEL := $80420D

; Bit 4 of the byte at $FFD5 in the cartridge header specifies
; whether a game should be manufactured with slow or fast ROM.
; The init code enables fast ROM if this bit is true.
map_mode = $00FFD5
map_mode := $00FFD5

; A tiny stub in bank $00 needs to set interrupt priority to 1,
; leave 6502 emulation mode, and long jump to the rest of init code
Expand Down
3 changes: 0 additions & 3 deletions src/main.s
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,3 @@ padwait:

jmp forever
.endproc



4 changes: 2 additions & 2 deletions src/player.s
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ player_facing: .res 1

; except for STZs and BRAs, the following subroutine is
; direct copypasta from the NES template code
cur_keys = JOY1CUR+1
cur_keys := JOY1CUR+1

; constants used by move_player
; PAL frames are about 20% longer than NTSC frames. So if you make
Expand Down Expand Up @@ -246,7 +246,7 @@ doneWallCollision:
; offset by about a pixel.
seta8
lda player_frame
cmp #7 ; C = true for frame 7, false otherwise
cmp #7 ; CF is true for frame 7, false otherwise
lda #0
bcc have_xoffset
bit player_facing
Expand Down
Loading

0 comments on commit c3a0d21

Please sign in to comment.