include "cpu/6309/include/common.inc" include "cpu/6x09/include/handlers/memory_write.inc" global sprite_debug section code sprite_debug: jsr sprite_viewer_palette_setup ldd #$1f std LAYER_A_TILE_PALETTE_BASE + $18 ldd #LAYER_A_TILE_BASE std r_old_highlight ; setup initial values ldx #r_mw_buffer ldd #$d0b4 ; y offset + sprite code std , x ldd #$3a ; x off set std 2, x ldd #$4080 ; size + zoom std 4, x clrd ; unused std 6, x ldx #d_mw_settings jsr memory_write_handler rts ; params: ; x = txt ram location to set highlight ; we are also on the hook for clearing out the ; previous highlight highlight_cb: ldy r_old_highlight lda , y anda #$1 sta , y lda #$30 lda , x ora #$30 sta , x stx r_old_highlight rts write_memory_cb: ldx #SPRITE_BASE jsr memory_write_generic_write loop_cb: rts section data d_mw_settings: MW_SETTINGS 8, r_mw_buffer, highlight_cb, write_memory_cb, loop_cb section bss r_mw_buffer: dcb.b 8 r_old_highlight: dcb.w 1