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(*))
- }
- }
- .label screen_memory = $0400
- .label memory_setup_register = $d018
- .label character_rom = $d000
- main:
- :break()
- :clear_screen()
- :print_all_characters()
- :choose_character_set(4)
- sei
- lda $01
- pha
- and #%11111011
- sta $01
- .for (var char = 0; char < 64; char++) {
- ldx #0
- ldy #7
- loopx:
- lda character_rom + char*8, X
- sta custom_charset + char*8, X
- sta custom_charset + [64+char]*8, Y
- dey
- inx
- cpx #8
- bne loopx
- }
- pla
- sta $01
- cli
- rts
- .pc = 4*2048 "Custom Charset"
- custom_charset:
- .for (var char = 0; char < 256; char++) {
- .if (char == ' ') {
- .byte %00000000
- .byte %00000000
- .byte %00000000
- .byte %00000000
- .byte %00000000
- .byte %00000000
- .byte %00000000
- .byte %00000000
- } else {
- .for (var i = 0; i < 8; i++) {
- .byte char & 1<<i
- }
- }
- }
- .macro choose_character_set(index) {
- lda memory_setup_register
- and #%11110001
- ora #[index << 1]
- sta memory_setup_register
- }
- .macro clear_screen() {
- ldx #250
- lda #' '
- loopx:
- .for (var i = 0; i < 4; i++) {
- sta screen_memory + 250*i - 1, X
- }
- dex
- bne loopx
- }
- .macro print_all_characters() {
- .for (var i = 0;i < 256; i++) {
- .var column = mod(i,32) + 4
- .var row = floor(i / 32) + 4
- lda #i
- sta screen_memory + row*40 + column
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement