Advertisement
yugorin

animka hires

May 2nd, 2017
354
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #import "helpers.asm"
  2.  
  3. :BasicUpstart2(main)
  4.  
  5. //----------------------------------------------------------
  6. // Code for creating the breakpoint file sent to Vice/C64Debugger
  7. //----------------------------------------------------------
  8. .var _useBinFolderForBreakpoints = cmdLineVars.get("usebin") == "true"
  9. .var _createDebugFiles = cmdLineVars.get("afo") == "true"
  10. .print "File creation " + [_createDebugFiles
  11.     ? "enabled (creating breakpoint file)"
  12.     : "disabled (no breakpoint file created)"]
  13. .var brkFile
  14. .if(_createDebugFiles) {
  15.     .if(_useBinFolderForBreakpoints)
  16.         .eval brkFile = createFile("bin/breakpoints.txt")
  17.     else
  18.         .eval brkFile = createFile("breakpoints.txt")
  19. }
  20.  
  21. .macro break() {
  22. .if(_createDebugFiles) {
  23.     .eval brkFile.writeln("break " + toHexString(*))
  24.     }
  25. }
  26.  
  27. // For C64Debugger v0.54 (2016/09/03)
  28. .macro setbkg(color) {
  29. .if(_createDebugFiles) {
  30.     .eval brkFile.writeln("setbkg " + toHexString(*) + " " + color)
  31.     }
  32. }
  33.  
  34. //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:
  35.  
  36. .const debug = cmdLineVars.get("afo") == "true"
  37.  
  38. .if (debug) {
  39.   inc $d020
  40. }
  41.  
  42.  
  43. .label screen_control_register = $d011
  44. .label memory_setup_register = $d018
  45. .label border_color = $d020
  46.  
  47. main:
  48.   lda screen_control_register
  49.   ora #%00100000
  50.   sta screen_control_register
  51.  
  52.   lda #DARK_GRAY
  53.   sta border_color
  54.  
  55.   :choose_screen_memory(3)
  56.  
  57.   :choose_bitmap_memory(1)
  58.  
  59. begin:
  60. lda #$c0
  61. ldx #$00
  62. ldy #$ff
  63.  
  64.  
  65. poczatek:
  66.  
  67.   inx
  68.  
  69.    
  70. :delay(200,40)
  71. :break()
  72.  
  73.   sty $2000+364*8
  74.  
  75.   sta $2000+204*8-1,x
  76.   //sta $2000+204*8-1,x
  77.   //sta $2000+244*8-1,x
  78.   //sta $2000+284*8-1,x
  79.  // sta $2000+324*8-1,x
  80.  
  81.   cpx #$08
  82.  
  83.   bne !fakejmp+
  84.  
  85.   beq drugaczesc
  86.  
  87. !fakejmp:
  88.   jmp poczatek
  89.  
  90. drugaczesc:  
  91.  
  92.  
  93.  
  94.   lda #$c0
  95.   ldx #$00
  96.   ldy #$ff
  97.  
  98. rysuj2:
  99.  
  100.   inx
  101.  
  102.    
  103. :delay(200,40)
  104.  
  105.   sta $2000+244*8-1,x
  106.   //sta $2000+284*8-1,x
  107.  // sta $2000+324*8-1,x
  108.  
  109.   cpx #$08
  110.  
  111.   bne !fakejmp+
  112.  
  113.   beq rotate
  114.  
  115. !fakejmp:
  116.   jmp rysuj2
  117.  
  118. rotate:  
  119. !drugaczesc:  
  120.  
  121.  
  122.  
  123.   lda #$c0
  124.   ldx #$00
  125.   ldy #$ff
  126.  
  127. !rysuj2:
  128.  
  129.   inx
  130.  
  131.    
  132. :delay(200,40)
  133.  
  134.   ror $2000+244*8-1,x
  135.   //sta $2000+284*8-1,x
  136.  // sta $2000+324*8-1,x
  137.  
  138.   cpx #$08
  139.  
  140.   bne !fakejmp+
  141.  
  142.   beq !end+
  143.  
  144. !fakejmp:
  145.   jmp !rysuj2-
  146.  
  147. !end:
  148.  jmp drugaczesc
  149.  
  150.  
  151.  
  152.  
  153.  
  154. * = screen_memory(3)
  155. .fill 1000, GRAY << 1 | LIGHT_GRAY
  156.  
  157. * = bitmap_memory(1)
  158. .fill 8192, 0
  159. /*.for (var y = 0; y < 25; y++) {
  160.   .for (var x = 0; x < 40; x++) {
  161.     .var number = 25*y + x
  162.     .for (var i = 7; i >= 0; i--) {
  163.       .byte number >> i
  164.     }
  165.   }
  166. }
  167. */
  168. .macro choose_bitmap_memory(index) {
  169.   lda memory_setup_register
  170.   and #%11110111
  171.   ora #[index << 3]
  172.   sta memory_setup_register
  173. }
  174.  
  175. .function bitmap_memory(index) {
  176.   .return 1024*8*index
  177. }
  178.  
  179. .macro choose_screen_memory(index) {
  180.   lda memory_setup_register
  181.   and #%00001111
  182.   ora #[index << 4]
  183.   sta memory_setup_register
  184. }
  185.  
  186. .function screen_memory(index) {
  187.   .return 1024*index
  188. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement