Advertisement
yugorin

Sinus nie działa na c64 debug

Sep 8th, 2016
135
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. :BasicUpstart2(main)
  2.  
  3. .var brkFile = createFile("breakpoints.txt")
  4.  
  5. .macro break() {
  6.   .eval brkFile.writeln("break " + toHexString(*))
  7. }
  8.  
  9. main:
  10.  
  11.     lda CYAN
  12.     sta $d027
  13.     jsr opoznienie
  14.  
  15.    
  16. ruszaj:
  17.     lda #$00
  18.     sta $d010
  19.  
  20.     lda #$01            // bit 0 zapalony
  21.     sta $d015           // sprite 0 wyświetlony
  22.     ldx #$00            // ustawienie licznika pętli dla sinusa oraz liniowego przemieszczania sprite
  23.  
  24. ruszaj2:
  25.     lda #$01            // bit 0 zapalony
  26.     sta $d015           // sprite 0 wyświetlony
  27.  
  28.     lda sinus,x     // załaduj kolejną wartość z sinusa
  29.     sta $d001           // kooordynaty z sinusa
  30.     stx $d000           // kooordynaty x+1
  31.     txa                 // zapamiętanie x
  32.     pha                 // na stos przed wykonaniem pętli opóźniającej
  33.     jsr opoznienie 
  34.     pla                 // przywrócenie x ze stosu
  35.     tax                 //
  36.     inx                 // zwiększenie x
  37.     cpx #$00
  38.     beq dodatkowy_bit_dla_sprite
  39.     jmp ruszaj2
  40.  
  41. dodatkowy_bit_dla_sprite:
  42.     lda #$01
  43.     sta $d010
  44.  
  45. ruszaj3:
  46.     lda #$01            // bit 0 zapalony
  47.     sta $d015           // sprite 0 wyświetlony
  48.  
  49.     lda sinus2,x        // załaduj kolejną wartość z sinusa
  50.     sta $d001           // kooordynaty z sinusa
  51.     stx $d000           // kooordynaty x+1
  52.     txa                 // zapamiętanie x
  53.     pha                 // na stos przed wykonaniem pętli opóźniającej
  54.     jsr opoznienie 
  55.     pla                 // przywrócenie x ze stosu
  56.     tax                 //
  57.     inx                 // zwiększenie x
  58.     cpx #$ff
  59.     beq ruszaj
  60.     :break()
  61.     jmp ruszaj3
  62.  
  63.    
  64. opoznienie:
  65.             ldx #$00   
  66.  
  67. petla1:
  68.             ldy #$00
  69.  
  70. petla2:
  71.             iny
  72.             cpy #$60
  73.             bne petla2
  74.             inx
  75.             cpx #$20
  76.             bne petla1
  77.             rts
  78.    
  79.    
  80. .pc = 64*255 "Default Sprite Bitmap"
  81. //----------------------------------------------------------
  82.  
  83.  
  84.  
  85.  
  86. //.import binary "sprajt1.spr"
  87.  
  88. .byte %01111111, %11111111, %11111110
  89. .byte %11111111, %11111111, %11111111
  90. .byte %11111111, %11111111, %11111111
  91. .byte %11111111, %00000000, %11111111
  92. .byte %11111111, %00000000, %11111111
  93. .byte %11111111, %00000000, %11111111
  94. .byte %11111111, %00000000, %11111111
  95. .byte %11111111, %00000000, %11111111
  96. .byte %11111111, %00000000, %11111111
  97. .byte %11111111, %00000000, %11111111
  98. .byte %11111111, %00000000, %11111111
  99. .byte %11111111, %00000000, %11111111
  100. .byte %11111111, %00000000, %11111111
  101. .byte %11111111, %00000000, %11111111
  102. .byte %11111111, %00000000, %11111111
  103. .byte %11111111, %00000000, %11111111
  104. .byte %11111111, %00000000, %11111111
  105. .byte %11111111, %00000000, %11111111
  106. .byte %11111111, %11111111, %11111111
  107. .byte %11111111, %11111111, %11111111
  108. .byte %01111111, %11111111, %11111110
  109.  
  110.  
  111.  
  112. .pc = $c000
  113. //sinus:
  114.  
  115. //.fill 512,<round(0+16256*sin(toRadians(i*360/256+360/512)))
  116.  
  117. //.fill 512,>round(0+16256*sin(toRadians(i*360/256+360/512)))
  118.  
  119.  
  120.  
  121. sinus:
  122.  
  123. .byte $78,$76,$75,$73,$72,$70,$6F,$6D,$6C,$6A,$69,$68,$66,$65,$64,$62
  124. .byte $61,$60,$5F,$5E,$5D,$5C,$5A,$59,$59,$58,$57,$56,$55,$54,$54,$53
  125. .byte $53,$52,$51,$51,$51,$50,$50,$50,$50,$50,$50,$50,$50,$50,$50,$50
  126. .byte $50,$51,$51,$51,$52,$52,$53,$54,$54,$55,$56,$57,$57,$58,$59,$5A
  127. .byte $5B,$5C,$5E,$5F,$60,$61,$62,$64,$65,$66,$67,$69,$6A,$6C,$6D,$6E
  128. .byte $70,$71,$73,$74,$76,$77,$79,$7A,$7C,$7D,$7F,$80,$81,$83,$84,$86
  129. .byte $87,$88,$8A,$8B,$8C,$8E,$8F,$90,$91,$92,$93,$94,$95,$96,$97,$98
  130. .byte $99,$9A,$9A,$9B,$9C,$9C,$9D,$9D,$9E,$9E,$9F,$9F,$9F,$9F,$9F,$9F
  131. .byte $9F,$9F,$9F,$9F,$9F,$9F,$9E,$9E,$9E,$9D,$9D,$9C,$9B,$9B,$9A,$99
  132. .byte $99,$98,$97,$96,$95,$94,$93,$92,$91,$8F,$8E,$8D,$8C,$8A,$89,$88
  133. .byte $86,$85,$84,$82,$81,$7F,$7E,$7C,$7B,$79,$78,$77,$75,$74,$72,$71
  134. .byte $6F,$6E,$6C,$6B,$6A,$68,$67,$65,$64,$63,$62,$60,$5F,$5E,$5D,$5C
  135. .byte $5B,$5A,$59,$58,$57,$56,$55,$55,$54,$53,$53,$52,$52,$51,$51,$50
  136. .byte $50,$50,$50,$50,$50,$50,$50,$50,$50,$50,$50,$51,$51,$51,$52,$52
  137. .byte $53,$53,$54,$55,$56,$56,$57,$58,$59,$5A,$5B,$5C,$5D,$5E,$5F,$61
  138. .byte $62,$63,$64,$66,$67,$68,$6A,$6B,$6D,$6E,$6F,$71,$72,$74,$75,$77
  139.  
  140.  
  141. sinus2:
  142. .byte $78,$7A,$7B,$7D,$7E,$80,$81,$82,$84,$85,$87,$88,$89,$8B,$8C,$8D
  143. .byte $8E,$90,$91,$92,$93,$94,$95,$96,$97,$98,$99,$99,$9A,$9B,$9C,$9C
  144. .byte $9D,$9D,$9E,$9E,$9E,$9F,$9F,$9F,$9F,$9F,$9F,$9F,$9F,$9F,$9F,$9F
  145. .byte $9F,$9E,$9E,$9D,$9D,$9C,$9C,$9B,$9A,$9A,$99,$98,$97,$96,$95,$94
  146. .byte $93,$92,$91,$90,$8F,$8D,$8C,$8B,$8A,$88,$87,$85,$84,$83,$81,$80
  147. .byte $7E,$7D,$7B,$7A,$78,$77,$76,$74,$73,$71,$70,$6E,$6D,$6B,$6A,$69
  148. //.byte $67,$66,$65,$63,$62,$61,$60,$5E,$5D,$5C,$5B,$5A,$59,$58,$57,$56
  149. //.byte $56,$55,$54,$54,$53,$52,$52,$51,$51,$51,$50,$50,$50,$50,$50,$50
  150. //.byte $50,$50,$50,$50,$50,$50,$51,$51,$52,$52,$53,$53,$54,$55,$55,$56
  151. //.byte $57,$58,$59,$5A,$5B,$5C,$5D,$5E,$5F,$60,$61,$63,$64,$65,$67,$68
  152. //.byte $69,$6B,$6C,$6E,$6F,$70,$72,$73,$75,$76,$78,$79,$7B,$7C,$7E,$7F
  153. //.byte $81,$82,$83,$85,$86,$88,$89,$8A,$8B,$8D,$8E,$8F,$90,$91,$93,$94
  154. //.byte $95,$96,$97,$98,$98,$99,$9A,$9B,$9B,$9C,$9D,$9D,$9E,$9E,$9E,$9F
  155. //.byte $9F,$9F,$9F,$9F,$9F,$9F,$9F,$9F,$9F,$9F,$9F,$9E,$9E,$9E,$9D,$9C
  156. // .byte $9C,$9B,$9B,$9A,$99,$98,$97,$96,$96,$95,$93,$92,$91,$90,$8F,$8E
  157. //.byte $8D,$8B,$8A,$89,$87,$86,$85,$83,$82,$80,$7F,$7D,$7C,$7A,$79,$78
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement