Skip to content

Instantly share code, notes, and snippets.

@Cyanne
Created January 23, 2023 00:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Cyanne/3ee4434a627ad356da503375bb33fafe to your computer and use it in GitHub Desktop.
Save Cyanne/3ee4434a627ad356da503375bb33fafe to your computer and use it in GitHub Desktop.
; Burger pieces:
; #$00 - nothing Keys:
; #$01 - bottom bread A 1: bottom bread
; #$02 - bottom bread B 2: sauce
; #$03 - sauce 3: lettuce
; #$04 - lettuce 4: tomato
; #$05 - tomato 5: patty
; #$06 - patty A 6: cheese
; #$07 - patty B 7: top bread
; #$08 - cheese
; #$09 - top bread A
; #$0a - top bread B 0: remove piece
Init:
; Colors
LDA #$0e ; ╮ $00 BG color
STA $00 ; ╯
LDA #$08 ; ╮ $01 Bread color
STA $01 ; ╯
LDA #$0a ; ╮ $03 Sauce color
STA $03 ; ╯
LDA #$0d ; ╮ $04 Lettuce color
STA $04 ; ╯
LDA #$02 ; ╮ $05 Tomato color
STA $05 ; ╯
LDA #$09 ; ╮ $06 Patty color
STA $06 ; ╯
LDA #$07 ; ╮ $08 Cheese color
STA $08 ; ╯
; Stack
; ...
StoreGraphics:
; Bottom Bread A
; Bottom Bread B
; Sauce
; Lettuce
; Tomato
; Patty A
; Patty B
; Cheese
; Top Bread A
; Top Bread B
FillBG_init:
LDA #$02 ; ╮ X/$11: Drawing page/high byte
TAX ; ╯
LDA #$00 ; ╮ Y: Drawing position
TAY ; ╯
LDA $00 ; Load background color into A
FillBG_loop:
STX $11 ; ╮ Draw background color pixel
STA ($10),Y ; ╯ to screen using indirect addrs.
INY ; Increment screen position
CPY #$00 ; ╮ Check if Y has overflowed,
BNE FillBG_loop ; ╯ otherwise loop.
INX ; Increment page
CPX #$06 ; ╮ Check if X passed enough pages,
BNE FillBG_loop ; ╯ otherwise loop.
DrawBurger:
; Pen on/pen off technique for 1-bit graphics
; ...
PollInput:
; ...
UpdateStack:
; ...
BRK ; Debug
JMP DrawBurger
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment