ACTION.SRC 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772
  1. ************************************************************************
  2. * *
  3. * [[[ NOP ]]] OBJECT ACTION PROGRAM *
  4. * *
  5. ************************************************************************
  6. XDEF MAIN_ACTION,GET_REL_POS,INIT_SORT,ORDER_SET
  7. XDEF ACTION,ACTION_SET,ACT_COUNT_SET
  8. XDEF NEXT_ACTION,HIT_AREA_SET,SORT_SET
  9. XDEF CHARA_SET
  10. XREF ?A5
  11. ;by SOUND
  12. XREF SET_SOUND,SET_SPHERO
  13. SECT.S SYS,,C
  14. INCLUDE NEO_GEO.INC @@@
  15. INCLUDE LABEL.INC
  16. CH_TABLE EQU 0FCH
  17. USER_ACT EQU 900H
  18. IFNE 0
  19. ;
  20. ; *** sprite(obj) action program sequence ***
  21. ;
  22. in main routine
  23. JSR INIT_SORT initialize SORT_WORK
  24. LOOP:
  25. JSR user PWORK move program
  26. ; (A6=temp PWORK)
  27. JSR MAIN_ACTION action logical process
  28. LOOP
  29. JSR ORDER_SET sorting order set for interruput
  30. in interrupt routine (after color generate process)
  31. JSR ACTION action physical process
  32. (output LSPC)
  33. ;
  34. ; *** logical action process ***
  35. ;
  36. MAIN_ACTION:
  37. JSR NEXT_ACTION
  38. ACT_COUNT(action counter) increment by ACT_TIMER-ACT_DEC
  39. if ACT_DEC d7=1 then action stop
  40. parameter set by ACT_No & ACT_COUNT
  41. hit area data (only ACT_COUNT=0)
  42. ACT_FLAG (d0-3 don't care)
  43. ACT_ADRS (for ACTION program)
  44. JSR HIT_AREA_SET(PC)
  45. hit area calcurate by temporary position & reduction
  46. JSR SORT_SET(PC)
  47. SORT_WORK set by PRIORITY (0=low - FF=high)
  48. RTS
  49. ORDER_SET:
  50. transfwer work No from SORT_WORK to ORDER_BUFFER
  51. by OBJ_DIV_POINT
  52. OBJ_DIV_POINT data format
  53. [order command insert prioriry No (word),
  54. order command (word-high byte don't care)],......
  55. ex.
  56. DC.W 40H,80H+5*4,0C0H,80H+2*4,-1
  57. a) b) c)
  58. a) SORT_WORK+40H insert order command 5
  59. b) SORT_WORK+C0H insert order command 2
  60. c) dummy data
  61. ;
  62. ; *** physical action process ***
  63. ;
  64. ACTION
  65. ORDER_BUFFER (sprite transfer order & command) format
  66. 0=<data<80H data is transfere PWORK No
  67. 80H=<data data is order command*4+80H
  68. order command
  69. 0 :all job end
  70. 1 :sprite group change to OBJ2 normal type
  71. 2 :sprite group change to OBJ3 normal type
  72. 3 :sprite group change to OBJ4 normal type
  73. 4 :start sprite group change to OBJ1 double type
  74. 5 :sprite group change to OBJ2 double type
  75. 6 :sprite group change to OBJ3 double type
  76. 7 :sprite group change to OBJ4 double type
  77. sprite group definition
  78. OBJ1(-4)_MAP
  79. start sprite No (word)
  80. use sprite count (word)
  81. *** double type real use sprite count*2
  82. and count set value must be 8*n. (n=1,2,3,...)
  83. start sprite group is OBJ1 normal type.
  84. *** action use parameter ***
  85. REL_X(Y) display base x(y) position
  86. use normal relocate co-ordinates
  87. DISP_X(Y) display offset
  88. ACT_ATTR action attribute bit work
  89. ACTAT_FLIP d0 softwear h flip
  90. ACTAT_ERACE d3 non use y area (=<16) clear (*1)
  91. ACTAT_CUT d4 h over display area cut (*2)
  92. ACTAT_OFF d5 non display
  93. ACTAT_FLASH d6 palette fixed by FLASH_PALETTE (*1)
  94. ACTAT_SET d7 character change (*2)
  95. (*1) flag auto clear
  96. (*2) not effectiv in double sprite type
  97. BIG_X(Y) display x(y) reduction. {(n+1)/256}
  98. PALETTE_ADD display palette add value (normal 0)
  99. FLASH_PALETTE flash palette code (set ACTAT_FLASH)
  100. ;
  101. ; *** action data format ***
  102. ;
  103. *** 1st table ***
  104. CH_TABLE:
  105. DC.L [d31-24:action max number]
  106. +[d23-0:2nd table address]
  107. DC.L ..........
  108. DC.L .......... -------ACT_No*4
  109. DC.L ..........
  110. *** 2nd table ***
  111. DC.B hit data (4 bytes)
  112. DC.L [d31-24:action time,0=action stop]
  113. +[d23-16:flag data into ACT_FLAG(d7-d0)
  114. +[d15-0:display data address offset (adrs-*)]
  115. DC.L ..........
  116. DC.L .......... -------(ACT_COUNT+1)*4
  117. DC.L ..........
  118. *** display data ***
  119. DC.W [conversion No*4] or 8000H+[offset command No*4]
  120. +[d1-0 y,x offset sign]
  121. DC.B y offset
  122. DC.B x offset
  123. offset command
  124. 0 :data end (without y,x offset)
  125. 1 :hit data change
  126. 2-5 :offset postion output WORKN0-3
  127. 6-D :user define command (long jump vector from 0C0H)
  128. *** conversion table ***
  129. CONV_TABLE(OBJT_INFO)
  130. DC.L [d31-29:conversion type]
  131. +[d28-25:y size-1(1=<y=<16)]
  132. +[d24-20:x size-1(1=<y=<32)]
  133. +[d20-0:conversion address]
  134. DC.L ..........
  135. DC.L .......... -------conversion No*4
  136. DC.L ..........
  137. *** conversion data ***
  138. [..]=common element (..)=repeat element
  139. ch.h(.l)=chara code high(low) 8bit
  140. pal=palette(8bit) art=attribute(8bit)
  141. type 0 (ch.h ch.l pal atr).....
  142. type 1 [pal][dummy byte](ch.h ch.l).....
  143. type 2 [pal][ch.h](ch.l).....
  144. type 3 [pal][dummy byte][base ch] ch code increment
  145. type 4 (ch.h ch.l pal).....
  146. type 5 [ch.h](ch.l pal).....
  147. type 6 [base ch](pal)..... ch code increment
  148. type 7 (ch.h ch.l pal atr)....
  149. atr<10H non command
  150. 10H=<atr=<7FH same data at atr/10H+1 times
  151. 80H=<atr=<FFH same pal,atr data at (atr-80H)/10H+1 times
  152. ie. {ch.h ch.l [pal atr]}(ch.h ch.l).....
  153. type 1-6 non attribute
  154. ENDC
  155. ;
  156. ; *** ACTION PROGRAM IN INTERRUPT ROUTINE ***
  157. ;
  158. ACTION:
  159. LEA.L LSPC_DATA,A2
  160. JSR DB_SEND(PC)
  161. JSR SET_OBJ1(PC)
  162. BCHG.B #0,TEMP_SPG(A5)
  163. LEA.L ORDER_BUFFER(A5),A3
  164. TST.B TEMP_ORDER(A5)
  165. BEQ.S ACT_1
  166. LEA.L 128(A3),A3
  167. ACT_1:
  168. ; loop top normal type
  169. ACT_2:
  170. MOVE.B (A3)+,(A5)
  171. BMI ORDER_COMMAND
  172. MOVE.W (A5),D0
  173. TST.W TYPE(A5,D0.W)
  174. BLE.S ACT_1 work non used or busy
  175. BTST.B #ACTAT_OFF,ACT_ATTR(A5,D0.W)
  176. BNE.S ACT_1 action not ready
  177. LEA.L 0(A5,D0.W),A6
  178. JSR GET_PWORK_VALUE(PC) PWORK parameter set
  179. MOVE.W TEMP_PAL_COM(A5),TEMP_PAL_COM2(A5)
  180. MOVE.L ACT_ADRS(A6),A0
  181. MOVE.W TEMP_SPRITE(A5),D3
  182. CMP.W SPRITE_POS(A6),D3
  183. BEQ.S ACT_3
  184. BSET.B #ACTAT_SET,ACT_ATTR(A6) physical sprite move ch write flag set
  185. MOVE.W D3,SPRITE_POS(A6)
  186. ACT_3:
  187. MOVE.L (A0)+,CONV_MARK(A5)
  188. MOVE.W CONV_MARK(A5),D4
  189. BPL.S ACT_4
  190. JSR OFFSET_COMMAND(PC)
  191. BEQ ACT_3
  192. BPL ACT_1
  193. ACT_4:
  194. JSR GET_CONV_TYPE(PC) conversion parameter set
  195. MOVE.W MAX_SPRITE(A5),D0
  196. SUB.W D6,D0
  197. BLS ACT_1 sprite over
  198. MOVE.W D0,MAX_SPRITE(A5)
  199. MOVE.W TEMP_SPRITE(A5),D4
  200. TST.B ACT_ATTR(A6)
  201. BPL NON_ACT chara no change
  202. MOVEQ.L #0,D0
  203. JSR FIRST_Y_SET(PC) y clear & chane set
  204. MOVE.W #0,(A2)
  205. JSR GET_Y_OFFSET(PC)
  206. JSR GET_Y_VALUE(PC)
  207. MOVE.W D1,START_V_VALUE(A5) y value store
  208. JSR GET_X_OFFSET(PC)
  209. ADD.W #SP_H-SP_V,D4
  210. ADD.W REL_X(A6),D1
  211. BTST.B #ACTAT_CUT,ACT_ATTR(A6)
  212. BEQ.S ACT_5
  213. JSR H_OUT_CUT(PC) h over area cut
  214. ACT_5:
  215. MOVE.W D4,-2(A2)
  216. LSL.W #7,D1
  217. MOVE.W D1,(A2) x value write
  218. JSR BIG_SET(PC)
  219. JSR CHARA_SET(PC) character write
  220. MOVE.W TEMP_PAL_COM2(A5),TEMP_PAL_COM(A5)
  221. BTST.B #ACTAT_KEEP,ACT_ATTR(A6)
  222. BNE ACT_3
  223. MOVE.L START_V_ADRS(A5),-2(A2) y value write
  224. JMP ACT_3(PC)
  225. ACTDB_1:
  226. ; action double sprite type loop top
  227. MOVE.B (A3)+,(A5)
  228. BMI ORDER_COMMAND
  229. ACTDB_2:
  230. MOVE.W (A5),D0
  231. TST.W TYPE(A5,D0.W)
  232. BLE.S ACTDB_1 work non used or busy
  233. BTST.B #ACTAT_OFF,ACT_ATTR(A5,D0.W)
  234. BNE.S ACTDB_1 action not ready
  235. LEA.L 0(A5,D0.W),A6
  236. JSR GET_PWORK_VALUE(PC)
  237. MOVE.W TEMP_PAL_COM(A5),TEMP_PAL_COM2(A5)
  238. MOVE.L ACT_ADRS(A6),A0
  239. MOVE.W TEMP_SPRITE(A5),SPRITE_POS(A6)
  240. BSET.B #ACTAT_SET,ACT_ATTR(A6)
  241. ACTDB_3:
  242. MOVE.L (A0)+,CONV_MARK(A5)
  243. MOVE.W CONV_MARK(A5),D4
  244. BPL.S ACTDB_4
  245. JSR OFFSET_COMMAND(PC)
  246. BEQ ACTDB_3
  247. BPL ACTDB_1
  248. ACTDB_4:
  249. JSR GET_CONV_TYPE(PC)
  250. MOVE.W MAX_SPRITE(A5),D0
  251. SUB.W D6,D0
  252. BLO ACTDB_1 sprite over
  253. MOVE.W D0,MAX_SPRITE(A5)
  254. MOVE.W TEMP_SPRITE(A5),D4
  255. JSR GET_Y_OFFSET(PC)
  256. JSR GET_Y_VALUE(PC)
  257. JSR Y_VAL_SET_DB(PC)
  258. JSR GET_X_OFFSET(PC)
  259. ADD.W #SP_H,D4
  260. ADD.W REL_X(A6),D1
  261. BTST.B #ACTAT_CUT,ACT_ATTR(A6)
  262. BEQ.S ACTDB_5
  263. JSR H_OUT_CUT(PC) h over area cut
  264. ACTDB_5:
  265. MOVE.W D4,-2(A2)
  266. LSL.W #7,D1
  267. MOVE.W D1,(A2)
  268. JSR BIG_SET(PC)
  269. JSR CHARA_SET(PC)
  270. MOVE.W TEMP_PAL_COM2(A5),TEMP_PAL_COM(A5)
  271. JMP ACTDB_3(PC)
  272. Y_VAL_SET_DB:
  273. ; chain bit set and active 0
  274. ; in) D6=x size
  275. ; D1=y value
  276. MOVE.W D1,(A4)
  277. ADD.W D6,A4
  278. ADD.W D6,A4
  279. RTS
  280. CHARA_SET:
  281. MOVE.W TEMP_SPRITE(A5),D3
  282. ADD.W D6,TEMP_SPRITE(A5)
  283. MOVE.W ERACE_CHARA(A5),D0
  284. TST.B ERACE_16(A5)
  285. BEQ.S CHARA_SET_1
  286. MOVEQ.L #16,D0
  287. SUB.W D5,D0
  288. CHARA_SET_1:
  289. SUBQ.W #1,D5
  290. SUBQ.W #1,D6
  291. MOVE.W D0,ERACE_CHARA(A5)
  292. MOVE.W H_FLIP_FLAG(A5),D2
  293. BNE CHS_FLIP
  294. MOVEQ.L #40H,D4
  295. LSL.W #6,D3
  296. MOVE.W TEMP_PAL_COM(A5),D1
  297. BEQ CHS_NN
  298. TST.B D1
  299. BNE CHS_NF
  300. CHS_NA:
  301. ; palette addition type
  302. MOVEQ.L #0,D0
  303. MOVE.B CONV_TYPE(A5),D0
  304. JMP CHS_NA_TBL(PC,D0.W)
  305. CHS_NA_TBL:
  306. JMP CHS_NA_T0(PC)
  307. JMP CHS_NA_T1(PC)
  308. JMP CHS_NA_T2(PC)
  309. JMP CHS_NA_T3(PC)
  310. JMP CHS_NA_T4(PC)
  311. JMP CHS_NA_T5(PC)
  312. JMP CHS_NA_T6(PC)
  313. JMP CHS_NA_T7(PC)
  314. CHS_NA_T0:
  315. MOVE.W D3,-2(A2)
  316. MOVE.W D5,D7
  317. CHS_NA_T0_1:
  318. MOVE.W (A1)+,(A2)
  319. MOVE.W (A1)+,D0
  320. ADD.W D1,D0
  321. MOVE.W D0,(A2)
  322. DBRA D7,CHS_NA_T0_1
  323. MOVE.W ERACE_CHARA(A5),D7
  324. BEQ.S CHS_NA_T0_3
  325. MOVE.W #2,2(A2)
  326. MOVEQ.L #0,D0
  327. CHS_NA_T0_2:
  328. MOVE.W D0,(A2)
  329. SUBQ.W #1,D7
  330. BNE.S CHS_NA_T0_2
  331. MOVE.W #1,2(A2)
  332. CHS_NA_T0_3:
  333. ADD.W D4,D3
  334. DBRA D6,CHS_NA_T0
  335. RTS
  336. CHS_NA_T1:
  337. ADD.W (A1)+,D1
  338. CLR.B D1
  339. CHS_NA_T1_0:
  340. MOVE.W D3,-2(A2)
  341. MOVE.W D5,D7
  342. CHS_NA_T1_1:
  343. MOVE.W (A1)+,(A2)
  344. NOP
  345. MOVE.W D1,(A2)
  346. DBRA D7,CHS_NA_T1_1
  347. MOVE.W ERACE_CHARA(A5),D7
  348. BEQ.S CHS_NA_T1_3
  349. MOVE.W #2,2(A2)
  350. MOVEQ.L #0,D0
  351. CHS_NA_T1_2:
  352. MOVE.W D0,(A2)
  353. SUBQ.W #1,D7
  354. BNE.S CHS_NA_T1_2
  355. MOVE.W #1,2(A2)
  356. CHS_NA_T1_3:
  357. ADD.W D4,D3
  358. DBRA D6,CHS_NA_T1_0
  359. RTS
  360. CHS_NA_T2:
  361. MOVE.B 1(A1),(A5)
  362. MOVE.W (A5),D2
  363. ADD.W (A1)+,D1
  364. CLR.B D1
  365. CHS_NA_T2_0:
  366. MOVE.W D3,-2(A2)
  367. MOVE.W D5,D7
  368. CHS_NA_T2_1:
  369. MOVE.B (A1)+,D2
  370. MOVE.W D2,(A2)
  371. NOP
  372. MOVE.W D1,(A2)
  373. DBRA D7,CHS_NA_T2_1
  374. MOVE.W ERACE_CHARA(A5),D7
  375. BEQ.S CHS_NA_T2_3
  376. MOVE.W #2,2(A2)
  377. MOVEQ.L #0,D0
  378. CHS_NA_T2_2:
  379. MOVE.W D0,(A2)
  380. SUBQ.W #1,D7
  381. BNE.S CHS_NA_T2_2
  382. MOVE.W #1,2(A2)
  383. CHS_NA_T2_3:
  384. ADD.W D4,D3
  385. DBRA D6,CHS_NA_T2_0
  386. RTS
  387. CHS_NA_T3:
  388. ADD.W (A1)+,D1
  389. CLR.B D1
  390. MOVE.W (A1)+,D2
  391. CHS_NA_T3_0:
  392. MOVE.W D3,-2(A2)
  393. MOVE.W D5,D7
  394. CHS_NA_T3_1:
  395. MOVE.W D2,(A2)
  396. ADDQ.W #1,D2
  397. MOVE.W D1,(A2)
  398. DBRA D7,CHS_NA_T3_1
  399. MOVE.W ERACE_CHARA(A5),D7
  400. BEQ.S CHS_NA_T3_3
  401. MOVE.W #2,2(A2)
  402. MOVEQ.L #0,D0
  403. CHS_NA_T3_2:
  404. MOVE.W D0,(A2)
  405. SUBQ.W #1,D7
  406. BNE.S CHS_NA_T3_2
  407. MOVE.W #1,2(A2)
  408. CHS_NA_T3_3:
  409. ADD.W D4,D3
  410. DBRA D6,CHS_NA_T3_0
  411. RTS
  412. CHS_NA_T4:
  413. CLR.W (A5)
  414. CHS_NA_T4_0:
  415. MOVE.W D3,-2(A2)
  416. MOVE.W D5,D7
  417. CHS_NA_T4_1:
  418. MOVE.B (A1)+,(A5)
  419. MOVE.W (A5),D0
  420. MOVE.B (A1)+,D0
  421. MOVE.W D0,(A2)
  422. MOVE.B (A1)+,(A5)
  423. MOVE.W (A5),D0
  424. ADD.W D1,D0
  425. MOVE.W D0,(A2)
  426. DBRA D7,CHS_NA_T4_1
  427. MOVE.W ERACE_CHARA(A5),D7
  428. BEQ.S CHS_NA_T4_3
  429. MOVE.W #2,2(A2)
  430. MOVEQ.L #0,D0
  431. CHS_NA_T4_2:
  432. MOVE.W D0,(A2)
  433. SUBQ.W #1,D7
  434. BNE.S CHS_NA_T4_2
  435. MOVE.W #1,2(A2)
  436. CHS_NA_T4_3:
  437. ADD.W D4,D3
  438. DBRA D6,CHS_NA_T4_0
  439. RTS
  440. CHS_NA_T5:
  441. MOVE.B (A1)+,(A5)
  442. MOVE.W (A5),D2
  443. CLR.W (A5)
  444. CHS_NA_T5_0:
  445. MOVE.W D3,-2(A2)
  446. MOVE.W D5,D7
  447. CHS_NA_T5_1:
  448. MOVE.B (A1)+,D2
  449. MOVE.W D2,(A2)
  450. MOVE.B (A1)+,(A5)
  451. MOVE.W (A5),D0
  452. ADD.W D1,D0
  453. MOVE.W D0,(A2)
  454. DBRA D7,CHS_NA_T5_1
  455. MOVE.W ERACE_CHARA(A5),D7
  456. BEQ.S CHS_NA_T5_3
  457. MOVE.W #2,2(A2)
  458. MOVEQ.L #0,D0
  459. CHS_NA_T5_2:
  460. MOVE.W D0,(A2)
  461. SUBQ.W #1,D7
  462. BNE.S CHS_NA_T5_2
  463. MOVE.W #1,2(A2)
  464. CHS_NA_T5_3:
  465. ADD.W D4,D3
  466. DBRA D6,CHS_NA_T5_0
  467. RTS
  468. CHS_NA_T6:
  469. MOVE.W (A1)+,D2
  470. CLR.W (A5)
  471. CHS_NA_T6_0:
  472. MOVE.W D3,-2(A2)
  473. MOVE.W D5,D7
  474. CHS_NA_T6_1:
  475. MOVE.W D2,(A2)
  476. ADDQ.W #1,D2
  477. MOVE.B (A1)+,(A5)
  478. MOVE.W (A5),D0
  479. ADD.W D1,D0
  480. MOVE.W D0,(A2)
  481. DBRA D7,CHS_NA_T6_1
  482. MOVE.W ERACE_CHARA(A5),D7
  483. BEQ.S CHS_NA_T6_3
  484. MOVE.W #2,2(A2)
  485. MOVEQ.L #0,D0
  486. CHS_NA_T6_2:
  487. MOVE.W D0,(A2)
  488. SUBQ.W #1,D7
  489. BNE.S CHS_NA_T6_2
  490. MOVE.W #1,2(A2)
  491. CHS_NA_T6_3:
  492. ADD.W D4,D3
  493. DBRA D6,CHS_NA_T6_0
  494. RTS
  495. CHS_NA_T7:
  496. MOVE.W D3,-2(A2)
  497. MOVE.W D5,D7
  498. CHS_NA_T7_1:
  499. MOVE.W (A1)+,(A2)
  500. MOVE.W (A1)+,D2
  501. ADD.W D1,D2
  502. MOVE.W D2,(A2)
  503. CMP.B #10H,D2
  504. BHS.S CHS_NA_T7_3
  505. CHS_NA_T7_2:
  506. DBRA D7,CHS_NA_T7_1
  507. BSR CHS_T7_NEXT
  508. BRA.S CHS_NA_T7_1
  509. CHS_NA_T7_3:
  510. DBRA D7,CHS_NA_T7_4
  511. BSR CHS_T7_NEXT
  512. CHS_NA_T7_4:
  513. TST.B D2
  514. BMI.S CHS_NA_T7_6
  515. MOVE.W -4(A1),D0
  516. CHS_NA_T7_5:
  517. MOVE.W D0,(A2)
  518. SUB.B #10H,D2
  519. MOVE.W D2,(A2)
  520. CMP.B #10H,D2
  521. BCS CHS_NA_T7_2
  522. DBRA D7,CHS_NA_T7_5
  523. BSR CHS_T7_NEXT
  524. BRA CHS_NA_T7_5
  525. CHS_NA_T7_6:
  526. MOVE.W (A1)+,(A2)
  527. SUB.B #10H,D2
  528. MOVE.W D2,(A2)
  529. CMP.B #90H,D2
  530. BCS CHS_NA_T7_2
  531. DBRA D7,CHS_NA_T7_6
  532. BSR CHS_T7_NEXT
  533. BRA CHS_NA_T7_6
  534. CHS_NF:
  535. ; palette fix type
  536. MOVEQ.L #0,D0
  537. MOVE.B CONV_TYPE(A5),D0
  538. JMP CHS_NF_TBL(PC,D0.W)
  539. CHS_NF_TBL:
  540. JMP CHS_NF_T0(PC)
  541. JMP CHS_NF_T1(PC)
  542. JMP CHS_NF_T2(PC)
  543. JMP CHS_NF_T3(PC)
  544. JMP CHS_NF_T4(PC)
  545. JMP CHS_NF_T5(PC)
  546. JMP CHS_NF_T6(PC)
  547. JMP CHS_NF_T7(PC)
  548. CHS_NF_T0:
  549. MOVE.W D3,-2(A2)
  550. MOVE.W D5,D7
  551. CHS_NF_T0_1:
  552. MOVE.W (A1),(A2)
  553. MOVE.B 3(A1),D1
  554. MOVE.W D1,(A2)
  555. ADDQ.W #4,A1
  556. DBRA D7,CHS_NF_T0_1
  557. MOVE.W ERACE_CHARA(A5),D7
  558. BEQ.S CHS_NF_T0_3
  559. MOVE.W #2,2(A2)
  560. MOVEQ.L #0,D0
  561. CHS_NF_T0_2:
  562. MOVE.W D0,(A2)
  563. SUBQ.W #1,D7
  564. BNE.S CHS_NF_T0_2
  565. MOVE.W #1,2(A2)
  566. CHS_NF_T0_3:
  567. ADD.W D4,D3
  568. DBRA D6,CHS_NF_T0
  569. RTS
  570. CHS_NF_T1:
  571. ADDQ.W #2,A1
  572. CLR.B D1
  573. JMP CHS_NA_T1_0(PC)
  574. CHS_NF_T2:
  575. MOVE.B 1(A1),(A5)
  576. MOVE.W (A5),D2
  577. ADDQ.W #2,A1
  578. CLR.B D1
  579. JMP CHS_NA_T2_0(PC)
  580. CHS_NF_T3:
  581. CLR.B D1
  582. MOVE.W 2(A1),D2
  583. ADDQ.W #4,A1
  584. JMP CHS_NA_T3_0(PC)
  585. CHS_NF_T4:
  586. CLR.B D1
  587. CHS_NF_T4_0:
  588. MOVE.W D3,-2(A2)
  589. MOVE.W D5,D7
  590. CHS_NF_T4_1:
  591. MOVE.B (A1)+,(A5)
  592. MOVE.W (A5),D0
  593. MOVE.B (A1),D0
  594. MOVE.W D0,(A2)
  595. ADDQ.W #2,A1
  596. MOVE.W D1,(A2)
  597. DBRA D7,CHS_NF_T4_1
  598. MOVE.W ERACE_CHARA(A5),D7
  599. BEQ.S CHS_NF_T4_3
  600. MOVE.W #2,2(A2)
  601. MOVEQ.L #0,D0
  602. CHS_NF_T4_2:
  603. MOVE.W D0,(A2)
  604. SUBQ.W #1,D7
  605. BNE.S CHS_NF_T4_2
  606. MOVE.W #1,2(A2)
  607. CHS_NF_T4_3:
  608. ADD.W D4,D3
  609. DBRA D6,CHS_NF_T4_0
  610. RTS
  611. CHS_NF_T5:
  612. MOVE.B (A1)+,(A5)
  613. MOVE.W (A5),D2
  614. CLR.B D1
  615. CHS_NF_T5_0:
  616. MOVE.W D3,-2(A2)
  617. MOVE.W D5,D7
  618. CHS_NF_T5_1:
  619. MOVE.B (A1),D2
  620. MOVE.W D2,(A2)
  621. ADDQ.W #2,A1
  622. MOVE.W D1,(A2)
  623. DBRA D7,CHS_NF_T5_1
  624. MOVE.W ERACE_CHARA(A5),D7
  625. BEQ.S CHS_NF_T5_3
  626. MOVE.W #2,2(A2)
  627. MOVEQ.L #0,D0
  628. CHS_NF_T5_2:
  629. MOVE.W D0,(A2)
  630. SUBQ.W #1,D7
  631. BNE.S CHS_NF_T5_2
  632. MOVE.W #1,2(A2)
  633. CHS_NF_T5_3:
  634. ADD.W D4,D3
  635. DBRA D6,CHS_NF_T5_0
  636. RTS
  637. CHS_NF_T6:
  638. MOVE.W (A1),D2
  639. CLR.B D1
  640. CHS_NF_T6_0:
  641. MOVE.W D3,-2(A2)
  642. MOVE.W D5,D7
  643. CHS_NF_T6_1:
  644. MOVE.W D2,(A2)
  645. ADDQ.W #1,D2
  646. MOVE.W D1,(A2)
  647. DBRA D7,CHS_NF_T6_1
  648. MOVE.W ERACE_CHARA(A5),D7
  649. BEQ.S CHS_NF_T6_3
  650. MOVE.W #2,2(A2)
  651. MOVEQ.L #0,D0
  652. CHS_NF_T6_2:
  653. MOVE.W D0,(A2)
  654. SUBQ.W #1,D7
  655. BNE.S CHS_NF_T6_2
  656. MOVE.W #1,2(A2)
  657. CHS_NF_T6_3:
  658. ADD.W D4,D3
  659. DBRA D6,CHS_NF_T6_0
  660. RTS
  661. CHS_NF_T7:
  662. MOVEQ.L #10H,D2
  663. MOVE.W D3,-2(A2)
  664. MOVE.W D5,D7
  665. CHS_NF_T7_1:
  666. MOVE.W (A1),(A2)
  667. MOVE.B 1(A1),D1
  668. MOVE.W D1,(A2)
  669. CMP.B D2,D1
  670. BHS.S CHS_NF_T7_3
  671. ADDQ.W #4,A1
  672. CHS_NF_T7_2:
  673. DBRA D7,CHS_NF_T7_1
  674. BSR CHS_T7_NEXT
  675. BRA.S CHS_NF_T7_1
  676. CHS_NF_T7_3:
  677. DBRA D7,CHS_NF_T7_4
  678. BSR CHS_T7_NEXT
  679. CHS_NF_T7_4:
  680. TST.B D1
  681. BMI.S CHS_NF_T7_6
  682. MOVE.W (A1),D0
  683. ADDQ.W #4,A1
  684. CHS_NF_T7_5:
  685. MOVE.W D0,(A2)
  686. SUB.B D2,D1
  687. MOVE.W D1,(A2)
  688. CMP.B D2,D1
  689. BCS CHS_NF_T7_2
  690. DBRA D7,CHS_NF_T7_5
  691. BSR CHS_T7_NEXT
  692. BRA CHS_NF_T7_5
  693. CHS_NF_T7_6:
  694. ADDQ.W #4,A1
  695. CHS_NF_T7_7:
  696. MOVE.W (A1)+,(A2)
  697. SUB.B D2,D1
  698. MOVE.W D1,(A2)
  699. CMP.B #90H,D1
  700. BCS CHS_NF_T7_2
  701. DBRA D7,CHS_NF_T7_7
  702. BSR CHS_T7_NEXT
  703. BRA CHS_NF_T7_7
  704. CHS_NN:
  705. ; normal type
  706. MOVEQ.L #0,D0
  707. MOVE.B CONV_TYPE(A5),D0
  708. JMP CHS_NN_TBL(PC,D0.W)
  709. CHS_NN_TBL:
  710. JMP CHS_NN_T0(PC)
  711. JMP CHS_NN_T1(PC)
  712. JMP CHS_NN_T2(PC)
  713. JMP CHS_NN_T3(PC)
  714. JMP CHS_NN_T4(PC)
  715. JMP CHS_NN_T5(PC)
  716. JMP CHS_NN_T6(PC)
  717. JMP CHS_NN_T7(PC)
  718. CHS_NN_T0:
  719. MOVE.W D3,-2(A2)
  720. MOVE.W D5,D7
  721. CHS_NN_T0_1:
  722. MOVE.W (A1)+,(A2)
  723. MOVE.W (A1)+,(A2)
  724. DBRA D7,CHS_NN_T0_1
  725. MOVE.W ERACE_CHARA(A5),D7
  726. BEQ.S CHS_NN_T0_3
  727. MOVE.W #2,2(A2)
  728. MOVEQ.L #0,D0
  729. CHS_NN_T0_2:
  730. MOVE.W D0,(A2)
  731. SUBQ.W #1,D7
  732. BNE.S CHS_NN_T0_2
  733. MOVE.W #1,2(A2)
  734. CHS_NN_T0_3:
  735. ADD.W D4,D3
  736. DBRA D6,CHS_NN_T0
  737. RTS
  738. CHS_NN_T1:
  739. MOVE.W (A1)+,D1
  740. CLR.B D1
  741. JMP CHS_NA_T1_0(PC)
  742. CHS_NN_T2:
  743. MOVE.B 1(A1),(A5)
  744. MOVE.W (A5),D2
  745. MOVE.W (A1)+,D1
  746. CLR.B D1
  747. JMP CHS_NA_T2_0(PC)
  748. CHS_NN_T3:
  749. MOVE.W (A1)+,D1
  750. CLR.B D1
  751. MOVE.W (A1)+,D2
  752. JMP CHS_NA_T3_0(PC)
  753. CHS_NN_T4:
  754. CLR.W (A5)
  755. CHS_NN_T4_0:
  756. MOVE.W D3,-2(A2)
  757. MOVE.W D5,D7
  758. CHS_NN_T4_1:
  759. MOVE.B (A1)+,(A5)
  760. MOVE.W (A5),D0
  761. MOVE.B (A1)+,D0
  762. MOVE.W D0,(A2)
  763. MOVE.B (A1)+,(A5)
  764. MOVE.W (A5),(A2)
  765. DBRA D7,CHS_NN_T4_1
  766. MOVE.W ERACE_CHARA(A5),D7
  767. BEQ.S CHS_NN_T4_3
  768. MOVE.W #2,2(A2)
  769. MOVEQ.L #0,D0
  770. CHS_NN_T4_2:
  771. MOVE.W D0,(A2)
  772. SUBQ.W #1,D7
  773. BNE.S CHS_NN_T4_2
  774. MOVE.W #1,2(A2)
  775. CHS_NN_T4_3:
  776. ADD.W D4,D3
  777. DBRA D6,CHS_NN_T4_0
  778. RTS
  779. CHS_NN_T5:
  780. MOVE.B (A1)+,(A5)
  781. MOVE.W (A5),D2
  782. CLR.W (A5)
  783. CHS_NN_T5_0:
  784. MOVE.W D3,-2(A2)
  785. MOVE.W D5,D7
  786. CHS_NN_T5_1:
  787. MOVE.B (A1)+,D2
  788. MOVE.W D2,(A2)
  789. MOVE.B (A1)+,(A5)
  790. MOVE.W (A5),(A2)
  791. DBRA D7,CHS_NN_T5_1
  792. MOVE.W ERACE_CHARA(A5),D7
  793. BEQ.S CHS_NN_T5_3
  794. MOVE.W #2,2(A2)
  795. MOVEQ.L #0,D0
  796. CHS_NN_T5_2:
  797. MOVE.W D0,(A2)
  798. SUBQ.W #1,D7
  799. BNE.S CHS_NN_T5_2
  800. MOVE.W #1,2(A2)
  801. CHS_NN_T5_3:
  802. ADD.W D4,D3
  803. DBRA D6,CHS_NN_T5_0
  804. RTS
  805. CHS_NN_T6:
  806. MOVE.W (A1)+,D2
  807. CLR.W (A5)
  808. CHS_NN_T6_0:
  809. MOVE.W D3,-2(A2)
  810. MOVE.W D5,D7
  811. CHS_NN_T6_1:
  812. MOVE.W D2,(A2)
  813. ADDQ.W #1,D2
  814. MOVE.B (A1)+,(A5)
  815. MOVE.W (A5),(A2)
  816. DBRA D7,CHS_NN_T6_1
  817. MOVE.W ERACE_CHARA(A5),D7
  818. BEQ.S CHS_NN_T6_3
  819. MOVE.W #2,2(A2)
  820. MOVEQ.L #0,D0
  821. CHS_NN_T6_2:
  822. MOVE.W D0,(A2)
  823. SUBQ.W #1,D7
  824. BNE.S CHS_NN_T6_2
  825. MOVE.W #1,2(A2)
  826. CHS_NN_T6_3:
  827. ADD.W D4,D3
  828. DBRA D6,CHS_NN_T6_0
  829. RTS
  830. CHS_NN_T7:
  831. MOVEQ.L #10H,D2
  832. MOVE.W D3,-2(A2)
  833. MOVE.W D5,D7
  834. CHS_NN_T7_1:
  835. MOVE.W (A1)+,(A2)
  836. MOVE.W (A1)+,(A2)
  837. CMP.B -1(A1),D2
  838. BLS.S CHS_NN_T7_3
  839. CHS_NN_T7_2:
  840. DBRA D7,CHS_NN_T7_1
  841. BSR CHS_T7_NEXT
  842. BRA.S CHS_NN_T7_1
  843. CHS_NN_T7_3:
  844. DBRA D7,CHS_NN_T7_4
  845. BSR CHS_T7_NEXT
  846. CHS_NN_T7_4:
  847. MOVE.W -4(A1),D0
  848. MOVE.W -2(A1),D1
  849. TST.B D1
  850. BMI.S CHS_NN_T7_6
  851. CHS_NN_T7_5:
  852. MOVE.W D0,(A2)
  853. SUB.B D2,D1
  854. MOVE.W D1,(A2)
  855. CMP.B D2,D1
  856. BCS CHS_NN_T7_2
  857. DBRA D7,CHS_NN_T7_5
  858. BSR CHS_T7_NEXT
  859. BRA CHS_NN_T7_5
  860. CHS_NN_T7_6:
  861. MOVE.W (A1)+,(A2)
  862. SUB.B D2,D1
  863. MOVE.W D1,(A2)
  864. CMP.B #90H,D1
  865. BCS CHS_NN_T7_2
  866. DBRA D7,CHS_NN_T7_6
  867. BSR CHS_T7_NEXT
  868. BRA CHS_NN_T7_6
  869. CHS_FLIP:
  870. MOVEQ.L #-40H,D4
  871. ADD.W D6,D3
  872. LSL.W #6,D3
  873. MOVE.W TEMP_PAL_COM(A5),D1
  874. BEQ CHS_HN
  875. TST.B D1
  876. BNE CHS_HF
  877. CHS_HA:
  878. ; palette addition type
  879. MOVEQ.L #0,D0
  880. MOVE.B CONV_TYPE(A5),D0
  881. JMP CHS_HA_TBL(PC,D0.W)
  882. CHS_HA_TBL:
  883. JMP CHS_HA_T0(PC)
  884. JMP CHS_HA_T1(PC)
  885. JMP CHS_HA_T2(PC)
  886. JMP CHS_HA_T3(PC)
  887. JMP CHS_HA_T4(PC)
  888. JMP CHS_HA_T5(PC)
  889. JMP CHS_HA_T6(PC)
  890. JMP CHS_HA_T7(PC)
  891. CHS_HA_T0:
  892. MOVE.W D3,-2(A2)
  893. MOVE.W D5,D7
  894. CHS_HA_T0_1:
  895. MOVE.W (A1)+,(A2)
  896. MOVE.W (A1)+,D0
  897. ADD.W D1,D0
  898. EOR.W D2,D0
  899. MOVE.W D0,(A2)
  900. DBRA D7,CHS_HA_T0_1
  901. MOVE.W ERACE_CHARA(A5),D7
  902. BEQ.S CHS_HA_T0_3
  903. MOVE.W #2,2(A2)
  904. MOVEQ.L #0,D0
  905. CHS_HA_T0_2:
  906. MOVE.W D0,(A2)
  907. SUBQ.W #1,D7
  908. BNE.S CHS_HA_T0_2
  909. MOVE.W #1,2(A2)
  910. CHS_HA_T0_3:
  911. ADD.W D4,D3
  912. DBRA D6,CHS_HA_T0
  913. RTS
  914. CHS_HA_T1:
  915. ADD.W (A1)+,D1
  916. MOVE.B D2,D1
  917. JMP CHS_NA_T1_0(PC)
  918. CHS_HA_T2:
  919. ADD.W (A1)+,D1
  920. MOVE.B D2,D1
  921. MOVE.B -1(A1),(A5)
  922. MOVE.W (A5),D2
  923. JMP CHS_NA_T2_0(PC)
  924. CHS_HA_T3:
  925. ADD.W (A1)+,D1
  926. MOVE.B D2,D1
  927. MOVE.W (A1)+,D2
  928. JMP CHS_NA_T3_0(PC)
  929. CHS_HA_T4:
  930. MOVE.W D2,(A5)
  931. JSR CHS_NA_T4_0(PC)
  932. CLR.W (A5)
  933. RTS
  934. CHS_HA_T5:
  935. MOVE.B (A1)+,(A5)
  936. MOVE.W (A5),D2
  937. MOVE.W #1,(A5)
  938. JSR CHS_NA_T5_0(PC)
  939. CLR.W (A5)
  940. RTS
  941. CHS_HA_T6:
  942. MOVE.W D2,(A5)
  943. MOVE.W (A1)+,D2
  944. JSR CHS_NA_T6_0(PC)
  945. CLR.W (A5)
  946. RTS
  947. CHS_HA_T7:
  948. MOVEQ.L #10H,D2
  949. MOVE.W D3,-2(A2)
  950. MOVE.W D5,D7
  951. CHS_HA_T7_1:
  952. MOVE.W (A1)+,(A2)
  953. MOVE.W (A1)+,D2
  954. ADD.W D1,D2
  955. EOR.W #1,D2
  956. MOVE.W D2,(A2)
  957. CMP.B #10H,D2
  958. BHS.S CHS_HA_T7_3
  959. CHS_HA_T7_2:
  960. DBRA D7,CHS_HA_T7_1
  961. BSR CHS_T7_NEXT
  962. BRA.S CHS_HA_T7_1
  963. CHS_HA_T7_3:
  964. DBRA D7,CHS_HA_T7_4
  965. BSR CHS_T7_NEXT
  966. CHS_HA_T7_4:
  967. TST.B D2
  968. BMI.S CHS_HA_T7_6
  969. MOVE.W -4(A1),D0
  970. CHS_HA_T7_5:
  971. MOVE.W D0,(A2)
  972. SUB.B #10H,D2
  973. MOVE.W D2,(A2)
  974. CMP.B #10H,D2
  975. BCS CHS_HA_T7_2
  976. DBRA D7,CHS_HA_T7_5
  977. BSR CHS_T7_NEXT
  978. BRA CHS_HA_T7_5
  979. CHS_HA_T7_6:
  980. MOVE.W (A1)+,(A2)
  981. SUB.B #10H,D2
  982. MOVE.W D2,(A2)
  983. CMP.B #90H,D2
  984. BCS CHS_HA_T7_2
  985. DBRA D7,CHS_HA_T7_6
  986. BSR CHS_T7_NEXT
  987. BRA CHS_HA_T7_6
  988. CHS_HF:
  989. ; palette fix type
  990. MOVEQ.L #0,D0
  991. MOVE.B CONV_TYPE(A5),D0
  992. JMP CHS_HF_TBL(PC,D0.W)
  993. CHS_HF_TBL:
  994. JMP CHS_HF_T0(PC)
  995. JMP CHS_HF_T1(PC)
  996. JMP CHS_HF_T2(PC)
  997. JMP CHS_HF_T3(PC)
  998. JMP CHS_HF_T4(PC)
  999. JMP CHS_HF_T5(PC)
  1000. JMP CHS_HF_T6(PC)
  1001. JMP CHS_HF_T7(PC)
  1002. CHS_HF_T0:
  1003. MOVE.W D3,-2(A2)
  1004. MOVE.W D5,D7
  1005. CHS_HF_T0_1:
  1006. MOVE.W (A1),(A2)
  1007. MOVE.B 3(A1),D1
  1008. EOR.W D2,D1
  1009. MOVE.W D1,(A2)
  1010. ADDQ.W #4,A1
  1011. DBRA D7,CHS_HF_T0_1
  1012. MOVE.W ERACE_CHARA(A5),D7
  1013. BEQ.S CHS_HF_T0_3
  1014. MOVE.W #2,2(A2)
  1015. MOVEQ.L #0,D0
  1016. CHS_HF_T0_2:
  1017. MOVE.W D0,(A2)
  1018. SUBQ.W #1,D7
  1019. BNE.S CHS_HF_T0_2
  1020. MOVE.W #1,2(A2)
  1021. CHS_HF_T0_3:
  1022. ADD.W D4,D3
  1023. DBRA D6,CHS_HF_T0
  1024. RTS
  1025. CHS_HF_T1:
  1026. ADDQ.W #2,A1
  1027. MOVE.B D2,D1
  1028. JMP CHS_NA_T1_0(PC)
  1029. CHS_HF_T2:
  1030. MOVE.B 1(A1),(A5)
  1031. MOVE.B D2,D1
  1032. MOVE.W (A5),D2
  1033. ADDQ.W #2,A1
  1034. JMP CHS_NA_T2_0(PC)
  1035. CHS_HF_T3:
  1036. MOVE.B D2,D1
  1037. MOVE.W 2(A1),D2
  1038. ADDQ.W #4,A1
  1039. JMP CHS_NA_T3_0(PC)
  1040. CHS_HF_T4:
  1041. MOVE.B D2,D1
  1042. JMP CHS_NF_T4_0(PC)
  1043. CHS_HF_T5:
  1044. MOVE.B D2,D1
  1045. MOVE.B (A1)+,(A5)
  1046. MOVE.W (A5),D2
  1047. JMP CHS_NF_T5_0(PC)
  1048. CHS_HF_T6:
  1049. MOVE.B D2,D1
  1050. MOVE.W (A1),D2
  1051. JMP CHS_NF_T6_0(PC)
  1052. CHS_HF_T7:
  1053. MOVEQ.L #10H,D2
  1054. MOVE.W D3,-2(A2)
  1055. MOVE.W D5,D7
  1056. CHS_HF_T7_1:
  1057. MOVE.W (A1),(A2)
  1058. MOVE.B 1(A1),D1
  1059. EOR.B #1,D1
  1060. MOVE.W D1,(A2)
  1061. CMP.B D2,D1
  1062. BHS.S CHS_HF_T7_3
  1063. ADDQ.W #4,A1
  1064. CHS_HF_T7_2:
  1065. DBRA D7,CHS_HF_T7_1
  1066. BSR CHS_T7_NEXT
  1067. BRA.S CHS_HF_T7_1
  1068. CHS_HF_T7_3:
  1069. DBRA D7,CHS_HF_T7_4
  1070. BSR CHS_T7_NEXT
  1071. CHS_HF_T7_4:
  1072. TST.B D1
  1073. BMI.S CHS_HF_T7_6
  1074. MOVE.W (A1),D0
  1075. ADDQ.W #4,A1
  1076. CHS_HF_T7_5:
  1077. MOVE.W D0,(A2)
  1078. SUB.B D2,D1
  1079. MOVE.W D1,(A2)
  1080. CMP.B D2,D1
  1081. BCS CHS_HF_T7_2
  1082. DBRA D7,CHS_HF_T7_5
  1083. BSR CHS_T7_NEXT
  1084. BRA CHS_HF_T7_5
  1085. CHS_HF_T7_6:
  1086. ADDQ.W #4,A1
  1087. CHS_HF_T7_7:
  1088. MOVE.W (A1)+,(A2)
  1089. SUB.B D2,D1
  1090. MOVE.W D1,(A2)
  1091. CMP.B #90H,D1
  1092. BCS CHS_HF_T7_2
  1093. DBRA D7,CHS_HF_T7_7
  1094. BSR CHS_T7_NEXT
  1095. BRA CHS_HF_T7_7
  1096. CHS_HN:
  1097. ; normal type
  1098. MOVEQ.L #0,D0
  1099. MOVE.B CONV_TYPE(A5),D0
  1100. JMP CHS_HN_TBL(PC,D0.W)
  1101. CHS_HN_TBL:
  1102. JMP CHS_HN_T0(PC)
  1103. JMP CHS_HN_T1(PC)
  1104. JMP CHS_HN_T2(PC)
  1105. JMP CHS_HN_T3(PC)
  1106. JMP CHS_HN_T4(PC)
  1107. JMP CHS_HN_T5(PC)
  1108. JMP CHS_HN_T6(PC)
  1109. JMP CHS_HN_T7(PC)
  1110. CHS_HN_T0:
  1111. MOVE.W D3,-2(A2)
  1112. MOVE.W D5,D7
  1113. CHS_HN_T0_1:
  1114. MOVE.W (A1)+,(A2)
  1115. MOVE.W (A1)+,D0
  1116. EOR.W D2,D0
  1117. MOVE.W D0,(A2)
  1118. DBRA D7,CHS_HN_T0_1
  1119. MOVE.W ERACE_CHARA(A5),D7
  1120. BEQ.S CHS_HN_T0_3
  1121. MOVE.W #2,2(A2)
  1122. MOVEQ.L #0,D0
  1123. CHS_HN_T0_2:
  1124. MOVE.W D0,(A2)
  1125. SUBQ.W #1,D7
  1126. BNE.S CHS_HN_T0_2
  1127. MOVE.W #1,2(A2)
  1128. CHS_HN_T0_3:
  1129. ADD.W D4,D3
  1130. DBRA D6,CHS_HN_T0
  1131. RTS
  1132. CHS_HN_T1:
  1133. MOVE.W (A1)+,D1
  1134. MOVE.B D2,D1
  1135. JMP CHS_NA_T1_0(PC)
  1136. CHS_HN_T2:
  1137. MOVE.B 1(A1),(A5)
  1138. MOVE.W (A5),D2
  1139. MOVE.W (A1)+,D1
  1140. MOVE.B #1,D1
  1141. JMP CHS_NA_T2_0(PC)
  1142. CHS_HN_T3:
  1143. MOVE.W (A1)+,D1
  1144. MOVE.B D2,D1
  1145. MOVE.W (A1)+,D2
  1146. JMP CHS_NA_T3_0(PC)
  1147. CHS_HN_T4:
  1148. MOVE.W D2,(A5)
  1149. JSR CHS_NN_T4_0(PC)
  1150. CLR.W (A5)
  1151. RTS
  1152. CHS_HN_T5:
  1153. MOVE.B (A1)+,(A5)
  1154. MOVE.W (A5),D2
  1155. MOVE.W #1,(A5)
  1156. JSR CHS_NN_T5_0(PC)
  1157. CLR.W (A5)
  1158. RTS
  1159. CHS_HN_T6:
  1160. MOVE.W #1,(A5)
  1161. MOVE.W (A1)+,D2
  1162. JSR CHS_NN_T6_0(PC)
  1163. CLR.W (A5)
  1164. RTS
  1165. CHS_HN_T7:
  1166. MOVEQ.L #10H,D2
  1167. MOVE.W D3,-2(A2)
  1168. MOVE.W D5,D7
  1169. CHS_HN_T7_1:
  1170. MOVE.W (A1)+,(A2)
  1171. MOVE.W (A1)+,D1
  1172. EOR.W #1,D1
  1173. MOVE.W D1,(A2)
  1174. CMP.B D1,D2
  1175. BLS.S CHS_HN_T7_3
  1176. CHS_HN_T7_2:
  1177. DBRA D7,CHS_HN_T7_1
  1178. BSR CHS_T7_NEXT
  1179. BRA.S CHS_HN_T7_1
  1180. CHS_HN_T7_3:
  1181. DBRA D7,CHS_HN_T7_4
  1182. BSR CHS_T7_NEXT
  1183. CHS_HN_T7_4:
  1184. MOVE.W -4(A1),D0
  1185. TST.B D1
  1186. BMI.S CHS_HN_T7_6
  1187. CHS_HN_T7_5:
  1188. MOVE.W D0,(A2)
  1189. SUB.B D2,D1
  1190. MOVE.W D1,(A2)
  1191. CMP.B D2,D1
  1192. BCS CHS_HN_T7_2
  1193. DBRA D7,CHS_HN_T7_5
  1194. BSR CHS_T7_NEXT
  1195. BRA CHS_HN_T7_5
  1196. CHS_HN_T7_6:
  1197. MOVE.W (A1)+,(A2)
  1198. SUB.B D2,D1
  1199. MOVE.W D1,(A2)
  1200. CMP.B #90H,D1
  1201. BCS CHS_HN_T7_2
  1202. DBRA D7,CHS_HN_T7_6
  1203. BSR CHS_T7_NEXT
  1204. BRA CHS_HN_T7_6
  1205. CHS_T7_NEXT:
  1206. MOVE.W ERACE_CHARA(A5),D7
  1207. BEQ.S CHS_T7_NEXT_2
  1208. MOVE.W #2,2(A2)
  1209. CHS_T7_NEXT_1:
  1210. CLR.W (A2)
  1211. SUBQ.W #1,D7
  1212. BNE.S CHS_T7_NEXT_1
  1213. MOVE.W #1,2(A2)
  1214. CHS_T7_NEXT_2:
  1215. ADD.W D4,D3
  1216. DBRA D6,CHS_T7_NEXT_3
  1217. ADDQ.W #4,SP
  1218. RTS
  1219. CHS_T7_NEXT_3:
  1220. MOVE.W D3,-2(A2)
  1221. MOVE.W D5,D7
  1222. RTS
  1223. NON_ACT:
  1224. BTST.B #ACTAT_KEEP,ACT_ATTR(A6)
  1225. BEQ.S NON_ACT_1
  1226. ; ADDQ.W #2,A0
  1227. MOVEQ.L #0,D0
  1228. JSR FIRST_Y_SET(PC)
  1229. MOVE.W TEMP_SPRITE(A5),D3
  1230. ADD.W D6,TEMP_SPRITE(A5)
  1231. JMP ACT_3(PC)
  1232. NON_ACT_1:
  1233. JSR GET_Y_OFFSET(PC)
  1234. JSR GET_Y_VALUE(PC)
  1235. MOVE.W D1,D0
  1236. JSR FIRST_Y_SET(PC)
  1237. JSR GET_X_OFFSET(PC)
  1238. ADD.W #SP_H-SP_V,D4
  1239. ADD.W REL_X(A6),D1
  1240. BTST.B #ACTAT_CUT,ACT_ATTR(A6)
  1241. BEQ.S NON_ACT_2
  1242. JSR H_OUT_CUT(PC)
  1243. NON_ACT_2:
  1244. MOVE.W D4,-2(A2)
  1245. LSL.W #7,D1
  1246. MOVE.W D1,(A2)
  1247. JSR BIG_SET(PC)
  1248. MOVE.W TEMP_SPRITE(A5),D3
  1249. ADD.W D6,TEMP_SPRITE(A5)
  1250. JMP ACT_3(PC)
  1251. GET_CONV_TYPE:
  1252. MOVE.L OBJT_INFO(A5),A1
  1253. AND.W #0FFFCH,D4
  1254. MOVE.L 0(A1,D4.W),(A5)
  1255. MOVE.W (A5),D0
  1256. AND.W #0FH,(A5)
  1257. MOVE.L (A5),A1
  1258. CLR.L (A5)
  1259. LSR.W #3,D0
  1260. MOVE.W D0,D4
  1261. AND.W #1C00H,D4
  1262. MOVE.W D4,CONV_TYPE(A5)
  1263. AND.W #3FEH,D0
  1264. MOVEQ.L #0,D5
  1265. MOVEQ.L #0,D6
  1266. MOVE.B SIZE_DATA(PC,D0.W),D5 y size
  1267. MOVE.B SIZE_DATA+1(PC,D0.W),D6 x size
  1268. RTS
  1269. SIZE MACRO SIZE_Y
  1270. SIZE_X SET 1
  1271. REPT 32
  1272. DC.B SIZE_Y,SIZE_X
  1273. SIZE_X SET SIZE_X+1
  1274. ENDR
  1275. ENDM
  1276. SIZE_DATA:
  1277. SIZE 1
  1278. SIZE 2
  1279. SIZE 3
  1280. SIZE 4
  1281. SIZE 5
  1282. SIZE 6
  1283. SIZE 7
  1284. SIZE 8
  1285. SIZE 9
  1286. SIZE 10
  1287. SIZE 11
  1288. SIZE 12
  1289. SIZE 13
  1290. SIZE 14
  1291. SIZE 15
  1292. SIZE 16
  1293. H_OUT_CUT:
  1294. CMP.W #-(512-320),D1
  1295. BLE LEFT_OUT
  1296. MOVE.L D6,D0
  1297. LSL.W #4,D0
  1298. MOVE.W TEMP_BIG_X(A5),D2
  1299. BEQ.S HOC_1
  1300. MULS.W D2,D0
  1301. ASR.L #8,D0
  1302. HOC_1:
  1303. ADD.W D1,D0
  1304. SUB.W #512,D0
  1305. BGE.S RIGHT_OUT
  1306. RTS
  1307. RIGHT_OUT:
  1308. MOVEQ.L #1,D2
  1309. ADD.B TEMP_BIG_VALUE(A5),D2
  1310. DIVU D2,D0
  1311. ADDQ.W #1,D0
  1312. CMP.W D0,D6
  1313. BHI.S RIGHT_OUT_1
  1314. ALL_OUT:
  1315. MOVE.W D6,D0
  1316. RIGHT_OUT_1:
  1317. NEG.W D0
  1318. TST.B SPG_MODE(A5)
  1319. BNE.S RIGHT_OUT_DB
  1320. ADD.W START_V_ADRS(A5),D0
  1321. ADD.W D6,D0
  1322. MOVE.W D0,-2(A2)
  1323. MOVE.W #0,(A2)
  1324. RTS
  1325. RIGHT_OUT_DB:
  1326. ADD.W D0,D0
  1327. CLR.W 0(A4,D0.W)
  1328. RTS
  1329. LEFT_OUT:
  1330. MOVE.W #512-320,D0
  1331. ADD.W D1,D0
  1332. NEG.W D0
  1333. MOVEQ.L #1,D2
  1334. ADD.B TEMP_BIG_VALUE(A5),D2
  1335. DIVU D2,D0
  1336. ADDQ.W #1,D0
  1337. CMP.W D0,D6
  1338. BLS ALL_OUT
  1339. ADD.W D0,D4
  1340. TST.B SPG_MODE(A5)
  1341. BNE.S LEFT_OUT_DB
  1342. ADD.W D0,START_V_ADRS(A5)
  1343. LSL.W #4,D0
  1344. LEFT_OUT_01:
  1345. MOVE.W TEMP_BIG_X(A5),D2
  1346. BEQ.S LEFT_OUT_1
  1347. MULS.W D2,D0
  1348. ASR.L #8,D0
  1349. LEFT_OUT_1:
  1350. ADD.W D0,D1
  1351. RTS
  1352. LEFT_OUT_DB:
  1353. SUB.W D6,A4
  1354. SUB.W D6,A4
  1355. ADD.W D0,D0
  1356. MOVE.W (A4),0(A4,D0.W)
  1357. CLR.W (A4)
  1358. ADD.W D6,A4
  1359. ADD.W D6,A4
  1360. ADD.W D0,D0
  1361. ADD.W D0,D0
  1362. ADD.W D0,D0
  1363. BRA LEFT_OUT_01
  1364. FIRST_Y_SET:
  1365. ; chain bit set and active 0
  1366. ; in) D4=start sprite number
  1367. ; D6=x size
  1368. ; D0=y value
  1369. ; out) D4=start v address
  1370. MOVE.W #1,2(A2)
  1371. ADD.W #SP_V,D4
  1372. MOVE.W D4,-2(A2)
  1373. MOVE.W D4,START_V_ADRS(A5)
  1374. MOVE.W D0,(A2)
  1375. MOVE.W D6,D7
  1376. SUBQ.W #1,D7
  1377. BEQ.S FYS_2
  1378. FYS_1:
  1379. MOVE.W #40H,(A2) chain only
  1380. SUBQ.W #1,D7
  1381. BNE.S FYS_1
  1382. FYS_2:
  1383. RTS
  1384. GET_Y_OFFSET:
  1385. MOVEQ.L #0,D1
  1386. MOVE.B CONV_MARK+2(A5),D1
  1387. BTST.B #1,CONV_MARK+1(A5)
  1388. BEQ.S GET_YO_1
  1389. NEG.W D1
  1390. GET_YO_1:
  1391. ADD.W DISP_Y(A6),D1
  1392. MOVE.W TEMP_BIG_Y(A5),D0
  1393. BEQ.S GET_YO_2
  1394. MULS.W D0,D1
  1395. ASR.L #8,D1
  1396. GET_YO_2:
  1397. RTS
  1398. GET_X_OFFSET:
  1399. MOVEQ.L #0,D1
  1400. MOVE.B CONV_MARK+3(A5),D1
  1401. BTST.B #0,CONV_MARK+1(A5)
  1402. BEQ.S GET_XO_1
  1403. NEG.W D1
  1404. GET_XO_1:
  1405. ADD.W DISP_X(A6),D1
  1406. TST.W H_FLIP_FLAG(A5)
  1407. BEQ.S GET_XO_2
  1408. MOVE.W D6,D0 x size
  1409. LSL.W #4,D0
  1410. ADD.W D0,D1
  1411. NEG.W D1
  1412. GET_XO_2:
  1413. MOVE.W TEMP_BIG_X(A5),D0
  1414. BEQ.S GET_XO_3
  1415. MULS.W D0,D1
  1416. ASR.L #8,D1
  1417. GET_XO_3:
  1418. RTS
  1419. GET_PWORK_VALUE:
  1420. MOVE.L A6,MASTER_PWORK(A5)
  1421. MOVEQ.L #0,D0
  1422. MOVE.B BIG_Y(A6),D0
  1423. MOVE.B D0,TEMP_BIG_VALUE+1(A5)
  1424. ADDQ.B #1,D0
  1425. MOVE.W D0,TEMP_BIG_Y(A5)
  1426. MOVE.B BIG_X(A6),D0
  1427. ADDQ.B #1,D0
  1428. MOVE.W D0,TEMP_BIG_X(A5)
  1429. ADD.W D0,D0
  1430. MOVE.W #200H,D1
  1431. MOVE.B BIG_X_DATA(PC,D0.W),TEMP_BIG_VALUE(A5)
  1432. MOVE.B BIG_X_DATA+1(PC,D0.W),D1
  1433. MOVE.L BIG_X_DATA(PC,D1.W),TEMP_BIG_BIT(A5)
  1434. BCLR.B #ACTAT_ERACE,ACT_ATTR(A6)
  1435. SNE.B ERACE_16(A5)
  1436. MOVEQ.L #1,D0
  1437. AND.B ACT_ATTR(A6),D0
  1438. MOVE.W D0,H_FLIP_FLAG(A5)
  1439. BCLR.B #ACTAT_FLASH,ACT_ATTR(A6)
  1440. BNE.S FLASH_ATTR_SET
  1441. CLR.W TEMP_PAL_COM(A5)
  1442. MOVE.B PALETTE_ADD(A6),TEMP_PAL_COM(A5)
  1443. RTS
  1444. FLASH_ATTR_SET:
  1445. MOVE.B FLASH_PALETTE(A5),TEMP_PAL_COM(A5)
  1446. MOVE.B #1,TEMP_PAL_COM+1(A5)
  1447. RTS
  1448. BIG_X_DATA:
  1449. DC.W 0F00H,0000H,0000H,0000H,0000H,0000H,0000H,0000H
  1450. DC.W 0000H,0000H,0000H,0000H,0000H,0000H,0000H,0000H
  1451. DC.W 0000H,0104H,0108H,010CH,0110H,0114H,0118H,011CH
  1452. DC.W 0120H,0124H,0128H,012CH,0130H,0134H,0138H,013CH
  1453. DC.W 0100H,0204H,0208H,020CH,0210H,0214H,0218H,021CH
  1454. DC.W 0220H,0224H,0228H,022CH,0230H,0234H,0238H,023CH
  1455. DC.W 0200H,0304H,0308H,030CH,0310H,0314H,0318H,031CH
  1456. DC.W 0320H,0324H,0328H,032CH,0330H,0334H,0338H,033CH
  1457. DC.W 0300H,0404H,0408H,040CH,0410H,0414H,0418H,041CH
  1458. DC.W 0420H,0424H,0428H,042CH,0430H,0434H,0438H,043CH
  1459. DC.W 0400H,0504H,0508H,050CH,0510H,0514H,0518H,051CH
  1460. DC.W 0520H,0524H,0528H,052CH,0530H,0534H,0538H,053CH
  1461. DC.W 0500H,0604H,0608H,060CH,0610H,0614H,0618H,061CH
  1462. DC.W 0620H,0624H,0628H,062CH,0630H,0634H,0638H,063CH
  1463. DC.W 0600H,0704H,0708H,070CH,0710H,0714H,0718H,071CH
  1464. DC.W 0720H,0724H,0728H,072CH,0730H,0734H,0738H,073CH
  1465. DC.W 0700H,0804H,0808H,080CH,0810H,0814H,0818H,081CH
  1466. DC.W 0820H,0824H,0828H,082CH,0830H,0834H,0838H,083CH
  1467. DC.W 0800H,0904H,0908H,090CH,0910H,0914H,0918H,091CH
  1468. DC.W 0920H,0924H,0928H,092CH,0930H,0934H,0938H,093CH
  1469. DC.W 0900H,0A04H,0A08H,0A0CH,0A10H,0A14H,0A18H,0A1CH
  1470. DC.W 0A20H,0A24H,0A28H,0A2CH,0A30H,0A34H,0A38H,0A3CH
  1471. DC.W 0A00H,0B04H,0B08H,0B0CH,0B10H,0B14H,0B18H,0B1CH
  1472. DC.W 0B20H,0B24H,0B28H,0B2CH,0B30H,0B34H,0B38H,0B3CH
  1473. DC.W 0B00H,0C04H,0C08H,0C0CH,0C10H,0C14H,0C18H,0C1CH
  1474. DC.W 0C20H,0C24H,0C28H,0C2CH,0C30H,0C34H,0C38H,0C3CH
  1475. DC.W 0C00H,0D04H,0D08H,0D0CH,0D10H,0D14H,0D18H,0D1CH
  1476. DC.W 0D20H,0D24H,0D28H,0D2CH,0D30H,0D34H,0D38H,0D3CH
  1477. DC.W 0D00H,0E04H,0E08H,0E0CH,0E10H,0E14H,0E18H,0E1CH
  1478. DC.W 0E20H,0E24H,0E28H,0E2CH,0E30H,0E34H,0E38H,0E3CH
  1479. DC.W 0E00H,0F04H,0F08H,0F0CH,0F10H,0F14H,0F18H,0F1CH
  1480. DC.W 0F20H,0F24H,0F28H,0F2CH,0F30H,0F34H,0F38H,0F3CH
  1481. ; 0123456789ABCDEF0123456789ABCDEF
  1482. DC.L 00000000000000000000000000000000B 0
  1483. DC.L 11111111011111111111111101111111B 1
  1484. DC.L 01111111011111110111111101111111B 2
  1485. DC.L 01111111011101110111111101110111B 3
  1486. DC.L 01110111011101110111011101110111B 4
  1487. DC.L 01110111010101110111011101010111B 5
  1488. DC.L 01010111010101110101011101010111B 6
  1489. DC.L 01010111010101010101011101010101B 7
  1490. DC.L 01010101010101010101010101010101B 8
  1491. DC.L 00010101010101010001010101010101B 9
  1492. DC.L 00010101000101010001010100010101B A
  1493. DC.L 00010101000100010001010100010001B B
  1494. DC.L 00010001000100010001000100010001B C
  1495. DC.L 00010001000000010001000100000001B D
  1496. DC.L 00000001000000010000000100000001B E
  1497. DC.L 00000001000000000000000100000000B F
  1498. BIG_SET:
  1499. ADD.W #SP_BIG-SP_H,D4
  1500. MOVE.W D4,-2(A2)
  1501. MOVE.W D6,D7
  1502. MOVE.W TEMP_BIG_VALUE(A5),D2
  1503. MOVE.L TEMP_BIG_BIT(A5),D1
  1504. BNE.S BIG_SET_2
  1505. BIG_SET_1:
  1506. MOVE.W D2,(A2)
  1507. SUBQ.W #1,D7
  1508. BNE.S BIG_SET_1
  1509. RTS
  1510. BIG_SET_2:
  1511. MOVE.W D2,D0
  1512. ADD.L D1,D1
  1513. BCC.S BIG_SET_3
  1514. SUB.W #100H,D0
  1515. BIG_SET_3:
  1516. MOVE.W D0,(A2)
  1517. SUBQ.W #1,D7
  1518. BNE.S BIG_SET_2
  1519. RTS
  1520. GET_Y_VALUE:
  1521. CLR.W ERACE_CHARA(A5)
  1522. MOVE.W REL_Y(A6),D0
  1523. ADD.W #100H,D0
  1524. ADD.W D0,D1
  1525. LSL.W #7,D1
  1526. MOVE.W TEMP_BIG_Y(A5),D0
  1527. BNE.S GET_Y_VALUE_1
  1528. ADD.W D5,D1
  1529. RTS
  1530. GET_Y_VALUE_1:
  1531. AND.W #0FCH,D0
  1532. ADD.W D0,D0
  1533. ADD.W D0,D0
  1534. SUBQ.W #1,D0
  1535. ADD.W D5,D0
  1536. ADD.W D0,D0
  1537. ADD.B ERACE_DATA(PC,D0.W),D1
  1538. MOVE.B ERACE_DATA+1(PC,D0.W),ERACE_CHARA+1(A5)
  1539. RTS
  1540. ERACE_DATA:
  1541. ;BIG_Y=00
  1542. DC.W 0010FH,0010EH,0010DH,0010CH,0010BH,0010AH,00109H,00108H
  1543. DC.W 00107H,00106H,00105H,00104H,00103H,00102H,00101H,00100H
  1544. DC.W 0010FH,0010EH,0010DH,0010CH,0010BH,0010AH,00109H,00108H
  1545. DC.W 00107H,00106H,00105H,00104H,00103H,00102H,00101H,00100H
  1546. DC.W 0010FH,0010EH,0010DH,0010CH,0010BH,0010AH,00109H,00108H
  1547. DC.W 00107H,00106H,00105H,00104H,00103H,00102H,00101H,00100H
  1548. DC.W 0010FH,0010EH,0010DH,0010CH,0010BH,0010AH,00109H,00108H
  1549. DC.W 00107H,00106H,00105H,00104H,00103H,00102H,00101H,00100H
  1550. ;BIG_Y=10
  1551. DC.W 0010FH,0010EH,0010DH,0010CH,0010BH,0010AH,00109H,00108H
  1552. DC.W 00107H,00106H,00105H,00104H,00103H,00202H,00201H,00200H
  1553. DC.W 0010CH,0010BH,0010AH,00109H,00108H,00107H,00106H,00105H
  1554. DC.W 00104H,00103H,00102H,00204H,00203H,00202H,00201H,00200H
  1555. DC.W 0010AH,00109H,00108H,00107H,00106H,00105H,00104H,00103H
  1556. DC.W 00102H,00206H,00205H,00204H,00203H,00202H,00201H,00200H
  1557. DC.W 00109H,00108H,00107H,00106H,00105H,00104H,00103H,00102H
  1558. DC.W 00207H,00206H,00205H,00204H,00203H,00202H,00201H,00200H
  1559. ;BIG_Y=20
  1560. DC.W 00107H,00106H,00105H,00104H,00103H,00102H,00101H,00208H
  1561. DC.W 00207H,00206H,00205H,00204H,00203H,00202H,00301H,00300H
  1562. DC.W 00107H,00106H,00105H,00104H,00103H,00102H,00208H,00207H
  1563. DC.W 00206H,00205H,00204H,00203H,00202H,00302H,00301H,00300H
  1564. DC.W 00106H,00105H,00104H,00103H,00102H,00207H,00206H,00205H
  1565. DC.W 00204H,00203H,00202H,00304H,00303H,00302H,00301H,00300H
  1566. DC.W 00105H,00104H,00103H,00102H,00101H,00206H,00205H,00204H
  1567. DC.W 00203H,00202H,00305H,00304H,00303H,00302H,00301H,00300H
  1568. ;BIG_Y=30
  1569. DC.W 00105H,00104H,00103H,00102H,00101H,00205H,00204H,00203H
  1570. DC.W 00202H,00201H,00305H,00304H,00303H,00302H,00301H,00400H
  1571. DC.W 00104H,00103H,00102H,00101H,00205H,00204H,00203H,00202H
  1572. DC.W 00201H,00305H,00304H,00303H,00302H,00402H,00401H,00400H
  1573. DC.W 00104H,00103H,00102H,00101H,00205H,00204H,00203H,00202H
  1574. DC.W 00305H,00304H,00303H,00302H,00301H,00402H,00401H,00400H
  1575. DC.W 00104H,00103H,00102H,00101H,00204H,00203H,00202H,00201H
  1576. DC.W 00304H,00303H,00302H,00301H,00403H,00402H,00401H,00400H
  1577. ;BIG_Y=40
  1578. DC.W 00103H,00102H,00101H,00204H,00203H,00202H,00201H,00304H
  1579. DC.W 00303H,00302H,00301H,00404H,00403H,00402H,00401H,00500H
  1580. DC.W 00103H,00102H,00101H,00204H,00203H,00202H,00201H,00304H
  1581. DC.W 00303H,00302H,00405H,00404H,00403H,00402H,00501H,00500H
  1582. DC.W 00103H,00102H,00101H,00204H,00203H,00202H,00304H,00303H
  1583. DC.W 00302H,00301H,00404H,00403H,00402H,00502H,00501H,00500H
  1584. DC.W 00103H,00102H,00101H,00203H,00202H,00201H,00304H,00303H
  1585. DC.W 00302H,00404H,00403H,00402H,00503H,00502H,00501H,00500H
  1586. ;BIG_Y=50
  1587. DC.W 00103H,00102H,00101H,00203H,00202H,00201H,00303H,00302H
  1588. DC.W 00301H,00403H,00402H,00401H,00503H,00502H,00501H,00600H
  1589. DC.W 00103H,00102H,00204H,00203H,00202H,00304H,00303H,00302H
  1590. DC.W 00404H,00403H,00402H,00504H,00503H,00502H,00601H,00600H
  1591. DC.W 00102H,00101H,00203H,00202H,00201H,00303H,00302H,00301H
  1592. DC.W 00403H,00402H,00401H,00503H,00502H,00501H,00601H,00600H
  1593. DC.W 00102H,00101H,00203H,00202H,00201H,00303H,00302H,00301H
  1594. DC.W 00403H,00402H,00503H,00502H,00501H,00602H,00601H,00600H
  1595. ;BIG_Y=60
  1596. DC.W 00102H,00101H,00203H,00202H,00201H,00302H,00301H,00403H
  1597. DC.W 00402H,00401H,00503H,00502H,00603H,00602H,00601H,00700H
  1598. DC.W 00102H,00101H,00203H,00202H,00303H,00302H,00301H,00403H
  1599. DC.W 00402H,00503H,00502H,00501H,00603H,00602H,00701H,00700H
  1600. DC.W 00102H,00101H,00202H,00201H,00303H,00302H,00301H,00402H
  1601. DC.W 00401H,00503H,00502H,00603H,00602H,00601H,00701H,00700H
  1602. DC.W 00102H,00101H,00202H,00201H,00303H,00302H,00403H,00402H
  1603. DC.W 00401H,00502H,00501H,00603H,00602H,00702H,00701H,00700H
  1604. ;BIG_Y=70
  1605. DC.W 00102H,00101H,00202H,00201H,00302H,00301H,00403H,00402H
  1606. DC.W 00503H,00502H,00501H,00602H,00601H,00702H,00701H,00800H
  1607. DC.W 00102H,00101H,00202H,00201H,00302H,00301H,00402H,00401H
  1608. DC.W 00503H,00502H,00603H,00602H,00703H,00702H,00701H,00800H
  1609. DC.W 00102H,00101H,00202H,00201H,00302H,00301H,00402H,00401H
  1610. DC.W 00502H,00501H,00602H,00601H,00702H,00701H,00801H,00800H
  1611. DC.W 00102H,00101H,00202H,00201H,00302H,00301H,00402H,00401H
  1612. DC.W 00502H,00501H,00602H,00601H,00702H,00701H,00801H,00800H
  1613. ;BIG_Y=80
  1614. DC.W 00101H,00202H,00201H,00302H,00301H,00402H,00401H,00502H
  1615. DC.W 00501H,00602H,00601H,00702H,00701H,00802H,00801H,00900H
  1616. DC.W 00101H,00202H,00201H,00302H,00301H,00402H,00401H,00502H
  1617. DC.W 00501H,00602H,00601H,00702H,00701H,00802H,00801H,00900H
  1618. DC.W 00101H,00202H,00201H,00302H,00301H,00402H,00401H,00502H
  1619. DC.W 00501H,00602H,00601H,00702H,00803H,00802H,00901H,00900H
  1620. DC.W 00101H,00202H,00201H,00302H,00301H,00402H,00401H,00502H
  1621. DC.W 00602H,00601H,00702H,00701H,00802H,00801H,00901H,00900H
  1622. ;BIG_Y=90
  1623. DC.W 00101H,00202H,00201H,00302H,00301H,00402H,00502H,00501H
  1624. DC.W 00602H,00601H,00702H,00701H,00802H,00902H,00901H,00A00H
  1625. DC.W 00101H,00202H,00201H,00302H,00301H,00401H,00502H,00501H
  1626. DC.W 00602H,00601H,00702H,00802H,00801H,00902H,00901H,00A00H
  1627. DC.W 00101H,00202H,00201H,00302H,00402H,00401H,00502H,00501H
  1628. DC.W 00602H,00702H,00701H,00802H,00801H,00902H,00A01H,00A00H
  1629. DC.W 00101H,00202H,00201H,00301H,00402H,00401H,00502H,00501H
  1630. DC.W 00601H,00702H,00701H,00802H,00902H,00901H,00A01H,00A00H
  1631. ;BIG_Y=A0
  1632. DC.W 00101H,00202H,00201H,00301H,00402H,00401H,00501H,00602H
  1633. DC.W 00601H,00702H,00802H,00801H,00902H,00901H,00A01H,00B00H
  1634. DC.W 00101H,00202H,00201H,00301H,00402H,00401H,00501H,00602H
  1635. DC.W 00601H,00701H,00802H,00801H,00902H,00A02H,00A01H,00B00H
  1636. DC.W 00101H,00202H,00302H,00301H,00402H,00502H,00501H,00602H
  1637. DC.W 00702H,00701H,00802H,00902H,00901H,00A02H,00B01H,00B00H
  1638. DC.W 00101H,00201H,00302H,00301H,00401H,00502H,00501H,00601H
  1639. DC.W 00702H,00701H,00801H,00902H,00901H,00A01H,00B01H,00B00H
  1640. ;BIG_Y=B0
  1641. DC.W 00101H,00201H,00302H,00301H,00401H,00502H,00501H,00601H
  1642. DC.W 00702H,00701H,00801H,00902H,00A02H,00A01H,00B01H,00C00H
  1643. DC.W 00101H,00201H,00302H,00301H,00401H,00502H,00602H,00601H
  1644. DC.W 00701H,00802H,00801H,00901H,00A02H,00B02H,00B01H,00C00H
  1645. DC.W 00101H,00201H,00302H,00301H,00401H,00501H,00602H,00601H
  1646. DC.W 00701H,00802H,00902H,00901H,00A01H,00B02H,00B01H,00C00H
  1647. DC.W 00101H,00201H,00302H,00301H,00401H,00501H,00602H,00601H
  1648. DC.W 00701H,00801H,00902H,00901H,00A01H,00B01H,00C01H,00C00H
  1649. ;BIG_Y=C0
  1650. DC.W 00101H,00201H,00301H,00402H,00401H,00501H,00601H,00702H
  1651. DC.W 00701H,00801H,00901H,00A02H,00A01H,00B01H,00C01H,00D00H
  1652. DC.W 00101H,00201H,00301H,00402H,00401H,00501H,00601H,00702H
  1653. DC.W 00701H,00801H,00901H,00A02H,00B02H,00B01H,00C01H,00D00H
  1654. DC.W 00101H,00201H,00301H,00402H,00401H,00501H,00601H,00701H
  1655. DC.W 00802H,00801H,00901H,00A01H,00B02H,00C02H,00C01H,00D00H
  1656. DC.W 00101H,00201H,00301H,00402H,00502H,00501H,00601H,00701H
  1657. DC.W 00802H,00902H,00901H,00A01H,00B01H,00C02H,00D01H,00D00H
  1658. ;BIG_Y=D0
  1659. DC.W 00101H,00201H,00301H,00401H,00502H,00501H,00601H,00701H
  1660. DC.W 00801H,00902H,00A02H,00A01H,00B01H,00C01H,00D01H,00E00H
  1661. DC.W 00101H,00201H,00301H,00401H,00502H,00602H,00601H,00701H
  1662. DC.W 00801H,00901H,00A02H,00B02H,00B01H,00C01H,00D01H,00E00H
  1663. DC.W 00101H,00201H,00301H,00401H,00501H,00602H,00601H,00701H
  1664. DC.W 00801H,00901H,00A01H,00B02H,00C02H,00C01H,00D01H,00E00H
  1665. DC.W 00101H,00201H,00301H,00401H,00501H,00601H,00702H,00701H
  1666. DC.W 00801H,00901H,00A01H,00B01H,00C01H,00D02H,00E01H,00E00H
  1667. ;BIG_Y=E0
  1668. DC.W 00101H,00201H,00301H,00401H,00501H,00601H,00701H,00802H
  1669. DC.W 00801H,00901H,00A01H,00B01H,00C01H,00D01H,00E01H,00F00H
  1670. DC.W 00101H,00201H,00301H,00401H,00501H,00601H,00701H,00801H
  1671. DC.W 00902H,00A02H,00A01H,00B01H,00C01H,00D01H,00E01H,00F00H
  1672. DC.W 00101H,00201H,00301H,00401H,00501H,00601H,00701H,00801H
  1673. DC.W 00901H,00A02H,00B02H,00C02H,00C01H,00D01H,00E01H,00F00H
  1674. DC.W 00101H,00201H,00301H,00401H,00501H,00601H,00701H,00801H
  1675. DC.W 00901H,00A01H,00B01H,00C02H,00D02H,00E02H,00F01H,00F00H
  1676. ;BIG_Y=F0
  1677. DC.W 00101H,00201H,00301H,00401H,00501H,00601H,00701H,00801H
  1678. DC.W 00901H,00A01H,00B01H,00C01H,00D01H,00E01H,00F01H,01000H
  1679. DC.W 00101H,00201H,00301H,00401H,00501H,00601H,00701H,00801H
  1680. DC.W 00901H,00A01H,00B01H,00C01H,00D01H,00E01H,00F01H,01000H
  1681. DC.W 00101H,00201H,00301H,00401H,00501H,00601H,00701H,00801H
  1682. DC.W 00901H,00A01H,00B01H,00C01H,00D01H,00E01H,00F01H,01000H
  1683. DC.W 00101H,00201H,00301H,00401H,00501H,00601H,00701H,00801H
  1684. DC.W 00901H,00A01H,00B01H,00C01H,00D01H,00E01H,00F01H,01000H
  1685. ORDER_COMMAND:
  1686. MOVEQ.L #7CH,D0
  1687. AND.B (A5),D0
  1688. JMP ORDER_COM_VECT(PC,D0.W)
  1689. ORDER_COM_VECT:
  1690. JMP ORDER_END(PC) 0
  1691. JMP CHANGE_OBJ2(PC) 1
  1692. JMP CHANGE_OBJ3(PC) 2
  1693. JMP CHANGE_OBJ4(PC) 3
  1694. JMP SET_OBJ1_DB(PC) 4
  1695. JMP CHANGE_OBJ2_DB(PC) 5
  1696. JMP CHANGE_OBJ3_DB(PC) 6
  1697. JMP CHANGE_OBJ4_DB(PC) 7
  1698. ORDER_END:
  1699. JSR OBJ_END_CLEAR(PC)
  1700. RTS
  1701. SET_OBJ1:
  1702. LEA.L OBJ1_MAP(A5),A0
  1703. MOVE.L A0,OBJ_MAP_POINT(A5)
  1704. MOVE.L (A0),TEMP_SPRITE(A5)
  1705. CLR.B SPG_MODE(A5)
  1706. RTS
  1707. CHANGE_OBJ2:
  1708. JSR OBJ_END_CLEAR(PC)
  1709. LEA.L OBJ2_MAP(A5),A0
  1710. MOVE.L A0,OBJ_MAP_POINT(A5)
  1711. MOVE.L (A0),TEMP_SPRITE(A5)
  1712. CLR.B SPG_MODE(A5)
  1713. JMP ACT_2(PC)
  1714. CHANGE_OBJ3:
  1715. JSR OBJ_END_CLEAR(PC)
  1716. LEA.L OBJ3_MAP(A5),A0
  1717. MOVE.L A0,OBJ_MAP_POINT(A5)
  1718. MOVE.L (A0),TEMP_SPRITE(A5)
  1719. CLR.B SPG_MODE(A5)
  1720. JMP ACT_2(PC)
  1721. CHANGE_OBJ4:
  1722. JSR OBJ_END_CLEAR(PC)
  1723. LEA.L OBJ4_MAP(A5),A0
  1724. MOVE.L A0,OBJ_MAP_POINT(A5)
  1725. MOVE.L (A0),TEMP_SPRITE(A5)
  1726. CLR.B SPG_MODE(A5)
  1727. JMP ACT_2(PC)
  1728. SET_OBJ1_DB:
  1729. LEA.L OBJ1_MAP(A5),A0
  1730. SET_OBJ_DB:
  1731. MOVE.L A0,OBJ_MAP_POINT(A5)
  1732. MOVE.B #1,SPG_MODE(A5)
  1733. JSR DB_START(PC)
  1734. JMP ACTDB_1(PC)
  1735. CHANGE_OBJ2_DB:
  1736. JSR OBJ_END_CLEAR(PC)
  1737. LEA.L OBJ2_MAP(A5),A0
  1738. JMP SET_OBJ_DB(PC)
  1739. CHANGE_OBJ3_DB:
  1740. JSR OBJ_END_CLEAR(PC)
  1741. LEA.L OBJ3_MAP(A5),A0
  1742. JMP SET_OBJ_DB(PC)
  1743. CHANGE_OBJ4_DB:
  1744. JSR OBJ_END_CLEAR(PC)
  1745. LEA.L OBJ4_MAP(A5),A0
  1746. JMP SET_OBJ_DB(PC)
  1747. DB_START:
  1748. LEA.L VPOS_BUFFER(A5),A4
  1749. MOVE.W OBJ_START(A0),D0
  1750. ADD.W D0,D0
  1751. LEA.L 0(A4,D0.W),A4
  1752. MOVE.W OBJ_SIZE(A0),D7
  1753. MOVE.L #40404040H,D0
  1754. DB_START_1:
  1755. MOVE.L D0,(A4)+
  1756. SUBQ.W #1,D7
  1757. BNE.S DB_START_1
  1758. LEA.L VPOS_BUFFER(A5),A4
  1759. MOVE.L OBJ_START(A0),D7
  1760. MOVE.L D7,TEMP_SPRITE(A5)
  1761. MOVE.W D7,D0
  1762. ADD.L D7,D7
  1763. SWAP D7
  1764. LEA.L 0(A4,D7.W),A4
  1765. SWAP D7
  1766. BTST.B #0,TEMP_SPG(A5)
  1767. BNE.S DB_START_2
  1768. CLR.W 0(A4,D7.W)
  1769. RTS
  1770. DB_START_2:
  1771. CLR.W (A4)
  1772. LEA.L 0(A4,D7.W),A4
  1773. ADD.W D0,TEMP_SPRITE(A5)
  1774. RTS
  1775. OBJ_END_CLEAR
  1776. MOVE.W #1,2(A2)
  1777. MOVE.L OBJ_MAP_POINT(A5),A0
  1778. MOVEQ.L #0,D2
  1779. TST.B SPG_MODE(A5)
  1780. BNE DB_END
  1781. MOVE.W TEMP_SPRITE(A5),D1
  1782. MOVE.W D1,D0
  1783. ADD.W #SP_V,D1
  1784. MOVE.W D1,-2(A2)
  1785. SUB.W OBJ_START(A0),D0
  1786. MOVE.W OBJ_USE(A0),D7
  1787. MOVE.W D0,OBJ_USE(A0)
  1788. SUB.W D0,D7
  1789. BRA.S OBJ_END_CL_2
  1790. OBJ_END_CL_1:
  1791. MOVE.W D2,(A2)
  1792. SUBQ.W #1,D7
  1793. OBJ_END_CL_2:
  1794. BHI.S OBJ_END_CL_1
  1795. RTS
  1796. DB_END:
  1797. CLR.W (A4)
  1798. RTS
  1799. DB_SEND:
  1800. MOVE.W #1,2(A2)
  1801. MOVEQ.L #0,D2
  1802. LEA.L OBJ1_MAP(A5),A0
  1803. BSR DB_SEND_1
  1804. LEA.L OBJ2_MAP(A5),A0
  1805. BSR DB_SEND_1
  1806. LEA.L OBJ3_MAP(A5),A0
  1807. BSR DB_SEND_1
  1808. LEA.L OBJ4_MAP(A5),A0
  1809. DB_SEND_1:
  1810. TST.W DB_TYPE(A0)
  1811. BEQ DB_SEND_4
  1812. BMI NON_USE_CLEAR
  1813. DB_SEND_2:
  1814. LEA.L VPOS_BUFFER(A5),A4
  1815. MOVE.W OBJ_START(A0),D0
  1816. MOVE.W D0,D1
  1817. ADD.W #SP_V,D1
  1818. MOVE.W D1,-2(A2)
  1819. ADD.W D0,D0
  1820. LEA.L 0(A4,D0.W),A4
  1821. MOVE.W OBJ_SIZE(A0),D7
  1822. DB_SEND_3:
  1823. MOVE.W (A4)+,(A2)
  1824. MOVE.W (A4)+,(A2)
  1825. SUBQ.W #1,D7
  1826. BNE.S DB_SEND_3
  1827. DB_SEND_4:
  1828. RTS
  1829. NON_USE_CLEAR:
  1830. MOVE.W OBJ_START(A0),D0
  1831. ADD.W #SP_V,D0
  1832. MOVE.W D0,-2(A2)
  1833. MOVE.W OBJ_SIZE(A0),D7
  1834. BRA.S NUC_2
  1835. NUC_1:
  1836. MOVE.W D2,(A2)
  1837. SUBQ.W #1,D7
  1838. NUC_2:
  1839. BNE.S NUC_1
  1840. CLR.W DB_TYPE(A0)
  1841. RTS
  1842. OFFSET_COMMAND:
  1843. AND.W #0FCH,D4
  1844. JMP OFFSET_COM_VECT(PC,D4.W)
  1845. OFFSET_COM_VECT:
  1846. JMP DATA_END(PC) 0 data end,next work
  1847. JMP CHGSUB(PC) 1 change subwork
  1848. JMP RET_MASTER(PC) 2 return master work
  1849. JMP BLINK(PC) 3 blink
  1850. JMP SUB0(PC) 4 subwork0 table
  1851. JMP SUB1(PC) 5 subwork1 table
  1852. JMP SUB2(PC) 6 subwork2 table
  1853. JMP SUB3(PC) 7 subwork3 table
  1854. JMP GOSUB(PC) 8 gosub
  1855. JMP SUBSUB(PC) 9 gosub with subwork
  1856. JMP RET(PC) A sub return
  1857. JMP SUBRET(PC) B sub return with subwork
  1858. JMP SKIP_W(PC) C skip data for main prog
  1859. JMP SKIP_L(PC) D skip data for main prog
  1860. JMP SUB_OFF(PC) E on/off by subwork
  1861. JMP PAL_COM_OFF(PC) F palette command off
  1862. JMP SUBP0(PC) 10 subwork0 parts table
  1863. JMP SUBP1(PC) 10 subwork1 parts table
  1864. JMP SUBP2(PC) 10 subwork2 parts table
  1865. JMP SUBP3(PC) 10 subwork3 parts table
  1866. DATA_END:
  1867. MOVE.L MASTER_PWORK(A5),A6
  1868. BCLR.B #ACTAT_SET,ACT_ATTR(A6)
  1869. MOVEQ.L #1,D0
  1870. RTS
  1871. CHGSUB:
  1872. MOVEQ.L #00000011B,D0
  1873. AND.W CONV_MARK(A5),D0
  1874. MOVE.B WORK_N0(A6,D0.W),(A5)
  1875. MOVE.W (A5),D0
  1876. LEA.L 0(A5,D0.W),A6
  1877. SUBQ.W #2,A0
  1878. MOVEQ.L #0,D0
  1879. RTS
  1880. RET_MASTER:
  1881. MOVE.L MASTER_PWORK(A5),A6
  1882. SUBQ.W #2,A0
  1883. MOVEQ.L #0,D0
  1884. RTS
  1885. SUB_OFF:
  1886. SUBQ.W #2,A0
  1887. MOVEQ.L #00000011B,D0
  1888. AND.W CONV_MARK(A5),D0
  1889. MOVE.B WORK_N0(A6,D0.W),(A5)
  1890. MOVE.W (A5),D0
  1891. TST.B ACT_TYPE(A5,D0.W)
  1892. BNE.S SUB_OFF_ON
  1893. ADDQ.W #4,A0
  1894. SUB_OFF_ON:
  1895. MOVEQ.L #0,D0
  1896. RTS
  1897. BLINK:
  1898. MOVE.B ACT_TYPE(A6),D0
  1899. BMI.S BLINK_OFF
  1900. ADD.B INT1_COUNT+3(A5),D0
  1901. BTST.L #0,D0
  1902. BEQ.S BLINK_OFF
  1903. SUBQ.W #2,A0
  1904. BLINK_ON:
  1905. MOVEQ.L #0,D0
  1906. RTS
  1907. BLINK_OFF:
  1908. TST.B SPG_MODE(A5)
  1909. BEQ.S SINGLE_BLINK
  1910. ADDQ.W #2,A0
  1911. MOVEQ.L #0,D0
  1912. RTS
  1913. SINGLE_BLINK:
  1914. SUBQ.W #2,A0
  1915. TST.B ACT_ATTR(A6)
  1916. BMI.S BLINK_ON
  1917. MOVE.L (A0)+,CONV_MARK(A5)
  1918. MOVE.W CONV_MARK(A5),D4
  1919. JSR GET_CONV_TYPE(PC) conversion parameter set
  1920. SUB.W D6,MAX_SPRITE(A5)
  1921. MOVE.W TEMP_SPRITE(A5),D4
  1922. ADD.W #SP_V,D4
  1923. MOVE.W D4,-2(A2)
  1924. ADD.W D6,TEMP_SPRITE(A5)
  1925. MOVEQ.L #0,D0
  1926. MOVE.W D0,(A2)
  1927. RTS
  1928. SUBP0:
  1929. MOVEP.W WORK_N0(A6),D1
  1930. JMP SUBP_TBL(PC)
  1931. SUBP1:
  1932. MOVEP.W WORK_N1(A6),D1
  1933. JMP SUBP_TBL(PC)
  1934. SUBP2:
  1935. MOVEP.W WORK_N2(A6),D1
  1936. JMP SUBP_TBL(PC)
  1937. SUBP3:
  1938. MOVEP.W WORK_N3(A6),D1
  1939. SUBP_TBL:
  1940. CLR.B D1
  1941. LEA.L (A0),A1
  1942. MOVEQ.L #00111111B,D0
  1943. AND.B CONV_MARK(A5),D0
  1944. CMP.B ACT_No(A5,D1.W),D0
  1945. BHI.S SUBP_TBL_1
  1946. CLR.B ACT_No(A5,D1.W)
  1947. SUBP_TBL_1:
  1948. ADD.W D0,D0
  1949. ADD.W D0,D0
  1950. LEA.L 0(A0,D0.W),A0
  1951. MOVE.B ACT_No(A5,D1.W),D0
  1952. MOVE.W CONV_MARK+2(A5),D2
  1953. ADD.W D2,ACT_No(A5,D1.W)
  1954. ADD.W D0,D0
  1955. ADD.W D0,D0
  1956. MOVE.L 0(A1,D0.W),CONV_MARK(A5)
  1957. MOVE.W CONV_MARK(A5),D4
  1958. MOVEQ.L #-1,D0
  1959. RTS
  1960. SUB0:
  1961. MOVE.B WORK_N0(A6),(A5)
  1962. JMP SUB_TBL(PC)
  1963. SUB1:
  1964. MOVE.B WORK_N1(A6),(A5)
  1965. JMP SUB_TBL(PC)
  1966. SUB2:
  1967. MOVE.B WORK_N2(A6),(A5)
  1968. JMP SUB_TBL(PC)
  1969. SUB3:
  1970. MOVE.B WORK_N3(A6),(A5)
  1971. SUB_TBL:
  1972. SUBQ.W #2,A0
  1973. LEA.L (A0),A1
  1974. MOVEQ.L #00000011B,D0
  1975. AND.W CONV_MARK(A5),D0
  1976. ADD.W D0,D0
  1977. ADD.W D0,D0
  1978. LEA.L 4(A0,D0.W),A0
  1979. MOVE.W (A5),D0
  1980. MOVE.W ACT_No(A5,D0.W),D0
  1981. BMI.S SUB_TBL_OFF
  1982. ADD.W D0,D0
  1983. ADD.W D0,D0
  1984. MOVE.L 0(A1,D0.W),CONV_MARK(A5)
  1985. MOVE.W CONV_MARK(A5),D4
  1986. MOVEQ.L #-1,D0
  1987. RTS
  1988. SUB_TBL_OFF:
  1989. MOVEQ.L #0,D0
  1990. RTS
  1991. SUBSUB:
  1992. MOVEQ.L #00000011B,D0
  1993. AND.W CONV_MARK(A5),D0
  1994. MOVE.B WORK_N0(A6,D0.W),(A5)
  1995. MOVE.W (A5),D0
  1996. LEA.L 0(A5,D0.W),A6
  1997. GOSUB:
  1998. MOVE.L A0,ACTION_STACK(A5)
  1999. ADD.W CONV_MARK+2(A5),A0
  2000. MOVEQ.L #0,D0
  2001. RTS
  2002. SUBRET:
  2003. MOVE.L MASTER_PWORK(A5),A6
  2004. RET:
  2005. MOVE.L ACTION_STACK(A5),A0
  2006. MOVEQ.L #0,D0
  2007. RTS
  2008. SKIP_L:
  2009. ADDQ.W #2,A0
  2010. SKIP_W:
  2011. MOVEQ.L #0,D0
  2012. RTS
  2013. PAL_COM_OFF:
  2014. SUBQ.W #2,A0
  2015. MOVEQ.L #0,D0
  2016. MOVE.W D0,TEMP_PAL_COM(A5)
  2017. RTS
  2018. ;
  2019. ;
  2020. ; *** ACTION PROGRAM IN MAIN ROUTINE ***
  2021. ;
  2022. ;
  2023. MAIN_ACTION:
  2024. ; logical action
  2025. ; in) A6=phygical work address
  2026. JSR NEXT_ACTION(PC)
  2027. JSR HIT_AREA_SET(PC)
  2028. JSR SORT_SET(PC)
  2029. RTS
  2030. NEXT_ACTION:
  2031. ; action time count
  2032. MOVEQ.L #0,D0
  2033. MOVE.W ACT_No(A6),D0
  2034. ADD.W D0,D0
  2035. ADD.W D0,D0
  2036. MOVE.L CH_TABLE,A0
  2037. MOVE.L 0(A0,D0.L),(A5)
  2038. MOVE.B ACT_DEC(A6),D0
  2039. BMI NEXT_ACTION_9 action stop
  2040. SUB.B D0,ACT_TIMER(A6)
  2041. BGT NEXT_ACTION_9
  2042. ADDQ.B #1,ACT_COUNT(A6)
  2043. BSET.B #ACTAT_SET,ACT_ATTR(A6)
  2044. NEXT_ACTION_1:
  2045. MOVEQ.L #0,D0
  2046. MOVE.B ACT_COUNT(A6),D0
  2047. CMP.B (A5),D0
  2048. BLO.S NEXT_ACTION_2
  2049. MOVEQ.L #0,D0
  2050. MOVE.B D0,ACT_COUNT(A6)
  2051. NEXT_ACTION_2:
  2052. CLR.B (A5)
  2053. MOVE.L (A5),A0
  2054. ADD.W D0,D0
  2055. ADD.W D0,D0
  2056. LEA.L 0(A0,D0.W),A0
  2057. MOVE.B (A0)+,ACT_TIMER(A6)
  2058. BNE.S NEXT_ACTION_3
  2059. BSET.B #7,ACT_DEC(A6)
  2060. NEXT_ACTION_3:
  2061. CLR.L (A5)
  2062. MOVE.B (A0)+,ACT_FLAG(A6)
  2063. MOVE.W (A0),D0
  2064. MOVE.W D0,D1
  2065. AND.W #7FFH,D0
  2066. ADD.W D0,A0
  2067. ADD.W D1,D1
  2068. BCC.S NEXT_ACTION_4
  2069. MOVE.L (A0)+,HIT_OFS_X(A6)
  2070. NEXT_ACTION_4:
  2071. ADD.W D1,D1
  2072. BCC.S NEXT_ACTION_5
  2073. MOVEP.W WORK_N0(A6),D0
  2074. CLR.B D0
  2075. MOVE.L (A0)+,HIT_OFS_X(A5,D0.W)
  2076. NEXT_ACTION_5:
  2077. ADD.W D1,D1
  2078. BCC.S NEXT_ACTION_6
  2079. MOVEP.W WORK_N1(A6),D0
  2080. CLR.B D0
  2081. MOVE.L (A0)+,HIT_OFS_X(A5,D0.W)
  2082. NEXT_ACTION_6:
  2083. ADD.W D1,D1
  2084. BCC.S NEXT_ACTION_7
  2085. MOVEP.W WORK_N2(A6),D0
  2086. CLR.B D0
  2087. MOVE.L (A0)+,HIT_OFS_X(A5,D0.W)
  2088. NEXT_ACTION_7:
  2089. ADD.W D1,D1
  2090. BCC.S NEXT_ACTION_8
  2091. MOVEP.W WORK_N3(A6),D0
  2092. CLR.B D0
  2093. MOVE.L (A0)+,HIT_OFS_X(A5,D0.W)
  2094. NEXT_ACTION_8:
  2095. CMP.B #11000000B,(A0)
  2096. BLO.S NEXT_ACTION_10
  2097. MOVE.W (A0)+,D0
  2098. AND.W #0FCH,D0
  2099. JSR MCOMMAND_TBL(PC,D0.W)
  2100. BRA.S NEXT_ACTION_8
  2101. NEXT_ACTION_10:
  2102. MOVE.L A0,ACT_ADRS(A6)
  2103. BSET.B #ACTAT_SET,ACT_ATTR(A6)
  2104. NEXT_ACTION_9:
  2105. CLR.L (A5)
  2106. RTS
  2107. MCOMMAND_TBL:
  2108. JMP SOUND_CALL(PC)
  2109. JMP SPHERO_CALL(PC)
  2110. JMP H_REV_CHG(PC)
  2111. JMP ACTAT_CHG(PC)
  2112. JMP BIG_CHG(PC)
  2113. JMP USER_PROG(PC)
  2114. JMP INNER_LOOP(PC)
  2115. SOUND_CALL:
  2116. MOVE.W (A0)+,D0
  2117. JMP SET_SOUND(PC)
  2118. SPHERO_CALL:
  2119. MOVE.W (A0)+,D0
  2120. MOVE.L A0,-(SP)
  2121. LEA.L (A6),A0
  2122. JSR SET_SPHERO(PC)
  2123. MOVE.L (SP)+,A0
  2124. RTS
  2125. H_REV_CHG:
  2126. BCHG.B #ACTAT_FLIP,ACT_ATTR(A6)
  2127. RTS
  2128. ACTAT_CHG:
  2129. MOVE.B (A0)+,D0
  2130. AND.B D0,ACT_ATTR(A6)
  2131. MOVE.B (A0)+,D0
  2132. OR.B D0,ACT_ATTR(A6)
  2133. RTS
  2134. BIG_CHG:
  2135. MOVE.W (A0)+,BIG_X(A6)
  2136. RTS
  2137. USER_PROG:
  2138. LEA.L USER_ACT,A1
  2139. MOVEQ.L #03FH,D0
  2140. AND.B -2(A0),D0
  2141. ADD.W D0,D0
  2142. ADD.W D0,D0
  2143. MOVE.L 0(A1,D0.W),A1
  2144. JMP (A1)
  2145. INNER_LOOP:
  2146. MOVEQ.L #00111111B,D0
  2147. AND.B -2(A0),D0
  2148. SUBQ.B #1,D0
  2149. MOVE.B D0,ACT_COUNT(A6)
  2150. RTS
  2151. HIT_AREA_SET:
  2152. ; hit area calucurate
  2153. JSR GET_HIT_X(PC)
  2154. JSR GET_HIT_Y(PC)
  2155. ADD.W Y_POSITION(A6),D3
  2156. MOVE.W D3,HIT_UPPER(A6)
  2157. SUB.W D4,D3
  2158. MOVE.W D3,HIT_LOWER(A6)
  2159. BTST.B #ACTAT_FLIP,ACT_ATTR(A6)
  2160. BNE.S HIT_AREA_SET_2
  2161. ADD.W X_POSITION(A6),D1
  2162. MOVE.W D1,HIT_LEFT(A6)
  2163. ADD.W D2,D1
  2164. MOVE.W D1,HIT_RIGHT(A6)
  2165. RTS
  2166. HIT_AREA_SET_2:
  2167. NEG.W D1
  2168. ADD.W X_POSITION(A6),D1
  2169. MOVE.W D1,HIT_RIGHT(A6)
  2170. SUB.W D2,D1
  2171. MOVE.W D1,HIT_LEFT(A6)
  2172. RTS
  2173. GET_HIT_X:
  2174. MOVE.B HIT_OFS_X(A6),D1
  2175. MOVE.B HIT_SIZE_X(A6),D2
  2176. EXT.W D1
  2177. EXT.W D2
  2178. ADD.W D1,D1
  2179. ADD.W D2,D2
  2180. MOVEQ.L #1,D0
  2181. ADD.B BIG_X(A6),D0
  2182. BEQ.S GET_HIT_X_1
  2183. MULS.W D0,D1
  2184. ASR.L #8,D1
  2185. MULS.W D0,D2
  2186. ASR.L #8,D2
  2187. GET_HIT_X_1:
  2188. RTS
  2189. GET_HIT_Y:
  2190. MOVE.B HIT_OFS_Y(A6),D3
  2191. MOVE.B HIT_SIZE_Y(A6),D4
  2192. EXT.W D3
  2193. EXT.W D4
  2194. ADD.W D3,D3
  2195. ADD.W D4,D4
  2196. MOVEQ.L #1,D0
  2197. ADD.B BIG_Y(A6),D0
  2198. BEQ.S GET_HIT_Y_1
  2199. MULS.W D0,D3
  2200. ASR.L #8,D3
  2201. MULS.W D0,D4
  2202. ASR.L #8,D4
  2203. GET_HIT_Y_1:
  2204. RTS
  2205. ACTION_SET:
  2206. ; new action set
  2207. ; in) D0=action No
  2208. MOVE.W D0,ACT_No(A6)
  2209. MOVE.B #-1,ACT_TIMER(A6)
  2210. MOVE.B #-1,ACT_COUNT(A6)
  2211. BCLR.B #7,ACT_DEC(A6)
  2212. RTS
  2213. ACT_COUNT_SET:
  2214. ; action count direct set
  2215. ; in) D0=act count
  2216. SUBQ.B #1,D0
  2217. MOVE.B D0,ACT_COUNT(A6)
  2218. MOVE.B #-1,ACT_TIMER(A6)
  2219. MOVE.B #1,ACT_DEC(A6)
  2220. RTS
  2221. GET_REL_POS:
  2222. ; relocate position calucurate
  2223. MOVE.W X_POSITION(A6),D0
  2224. SUB.W WINDOW_X(A5),D0
  2225. MOVE.W D0,REL_X(A6)
  2226. MOVE.W Y_POSITION(A6),D0
  2227. ADD.W Z_POSITION(A6),D0
  2228. SUB.W WINDOW_Y(A5),D0
  2229. MOVE.W D0,REL_Y(A6)
  2230. RTS
  2231. INIT_SORT:
  2232. ; SORT_WORK all clear (FF)
  2233. ; use) D0-D7(.l)=0FFFFFFFFH
  2234. ; A0
  2235. LEA.L SORT_WORK+100H(A5),A0
  2236. MOVEQ.L #-1,D0
  2237. MOVE.L D0,D1
  2238. MOVE.L D0,D2
  2239. MOVE.L D0,D3
  2240. MOVE.L D0,D4
  2241. MOVE.L D0,D5
  2242. MOVE.L D0,D6
  2243. MOVE.L D0,D7
  2244. REPT 8
  2245. MOVEM.L D0-D7,-(A0)
  2246. ENDR
  2247. RTS
  2248. SORT_SET:
  2249. ; sorting by priority
  2250. LEA.L SORT_WORK(A5),A1
  2251. MOVEQ.L #0,D0
  2252. MOVE.B PRIORITY(A6),D0
  2253. MOVE.B 0(A1,D0.W),SORT_CHILD(A6)
  2254. MOVE.B WORK_No(A6),0(A1,D0.W)
  2255. RTS
  2256. ORDER_SET:
  2257. MOVE.L OBJ_DIV_POINT(A5),A2
  2258. LEA.L ORDER_BUFFER(A5),A3
  2259. MOVEQ.L #96,D7
  2260. MOVEQ.L #0,D6
  2261. MOVEQ.L #0,D5
  2262. LEA.L SORT_WORK(A5),A1
  2263. MOVE.W D5,(A5)
  2264. TST.B TEMP_ORDER(A5)
  2265. BNE.S ORDER_SET_1
  2266. LEA.L 128(A3),A3
  2267. ORDER_SET_1:
  2268. CMP.W (A2),D6
  2269. BNE.S ORDER_SET_2
  2270. MOVE.B 3(A2),(A3)+
  2271. ADDQ.W #4,A2
  2272. ORDER_SET_2:
  2273. MOVE.B (A1)+,D0
  2274. BMI ORDER_SET_4
  2275. ORDER_SET_3:
  2276. MOVE.B D0,(A3)+
  2277. MOVE.B D0,(A5)
  2278. MOVE.W (A5),D0
  2279. BCLR.B #ACTAT_OFF,ACT_ATTR(A5,D0.W)
  2280. SUBQ.W #1,D7
  2281. BEQ.S ORDER_SET_5
  2282. MOVE.B SORT_CHILD(A5,D0.W),D0
  2283. BPL.S ORDER_SET_3
  2284. ORDER_SET_4:
  2285. ADDQ.B #1,D6
  2286. BNE ORDER_SET_1
  2287. ORDER_SET_5:
  2288. MOVE.B #80H,(A3)
  2289. EOR.B #1,TEMP_ORDER(A5)
  2290. RTS
  2291. INCLUDE WORK.INC
  2292.