Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :BasicUpstart2(main)
- //----------------------------------------------------------
- // Code for creating the breakpoint file sent to Vice.
- //----------------------------------------------------------
- .var _useBinFolderForBreakpoints = cmdLineVars.get("usebin") == "true"
- .var _createDebugFiles = cmdLineVars.get("afo") == "true"
- .print "File creation " + [_createDebugFiles
- ? "enabled (creating breakpoint file)"
- : "disabled (no breakpoint file created)"]
- .var brkFile
- .if(_createDebugFiles) {
- .if(_useBinFolderForBreakpoints)
- .eval brkFile = createFile("bin/breakpoints.txt")
- else
- .eval brkFile = createFile("breakpoints.txt")
- }
- .macro break() {
- .if(_createDebugFiles) {
- .eval brkFile.writeln("break " + toHexString(*))
- }
- }
- //------------------------------------------------------
- main:
- :ClearScreen($0400,32)
- sei
- start:
- lda #$3b //; wait for line #59, making sure we
- !jump:
- cmp $d012 //; don't catch it twice in one frame
- beq !jump-
- !jump:
- cmp $d012
- bne !jump-
- lda $d016 //; decrease scroll register
- sbc #$01 //; (carry was set by cmp above)
- and #$07
- sta $d016
- cmp #$07 //; go back if there's no need
- bne start //; to shift screen memory
- ldx #$00 //; move columns 1..38 one byte left
- screen: lda $0401,x
- sta $0400,x
- inx
- cpx #$26
- bne screen
- lda $c000 //; some dummy data to column 38
- sta $0426
- inc *-5
- jmp start
- * = $c000 "Tekst"
- .text "arek arek arek"
- raster_color:
- .byte $00,$00,$07,$0a,$08,$0a,$08,$02
- .byte $08,$02,$09,$02,$09,$0b,$09,$0b
- .byte $00,$0b,$00,$07,$0a,$08,$0a,$08
- .byte $02,$08,$02,$09,$02,$09,$0b,$09
- .byte $0b,$00,$0b,$00,$08,$0a,$08,$02
- .byte $08,$02,$09,$02,$09,$0b,$09,$0b
- .byte $00,$0b,$00,$08,$02,$08,$02,$09
- .byte $02,$09,$0b,$09,$0b,$00,$0b,$00
- .byte $08,$02,$09,$02,$09,$0b,$09,$0b
- .byte $00,$0b,$00,$09,$02,$09,$0b,$09
- .byte $0b,$00,$0b,$00,$09,$0b,$09,$0b
- .byte $00,$0b,$00,$09,$0b,$00,$0b,$00
- .byte $00,$0b,$00,$00,$0b,$00,$00,$0b
- .byte $00,$0b,$06,$00,$0b,$00,$0b,$06
- .byte $0b,$06,$00,$0b,$00,$0b,$06,$0b
- .byte $06,$0c,$06,$00,$0b,$00,$0b,$06
- .byte $0b,$06,$0c,$06,$0c,$0e,$00,$0b
- .byte $00,$0b,$06,$0b,$06,$0c,$06,$0c
- .byte $0e,$0c,$0e,$00,$0b,$00,$0b,$06
- .byte $0b,$06,$0c,$06,$0c,$0e,$0c,$0e
- .byte $0f,$0e,$00,$0b,$00,$0b,$06,$0b
- .byte $06,$0c,$06,$0c,$0e,$0c,$0e,$0f
- .byte $0e,$0f,$03,$00,$0b,$00,$0b,$06
- .byte $0b,$06,$0c,$06,$0c,$0e,$0c,$0e
- .byte $0f,$0e,$0f,$03,$0f,$03,$00,$0b
- .byte $00,$0b,$06,$0b,$06,$0c,$06,$0c
- .byte $0e,$0c,$0e,$0f,$0e,$0f,$03,$0f
- .byte $03,$01,$00,$00,$00,$00,$00,$00
- .byte $00,$00,$00,$00,$00,$00,$00,$00
- .byte $00,$00,$00,$00,$00,$00,$00,$00
- .macro ClearScreen(screen, clearByte) {
- lda #clearByte
- ldx #0
- !loop:
- sta screen, x
- sta screen + $100, x
- sta screen + $200, x
- sta screen + $300, x
- inx
- bne !loop-
- }
- .pseudocommand pause cycles {
- :ensureImmediateArgument(cycles)
- .var x = floor(cycles.getValue())
- .if (x<2) .error "Cant make a pause on " + x + " cycles"
- // Take care of odd cyclecount
- .if ([x&1]==1) {
- bit $00
- .eval x=x-3
- }
- // Take care of the rest
- .if (x>0)
- :nop #x/2
- }
- //---------------------------------
- // repetition commands
- //---------------------------------
- .macro ensureImmediateArgument(arg) {
- .if (arg.getType()!=AT_IMMEDIATE) .error "The argument must be immediate!"
- }
- .pseudocommand asl x {
- :ensureImmediateArgument(x)
- .for (var i=0; i<x.getValue(); i++) asl
- }
- .pseudocommand lsr x {
- :ensureImmediateArgument(x)
- .for (var i=0; i<x.getValue(); i++) lsr
- }
- .pseudocommand rol x {
- :ensureImmediateArgument(x)
- .for (var i=0; i<x.getValue(); i++) rol
- }
- .pseudocommand ror x {
- :ensureImmediateArgument(x)
- .for (var i=0; i<x.getValue(); i++) ror
- }
- .pseudocommand pla x {
- :ensureImmediateArgument(x)
- .for (var i=0; i<x.getValue(); i++) pla
- }
- .pseudocommand nop x {
- :ensureImmediateArgument(x)
- .for (var i=0; i<x.getValue(); i++) nop
- }
- teskt:
- .byte $04
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement