Advertisement
yugorin

3 rasterbary stabilne - wycyklowane

Sep 28th, 2016
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. :BasicUpstart2(main)
  2.  
  3.  
  4. .var _useBinFolderForBreakpoints = cmdLineVars.get("usebin") == "true"
  5.  
  6. .var _createDebugFiles = cmdLineVars.get("afo") == "true"
  7.  
  8. .print "File creation " + [_createDebugFiles
  9.     ? "enabled (creating breakpoint file)"
  10.     : "disabled (no breakpoint file created)"]
  11.  
  12. .var brkFile
  13.  
  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. .macro przeniesienie (pozycja) {
  28.  
  29.             lda #pozycja
  30. loop:       cmp $d012
  31.             bne loop
  32. :pause #52             
  33.             lda #RED
  34.             sta $d020
  35.             sta $d021
  36.  
  37.  
  38.  
  39.  
  40.             lda #pozycja+1
  41. loop2:      cmp $d012
  42.             bne loop2
  43. :pause #50
  44.             lda #WHITE
  45.             sta $d020
  46.             sta $d021
  47.  
  48.  
  49.  
  50.  
  51.             lda #pozycja+2
  52. loop3:      cmp $d012
  53.             bne loop3
  54. :pause #44
  55.             lda #WHITE
  56.             sta $d020
  57.             sta $d021
  58.  
  59.  
  60.  
  61.  
  62.             lda #pozycja+3
  63. loopbl:     cmp $d012
  64.             bne loopbl
  65. :pause #46
  66.             lda #BLACK
  67.             sta $d020
  68.             sta $d021
  69.  
  70.  
  71.             jmp $ea31
  72. }
  73.  
  74. main:
  75.  
  76. :ClearScreen($0400,32)
  77.  
  78.     sei
  79.     lda #<irq
  80.     sta $0314
  81.     lda #>irq
  82.     sta $0315
  83.     lda #$7f
  84.     sta $dc0d
  85.     sta $dd0d
  86.     lda $dc0d
  87.     lda $dd0d
  88.     lda #$01
  89.     sta $d01a
  90.     lda #$3f
  91.     sta $d012
  92.     lda $d011
  93.     and #$7f
  94.     sta $d011
  95.     lda #$ff
  96.     sta $d019              
  97.     cli
  98.  
  99.  
  100. irq:
  101. //:break()
  102.     :przeniesienie($3f)
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110.  
  111. .macro ClearScreen(screen, clearByte) {
  112.     lda #clearByte
  113.     ldx #0
  114. !loop:
  115.     sta screen, x
  116.     sta screen + $100, x
  117.     sta screen + $200, x
  118.     sta screen + $300, x
  119.     inx
  120.     bne !loop-
  121. }
  122.  
  123. .pseudocommand pause cycles {
  124.     :ensureImmediateArgument(cycles)
  125.     .var x = floor(cycles.getValue())
  126.     .if (x<2) .error "Cant make a pause on " + x + " cycles"
  127.  
  128.     // Take care of odd cyclecount 
  129.     .if ([x&1]==1) {
  130.         bit $00
  131.         .eval x=x-3
  132.     }  
  133.    
  134.     // Take care of the rest
  135.     .if (x>0)
  136.         :nop #x/2
  137. }
  138.  
  139.  
  140. //---------------------------------
  141. // repetition commands
  142. //---------------------------------
  143. .macro ensureImmediateArgument(arg) {
  144.     .if (arg.getType()!=AT_IMMEDIATE)   .error "The argument must be immediate!"
  145. }
  146. .pseudocommand asl x {
  147.     :ensureImmediateArgument(x)
  148.     .for (var i=0; i<x.getValue(); i++) asl
  149. }
  150. .pseudocommand lsr x {
  151.     :ensureImmediateArgument(x)
  152.     .for (var i=0; i<x.getValue(); i++) lsr
  153. }
  154. .pseudocommand rol x {
  155.     :ensureImmediateArgument(x)
  156.     .for (var i=0; i<x.getValue(); i++) rol
  157. }
  158. .pseudocommand ror x {
  159.     :ensureImmediateArgument(x)
  160.     .for (var i=0; i<x.getValue(); i++) ror
  161. }
  162.  
  163. .pseudocommand pla x {
  164.     :ensureImmediateArgument(x)
  165.     .for (var i=0; i<x.getValue(); i++) pla
  166. }
  167.  
  168. .pseudocommand nop x {
  169.     :ensureImmediateArgument(x)
  170.     .for (var i=0; i<x.getValue(); i++) nop
  171. }
  172.  
  173.  
  174.  
  175.  
  176.  
  177. /*
  178.  
  179.  
  180.  
  181.             lda #$43
  182. loop4:      cmp $d012
  183.             bne loop4
  184. :pause #50
  185.             lda #WHITE
  186.             sta $d020
  187.             sta $d021
  188.  
  189. /*
  190.             lda #$44
  191. loop5:      cmp $d012
  192.             bne loop5
  193. :pause #2
  194.             lda #RED
  195.             sta $d020
  196.             sta $d021
  197.  
  198.  
  199.  
  200.             lda #$45
  201. loop6:      cmp $d012
  202.             bne loop6
  203. :pause #44
  204.             lda #WHITE
  205.             sta $d020
  206.             sta $d021
  207.  
  208.  
  209.  
  210.             lda #$46
  211. loop7:      cmp $d012
  212.             bne loop7
  213. //:pause #44
  214.             lda #RED
  215.             sta $d020
  216.             sta $d021
  217.  
  218.  
  219.  
  220.             lda #$47
  221. loop8:      cmp $d012
  222.             bne loop8
  223. //:pause #44
  224.             lda #WHITE
  225.             sta $d020
  226.             sta $d021
  227.  
  228.  
  229.  
  230.  
  231.             lda #$48
  232. loop9:      cmp $d012
  233.             bne loop9
  234. //:pause #44
  235.             lda #RED
  236.             sta $d020
  237.             sta $d021
  238.  
  239.  
  240.  
  241.             lda #$49
  242. loop10:     cmp $d012
  243.             bne loop10
  244. //:pause #44
  245.             lda #WHITE
  246.             sta $d020
  247.             sta $d021
  248.  
  249.  
  250.  
  251.             lda #$4a
  252. loop11:     cmp $d012
  253.             bne loop11
  254. //:pause #44
  255.             lda #RED
  256.             sta $d020
  257.             sta $d021
  258.  
  259.  
  260.  
  261.  
  262.             lda #$4b
  263. loop12:     cmp $d012
  264.             bne loop12
  265. :pause #54
  266.             lda #WHITE
  267.  
  268.             sta $d020
  269.             sta $d021
  270.  
  271.  
  272.  
  273.             lda #$4c
  274. loop13:     cmp $d012
  275.             bne loop13
  276. //:pause #54
  277.             lda #RED
  278.  
  279.             sta $d020
  280.             sta $d021
  281.  
  282.  
  283.             lda #$4d
  284. loop14:     cmp $d012
  285.             bne loop14
  286. //:pause #54
  287.             lda #WHITE
  288.  
  289.             sta $d020
  290.             sta $d021
  291.  
  292.  
  293.             lda #$4e
  294. loop15:     cmp $d012
  295.             bne loop15
  296. :pause #54
  297.             lda #RED
  298.  
  299.             sta $d020
  300.             sta $d021
  301.  
  302.  
  303.  
  304.  
  305. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement