EASY_MAC.INC 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482
  1. ************************************************************************
  2. * *
  3. * [[[ NOP ]]] EASY CML MACRO DEFINITIONS *
  4. * by S.OKADA from 92/01/07 Tue 14:56 *
  5. * *
  6. ************************************************************************
  7. ;
  8. ; *** easy command macro ***
  9. ;
  10. EASY_START MACRO
  11. MOVE.L ADRS1(A6),A0
  12. JMP (A0)
  13. ENDM
  14. EASY_CALL MACRO
  15. MOVE.L ADRS1(A6),A0
  16. JSR (A0)
  17. ENDM
  18. STEP_SAVE MACRO No,ADRS
  19. MOVE.B #No,STEP1(A6)
  20. MOVE.L #ADRS,ADRS1(A6)
  21. ENDM
  22. NEXT_CHECK MACRO BRC,No,ADRS
  23. \1 SET_\3
  24. RTS
  25. SET_\3
  26. MOVE.B #No,STEP1(A6)
  27. MOVE.L #ADRS,ADRS1(A6)
  28. ENDM
  29. END_NEXT MACRO No,ADRS
  30. MOVE.B #No,STEP1(A6)
  31. MOVE.L #ADRS,ADRS1(A6)
  32. RTS
  33. ENDM
  34. SEC_TIMER MACRO OFFS
  35. LEA.L OFFS(A6),A0
  36. JSR.S SEC_TIME
  37. ENDM
  38. SEC_TIMER_SET MACRO TIME,OFFS
  39. MOVE.B #TIME,OFFS(A6)
  40. MOVE.B SECOND_VALUE(A5),OFFS+1(A6)
  41. ENDM
  42. SUB_WORK MACRO No,AREG,LP
  43. MOVEP.W No(A6),D0
  44. CLR.B D0
  45. LEA.L -LP(A5,D0.W),AREG
  46. ENDM
  47. XREF GEN_PCHILD
  48. XREF GEN_LCHILD
  49. PCHILD MACRO NUM,TYPE,ACT_No,X,Y,PRI,CML
  50. JSR.S GEN_PCHILD
  51. DC.W \1,\2,\3,\4,\5,\6
  52. DC.L \7
  53. ENDM
  54. LCHILD MACRO NUM,SYS_TYPE,CML
  55. JSR.S GEN_LCHILD
  56. DC.W \1,\2
  57. DC.L \3
  58. ENDM
  59. OBJ_MAP MACRO ADRS
  60. LEA.L ADRS(PC),A0
  61. JSR.S OBJ_MAP_SET
  62. ENDM
  63. XREF COLOR_COM_SET
  64. COLOR_COMMAND MACRO
  65. JSR.S COLOR_COM_SET
  66. ENDM
  67. PALETTE MACRO PAL,PG,COMMAND
  68. DC.W PAL*20H
  69. DC.B PG
  70. DC.B COMMAND
  71. ENDM
  72. PG_SET EQU 10000000B
  73. FADE_OUT EQU 01110000B
  74. FADE_IN EQU 01110100B
  75. FADE_COLOR EQU 01111000B
  76. B_OUT EQU 01100000B
  77. B_IN EQU 01100100B
  78. B_COLOR EQU 01101000B
  79. G_OUT EQU 01010000B
  80. G_IN EQU 01010100B
  81. G_COLOR EQU 01011000B
  82. GB_OUT EQU 01000000B
  83. GB_IN EQU 01000100B
  84. GB_COLOR EQU 01001000B
  85. R_OUT EQU 00110000B
  86. R_IN EQU 00110100B
  87. R_COLOR EQU 00111000B
  88. RB_OUT EQU 00100000B
  89. RB_IN EQU 00100100B
  90. RB_COLOR EQU 00101000B
  91. RG_OUT EQU 00010000B
  92. RG_IN EQU 00010100B
  93. RG_COLOR EQU 00011000B
  94. RGB_OUT EQU 00000000B
  95. RGB_IN EQU 00000100B
  96. RGB_COLOR EQU 00001000B
  97. BASE_COLOR EQU 00001100B
  98. CC_SPEED0 EQU 0 128/60
  99. CC_SPEED1 EQU 1 64/60
  100. CC_SPEED2 EQU 2 32/60
  101. CC_SPEED3 EQU 3 16/60
  102. PALETTE_END MACRO
  103. DC.W -1
  104. ENDM
  105. PAL_WAIT MACRO No
  106. TST.W No*20H+COLOR_BUFFER(A5)
  107. DC.W 6702H BEQ.S *+2
  108. RTS
  109. ENDM
  110. CONT_FIX_SET MACRO
  111. MESS_ON
  112. MOVE.L A6,(A0)+
  113. SUBQ.B #2,-4(A0)
  114. MOVE.L A0,MESS_POINT(A5)
  115. MESS_OFF
  116. ENDM
  117. FIX_WORK_MESS MACRO ADRS
  118. MESS_ON
  119. MOVE.L A6,(A0)+
  120. SUBQ.B #1,-4(A0)
  121. MOVE.L #ADRS,(A0)+
  122. MESS_OFF
  123. ENDM
  124. ;
  125. ; *** nop mess out ***
  126. ;
  127. ; No 0 command end
  128. FIX_END MACRO NEXT,SAVE_CML
  129. MODE SET 0
  130. IFC 'RAM',\1
  131. MODE SET 8000H
  132. ENDC
  133. IFC 'SAVE',\2
  134. MODE SET MODE+100H
  135. ENDC
  136. DC.W MODE
  137. ENDM
  138. ; No 1 data format
  139. FIX_FORMAT MACRO TYPE,PARM
  140. MODE SET 301H
  141. IFC 'B',\0
  142. MODE SET 101H
  143. ENDC
  144. IFC 'CODE',\1
  145. MODE SET MODE-100H
  146. ENDC
  147. DC.W MODE,PARM
  148. ENDM
  149. FIX_FORMAT_T MACRO TYPE
  150. MODE SET 301H
  151. IFC 'B',\0
  152. MODE SET 101H
  153. ENDC
  154. IFC 'CODE',\1
  155. MODE SET MODE-100H
  156. ENDC
  157. DC.W MODE
  158. ENDM
  159. FIX_FORMAT_TP MACRO PARM
  160. DC.W PARM
  161. ENDM
  162. ; No 2 auto increment value
  163. FIX_AUTO MACRO INC
  164. DC.W INC*100H+2
  165. ENDM
  166. ; No 3 output v-ram address
  167. FIX_ADRS MACRO X,Y
  168. DC.W 3
  169. IFEQ NARG-1
  170. DC.W X
  171. ELSEC
  172. DC.W 7000H+20H*X+Y
  173. ENDM
  174. FIX_ADRS_T MACRO
  175. DC.W 3
  176. ENDM
  177. FIX_ADRS_TP MACRO X,Y
  178. IFEQ NARG-1
  179. DC.W X
  180. ELSEC
  181. DC.W 7000H+20H*X+Y
  182. ENDM
  183. ; No 4 get data address and data output
  184. FIX_DATA_ADRS MACRO ADRS
  185. DC.W 4
  186. DC.L ADRS
  187. ENDM
  188. ; No 5 address increment
  189. ; No 14 address increment byte type
  190. FIX_NEXT MACRO X,Y
  191. MODE SET X
  192. IFEQ NARG-2
  193. MODE SET X*20H+(Y)
  194. ENDC
  195. IFGE MODE+80H
  196. IFLT MODE-80H
  197. DC.W MODE*100H+14H
  198. ELSEC
  199. DC.W 5,MODE
  200. ENDC
  201. ELSEC
  202. DC.W 5,MODE
  203. ENDC
  204. ENDM
  205. FIX_NEXT_T MACRO
  206. DC.W 5
  207. ENDM
  208. FIX_NEXT_TP MACRO X,Y
  209. DC.W X*20H+(Y)
  210. ENDM
  211. NEXT_DIRECT MACRO X,Y
  212. MODE SET X
  213. IFEQ NARG-2
  214. MODE SET X*20H+(Y)
  215. ENDC
  216. IFGE MODE+80H
  217. IFLT MODE-80H
  218. DC.W MODE*100H+14H,7
  219. ELSEC
  220. DC.W 5,MODE,7
  221. ENDC
  222. ELSEC
  223. DC.W 5,MODE,7
  224. ENDC
  225. ENDM
  226. ; No 6 data continue output
  227. FIX_DATA_CONT MACRO
  228. DC.W 6
  229. ENDM
  230. ; No 7 direct data
  231. FIX_DIRECT_DATA MACRO
  232. DC.W 7
  233. ENDM
  234. ; No 8 common Fix 8*16 font output
  235. FIX_DOUBLE MACRO HI
  236. DC.W HI*100H+8
  237. ENDM
  238. ; No 9 common Fix 8*16 font output
  239. FIX_KANA MACRO HI
  240. DC.W HI*100H+9
  241. ENDM
  242. ; No 9 common Fix 16*16 font output
  243. FIX_KNJ MACRO HI
  244. DC.W HI*100H+18H
  245. ENDM
  246. ; No 0A sub data call
  247. FIX_CALL MACRO ADRS
  248. DC.W 0AH
  249. DC.L ADRS
  250. ENDM
  251. ; No 0B sub data return
  252. FIX_RETURN MACRO
  253. DC.W 0BH
  254. ENDM
  255. ; No 0C same data output
  256. FIX_SAME MACRO COUNT,CODE
  257. DC.W COUNT*100H+0CH,CODE
  258. ENDM
  259. ; No 0D increment data output
  260. FIX_INC_OUT MACRO COUNT,CODE
  261. DC.W COUNT*100H+0DH,CODE
  262. ENDM
  263. ; No 0E A6 work change
  264. FIX_WORK_CHANGE MACRO TARGET
  265. IFC 'MASTER',\1
  266. DC.W 800EH
  267. ELSEC
  268. DC.W TARGET*100H+0EH
  269. ENDC
  270. ENDM
  271. ; No 0F command table call
  272. FIX_TABLE MACRO WORK,OFS,TABLE
  273. IFC 'A6',\1
  274. DC.W 0FH
  275. ELSEC
  276. DC.W 10FH
  277. ENDC
  278. DC.W OFS
  279. DC.W TABLE-*
  280. ENDM
  281. ; No 17 single command table call
  282. FIX_TABLE_SING MACRO WORK,OFS,TABLE
  283. IFC 'A6',\1
  284. DC.W 17H
  285. ELSEC
  286. DC.W 117H
  287. ENDC
  288. DC.W OFS
  289. DC.W TABLE-*
  290. ENDM
  291. WORD_TBL MACRO ADRS
  292. DC.W ADRS-*
  293. ENDM
  294. ; No 10 command pointer to cml
  295. FIX_CML_POINT MACRO
  296. DC.W 10H
  297. ENDM
  298. ; No 11 cml pointer save
  299. FIX_CML_SAVE MACRO
  300. DC.W 11H
  301. ENDM
  302. ; No 12 BCD convert data table set
  303. FIX_BCD_TABLE MACRO ADRS
  304. DC.W 12H
  305. DC.L ADRS
  306. ENDM
  307. ; No 13 BCD data output by BCD table
  308. FIX_BCD_OUT MACRO ZERO,BASE,OFS,START,COUNT,X,Y,HI
  309. MODE SET 8013H+(COUNT-1)*100H
  310. IFC \0,'B'
  311. MODE SET MODE-8000H
  312. ENDC
  313. IFC 'MASK',\1
  314. MODE SET MODE+4000H
  315. ENDC
  316. IFC 'A6',\2
  317. MODE SET MODE+1000H
  318. ENDC
  319. IFC 'LOW',\4
  320. MODE SET MODE+2000H
  321. ENDC
  322. DC.W MODE,7000H+20H*X+Y,OFS
  323. DC.B HI,0
  324. ENDM
  325. ; No 15 fix continue output
  326. FIX_CONT_MODE MACRO
  327. DC.W 15H
  328. ENDM
  329. ; No 16 C language printf
  330. FIX_PRINTF MACRO
  331. DC.W 16H
  332. ENDM
  333. PARM MACRO COUNT,ADRS
  334. DC.B '%',COUNT
  335. DC.W ADRS-?A5
  336. ENDM
  337. ;
  338. ; *** fix countinue command ***
  339. ;
  340. ; CF No 00 data end
  341. CF_END MACRO
  342. DC.B CTRL_CH,0
  343. ENDM
  344. ; CF No 01 first parm set
  345. CF_FIRST MACRO BX,BY,CH_INC,LINE_INC,ATTR
  346. DC.B CTRL_CH,1
  347. DC.W 7000H+20H*BX+BY
  348. DC.W CH_INC,LINE_INC,ATTR
  349. ENDM
  350. ; CF No 02 line feed
  351. CF_LINE_FEED MACRO
  352. DC.B CTRL_CH,02
  353. ENDM
  354. ; CF No 03 next page
  355. CF_NEXT_PAGE MACRO
  356. DC.B CTRL_CH,03
  357. ENDM
  358. ; CF No 04 temporary 1 line clear
  359. CF_LINE_CLEAR MACRO X
  360. DC.B CTRL_CH,04,X
  361. ENDM
  362. ; CF No 05 page clear
  363. CF_PAGE_CLEAR MACRO X,Y
  364. DC.B CTRL_CH,05,X,Y
  365. ENDM
  366. ; CF No 06 table sub data call with d16(A5)
  367. ; CF No 07 table sub data call with d16(A6)
  368. CF_TABLE_SUB MACRO BASE,OFS,TABLE
  369. DC.B CTRL_CH
  370. IFC 'A5',\1
  371. DC.B 7
  372. ELSEC
  373. DC.B 6
  374. ENDC
  375. DC.W OFS
  376. DC.W TABLE-*
  377. ENDM
  378. ; CF No 08 return from sub data
  379. CF_SUB_RETURN MACRO
  380. DC.B CTRL_CH,08
  381. ENDM
  382. ; CF No 09 word output
  383. CF_WORD_OUT MACRO CHH,CHL
  384. DC.B CTRL_CH,09,CHH,CHL
  385. ENDM
  386. ; CF No 0A CHAR_ATTR change
  387. CF_ATTR_CHANGE MACRO CHH
  388. DC.B CTRL_CH,0AH,CHH
  389. ENDM
  390.