Skip to content

Instantly share code, notes, and snippets.

@nurpax
Last active August 3, 2019 21:42
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 nurpax/35e2b992ecfe959cdb9121a247a230eb to your computer and use it in GitHub Desktop.
Save nurpax/35e2b992ecfe959cdb9121a247a230eb to your computer and use it in GitHub Desktop.
6502 lines size optimization
!include "c64.asm"
+c64::basic_start(entry)
entry: {
lda #0
sta $d020
sta $d021
ldx #0
lda #$20
clrscr:
!for i in [0, $100, $200, $300] {
sta $0400 + i, x
}
inx
bne clrscr
lda #$a0
!for i in range(0, 40) {
!let y0 = Math.floor(25/40*(i+0.5))
sta $0400 + y0*40 + i
sta $0400 + (24-y0)*40 + i
; sta $0400 + 0*40 + i
; sta $0400 + 24*40 + i
; sta $0400 + i*40 + 0
; sta $0400 + i*40 + 39
}
inf: jmp inf
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment