CARD.SRC 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397
  1. ;
  2. ;
  3. ; *** 044 MEMORY CARD PROGRAM ***
  4. ;
  5. ;
  6. XDEF INIT_STORY_SAVE,STORY_SAVE
  7. XDEF INIT_STORY_LOAD,STORY_LOAD
  8. XREF ?A5
  9. ;by PHASE
  10. XREF ACTIVE_TRIGER
  11. ;by MESSAGE
  12. XREF MESS_SET,MESS_SET_INNER,FLAME_WRITE,FLAME_CLR
  13. XREF FLAME_WRITED,FLAME_CLRD
  14. ;by DEMO_CML
  15. XREF DEMO_OBJ_MAP
  16. ;by GAME_SUB
  17. XREF LWORK_DEAD
  18. SECT GAME,,C
  19. INCLUDE SYS.INC
  20. INCLUDE NEO_GEO.INC
  21. INCLUDE LABEL.INC
  22. INCLUDE ACT_No.INC
  23. INCLUDE MACRO.INC
  24. INCLUDE EASY_MAC.INC
  25. INCLUDE SMACRO.INC
  26. INCLUDE SCODE.INC
  27. ;
  28. ; *** CARD LOAD ***
  29. ;
  30. INIT_STORY_LOAD:
  31. JSR.S PWORK_INIT
  32. JSR.S LWORK_DEAD
  33. LEA.L MLWORK1(A5),A6
  34. OBJ_MAP DEMO_OBJ_MAP
  35. JSR CARD_FIRST(PC)
  36. MOVE.B #2,CARD_COMMAND(A5) data load
  37. JSR SYS_CARD
  38. LEA.L ?A5,A5
  39. TST.B CARD_ANSWER(A5)
  40. BNE STORY_LOAD_END
  41. BSR LOAD_CHECK
  42. LEA.L MLWORK1(A5),A6
  43. MOVE.W #0,COLOR_BUFFER+1FFEH(A5)
  44. COLOR_COMMAND
  45. PALETTE 000H,00H,PG_SET+BASE_COLOR
  46. PALETTE 0FFH,00H,BASE_COLOR
  47. PALETTE_END
  48. MOVE.W #0A00H,WORD_TIMER(A6)
  49. MOVE.W #0,LW_D0(A6)
  50. MOVE.W #31H,D0
  51. JSR.S MESS_SET
  52. MOVE.W #6,FLAME_COUNT(A5)
  53. MOVE.W #6,FLAME_END(A5)
  54. MOVE.W #1,FLAME_TYPE(A5)
  55. MOVE.W #7000H+20H*11+14,FLAME_POS(A5)
  56. JSR.S FLAME_WRITED
  57. MOVE.W #5EH,D0
  58. JSR.S MESS_SET
  59. JSR CARD_CURSOR(PC)
  60. AND.B #01111111B,PHASE+1(A5)
  61. STEP_SAVE 0,LOAD_0
  62. RTS
  63. LOAD_CHECK:
  64. CMP.W #1,CARD_BUFFER+20(A5)
  65. BCS.S STAGE_ERROR
  66. CMP.W #12,CARD_BUFFER+20(A5)
  67. BCS.S LOAD_CHECK_1
  68. STAGE_ERROR:
  69. MOVE.W #1,CARD_BUFFER+20(A5)
  70. LOAD_CHECK_1:
  71. CMP.B #12,CARD_BUFFER+22(A5)
  72. BCS.S LIFE_ERROR
  73. CMP.B #17,CARD_BUFFER+22(A5)
  74. BCS.S LOAD_CHECK_2
  75. LIFE_ERROR:
  76. MOVE.B #12,CARD_BUFFER+22(A5)
  77. LOAD_CHECK_2:
  78. CMP.B #12,CARD_BUFFER+23(A5)
  79. BCS.S SPILIT_ERROR
  80. CMP.B #17,CARD_BUFFER+23(A5)
  81. BCS.S LOAD_CHECK_3
  82. SPILIT_ERROR:
  83. MOVE.B #12,CARD_BUFFER+23(A5)
  84. LOAD_CHECK_3:
  85. RTS
  86. STORY_LOAD:
  87. LEA.L MLWORK1(A5),A6
  88. EASY_START
  89. LOAD_0:
  90. JSR CARD_TIME_DEC(PC)
  91. BCS STORY_LOAD_END
  92. JSR CARD_LEVER(PC)
  93. BNE LOAD_1
  94. RTS
  95. LOAD_1:
  96. SOUND #S_KETTEI
  97. TST.W LW_D0(A6)
  98. BNE.S STORY_LOAD_END
  99. MOVE.W CARD_BUFFER+20(A5),STORY_STAGE(A5)
  100. MOVE.B CARD_BUFFER+22(A5),STORY_LIFE(A5)
  101. MOVE.B CARD_BUFFER+23(A5),STORY_SPIRIT(A5)
  102. MOVE.B CARD_BUFFER+24(A5),HAOH_USE(A5)
  103. MOVE.B #00100000B,D0
  104. AND.B PHASE+1(A5),D0
  105. OR.B #10000010B,D0 story player select
  106. MOVE.B D0,PHASE+1(A5)
  107. RTS
  108. STORY_LOAD_END:
  109. MOVE.B #00100000B,D0
  110. AND.B PHASE+1(A5),D0
  111. OR.B #10000001B,D0 story how to play
  112. MOVE.B D0,PHASE+1(A5)
  113. RTS
  114. ;
  115. ; *** CARD SAVE ***
  116. ;
  117. INIT_STORY_SAVE:
  118. MOVE.W #S_RESET,D0
  119. JSR.S SET_BGM
  120. SOUND #S_WAIT2
  121. SOUND #S_WAIT2
  122. SOUND #S_ALL_EI
  123. JSR.S PWORK_INIT
  124. JSR.S LWORK_DEAD
  125. LEA.L MLWORK1(A5),A6
  126. OBJ_MAP DEMO_OBJ_MAP
  127. BTST.B #4,PHASE+1(A5)
  128. BEQ ISS_1
  129. ; in vs.mode
  130. MOVE.L WIN_PLAYER(A5),A4
  131. MOVE.L ANOTHER_PLAYER(A4),A4
  132. MOVE.W PLAYER_No(A4),D0
  133. CMP.W STORY_PLAYER(A5),D0
  134. BNE STORY_SAVE_END
  135. CLR.B PHASE(A5)
  136. BSET.B D0,PHASE(A5)
  137. CLR.B MAKE_DEMO_CUT(A5)
  138. ISS_1:
  139. MOVE.B START_SELECT,D0
  140. AND.B #IC_CARD_ON,D0
  141. BNE STORY_SAVE_END
  142. JSR CARD_FIRST(PC)
  143. JSR CARD_SAVE_SET(PC)
  144. LEA.L MLWORK1(A5),A6
  145. MOVE.W #0,COLOR_BUFFER+1FFEH(A5)
  146. COLOR_COMMAND
  147. PALETTE 000H,00H,PG_SET+BASE_COLOR
  148. PALETTE 0FFH,00H,BASE_COLOR
  149. PALETTE_END
  150. MOVE.W #0A00H,WORD_TIMER(A6)
  151. MOVE.W #1,LW_D0(A6)
  152. MOVE.W #31H,D0
  153. JSR.S MESS_SET
  154. MOVE.W #6,FLAME_COUNT(A5)
  155. MOVE.W #6,FLAME_END(A5)
  156. MOVE.W #1,FLAME_TYPE(A5)
  157. MOVE.W #7000H+20H*11+14,FLAME_POS(A5)
  158. JSR.S FLAME_WRITED
  159. MOVE.W #5FH,D0
  160. JSR.S MESS_SET
  161. JSR CARD_CURSOR(PC)
  162. AND.B #01111111B,PHASE+1(A5)
  163. STEP_SAVE 0,SAVE_0
  164. RTS
  165. STORY_SAVE:
  166. LEA.L MLWORK1(A5),A6
  167. EASY_START
  168. SAVE_0:
  169. JSR CARD_TIME_DEC(PC)
  170. BCS STORY_SAVE_END
  171. JSR CARD_LEVER(PC)
  172. BNE.S SAVE_1
  173. RTS
  174. SAVE_1:
  175. CMP.B #7,WORD_TIMER(A6)
  176. BCS.S SAVE_2
  177. RTS
  178. SAVE_2:
  179. TST.W LW_D0(A6)
  180. BNE STORY_SAVE_END_0
  181. MOVE.B START_SELECT,D0
  182. AND.B #IC_CARD_ON,D0
  183. BEQ.S SAVE_3
  184. RTS
  185. SAVE_3:
  186. SOUND #S_KETTEI
  187. JSR SAVE_CHECK(PC)
  188. BNE STORY_SAVE_END
  189. MOVE.W #62H,D0
  190. JSR.S MESS_SET
  191. MOVE.W #200H,WORD_TIMER(A6)
  192. END_NEXT 4,SAVE_4
  193. SAVE_4:
  194. SEC_TIMER WORD_TIMER
  195. BCS.S STORY_SAVE_END
  196. RTS
  197. STORY_SAVE_END_0:
  198. SOUND #S_KETTEI
  199. STORY_SAVE_END:
  200. BTST.B #4,PHASE+1(A5)
  201. BNE SAVE_IN_VS
  202. MOVE.B #10000100B,PHASE+1(A5)
  203. RTS
  204. SAVE_IN_VS:
  205. MOVE.L WIN_PLAYER(A5),A1
  206. MOVE.L ANOTHER_PLAYER(A1),A0
  207. MOVE.W PLAYER_No(A0),D0
  208. CMP.W STORY_PLAYER(A5),D0
  209. BNE.S SAVE_IN_VS_1
  210. MOVE.W #-1,STORY_PLAYER(A5)
  211. SAVE_IN_VS_1:
  212. CLR.B PHASE(A5)
  213. MOVE.W PLAYER_No(A1),D0
  214. BSET.B D0,PHASE(A5)
  215. MOVE.B #00110000B,D0
  216. AND.B PHASE+1(A5),D0
  217. OR.B #10000011B,D0 vs.entry
  218. MOVE.B D0,PHASE+1(A5)
  219. RTS
  220. SAVE_CHECK:
  221. MOVEM.L A0-A6,-(SP)
  222. MOVE.B #4,CARD_COMMAND(A5)
  223. JSR SYS_CARD
  224. MOVE.B #3,CARD_COMMAND
  225. JSR SYS_CARD
  226. TST.B CARD_ANSWER
  227. BEQ SAVE_CHECK_3
  228. MOVE.W STORY_PLAYER,D0
  229. ADDQ.B #1,D0
  230. EOR.B #00000011B,D0
  231. MOVE.B D0,ERROR_LEVER
  232. JSR SYS_CARD_ERROR
  233. CLR.B ERROR_LEVER
  234. TST.B CARD_ANSWER
  235. SAVE_CHECK_3:
  236. MOVEM.L (SP)+,A0-A6
  237. RTS
  238. CARD_SAVE_SET:
  239. LEA.L CARD_BUFFER(A5),A0
  240. MOVE.L 116H,A1
  241. TST.B COUNTRY_CODE(A5)
  242. BEQ CSS_1
  243. MOVE.L 11AH,A1
  244. CSS_1:
  245. MOVE.L (A1)+,(A0)+
  246. MOVE.L (A1)+,(A0)+
  247. MOVE.L (A1)+,(A0)+
  248. MOVE.L (A1),(A0)+
  249. MOVE.L #' ',(A0)+
  250. MOVE.W STORY_STAGE(A5),(A0)+
  251. MOVE.B STORY_LIFE(A5),(A0)+
  252. MOVE.B STORY_SPIRIT(A5),(A0)+
  253. MOVE.B HAOH_USE(A5),(A0)+
  254. RTS
  255. ;
  256. ; *** sub routine & message ***
  257. ;
  258. CARD_LEVER:
  259. JSR.S ACTIVE_TRIGER
  260. MOVE.W LW_D0(A6),D1
  261. MOVE.B D2,D0
  262. AND.B CL_EI(PC,D1.W),D0
  263. BEQ CARD_LEVER_1
  264. EOR.W #1,LW_D0(A6)
  265. JSR CARD_CURSOR(PC)
  266. SOUND #S_SENTAKU
  267. CARD_LEVER_1:
  268. AND.B #A_BUTTON,D2
  269. RTS
  270. CL_EI:
  271. DC.B RIGHT,LEFT
  272. CARD_TIME_DEC:
  273. SUBQ.B #1,WORD_TIMER+1(A6)
  274. BGT.S CARD_TIME_1
  275. MOVE.W #63H,D0
  276. JSR.S MESS_SET
  277. MOVE.B SECOND_VALUE(A5),WORD_TIMER+1(A6)
  278. SUBQ.B #1,WORD_TIMER(A6)
  279. CARD_TIME_1:
  280. RTS
  281. CARD_FIRST:
  282. MOVE.W 108H,CARD_FCB(A5) game code (044)
  283. MOVE.B #0,CARD_SUB(A5) file No
  284. MOVE.L #CARD_BUFFER,CARD_START(A5)
  285. MOVE.W #64,CARD_SIZE(A5)
  286. MOVE.W #108H,CARD_BUFFER(A5)
  287. RTS
  288. CARD_CURSOR:
  289. MOVE.W #60H,D0
  290. ADD.W LW_D0(A6),D0
  291. JSR.S MESS_SET
  292. RTS
  293. INCLUDE WORK.INC
  294.