Guest User

rom.asm

a guest
May 18th, 2018
32
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ;header.asm-------------------
  2. dc.l 0x00FFE000
  3. dc.l EntryPoint
  4. dc.l Exception
  5. dc.l Exception
  6. dc.l Exception
  7. dc.l Exception
  8. dc.l Exception
  9. dc.l Exception
  10. dc.l Exception
  11. dc.l Exception
  12. dc.l Exception
  13. dc.l Exception
  14. dc.l Exception
  15. dc.l Exception
  16. dc.l Exception
  17. dc.l Exception
  18. dc.l Exception
  19. dc.l Exception
  20. dc.l Exception
  21. dc.l Exception
  22. dc.l Exception
  23. dc.l Exception
  24. dc.l Exception
  25. dc.l Exception
  26. dc.l Exception
  27. dc.l Exception
  28. dc.l Exception
  29. dc.l Exception
  30. dc.l HBlankInterrupt
  31. dc.l Exception
  32. dc.l VBlankInterrupt
  33. dc.l Exception
  34. dc.l Exception
  35. dc.l Exception
  36. dc.l Exception
  37. dc.l Exception
  38. dc.l Exception
  39. dc.l Exception
  40. dc.l Exception
  41. dc.l Exception
  42. dc.l Exception
  43. dc.l Exception
  44. dc.l Exception
  45. dc.l Exception
  46. dc.l Exception
  47. dc.l Exception
  48. dc.l Exception
  49. dc.l Exception
  50. dc.l Exception
  51. dc.l Exception
  52. dc.l Exception
  53. dc.l Exception
  54. dc.l Exception
  55. dc.l Exception
  56. dc.l Exception
  57. dc.l Exception
  58. dc.l Exception
  59. dc.l Exception
  60. dc.l Exception
  61. dc.l Exception
  62. dc.l Exception
  63. dc.l Exception
  64. dc.l Exception
  65. dc.l Exception
  66.  
  67. dc.b "SEGA GENESIS"
  68. dc.b "(C)DAWNING 2018.MAY"
  69. dc.b "ROM"
  70. dc.b "ROM"
  71. dc.b "GM 00000000-00"
  72. dc.w 0x0000
  73. dc.b "J"
  74. dc.l 0x00000000
  75. dc.l __end
  76. dc.l 0x00FF0000
  77. dc.l 0x00FFFFFF
  78. dc.l 0x00000000
  79. dc.l 0x00000000
  80. dc.l 0x00000000
  81. dc.l 0x00000000
  82. dc.l 0x00000000
  83. dc.l 0x00000000
  84. dc.b " "
  85. dc.b "JUE"
  86.  
  87. ;data.asm------------------------
  88. VDPRegisters:
  89. VDPReg0: dc.b 0x14
  90. VDPReg1: dc.b 0x74
  91. VDPReg2: dc.b 0x30
  92. VDPReg3: dc.b 0x00
  93. VDPReg4: dc.b 0x07
  94. VDPReg5: dc.b 0x78
  95. VDPReg6: dc.b 0x00
  96. VDPReg7: dc.b 0x00
  97. VDPReg8: dc.b 0x00
  98. VDPReg9: dc.b 0x00
  99. VDPRegA: dc.b 0xFF
  100. VDPRegB: dc.b 0x00
  101. VDPRegC: dc.b 0x81
  102. VDPRegD: dc.b 0x3F
  103. VDPRegE: dc.b 0x00
  104. VDPRegF: dc.b 0x02
  105. VDPReg10: dc.b 0x01
  106. VDPReg11: dc.b 0x00
  107. VDPReg12: dc.b 0x00
  108. VDPReg13: dc.b 0xFF
  109. VDPReg14: dc.b 0xFF
  110. VDPReg15: dc.b 0x00
  111. VDPReg16: dc.b 0x00
  112. VDPReg17: dc.b 0x80
  113.  
  114. Z80Data:
  115. dc.w 0xAF01, 0xD91F
  116. dc.w 0x1127, 0x0021
  117. dc.w 0x2600, 0xF977
  118. dc.w 0xEDB0, 0xDDE1
  119. dc.w 0xFDE1, 0xED47
  120. dc.w 0xED4F, 0xD1E1
  121. dc.w 0xF108, 0xD9C1
  122. dc.w 0xD1E1, 0xF1F9
  123. dc.w 0xF3ED, 0x5636
  124. dc.w 0xE9E9, 0x8104
  125. dc.w 0x8F01
  126.  
  127. PSGData:
  128. dc.w 0x9FBF, 0xDFFF
  129.  
  130. ;init.asm-------------------------
  131. __init:
  132.  
  133. EntryPoint:
  134. tst.w 0x00A10008
  135. bne Main
  136. tst.w 0x00A1000C
  137. bne Main
  138.  
  139. move.l #0x00000000, d0
  140. move.l #0x00000000, a0
  141. move.l #0x00003FFF, d1
  142. @Clear:
  143. move.l d0, -(a0)
  144. dbra d1, @Clear
  145.  
  146. move.b 0x00A10001, d0
  147. andi.b #0x0F, d0
  148. beq @Skip
  149. move.l #'SEGA', 0x00A14000
  150. @Skip:
  151. move.w #0x0100, 0x00A11100
  152. move.w #0x0100, 0x00A11200
  153.  
  154. @Wait:
  155. btst #0x0, 0x00A11100
  156. bne @Wait
  157.  
  158. move.l #Z80Data, a0
  159. move.l #0x00A00000, a1
  160. move.l #0x29, d0
  161. @CopyZ80:
  162. move.b (a0)+, (a1)+
  163. dbra d0, @CopyZ80
  164.  
  165. move.w #0x0000, 0x00A11200
  166. move.w #0x0000, 0x00A11100
  167.  
  168. move.l #PSGData, a0
  169. move.l #0x03, d0
  170. @CopyPSG:
  171. move.b (a0)+, 0x00C00011
  172. dbra d0, @CopyPSG
  173.  
  174. move.l #VDPRegisters, a0
  175. move.l #0x18, d0
  176. move.l #0x00008000, d1
  177.  
  178. @CopyVDP:
  179. move.b (a0)+, d1
  180. move.w d1, 0x00C00004
  181. add.w #0x0100, d1
  182. dbra d0, @CopyVDP
  183.  
  184. move.b #0x00, 0x000A10009
  185. move.b #0x00, 0x000A1000B
  186. move.b #0x00, 0x000A1000D
  187.  
  188. move.l #0x00000000, a0
  189. movem.l (a0), d0-d7/a1-a7
  190.  
  191. jmp __main
  192.  
  193. ;palette.asm-----------------------
  194. Palette:
  195. dc.w 0x0000
  196. dc.w 0x000E
  197. dc.w 0x00E0
  198. dc.w 0x0E00
  199. dc.w 0x0000
  200. dc.w 0x0EEE
  201. dc.w 0x00EE
  202. dc.w 0x008E
  203. dc.w 0x0E0E
  204. dc.w 0x0808
  205. dc.w 0x0444
  206. dc.w 0x0888
  207. dc.w 0x0EE0
  208. dc.w 0x000A
  209. dc.w 0x0600
  210. dc.w 0x0060
  211.  
  212. ;characters.asm-------------------
  213. Characters:
  214. dc.l 0x11000110
  215. dc.l 0x11000110
  216. dc.l 0x11000110
  217. dc.l 0x11111110
  218. dc.l 0x11000110
  219. dc.l 0x11000110
  220. dc.l 0x11000110
  221. dc.l 0x00000000
  222.  
  223. dc.l 0x11111110
  224. dc.l 0x11000000
  225. dc.l 0x11000000
  226. dc.l 0x11111110
  227. dc.l 0x11000000
  228. dc.l 0x11000000
  229. dc.l 0x11111110
  230. dc.l 0x00000000
  231.  
  232. dc.l 0x11000000
  233. dc.l 0x11000000
  234. dc.l 0x11000000
  235. dc.l 0x11000000
  236. dc.l 0x11000000
  237. dc.l 0x11000000
  238. dc.l 0x11111110
  239. dc.l 0x00000000
  240.  
  241. dc.l 0x01111100
  242. dc.l 0x11000110
  243. dc.l 0x11000110
  244. dc.l 0x11000110
  245. dc.l 0x11000110
  246. dc.l 0x11000110
  247. dc.l 0x01111100
  248. dc.l 0x00000000
  249.  
  250. dc.l 0x11000110
  251. dc.l 0x11000110
  252. dc.l 0x11000110
  253. dc.l 0x11010110
  254. dc.l 0x11111110
  255. dc.l 0x11101110
  256. dc.l 0x11000110
  257. dc.l 0x00000000
  258.  
  259. dc.l 0x11111100
  260. dc.l 0x11000110
  261. dc.l 0x11000110
  262. dc.l 0x11111100
  263. dc.l 0x11000110
  264. dc.l 0x11000110
  265. dc.l 0x11000110
  266. dc.l 0x00000000
  267.  
  268. dc.l 0x11111100
  269. dc.l 0x11000110
  270. dc.l 0x11000110
  271. dc.l 0x11000110
  272. dc.l 0x11000110
  273. dc.l 0x11000110
  274. dc.l 0x11111100
  275. dc.l 0x00000000
  276.  
  277. ;main.asm---------------------------
  278. ;include 'header.asm'
  279. ;include 'init.asm'
  280. __main:
  281. move.w #0x8F02, 0x00C00004
  282. move.l #0x40000003, 0x00C00004
  283.  
  284. move.l #0xC0000003, 0x00C00004
  285. lea Palette, a0
  286. move.l #0x07, d0
  287.  
  288. move.l #0x40200000, 0x00C00004
  289. lea Characters, a0
  290. move.l #0x37, d0
  291.  
  292. @Loop:
  293. move.l (a0)+, 0x00C00000
  294. dbra d0, @Loop
  295.  
  296. move.l #0x40000003, 0x00C00004
  297. move.w #0x0001, 0x00C00000
  298.  
  299. Main:
  300. jmp Main
  301.  
  302. HBlankInterrupt:
  303. VBlankInterrupt:
  304. rte
  305.  
  306. Exception:
  307. rte
  308.  
  309. ;include 'data.asm'
  310. ;include 'palette.asm'
  311. ;include 'characters.asm'
  312.  
  313. __end
RAW Paste Data