Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #import "helpers.asm"
- :BasicUpstart2(main)
- //----------------------------------------------------------
- // Code for creating the breakpoint file sent to Vice/C64Debugger
- //----------------------------------------------------------
- .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(*))
- }
- }
- // For C64Debugger v0.54 (2016/09/03)
- .macro setbkg(color) {
- .if(_createDebugFiles) {
- .eval brkFile.writeln("setbkg " + toHexString(*) + " " + color)
- }
- }
- //Because Kick Assembler has to be run with the -afo switch to be able to write breakpoints to a file, we can use this to enable "debugger" specific code when build with Shift-F7 or Shift-F5, ie:
- .const debug = cmdLineVars.get("afo") == "true"
- .if (debug) {
- inc $d020
- }
- .label screen_control_register = $d011
- .label memory_setup_register = $d018
- .label border_color = $d020
- main:
- lda screen_control_register
- ora #%00100000
- sta screen_control_register
- lda #DARK_GRAY
- sta border_color
- :choose_screen_memory(3)
- :choose_bitmap_memory(1)
- lda #$c0
- ldx #$00
- ldy #$ff
- liniastart:
- inx
- :delay(200,40)
- :break()
- sty $2000+364*8
- sta $2000+204*8-1,x
- //sta $2000+204*8-1,x
- //sta $2000+244*8-1,x
- //sta $2000+284*8-1,x
- // sta $2000+324*8-1,x
- cpx #$08
- bne linia
- beq tu2
- linia:
- jmp liniastart
- tu2:
- lda #$c0
- ldx #$00
- ldy #$ff
- liniastart3:
- inx
- :delay(200,40)
- sta $2000+244*8-1,x
- //sta $2000+284*8-1,x
- // sta $2000+324*8-1,x
- cpx #$08
- bne linia3
- beq tu3
- linia3:
- jmp liniastart3
- tu3: jmp *
- * = screen_memory(3)
- .fill 1000, GRAY << 1 | LIGHT_GRAY
- * = bitmap_memory(1)
- .fill 8192, 0
- /*.for (var y = 0; y < 25; y++) {
- .for (var x = 0; x < 40; x++) {
- .var number = 25*y + x
- .for (var i = 7; i >= 0; i--) {
- .byte number >> i
- }
- }
- }
- */
- .macro choose_bitmap_memory(index) {
- lda memory_setup_register
- and #%11110111
- ora #[index << 3]
- sta memory_setup_register
- }
- .function bitmap_memory(index) {
- .return 1024*8*index
- }
- .macro choose_screen_memory(index) {
- lda memory_setup_register
- and #%00001111
- ora #[index << 4]
- sta memory_setup_register
- }
- .function screen_memory(index) {
- .return 1024*index
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement