Advertisement
Zoinkity

ZSIJ Running dASM

May 10th, 2017
348
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 126.95 KB | None | 0 0
  1. 80025C00 inception point
  2. 8006B780[0:0xB4C50] = repeat(0, 0xB4C50)
  3. SP = 800B1A60
  4. goto 8003A940()
  5. 80025C60 V0 = 80113110[0]
  6. 80025C6C Thread: game
  7. call 80047068(0) # initialize Aleck
  8. call 8004742C(800ADBC8) # write Aleck hardware handles to A0
  9. call 80029170(800ADBC8) # read Aleck IO using handles A0 to manager at 80112968
  10. 800AEE78+0 = 0
  11. 800AEE78+4 = 0
  12. 80112A2C[0] = 0
  13. 8007D8E4[0] = 0
  14. call 8003CA30() # ???; sets up framebuffers and display processing threads
  15. call 8003CB80()
  16. call 8003C8A0() # create E/PI Thread and handle
  17. call 80029CF0() # redirect to 8003DBB0: add SI callback for 80066D94
  18. call 8003EF10()
  19. 8007DAEC = 0x20000
  20. call 80053E50(8007DB30, 0x20000) # initialize A1 bytes at A0
  21. call 800341E0(8007DB30, @8007DAEC) # create memory manager for A1 bytes at A0
  22. call 8002623C(0) # set screen resolution A0: 320x240
  23. call 8003C900(0x46B80, 801203D0, 0x64580 - 0x46B80) # load A2 bytes from hardware A0 to rdram A1
  24. dl = 80118390
  25. 801182C0 = 80118390+8 # cur p->DL
  26. dl.append(E9000000, 00000000)
  27. 801182C0 = 80118390+10
  28. dl.append(DF000000, 00000000)
  29. 80117620 = 0
  30. 80117624 = 0
  31. 80064FE0 = 0
  32. 80064FB4 = 0
  33. 80064FE0 = 1
  34. # 80025DB0
  35. while True:
  36. 800AEE78+0 = 0
  37. 800AEE78+4 = 0
  38. 80113110[0] = 0
  39. 80112A2C[0] = 0
  40. 8007D8E4[0] = 0
  41. call 80029170(800ADBC8) # read Aleck IO using handles A0 to manager at 80112968
  42. call 80037990(800ADBC8)
  43. for i in range(2):
  44. 8007D8E8+(i<<2) = 3
  45. 8007D900[i*5] = 0
  46. v = 0xC + (i << 1)
  47. 8007D8E8[v:v+2] = 0
  48. # 80025E40
  49. 8007D890[0:2] = 0
  50. 8007DAE8[0:2] = 0
  51. 8007D8A8[0:2] = 0
  52. 800B2680[0:2] = 0
  53. 800ADC3C[0:2] = 0
  54. call 800374F0()
  55. call 80028D90()
  56. call 80028DC8(0, 8002A7E8) # link context function A1 in index A0
  57. call 8003C580(80025EC0) # set 80066DA0 to function pointer A0
  58. call 8003C870() # 800AE9F8 = 0x80
  59. while True:
  60. if not call 80025C60(): # V0 = 80113110[0]
  61. break
  62. 80025EC0
  63. 80117624 += 1
  64. 80117620 += (@80117624 < 1)
  65. 8006B780 += 1
  66. if not 80118300[6:8]:
  67. call 80029424()
  68. elif 80118300[6:8] == 1:
  69. 800ADC3C[0:2] = 0
  70. 800B2680[0:2] = 0
  71. call 800293D4() # update 80112978 with current Aleck switch state
  72. else:
  73. call 800293D4() # update 80112978 with current Aleck switch state
  74. call 80037C70()
  75. if @800D26B8 or @80064FB4:
  76. return
  77. # 80025F7C
  78. ...
  79.  
  80. 8002622C unconditional return
  81. accepts: A0
  82. 80026234 NERFed! display string A1; unconditional return
  83. accepts: A0=palette?, A1=p->string
  84. 8002623C set screen resolution A0
  85. accepts: A0=resolution (0:320x240, 1:640x480)
  86. call 8003C5E0() # wait while @800D26B8 nonzero
  87. if not A0:
  88. if not @80064FB0 & 0x40:
  89. return
  90. 80064FBC = 0x140
  91. 80064FC0 = 0xF0
  92. call 80055850(80068740) # use VI settings at A0
  93. call 8003C830() # disable display and blackout
  94. call 8003C630(80064FC4, 3) # register A1 framebuffers starting at rdram A0
  95. 800ADBB0 = 80000400
  96. call 8003C870() # 800AE9F8 = 0x80
  97. 80064FB0 &= ~0x40
  98. elif A0 == 1:
  99. # 800262CC
  100. if @80064FB0 & 0x40:
  101. return
  102. 80064FBC = 0x280
  103. 80064FC0 = 0x1E0
  104. call 80055850(80068790) # use VI settings at A0
  105. call 8003C830() # disable display and blackout
  106. call 8003C630(80064FD0, 1) # register A1 framebuffers starting at rdram A0
  107. 800ADBB0 = 80000400
  108. call 8003C870() # 800AE9F8 = 0x80
  109. 80064FB0 |= 0x40
  110. 80026360 unconditional return
  111. 80026368
  112.  
  113. 80028A5C set A1 words at A0 to previous address & 0xFFFFFF
  114. accepts: A0=p->target, A1=words
  115. A1 <<= 2
  116. for i in (A0+A1, A0, -4):
  117. i+0 = (i - 4) & 0xFFFFFF
  118. A0+0 = 0
  119. 80028A9C append list of display list pointers at A0
  120. accepts: A0=p->list of DL pointers
  121. v = @A0+0
  122. while v:
  123. if (v>>24) == 0:
  124. v &= 0xFFFFFF
  125. v = @80000000+v
  126. elif (v>>24) == 1:
  127. v = (v & 0xFFFFFF) - 80000000
  128. dl = @801182C0
  129. dl.append(DE000000, @v+4)
  130. 801182C0 += 8
  131. v = @v+0
  132. 80028B1C
  133. accepts: A0, A1, A2, A3, SP+10, SP+14
  134. v = @800AEED4
  135. 800AEED4 += 0x48
  136. v+44 = v + 0x48
  137. i = (0 - @80064FC0) << 1
  138. j = @80064FBC + (@80064FBC >> 31)
  139. j >>= 1
  140. k = @80064FC0 + (@80064FC0 >> 31)
  141. k >>= 1
  142. v[0:2] = A0 + A3 - j
  143. v[2:4] = k - (A1 + @SP+10)
  144. v[4:6] = i
  145. v[C] = (@SP+14 >> 16) & 0xFF
  146. v[D] = (@SP+14 >> 8) & 0xFF
  147. v[E] = @SP+14 & 0xFF
  148. v[12:14] = k - (A1 + @SP+10)
  149. v[14:16] = i
  150. v[20:22] = A0 + A3 - j
  151. v[22:24] = k - (A0 + j)
  152. v[24:26] = i
  153. v[30:32] = j
  154. v[32:34] = k - (A0 + j)
  155. v[34:36] = i
  156. v+40 = 0
  157. v+48.append(DA380003, @801203A8 + 80000080)
  158. v+50.append(01004008, v)
  159. v+58.append(E7000000, 00000000)
  160. v+60.append(E3000A01, 00000000)
  161. v+68.append(FC327E64, FFFFF7FB)
  162. v+70.append(D9000000, 00000000)
  163. v+78.append(D9FFFFFF, 00000404)
  164. if not @80064FE4:
  165. v+80.append(E200001C, 00552008)
  166. v+88.append(FA000101, FFFFFFFF)
  167. else:
  168. if @80064FE4 == 1:
  169. v+80.append(E200001C, 005041C8)
  170. else:
  171. v+80.append(E200001C, 005A41C8)
  172. v+88.append(FA000101, FFFFFF00 | 80064FE8[3])
  173. # 80028CFC
  174. v+90.append(06000402, 00000604)
  175. v+98.append(DF000000, 00000000)
  176. 800AEED4 = v + 0xA0
  177. A2 = min(0xFFF, A2)
  178. A2 &= (~A2 >> 31)
  179. A2 <<= 2
  180. A3+0 = @80113490+A2
  181. 80113490+A2 = 01000000 + (A3 & 0xFFFFFF)
  182. 80028D90
  183. call 8005C620(800AEF50, 0, 0x840) # V0=p->A2 bytes at A0 filled with value A1
  184. 800AEF4C = 0
  185. 80117490 = 0
  186. 80028DC8 link context function A1 in index A0
  187. accepts: A0=index, A1=p->function
  188. v = 800AEF50 + (A0 * 0x84)
  189. call 8005C620(v, 0, 0x84) # V0=p->A2 bytes at A0 filled with value A1
  190. v+78 = 8009EBB0 + (A0 * 0x1000)
  191. v+0 = 1
  192. v+80 = A1
  193. i = 1 << A0
  194. 80117490 = @80117490 | i
  195. 800AEF4C = @800AEF4C & ~i
  196. v+44 = S0
  197. v+48 = S1
  198. v+4C = S2
  199. v+50 = S3
  200. v+54 = S4
  201. v+58 = S5
  202. v+5C = S6
  203. v+60 = S7
  204. v+6C = K0
  205. v+70 = K1
  206. v+74 = GP
  207. v+7C = S8
  208. 80028EA8 stop and unlink registered context function A0
  209. accepts: A0=flag index
  210. v = 1 << A0
  211. 80117490 &= ~v
  212. 800AEF4C &= ~v
  213. 80028EE0 set context flag A0 at 800AEF4C
  214. accepts: A0=flag index
  215. v = 1 << A0
  216. 800AEF4C |= v
  217. 80028F00 unset context flag A0 at 800AEF4C
  218. accepts: A0=flag index
  219. v = 1 << A0
  220. 800AEF4C &= ~v
  221. 80028F24 V0 = True if context function A0 linked else False
  222. accepts: A0=flag index
  223. v = 1 << A0
  224. return @80117490 & v
  225. 80028F3C
  226. 800D26C8+40 = S0
  227. 800D26C8+44 = S1
  228. 800D26C8+48 = S2
  229. 800D26C8+4C = S3
  230. 800D26C8+50 = S4
  231. 800D26C8+54 = S5
  232. 800D26C8+58 = S6
  233. 800D26C8+5C = S7
  234. 800D26C8+68 = K0
  235. 800D26C8+6C = K1
  236. mask = 1
  237. i = 800AEF50
  238. # 80028F9C
  239. for j in range(0x10):
  240. if (@80117490 & mask) and (@800AEF4C & mask):
  241. i -= 1
  242. if not @i:
  243. 800D26C8+8 = V0
  244. 800D26C8+C = V1
  245. 800D26C8+10 = A0
  246. 800D26C8+14 = A1
  247. 800D26C8+18 = A2
  248. 800D26C8+1C = A3
  249. 800D26C8+3C = T7
  250. 800D26C8+70 = GP
  251. 800D26C8+74 = SP
  252. 800D26C8+78 = S8
  253. 800D26C8+7C = RA
  254. # 80028FF8
  255. S0 = @i+44
  256. S1 = @i+48
  257. S2 = @i+4C
  258. S3 = @i+50
  259. S4 = @i+54
  260. S5 = @i+58
  261. S6 = @i+5C
  262. S7 = @i+60
  263. K0 = @i+6C
  264. K1 = @i+70
  265. GP = @i+74
  266. SP = @i+78
  267. S8 = @i+7C
  268. 800D26C8+80 = 80029084
  269. call @i+80()
  270. # 80029040
  271. v = @800D26C8+14 NOR @800D26C8+14
  272. 80117490 = @800D26C8+18 & v
  273. 800AEF4C = @800D26C8+3C & v
  274. # 80029084: restores context
  275. T7 = @800D26C8+3C
  276. GP = @800D26C8+70
  277. SP = @800D26C8+74
  278. S8 = @800D26C8+78
  279. RA = @800D26C8+7C
  280. i = @800D26C8+1C + 0x84
  281. mask <<= 1
  282. # 800290D0
  283. S0 = @800D26C8+40
  284. S1 = @800D26C8+44
  285. S2 = @800D26C8+48
  286. S3 = @800D26C8+4C
  287. S4 = @800D26C8+50
  288. S5 = @800D26C8+54
  289. S6 = @800D26C8+58
  290. S7 = @800D26C8+5C
  291. K0 = @800D26C8+68
  292. K1 = @800D26C8+6C
  293. 800290FC run assigned context function A0 times
  294. v = @800D26C8+1C
  295. v+0 = A0
  296. v+44 = S0
  297. v+48 = S1
  298. v+4C = S2
  299. v+50 = S3
  300. v+54 = S4
  301. v+58 = S5
  302. v+5C = S6
  303. v+60 = S7
  304. v+6C = K0
  305. v+70 = K1
  306. v+74 = GP
  307. v+78 = SP
  308. v+7C = S8
  309. v+80 = RA
  310. goto @800D26C8+80
  311. 8002915C unconditional return
  312. 80029170 read Aleck IO using handles A0 to manager at 80112968
  313. accepts: A0=p->Aleck hardware handles
  314. 80112968+0 = @A0+8 # E0800000
  315. 80112968+4 = @A0+8 + 2
  316. 80112968+8 = @A0+8 + 4
  317. 80112988[20:22] = 0
  318. 80112988[22:24] = 0
  319. 80112988[24:26] = 0
  320. 80112988[26:28] = 0
  321. 80112988[28:2A] = 0
  322. 80112988[2A:2C] = 0
  323. 80112988[2C:2E] = 0
  324. 80112988[2E:30] = 0
  325. 80112988[30:32] = 0
  326. 80112968+C = @A0+8 + 0xA
  327. for i in range(4):
  328. v = @80112968+(i<<2)
  329. 80112968+18[i<<1:i<<1 + 2] = ~(v[0:2])
  330. 80112968+10[i<<1:i<<1 + 2] = ~(v[0:2])
  331. 80029244
  332. v = (80118300[2:4] - 80118378[2:4]) / @80118358
  333. return 0 - (v < 1)
  334. 80029288
  335. 800293D4 update 80112978 with current Aleck switch state
  336. for i in range(4):
  337. j = i << 1
  338. 80112980[j:j+2] = 80112978[j:j+2]
  339. v = @80112968+(i<<2)
  340. 80112978[j:j+2] = ~v
  341. 80029424
  342. call 800293D4() # update 80112978 with current Aleck switch state
  343. call 80029498()
  344. call 800295F0()
  345. call 80029710()
  346. call 80029C78() # unconditional return
  347. if not 80118300[6:8]:
  348. call 80029870()
  349. call 80029AE4()
  350. else:
  351. 800ADC3C[0:2] = 0
  352. 800B2680[0:2] = 0
  353. 80029498
  354. v = 80112978[4:6]
  355. if not v & 4: # coin slot 1
  356. if 80118300[E:10] & 1:
  357. 80118300[E:10] &= ~1
  358. if not 80118300[E:10]:
  359. call 8003A2D0(2)
  360. 80112980[A:C] = 0
  361. # 800294E0
  362. if 80112980[A:C] < 2:
  363. 80112980[A:C] = 0
  364. return
  365. elif 80112980[A:C] >= 0x1E:
  366. return
  367. 80112980[A:C] = 0
  368. 8007D8A8[0:2] += 1
  369. if 8007D8E4[0]:
  370. # 8002952C
  371. 80118300[4:6] += 1
  372. 80118318[0:2] += 1
  373. call 8003A6BC()
  374. 80118310[0:2] = 1
  375. if 80118300[2:4] > 0x270F:
  376. 80118300[2:4] = 0x270F
  377. else:
  378. # 80029584
  379. 80118384 += 1
  380. else:
  381. # 8002959C
  382. 80112980[A:C] += 1
  383. if 80112980[A:C] < 0x1F:
  384. return
  385. if not 80118300[E:10] & 1: # set error after timeout!
  386. 80118300[E:10] |= 1
  387. call 8003A2D0(1)
  388. 800295F0
  389. if not @800652A0 and 80112A2C[0]:
  390. v = 80112978[4:6]
  391. if (v & 0x10) and not (801182F0[4:6] & 2): # service button
  392. 801182F0[4:6] |= 2
  393. call 8003A760(1)
  394. 800652A0 += 1
  395. else:
  396. # 80039664
  397. v &= v ^ 80112980[4:6]
  398. if not v & 0x10: # service button pressed
  399. return
  400. if 8007D8E4[0]:
  401. 80118300[4:6] += 1
  402. 80118318[0:2] += 1
  403. call 8003A6BC()
  404. 80118310[0:2] = 1
  405. if 80128300[2:4] > 0x270F:
  406. 80128300[2:4] = 0x270F
  407. else:
  408. 80118384 += 1
  409. 80029710
  410. if 80118300[6:8]:
  411. 8006C890 = 0
  412. return
  413. v = 80112978[4:6]
  414. if not v & 0x20: # test button
  415. 8006C890 = 0
  416. return
  417. 8006C890 += 1
  418. 80118300+8 = 0
  419. if @8006C890 < 0xB5:
  420. return
  421. # 80029760
  422. 8006C890 = 0
  423. 80118388 = 0
  424. v = 80118378[2:4] - 80118330[6:8]
  425. if v < 0:
  426. v = 0
  427. i = v - 80118300[2:4]
  428. 8007DAE8[0:2] += i / @80118358
  429. if (@80118370 & 0) or (@80118374 & 0x80):
  430. 80118300[2:4] = v
  431. 80118330[6:8] = 80118378[2:4] - v
  432. else:
  433. 80118300[2:4] = i - (i / @80118358 * @80118358)
  434. 80029870
  435. 800ADC3C[0:2] = 1
  436. # if @80112954 >= 7: return # error mode #
  437. # call @8006A518(@80112954<<2)()
  438. if @80112954 in (0, 1):
  439. # 800298B0
  440. if not @800AEE78 and @800AEE7C < 0x5B:
  441. return
  442. v = 80118300[2:4] + 80118330[6:8]
  443. if v < 0x2328:
  444. if 801182FC[2:4] or 80118378[2:4] or 80118318[2:4]:
  445. return
  446. if call 80029244():
  447. return
  448. # 80029940
  449. v = @80118300 / @80118358
  450. i = 80112978[4:6] & (80112978[4:6] ^ 80112980[4:6])
  451. if not (@80118344 + @8011834C) and (i & 1):
  452. # 80029A88: pressed P1 Start
  453. 80118300+8 = 0
  454. if v <= 0:
  455. return
  456. call 80029288(v)
  457. else:
  458. # 80029AA4
  459. i = (@80118344 + @8011834C) < 1
  460. i &= 0 < v
  461. if i:
  462. 800ADC3C[0:2] = 0
  463. elif @80112954 == 3:
  464. # 800299A8
  465. if not @800AEE78 and @800AEE7C < 0x5B:
  466. return
  467. v = 80118300[2:4] + 80118330[6:8]
  468. if v < 0x2328:
  469. if 801182FC[2:4] or 80118378[2:4]:
  470. return
  471. if call 80029244():
  472. return
  473. # 80029A28
  474. v = @80118300 / @80118358
  475. i = 80112978[4:6] & (80112978[4:6] ^ 80112980[4:6])
  476. if not (@80118344 + @8011834C) and (i & 1):
  477. # 80029A88: pressed P1 Start
  478. 80118300+8 = 0
  479. if v <= 0:
  480. return
  481. call 80029288(v)
  482. else:
  483. # 80029AA4
  484. i = (@80118344 + @8011834C) < 1
  485. i &= 0 < v
  486. if i:
  487. 800ADC3C[0:2] = 0
  488. elif @80112954 == 4:
  489. # 80029ACC
  490. 800ADC3C[0:2] = 0
  491. 80029AE4
  492.  
  493. 80029C78 unconditional return
  494. 80029C80 V0 = nonzero if coin slot 1 triggered
  495. v = @80112970 # E0800004
  496. return v[0:2] & 4
  497. 80029C98 V0 = 1 service button pressed else -1
  498. v = @80112970 # E0800004
  499. i = ~v[0:2]
  500. v = i & (i ^ 80112990[2:4])
  501. if v & 0x10:
  502. return 1
  503. 80112990[2:4] = i
  504. return -1
  505. 80029CDC V0 = True if P1 start else False
  506. v = @80112970 # E0800004
  507. return v[0:2] & 1
  508. 80029CF0 redirect to 8003DBB0: add SI callback for 80066D94
  509. 80029D0C
  510. accepts: A0
  511. for i in range(8):
  512. SP[18] = 0 # not a typo; they set the same value 8 times!
  513. v = call 8003DD30() # V0 = eeprom type or -1
  514. if v < 0:
  515. return
  516. for i in range(7):
  517. SP[17-i] = 0
  518. call 8003DCA8(0, SP+10, 8) # write A2 bytes of data A1 to eeprom address A0
  519. call 8003DC20(0, SP+10, 8) # read A2 bytes of data from eeprom address A0 to A1
  520. for i in (SP+10[0:8]):
  521. if not i:
  522. break
  523. call 80053F80(800AED38, 8006A558) # V0 = p->C-string A1 expanded and Null-terminated to A0: " == EEPROM ERROR == NOT INIT != 0 \n"
  524. call 80026234(0, 800AED38) # NERFed! display string A1
  525. for i in range(7):
  526. SP[17-i] = 0xFF
  527. call 8003DCA8(0, SP+10, 8) # write A2 bytes of data A1 to eeprom address A0
  528. call 8003DC20(0, SP+10, 8) # read A2 bytes of data from eeprom address A0 to A1
  529. for i in (SP+10[0:8]):
  530. if i == 0xFF:
  531. break
  532. while True:
  533. call 80053F80(800AED38, 8006A580) # V0 = p->C-string A1 expanded and Null-terminated to A0: " == EEPROM ERROR == NOT INIT != 0xFF \n"
  534. call 80026234(0, 800AED38) # NERFed! display string A1
  535. 800D2750[0] = 0
  536. 800D2750[3] = 6
  537. 800D2750[2] = 4
  538. 800D2750[10] = 4
  539. 800D2750[1] = 3
  540. 800D2750+8 = 0
  541. 800D2750+C = 4
  542. 800D2750[12] = call 8005C6F0()
  543. 800D2750[13] = 0
  544. 800D2750[14] = 0
  545. v, j = 0
  546. for i in range(0x18):
  547. v ^= 800D2750[i]
  548. v += i
  549. 800D2750[14] = v
  550. call 80029EF4()
  551. 80029EF4
  552. if call 8003DD30() <= 0: # V0 = eeprom type or -1
  553. return
  554. v = call 8005C6F0()
  555. if v < 0:
  556. v += 0xFF
  557. 800D2750[14] = 0
  558. 800D2750[12] = v
  559. v = 0
  560. for i in range(0x18):
  561. v ^= 800D2750[i]
  562. v += i
  563. 800D2750[14] = v
  564. call 8003DCA8(0, 800D2750, 0x18) # write A2 bytes of data A1 to eeprom address A0
  565. 80029F90
  566. if call 8003DD30() <= 0: # V0 = eeprom type or -1
  567. return
  568. for i in range(3):
  569. call 8003DC20(0, SP+10, 0x18) # read A2 bytes of data from eeprom address A0 to A1
  570. v = 0
  571. for j in range(0x18):
  572. v ^= SP[10+j]
  573. v += j
  574. if SP[24] == v:
  575. 800D2750[0:18] = SP[10:18]
  576. call 8005C724(800D2750[12]) # 8007D880 = A0
  577. call 80029EF4()
  578. call 80029D0C(0)
  579. 80128300[6:8] = 1
  580. 8002A080
  581. 8002A33C
  582. accepts: A0
  583. A0 &= 0xFFF
  584. if A0 < 0x401:
  585. v = A0 << 1
  586. return 80065AB4[v:v+2]
  587. if A0 < 0x801:
  588. v = (0x800 - A0) << 1
  589. return 80065AB4[v:v+2]
  590. if A0 < 0xC01:
  591. v = A0 << 1
  592. return 0 - 80064AB4[v:v+2]
  593. v = (0x1000 - A0) << 1
  594. return 0 - 80065AB4[v:v+2]
  595. 8002A3C4
  596. 8002A450
  597. 80118300+8 = 0
  598. if 80118300[4:6] <= 0:
  599. return
  600. v = 80112978[0:2] # DIP switches
  601. if v & 0x200:
  602. 80118330[6:8] += (80118300[4:6] * 8011835C[0:2])
  603. if 80118330[6:8] > 0x270F:
  604. 80118330[6:8] = 0x270F
  605. else:
  606. # 8002A4E4
  607. 80118330[2:4] += (80118300[4:6] * 8011835C[0:2])
  608. if 80118330[2:4] > 0x270F:
  609. 80118330[2:4] = 0x270F
  610. # 8002A530
  611. call 8003A79C(80118300[2:4])
  612. call 8003A3E0(80118330[6:8])
  613. 80118300[4:6] = 0
  614. 80118318[0:2] = 0
  615. call 8003A6BC()
  616. 80118388[0:2] = 0
  617. 8002A580
  618. 8002A7E8
  619. 80112954 = 1
  620. 80066A54 = 0x14
  621. 80117494 = 0
  622. call 8002685C()
  623. 80118300[6:8] = 2
  624. call 800290FC(0x1E) # run assigned context function A0 times
  625. call 8003A2D0(2)
  626. call 8003A7B8() # call 80039A48(0xC)
  627. call 800290FC(1) # run assigned context function A0 times
  628. v = 80112978[0:2] # DIP switches
  629. if v & 1:
  630. 80118300[6:8] = 2
  631. call 8003A358(1)
  632. call 80028DC8(0xA, 800308BC) # link context function A1 in index A0: button switch test
  633. while True:
  634. call 800290FC(1) # run assigned context function A0 times
  635. # 8002A8A4
  636. if v & 2:
  637. call 80029D0C(0) # initializes eeprom? Some kind of eeprom test
  638. 80118300[6:8] = 1
  639. # 8002A8D0
  640. v = @80112970 # E0800004
  641. v = v[0:2] # Aleck switches
  642. 80118300[6:8] = True if v & 0x20 else False # test button
  643. call 80029F90()
  644. call 800290FC(1) # run assigned context function A0 times
  645. 80112A2C[0] = 1
  646. if 80118300[6:8] == 1:
  647. call 8003A358(1)
  648. call 80028DC8(0xA, 8002E664) # link context function A1 in index A0: test mode
  649. while call 80028F24(0xA): # V0 = True if context function A0 linked else False
  650. call 8002651C()
  651. call 800290FC(1) # run assigned context function A0 times
  652. else:
  653. call 8003A358(2)
  654. # 8002A9A4
  655. 80118300[2:4] = 0
  656. call 8002DEA4()
  657. call 8003A358(2)
  658. call 8003A7B8() # call 80039A48(0xC)
  659. call 8002A580()
  660. # 8002A9C8
  661. while True:
  662. call 8003CBE0(8006C8A0, 0) # copy controller A1 button input to A0
  663. call 8002B370() # toggle display of errors
  664. # if @80112954 < 8:
  665. # call @8006A5C0+(@80112954<<2)()
  666. if @80112954 == 0:
  667. # 8002AA2C
  668. if 80118310[0:2] or 801182F0[E:10]:
  669. 80118300+8 = 0
  670. call 80028EA8(0xA) # stop and unlink registered context function A0
  671. call 80028EA8(0xB) # stop and unlink registered context function A0
  672. call 80028EA8(0xC) # stop and unlink registered context function A0
  673. 800ADC30[E] = 0
  674. 80112954 = 1
  675. # 8002AA88
  676. 80066A50[4:6] = 0x14
  677. 8007D8E8 = 5
  678. 8007D8EC = 5
  679. 8007D8F0[0:2] = 7
  680. 8007D8F0[2:4] = 7
  681. call 80031140(0, 0, 0, 0)
  682. elif @80112954 == 1:
  683. # 8002AAE0
  684. ...
  685. elif @80112954 == 2:
  686. # 8002AFCC
  687. 80118300+8 = 0
  688. if not call 80028F24(0xA): # V0 = True if context function A0 linked else False
  689. call 8003A7B8()
  690. 800ADC30[E] = 0
  691. call 80028DC8(0xA, 8002B430) # link context function A1 in index A0: run context functions
  692. 80118318[2:4] = 0
  693. call 8002A450()
  694. 80112954 = 1
  695. elif @80112954 == 3:
  696. # 8002AE78
  697. 80118300+8 = 0
  698. if not call 80028F24(0xA): # V0 = True if context function A0 linked else False
  699. if 801182F0[6:8] & 2:
  700. call 80028EA8(0xA) # stop and unlink registered context function A0
  701. call 80028EA8(0xB) # stop and unlink registered context function A0
  702. call 80028DC8(0xA, 8002D4C0) # link context function A1 in index A0
  703. call 8003A7B8()
  704. 80112954 = 3
  705. elif 801182F0[6:8] & 4:
  706. # 8002AEE0
  707. call 80028EA8(0xA) # stop and unlink registered context function A0
  708. call 80028EA8(0xB) # stop and unlink registered context function A0
  709. call 80028DC8(0xA, 8002D840) # link context function A1 in index A0
  710. call 8003A7B8()
  711. 80112954 = 3
  712. elif 801182F0[6:8] & 8:
  713. # 8002AF30
  714. call 80028EA8(0xA) # stop and unlink registered context function A0
  715. call 80028EA8(0xB) # stop and unlink registered context function A0
  716. call 80028DC8(0xA, 8002DA34) # link context function A1 in index A0
  717. call 8003A7B8()
  718. 80112954 = 3
  719. else:
  720. # 8002AF80
  721. call 80028EA8(0xB) # stop and unlink registered context function A0
  722. 800ADC30[E] = 0
  723. call 80028DC8(0xA, 8002B430) # link context function A1 in index A0: run context functions
  724. call 8003A7B8()
  725. 80112954 = 1
  726. # 8002AFB4
  727. call 8002A450()
  728. call 8002A580()
  729. elif @80112954 == 4:
  730. # 8002B024
  731. 80118300+8 = 0
  732. if 80118300[2:4] > 0 or 80118330[6:8] > 0:
  733. # 8002B054
  734. 8011831C = 1
  735. call 80028EA8(0xA) # stop and unlink registered context function A0
  736. call 80028EA8(0xB) # stop and unlink registered context function A0
  737. 800ADC30[E] = 0
  738. call 8003A7D4()
  739. call 80028DC8(0xA, 8002CCC8) # link context function A1 in index A0
  740. 80112954 = 2
  741. elif not call 80028F24(0xA):
  742. # 8002B09C
  743. 8011831C = 0
  744. call 80028DC8(0xA, 8002B478) # link context function A1 in index A0
  745. elif @8011831C == 1:
  746. # 8002B130
  747. call 80028EA8(0xA) # stop and unlink registered context function A0
  748. call 80028EA8(0xB) # stop and unlink registered context function A0
  749. 800ADC30[E] = 0
  750. call 80028DC8(0xA, 8002CCC8) # link context function A1 in index A0
  751. 80112954 = 2
  752. elif @8011831C == 2:
  753. # 8002B16C
  754. call 80028EA8(0xA) # stop and unlink registered context function A0
  755. call 80028EA8(0xB) # stop and unlink registered context function A0
  756. 800ADC30[E] = 0
  757. call 80039A48(6)
  758. call 80028DC8(0xA, 8002BEB8) # link context function A1 in index A0
  759. 80112954 = 5
  760. elif @8011831C == 3:
  761. # 8002B1B0
  762. call 80028EA8(0xA) # stop and unlink registered context function A0
  763. call 80028EA8(0xB) # stop and unlink registered context function A0
  764. 800ADC30[E] = 0
  765. call 8003A7B8()
  766. call 80028DC8(0xA, 8002C27C) # link context function A1 in index A0
  767. call 80039A48(7)
  768. 80112954 = 6
  769. elif @8011831C == 4:
  770. # 8002B1F4
  771. call 80028EA8(0xA) # stop and unlink registered context function A0
  772. call 80028EA8(0xB) # stop and unlink registered context function A0
  773. 800ADC30[E] = 0
  774. call 8003A7B8()
  775. call 80028DC8(0xA, 8002C648) # link context function A1 in index A0
  776. call 80039A48(0xD)
  777. 80112954 = 7
  778. elif @80112954 == 5:
  779. # 8002B248
  780. 80118300+8 = 0
  781. if not call 80028F24(0xA): # V0 = True if context function A0 linked else False
  782. 80118318[2:4] = 0
  783. call 8003A7B8()
  784. 80112954 = 1
  785. elif @80112954 == 6:
  786. # 8002B280
  787. 80118300+8 = 0
  788. if not call 80028F24(0xA): # V0 = True if context function A0 linked else False
  789. 80118318[2:4] = 0
  790. call 8003A7B8()
  791. 80112954 = 1
  792. elif @80112954 == 7:
  793. # 8002B2B8
  794. 80118300+8 = 0
  795. if not call 80028F24(0xA): # V0 = True if context function A0 linked else False
  796. 80118318[2:4] = 0
  797. call 8003A7B8()
  798. 80112954 = 1
  799. else:
  800. # 8002B2F0
  801. 80118300+8 = 0
  802. call 80053F80(800AED38, 8006A5A8, @80112954) # V0 = p->C-string A1 expanded and Null-terminated to A0: "error mode No=%d\n"
  803. call 80026234(0, 800AED38) # NERFed! display string A1
  804. # 8002B32C: pointless jump to next opcode
  805. call 8005C6F0()
  806. if not 80118300[C:E]: # major error code
  807. pass
  808. call 8002651C()
  809. call 800290FC(1) # run assigned context function A0 times
  810. 8002B370 toggle display of errors
  811. if not @8006641C:
  812. if not 80118300[C:E]: # no major error code detected
  813. return
  814. call 80028EE0(0xA) # set context flag A0 at 800AEF4C
  815. call 80028EE0(0xB) # set context flag A0 at 800AEF4C
  816. call 80028EE0(0xC) # set context flag A0 at 800AEF4C
  817. call 80028DC8(0xF, 80030C28) # link context function A1 in index A0: error display
  818. 8006641C = 1
  819. else:
  820. # 8002B3DC
  821. if 80118300[C:E]: # continue displaying major error code
  822. return
  823. call 80028EA8(0xF) # stop and unlink registered context function A0
  824. 800B1A60 = 0
  825. call 80028F00(0xA) # unset context flag A0 at 800AEF4C
  826. call 80028F00(0xB) # unset context flag A0 at 800AEF4C
  827. call 80028F00(0xC) # unset context flag A0 at 800AEF4C
  828. 8006641C = 0
  829. 8002B430 run context functions
  830. while True:
  831. call 800290FC(1) # run assigned context function A0 times
  832. 8002B478
  833. 8002BEB8
  834. 8002C27C
  835.  
  836. 8002C648
  837.  
  838. 8002CA14
  839. 8002CCC8
  840. SP[10] = 3
  841. SP[11] = 5
  842. SP[18:1F] = 8006A654[0:7] # 00010204060809
  843. SP+24 = 0
  844. SP+28 = 0
  845. SP+30 = 0
  846. SP+28 = 0 # not a typo
  847. v = 80112978[0:2] # DIP switches
  848. if not (v & 0x100) or not 800D2750[3]:
  849. 80118318[0:2] = 0
  850. return
  851. # 8002CD68
  852. ...
  853. # 8002CE18
  854. while True:
  855. ...
  856. # 8002CFA0
  857. SP+34 = @80118360
  858. call 80053F80(800AED38, 8006A65C, @SP+34) # V0 = p->C-string A1 expanded and Null-terminated to A0: " BIG PST = %d\n"
  859. call 80026234(1, 800AED38) # NERFed! display string A1
  860. call 80053F80(800AED38, 8006A66C, 801182F0[A:C]) # V0 = p->C-string A1 expanded and Null-terminated to A0: " SLOT_TYPE = %x\n"
  861. call 80026234(1, 800AED38) # NERFed! display string A1
  862. # 8002D004
  863. ...
  864. # 8002D21C
  865. call 80039A48(5)
  866. call 80053F80(800AED38, 8006A680) # V0 = p->C-string A1 expanded and Null-terminated to A0: " GET SMALL \n"
  867. call 80026234(1, 800AED38) # NERFed! display string A1
  868. # 8002D248
  869. ...
  870. # 8002D2C0
  871. call 80053F80(800AED38, 8006A690, @SP+20) # V0 = p->C-string A1 expanded and Null-terminated to A0: " GET SMALL \n"
  872. call 80026234(1, 800AED38) # NERFed! display string A1
  873. SP+24 = 4
  874. goto 8002D390
  875. # 8002D2F4
  876. ...
  877. # 8002D390
  878. call 80031140(0, 0, 0, 0)
  879. call 80053F80(800AED38, 8006A6A0, @SP+2C) # V0 = p->C-string A1 expanded and Null-terminated to A0: "Service Game Last = %d\n"
  880. call 80026234(1, 800AED38) # NERFed! display string A1
  881. 80064FF4 = 0xFF
  882. 80064FF0 = 0xFF
  883. 80064FEC = 0xFF
  884. SP+30 += 1
  885. call 800290FC(1) # run assigned context function A0 times
  886. 8002D424 display "+ CT START +\n" 60 times
  887. for i in range(0x3D):
  888. call 80053F80(800AED38, 8006A6D0) # V0 = p->C-string A1 expanded and Null-terminated to A0: "+ CT START +\n"
  889. call 80026234(1, 800AED38) # NERFed! display string A1
  890. call 800290FC(1) # run assigned context function A0 times
  891. call 80028EA8(0xB) # stop and unlink registered context function A0
  892. 8002D4C0
  893. SP+10 = 0
  894. SP+14 = 0
  895. SP+18 = 0
  896. SP+1C = 0
  897. call 80028DC8(0xB, 8002DC24) # link context function A1 in index A0: display "++ BIG START ++\n" 60 times
  898. while True:
  899. # if @SP+10 < 8: call @8006A6E0+(@SP+10<<2)()
  900. if @SP+10 == 0:
  901. # 8002D534
  902. if not call 80028F24(0xB): # V0 = True if context function A0 linked else False
  903. 8006C8A8 = 0
  904. call 80028DC8(0xB, 8002DCC0) # link context function A1 in index A0: display "BIG PLAY!! \n"
  905. SP+1C = 0
  906. SP+18 = 1
  907. if 801182F0[E:10] == 3:
  908. call 8003A7B8()
  909. elif @SP+10 == 1:
  910. # 8002D58C
  911. v = 801182F0[C:E]
  912. if v & 2:
  913. SP+10 =2
  914. elif @SP+10 == 2:
  915. # 8002D5B4
  916. v = 801182F0[C:E]
  917. if v & 2:
  918. # 8002D608
  919. if 801182F0[E:10] == 3:
  920. call 8003A7B8()
  921. else:
  922. # 8002D5CC
  923. 801182F0[4:6] &= 2 # untoggle service button pressed flag
  924. 801182F0[6:8] &= 2
  925. SP+10 += 1
  926. elif @SP+10 == 3:
  927. # 8002D62C
  928. if 801182F0[4:6] & 0x20:
  929. 801182F0[4:6] &= 0x20
  930. 801182F0[6:8] &= 0x20
  931. call 80028EA8(0xB) # stop and unlink registered context function A0
  932. SP+14 = 0
  933. call 80028DC8(0xB, 8002D424) # link context function A1 in index A0: display "+ CT START +\n" 60 times
  934. SP+10 += 1
  935. else:
  936. # 8002D69C
  937. call 80028EA8(0xB) # stop and unlink registered context function A0
  938. call 80028DC8(0xB, 8002DD3C) # link context function A1 in index A0: run context function 0x1F times
  939. SP+14 = 2
  940. SP+10 = 7
  941. elif @SP+10 == 4:
  942. # 8002D6CC
  943. if call 80028F24(0xB): # V0 = True if context function A0 linked else False
  944. # 8002D714
  945. if 801182F0[E:10] == 3:
  946. call 8003A7B8()
  947. else:
  948. # 8002D6DC
  949. SP+14 = 1
  950. 8006C8A8 = 2
  951. call 80028DC8(0xB, 8002DCC0) # link context function A1 in index A0: display "BIG PLAY!! \n"
  952. SP+10 += 1
  953. elif @SP+10 == 5:
  954. # 8002D738
  955. if 801182F0[C:E] & 0x20:
  956. call 8003A7B8()
  957. SP+1C = 0
  958. SP+10 += 1
  959. elif @SP+10 == 6:
  960. # 8002D774
  961. if not 801182F0[C:E] & 0x20:
  962. call 80028EA8(0xB) # stop and unlink registered context function A0
  963. call 80028DC8(0xB, 8002DD3C) # link context function A1 in index A0: run context function 0x1F times
  964. SP+14 = 2
  965. SP+10 += 1
  966. # 8002D7BC
  967. if 801182F0[E:10] == 3:
  968. call 8003A7B8()
  969. elif @SP+10 == 7:
  970. # 8002D7E0
  971. if not call 80028F24(0xB): # V0 = True if context function A0 linked else False
  972. 80118318[2:4] = 0
  973. return
  974. # 8002D80C
  975. SP+18 += 1
  976. call 800290FC(1) # run assigned context function A0 times
  977. 8002D840
  978. SP+10 = 0
  979. SP+14 = 0
  980. SP+18 = 0
  981. call 80028DC8(0xB, 8002DC24) # link context function A1 in index A0: display "++ BIG START ++\n" 60 times
  982. # 8002D87C
  983. while True:
  984. if @SP+10 == 0:
  985. # 8002D8C8
  986. if not call 80028F24(0xB): # V0 = True if context function A0 linked else False
  987. 8006C8A8 = 1
  988. call 80028DC8(0xB, 8002DCC0) # link context function A1 in index A0: display "BIG PLAY!! \n"
  989. SP+10 += 1
  990. # 8002D904
  991. if 801182F0[E:10] == 3:
  992. call 8003A7B8()
  993. elif @SP+10 == 1:
  994. # 8002D928
  995. if 801182F0[C:E] & 4:
  996. SP+10 = 2
  997. elif @SP+10 == 2:
  998. # 8002D950
  999. if 801182F0[C:E] & 4:
  1000. # 8002D9B4
  1001. if 801182F0[E:10] == 3:
  1002. call 8003A7B8()
  1003. else:
  1004. # 8002D968
  1005. 801182F0[4:6] &= 4
  1006. 801182F0[6:8] &= 4
  1007. call 80028DC8(0xB, 8002DD3C) # link context function A1 in index A0: run context function 0x1F times
  1008. SP+10 += 1
  1009. elif @SP+10 == 3:
  1010. # 8002D9D8
  1011. if not call 80028F24(0xB): # V0 = True if context function A0 linked else False
  1012. call 8003A7B8()
  1013. return
  1014. # 8002DA00
  1015. SP+14 += 1
  1016. call 800290FC(1) # run assigned context function A0 times
  1017. 8002DA34
  1018. SP+10 = 0
  1019. SP+14 = 0
  1020. call 80028DC8(0xB, 8002DC24) # link context function A1 in index A0: display "++ BIG START ++\n" 60 times
  1021. # 8002DA6C
  1022. while True:
  1023. if @SP+10 == 0:
  1024. # 8002DAB8
  1025. if not call 80028F24(0xB): # V0 = True if context function A0 linked else False
  1026. 8006C8A8 = 1
  1027. call 80028DC8(0xB, 8002DCC0) # link context function A1 in index A0: display "BIG PLAY!! \n"
  1028. SP+10 += 1
  1029. # 8002DAF4
  1030. if 801182F0[E:10] == 3:
  1031. call 8003A7B8()
  1032. elif @SP+10 == 1:
  1033. # 8002DB18
  1034. if 801182F0[C:E] & 8:
  1035. SP+10 = 2
  1036. elif @SP+10 == 2:
  1037. # 8002DB40
  1038. if 801182F0[C:E] & 8:
  1039. if 801182F0[E:10] == 3:
  1040. call 8003A7B8()
  1041. else:
  1042. 801182F0[4:6] & 8
  1043. 801182F0[6:8] & 8
  1044. call 80028DC8(0xB, 8002DD3C) # link context function A1 in index A0: run context function 0x1F times
  1045. SP+10 += 1
  1046. elif @SP+10 == 3:
  1047. # 8002DBC8
  1048. if not call 80028F24(0xB): # V0 = True if context function A0 linked else False
  1049. call 8003A7B8()
  1050. return
  1051. # 8002DBF0
  1052. SP+14 += 1
  1053. call 800290FC(1) # run assigned context function A0 times
  1054. 8002DC24 display "++ BIG START ++\n" 60 times
  1055. for i in range(0x3D):
  1056. call 80053F80(800AED38, 8006A700) # V0 = p->C-string A1 expanded and Null-terminated to A0: "++ BIG START ++\n"
  1057. call 80026234(1, 800AED38) # NERFed! display string A1
  1058. call 800290FC(1) # run assigned context function A0 times
  1059. call 80028EA8(0xB) # stop and unlink registered context function A0
  1060. 8002DCC0 display "BIG PLAY!! \n"
  1061. i = 0
  1062. while True:
  1063. i += 1
  1064. call 80053F80(800AED38, 8006A714) # V0 = p->C-string A1 expanded and Null-terminated to A0: "BIG PLAY!! \n"
  1065. call 80026234(1, 800AED38) # NERFed! display string A1
  1066. call 800290FC(1) # run assigned context function A0 times
  1067. 8002DD3C run context function 0x1F times
  1068. for i in range(0x1F):
  1069. call 800290FC(1) # run assigned context function A0 times
  1070. 8002DDAC V0 = p->string A0 for DIP switch index A1
  1071. accepts: A0=p->target, A1=index
  1072. if A1+1 < 0xA:
  1073. return call 80053F80(A0, 8006A724, A1+1) # V0 = p->C-string A1 expanded and Null-terminated to A0: "S-0%d"
  1074. else:
  1075. return call 80053F80(A0, 8006A72C, A1+1) # V0 = p->C-string A1 expanded and Null-terminated to A0: "S-%d"
  1076. 8002DE38 V0 = p->string A0 "On" if A1 else "Off"
  1077. accepts: A0=p->target, A1=state
  1078. if A1:
  1079. return call 80053F80(A0, 8006A734) # V0 = p->C-string A1 expanded and Null-terminated to A0: "On"
  1080. else:
  1081. return call 80053F80(A0, 8006A738) # V0 = p->C-string A1 expanded and Null-terminated to A0: "Off"
  1082. 8002DEA4
  1083. ...
  1084. # 8002E0D0
  1085. i = 0
  1086. while not 801182F0[A:C]:
  1087. call 800290FC(1) # run assigned context function A0 times
  1088. i += 1
  1089. 8007D8E8 = 3
  1090. call 80053F80(8007D900, 8006A73C) # V0 = p->C-string A1 expanded and Null-terminated to A0: "----"
  1091. 8007D8EC = 3
  1092. call 80053F80(8007D905, 8006A73C) # V0 = p->C-string A1 expanded and Null-terminated to A0: "----"
  1093. # 8002E140: this looks like a programming error. When the counter runs out nothing happens.
  1094. if i >= 0x12D:
  1095. pass
  1096. # 8002E158
  1097. # 8002E15C
  1098. while 800ADE10[6:8] > 0:
  1099. 8007D8E8 = 3
  1100. call 80053F80(8007D900, 8006A744) # V0 = p->C-string A1 expanded and Null-terminated to A0: "=--="
  1101. 8007D8EC = 3
  1102. call 80053F80(8007D905, 8006A744) # V0 = p->C-string A1 expanded and Null-terminated to A0: "=--="
  1103. call 800290FC(1) # run assigned context function A0 times
  1104. # 8002E1C4
  1105. # 8002E1C8
  1106. for i in range(0x78):
  1107. 8007D8E8 = 3
  1108. call 80053F80(8007D900, 8006A74C) # V0 = p->C-string A1 expanded and Null-terminated to A0: "===="
  1109. 8007D8EC = 3
  1110. call 80053F80(8007D905, 8006A74C) # V0 = p->C-string A1 expanded and Null-terminated to A0: "===="
  1111. call 800290FC(1) # run assigned context function A0 times
  1112. # 8002E240
  1113. ...
  1114. 8002E664 test mode [nonterminating?]
  1115. ...
  1116. # 8002EA64
  1117. while True:
  1118. v = 80112978[4:6] # Aleck switches
  1119. if (v & 1) and not ((v & 1) & 80112980[4:6]):
  1120. # 8002EAB0: pressed P1 Start
  1121. SP+18 += 1
  1122. v = 80112978[0:2] # DIP switches
  1123. if v & 0x100:
  1124. if @SP+18 >= 0x10:
  1125. SP+18 = 0
  1126. else:
  1127. if @SP+18 >= 0xF:
  1128. SP+18 = 0
  1129. # 8002EB08
  1130. SP+1C = 0
  1131. if (v & 2) and not ((v & 2) & 80112980[4:6]):
  1132. # 8002EB48: pressed P2 Start
  1133. SP+1C = 1
  1134. # 8002EB50
  1135. call 800312C8()
  1136. # if @SP+18 >= 0x10: return
  1137. # call @8006A7F0[@SP+18 << 2]()
  1138. if @SP+18 == 0:
  1139. # 8002EB8C
  1140. ...
  1141. # 8002ECEC
  1142. call 80026234(1, 8007D900) # NERFed! display string A1
  1143. call 80053F80(800AED38, 8006A754, 8007D8F0[2:4]) # V0 = p->C-string A1 expanded and Null-terminated to A0: " %4d\n"
  1144. call 80026234(1, 800AED38) # NERFed! display string A1
  1145. elif @SP+18 == 1:
  1146. # 8002ED34
  1147. ...
  1148. elif @SP+18 == 2:
  1149. # 8002EFB4
  1150. ...
  1151. elif @SP+18 == 3:
  1152. # 8002F118
  1153. ...
  1154. elif @SP+18 == 4:
  1155. # 8002F270
  1156. ...
  1157. elif @SP+18 == 5:
  1158. # 8002F3C8
  1159. ...
  1160. elif @SP+18 == 6:
  1161. # 8002F520
  1162. ...
  1163. elif @SP+18 == 7:
  1164. # 8002F678
  1165. ...
  1166. elif @SP+18 == 8:
  1167. # 8002F7D0
  1168. ...
  1169. elif @SP+18 == 9:
  1170. # 8002F934
  1171. ...
  1172. elif @SP+18 == 0xA:
  1173. # 8002FA8C
  1174. ...
  1175. elif @SP+18 == 0xB:
  1176. # 8002FBE4
  1177. ...
  1178. elif @SP+18 == 0xC:
  1179. # 8002FD48
  1180. ...
  1181. elif @SP+18 == 0xD:
  1182. # 8002FEA0
  1183. ...
  1184. elif @SP+18 == 0xE:
  1185. # 8002FFF8
  1186. ...
  1187. elif @SP+18 == 0xF:
  1188. # 80030150
  1189. ...
  1190. else:
  1191. # 8003029C
  1192. SP+18 = 0
  1193. # 800302A4
  1194. call 80053F80(800AED38, 8006A76C) # V0 = p->C-string A1 expanded and Null-terminated to A0: " ----- Test Mode -----\n"
  1195. call 80026234(0, 800AED38) # NERFed! display string A1
  1196. v = @SP+18 << 3
  1197. SP+10 = @v+18
  1198. SP+14 = @v+1C
  1199. call 80053F80(800AED38, 8006A784, @SP+18) # V0 = p->C-string A1 expanded and Null-terminated to A0: "Mode Select No=%2d , Mode Count=%llu\n"
  1200. call 80026234(0, 800AED38) # NERFed! display string A1
  1201. if call 8003DD30() <= 0: # V0 = eeprom type or -1
  1202. call 80053F80(800AED38, 8006A7AC) # V0 = p->C-string A1 expanded and Null-terminated to A0: " == EEPROM ERROR == \n"
  1203. call 80026234(0, 800AED38) # NERFed! display string A1
  1204. elif call 8003DD30() == 1: # V0 = eeprom type or -1
  1205. call 80053F80(800AED38, 8006A7C4) # V0 = p->C-string A1 expanded and Null-terminated to A0: " EEPROM = 4K Bit \n"
  1206. call 80026234(0, 800AED38) # NERFed! display string A1
  1207. elif call 8003DD30() == 2: # V0 = eeprom type or -1
  1208. call 80053F80(800AED38, 8006A7D8) # V0 = p->C-string A1 expanded and Null-terminated to A0: " EEPROM = 16K Bit \n"
  1209. call 80026234(0, 800AED38) # NERFed! display string A1
  1210. # 800303CC
  1211. call 80031094(2) # NERFed!; SP+8 = A0
  1212. v = 80112978[4:6] # Aleck switches
  1213. if v & 0x20 and not (v & 0x20 & 80112980[4:6]): # test button pressed
  1214. 800D2750[0] = SP[27]
  1215. 800D2750[1] = SP[2F]
  1216. 800D2750[2] = SP[27]
  1217. 800D2758 = 0
  1218. 800D275C = 0
  1219. if @SP+38 or @SP+3C:
  1220. 800D2758 |= 0
  1221. 800D275C |= 1
  1222. # 8003049C
  1223. if @SP+40 or @SP+44:
  1224. 800D2758 |= 0
  1225. 800D275C |= 2
  1226. # 800304EC
  1227. if @SP+48 or @SP+4C:
  1228. 800D2758 |= 0
  1229. 800D275C |= 4
  1230. # 8003053C
  1231. if @SP+50 or @SP+54:
  1232. 800D2758 |= 0
  1233. 800D275C |= 8
  1234. # 8003058C
  1235. if @SP+58 or @SP+5C:
  1236. 800D2758 |= 0
  1237. 800D275C |= 0x10
  1238. # 800305DC
  1239. 800D2760[0] = SP[67]
  1240. if @SP+68 or @SP+6C:
  1241. 800D2758 |= 0
  1242. 800D275C |= 0x20
  1243. # 80030638
  1244. if @SP+70 or @SP+74:
  1245. 800D2758 |= 0
  1246. 800D275C |= 0x40
  1247. # 80030688
  1248. 800D2760[1] = SP[7F]
  1249. if @SP+80 or @SP+84:
  1250. 800D2758 |= 0
  1251. 800D275C |= 0x80
  1252. # 800306E4
  1253. if @SP+88 or @SP+8C:
  1254. 800D2758 |= 0
  1255. 800D275C |= 0x100
  1256. # 80030734
  1257. if @SP+90 or @SP+94:
  1258. 800D2758 |= 0
  1259. 800D275C |= 0x200
  1260. # 80030784
  1261. 800D2750[3] = SP[9F]
  1262. if not (800D2758 & 0) and not (800D275C & 1) ...
  1263. and not (800D2758 & 0) and not (800D275C & 2) ...
  1264. and not (800D2758 & 0) and not (800D275C & 4) ...
  1265. and not (800D2758 & 0) and not (800D275C & 0x100):
  1266. 800D2758 |= 0
  1267. 800D275C |= 1
  1268. # 80030870
  1269. 80118300[6:8] = 0
  1270. call 80029EF4()
  1271. # 80030884
  1272. call 80031140(0, 0, 0, 0)
  1273. call 800290FC(1) # run assigned context function A0 times
  1274. 800308BC button switch test [nonterminating]
  1275. i, j = 0, 0
  1276. 8007D8E8 = 9
  1277. 8007D8EC = 9
  1278. 8007D900[0] = 0
  1279. 8007D900[5] = 0
  1280. while True:
  1281. # 8003090C
  1282. if i == 0:
  1283. if 8007D900[0] == 2:
  1284. pass
  1285. i = 1
  1286. call 800290FC(1) # run assigned context function A0 times
  1287. continue
  1288. if i != 1:
  1289. pass
  1290. call 80053F80(800AED38, 8006A830) # V0 = p->C-string A1 expanded and Null-terminated to A0: "BUTTON SWITCH TEST "
  1291. call 80026234(j, 800AED38) # NERFed! display string A1
  1292. 8007D8E8 = 3
  1293. call 80053F80(8007D900, 8006A844) # V0 = p->C-string A1 expanded and Null-terminated to A0: " SCH"
  1294. 8007D8EC = 3
  1295. call 80053F80(8007D905, 8006A634) # V0 = p->C-string A1 expanded and Null-terminated to A0: " "
  1296. # 800309B4
  1297. v = 80112978[4:6] # Aleck switches
  1298. if v & 0x10: # service button
  1299. call 80053F80(800AED38, 8006A84C) # V0 = p->C-string A1 expanded and Null-terminated to A0: "ON = SERVICE SWITCH "
  1300. call 80026234(j, 800AED38) # NERFed! display string A1
  1301. 8007D8EC = 3
  1302. call 80053F80(8007D905, 8006A864) # V0 = p->C-string A1 expanded and Null-terminated to A0: " C-1"
  1303. elif v & 2: # P2 start
  1304. # 80030A20
  1305. call 80053F80(800AED38, 8006A86C) # V0 = p->C-string A1 expanded and Null-terminated to A0: "ON = CREDIT TRANCE "
  1306. call 80026234(j, 800AED38) # NERFed! display string A1
  1307. 8007D8EC = 3
  1308. call 80053F80(8007D905, 8006A880) # V0 = p->C-string A1 expanded and Null-terminated to A0: " C-2"
  1309. elif v & 1: # P1 start
  1310. # 80030A80
  1311. call 80053F80(800AED38, 8006A888) # V0 = p->C-string A1 expanded and Null-terminated to A0: "ON = CREDIT CREAR "
  1312. call 80026234(j, 800AED38) # NERFed! display string A1
  1313. 8007D8EC = 3
  1314. call 80053F80(8007D905, 8006A89C) # V0 = p->C-string A1 expanded and Null-terminated to A0: " C-3"
  1315. elif v & 4: # coin slot 1
  1316. # 80030AE0
  1317. call 80053F80(800AED38, 8006A8A4) # V0 = p->C-string A1 expanded and Null-terminated to A0: "ON = COIN IN "
  1318. call 80026234(j, 800AED38) # NERFed! display string A1
  1319. 8007D8EC = 3
  1320. call 80053F80(8007D905, 8006A8B4) # V0 = p->C-string A1 expanded and Null-terminated to A0: " C-4"
  1321. elif v & 0x20: # test button
  1322. # 80030B40
  1323. call 80053F80(800AED38, 8006A8BC) # V0 = p->C-string A1 expanded and Null-terminated to A0: "ON = TEST SWITCH "
  1324. call 80026234(j, 800AED38) # NERFed! display string A1
  1325. 8007D8EC = 3
  1326. call 80053F80(8007D905, 8006A8D0) # V0 = p->C-string A1 expanded and Null-terminated to A0: " C-5"
  1327. # 80030B98
  1328. 800ADC3C[0:2] = 0
  1329. 800B2680[0:2] = 0
  1330. if v & 2:
  1331. 800B2680[0:2] = 1
  1332. if v & 1:
  1333. 800ADC3C[0:2] = 1
  1334. call 80031140(1, 0x14, 0, 0)
  1335. # 80030C04
  1336. call 800290FC(1) # run assigned context function A0 times
  1337. 80030C28 error display [nonterminating?]
  1338. i = 0
  1339. 800B1A60 = 1
  1340. # 80030C58
  1341. while True:
  1342. call 80053F80(800AED38, 8006A8D8) # V0 = p->C-string A1 expanded and Null-terminated to A0: "ERROR "
  1343. call 80026234(i, 800AED38) # NERFed! display string A1
  1344. 801129A0 = 3
  1345. call 80053F80(801129B8, 8006A8E0) # V0 = p->C-string A1 expanded and Null-terminated to A0: " Err"
  1346. 801129A4 = 3
  1347. call 80053F80(801129BD, 8006A634) # V0 = p->C-string A1 expanded and Null-terminated to A0: " "
  1348. v = 80118300[C:E] # major error code
  1349. if v & 1:
  1350. # 80030CD8
  1351. call 80053F80(800AED38, 8006A8E8) # V0 = p->C-string A1 expanded and Null-terminated to A0: "Aleck Error = CE ERROR "
  1352. call 80026234(i, 800AED38) # NERFed! display string A1
  1353. 801129A4 = 3
  1354. call 80053F80(801129BD, 8006A900) # V0 = p->C-string A1 expanded and Null-terminated to A0: " CE"
  1355. elif v & 2:
  1356. # 80030D24
  1357. call 80053F80(800AED38, 8006A908) # V0 = p->C-string A1 expanded and Null-terminated to A0: "Aleck Error = CJ ERROR "
  1358. call 80026234(i, 800AED38) # NERFed! display string A1
  1359. 801129A4 = 3
  1360. call 80053F80(801129BD, 8006A920) # V0 = p->C-string A1 expanded and Null-terminated to A0: " CJ"
  1361. elif v & 4:
  1362. # 80030D8C
  1363. call 80053F80(800AED38, 8006A928) # V0 = p->C-string A1 expanded and Null-terminated to A0: "Aleck Error = CO ERROR "
  1364. call 80026234(i, 800AED38) # NERFed! display string A1
  1365. 801129A4 = 3
  1366. call 80053F80(801129BD, 8006A940) # V0 = p->C-string A1 expanded and Null-terminated to A0: " CO"
  1367. elif v & 8:
  1368. # 80030DF4
  1369. call 80053F80(800AED38, 8006A948) # V0 = p->C-string A1 expanded and Null-terminated to A0: "Aleck Error = CR ERROR "
  1370. call 80026234(i, 800AED38) # NERFed! display string A1
  1371. 801129A4 = 3
  1372. call 80053F80(801129BD, 8006A960) # V0 = p->C-string A1 expanded and Null-terminated to A0: " Cr"
  1373. elif v & 0x10:
  1374. # 80030E5C
  1375. call 80053F80(800AED38, 8006A968) # V0 = p->C-string A1 expanded and Null-terminated to A0: "Aleck Error = HE ERROR "
  1376. call 80026234(i, 800AED38) # NERFed! display string A1
  1377. 801129A4 = 3
  1378. call 80053F80(801129BD, 8006A980) # V0 = p->C-string A1 expanded and Null-terminated to A0: " HE"
  1379. elif v & 0x20:
  1380. # 80030EC4
  1381. call 80053F80(800AED38, 8006A988) # V0 = p->C-string A1 expanded and Null-terminated to A0: "Aleck Error = HJ ERROR "
  1382. call 80026234(i, 800AED38) # NERFed! display string A1
  1383. 801129A4 = 3
  1384. call 80053F80(801129BD, 8006A9A0) # V0 = p->C-string A1 expanded and Null-terminated to A0: " HJ"
  1385. elif v & 0x40:
  1386. # 80030F2C
  1387. call 80053F80(800AED38, 8006A9A8) # V0 = p->C-string A1 expanded and Null-terminated to A0: "Aleck Error = EE ERROR "
  1388. call 80026234(i, 800AED38) # NERFed! display string A1
  1389. 801129A4 = 3
  1390. call 80053F80(801129BD, 8006A9C0) # V0 = p->C-string A1 expanded and Null-terminated to A0: " EE"
  1391. elif v & 0x80:
  1392. # 80030F94
  1393. if 80118300[E:10] & 1:
  1394. call 80053F80(800AED38, 8006A9C8) # V0 = p->C-string A1 expanded and Null-terminated to A0: "Aleck Error = 6E_COIN ERROR "
  1395. call 80026234(i, 800AED38) # NERFed! display string A1
  1396. 801129A4 = 3
  1397. call 80053F80(801129BD, 8006A9E8) # V0 = p->C-string A1 expanded and Null-terminated to A0: " 6E"
  1398. if 80118300[E:10] & 2:
  1399. call 80053F80(800AED38, 8006A9F0) # V0 = p->C-string A1 expanded and Null-terminated to A0: "Aleck Error = 6E_FULL ERROR "
  1400. call 80026234(i, 800AED38) # NERFed! display string A1
  1401. 801129A4 = 3
  1402. call 80053F80(801129BD, 8006A9E8) # V0 = p->C-string A1 expanded and Null-terminated to A0: " 6E"
  1403. # 80031070
  1404. call 800290FC(1) # run assigned context function A0 times
  1405. 80031094 NERFed!; SP+8 = A0
  1406. 800310B4 NERFed!; SP+8 = A0; unlinked
  1407. 800310D4 NERFed!; SP+8 = A0; unlinked
  1408. 800310F4 NERFed!; SP+8 = A0; unlinked
  1409. 80031114 NERFed!; SP+8 = A0; unlinked
  1410. 80031140
  1411. 800312C8
  1412. 80031374
  1413. 80031440
  1414. 8003152C redirect to 8003C900: load A2 bytes from hardware A0 to rdram A1
  1415. accepts: A0, A1, A2
  1416. call 8003C900(A0, A1, A2) # load A2 bytes from hardware A0 to rdram A1
  1417. 8003156C
  1418.  
  1419. 800341E0 create memory manager for A1 bytes at A0
  1420. accepts: A0=p->target, A1=size
  1421. A0+10 = A0
  1422. A0+0 = A0
  1423. A0+4 = 0
  1424. call 80034248(A0, A0+20, A1 - 0x20)
  1425. 80034248 initialize memory manager entries for data A1 using table A0
  1426. accepts: A0=p->table, A1=p->data, A2=length of data
  1427. A1+0 = ~A1
  1428. A1+4 = A2 >> 4
  1429. call 800343EC(A0, A1+10) # initialize memory manager entries for data A1 using table A0
  1430. 800342B4 also allocate entry of size A1 in memory manager A0?
  1431. accepts: A0=p->table, A1=size
  1432. 800343EC initialize memory manager entries for data A1 using table A0
  1433. accepts: A0=p->table, A1=p->data
  1434. 800345DC allocate entry of size A1 in memory manager A0
  1435. accepts: A0=p->table, A1=size
  1436. 8003473C
  1437. 800347D4
  1438. 80034880 V0 = p->loaded and decompressed file from hardware A0 using method A2, opt. writing size to A1
  1439. accepts: A0=hardware offset, A1=p->length or None, A2=allocation method (0, 1)
  1440. SP+130 = SP+30
  1441. call 8003152C(A0, SP+30, 0x100) # redirect to 8003C900: load A2 bytes from hardware A0 to rdram A1
  1442. A0 += 0x100
  1443. SP+1C = SP[30]
  1444. SP+1C |= SP[31] << 8
  1445. SP+1C |= SP[32] << 16
  1446. SP+1C |= SP[33] << 24
  1447. if A2:
  1448. # 80034944
  1449. SP+14 = call 800342B4(8007DB30, @SP+1C)
  1450. else:
  1451. # 8003495C
  1452. SP+14 = call 800345DC(8007DB30, @SP+1C) # allocate entry of size A1 in memory manager A0
  1453. # 80034970
  1454. if not @SP+14:
  1455. return 0
  1456. SP+10 = @SP+14
  1457. SP+28 = 0
  1458. SP+2C = 0
  1459. i, j = 0, 4
  1460. # 8003499C
  1461. while i < @SP+1C:
  1462. if not @SP+2C:
  1463. j += 1
  1464. SP+28 = SP[30+(j&0xFF)]
  1465. if not j & 0xFF:
  1466. call 8003152C(A0, SP+30, 0x100) # redirect to 8003C900: load A2 bytes from hardware A0 to rdram A1
  1467. A0 += 0x100
  1468. SP+2C = 8
  1469. # 80034A10
  1470. SP+2C -= 1
  1471. SP+28 <<= 1
  1472. if not @SP+28 & 0x100:
  1473. # 80034A3C
  1474. j += 1
  1475. SP+134 = SP[30+(j&0xFF)]
  1476. if not j & 0xFF:
  1477. call 8003152C(A0, SP+30, 0x100) # redirect to 8003C900: load A2 bytes from hardware A0 to rdram A1
  1478. A0 += 0x100
  1479. j += 1
  1480. SP+135 = SP[30+(j&0xFF)]
  1481. if not j & 0xFF:
  1482. call 8003152C(A0, SP+30, 0x100) # redirect to 8003C900: load A2 bytes from hardware A0 to rdram A1
  1483. A0 += 0x100
  1484. SP+20 = (SP[134] >> 4) + 3
  1485. SP+24 = (SP[134] & 0xF) << 8
  1486. SP+24 |= SP[135]
  1487. SP+24 += 1
  1488. v = @SP+10
  1489. for k in range(@SP+20):
  1490. v[i] = v[i - @SP+24]
  1491. i += 1
  1492. else:
  1493. # 80034B64
  1494. v = @SP+10
  1495. v[i] = SP[30+(j&0xFF)]
  1496. i += 1
  1497. j += 1
  1498. if not j & 0xFF:
  1499. call 8003152C(A0, SP+30, 0x100) # redirect to 8003C900: load A2 bytes from hardware A0 to rdram A1
  1500. A0 += 0x100
  1501. # 80034BC0
  1502. if A1:
  1503. A1+0 = @SP+1C
  1504. return @SP+14
  1505. 80034BFC
  1506. 80034F08 V0 = p->loaded and decompressed file from hardware A0 using method 0, opt. writing size to A1
  1507. accepts: A0=hardware offset, A1=p->target or None
  1508. return call 80034880(A0, A1, 0) # V0 = p->loaded and decompressed file from hardware A0 using method A2, opt. writing size to A1
  1509. 80034F50 V0 = p->loaded and decompressed file from hardware A0 using method 1, opt. writing size to A1
  1510. accepts: A0=hardware offset, A1=p->target or None
  1511. return call 80034880(A0, A1, 1) # V0 = p->loaded and decompressed file from hardware A0 using method A2, opt. writing size to A1
  1512. 80034FA0
  1513. 8003501C
  1514.  
  1515. 80035474
  1516. 800354E8
  1517. 800355AC
  1518. 800356D0 V0 = A0 + 1
  1519. 80035700 V0 = 16bit random number
  1520. v = @8006C9F8 * 2100005341
  1521. v += 1
  1522. 8006C9F8 = v
  1523. return (v >> 0x10) & 0xFFFF
  1524. 80035758
  1525.  
  1526. 800359DC write ASCII string A1 converted to character mappings to A0 using mode A2
  1527. accepts: A0=p->target, A1=p->string, A2=mode
  1528. for i in range(4):
  1529. v = A1[0]
  1530. A1 += 1
  1531. if not i:
  1532. A1 -= 1
  1533. v = 80066994[v] if v < 0x80 else 0
  1534. if A2:
  1535. if A2[0]:
  1536. v |= 0x80
  1537. A2 += 1
  1538. A0[0] = v & 0xFF
  1539. A0 += 1
  1540. 80035ADC
  1541. ...
  1542. # 80035EB8
  1543. v = @SP+3C
  1544. SP+2C = @v+8 * 0x66666667
  1545. v = (@SP+2C >> 5) - (@v+8 >> 31)
  1546. v &= 3
  1547. call 800359DC(@SP+38, @800667BC+(v<<2), 0) # write ASCII string A1 converted to character mappings to A0 using mode A2: ("Slot", "In", "Coin", "PLAY")[v]
  1548. else:
  1549. # 80035F10
  1550. call 800359DC(@SP+38, 8006AA48, 0) # write ASCII string A1 converted to character mappings to A0 using mode A2: " "
  1551. # 80035F30
  1552. ...
  1553. # 800360C4
  1554. ...
  1555. 8003659C
  1556.  
  1557. 800374F0
  1558. call 8005C620(8006C8C0, 0, 0x2C) # V0=p->A2 bytes at A0 filled with value A1
  1559. call 8005C620(8006C8F0, 0, 0x2C) # V0=p->A2 bytes at A0 filled with value A1
  1560. call 8005C620(8006C99C, 0, 8) # V0=p->A2 bytes at A0 filled with value A1
  1561. call 8005C620(8006C928, 0, 0x38) # V0=p->A2 bytes at A0 filled with value A1
  1562. call 8005C620(8006C9A8, 0, 0x50) # V0=p->A2 bytes at A0 filled with value A1
  1563. call 8005C620(8006CA08, 0, 0xC) # V0=p->A2 bytes at A0 filled with value A1
  1564. 8006C944[2:4] = 1
  1565. u, l = call 80054E80() # V0, V1 = Count plus timer base (@800AEE70, @800AEE78)
  1566. 8006C9F8 = l # set seed
  1567. for i in range(2):
  1568. for j in range(0xA):
  1569. SP[20+j] = j
  1570. # 800375F0
  1571. for j in range(1, 4):
  1572. k = call 80035700() # V0 = 16bit random number
  1573. k *= 0xA - j
  1574. k >>= 0x10
  1575. v = i * 0x1C
  1576. 8006C93C[v + j] = SP[20 + k]
  1577. SP[20 + k] = SP[29 - j]
  1578. # 800376C0
  1579. call 80053F54(8006C960, 8006C928, 0x38) # copy A2 bytes from A1 to A0
  1580. 800667A0 = 0
  1581. 800376F4
  1582. if @800667A0:
  1583. call 800374F0()
  1584. 8006C8F4 = 0
  1585. 8006C8F0 = 0
  1586. 8006C8C4 = 0
  1587. 8006C8C0 = 0
  1588. call 800377C8()
  1589. 80037754
  1590. accepts: A0=flags
  1591. 80112994[2:4] &= ~(A0 & 0xFFFF)
  1592. 80037790
  1593. accepts: A0=flags
  1594. 80112994[2:4] |= A0
  1595. 800377C8
  1596. if @800667A0:
  1597. call 800374F0()
  1598. if @800B1A60:
  1599. 8006C998 = 8006C960
  1600. 8006C91C = 8006C8F0
  1601. 8006C920 = 801129A0
  1602. else:
  1603. 8006C998 = 8006C928
  1604. 8006C91C = 8006C8C0
  1605. 8006C920 = 8007D8E8
  1606. call 80036ADC()
  1607. call 80036CE8()
  1608. call 80037790(3)
  1609. if @800667B4:
  1610. call 80037754(1)
  1611. for i in range(0x50):
  1612. if 8006C9A8[i]:
  1613. call 80037754(4)
  1614. else:
  1615. call 80037790(4)
  1616. call 80037790(8)
  1617. call 8003748C()
  1618. call 800373F4()
  1619. call 80037754(8)
  1620. call 8003748C()
  1621. call 800373F4()
  1622. # 8003792C
  1623. call 80037790(0xC)
  1624. call 8003748C()
  1625. call 800373F4()
  1626. call 80037754(2)
  1627. call 8003748C()
  1628. call 800373F4()
  1629. call 80037790(2)
  1630. call 8003748C()
  1631. 800667B4 = 0
  1632. return 0
  1633. 80037990
  1634. accepts: A0=p->Aleck hardware handles
  1635. 8011831C+0 = 0
  1636. 8011831C+4 = 0
  1637. 8011831C+8 = 0
  1638. 8011831C+C = 0
  1639. 8011831C+10 = 0
  1640. 8011831C[14:18] = (0x20, 0x20, 0x20, 0x20)
  1641. 8011831C[1A:1C] = 0
  1642. 8011831C[1C:1E] = 0
  1643. 8011831C+20 = 0
  1644. 8011831C+24 = 0
  1645. 8011831C+28 = 0
  1646. 8011831C+2C = 0
  1647. 8011831C+30 = 0
  1648. 8011831C+34 = 0
  1649. 8011831C+38 = 0
  1650. 8011831C+3C = 1.0
  1651. 8011831C[40:42] = 0
  1652. 8011831C+44 = -1
  1653. 8011831C+48 = -1
  1654. 8011831C+4C = -1
  1655. 8011831C[50:52] = 0
  1656. 8011831C+54 = 0
  1657. 8011831C+58 = 0
  1658. 8011831C[5E:60] = 0
  1659. 8011831C+64 = 0
  1660. 8011831C+68 = 0
  1661. 8011831C+6C = 0
  1662. 801182F0+0 = 0
  1663. 801182F0[4:6] = 0
  1664. 801182F0[6:8] = 0
  1665. 801182F0[8:A] = 0
  1666. 801182F0[A:C] = 0
  1667. 801182F0[C:E] = 0
  1668. 801182F0[E:10] = 0
  1669. 801182F0[10:12] = 0
  1670. 801182F0[12:14] = 0
  1671. 801182F0[14:16] = 0
  1672. 801182F0[18:1A] = 0
  1673. 801182F0[1C:1E] = 0
  1674. 801182F0[1E:20] = 0
  1675. 801182F0[20:22] = 0
  1676. 801182F0[22:24] = 0
  1677. 801182F0[26:28] = 0
  1678. 801182F0[28:2A] = 0
  1679. 801182F0[2A:2C] = 0
  1680. # 80037B34
  1681. v = @A0+8 # E0800000
  1682. 801182E8 = v+8
  1683. 8007D8B0+0 = 0
  1684. 8007D8B0[4:6] = 0
  1685. 8007D8B0[6:8] = 0
  1686. 8007D8B0[8:A] = 0
  1687. 8007D8B0[A:C] = 0
  1688. 801182EC = v+A
  1689. 800ADE10+0 = 0
  1690. 800ADE10[4:6] = 0
  1691. 800ADE10[6:8] = 0
  1692. 800ADE10[8:A] = 0
  1693. 800ADE10[A:C] = 0
  1694. 800D269C[0:2] = 0
  1695. call 80037F00()
  1696. 80037BBC
  1697. if @80118344 <= 0:
  1698. return
  1699. if call 80039B30():
  1700. return
  1701. 80118344 = 0
  1702. 800AEE78 = 0
  1703. 800AEE7C = 0
  1704. 80037C18
  1705. if not 80118310[0:2]:
  1706. if not 801182F0[C:E] & 0x800:
  1707. call 80039A48(8)
  1708. elif 801182F0[C:E] & 0x800:
  1709. call 80039A48(9)
  1710. 80037C70
  1711. 80037F00
  1712. v = @801182EC # E080000A
  1713. v[0:2] = (800D269C[0:2] & 0xFF00) | 80112997[0]
  1714. 80037F28
  1715. while True:
  1716. u1, l1 = call 80054E80() # V0, V1 = Count plus timer base (@800AEE70, @800AEE78)
  1717. v = @801182E8 # E0800008
  1718. 8007D8B8[0:2] = v[1]
  1719. while True:
  1720. u2, l2 = call 80054E80() # V0, V1 = Count plus timer base (@800AEE70, @800AEE78)
  1721. u2 -= u1 - (l2 < l1)
  1722. l2 -= l1
  1723. if u2 or l2 >= 0x578:
  1724. break
  1725. if 8007D8B8[0:2] == v[1]:
  1726. break
  1727. # 80037FA8
  1728. 80117494 = @8007D8B0
  1729. if v[1] == 0xFF:
  1730. 8007D8B0+0 = 0xB
  1731. v = @8007D8B0
  1732. if v < 0xC:
  1733. # v <<= 2
  1734. # call @8006AAC8+v()
  1735. if v == 0:
  1736. # 80037FF0
  1737. if 8007D8B8[0:2] != 0xFE:
  1738. 80118300[0:2] = 0
  1739. elif 8007D8B8[2:4] == 8007D8B8[0:2]:
  1740. 80118300[0:2] = 0
  1741. else:
  1742. 800D269C[0:2] = 0xFC00
  1743. 80066B80+0 = 0
  1744. 8007D8B0+0 += 1
  1745. 8007D8B8[2:4] = 8007D8B8[0:2]
  1746. elif v == 1:
  1747. # 80038040
  1748. if not 8007D8B8[0:2] and 8007D8B8[2:4]:
  1749. 8007D8B0 += 1
  1750. 800D269C[0:2] = 0
  1751. 80066B80+0 = 0
  1752. 8007D8B8[2:4] = 8007D8B8[0:2]
  1753. elif v == 2:
  1754. # 80038088
  1755. if 8007D8B8[0:2] and 8007D8B8[0:2] != 8007D8B8[2:4]:
  1756. 8007D8B4[0:2] = 8007D8B8[0:2]
  1757. 800D269C[0:2] = 0xFC00
  1758. 80066B80+0 = 0
  1759. 8007D8B0+0 += 1
  1760. 8007D8B8[2:4] = 8007D8B8[0:2]
  1761. elif v == 3:
  1762. # 800380D4
  1763. if not 8007D8B8[0:2] and 8007D8B8[2:4]:
  1764. v = 8007D8B4[0:2] << 2
  1765. v = @80066A60+v
  1766. 800D269C[0:2] = 0
  1767. 80066B80+0 = 0
  1768. if 8007D8B8[2:4] < v:
  1769. # 80038210
  1770. 8007D8B0 = 4
  1771. else:
  1772. # 8003821C
  1773. 80118300[0:2] = 0
  1774. call 8003A7F0(8007D8B0)
  1775. 8007D8B0 = 0
  1776. 8007D8B4[2:4] = 0
  1777. 80066B80 = 0
  1778. 8007D8B8[2:4] = 8007D8B8[0:2]
  1779. elif v == 4:
  1780. # 8003813C
  1781. if 8007D8B8[0:2] and 8007D8B8[0:2] != 8007D8B8[2:4]:
  1782. v = (8007D8B4[2:4] << 0x10) >> 0xE
  1783. 8007D8B4[2:4] += 1
  1784. 8007D8B8[v+4:v+6] = 8007D8B8[0:2] & 0xFF
  1785. 80066B80+0 = 0
  1786. 800D269C[0:2] = 0
  1787. 8007D8B0 += 1
  1788. 8007D8B8[2:4] = 8007D8B8[0:2]
  1789. elif v == 5:
  1790. # 800381BC
  1791. 800D269C[0:2] = 0
  1792. if not 8007D8B8[0:2] and 8007D8B8[2:4]:
  1793. v = 8007D8B4[0:2] << 2
  1794. v = @80066A60+v
  1795. if 8007D8B8[2:4] < v:
  1796. # 80038210
  1797. 8007D8B0 = 4
  1798. else:
  1799. # 8003821C
  1800. 80118300[0:2] = 0
  1801. call 8003A7F0(8007D8B0)
  1802. 8007D8B0 = 0
  1803. 8007D8B4[2:4] = 0
  1804. 80066B80 = 0
  1805. 8007D8B8[2:4] = 8007D8B8[0:2]
  1806. elif v == 0xA:
  1807. # 80038254
  1808. 800D269C[0:2] = 0xFF00
  1809. 8007D8B0 += 1
  1810. elif v == 0xB:
  1811. # 80038278
  1812. 800D269C[0:2] = 0
  1813. 8007D8B8[2:4] = 0
  1814. 8007D8B0 = 0
  1815. 8007D8B4[0:2] = 0
  1816. 8007D8B4[2:4] = 0
  1817. 800382B4
  1818. 800ADE10[6:8] = 0
  1819. 800ADE10+0 = 0
  1820. 800ADE10[4:6] = 0
  1821. 80118300[0:2] = 0
  1822. 800382DC
  1823.  
  1824. 80038658 set slot type to A0; 801182F0[A:C] = @A0+0
  1825. accepts: A0
  1826. 80038668
  1827. accepts: A0
  1828.  
  1829. 80038984
  1830. accepts: A0
  1831.  
  1832. 80038C38
  1833. accepts: A0
  1834.  
  1835. 80038DDC
  1836. accepts: A0
  1837.  
  1838. 800391C4 unconditional return
  1839. accepts: A0
  1840. 800391CC
  1841. accepts: A0
  1842. v = @A0+0
  1843. if not v & 0x20:
  1844. return
  1845. v &= 0xF
  1846. # they do a number of silly tests, so important one here is...
  1847. if v != 4:
  1848. return
  1849. v = 80118300[2:4] / @80118358
  1850. 80118344 += v
  1851. 8011834C += v
  1852. if (@80118370 & 0) or (@80118374 & 0x20):
  1853. 80118300[2:4] = 0
  1854. 80118334[2:4] = 0
  1855. else:
  1856. v *= @80118358
  1857. v = 80118300[2:4] - v
  1858. 80118300[2:4] = v
  1859. if not call 80039B30(80118344):
  1860. 80118344 = 0
  1861. 80118388 = 0
  1862. 800392EC 80118378[2:4] = @A0+0
  1863. accepts: A0
  1864. 800392FC
  1865. accepts: A0
  1866. 80118310[2:4] = @A0+0
  1867. call 80039960(80118354[0:2], 800D2750[1] + 1)
  1868. 80039334
  1869. accepts: A0
  1870. 800394A4 ???; add credit up to 99 credits?
  1871. accepts: A0
  1872. 8011833C += 1
  1873. 80118340 += 1
  1874. 8007D890[0:2] += 1
  1875. 80118300[2:4] += 80118354[0:2]
  1876. 80118338[2:4] += 80118354[0:2]
  1877. if 80118338[2:4] > 0x63:
  1878. 80118338[2:4] = 0x63
  1879. if 80118338[2:4] < 0:
  1880. 80118338[2:4] = 0
  1881. 8003954C
  1882. accepts: A0
  1883. 800396BC
  1884. accepts: A0
  1885. 8011834C -= 1
  1886. if @8011834C < 0:
  1887. 8011834C = 0
  1888. 8007DAE8 += 1
  1889. 800AEE78 = 0
  1890. 800AEE7C = 0
  1891. 80039708
  1892. accepts: A0
  1893. v = @8011834C * @80118358
  1894. v += 80118300[2:4]
  1895. 8011834C = 0
  1896. 80118300[2:4] = v
  1897. call 8003A79C(v)
  1898. 80039774
  1899. accepts: A0
  1900. 80039868
  1901. accepts: A0
  1902. 8003990C 80118300[4:6] -= 1 within range (0, 200)
  1903. 80118300[4:6] -= 1
  1904. if 80118300[4:6] < 0:
  1905. 80118300[4:6] = 0
  1906. if 80118300[4:6] > 0xC8:
  1907. 80118300[4:6] = 0xC8
  1908. 80039948 80113110[0] = 1; rerun code at 80025DB0
  1909. 80039958 unconditional return
  1910. 80039960
  1911. accepts: A0, A1
  1912. v = 800ADE10[6:8]
  1913. if v < 0xFA:
  1914. v <<= 1
  1915. 800ADE10[v+C:v+E] = 0x100
  1916. v = 800ADE10[6:8] * 0xA
  1917. 800AE010[v:v+2] = A0 << 8
  1918. 800AE010[v+2:v+4] = A1 << 8
  1919. 800ADE10[6:8] += 1
  1920. 800399DC
  1921. v = 800ADE10[6:8]
  1922. if v < 0xFA:
  1923. v <<= 1
  1924. 800ADE10[v+C:v+E] = 0x200
  1925. v = 800ADE10[6:8] * 0xA
  1926. A0 += 1
  1927. 800AE010[v:v+2] = A0 << 8
  1928. 800ADE10[6:8] += 1
  1929. 80039A48
  1930. accepts: A0
  1931. v = 800ADE10[6:8]
  1932. if v < 0xFA:
  1933. v <<= 1
  1934. 800ADE10[v+C:v+E] = 0x300
  1935. v = 800ADE10[6:8] * 0xA
  1936. 800AE010[v:v+2] = A0 << 8
  1937. 800ADE10[6:8] += 1
  1938. 80039AA4
  1939. v = 800ADE10[6:8]
  1940. if v < 0xFA:
  1941. v <<= 1
  1942. 800ADE10[v+C:v+E] = 0x400
  1943. 80118338[0:2] = 0
  1944. 800ADE10[6:8] += 1
  1945. 80039AE8
  1946. v = 800ADE10[6:8]
  1947. if v < 0xFA:
  1948. v <<= 1
  1949. 800ADE10[v+C:v+E] = 0x500
  1950. 80118338[0:2] = 0
  1951. 800ADE10[6:8] += 1
  1952. 80039B30
  1953. 80039FF4
  1954. 8003A294
  1955. if 800ADE10[6:8] < 0xFA:
  1956. v = 800ADE10[6:8] << 1
  1957. 800ADE10[v+C:v+E] = 0x700
  1958. 800ADE10[6:8] += 1
  1959. 8003A2D0
  1960. if 800ADE10[6:8] < 0xFA:
  1961. v = 800ADE10[6:8] << 1
  1962. 800ADE10[v+C:v+E] = 0x800
  1963. v = 800ADE10[6:8] * 0xA
  1964. 800AE010[v:v+2] = 0x8000 if A0 == 1 else 0x4000
  1965. 800ADE10[6:8] += 1
  1966. 8003A358
  1967. if 800ADE10[6:8] < 0xFA:
  1968. v = 800ADE10[6:8] << 1
  1969. 800ADE10[v+C:v+E] = 0x900
  1970. v = 800ADE10[6:8] * 0xA
  1971. 800AE010[v:v+2] = 0x8000 if A0 == 1 else 0x4000
  1972. 800ADE10[6:8] += 1
  1973. 8003A3E0
  1974. 8003A680
  1975. if 800ADE10[6:8] < 0xFA:
  1976. v = 800ADE10[6:8] << 1
  1977. 800ADE10[v+C:v+E] = 0xB00
  1978. 800ADE10[6:8] += 1
  1979. 8003A6BC
  1980. if 800ADE10[6:8] < 0xFA:
  1981. v = 800ADE10[6:8] << 1
  1982. 800ADE10[v+C:v+E] = 0xC00
  1983. v = 800ADE10[6:8] * 0xA
  1984. 800AE010[v:v+2] = 80118300[4:6] << 8
  1985. 800ADE10[6:8] += 1
  1986. 8003A724
  1987. if 800ADE10[6:8] < 0xFA:
  1988. v = 800ADE10[6:8] << 1
  1989. 800ADE10[v+C:v+E] = 0xD00
  1990. 800ADE10[6:8] += 1
  1991. 8003A760
  1992. accepts: A0=mode
  1993. if A0 == 1:
  1994. call 80039A48(1)
  1995. elif A0 == 2:
  1996. call 80039A48(3)
  1997. 8003A79C redirect to 80039FF4()
  1998. 8003A7B8 call 80039A48(0xC)
  1999. 8003A7D4 call 80039A48(0xB)
  2000. 8003A7F0
  2001. accepts: A0 [8007D8B0]
  2002. # if A0[4:6] >= 0x13: return
  2003. # call @8006ACA8+(A0[4:6]<<2)(A0)
  2004. if A0[4:6] == 1:
  2005. call 80038658(A0+C) # set slot type to A0; 801182F0[A:C] = @A0+0
  2006. elif A0[4:6] == 2:
  2007. call 80038668(A0+C)
  2008. elif A0[4:6] == 3:
  2009. call 80038984(A0+C)
  2010. elif A0[4:6] == 4:
  2011. call 80038C38(A0+C)
  2012. elif A0[4:6] == 5:
  2013. call 80038DDC(A0+C)
  2014. elif A0[4:6] == 6:
  2015. call 800391C4(A0+C) # unconditional return
  2016. elif A0[4:6] == 7:
  2017. call 800391CC(A0+C)
  2018. elif A0[4:6] == 8:
  2019. call 800392EC(A0+C)
  2020. elif A0[4:6] == 9:
  2021. call 800392FC(A0+C)
  2022. elif A0[4:6] == 0xA:
  2023. call 80039334(A0+C)
  2024. elif A0[4:6] == 0xB:
  2025. call 800394A4(A0+C)
  2026. elif A0[4:6] == 0xC:
  2027. call 8003954C(A0+C)
  2028. elif A0[4:6] == 0xD:
  2029. call 800396BC(A0+C)
  2030. elif A0[4:6] == 0xE:
  2031. call 80039708(A0+C)
  2032. elif A0[4:6] == 0xF:
  2033. call 80039774(A0+C)
  2034. elif A0[4:6] == 0x10:
  2035. call 80039868(A0+C)
  2036. elif A0[4:6] == 0x11:
  2037. call 8003990C(A0+C) # 80118300[4:6] -= 1 within range (0, 200)
  2038. elif A0[4:6] == 0x12:
  2039. call 80039948(A0+C) # 80113110[0] = 1; rerun code at 80025DB0
  2040. 8003A940 Thread: boot
  2041. call 80058D28() # initialize system
  2042. call 80059000() # unconditional return
  2043. call 80054970(8006CA20, 1, 8003A9A4, 0, 8006ED80, 0xA) # create thread A0, ID A1, calling A2(A3) w/ stack at SP+10 and priority SP+14
  2044. call 80054C10(8006CA20) # start thread A0
  2045. 8003A9A4 Thread: main
  2046. 801127C8 = None
  2047. call 8003C8A0() # create E/PI Thread and handle
  2048. call 8003AA50(2, 1) # create and initialize display using VI setting #A0
  2049. call 800558A0(0x5A) # set VI manager settings based on flags A0
  2050. call 80054970(8006CBD0, 3, 80025C6C, 0, 800B1A60, 0xA) # create thread A0, ID A1, calling A2(A3) w/ stack at SP+10 and priority SP+14
  2051. call 80054C10(8006CBD0) # start thread A0
  2052. call 80054B40(8006CA20, 0) # change priority of thread A0 or current thread to A1
  2053. while True:
  2054. if @801127C8:
  2055. call @801127C8()
  2056. 8003AA50 create and initialize display using VI setting #A0
  2057. accepts: A0=VI settings index, A1
  2058. 801180DC = 0
  2059. 801180E0 = 0
  2060. 801180E4 = 0
  2061. 801180D8 = 0
  2062. 80117A70[0:2] = 1
  2063. 80117A70[2:4] = 2
  2064. 801180E8 = A1
  2065. 801180ED[0] = 2
  2066. 801180EC[0] = 0x32 if not @80000300 else 0x3C
  2067. 8007D892[0] = 0
  2068. 80074D80 = 80112A30
  2069. 80112A30+0 = 0
  2070. 80112A30+4 = 0
  2071. 80112A30[59] = 0
  2072. 80112A30[58] = 0
  2073. 8007D918 = 80112A30
  2074. call 800544C0(0x3C0) # A410000C = A0; set DP Status to A0
  2075. call 80054040(80117AE4, 80117AFC, 8) # create message queue A0 with A2 messages at A1
  2076. call 80054040(80117B1C, 80117B34, 8) # create message queue A0 with A2 messages at A1
  2077. call 80054040(80117B54, 80117B6C, 8) # create message queue A0 with A2 messages at A1
  2078. call 80054040(80117AAC, 80117AC4, 8) # create message queue A0 with A2 messages at A1
  2079. call 80054040(80117A74, 80117A8C, 8) # create message queue A0 with A2 messages at A1
  2080. call 80054040(80117B8C, 80117BA4, 8) # create message queue A0 with A2 messages at A1
  2081. call 800554B0(0xFE) # create and start VI thread with priority A0
  2082. call 80055850(800675C0 + (A0 * 0x50)) # use VI settings at A0
  2083. call 80055DC0(1) # blackout screen if A0
  2084. call 800557F0(80117AE4, 0x29A, A1) # set VI interrupt callback to queue A0, msg A1, mode A2
  2085. call 80054410(4, 80117B1C, 0x29B) # create callback for event A0, sending msg A2 to queue A1: SP task complete
  2086. call 80054410(9, 80117B54, 0x29C) # create callback for event A0, sending msg A2 to queue A1: DP full sync
  2087. call 80054410(0xE, 80117AE4, 0x29D) # create callback for event A0, sending msg A2 to queue A1: preNMI
  2088. call 80054970(80117BC8, 0x13, 8003AE04, 80117A70, 80070D80, 0x78) # create thread A0, ID A1, calling A2(A3) w/ stack at SP+10 and priority SP+14
  2089. call 80054C10(80117BC8) # start thread A0
  2090. call 80054970(80117D78, 0x12, 8003B2CC, 80117A70, 80072D80, 0x6E) # create thread A0, ID A1, calling A2(A3) w/ stack at SP+10 and priority SP+14
  2091. call 80054C10(80117D78) # start thread A0
  2092. call 80054970(80117F28, 0x11, 8003B658, 80117A70, 80074D80, 0x64) # create thread A0, ID A1, calling A2(A3) w/ stack at SP+10 and priority SP+14
  2093. call 80054C10(80117F28) # start thread A0
  2094. 8003ADA4 V0 = 80117A74
  2095. 8003ADD4 V0 = 80117AAC
  2096. 8003AE04 Thread
  2097. accepts: A0
  2098. 8003B028
  2099. accepts: A0=p->target, A1=p->queue, A2=flags
  2100. flag = call 8004C4A0(1) # V0 = flags after masking Status with A0
  2101. A0+4 = A1
  2102. A0+0 = @801180D8
  2103. A0[8:A] = A2
  2104. 801180D8 = A0
  2105. if A2 & 2 and 8007D892[0]:
  2106. call 800542E0(A1, 80117A72, False) # send or jam (A2) msg A1 to queue A0
  2107. call 8004C4A0(flag) # V0 = flags after masking Status with A0
  2108. 8003B0F8
  2109. flag = call 8004C4A0(1) # V0 = flags after masking Status with A0
  2110. A0[8:A] = A1
  2111. call 8004C4A0(flag) # V0 = flags after masking Status with A0
  2112. 8003B15C
  2113. accepts: A0
  2114. 8003B230
  2115. 8003B2CC Thread
  2116. accepts: A0
  2117. 8003B658 Thread
  2118. accepts: A0
  2119. 8003BCA8
  2120. 8003BD70 801180ED[0] = A0
  2121. accepts: A0
  2122. 8003BDA4 V0 = 801180EC[0]
  2123. 8003BDE0 Thread
  2124. call 80054040(801182C8, 80076F50, 8) # create queue A0 with A2 messages at A1
  2125. # 8003BE20
  2126. while True:
  2127. call 800541B0(801182C8, SP+14, True) # read or wait (A2) to write message from queue A0 to A1
  2128. v = @SP+14
  2129. v = @v+54
  2130. if v[0:2] == 4:
  2131. # 8003BE70
  2132. if @80066BCC:
  2133. call @80066BCC(@SP+14)
  2134. if @800AE9F8 & 0x80:
  2135. call 80055DC0(0)
  2136. 800AE9F8 = 1
  2137. flag = call 8004C4A0(1) # V0 = flags after masking Status with A0
  2138. 800D26B8 -= 1
  2139. @800D26B8 # not an error; read and thrown away, probably to push out of cache
  2140. call 8004C4A0(flag) # V0 = flags after masking Status with A0
  2141. elif v[0:2] == 8:
  2142. # 8003BF00
  2143. if @80066BD0:
  2144. call @80066BD0(@SP+14)
  2145. flag = call 8004C4A0(1) # V0 = flags after masking Status with A0
  2146. 800D26B8 -= 1
  2147. @800D26B8 # not an error; read and thrown away, probably to push out of cache
  2148. call 8004C4A0(flag) # V0 = flags after masking Status with A0
  2149. 8003BF84
  2150. 80074D94[0:2] = 8
  2151. 80074D94[2:4] = 4
  2152. 800D26B8 = 0
  2153. call 8003C830() # disable display and blackout
  2154. call 80054970(80074D98, 5, 8003BDE0, 0, 80076F50, 0x3C) # create thread A0, ID A1, calling A2(A3) w/ stack at SP+10 and priority SP+14
  2155. call 80054C10(80074D98) # start thread A0
  2156. for i in range(0xA):
  2157. v = i * 0x58
  2158. 80113118+v = 80113170 + v
  2159. 80113168+v = 801182C8
  2160. 80113128+v = 1
  2161. 8011312C+v = 0
  2162. 80113130+v = 8005DA50
  2163. 80113134+v = 8005DB20 - 8005DA50 # 0xD0
  2164. 8011313C+v = 0x1000
  2165. 80113144+v = 0x800
  2166. 80113148+v = 80117670
  2167. 8011314C+v = 0x400
  2168. 80113160+v = 800B1A70
  2169. 80113164+v = 0xC10
  2170. # 8003C284
  2171. 80113430 = 80113118
  2172. 80074D90 = 80113118
  2173. 8003C2BC start graphics task with display list A0, length A1
  2174. accepts: A0=p->dl, A1=length, A2, A3
  2175. 8003C580 set 80066DA0 to function pointer A0
  2176. accepts: A0=p->function
  2177. call 8003C5E0() # wait while @800D26B8 nonzero
  2178. flag = call 8004C4A0(1) # V0 = flags after masking Status with A0
  2179. 80066DA0 = A0
  2180. call 8004C4A0(flag) # V0 = flags after masking Status with A0
  2181. 8003C5E0 wait while @800D26B8 nonzero
  2182. while @800D26B8:
  2183. pass
  2184. 8003C630 register A1 framebuffers starting at rdram A0
  2185. accepts: A0=p->target, A1=num
  2186. 80117618 = A0
  2187. 80066BC0 = A1
  2188. 800ADC44 = 0
  2189. v = @80117618
  2190. 80117598 = @v+0
  2191. call 8003E0F0(1) # ???; wait A0 frames?
  2192. call 8003BD70(A1 & 0xFF) # 801180ED[0] = A0
  2193. if A1 < 2:
  2194. return
  2195. for i in range(A1-1):
  2196. v = @80117618+0 + (i << 2)
  2197. if @v+0 != @v+4:
  2198. break
  2199. # 8003C730
  2200. if i == (A1-1):
  2201. call 8003BD70(1) # 801180ED[0] = A0
  2202. return
  2203. for i in range(A1):
  2204. call 80055420()
  2205. v = @80117618+0 + (i << 2)
  2206. if @v+0 != @80117618:
  2207. 800ADC44 = i
  2208. 80117598 = @v+0
  2209. break
  2210. # 8003C7F4
  2211. if i == A1:
  2212. call 80054018(8006AD44) # NERFed! print debug message A0: "nuGfxSetCfb: FrameBuffer Addres Error!!\n"
  2213. 8003C830 disable display and blackout
  2214. 800AE9F8 = 0
  2215. call 80055DC0(1) # blackout screen if A0
  2216. 8003C870 800AE9F8 = 0x80
  2217. 8003C8A0 create E/PI Thread and handle
  2218. call 8004C540(0x96, 80076F70, 80076F88, 0x32) # create EPI request thread with priority A0, using queue A1 with A3 msgs at A2
  2219. 80112958 = call 8004C960() # V0 = p->EPI handle for cart, creating if necessary
  2220. 8003C900 load A2 bytes from hardware A0 to rdram A1
  2221. accepts: A0=hardware offset, A1=p->target, A2=length
  2222. call 80054040(SP+28, SP+40, 1) # create queue A0 with A2 messages at A1
  2223. SP[12] = 0
  2224. SP+14 = SP+28
  2225. call 80051C90(A1, A2)
  2226. if not A2:
  2227. return
  2228. i = 0
  2229. while i < A2:
  2230. v = min(0x4000, A2 - i)
  2231. SP+18 = A1
  2232. SP+1C = A0
  2233. SP+20 = v
  2234. call 8004C8C0(@80112958, SP+10, 0) # V0 = errors when completing and sending read or write (A2) E/PI request A1 using EPI handle A0
  2235. call 800541B0(SP+28, SP+40, True) # read or wait (A2) to write message from queue A0 to A1
  2236. A1 += i
  2237. A0 += i
  2238. 8003CA30 ???; sets up framebuffers and display processing threads
  2239. call 8003DFD4() # create and start thread 800ADC48 calling 8003DEB0(0)
  2240. call 8003C630(80066C10, 3) # register A1 framebuffers starting at rdram A0
  2241. 800ADBB0 = 80000400 # replacement Z buffer, looks like
  2242. call 8003E040(8003E0A0) # ???; 80066BCC = p->function A0
  2243. call 8003E1A0(800B2690, 0x20000) # set fifo buffer A0, size A1
  2244. 800AF9D8 = 80066BE0 # microcode table
  2245. call 8003BF84()
  2246. dl = SP+10
  2247. dl.append(DE000000, 00066C20)
  2248. dl.append(E9000000, 00000000)
  2249. dl.append(DF000000, 00000000)
  2250. v = dl - SP+10
  2251. v >>= 3
  2252. v <<= 3
  2253. call 8003C2BC(SP+10, v, 0, 0) # start graphics task with display list A0, length A1
  2254. call 8003C5E0() # wait while @800D26B8 nonzero
  2255. 8003CB80
  2256. SP[10] = call 8003E230()
  2257. call 8003E900() # V0 = number of connected controllers; initialize SI callback for controller input
  2258. call 8003CCA0() # add SI callback 80066D40
  2259. call 8003D170()
  2260. return SP[10]
  2261. 8003CBE0 copy controller A1 button input to A0
  2262. accepts: A0=p->target, A1=channel
  2263. SP[10:12] = A0[0:2]
  2264. call 8003EA98() # jam msg 0 to queue 801203B0
  2265. v = A1 * 6
  2266. call 80053B30(800AEE38+v, A0, 6) # V0 = p->A2 bytes copied from A0 to A1; fastcopy
  2267. A0[6:8] = 800AEE38[v:v+2] & ~SP[10:12]
  2268. call 8003EAD8() # wait for message on queue 801203B0
  2269. 8003CCA0 add SI callback 80066D40; call 8003E710(80066D40)
  2270. 8003CCD8 remove SI callback 80066D40; call 8003E840(80066D40)
  2271. 8003CD10
  2272.  
  2273. 8003CD9C
  2274. accepts: A0
  2275. v = @A0+C
  2276. i = @v+0
  2277. return call 800575A0(@i+0, v+4)
  2278. 8003CE04
  2279. accepts: A0
  2280. v = @A0+C
  2281. return call 80056E00(@(@v+0)+0, @(@v+0)+4, v[C], @v+4, @v+8, @v+10, v, @v+0)
  2282. 8003CE98
  2283. 8003CFA0
  2284. 8003D028
  2285. 8003D09C
  2286. accepts: A0=p->request struct
  2287. j = @A0+0
  2288. i = @A0+C
  2289. return call 800576B0(@j+0, @i+4, @i+8)
  2290. 8003D110
  2291. v = @A0+C
  2292. return call 80057A80(@v+0)
  2293. 8003D170
  2294. for i in range(4):
  2295. v = i * 0xA
  2296. 800AED10[v+4:v+6] = i
  2297. 800AED10[v+6] = 2
  2298. 800AED10[v+7] = 0
  2299. # 8003D220
  2300. call 8003E710(80066D70) # add SI callback for A0
  2301. 8003D248 remove SI callback 80066D70; call 8003E840(80066D70)
  2302. 8003D280
  2303. accepts: A0
  2304. 8003D5B0
  2305. 8003D858
  2306. 8003D8EC
  2307. 8003D9B8
  2308. accepts: A0
  2309. for i in range(4):
  2310. v = i * 0xA
  2311. 800AED10[v+7] &= 0x7F
  2312. return 0
  2313. 8003DA60
  2314. 8003DB50
  2315. 8003DBB0 add SI callback for 80066D94; call 8003E710(80066D94)
  2316. 8003DBE8 remove SI callback 80066D94; call 8003E840(80066D94)
  2317. 8003DC20 read A2 bytes of data from eeprom address A0 to A1
  2318. accepts: A0, A1, A2
  2319. SP+18 = A1
  2320. SP+18[8] = A0 & 0xFF
  2321. SP+18[A:C] = A2
  2322. return call 8003E2FC(0x402, SP+18)
  2323. 8003DCA8 write A2 bytes of data A1 to eeprom address A0
  2324. accepts: A0, A1, A2
  2325. SP+18 = A1
  2326. SP+18[8] = A0 & 0xFF
  2327. SP+18[A:C] = A2
  2328. return call 8003E2FC(0x403, SP+18)
  2329. 8003DD30 V0 = eeprom type or -1
  2330. return call 8003E2FC(0x401, 0)
  2331. 8003DD78 V0 = eeprom type read using SI queue 801182A8
  2332. return call 8004B950(801182A8) # V0 = eeprom type read using SI queue A0
  2333. 8003DDC4 V0 = errors reading eeprom using request struct A0
  2334. accepts: A0=eeprom request struct
  2335. v = @A0+C
  2336. return call 8004BAC0(801182A8, @v+8, v, A0[A:C]) # V0 = errors reading A3 bytes from eeprom address A1 to A2 using queue A0
  2337. 8003DE38 V0 = errors writing eeprom using request struct A0
  2338. accepts: A0=eeprom request struct
  2339. v = @A0+C
  2340. return call 8004B9D0(801182A8, @v+8, v, A0[A:C]) # V0 = errors writing A3 bytes of data A2 to eeprom address A1 using queue A0
  2341. 8003DEB0 Thread
  2342. call 80054040(800AEE58, 80077050, 8) # create queue A0 with A2 messages at A1
  2343. call 8003B028(SP+10, 800AEE58, 3)
  2344. # 8003DF0C
  2345. while True:
  2346. call 800541B0(800AEE58, SP+20, True) # read or wait (A2) to write message from queue A0 to A1
  2347. v = @SP+20
  2348. if v[0:2] == 1:
  2349. # 8003DF50
  2350. if @80066DA0:
  2351. call @80066DA0(@800D26B8)
  2352. elif v[0:2] == 2:
  2353. # 8003DF80
  2354. if @80066DA4:
  2355. call @80066DA4()
  2356. 8003DFD4 create and start thread 800ADC48 calling 8003DEB0(0)
  2357. call 80054970(800ADC48, 4, 8003DEB0, 0, 80079070, 0x32) # create thread A0, ID A1, calling A2(A3) w/ stack at SP+10 and priority SP+14
  2358. call 80054C10(800ADC48) # start thread A0
  2359. 8003E040 ???; 80066BCC = p->function A0
  2360. accepts: A0=p->function
  2361. flag = call 8004C4A0(1) # V0 = flags after masking Status with A0
  2362. 80066BCC = A0
  2363. call 8004C4A0(flag) # V0 = flags after masking Status with A0
  2364. 8003E0A0 call 80055A60(@A0+C)
  2365. 8003E0F0 ???; wait A0 frames?
  2366. accepts: A0=frame number
  2367. call 80054040(SP+28, SP+20, 1) # create queue A0 with A2 messages at A1
  2368. call 8003B028(SP+10, SP+28, 1)
  2369. for i in range(A0):
  2370. call 800541B0(SP+28, 0, True) # read or wait (A2) to write message from queue A0 to A1
  2371. call 8003B15C(SP+10)
  2372. 8003E1A0 set fifo buffer A0, size A1
  2373. accepts: A0=p->fifo buffer, A1=fifo size
  2374. if A0 & 0xF:
  2375. call 80054018(8006AD70) # NERFed! print debug message A0: "nuGfxUcodeFifoSet: fifo buffer is NOT 16byte boundaries\n"
  2376. if A1 & 0xF:
  2377. call 80054018(8006ADAC) # NERFed! print debug message A0: "nuGfxUcodeFifoSet: fifo size is NOT multiple 8 \n"
  2378. 80066BC8 = A0
  2379. 80066BC4 = A1
  2380. 8003E230
  2381. 8003E2FC
  2382.  
  2383. 8003E41C Thread: SI callback
  2384. call 80054040(800D26A0, SP+20, 8) # create queue A0 with A2 messages at A1
  2385. call 8003B028(SP+10, 800D26A0, 1)
  2386. # 8003E474
  2387. while True:
  2388. call 800541B0(800D26A0, SP+40, True) # read or wait (A2) to write message from queue A0 to A1
  2389. SP+44 = 80066DB0
  2390. if (@SP+40)[0:2] == 1:
  2391. # 8003E4C4
  2392. while @(@SP+44)+0:
  2393. v = @(@SP+44)+0
  2394. v = @v+4
  2395. if @v+0:
  2396. SP+48 = call @v+0(@SP+40)
  2397. if @SP+48:
  2398. break
  2399. SP+44 = @(@SP+44)+0
  2400. continue
  2401. elif (@SP+40)[0:2] == 0x7F00:
  2402. # 8003E544
  2403. call 800542E0(@(@SP+40)+4, 0, True) # send or jam (A2) msg A1 to queue A0
  2404. call 8003B0F8(SP+10, 0)
  2405. call 80054D30(0)
  2406. call 8003B0F8(SP+10, 1)
  2407. continue
  2408. else:
  2409. # 8003E590
  2410. SP[4C:4E] = (@SP+40)[0:2] & 0xFF00
  2411. SP[4E:50] = (@SP+40)[0:2] & 0xFF
  2412. while @(@SP+44)+0:
  2413. v = @(@SP+44)+0
  2414. if v[8:A] != SP[4C:4E]:
  2415. # 8003E6A8
  2416. SP+44 = @(@SP+44)+0
  2417. continue
  2418. if v[A:C] < SP[4E:50]:
  2419. v = @v+4
  2420. v = @v+(SP[4E:50]<<2)
  2421. (@SP+40)+8 = call @v+0(@SP+40)
  2422. else:
  2423. call 80054018(8006ADE0, SP[4C:4E], SP[4E:50], (@(@SP+44)+0)[A]) # NERFed! print debug message A0: "nuSiMgr: majorNo %#x minorNo %#x is over callback func num(%d).\n"
  2424. (@SP+40)+8 = -1
  2425. # 8003E678
  2426. if @(@SP+40)+4:
  2427. call 800542E0(@(@SP+40)+4, 0, True) # send or jam (A2) msg A1 to queue A0
  2428. # 8003E6BC
  2429. if not @(@SP+44)+0:
  2430. call 80054018(8006AE24, (@SP+40)[0:2]) # NERFed! print debug message A0: "nuSiMgr: no si callback function mesg %#X\n"
  2431. 8003E710 add SI callback for A0; nuSiCallBackAdd?
  2432. accepts: A0=p->SI struct
  2433. v = @80066DB0
  2434. while v:
  2435. if v[8:A] == A0[8:A]:
  2436. call 80054018(8006AE50, A0[8:A]) # NERFed! print debug message A0: "nuSiCallBackAdd: CallBack is already added(major no = %#X!!\n"
  2437. return
  2438. v = @v+0
  2439. # 8003E79C
  2440. i = 1
  2441. while True:
  2442. if not @(@A0+4)+(i<<2):
  2443. break
  2444. i += 1
  2445. flag = call 8004C4A0(1) # V0 = flags after masking Status with A0
  2446. v+0 = A0
  2447. A0+0 = 0
  2448. A0[A] = i
  2449. call 8004C4A0(flag) # V0 = flags after masking Status with A0
  2450. 8003E840 remove SI callback A0
  2451. accepts: A0=p->SI struct
  2452. v = 80066D80
  2453. while @v+0:
  2454. i = @v+0
  2455. if @i+0 == A0:
  2456. flag = call 8004C4A0(1) # V0 = flags after masking Status with A0
  2457. i+0 = @A0+0
  2458. A0+0 = 0
  2459. call 8004C4A0(flag) # V0 = flags after masking Status with A0
  2460. return
  2461. # 8003E8D0
  2462. v = @v+0
  2463. 8003E900 V0 = number of connected controllers; initialize SI callback for controller input
  2464. call 8003EE80()
  2465. call 80054040(8007DAD0, 8007B240, 1) # create queue A0 with A2 messages at A1
  2466. call 80054040(801203B0, 8007B244, 1) # create queue A0 with A2 messages at A1
  2467. call 8003E710(80066DD8) # add SI callback for A0
  2468. call 8003EED0() # copy result of SI status request to 800ADBB8
  2469. 800B1A68 = 0
  2470. j = 0
  2471. for i in range(4):
  2472. if not 800ADBB8[3 + (i<<2)]:
  2473. v = 800ADBB8[(i<<2):(i<<2)+2]
  2474. v &= 0x1F07
  2475. if v == 5:
  2476. 800B1A68 += 1
  2477. j |= 1 << i
  2478. # 8003EA38
  2479. return j
  2480. 8003EA60 remove SI callback 80066DD8; call 8003E840(80066DD8)
  2481. 8003EA98 jam msg 0 to queue 801203B0
  2482. call 800542E0(801203B0, 0, True) # send or jam (A2) msg A1 to queue A0
  2483. 8003EAD8 wait for message on queue 801203B0
  2484. call 800541B0(801203B0, 0, True) # read or wait (A2) to write message from queue A0 to A1
  2485. 8003EB18 read controller input to A0
  2486. accepts: A0=p->target, A1=flags
  2487. v = call 80051E90(801182A8) # send pifram read requests, informing queue A0
  2488. if v:
  2489. return v
  2490. call 800541B0(801182A8, 0, True) # read or wait (A2) to write message from queue A0 to A1
  2491. if @800ADBB4 & A1:
  2492. return v
  2493. call 8003EA98() # jam msg 0 to queue 801203B0
  2494. call 80051F18(A0) # copy result of SI read request to A0
  2495. call 8003EAD8() # wait for message on queue 801203B0
  2496. return v
  2497. 8003EBD8 send and copy results of SI status request to 800ADBB8
  2498. v = call 80051DF0(801182A8) # send pifram status requests, informing queue A0
  2499. if not v:
  2500. call 800541B0(801182A8, 0, True) # read or wait (A2) to write message from queue A0 to A1
  2501. call 80051E70(800ADBB8) # copy result of SI status request to A0; calls 8005220C
  2502. return v
  2503. 8003EC64
  2504. accepts: A0
  2505. if @800ADBB4:
  2506. return 0
  2507. call 800541B0(8007DAD0, 0, False) # read or wait (A2) to write message from queue A0 to A1
  2508. call 8003EB18(800AEE38, 1) # read controller input to A0
  2509. if @80066DC0:
  2510. call @80066DC0(A0[0:2])
  2511. call 800542E0(8007DAD0, 0, False) # send or jam (A2) msg A1 to queue A0
  2512. return 0
  2513. 8003ED28 read controller input into struct A0
  2514. accepts: A0
  2515. return call 8003EB18(@A0+C, 1) # read controller input to A0
  2516. 8003ED78
  2517. accepts: A0
  2518. call 800541B0(8007DAD0, 0, False) # read or wait (A2) to write message from queue A0 to A1
  2519. v = call 8003EB18(800AEE38, 0) # read controller input to A0
  2520. if v and @80066DC0:
  2521. call @80066DC0(A0[0:2])
  2522. return v
  2523. 8003EE30
  2524. flag = call 8004C4A0(1) # V0 = flags after masking Status with A0
  2525. 800ADBB4 = 1
  2526. call 8004C4A0(flag) # V0 = flags after masking Status with A0
  2527. 8003EE80
  2528. flag = call 8004C4A0(1) # V0 = flags after masking Status with A0
  2529. 800ADBB4 = 0
  2530. call 8004C4A0(flag) # V0 = flags after masking Status with A0
  2531. 8003EED0 copy result of SI status request to 800ADBB8; call 8003E2FC(0x103, 0)
  2532. 8003EF10
  2533. call 8003F290(8033F800, 0x50000, 80066E00)
  2534. call 8003EFA0(80066E24, 0x8000, 0)
  2535. call 8003EFA0(80066E24, 0x8000, 1)
  2536. call 8003F020(80066E40)
  2537. call 8003F0F0(8003F130)
  2538. call 8003F050(8003F090)
  2539. call 8003FC94()
  2540. 8003EFA0
  2541. accepts: A0, A1=length, A2
  2542. A0+C = 8007D898
  2543. v = call 8003FC3C(A1) # V0 = p->A0 bytes allocated from table 8007D898
  2544. i = A2 * 0x184
  2545. 800AEB7C+i = v
  2546. call 80040530(800AEA08+i, A0)
  2547. 8003F020
  2548. accepts: A0
  2549. A0+8 = 8007D898
  2550. call 800417F0(800AEE80)
  2551. 8003F050
  2552. accepts: A0=p->function
  2553. flag = call 8004C4A0(1) # V0 = flags after masking Status with A0
  2554. 80066E5C = A0
  2555. call 8004C4A0(flag) # V0 = flags after masking Status with A0
  2556. 8003F090
  2557. accepts: A0, A1
  2558. if A0 == 1 and A1 == 0x1C:
  2559. 80066E68[2:4] = 0
  2560. elif A0 == 2:
  2561. call 8003FD70(0, 0x1C)
  2562. call 8003FD70(1, 0x1C)
  2563. 8003F0F0
  2564. accepts: A0=p->function
  2565. flag = call 8004C4A0(1) # V0 = flags after masking Status with A0
  2566. 80066E60 = A0
  2567. call 8004C4A0(flag) # V0 = flags after masking Status with A0
  2568. 8003F130
  2569. 8003F290 set allocation at A0, size A1
  2570. accepts: A0=p->rdram, A1=length, A2=
  2571. 80066E68[2] = 1
  2572. v = call 8003BDA4() # V0 = 801180EC[0]
  2573. k = @801180E8 * @A2+18
  2574. k += v
  2575. k -= 1
  2576. k /= v
  2577. j = 80066E68[0:2] + k + 0xB7
  2578. 800ADC40[0:2] = k
  2579. i = j * 0xB21642C9
  2580. i += j
  2581. i >>= 7
  2582. i -= j >> 31
  2583. 800ADC40[0:2] = i * 0xB8
  2584. call 8003FC20(8007D898, A0, A1) # set allocation table A0 for A2 bytes at A1
  2585. 801127C4 = call 8003FC3C(@80066E64 << 3) # V0 = p->A0 bytes allocated from table 8007D898
  2586. 8007B250 = call 8003FC3C(@800ADC40 << 2) # V0 = p->A0 bytes allocated from table 8007D898
  2587. 8007B254 = call 8003FC3C(@800ADC40 << 2) # V0 = p->A0 bytes allocated from table 8007D898
  2588. 801182E0 = call 8003FC3C(0x2000) # V0 = p->A0 bytes allocated from table 8007D898
  2589. A2+10 = 8003F9C4
  2590. A2+14 = 8007D898
  2591. A2+18 = call 8004CFA0(@A2+18)
  2592. call 8003FE60(801129D0, A2)
  2593. # 8003F3EC
  2594. 800ADBF0 = 2
  2595. 800ADBFC = 8005DB20 - 8005DA50 # 0xD0
  2596. 800ADC00 = 8005CDF0
  2597. 800ADC08 = 800689C0
  2598. 800ADC0C = 0x800
  2599. 800ADC34 = 0
  2600. 800ADBF8 = 8005DA50
  2601. 800ADC10 = 0
  2602. 800ADC14 = 0
  2603. 800ADC18 = 0
  2604. 800ADC1C = 0
  2605. 800ADC28 = 0
  2606. 800ADC2C = 0
  2607. 800AEB84 = 0
  2608. 800AED08 = 0
  2609. 800AEB7C = 0
  2610. 800AED00 = 0
  2611. call 80054970(800AF828, 6, 8003F504, 0, @801182E0+0 + 0x2000, 0x46) # create thread A0, ID A1, calling A2(A3) w/ stack at SP+10 and priority SP+14
  2612. call 80054C10(800AF828) # start thread A0
  2613. return call 8003FC94() # V0 = @8007D89C - @8007D898
  2614. 8003F504 Thread
  2615. 8003F820 V0 = p->A1 bytes read from hardware A0
  2616. accepts: A0=hardware offset, A1
  2617. k = @80112960
  2618. A1 += A0
  2619. j = 0
  2620. # 8003F854
  2621. while k:
  2622. v = 80066DF0[2:4] + @k+8
  2623. if A0 < @k+8:
  2624. break
  2625. j = k
  2626. if v < A1:
  2627. # 8003F8F4
  2628. k+C = 1
  2629. v = @k+10 + @k+8 + A0
  2630. return call 80052380(v) # V0 = physical address for A0
  2631. k = @k+0
  2632. # 8003F87C
  2633. k = @80112064
  2634. if not k:
  2635. v = @80112960
  2636. return 80000000 - @v+10
  2637. # 8003F8A8
  2638. 80112964 = @k+0
  2639. call 8005097C()
  2640. if j:
  2641. call 8005095C(k, j)
  2642. else:
  2643. # 8003F8CC
  2644. j = @80112960
  2645. if j:
  2646. 80112960 = k
  2647. k+0 = j
  2648. k+4 = 0
  2649. j+4 = k
  2650. else:
  2651. 80112960 = k
  2652. k+0 = 0
  2653. k+4 = 0
  2654. # 8003F928
  2655. j = A0 & 1
  2656. A0 -= j
  2657. v = @8007B260 * 0x18
  2658. 8007B260 += 1
  2659. k+8 = A0
  2660. k+C = 1
  2661. k+10 = k
  2662. (@800AE9FC)[v + 2] = 0
  2663. (@800AE9FC)+4 = 800ADDF8
  2664. (@800AE9FC)+8 = k
  2665. (@800AE9FC)+C = A0
  2666. (@800AE9FC)+10 = 80066DF0[2:4]
  2667. call 8004C8C0(@80112958, @800AE9FC, 0) # V0 = errors when completing and sending read or write (A2) E/PI request A1 using EPI handle A0
  2668. return call 80052380(k) + j # V0 = physical address for A0
  2669. 8003F9C4 V0 = 8003F820
  2670. accepts: A0
  2671. if not 8011295C[0]:
  2672. 800B1A64 = call 8003FC3C(80066DF0[0:2] << 2) # V0 = p->A0 bytes allocated from table 8007D898
  2673. 800AE9FC = call 8003FC3C(80066DF0[0:2] * 0x18) # V0 = p->A0 bytes allocated from table 8007D898
  2674. call 80054040(800ADDF8, @800B1A64, 80066DF0[0:2]) # create queue A0 with A2 messages at A1
  2675. 800AEA00 = call 8003FC3C(80066DF0[0:2] * 0x14) # V0 = p->A0 bytes allocated from table 8007D898
  2676. 80112960 = 0
  2677. 80112964 = @800AEA00
  2678. v = @800AEA00
  2679. v+0 = 0
  2680. v+4 = 0
  2681. # 8003FA94
  2682. for i in range(80066DF0[0:2])
  2683. call 8005095C(@800AEA00 + (i + 1) * 0x14, @800AEA00 + i * 0x14)
  2684. (@800AEA00)+(i * 0x14)+10 = call 8003FC3C(80066DF0[2:4]) # V0 = p->A0 bytes allocated from table 8007D898
  2685. # 8003FAE4
  2686. (@800AEA00)+(i * 0x14)+10 = call 8003FC3C(80066DF0[2:4]) # V0 = p->A0 bytes allocated from table 8007D898
  2687. 8011295C[0] += 1
  2688. # 8003FB20
  2689. 8007B260 = 0
  2690. A0+0 = 8011295C
  2691. return 8003F820
  2692. 8003FB58
  2693. i = @80112960+0
  2694. 8007B260 = 0
  2695. while i:
  2696. v = @80112960+C
  2697. 80112960+C -= 1
  2698. if not v:
  2699. if @80112960+0 == i:
  2700. 80112960+0 = @i+0
  2701. call 8005097C(i)
  2702. if not @80112960+4:
  2703. 80112960+4 = i
  2704. i+0 = 0
  2705. i+4 = 0
  2706. else:
  2707. call 8005095C(i, @80112960+4)
  2708. i = @i+0
  2709. # 8003FBE8
  2710. 80066E50 += 1
  2711. 8003FC20 set allocation table A0 for A2 bytes at A1; redirect to 800509B0(A0, A1, A2)
  2712. accepts: A0=p->allocation table, A1, A2
  2713. 8003FC3C V0 = p->A0 bytes allocated from table 8007D898; calls 800509F0(0, 0, 8007D898, 1, A0)
  2714. accepts: A0=length
  2715. call 800509F0(0, 0, 8007D898, 1, A0) # V0 = p->count SP+10 blocks of size A3 allocated from table A2
  2716. 8003FC6C
  2717. v = call 8003FC94()
  2718. return @8007C8A0 - v
  2719. 8003FC94 V0 = @8007D89C - @8007D898
  2720. 8003FCB0
  2721. 8003FD70
  2722. 8003FE60
  2723. accepts: A0, A1=p->request
  2724. if not @80066E70:
  2725. 80066E70 = A0
  2726. if not @80066E74:
  2727. 80066E74 = A0
  2728. call 8003FF00(A1)
  2729. 8003FEA4
  2730. if @80066E70:
  2731. call 8003FEE0()
  2732. 80066E70 = 0
  2733. 80066E74 = 0
  2734. 8003FEE0
  2735. v = @80066E74
  2736. v+0 = 0
  2737. v+4 = 0
  2738. v+8 = 0
  2739. v+C = 0
  2740. 8003FF00
  2741. accepts: A0=p->request
  2742. v = @80066E74
  2743. v+0 = 0
  2744. v+4 = 0
  2745. v+8 = 0
  2746. v+C = 0
  2747. v+28 = 0
  2748. v+2C = 0
  2749. v+30 = @A0+10
  2750. v+44 = @A0+4
  2751. v+4C = @A0+18
  2752. v+50 = 0xB8
  2753. v+54 = 0
  2754. v+58 = 1
  2755. k = call 800509F0(0, 0, @A0+14, 1, 0x44) # V0 = p->count SP+10 blocks of size A3 allocated from table A2
  2756. v+40 = k
  2757. k+14 = 0
  2758. k+18 = @A0+4
  2759. k+1C = call 800509F0(0, 0, @A0+14, @A0+4, 4) # V0 = p->count SP+10 blocks of size A3 allocated from table A2
  2760. j = call 800509F0(0, 0, @A0+14, 1, 0x14) # V0 = p->count SP+10 blocks of size A3 allocated from table A2
  2761. k+3C = j
  2762. if A0[1C]:
  2763. (@v+40)+20 = call 80044DC0(0, A0, @A0+14)
  2764. (@v+3C)+4 = 80044270
  2765. else:
  2766. j+4 = 800429E0
  2767. # 80040044
  2768. v+10 = 0
  2769. v+14 = 0
  2770. v+18 = 0
  2771. v+1C = 0
  2772. v+20 = 0
  2773. v+24 = 0
  2774. j = call 800509F0(0, 0, @A0+14, @A0+4, 0x8C) # V0 = p->count SP+10 blocks of size A3 allocated from table A2
  2775. for i in range(@A0+4):
  2776. call 8005095C(j, v+10)
  2777. j+8 = 0
  2778. call 80042E6C(j, @v+30, @A0+14) # dynamically load image file to A0 using function A1 and allocation table A2
  2779. (@v+1C + @(@v+40)+14)+0 = j
  2780. (@v+40)+14 += 1
  2781. j += 0x8C
  2782. # 800400FC
  2783. j = call 800509F0(0, 0, @A0+14, @A0+8, 0x1C) # V0 = p->count SP+10 blocks of size A3 allocated from table A2
  2784. v+38 = 0
  2785. # 80040134
  2786. for i in range(@A0+8):
  2787. j+0 = @v+38
  2788. v+38 = j
  2789. j += 0x1C
  2790. # 80040154
  2791. return @80066E74
  2792. 8004017C
  2793. 800402FC
  2794.  
  2795. 80040530
  2796. accepts: A0, A1
  2797. 800406A0
  2798.  
  2799. 800417F0
  2800. 80041908
  2801. 80041998
  2802. 80041DD0
  2803. 80041E78
  2804. 80041ED0
  2805. 80041F4C
  2806. 80041FE4
  2807.  
  2808. 80042E6C dynamically load image file to A0 using function A1 and allocation table A2
  2809. accepts: A0=p->struct, A1=p->function, A2=p->allocation table
  2810. A0+C = call 800509F0(0, 0, A2, 1, 0x20) # V0 = p->count SP+10 blocks of size A3 allocated from table A2
  2811. A0+10 = call 800509F0(0, 0, A2, 1, 0x20) # V0 = p->count SP+10 blocks of size A3 allocated from table A2
  2812. A0+28 = call A1(A0+2C)
  2813. A0+34 = 0
  2814. A0+38 = A1
  2815. A0+3C = 0
  2816. A0+40 = call 800509F0(0, 0, A2, 1, 0x20) # V0 = p->count SP+10 blocks of size A3 allocated from table A2
  2817. A0+44 = 1.0
  2818. A0+48 = 0
  2819. A0+4C = 0
  2820. A0+50 = A1
  2821. A0+54 = call 800509F0(0, 0, A2, 1, 0x50) # V0 = p->count SP+10 blocks of size A3 allocated from table A2
  2822. A0[58:5A] = 0
  2823. A0[5A:5C] = 1
  2824. A0[5C:5E] = 1
  2825. A0[5E:60] = 1
  2826. A0[60:62] = 0
  2827. A0[62:64] = 0
  2828. A0[64:66] = 0 # set twice
  2829. A0[66:68] = 1 # set twice
  2830. A0[68:6A] = 1
  2831. A0[6E:70] = 1
  2832. A0+70 = 0
  2833. A0+74 = 0
  2834. A0+78 = A1
  2835. A0+7C = 0
  2836. A0+80 = 0
  2837. A0+84 = 0
  2838. 80042FA0
  2839.  
  2840. 80047068 initialize Aleck hardware
  2841. accepts: A0=feature flags
  2842. call 80047380() # set TLB entries for Aleck hardware
  2843. call 8004742C(SP+10) # write Aleck hardware handles to A0
  2844. 8007B270 = call 8004B160(@SP+10, @SP+14) # V0 = p->initialized Aleck "ram" at A0, size A1
  2845. if A0 & 0x10: # overlay
  2846. call 800475F0() # initialize Aleck overlay
  2847. if A0 & 0x20: # networking
  2848. call 80047F2C() # initialize Aleck networking
  2849. 800470F0 allocate entry of size A0 in default aleck memory manager
  2850. return call 8004B534(@8007B270, A0) # allocate entry of size A1 in aleck memory manager A0
  2851. 80047140 initialize default aleck memory manager entries for data A0
  2852. call 8004B2DC(@8007B270, A0) # initialize aleck memory manager entries for data A1 using table A0
  2853. 80047180 call 8005CBD0(0)
  2854. 800471C0 write TLB entry with index A0 mapping A1 to A2 using pagemask #A3 using cache mode SP+10
  2855. accepts: A0=index, A1=virtual page, A2=phys.addy, A3=index of pagemask, SP+10=mode (0:uncached, 1:cache noncoherant)
  2856. v = A3 * 0xC
  2857. SP+20 = 80067120+v
  2858. SP+24 = 0
  2859. SP+28 = 3 if SP+10 else 2
  2860. SP+2C = 1
  2861. SP+30 = 1
  2862. SP+34 = 1
  2863. if @80067120+v != A3:
  2864. return 0
  2865. SP+10 = A1 & ~0x3FFF # EntryHi
  2866. SP+10 |= @SP+24
  2867. SP+14 = (A2 >> 6) | (@SP+28 << 3) | (@SP+2C << 2) | (@SP+30 << 1) | @SP+34 # EntryLo0
  2868. SP+18 = (@80067120+v+4 | A2) >> 6 # EntryLo1
  2869. SP+18 |= (@SP+28 << 3) | (@SP+2C << 2) | (@SP+30 << 1) | @SP+34
  2870. SP+1C = @80067120+v+8 # PageMask (0x7FE000)
  2871. call 8004B890(A0, SP+10) # write TLB entry @A1 to index A0
  2872. return 1
  2873. 80047334 V0 = True; read TLB entry A0 to A1
  2874. accepts: A0=index, A1=p->target
  2875. call 8004B7E0(A0, A1) # read TLB entry A0 to A1
  2876. return 1
  2877. 80047380 set TLB entries for Aleck hardware
  2878. SP+10 = E0000000 # EntryHi
  2879. SP+14 = 03000007 # EntryLo0
  2880. SP+18 = 03420017 # EntryLo1
  2881. SP+1C = @80067164 # PageMask (0x7FE000)
  2882. call 8004B890(0x10, SP+10) # write TLB entry @A1 to index A0
  2883. SP+10 = E0800000 # EntryHi
  2884. SP+14 = 03020017 # EntryLo0
  2885. SP+18 = 03030017 # EntryLo1
  2886. SP+1C = @80067128 # PageMask (0)
  2887. call 8004B890(0x11, SP+10) # write TLB entry @A1 to index A0
  2888. return True
  2889. 8004742C write Aleck hardware handles to A0
  2890. A0+0 = E0000000
  2891. A0+4 = 0x400000
  2892. A0+8 = E0800000
  2893. A0+C = 0x400
  2894. A0+10= E0400000
  2895. A0+14= 0x4000
  2896. 80047498 initialize 32 TLB entries
  2897. SP+24 = 0x80000
  2898. SP+28 = 0
  2899. SP+2C = 0
  2900. SP+30 = 0
  2901. SP+34 = 0
  2902. SP+38 = 0
  2903. SP+3C = 0
  2904. SP+40 = 1
  2905. SP+44 = 0x20
  2906. SP+14 = (@SP+2C << 6) | (@SP+30 << 3) | (@SP+34 << 2) | (@SP+38 << 1) | @SP+3C
  2907. SP+18 = (@SP+2C << 6) | (@SP+30 << 3) | (@SP+34 << 2) | (@SP+38 << 1) | @SP+3C
  2908. SP+1C = @SP+40 << 0xD
  2909. for i in range(0x20):
  2910. SP+10 = (@SP+24 >> 1) << 0xD
  2911. SP+10 += @SP+28
  2912. call 8004B890(i, SP+10) # write TLB entry @A1 to index A0
  2913. SP+24 += 1
  2914. 800475F0 initialize Aleck overlay (E0400000)
  2915. call 8004742C(SP+20) # write Aleck hardware handles to A0
  2916. base = @SP+30 # E0400000
  2917. base[281E:2820] = 1
  2918. while base[2800:2802] & 0x800:
  2919. pass
  2920. base[2802:2804] = 0x66
  2921. base[2804:2806] = 0x2E0
  2922. base[2806:2808] = 0x2F9
  2923. base[2808:280A] = 0x400
  2924. base[280C:280E] = 0x10
  2925. base[280E:2810] = 0xFF
  2926. base[2810:2812] = 0x105
  2927. base[2812:2814] = 0x3EC
  2928. base[2814:2816] = 0xC
  2929. base[2818:281A] = 0
  2930. base[2818:281A] = 0x10 # Not a typo; same offset as line above.
  2931. base[0x1000:0x2000:2] = repeat(0, 0x800)
  2932. base[2816:2818] = 7
  2933. base[0:0x1000:8] = repeat((0, 0, 0, 0x200), 0x200)
  2934. base[2816:2818] = 6
  2935. 80047810 wait 0x124F ms
  2936. call 80054040(SP+40, SP+58, 8) # create queue A0 with A2 messages at A1
  2937. call 80054F10(SP+20, -, 0, 0x124F, 0, 0, SP+40, 1) # create timer A0 for (A2, A3) from (SP+10, SP+14), writing or jamming (SP+1C) queue SP+18
  2938. call 800541B0(SP+40, SP+78, True) # read or wait (A2) to write message from queue A0 to A1
  2939. 800478A4
  2940. return E0800008[0:2] & 0xF
  2941. 800478E0
  2942. accepts: A0, A1
  2943. if A1 >= 0x10 or A1 in (8, 0xB):
  2944. return -1
  2945. flag = call 8004C4A0(~0x800) # V0 = flags after masking Status with A0
  2946. A0 <<= 2
  2947. E0800100[A0:A0+2] # this read is thrown away
  2948. E0800100[A0:A0+2] = A1
  2949. v = E0800100[A0:A0+2] & 0xFF
  2950. call 8004C4A0(flag) # V0 = flags after masking Status with A0
  2951. return v
  2952. 800479E0
  2953. accepts: A0, A1
  2954. if A1[0] < 0x10 or A1[0] == 0x17:
  2955. v = A1[0] * 0x21
  2956. return 8007B288[v+A0]
  2957. else:
  2958. return -1
  2959. 80047A80 ???, tied to networking; set value A2 in word A0 of E0800100 and bank A0, slot A1
  2960. accepts: A0=bank, A1=slot, A2=value
  2961. 80047CF8
  2962. 80047F2C initialize Aleck networking
  2963. call 80047A80(0, 9, 0xC0)
  2964. 80047F68 ???; something slightly more complicated with networking
  2965. call 80047A80(0, 9, 0xC0)
  2966. call 80047810() # wait 0x124F ms
  2967. ...
  2968. 80048568
  2969. 800485D0
  2970. 800486DC
  2971. 800487E4
  2972. 80048890
  2973. 800488CC
  2974. 80048900
  2975. 80048944 V0 = byte A1 set in network slot A0
  2976. accepts: A0=slot, A1=byte
  2977. A0 <<= 2
  2978. E0800100[A0:A0+2] = A1
  2979. return E0800100[A0:A0+2] & 0xFF
  2980. 800489BC
  2981. accepts: A0=slot, A1=byte, A2=byte
  2982. v = (A0 << 5) + A1
  2983. 8007B288[v] = A2
  2984. A0 <<= 2
  2985. E0800100[A0:A0+2] = A1
  2986. E0800100[A0:A0+2] = A2 # not a typo!
  2987. 80048A54
  2988. 8004987C
  2989. 80049E70
  2990. 8004A16C
  2991. 8004A2DC
  2992. 8004A3C8
  2993. 8004A488
  2994. 8004A890
  2995. accepts: A0
  2996. flag = call 8004C4A0(1) # V0 = flags after masking Status with A0
  2997. v = A0 * 0x60
  2998. if call 800486DC(@8007B2F4+v, SP+18, SP+14):
  2999. call 80053B30(@SP+18, A2, @SP+14) # V0 = p->A2 bytes copied from A0 to A1; fastcopy
  3000. call 80047140(@SP+18) # initialize default aleck memory manager entries for data A0
  3001. A3+0 = @SP+14
  3002. else:
  3003. A3+0 = 0
  3004. SP+20 = 2
  3005. # 8004A94C
  3006. call 8004C4A0(flag) # V0 = flags after masking Status with A0
  3007. A3+0 |= (@8007B2D4+v << 16)
  3008. 8007B2D4+v = 0
  3009. return @SP+20
  3010. 8004A9D8
  3011. 8004AC00
  3012. 8004ACBC
  3013. 8004ADCC
  3014. 8004AE44
  3015.  
  3016. 8004B160 V0 = p->initialized Aleck "ram" at A0, size A1
  3017. accepts: A0=address, A1=size
  3018. # Effectively sets up a memory manager for the 0x400000 bytes at E0000000, returning E0000000.
  3019. A0+30 = 0
  3020. A0+8 = A0
  3021. A0+C = 0
  3022. A0+14 = 0
  3023. A0+20 = 0
  3024. A0+10 = A0+20
  3025. A0+24 = A0+10
  3026. call 8004B21C(A0, A0+38, A1 - 0x38) # create aleck memory manager for A2 bytes at A1 using table A0
  3027. return A0
  3028. 8004B21C create aleck memory manager for A2 bytes at A1 using table A0
  3029. accepts: A0=p->table, A1=p->data, A2=size
  3030. A1+8 = ~A1 # for E0000038: 1FFFFFC7
  3031. A1+0 = @A0+24
  3032. A1+4 = @A0+24
  3033. A1+0 = A1 + 0x20
  3034. A0+24 = A1
  3035. A1+C = A2 >> 4
  3036. call 8004B2DC(A0, A1 + 0x10) # initialize aleck memory manager entries for data A1 using table A0
  3037. 8004B2DC initialize aleck memory manager entries for data A1 using table A0
  3038. accepts: A0=p->table, A1=p->data
  3039. flag = call 8004C4A0(1) # V0 = flags after masking Status with A0
  3040. header = A1 - 0x10
  3041. if @header+8 != ~header:
  3042. call 8004C4A0(flag) # V0 = flags after masking Status with flags A0
  3043. return
  3044. header+8 = 0
  3045. v = @header+4
  3046. v+0 = @header+0
  3047. v = @header+0
  3048. v+4 = @header+4
  3049. # 8004B390
  3050. while True:
  3051. v = @A0+30
  3052. if (v < header) and (header < @v+8):
  3053. break
  3054. if v >= @v+8:
  3055. if (v < header) or (header < @v+8):
  3056. break
  3057. A0+30 = @v+8
  3058. # 8004B42C
  3059. v = header + (@header+C << 4)
  3060. if v == @v+8:
  3061. # 8004B454
  3062. v = @(@A0+30)+8
  3063. header+C += @(@A0+30)+C
  3064. header+8 = v
  3065. else:
  3066. # 8004B490
  3067. header+8 = @(@A0+30)+8
  3068. # 8004B4A0
  3069. v = @A0+30 + @(@A0+30)+C << 4
  3070. if v == header:
  3071. # 8004B4C4
  3072. (@A0+30)+C += @header+C
  3073. (@A0+30)+8 = @header+8
  3074. else:
  3075. # 8004B4F8
  3076. (@A0+30)+8 = header
  3077. # They assign A0+30 to the buffered copy from earlier.
  3078. call 8004C4A0(flag) # V0 = flags after masking Status with flags A0
  3079. 8004B534 allocate entry of size A1 in aleck memory manager A0
  3080. accepts: A0=p->table, A1=size
  3081. 8004B708 V0 = @A0+10
  3082. 8004B73C V0 = @A0+30
  3083. 8004B770 allocate and initialize entry of size A1 in aleck memory manager A0
  3084. accepts: A0=p->table, A1=size
  3085. v = call 8004B534(A0, A1)
  3086. if v:
  3087. call 80053E50(v, A1) # initialize A1 bytes at A0
  3088. return v
  3089. 8004B7E0 read TLB entry A0 to A1
  3090. accepts: A0=index, A1=p->target
  3091. 8004B890 write TLB entry @A1 to index A0
  3092. accepts: A0=index, A1=p->entry (EntryHi, EntryLo0, EntryLo1, PageMask)
  3093. 8004B950 V0 = eeprom type read using SI queue A0 (0:none, 1:4k, 2:8k)
  3094. accepts: A0=p->queue
  3095. call 800548D4() # wait for message on SI lock queue (80120390), creating if necessary
  3096. if not call 80059440(A0, SP+10): # V0 = errors when reading status of eeprom to A1 using SI queue A0
  3097. v = SP[10:12] & 0xC000
  3098. if v == 0x8000:
  3099. return 1
  3100. elif v == 0xC000:
  3101. return 2
  3102. return 0
  3103. 8004B9D0 V0 = errors writing A3 bytes of data A2 to eeprom address A1 using queue A0
  3104. accepts: A0=p->queue, A1=address, A2=p->data, A3=length
  3105. v = 0
  3106. while A3 > 0:
  3107. v = call 80059230(A0, A1 & 0xFF, A2) # V0 = errors when sending SI write eeprom request writing data A2 to address A1 using queue A0
  3108. if v:
  3109. break
  3110. A3 -=8
  3111. A1 += 1
  3112. A2 += 8
  3113. call 80054F10(801130F0, -, 0, 0x89544, 0, 0, 801180F0, 800D26C0) # create timer A0 for (A2, A3) from (SP+10, SP+14), writing or jamming (SP+1C) queue SP+18
  3114. call 800541B0(801180F0, 0, True) # read or wait (A2) to write msg from queue A0 to A1
  3115. return v
  3116. 8004BAC0 V0 = errors reading A3 bytes from eeprom address A1 to A2 using queue A0
  3117. accepts: A0=p->queue, A1=address, A2=p->target, A3=length
  3118. v = 0
  3119. while A3 > 0:
  3120. v = call 80059010(A0, A1 & 0xFF, A2) # V0 = errors when writing result of SI read eeprom request for address A1 to A2 using queue A0
  3121. if v:
  3122. break
  3123. A3 -= 8
  3124. A1 += 1
  3125. A2 += 8
  3126. return v
  3127. 8004BB30 master copy of exception handler jump
  3128. 8004BB40 exception handler
  3129. 8004C490 redirect to 80054A40()
  3130. 8004C4A0 V0 = flags after masking Status with flags A0
  3131. 8004C540 create EPI request thread with priority A0, using queue A1 with A3 msgs at A2
  3132. accepts: A0=priority, A1=p->queue, A2=p->msgs, A3=#msgs
  3133. if @800671F0:
  3134. return
  3135. call 80054040(A1, A2, A3) # create message queue A0 with A2 messages at A1
  3136. call 80054040(8007C4C0, 8007C4D8, 1) # create message queue A0 with A2 messages at A1
  3137. if not @80067230:
  3138. call 8004CEA0() # create and initialize access queue at 800AF7E0
  3139. call 80054410(8, 8007C4C0, 0x22222222) # create callback for event A0, sending msg A2 to queue A1: PI int
  3140. v = call 80054B20(None) # V0 = priority of thread A0 or current thread
  3141. if v < A0:
  3142. call 80054B40(None, A0) # change priority of thread A0 or current thread to A1
  3143. flag = call 800595E0() # disable exceptions; V0 = exceptions flag from Status
  3144. 800671F0+0 = True
  3145. 800671F0+4 = 8007B310
  3146. 800671F0+8 = A1
  3147. 800671F0+C = 8007C4C0
  3148. 800671F0+10 = 800AF7E0
  3149. 800671F0+14 = 80059700
  3150. 800671F0+18 = 8004C6D0
  3151. call 80054970(8007B310, 0, 8004CAE0, 800671F0, 8007C4C0, A0) # create thread A0, ID A1, calling A2(A3) w/ stack at SP+10 and priority SP+14
  3152. call 80054C10(8007B310) # start thread A0
  3153. call 80059650(flag)
  3154. if v < A0:
  3155. call 80054B40(None, v) # change priority of thread A0 or current thread to A1
  3156. 8004C6D0 read or write (A1) SP+10 bytes between hardware A2 and rdram A3 using EPI handle A0; EPI DMA request handler
  3157. accepts: A0=p->EPI handle, A1=mode, A2=hardware offset, A3=p->rdram, SP+10=size
  3158. 8004C8C0 V0 = errors when completing and sending read or write (A2) E/PI request A1 using EPI handle A0
  3159. accepts: A0=p->EPI handle, A1=p->request, A2=mode (0:read, 1:write)
  3160. if not @800671F0:
  3161. return -1
  3162. A1+14 = A0
  3163. A1[0:2] = 0xF + mode
  3164. if A1[2] == 1:
  3165. v = call 800597D0() # V0 = p->E/PI queue if initialized else None
  3166. return call 80054070(v, A1, False)
  3167. else:
  3168. v = call 800597D0() # V0 = p->E/PI queue if initialized else None
  3169. return call 800542E0(v, A1, False) # send or jam (A2) msg A1 to queue A0
  3170. 8004C960 V0 = p->EPI handle for cart, creating if necessary
  3171. call 8004CEF4()
  3172. if @80067220:
  3173. 80067220 = 0
  3174. 800AEED8[4] = 0
  3175. 800AEED8+C = B0000000
  3176. 800AEED8[9] = 0
  3177. 800AEED8[10] = 0
  3178. call 80053E50(800AEEDC+10, 0x60) # initialize A1 bytes at A0
  3179. while @A4600010 & 3:
  3180. pass
  3181. org = @A4600014, @A4600018, @A460001C, @A4600020
  3182. v = @800AEED8+C | A0000000
  3183. A4600014 = 0xFF
  3184. A4600018 = 0xFF
  3185. A460001C = 0
  3186. A4600020 = 3
  3187. v = @v+0
  3188. A4600014, A4600018, A460001C, A4600020 = *org
  3189. 800AEED8[6] = (v >> 16) & 0xF
  3190. 800AEED8[5] = v & 0xFF
  3191. 800AEED8[7] = (v >> 20) & 0xF (v >> 8) & 0xF
  3192. 800AEED8[8] = (v >> 8) & 0xFF
  3193. v = call 800595E0() # disable exceptions; V0 = exceptions flag from Status
  3194. 800AEED8+0 = @8006720C
  3195. 8006720C = 800AEED8
  3196. call 80059650(v) # Status |= A0
  3197. return 800AEED8
  3198. 8004CAE0 Thread: E/PI request handler
  3199. accepts: A0=epi struct @ 800671F0
  3200.  
  3201. 8004CEA0 create and initialize access queue at 800AF7E0
  3202. 80067230 = 1
  3203. call 80054040(800AF7E0, 8007C4E0, 1)
  3204. call 800542E0(800AF7E0, 0, False)
  3205. 8004CEF4
  3206.  
  3207.  
  3208.  
  3209. 8005095C
  3210. accepts: A0, A1
  3211. A0+4 = A1
  3212. A0+0 = @A1+0
  3213. v = @A1+0
  3214. if v:
  3215. v+4 = A0
  3216. A1+0 = A0
  3217. 8005097C
  3218. accepts: A0
  3219. v = @A0+0
  3220. if v:
  3221. v+4 = @A0+4
  3222. v = @A0+4
  3223. if v:
  3224. v+0 = @A0+0
  3225. 800509B0 set allocation table A0 for A2 bytes at A1
  3226. accepts: A0=p->allocation table, A1=p->rdram, A2=size
  3227. v = A1 & 0xF
  3228. v = 0x10 - v
  3229. A0+0 = A1 if v == 0x10 else A1+v
  3230. A0+4 = @A0+0
  3231. A0+8 = A2
  3232. A0+C = 0
  3233. 800509F0 V0 = p->count SP+10 blocks of size A3 allocated from table A2
  3234. accepts: A0=(unused), A1=(unused), A2=p->allocation table, A3=size, SP+10=count
  3235. v = @SP+10 * A3
  3236. v += 0xF
  3237. v &= ~0xF
  3238. k = @A2+8 + @A2+0 # end of allocation
  3239. i = @A2+4 # start of block
  3240. v += @A2+4 # end of block
  3241. if k < v:
  3242. return None
  3243. A2+4 = v
  3244. return i
  3245. 80050A40 copy A2 bytes from A0 to A1
  3246. 80050A80
  3247. 80050B8C
  3248. 80050C80
  3249. accepts: A0, A1=p->target
  3250. if not @A0+4:
  3251. return 0
  3252. v = -1
  3253. for i in range(0x10):
  3254. if not (@A0+4 >> i) & 1:
  3255. continue
  3256. if @A0+14:
  3257. A0+B8+(i<<2) -= @A0+10
  3258. if @A0+B8+(i<<2) >= v:
  3259. v = @A0+B8+(i<<2)
  3260. A0+14 = 0
  3261. A1+0 = v
  3262. return 1
  3263. 80050D00
  3264. 80050F70
  3265. 80050FEC
  3266. 8005108C V0 = @A0+C
  3267. 80051094
  3268.  
  3269. 80051B28
  3270. 80051B90
  3271. 80051C30
  3272.  
  3273. 80051DC0 (check this one!) invalidate 0x2000 of data cache at 80000000
  3274. 80051DF0 send pifram status requests, informing queue A0
  3275. accepts: A0=p->queue
  3276. call 800548D4() # wait for message on SI lock queue (80120390), creating if necessary
  3277. if 800D26BC[0]: # write Status requests if not already in the buffer
  3278. call 800522C0(0) # fill buffer 8007DAF0 with SI status or reset (A0) commands
  3279. call 800547D0(1, 8007DAF0) # read or write (A0) between rdram A1 and pifram
  3280. call 800541B0(A0, 0, True) # read or wait (A2) to write msg from queue A0 to A1
  3281. # 80051E3C
  3282. v = call 800547D0(0, 8007DAF0) # read or write (A0) between rdram A1 and pifram
  3283. 800D26BC[0] = 0
  3284. call 80054940() # send message 0 to queue 80120390: SI lock queue
  3285. return v
  3286. 80051E70 copy result of SI status request to A0; calls 8005220C
  3287. accepts: A0
  3288. call 8005220C(SP+10, A0)
  3289. 80051E90 send pifram read requests, informing queue A0
  3290. accepts: A0=p->queue
  3291. call 800548D4() # wait for message on SI lock queue (80120390), creating if necessary
  3292. if 800D26BC[0] != 1:
  3293. call 80051FB4() # fill buffer 8007DAF0 with SI read request commands
  3294. call 800547D0(1, 8007DAF0) # read or write (A0) between rdram A1 and pifram
  3295. call 800541B0(A0, 0, True) # read or wait (A2) to write msg from queue A0 to A1
  3296. v = call 800547D0(0, 8007DAF0) # read or write (A0) between rdram A1 and pifram
  3297. 800D26BC[0] = 1
  3298. call 80054940() # send message 0 to queue 80120390: SI lock queue
  3299. 80051F18 copy result of SI read request to A0
  3300. 80051FB4 fill buffer 8007DAF0 with SI read request commands
  3301. 80052070 initialize and read controller status to A1, presence flags to A2, informing queue A0
  3302. accepts: A0=p->queue, A1=p->target for status, A2=p->target for controller presence flags
  3303. 8005220C copy result of SI status request to A1, setting presence flags to A0
  3304. accepts: A0=p->flags, A1=p->results
  3305. 800522C0 fill buffer 8007DAF0 with SI status or reset (A0) commands
  3306. 80052380 V0 = physical address for A0
  3307. 800523E0 F0 = square root of float F12
  3308. 800523F0
  3309. 800525A0
  3310.  
  3311. 80053B30 V0 = p->A2 bytes copied from A0 to A1; fastcopy
  3312. 80053E50 initialize A1 bytes at A0
  3313. 80053EF0 V0 = p->char A1 in string A0 or None
  3314. accepts: A0=p->string, A1=char
  3315. 80053F30 V0 = p->end fo string A0
  3316. 80053F54 copy A2 bytes from A1 to A0
  3317. accepts: A0=p->target, A1=p->source, A2=count
  3318. 80053F80 V0 = p->C-string A1 expanded and Null-terminated to A0
  3319. accepts: A0=p->target, A1=p->src, ...
  3320. v = call 80059DD0(80053FD8, A0, A1, p->args) # expand C-string A2 to A1 using function A0 and p->args A3
  3321. if v >= 0:
  3322. A0[v] = 0
  3323. return v
  3324. 80053FD8 V0 = p->end of A2 bytes copied from A1 to A0
  3325. call 80053F54(A0, A1, A2) # copy A2 bytes from A1 to A0
  3326. return A0+A2
  3327. 80054010 unconditional return
  3328. 80054018 NERFed! print debug message A0; stores arguments to stack
  3329. 8005402C NERFed!; stores arguments to stack
  3330. 80054040 create message queue A0 with A2 messages at A1
  3331. 80054070
  3332. 800541B0 read or wait (A2) to write msg from queue A0 to A1
  3333. 800542E0 send or jam (A2) msg A1 to queue A0
  3334. 80054410 create callback for event A0, sending msg A2 to queue A1
  3335. accepts: A0=event index, A1=p->queue, A2=message
  3336. flag = call 800595E0()
  3337. v = 801175A0 + (A0 << 3)
  3338. v+0 = A1
  3339. v+4 = A2
  3340. if A0 == 0xE:
  3341. if @8006881C and not @80067550:
  3342. call 800542E0(A1, A2, False) # send or jam (A2) msg A1 to queue A0
  3343. 80067550+0 = 1
  3344. call 80059650(flag)
  3345. 800544C0 A410000C = A0; set DP Status to A0
  3346. 800544D0
  3347.  
  3348. 800547D0 read or write (A0) between rdram A1 and pifram
  3349. 80054880 create and initialize queue at 80120390: SI lock queue
  3350. call 80054040(80120390, 8007C550, 1) # create message queue A0 with A2 messages at A1
  3351. call 800542E0(80120390, 0, False) # send or jam (A2) msg A1 to queue A0
  3352. 800548D4 wait for message on SI lock queue (80120390), creating if necessary
  3353. if not @80067580:
  3354. 80067560 = 1
  3355. call 80054040(80120390, 8007C550, 1) # create message queue A0 with A2 messages at A1
  3356. call 800542E0(80120390, 0, False) # send or jam (A2) msg A1 to queue A0
  3357. call 800541B0(80120390, SP+10, True) # read or wait (A2) to write message from queue A0 to A1
  3358. 80054940 send message 0 to queue 80120390: SI lock queue
  3359. call 800542E0(80120390, 0, False) # send or jam (A2) msg A1 to queue A0
  3360. 80054970 create thread A0, ID A1, calling A2(A3) w/ stack at SP+10 and priority SP+14
  3361. accepts: A0=p->thread, A1=ID, A2=p->function, A3=arg, SP+10=p->SP, SP+14=priority
  3362. 80054A40
  3363.  
  3364. 80054B20 V0 = priority of thread A0 or current thread
  3365. accepts: A0=p->thread or None
  3366. 80054B40 change priority of thread A0 or current thread to A1
  3367. accepts: A0=p->thread or None, A1=priority
  3368. 80054C10 start thread A0
  3369. 80054D30
  3370. flag = call 800595E0() # disable exceptions; V0 = exceptions flag from Status
  3371. v = 4 if not A0 else A0[10:12]
  3372. if v == 2:
  3373. # 80054DB4
  3374. A0[10:12] = 1
  3375. call 80054DF0(@A0+8, A0)
  3376. elif v in (4, 8):
  3377. # 80054D94
  3378. v = @80067580
  3379. v[10:12] = 1
  3380. call 8004C1AC(0)
  3381. call 80059650(flag) # Status |= A0
  3382. 80054DF0
  3383. v = @A0+0
  3384. while v:
  3385. if v == A1:
  3386. A0+0 = @v+0
  3387. return
  3388. A0 = v
  3389. v = @A0+0
  3390. 80054E30
  3391. flag = call 800595E0() # disable exceptions; V0 = exceptions flag from Status
  3392. v = @80067580
  3393. v[10:12] = 2
  3394. call 8004C1AC(80067578)
  3395. call 80059650(flag) # Status |= A0
  3396. 80054E80 V0, V1 = Count plus timer base (@800AEE70, @800AEE78)
  3397. flag = call 800595E0() # disable exceptions; V0 = exceptions flag from Status
  3398. v = call 8005A830() # V0 = Count
  3399. v -= @8007D914
  3400. call 80059650(flag) # Status |= A0
  3401. l = v + @800AEE74
  3402. u = @800AEE70 + (u < v)
  3403. 80054F10 create timer A0 for (A2, A3) from (SP+10, SP+14), writing or jamming (SP+1C) queue SP+18
  3404. accepts: A0=p->timer, A1=(not used), (A2, A3)=end, (SP+10, SP+14)=start, SP+18=p->queue, SP+1C=mode (0:write, 1:jam)
  3405. 80055040
  3406. v = @80067590
  3407. 800AEE70 = 0
  3408. 800AEE74 = 0
  3409. 8007D914 = 0
  3410. v+0 = v
  3411. v+4 = v
  3412. v+8 = 0
  3413. v+C = 0
  3414. v+10 = 0
  3415. v+14 = 0
  3416. v+18 = 0
  3417. v+1C = 0
  3418. 80055094
  3419.  
  3420. 80055420 V0 = ???; @frame manager+4
  3421. flag = call 800595E0() # disable exceptions; V0 = exceptions flag from Status
  3422. v = @800688E0
  3423. call 80059650(flag) # Status |= A0
  3424. return @v+4
  3425. 80055460 V0 = ???; @VI manager struct+4
  3426. flag = call 800595E0() # disable exceptions; V0 = exceptions flag from Status
  3427. v = @800688E4
  3428. call 80059650(flag) # Status |= A0
  3429. return @v+4
  3430. 800554A0 @A4400010
  3431. 800554B0 create and start VI thread with priority A0
  3432. accepts: A0=priority
  3433. if @800675A0:
  3434. return
  3435. call 80055040()
  3436. 800675BC = 0
  3437. call 80054040(8007D720, 8007D738, 5) # create message queue A0 with A2 messages at A1
  3438. 8007D750[0:2] = 0xD
  3439. 8007D750[2] = 0
  3440. 8007D750+4 = 0
  3441. 8007D768[0:2] = 0xE
  3442. 8007D768[2] = 0
  3443. 8007D768+4 = 0
  3444. call 80054410(7, 8007D720, 8007D750) # create callback for event A0, sending msg A2 to queue A1: vertical retrace
  3445. call 80054410(3, 8007D720, 8007D768) # create callback for event A0, sending msg A2 to queue A1: counter
  3446. v = call 80054B20(None) # V0 = priority of thread A0 or current thread
  3447. if v < A0:
  3448. call 80054B40(None, A0) # change priority of thread A0 or current thread to A1
  3449. flag = call 800595E0() # disable exceptions; V0 = exceptions flag from Status
  3450. 800675A0+0 = 1
  3451. 800675A0+4 = 8007C568
  3452. 800675A0+8 = 8007D720
  3453. 800675A0+C = 8007D720
  3454. 800675A0+10 = 0
  3455. 800675A0+14 = 0
  3456. 800675A0+18 = 0
  3457. call 80054970(8007C568, 0, 80055650, 800675A0, 8007D720, A0) # create thread A0, ID A1, calling A2(A3) w/ stack at SP+10 and priority SP+14: VI
  3458. call 8005ABD0() # initialize VI frame managers
  3459. call 80054C10(8007C568) # start thread A0
  3460. call 80059650(flag) # Status |= A0
  3461. if v < A0:
  3462. call 80054B40(None, v) # change priority of thread A0 or current thread to A1
  3463. 80055650 Thread: VI
  3464. accepts: A0
  3465. 800557F0 set VI interrupt callback to queue A0, msg A1, mode A2
  3466. accepts: A0=p->queue, A1=value, A2=mode
  3467. flag = call 800595E0() # disable exceptions; V0 = exceptions flag from Status
  3468. v = @800688E4
  3469. v+10 = A0
  3470. v+14 = A1
  3471. v[2:4] = A2
  3472. call 80059650(flag) # Status |= A0
  3473. 80055850 use VI settings at A0
  3474. accepts: A0=p->VI settings
  3475. flag = call 800595E0() # disable exceptions; V0 = exceptions flag from Status
  3476. v = @800688E4
  3477. v+8 = A0
  3478. v[0:2] = 1
  3479. v+C = @A0+4
  3480. call 80059650(flag) # Status |= A0
  3481. 800558A0 set VI manager settings based on flags A0
  3482. accepts: A0=flags
  3483. flag = call 800595E0() # disable exceptions; V0 = exceptions flag from Status
  3484. v = @800688E4
  3485. if A0 & 1:
  3486. v+C |= 8
  3487. if A0 & 2:
  3488. v+C &= ~8
  3489. if A0 & 4:
  3490. v+C |= 4
  3491. if A0 & 8:
  3492. v+C &= ~4
  3493. if A0 & 0x10:
  3494. v+C |= 0x10
  3495. if A0 & 0x20:
  3496. v+C &= ~0x10
  3497. if A0 & 0x40:
  3498. v+C |= 0x10000
  3499. v+C &= ~0x300
  3500. if A0 & 0x80:
  3501. v+C &= ~0x10000
  3502. v+C |= @(@v+8)+4 & 0x300
  3503. v[0:2] |= 8
  3504. call 80059650(flag) # Status |= A0
  3505. 80055A10 set VI Y scale to F12
  3506. accepts: F12
  3507. flag = call 800595E0() # disable exceptions; V0 = exceptions flag from Status
  3508. v = @800688E4
  3509. v[0:2] |= 4
  3510. v+24 = F12
  3511. call 80059650(flag) # Status |= A0
  3512. 80055A60
  3513. accepts: A0
  3514. flag = call 800595E0() # disable exceptions; V0 = exceptions flag from Status
  3515. v = @800688E4
  3516. v[0:2] |= 0x10
  3517. v+4 = A0
  3518. call 80059650(flag) # Status |= A0
  3519. 80055AB0
  3520. 80055DC0 blackout screen if A0
  3521. accepts: A0=mode
  3522. flag = call 800595E0() # disable exceptions; V0 = exceptions flag from Status
  3523. v = @800688E4
  3524. if mode & 0xFF:
  3525. v[0:2] |= 0x20
  3526. else:
  3527. v[0:2] &= ~0x20
  3528. call 80059650(flag) # Status |= A0
  3529. 80055E20
  3530. 80055E80
  3531.  
  3532. 800576B0
  3533. accepts: A0=p->ctrl handle, A1, A2
  3534. if not @A0 & 1:
  3535. return 5
  3536. v = call 800583F4(A0) # V0 = error reading mempak using controller handle A0
  3537. if v:
  3538. return v
  3539. if A0[65]:
  3540. v = call 80057CF0(A0, 0) # V0 = errors writing block of A1 to slot addr 0x400 using controller handle A0
  3541. if v:
  3542. return v
  3543. # 80057728
  3544. j = 0
  3545. for i in range(@A0+50):
  3546. v = call 800587F0(@A0+4, @A0+8, @A0+5C + i, SP+10) # V0 = errors reading 0x20 block of data from slot A1, address A2, to A3, informing queue A0
  3547. if v:
  3548. return v
  3549. if SP[14:16]:
  3550. j += 0 < @SP+10
  3551. A2 = j
  3552. A1+0 = @A0+50
  3553. return call 80057AE0(@A0+4, @A0+8)
  3554. 800577B0
  3555.  
  3556. 80057AE0
  3557. 80057BD0
  3558.  
  3559. 80057CF0 V0 = errors writing block of A1 to slot addr 0x400 using controller handle A0
  3560. accepts: A0=p->ctrl handle, A1=value
  3561. SP[18:38] = repeat(A1, 0x20)
  3562. if not call 800589E0(@A0+4, @A0+8, 0x400, SP+18): # V0 = errors writing 0x20 block of data A3 to slot A1, address A2, informing queue A0
  3563. A0[65] = A1
  3564. 80057D60
  3565.  
  3566. 800583F4 V0 = error reading mempak using controller handle A0
  3567. accepts: A0=p->ctrl handle
  3568. if not A0[65]:
  3569. v = call 80057CF0(A0, 0) # V0 = errors writing block of A1 to slot addr 0x400 using controller handle A0
  3570. if v == 2:
  3571. v = call 80057CF0(A0, 0) # V0 = errors writing block of A1 to slot addr 0x400 using controller handle A0
  3572. if v:
  3573. return v
  3574. v = call 800587F0(@A0+4, @A0+8, 1, SP+10) # V0 = errors reading 0x20 block of data from slot A1, address A2, to A3, informing queue A0
  3575. if v == 2:
  3576. v = call 800587F0(@A0+4, @A0+8, 1, SP+10) # V0 = errors reading 0x20 block of data from slot A1, address A2, to A3, informing queue A0
  3577. if v:
  3578. return v
  3579. v = 0 < call 80059CC0(A0+C, SP+10, 0x20) # V0 = False if A2 bytes of data A0 and A1 match else True
  3580. return v << 1
  3581. 800584AC
  3582.  
  3583. 800587F0 V0 = errors reading 0x20 block of data from slot A1, address A2, to A3, informing queue A0
  3584. accepts: A0=p->queue, A1=slot, A2=address, A3=p->data
  3585. 800589E0 V0 = errors writing 0x20 block of data A3 to slot A1, address A2, informing queue A0
  3586. accepts: A0=p->queue, A1=slot, A2=address, A3=p->data
  3587. 80058BF0 no code until 80058C50
  3588. 80058C50 call 8005A8D0(0)
  3589. 80058C70 create default EPI handles at 800AF9E4 and 800ADB34
  3590. 80058D28 initialize system
  3591. 80117628 = 1
  3592. v = call 8005A840() # V0 = Status
  3593. call 8005A870(0x20000000 | v) # Status = A0
  3594. call 8005A860(0x1000800) # V0 = COP1 Control; COP1 Control = A0
  3595. call 8005A880(0x4900000) # WatchLo = A0: A4900000
  3596. while call 8005A990(1FC007FC, SP+10): # V0 = success of reading word from PIFram offset A0 to A1
  3597. pass
  3598. while call 8005A9E0(1FC007FC, @SP+10 + 8) # V0 = success of writing word A1 to PIFram offset A0
  3599. pass
  3600. 80000000[0:10] = 8004BB30[0:10]
  3601. 80000080[0:10] = 8004BB30[0:10]
  3602. 80000100[0:10] = 8004BB30[0:10]
  3603. 80000180[0:10] = 8004BB30[0:10]
  3604. call 80051D40(80000000, 0x190)
  3605. call 80059AF0(80000000, 0x190)
  3606. # create default EPI handles
  3607. 800AF9E4[0] = 7
  3608. 800AF9E4[1] = @A4600014 # PI Domain 0 Latency
  3609. 800AF9E4[2] = @A460001C # PI Domain 0 Page Size
  3610. 800AF9E4[3] = @A4600020 # PI Domain 0 Release
  3611. 800AF9E4[4] = @A4600018 # PI Domain 0 Pulse Width
  3612. 800ADB34[0] = 7
  3613. 800ADB34[1] = @A4600024 # PI Domain 1 Latency
  3614. 800ADB34[2] = @A460002C # PI Domain 1 Page Size
  3615. 800ADB34[3] = @A4600030 # PI Domain 1 Release
  3616. 800ADB34[4] = @A4600028 # PI Domain 1 Pulse Width
  3617. call 8005AB80() # initialize TLB entries 0-1E
  3618. call 8005AB20() # write TLB entry to index 0x1F mapping 0x1000 @ 80000000 to C0000000
  3619. u, l = @80068810, @80068814
  3620. u <<= 1
  3621. u |= l >> 0x1F
  3622. l *= 3
  3623. l += u < 0
  3624. 80068810, 80068814 = call 8005CB70(u, l, 0, 4) # V0, V1 = (A0, A1) DDIVU (A2, A3)
  3625. if not @8000030C: # reinit NMI buffer on cold boot
  3626. call 80053E50(8000031C, 0x40) # initialize A1 bytes at A0
  3627. if @80000300 == 0: # PAL
  3628. 80068818 = 0x2F5B2D2
  3629. elif @80000300 == 2: # MPAL
  3630. 80068818 = 0x2E6025C
  3631. else: # NTSC
  3632. 80068818 = 0x2E6D354
  3633. v = call 8005A820() # V0 = Cause
  3634. if v & 0x1000:
  3635. while True:
  3636. pass
  3637. A4500008 = 1
  3638. A4500010 = 0x3FFF
  3639. A4500014 = 0xF
  3640. 80059000 unconditional return
  3641. 80059010 V0 = errors when writing result of SI read eeprom request for address A1 to A2 using queue A0
  3642. accepts: A0=p->queue, A1=address, A2=p->target
  3643. call 800548D4() # wait for message on SI lock queue (80120390), creating if necessary
  3644. i = call 80059440(A0, SP+10) # V0 = errors when reading status of eeprom to A1 using SI queue A0
  3645. if i:
  3646. call 80054940()
  3647. return i
  3648. v = SP[10:12] & 0xC000
  3649. if (v == 0x8000) and (A2 >= 0x40):
  3650. i = -1
  3651. elif v != 0xC000:
  3652. i = 8
  3653. if i:
  3654. call 80054940()
  3655. return i
  3656. while SP[12] & 0x80:
  3657. call 80059440(A0, SP+10) # V0 = errors when reading status of eeprom to A1 using SI queue A0
  3658. call 800591A8(A1) # fill buffer 8008F7A0 with SI read eeprom request command for address A0
  3659. call 800547D0(1, 800AF7D0) # read or write (A0) between rdram A1 and pifram
  3660. call 800541B0(A0, 0, True) # read or wait (A2) to write message from queue A0 to A1
  3661. call 800547D0(0, 800AF7D0) # read or write (A0) between rdram A1 and pifram
  3662. 800D26BC[0] = 4
  3663. call 800541B0(A0, 0, True) # read or wait (A2) to write message from queue A0 to A1
  3664. # for j in range(4): 800AF7A0+=1 # ignore controller channels
  3665. SP[18:24] = 800AF7A0[4:10]
  3666. i = (800AF7A0[5] & 0xC0) >> 4
  3667. A2[0:8] = SP[1C:24]
  3668. call 80054940()
  3669. return i
  3670. 800591A8 fill buffer 8008F7A0 with SI read eeprom request command for address A0
  3671. accepts: A0=address
  3672. 80059230 V0 = errors when sending SI write eeprom request writing data A2 to address A1 using queue A0
  3673. accepts: A0=p->queue, A1=address, A2=p->data
  3674. call 800548D4() # wait for message on SI lock queue (80120390), creating if necessary
  3675. i = call 80059440(A0, SP+20) # V0 = errors when reading status of eeprom to A1 using SI queue A0
  3676. if i:
  3677. call 80054940()
  3678. return i
  3679. v = SP[20:22] & 0xC000
  3680. if (v == 0x8000) and (A2 >= 0x40):
  3681. i = -1
  3682. elif v != 0xC000:
  3683. i = 8
  3684. if i:
  3685. call 80054940()
  3686. return i
  3687. while SP[12] & 0x80:
  3688. call 80059440(A0, SP+20) # V0 = errors when reading status of eeprom to A1 using SI queue A0
  3689. call 80059398(A1, A2) # fill buffer 8008F7A0 with SI write eeprom request command for address A0, data A1
  3690. call 800547D0(1, 800AF7D0) # read or write (A0) between rdram A1 and pifram
  3691. call 800541B0(A0, 0, True) # read or wait (A2) to write message from queue A0 to A1
  3692. call 800547D0(0, 800AF7D0) # read or write (A0) between rdram A1 and pifram
  3693. 800D26BC[0] = 5
  3694. call 800541B0(A0, 0, True) # read or wait (A2) to write message from queue A0 to A1
  3695. SP[10:1C] = 800AF7A0[4:10]
  3696. i = (800AF7A0[5] & 0xC0) >> 4
  3697. call 80054940()
  3698. return i
  3699. 80059398 fill buffer 8008F7A0 with SI write eeprom request command for address A0, data A1
  3700. accepts: A0=address, A1=p->data
  3701. 80059440 V0 = errors when reading status of eeprom to A1 using SI queue A0
  3702. accepts: A0=p->queue, A1=p->target
  3703. 800595E0 disable exceptions; V0 = exceptions flag from Status
  3704. 80059650 Status |= A0
  3705. 80059670
  3706. v = call 800595E0()
  3707. 80068820+0 |= A0
  3708. call 80059650(v)
  3709. 800596B0
  3710. v = call 800595E0()
  3711. 80068820+0 &= (~A0 | 0x401)
  3712. call 80059650(v)
  3713. 80059700 read or write (A0) A3 bytes between boot device offset A1 and rdram A2; PI DMA request handler
  3714. accepts: A0=mode (0:read, 1:write), A1=hardware address, A2=p->rdram, A3=length
  3715. 800597D0 V0 = p->E/PI queue if initialized else None
  3716. 800597F0 V0 = errors when reading word from uncached hardware address A1 to rdram A2 using EPI handle A0
  3717. accepts: A0=p->EPI handle, A1=hardware offset, A2=p->target
  3718. 80059960 V0 = errors when writing word A2 to uncached hardware address A1 using EPI handle A0
  3719. accepts: A0=p->EPI handle, A1=hardware offset, A2=value
  3720. 80059AD0
  3721.  
  3722. 80059CC0 V0 = False if A2 bytes of data A0 and A1 match else True
  3723. accepts: A0=p->data1, A1=p->data2, A2=length
  3724. 80059DD0 expand C-string A2 to A1 using function A0 and p->args A3
  3725. accepts: A0=p->function, A1=p->target, A2=p->source, A3=p->args
  3726. 8005A350
  3727. 8005A820 V0 = Cause
  3728. 8005A830 V0 = Count
  3729. 8005A840 V0 = Status
  3730. 8005A850 Compare = A0
  3731. 8005A860 V0 = COP1 Control; COP1 Control = A0
  3732. 8005A870 Status = A0
  3733. 8005A880 WatchLo = A0
  3734. 8005A890
  3735. return bool(@A4040010 & 0x1C)
  3736. 8005A8B0 V0 = @A4040010
  3737. 8005A8C0 A4040010 = A0
  3738. 8005A8D0
  3739. if not @A4040010 & 1:
  3740. return -1
  3741. A4080000 = A0
  3742. return 0
  3743. 8005A900 SP DMA: V0 = success of reading or writing (A0) A3 bytes between SP address A1 and rdram A2
  3744. accepts: A0=mode (0:write, 1:read), A1=SP address, A2=p->rdram, A3=length
  3745. if call 8005A890():
  3746. return -1
  3747. A4040000 = A1
  3748. A4040004 = call 80052380(A2) # V0 = physical address for A0
  3749. if not A0:
  3750. A404000C = A3
  3751. else:
  3752. A4040008 = A3
  3753. return 0
  3754. 8005A990 V0 = success of reading word from PIFram offset A0 to A1
  3755. 8005A9E0 V0 = success of writing word A1 to PIFram offset A0
  3756. 8005AA30
  3757. 8005AA9C
  3758. 8005AB20 write TLB entry to index 0x1F mapping 0x1000 @ 80000000 to C0000000
  3759. 8005AB80 initialize TLB entries 0-1E
  3760. 8005ABD0 initialize VI frame managers
  3761. 8005ACE0 V0 = @800688E0: p->current frame manager
  3762. 8005AD00
  3763.  
  3764. 8005C440 V0 = True if SI busy else False
  3765. 8005C460
  3766.  
  3767. 8005C620 V0=p->A2 bytes at A0 filled with value A1
  3768. accepts: A0=p->target, A1=value, A2=length
  3769. 8005C6C0 V0=p->A1 bytes at A0 filled with value A2; call 8005C620(A0, A2, A1)
  3770. accepts: A0=p->target, A1=length, A2=value
  3771. 8005C6F0
  3772. v = @8007D880 * 0x41C64E6D
  3773. 8007D880 = v + 0x3039
  3774. v += 0x303A
  3775. return (v >> 16) & 0x7FFF
  3776. 8005C724 8007D880 = A0
  3777. 8005C730 V0 = p->string A0 copied from A1
  3778. accepts: A0=p->target, A1=p->src
  3779. 8005C804
  3780. 8005C838 (not sure if these are independant or part of 8005CB70)
  3781. 8005C934 (not sure if these are independant or part of 8005CB70)
  3782. 8005CAB0 (not sure if these are independant or part of 8005CB70)
  3783. 8005CB70 V0, V1 = (A0, A1) DDIVU (A2, A3)
  3784. 8005CB90
  3785. 8005CBD0
  3786. 8005CCF0
  3787. 8005CDF0 RSP instructions
  3788.  
  3789. 8005DA50 RSP instructions; 0xD0
  3790. 8005DB20 code for microcode F3DEX fifo 2.08; 0x1190
  3791. 8005EEB0 code for microcode L3DEX fifo 2.08; 0x1190
  3792. 80060040 code for microcode F3DEX.Rej fifo 2.08; 0x1190
  3793. 800611D0 code for microcode F3DEX.NoN fifo 2.08
  3794.  
  3795. 80062560 code for microcode F3DLX.Rej fifo 2.08; 0x1190
  3796. 800636F0 code for microcode S2DEX fifo 2.08
  3797.  
  3798. 80064FB0 screen flags
  3799.  
  3800. 80064FBC screen width
  3801. 80064FC0 screen height
  3802.  
  3803. 800667BC pointers to strings "Slot", "In", "Coin", "PLAY"
  3804. 800667CC
  3805.  
  3806. 80066994 char mapping table for ASCII
  3807. 80066A14
  3808.  
  3809. 80066B94 NuSys library version "NuSystem2.07"
  3810. 80066BA4
  3811.  
  3812. 80066BC0 number of framebuffers
  3813. 80066BC4 fifo size
  3814. 80066BC8 p->fifo buffer
  3815. 80066BCC p->function
  3816. 80066BD0 p->function
  3817.  
  3818. 80066BE0 microcode table; p->code, p->data
  3819. 8005DB20 80068C70 F3DEX fifo 2.08
  3820. 800611D0 80069890 F3DEX.NoN fifo 2.08
  3821. 80060040 80069480 F3DEX.Rej fifo 2.08
  3822. 80062560 80069CB0 F3DLX.Rej fifo 2.08
  3823. 8005EEB0 80069090 L3DEX fifo 2.08
  3824. 800636F0 8006A0C0 S2DEX fifo 2.08
  3825. 80066C10 p->framebuffers
  3826. 80066C20 display list
  3827. 80066D10
  3828.  
  3829. 80066D18 function pointers: SI callback for controller pak
  3830. 00000000 8003CD10 8003CD9C 8003CE98 8003CE04 8003CFA0 8003D028 8003D09C 8003D110
  3831. 80066D40 SI callback for controller pak; function pointers at 80066D18
  3832. 80066D4C
  3833. 80066D50
  3834. 80066D54 function pointers
  3835. 8003D5B0 8003D858 8003DA60 8003DB50 8003D8EC 8003D9B8
  3836. 80066D70 SI callback for ???; function pointers at 80066D54
  3837. 80066D7C
  3838. 80066D80 function pointers: SI callback for eeprom
  3839. 00000000 8003DD78 8003DDC4 8003DE38
  3840. 80066D94 SI callback for eeprom; function pointers at 80066D80
  3841. 80066DA0 p->function (processes display lists?)
  3842. 80066DA4 p->function
  3843.  
  3844. 80066DC0 p->function; run after reading controller input
  3845. 80066DC4 function pointers: SI callback for controller input
  3846. 8003EC64 8003ED28 8003ED78 8003EBD8
  3847. 80066DD8 SI callback for controller input; uses pointers at 80066DC4
  3848. 80066DE4
  3849.  
  3850. 80066E5C p->function
  3851. 80066E60 p->function
  3852.  
  3853. 800671F0 device manager struct
  3854. 8006721C
  3855. 80067220 False if cart EPI handle generated
  3856.  
  3857. 80067580 p->current thread
  3858.  
  3859. 800675C0 VI settings table
  3860. 800687E0
  3861.  
  3862. 80068810 clock rate
  3863. 80068818 VI refresh rate (from detected region)
  3864. 8006881C
  3865.  
  3866. 800688E0 p->current frame manager
  3867. 800688E4 p->VI manager struct
  3868.  
  3869. 80068C70 data for microcode F3DEX fifo 2.08
  3870.  
  3871. 80069890 data for microcode F3DEX.NoN fifo 2.08
  3872.  
  3873. 80069480 data for microcode F3DEX.Rej fifo 2.08
  3874.  
  3875. 80069CB0 data for microcode F3DLX.Rej fifo 2.08
  3876.  
  3877. 80069090 data for microcode L3DEX fifo 2.08
  3878.  
  3879. 8006A0C0 data for microcode S2DEX fifo 2.08
  3880.  
  3881. 8006A518 function pointers for 80029870
  3882. 800298B0 800298B0 80029AD4 800299A8 80029ACC 80029AD4 80029AD4
  3883. 8006A538 function pointers
  3884. 80029B28 80029B28 80029C64 80029B80 80029C5C 80029C64 80029C64
  3885. 8006A558 == EEPROM ERROR == NOT INIT != 0 \n
  3886. 8006A580 == EEPROM ERROR == NOT INIT != 0xFF \n
  3887. 8006A5A8 error mode No=%d\n
  3888. 8006A5C0 function pointers
  3889. 8002AA2C 8002AAE0 8002AFCC 8002AE78 8002B024 8002B248 8002B280 8002B2B8
  3890. 8006A5E0 NO-G
  3891. 8006A5E5 REP
  3892. 8006A5EA BIG
  3893. 8006A5EF
  3894. 8006A5F4 REP
  3895. 8006A600 function pointers
  3896. 8002BF6C 8002BF94 8002C068 8002C114 8002C134
  3897. 8006A614 BIG
  3898. 8006A620 function pointers
  3899. 8002C314 8002C390 8002C3B8 8002C480 8002C4A0
  3900. 8006A634
  3901. 8006A640 function pointers
  3902. 8002C734 8002C75C 8002C784 8002C84C 8002C86C
  3903. 8006A654 00010204060809
  3904. 8006A65C BIG PST = %d\n
  3905. 8006A66C SLOT_TYPE = %x\n
  3906. 8006A680 GET SMALL \n
  3907. 8006A690 GET NUM = %d\n
  3908. 8006A6A0 Service Game Last = %d\n
  3909. 8006A6B8 function pointers
  3910. 8002CE5C 8002CFA0 8002D2C0 8002D2C0 8002D2F4 8002D358
  3911. 8006A6D0 + CT START +\n
  3912. 8006A6E0 function pointers
  3913. 8002D534 8002D58C 8002D5B4 8002D62C 8002D6CC 8002D738 8002D774 8002D7E0
  3914. 8006A700 ++ BIG START ++\n
  3915. 8006A714 BIG PLAY!! \n
  3916. 8006A724 S-0%d
  3917. 8006A72C S-%d
  3918. 8006A734 On
  3919. 8006A738 OFF
  3920. 8006A73C ----
  3921. 8006A744 =--=
  3922. 8006A74C ====
  3923. 8006A754 %4d\n
  3924. 8006A75C %4d-%d\n
  3925. 8006A768 %f\n
  3926. 8006A76C ----- Test Mode -----\n
  3927. 8006A784 Mode Select No=%2d , Mode Count=%llu\n
  3928. 8006A7AC == EEPROM ERROR == \n
  3929. 8006A7C4 EEPROM = 4K Bit \n
  3930. 8006A7D8 EEPROM = 16K Bit \n
  3931. 8006A7F0 function pointers
  3932. 8002EB8C 8002ED34 8002EFB4 8002F118 8002F270 8002F3C8 8002F520 8002F678 8002F7D0 8002F934 8002FA8C 8002FBE4 8002FD48 8002FEA0 8002FFF8 80030150
  3933. 8006A830 BUTTON SWITCH TEST
  3934. 8006A844 SCH
  3935. 8006A84C ON = SERVICE SWITCH
  3936. 8006A864 C-1
  3937. 8006A86C ON = CREDIT TRANCE
  3938. 8006A880 C-2
  3939. 8006A888 ON = CREDIT CREAR
  3940. 8006A89C C-3
  3941. 8006A8A4 ON = COIN IN
  3942. 8006A8B4 C-4
  3943. 8006A8BC ON = TEST SWITCH
  3944. 8006A8D0 C-5
  3945. 8006A8D8 ERROR
  3946. 8006A8E0 Err
  3947. 8006A8E8 Aleck Error = CE ERROR
  3948. 8006A900 CE
  3949. 8006A908 Aleck Error = CJ ERROR
  3950. 8006A920 CJ
  3951. 8006A928 Aleck Error = CO ERROR
  3952. 8006A940 CO
  3953. 8006A948 Aleck Error = CR ERROR
  3954. 8006A960 Cr
  3955. 8006A968 Aleck Error = HE ERROR
  3956. 8006A980 HE
  3957. 8006A988 Aleck Error = HJ ERROR
  3958. 8006A9A0 HJ
  3959. 8006A9A8 Aleck Error = EE ERROR
  3960. 8006A9C0 EE
  3961. 8006A9C8 Aleck Error = 6E_COIN ERROR
  3962. 8006A9E8 6E
  3963. 8006A9F0 Aleck Error = 6E_FULL ERROR
  3964. 8006AA10 (double)
  3965. 8006AA18 (double)
  3966. 8006AA20 PLAY
  3967. 8006AA28 Coin
  3968. 8006AA30 In
  3969. 8006AA34 Slot
  3970. 8006AA3C %d
  3971. 8006AA40 %00d
  3972. 8006AA48
  3973. 8006AA50 function pointers
  3974. 80035B28 80035BF8 80035CCC 80035CE4 80035CFC 80035D14 80035D2C 80035DE0 80035E64 80035FB0 80035F30 80035FE0 80035E64 80035FBC 80035F3C 80035FEC
  3975. 8006AA90 FULL
  3976. 8006AA98 function pointers
  3977. 80036890 800368A8 800368AC 800368CC 800368D0 800368E8 80036950 8003694C 8003697C 80036994 800369AC
  3978. 8006AAC4 )\n
  3979. 8006AAC8 function pointers
  3980. 80037FF0 80038040 80038088 800380D4 8003813C 800381BC 800382A0 800382A0 800382A0 800382A0 80038254 80038278 80038390 80038400 800383D4 80038400 8003844C 80038614 80038614 80038614 80038614 80038614 800385D0 800385F4 800389B8 800389D0 800389E8 80038A00 80038A18 80038A30 80038A48 80038A60 80038A78 80038A90 80038AA8 80038AC0 80038C30
  3981. 8006AB60 function pointers
  3982. 80038B08 80038B20 80038B38 80038B50 80038B68 80038B80 80038B98 80038BB0 80038BC8 80038BE0 80038BF8 80038C10 80038C30
  3983. 8006AB98 function pointers
  3984. 80038DD4 80038C6C 80038C80 80038C94 80038CA8 80038CBC 80038CD0 80038CE4 80038CF8 80038DD4 80038DD4 80038D34 80038D48 80038D5C 80038D70 80038D84 80038D98 80038DAC 80038DC0 80038DD4 80038E0C 80038E20 80038E34 80038E48 80038E5C 80038E70 80038E84 80038E98 80038EAC 80038EC0 80038ED4
  3985. 8006AC18 function pointers
  3986. 80038F04 80038F18 80038F2C 80038F40 80038F54 80038F68 80038F7C 80038F90 80038FA4 80038FB8 80038FCC
  3987. 8006AC48 function pointers
  3988. 80038FFC 80039010 80039024 80039038 8003904C 80039060 80039074 80039088 8003909C 800390B0 800390C4
  3989. 8006AC78 function pointers
  3990. 800390F4 80039108 8003911C 80039130 80039144 80039158 8003916C 80039180 80039194 800391A8 800391BC
  3991. 8006ACA8 function pointers for 8003A7F0
  3992. 8003A934 8003A81C 8003A82C 8003A83C 8003A84C 8003A85C 8003A86C 8003A87C 8003A88C 8003A89C 8003A8AC 8003A8BC 8003A8CC 8003A8DC 8003A8EC 8003A8FC 8003A90C 8003A91C 8003A92C
  3993. 8006ACF8 nuGfxTaskStart: Must set FIFO buffer for fifo-ucode(use nuGfxSetUcodeFifo)\n
  3994. 8006AD44 nuGfxSetCfb: FrameBuffer Addres Error!!\n
  3995. 8006AD70 nuGfxUcodeFifoSet: fifo buffer is NOT 16byte boundaries\n
  3996. 8006ADAC nuGfxUcodeFifoSet: fifo size is NOT multiple 8 \n
  3997. 8006ADE0 nuSiMgr: majorNo %#x minorNo %#x is over callback func num(%d).\n
  3998. 8006AE24 nuSiMgr: no si callback function mesg %#X\n
  3999. 8006AE50 nuSiCallBackAdd: CallBack is already added(major no = %#X!!\n
  4000. 8006AE90 (double)
  4001. 8006AE98 (double)
  4002. 8006AEA0 (double)
  4003. 8006AEA8 (double)
  4004. 8006AEB0 function pointers
  4005.  
  4006. 8006B590 C-expansion special chars " +-#0"
  4007. 8006B598
  4008. 8006B5B0 C-expansion type special chars "hlL"
  4009. 8006B5B8 function pointers
  4010. 8006B710 (double)
  4011. 8006B718 (double)
  4012. 8006B720 (double)
  4013. 8006B728 (double)
  4014. 8006B730 (double)
  4015. 8006B738 (double)
  4016. 8006B740 (double)
  4017. 8006B748 (double)
  4018. 8006B750 (double)
  4019. 8006B758 C-expansion special float label "NaN"
  4020. 8006B75C C-expansion special float label "Inf"
  4021. 8006B760 (double)
  4022. 8006B768 (double)
  4023.  
  4024. 8006B780 initialized at runtime
  4025.  
  4026. 8006C8A0 copy of controller 1 button input
  4027.  
  4028. 8006C9F8 seed for rand()
  4029.  
  4030. 8006CA20 thread: main ID 1, priority 0xA, calling 8003A9A4(0), SP = 8006ED80
  4031. 8006CBD0 thread: game ID 3, priority 0xA, calling 80025C6C(0), SP = 800B1A60
  4032. 8006CD80
  4033.  
  4034. *8006ED80 top of main thread stack
  4035.  
  4036. *80070D80 top of thread 80117BC8 stack
  4037. *80072D80 top of thread 80117D78 stack
  4038. *80074D80 top of thread 80117F28 stack
  4039.  
  4040. 80074D98 thread ID 5, priority 0x3C, calling 8003BDE0(0), SP = 80076F50
  4041. 80074F48
  4042.  
  4043. *80076F50 top of thread 80074D98 stack
  4044.  
  4045. 80076F70 EPI queue w/ 0x32 msgs at 80076F88
  4046. 80076F88 messages for queue 80076F70
  4047. 80077050
  4048.  
  4049. *80079070 top of thread 800ADC48 stack
  4050.  
  4051. 8007B240 message for queue 8007DAD0
  4052. 8007B244 message for queue 801203B0
  4053.  
  4054. 8007B310 thread: EPI ID 0, calls 8004CAE0(800671F0), SP = 8007C4C0
  4055. 8007B4C0
  4056.  
  4057. *8007C4C0 top of EPI thread stack
  4058. 8007C4C0 queue with 1 message at 8007C4D8: event queue
  4059. 8007C4D8 message for queue 8007C4C0
  4060. 8007C4DC
  4061. 8007C4E0 message for queue 800AF7E0
  4062. 8007C4E4
  4063.  
  4064. 8007C550 message for queue 80120390
  4065. 8007C554
  4066.  
  4067. 8007C568 thread: VI ID 0, calling 80055650(800675A0), SP = 8007D720
  4068. 8007C718
  4069.  
  4070. *8007D720 top of VI thread stack
  4071. 8007D720 queue with 5 messages at 8007D738: vertical retrace and counter callback
  4072. 8007D738 5 messages for queue 8007D720
  4073. 8007D74C
  4074. 8007D750 PI request event: vertical retrace
  4075. 8007D768 PI request event: counter
  4076. 8007D780
  4077.  
  4078. 8007D8B0
  4079.  
  4080. 8007DAD0 queue with 1 message at 8007B240
  4081. 8007DAE8
  4082.  
  4083. 8007DAF0 PIF read cmd buffer
  4084. 8007DB30
  4085.  
  4086. *8007DB30 0x20000 initialized by game thread
  4087.  
  4088. *8009DB30 top of game thread allocation
  4089.  
  4090. 8009EBB0 blocks of 0x1000 for context function stacks; 16 total
  4091. 800A8BB0?
  4092.  
  4093. 800ADB34 default EPI handle for domain 1
  4094.  
  4095. 800ADC3C[0:2] True if P1 Start pressed
  4096.  
  4097. 800ADC48 thread ID 4, priority 0x32, calling 8003DEB0(0), SP = 80079070
  4098. 800ADDF8 queue with messages at 800B1A64
  4099. 800ADE10
  4100.  
  4101. 800AE9FC p->array of E/PI requests; 0x18 each
  4102.  
  4103. 800AEA08
  4104.  
  4105. 800AEB7C
  4106.  
  4107. 800AEB8C
  4108.  
  4109. 800AEE50 #connected controllers
  4110.  
  4111. 800AEE80
  4112.  
  4113. 800AEED8 EPI handle for cart
  4114.  
  4115. 800AEF4C flags indicating which context thingies are filled; from low to high
  4116. 800AEF50 16 context thingies for a thread-like doodlie; 0x84 each
  4117. 800AF790
  4118.  
  4119. 800AF7A0 buffer for eeprom SI status requests
  4120. 800AF7E0 queue with 1 message at 8007C4E0: access queue
  4121. 800AF7F8
  4122.  
  4123. 800AF828 thread ID 6, priority 0x46, calling 8003F504(0), SP = @801182E0+0 + 0x2000
  4124. 800AF9D8 p->microcode table at 80066BE0
  4125.  
  4126. 800AF9E4 default EPI handle for domain 0
  4127.  
  4128. *800B1A60 top of boot thread stack + top of game thread stack
  4129. 800B1A64 p->array of messages for queue 800ADDF8
  4130.  
  4131. 800B2680[0:2] True if P2 Start pressed
  4132.  
  4133. 800D26BC[0] last type of PIF command copied to 8007DAF0
  4134.  
  4135. 800D2750 eeprom buffer
  4136. 800D2768
  4137.  
  4138. 801127C4 p->0x4000 byte allocation
  4139. 801127C8 p->function run in main thread
  4140.  
  4141. 80112954 error mode #
  4142. 80112958 p->EPI handle for cart
  4143.  
  4144. 80112968+0 80112968 E0800000
  4145. 80112968+4 8011296C E0800002
  4146. 80112968+8 80112970 E0800004
  4147. 80112968+C 80112974 E080000A
  4148. 80112968[10:18:2] 80112978 current state; copies of NOR'd values from above four addresses
  4149. 80112968[18:20:2] 80112980 previous state; copies of NOR'd values from above four addresses
  4150. 80112968[40:42] 801129A8
  4151. 80112968[42:44] 801129AA
  4152. 80112968[44:46] 801129AC
  4153. 80112968[46:48] 801129AE
  4154. 80112968[48:4A] 801129B0
  4155. 80112968[4A:4C] 801129B2
  4156. 80112968[4C:4E] 801129B4
  4157. 80112968[4E:50] 801129B6
  4158. 80112968[50:52] 801129B8
  4159.  
  4160. 80117628 True when system initialized
  4161.  
  4162. 80117A74 queue with 8 messages at 80117A8C
  4163. 80117A8C 8 messages for queue 80117A74
  4164. 80117AAC queue with 8 messages at 80117AC4
  4165. 80117AC4 8 messages for queue 80117AAC
  4166. 80117AE4 queue with 8 messages at 80117AFC: VI interrupt and PreNMI callback
  4167. 80117AFC 8 messages for queue 80117AE4
  4168. 80117B1C queue with 8 messages at 80117B34: SP task complete callback
  4169. 80117B34 8 messages for queue 80117B1C
  4170. 80117B54 queue with 8 messages at 80117B6C: DP full sync callback
  4171. 80117B6C 8 messages for queue 80117B54
  4172. 80117B8C queue with 8 messages at 80117BA4
  4173. 80117BA4 8 messages for queue 80117B8C
  4174. 80117BC4
  4175. 80117BC8 thread ID 0x13, priority 0x78, calling 8003AE04(80117A70), SP = 80070D80
  4176. 80117D78 thread ID 0x12, priority 0x6E, calling 8003B2CC(80117A70), SP = 80072D80
  4177. 80117F28 thread ID 0x11, priority 0x64, calling 8003B658(80117A70), SP = 80074D80
  4178. 801180D8
  4179.  
  4180. 801182F0[A:C] whatever "slot type" means
  4181.  
  4182. 80118300[C:E] major error code index
  4183. 0001 CE
  4184. 0002 CJ
  4185. 0004 CO
  4186. 0008 CR
  4187. 0010 HE
  4188. 0020 HJ
  4189. 0040 EE
  4190. 0080 6E
  4191. 80118300[E:10] minor error code index
  4192. 0001 coin error
  4193. 0002 full error
  4194.  
  4195. 80118390 display list buffer
  4196.  
  4197. 80120390 queue with 1 message at 8007C550; SI lock queue
  4198. 801203A8
  4199.  
  4200. 801203B0 queue with 1 message at 8007B244
  4201. 801203C8
  4202.  
  4203. 801203D0 target for file 0x46B80 (pointer correction +800D9850)
  4204. 801203D0 46B80.47780.96x32.ci8 クレジット credit
  4205. 80120FD0 ci8 palette for 801203D0
  4206. 801211D0 entry for "credit"
  4207. 80121200
  4208.  
  4209. *8013DDD0 end of file 0x46B80
  4210.  
  4211. 8033F800 0x50000 allocatable memory
  4212. 8038F800 framebuffer (320x240 mode)
  4213. 803B5000 framebuffer (320x240 mode)
  4214. 803DA800 framebuffer (320x240 mode)
  4215. 80400000
  4216.  
  4217. 0x46B80 bin resources.bin
  4218. 0x64580
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement