Advertisement
Guest User

Untitled

a guest
Sep 25th, 2015
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.63 KB | None | 0 0
  1. processor 6502
  2. include "vcs.h"
  3. include "macro.h"
  4.  
  5. seg
  6. org $f000
  7.  
  8. Start:
  9. Temp = $80
  10. ;PatternCounter = $81
  11. ;ScrollCounter = $82
  12. ;FrameCounter = $83
  13. ;Change = $84
  14. jsr ResetRAM
  15. lda #%10110000
  16. sta Temp
  17. Reset:
  18. StartFrame:
  19.  
  20. ; Start vertical blank
  21. lda #$00
  22. sta VBLANK
  23. lda #2
  24. sta VSYNC
  25. sta WSYNC
  26. sta WSYNC
  27. sta WSYNC
  28. lda #$00
  29. sta VSYNC
  30.  
  31. ; End of Vertical Sync
  32. ldx #37
  33. vbloop:
  34. sta WSYNC
  35. dex
  36. bne vbloop
  37.  
  38. ;End of vertical blank
  39.  
  40. ; Pre values for 192 scanlines
  41. sta COLUPF
  42. lda #%00000001
  43. ; 192 Scanlines of Visible Screen
  44.  
  45. ldx #192
  46. l1:
  47. stx COLUBK
  48. sta WSYNC
  49. dex
  50. bne l1
  51. ; End of Visible Screen
  52. ; Start of VBLANK / Overscan
  53. lda #%01000010
  54. ldx #30
  55. sta VBLANK
  56. osloop:
  57. sta WSYNC
  58. dex
  59. bne osloop
  60. jmp StartFrame
  61. ResetRAM:
  62. lda #$00
  63. ldx #$80
  64. resetloop:
  65. sta Temp,x
  66. dex
  67. bne resetloop
  68. rts
  69. coltable:
  70. .byte $01,$02,$03,$04,$05,$06,$07
  71. .byte $0a,$0b,$0c,$0d,$0e,$0f,$10
  72. .byte $13,$14,$15,$16,$17,$18,$19
  73. .byte $1c,$1d,$1e,$1f,$20,$21,$22
  74. .byte $25,$26,$27,$28,$29,$2a,$2b
  75. .byte $2e,$2f,$30,$31,$32,$33,$34
  76. .byte $37,$38,$39,$3a,$3b,$3c,$3d
  77. .byte $40,$41,$42,$43,$44,$45,$46
  78. .byte $49,$4a,$4b,$4c,$4d,$4e,$4f
  79. .byte $52,$53,$54,$55,$56,$57,$58
  80. .byte $5b,$5c,$5d,$5e,$5f,$60,$61
  81. .byte $64,$65,$66,$67,$68,$69,$6a
  82. .byte $6d,$6e,$6f,$70,$71,$72,$73
  83. .byte $76,$77,$78,$79,$7a,$7b,$7c
  84. .byte $7f,$80,$81,$82,$83,$84,$85
  85. .byte $88,$89,$8a,$8b,$8c,$8d,$8e
  86. .byte $91,$92,$93,$94,$95,$96,$97
  87. .byte $9a,$9b,$9c,$9d,$9e,$9f,$a0
  88. .byte $a3,$a4,$a5,$a6,$a7,$a8,$a9
  89. .byte $ac,$ad,$ae,$af,$b0,$b1,$b2
  90. .byte $b5,$b6,$b7,$b8,$b9,$ba,$bb
  91. .byte $bc,$bd,$bc,$bd,$be,$bf
  92.  
  93. org $fffa
  94. .word Reset
  95. .word Reset
  96. .word Reset
  97. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement