Advertisement
Guest User

Untitled

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