Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Screen =$0400
- ; [BASIC LOADER] --------------------------------------------------------------
- ; The following bytes generate the SYS call below to execute the Assembler.
- ; 10 SYS (2065) = $0811
- *=$0801
- BYTE $0E, $08, $0A, $00, $9E, $20, $28, $32, $30, $36, $35, $29, $00, $00, $00
- ; [CODE START] ----------------------------------------------------------------
- *=$0811
- ldx #250 ; Clear screen
- lda #" "
- @clr sta Screen,x
- sta Screen+250,x
- sta Screen+500,x
- sta Screen+750,x
- dex
- bne @clr
- txa
- jsr initRaster ; Init Raster IRQ
- @loop
- ; jsr waitRaster
- sta Screen+120,x ; Draw character to screen
- inx
- cpx #40
- bne @nzero
- ldx #0
- clc
- adc #1
- @nzero
- jmp @loop
- ;;; -----------------------------------------------------------------------------
- ;;; install raster interrupt handler
- ;;; -----------------------------------------------------------------------------
- initRaster
- sei ; turn off interrupts
- ldx #1 ; enable raster interrupts
- stx $d01a
- lda #<intHandler ; set raster interrupt vector
- ldx #>intHandler
- sta $fffe
- stx $ffff
- ldy #$50 ; set scanline on which to trigger interrupt
- sty $d012
- lda $d011 ; scanline hi bit
- and #%01111111
- sta $d011
- lda #$35 ; disable kernal and BASIC memory ($e000 - $ffff)
- sta $01
- asl $d019 ; acknowledge VIC interrupts
- cli
- rts
- ;;; -----------------------------------------------------------------------------
- ;;; raster IRQ handler
- ;;; -----------------------------------------------------------------------------
- intHandler
- pha
- txa
- pha
- tya
- pha
- lda #$ff
- sta $d019
- ; inc $d020
- ; inc rasterCount
- pla
- tay
- pla
- tax
- pla
- rti
- ;;; -----------------------------------------------------------------------------
- waitRaster
- pha
- lda rasterCount
- @wait cmp rasterCount
- beq @wait
- pla
- rts
- rasterCount byte 00
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement