Skip to content

Instantly share code, notes, and snippets.

@eriksvedang
Created March 5, 2018 12:22
Show Gist options
  • Select an option

  • Save eriksvedang/20f9b2dfe402606f5bbc07408e3d3471 to your computer and use it in GitHub Desktop.

Select an option

Save eriksvedang/20f9b2dfe402606f5bbc07408e3d3471 to your computer and use it in GitHub Desktop.
.org $0200
jsr setup_hardware_registers
ldx #$00 ; offset into sprite-table
lda #$00
sta sprites,x ; x-position
inx
lda #$00
sta sprites,x ; y-position
inx
lda #$21
sta sprites,x ; tile-index
rts
tiles:
.incbin "enias-font.bin"
palette:
.incbin "default_palette.bin"
sprites:
.repeat 64
.byte $00, $FE, $44, $80
.endrepeat
nametable:
.repeat 768
.byte $00
.endrepeat
.proc setup_hardware_registers
; Setup tiles
lda #<tiles
sta $FE00
lda #>tiles
sta $FE01
; Setup sprite
lda #<sprites
sta $FE02
lda #>sprites
sta $FE03
; Setup palette
lda #<palette
sta $FE04
lda #>palette
sta $FE05
; Setup nametable
lda #<nametable
sta $FE06
lda #>nametable
sta $FE07
rts
.endproc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment