Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- * = $C000
- RASTERBEGIN = 58
- RASTEREND = 66
- lda $d016 ; Horizzontal scroll register -> A
- and #%11110111 ; 38 column mode
- sta $d016
- sei ; Disable Interrupts
- ldy #$7f ; $7f = %01111111
- sty $dc0d ; Disable the CIA Interrupts
- sty $dd0d ; Found at $DC0D and $DD0D
- lda $dc0d ; So we cancel all the interrupts
- lda $dd0d ; that has yet to happeand and not processed
- lda #$01 ; Bit 0 of the Interrupt Enable Register is for the Raster Interrupt
- sta $d01a ; Set this to 1 to Enable the Raster Interrupt
- lda #<IrqStart ; Get Lo-Byte Pointer to our Raster Interrupt Routine
- ldx #>IrqStart ; Get Lo-Byte Pointer to our Raster Interrupt Routine
- sta $0314 ; Lo-Byte
- stx $0315 ; Hi-Byte
- lda #RASTERBEGIN; The scan line where the raster interrupt has to happend
- sta $d012 ; Store this in $D012
- lda $d011 ; We make sure that the high bit of the Raster
- and #$7f ; line is zero. Like this we make sure that
- sta $d011 ; the interrupts always happen at scan line 250
- cli ; Initialize the interrupts
- jmp *
- smooth byte $7 ; offset in pixel
- shift byte $00 ; flag to shift all char at left
- IrqStart
- ;lda #0
- ;sta 53281
- lda $d016 ; Horizzontal scroll register -> A
- ora smooth ; "add" smooth value (0..7)
- sta $d016 ; place new value
- dec smooth ; decrement smooth offset
- bpl IrqStart_Continue ; if non negative ok
- lda #7 ; else set smooth
- sta smooth ; offset to seven and
- sta shift ; indicate to do line shift at next raster interrupt
- ; at the end of this line (see below)
- IrqStart_Continue
- lda #<IrqEnd
- sta $0314
- lda #>IrqEnd
- sta $0315 ; Re-direct next interrupt to IrqEnd service routine
- lda #RASTEREND ; Scan line where the raster interrupt has to happend
- sta $d012 ; store it
- asl $d019 ; "Acknowledge" the interrupt by clearing the VIC's interrupt flag.
- jmp $ea81 ; Jump to normal interrupt routine ... no keyscan
- ;jmp $ea31 ; return normally to the kernal (keyscan) via its Interrupt routine
- IrqEnd
- ;lda #1
- ;sta 53281
- lda shift ; check shify flag
- beq IrqEContinue; if = 0 ok continue normally
- ; else shift (better rollup) character line
- ldy $0400+40
- ldx #00
- IrqELoop
- lda $0400+41,x
- sta $0400+40,x
- inx
- cpx #39
- bne IrqELoop
- sty $0400+79
- lda #0 ; reset
- sta shift ; shift flag
- IrqEContinue
- lda $d016 ; Horizzontal scroll register -> A
- and #%11111000 ; reset horizzontal bit-shift
- sta $d016
- lda #<IrqStart
- sta $0314
- lda #>IrqStart
- sta $0315 ; Re-direct next interrupt to IrqMiddle service routine
- lda #RASTERBEGIN; Scan line where the raster interrupt has to happend
- sta $d012 ; store it
- asl $d019 ; "Acknowledge" the interrupt by clearing the VIC's interrupt flag.
- jmp $ea81 ; Jump to normal interrupt routine ... no keyscan
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement