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/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
- }
- licznik:
- .byte $0
- goraczydol:
- .byte $0
- main:
- :break()
- sei //disable maskable IRQs
- lda #$7f
- sta $dc0d //disable timer interrupts which can be generated by the two CIA chips
- sta $dd0d //the kernal uses such an interrupt to flash the cursor and scan the keyboard, so we better
- //stop it.
- lda $dc0d//;by reading this two registers we negate any pending CIA irqs.
- lda $dd0d //if we don't do this, a pending CIA irq might occur after we finish setting up our irq.
- //;we don't want that to happen.
- lda #$01 //;this is how to tell the VICII to generate a raster interrupt
- sta $d01a
- lda #$47 //;this is how to tell at which rasterline we want the irq to be triggered
- sta $d012
- lda #$1b //as there are more than 256 rasterlines, the topmost bit of $d011 serves as
- sta $d011 //the 9th bit for the rasterline we want our irq to be triggered.
- //;here we simply set up a character screen, leaving the topmost bit 0.
- // lda #$35 //we turn off the BASIC and KERNAL rom here
- // sta $01 //the cpu now sees RAM everywhere except at $d000-$e000, where still the registers of
- //SID/VICII/etc are visible
- lda #<irq // nastavit LO byte adresy
- sta $0314 // na LO adresu IRQ - preruseni
- lda #>irq // nastavit HI byte adresy
- sta $0315 // na HI adresu IRQ - preruseni
- cli // vypnout preruseni
- //rts // skoncit program
- // cli //;enable maskable interrupts again
- jmp * //;we better don't RTS, the ROMS are now switched off, there's no way back to the system
- irq:
- inc $d019
- linia1: lda #120
- !loop:
- cmp $d012
- bne !loop-
- !kolor:
- ldx #BLACK
- stx $d021
- linia2: lda #140
- sta $d012
- !loop:
- cmp $d012
- bne !loop-
- lda #WHITE
- sta $d021
- linia3: lda #160
- !loop:
- cmp $d012
- bne !loop-
- !kolor:
- ldx #RED
- stx $d021
- linia4: lda #180
- sta $d012
- !loop:
- cmp $d012
- bne !loop-
- lda #BLUE
- sta $d021
- pla
- tay
- pla
- tax
- pla
- // dec $d020
- lda goraczydol
- cmp #$00
- beq !loop+
- !loop1:
- dec linia1+1
- dec linia2+1
- dec linia3+1
- dec linia4+1
- dec licznik
- lda licznik
- cmp #00
- beq dalej
- rti
- !loop:
- inc linia1+1
- inc linia2+1
- inc linia3+1
- inc linia4+1
- inc licznik
- lda licznik
- cmp #$29
- beq dalej2
- rti
- dalej:
- inc goraczydol
- rti
- dalej2:
- dec goraczydol
- rti
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement