
.include "globals.inc"

.define COPY_GFX 1

.segment "STARTUP"

start:
.assert start = $0400, error, "Code not at $0400"

.if COPY_GFX
.import  __GFXDATA_LOAD__
.import  __GFXDATA_SIZE__

; the file might be loaded using DMA
; so the GFX data is not cached by the LED engine
; update cache by re-writing GFX data to same place
; a possible better solution would be to port exomizer and pack it

   lda   #<__GFXDATA_LOAD__
   sta   vector+0
   lda   #>__GFXDATA_LOAD__
   sta   vector+1

   ldx   #>(__GFXDATA_SIZE__+$0100)
   ldy   #$00
:
   lda   (vector),y
   sta   (vector),y
   iny
   bne   :-
   inc   vector+1
   dex
   bne   :-
.endif

   jmp   main

.segment "MUSIC"
music:
.incbin "../music/nolimits.bin"
.assert music = $0500, error, "Music not at $0500"
