Hugo4IT

Current code

Dec 15th, 2020
563
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ; =======================================================
  2. ; |                                                     |
  3. ; |     Author: Hugo van de Kuilen from Hugo4IT.com     |
  4. ; |                                                     |
  5. ; =======================================================
  6. ; Bootloader was copied from a blog, the rest was made by me
  7.  
  8. *=$0801         ; Assembled code should start at $0801
  9.             ; (where BASIC programs start)
  10.             ; The real program starts at $0810 = 2064
  11. !byte $0C,$08       ; $080C - pointer to next line of BASIC code
  12. !byte $0A,$00       ; 2-byte line number ($000A = 10)
  13. !byte $9E       ; SYS BASIC token
  14. !byte $20       ; [space]
  15. !byte $32,$30,$36,$34   ; $32="2",$30="0",$36="6",$34="4"
  16.             ; (ASCII encoded nums for dec starting addr)
  17. !byte $00       ; End of Line
  18. !byte $00,$00       ; This is address $080C containing
  19.             ; 2-byte pointer to next line of BASIC code
  20.             ; ($0000 = end of program)
  21. *=$0810         ; Here starts the real program
  22.  
  23. ; Own code starts here:
  24.  
  25. ; Register addresses
  26. r0L=$02
  27. r0H=$03
  28. r1L=$04
  29. r1H=$05
  30. r2L=$06
  31. r2H=$07
  32. r3L=$08
  33. r3H=$09
  34. r4L=$0a
  35. r4H=$0b
  36. r5L=$0c
  37. r5H=$0d
  38. r6L=$0e
  39. r6H=$0f
  40. r7L=$10
  41. r7H=$11
  42. r8L=$12
  43. r8H=$13
  44. r9L=$14
  45. r9H=$15
  46. r10L=$16
  47. r10H=$17
  48. r11L=$18
  49. r11H=$19
  50. r12L=$1a
  51. r12H=$1b
  52. r13L=$1c
  53. r13H=$1d
  54. r14L=$1e
  55. r14H=$1f
  56. r15L=$20
  57. r15H=$21
  58.  
  59. ; API Adresses
  60. GRAPH_init=$FF20
  61. GRAPH_clear=$FF23
  62. GRAPH_set_colors=$FF29
  63. DC_VIDEO=$9F29
  64. jsr GRAPH_init
  65.  
  66. ; Setting colors
  67. lda #$1C
  68. ldx #$1C
  69. ldy #$1C
  70. jsr GRAPH_set_colors
  71.  
  72. ; Video settings bytes
  73. lda #%01110010        ; [0]1110110 Current field (idk)
  74.                       ; 0[111]0110 Sprites, Layer1 and Layer0 enable
  75.                       ; 0111[0]110 Unused
  76.                       ; 01110[1]10 Chroma disable
  77.                       ; 011101[10] Enable NTSC mode
  78. sta DC_VIDEO          ; Store video settings
  79.  
  80. mainloop:
  81.   jsr GRAPH_clear
  82.  
  83. jmp mainloop
  84.  
RAW Paste Data