Advertisement
Zoinkity

Polygon Studio edits

Jun 4th, 2015
475
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.69 KB | None | 0 0
  1. 0x11936A8, 0x151B0 bin LBA 0x400: sound tables
  2. 0x126B3C8 bin LBA 0x432: sound samples
  3. 0x1518FA8
  4.  
  5. 0x18D0268 ram.mfs
  6. 0x3D7A028 copy of fonts from IPL
  7.  
  8. For Nemu NOP 80032188!
  9. 0x1527890 for IPL music; 0x2BE480
  10.  
  11. +_+ addresses and functions
  12.  
  13. 8001FA00 0x206E8 Thread: LeoWrk
  14.  
  15. 80020250 0x20F38 A2=size of A1 LBAs starting at LBA A0
  16.  
  17. 800203A0 V0=p->IPL EPI handle @80154A30, creating if necessary
  18.  
  19. 800278A0 0x28588 send or jam (A2) msg A1 to queue A0
  20.  
  21. 80027D40 0x28A28 read or wait (A2) to write msg f/ queue A0 to A1
  22.  
  23. 80028624 getting an inf. loop here due to stack corruption
  24. while not call 8002E0A0(): # True if SP Status and SP Busy clear
  25. pass
  26. call 80032180(0x125) # SP Status = A0
  27. 80028670
  28.  
  29. 80029E10 create thread
  30.  
  31. 8002A3D0 0x2B0B8 cache A2 bytes at A1 before hardware write
  32.  
  33.  
  34. 8002B850 0x2C538
  35. @0x2C5EC creates the E/PI thread
  36. 800732C0 = (1, 801568C0, [800B3458], 80157A70, 801564C8, 8002BDD0, 8002E710) (flag, thread, req, callback, busy, f(PI), f(EPI))
  37. 8002B9C0 0x2C6A8 Thread: E/PI
  38.  
  39. 8002BDD0 0x2CAB8 PI for boot device
  40.  
  41. (check this one!)
  42. 8002DDB0 0x2EA98 send EPI read or write (A2) request A1 using EPI handle A0
  43. accepts: A0=p->EPI handle, A1=p->req, A2=mode (0:EPI read, 1:EPI write)
  44.  
  45. 8002DFC0 0x2ECA8 create queue A0 with A2 msgs at A1
  46. 8002DFF0 0x2ECD8 cache A2 bytes at A1 before hardware read
  47.  
  48. 8002FB00 0x307E8 V0=0 if not @800732C0 else p->E/PI request queue
  49.  
  50. 8002FCA0 0x30988 write word A2 to A1 using EPI handle A0
  51.  
  52. 80154A30 p->EPI IPL handle
  53. 80154AB0 p->EPI ASIC handle
  54.  
  55. +_+ changes
  56.  
  57. alternate:
  58. 0x20788 8001FAA0 LeoWrk: remove ASIC Status and error detection, plus set default values
  59. 3C058000 LUI A1,8000
  60. ...
  61. 0xE398
  62. 8CA501A0 LW A1,01A0 (A1)
  63. 3C06A002 LUI A2,A002
  64. 1000000A BEQ R0,R0,+10
  65. ACC5FAE0 SW A1,FAE0 (A2)
  66. original:
  67. 0x20788 8001FAA0 LeoWrk: remove ASIC Status and error detection, plus set default values
  68. 3C050100 LUI A1,0100 ;default ASIC Status value
  69. ...
  70. 0x20798
  71. 3C068015 LUI A2,8015
  72. 1000000B BEQ R0,R0,+11
  73. ACC54B30 SW A1,4B30 (A2)
  74. 00000000
  75. 00000000
  76. 00000000
  77. 00000000
  78. 00000000
  79. 00000000
  80. 00000000
  81. 00000000
  82. 00000000
  83. ...
  84. 0x20988 alter a branch over eliminated code
  85. 10200036 BEQ AT,R0,+0x36
  86. ...
  87. 0x209DC 8001FCF4 0x88 of zeroes!
  88. 0x20A64 8001FD7C
  89. 0C007F9F JAL 8001FE7C ;directly read disk header to 800C86E0
  90. 00000000 NOP
  91. change some pointers! 8001FCF4 -> 8001FD7C
  92. 0x74938, 0x7493C, 0x74940, 0x74944, 0x7494C, 0x74950, 0x74958
  93.  
  94. 0x20B64 8001FE7C rewritten: directly read disk header from ROM, return 0
  95. 27BDFFE8 ADDIU SP,SP,FFE8
  96. 3C058015 LUI A1,8015
  97. AFBF0014 SW RA,0014 (SP)
  98. 8CA249B0 LW V0,49B0 (A1)
  99. 24041000 ADDIU A0,R0,1000
  100. 24A562E0 ADDIU A1,A1,62E0
  101. 240600E8 ADDIU A2,R0,00E8
  102. 0C0081F4 JAL 800207D0 ;read A2 bytes from offset A0 to rdram A1
  103. A4400004 SH R0,0004 (V0)
  104. 8FBF0014 LW RA,0014 (SP)
  105. 00001025 OR V0,R0,R0
  106. 03E00008 JR RA
  107. 27BD0018 ADDIU SP,SP,0018
  108. 0x180 zeroes
  109.  
  110. 0x20DA4 800200BC rewritten: process disk read or write (A1) request at 801549B0 using base LBA 0
  111. 00002825 OR A1,R0,R0
  112. 0x20DA8 800200C0 rewritten: process disk read or write (A1) request at 801549B0 using base LBA A0
  113. 27BDFFE0 ADDIU SP,SP,FFE0
  114. AFBF001C SW RA,001C (SP)
  115. AFB00018 SW S0,0018 (SP)
  116. 3C108015 LUI S0,8015
  117. 8E0649B0 LW A2,49B0 (S0) ;A1=p->leocmd
  118. A2054A0A SB A1,4A0A (S0) ;80154A08[2] = mode
  119. 8CCA0014 LW T2,0014 (A2) ;T2=p->target
  120. 8CC2000C LW V0,000C (A2) ;V0=lba
  121. 8CC50010 LW A1,0010 (A2) ;A1=num
  122. 00822021 ADDU A0,A0,V0 ;A0=actual LBA
  123. 00854021 ADDU T0,A0,A1
  124. 2D0110DD SLTIU AT,T0,10DD ;True if valid
  125. 14200004 BNE AT,R0,tobytes
  126. 260B4968 ADDIU T3,S0,4968
  127. 24090220 ADDIU T1,R0,0220
  128. 1000001D BEQ R0,R0,return
  129. A4C90004 SH T1,0004 (A2)
  130. A4C00004 SH R0,0004 (A2)
  131. AE0449C0 SW A0,49C0 (S0)
  132. AE0B4A0C SW T3,4A0C (S0) ;80154A08[4:8] = p->thread to notify
  133. AE0A4A10 SW T2,4A10 (S0) ;80154A08[8:12] = p->rdram
  134. 0C008095 JAL 80020254 ;A2=size of A1 LBAs starting at LBA A0
  135. 26064A18 ADDIU A2,S0,4A18 ;80154A08[16:20] = size
  136. 8E0549C0 LW A1,49C0 (S0)
  137. 00002025 OR A0,R0,R0
  138. 0C008095 JAL 80020254 ;A2=size of A1 LBAs starting at LBA A0
  139. 26064A14 ADDIU A2,S0,4A14 ;80154A08[12:16] = hardware offset
  140. 92014A0A LBU AT,4A0A (S0) ;mode
  141. 8E044A10 LW A0,4A10 (S0) ;p->target
  142. 14200003 BNE AT,R0,+3
  143. 8E054A18 LW A1,4A18 (S0) ;size
  144. 0C00B7FC JAL 8002DFF0 ;cache A2 bytes at A1 before hardware read
  145. 27FF0008 ADDIU RA,RA,0008
  146. 0C00A8F4 JAL 8002A3D0 ;cache A2 bytes at A1 before hardware write
  147. 00000000 NOP
  148. 24020004 ADDIU V0,R0,0004
  149. 26044AB0 ADDIU A0,S0,4AB0
  150. 26054A08 ADDIU A1,S0,4A08
  151. 92064A0A LBU A2,4A0A (S0)
  152. 0C00B76C JAL 8002DDB0 ;send EPI read or write (A2) request A1 using EPI handle A0
  153. AC820014 SW V0,0014 (A0) ;epi+20 = 2: cart request
  154. 26044968 ADDIU A0,S0,4968
  155. 00002825 OR A1,R0,R0
  156. 0C009F50 JAL 80027D40 ;wait to write msg f/ queue
  157. 24060001 ADDIU A2,R0,0001
  158. 8FBF001C LW RA,001C (SP)
  159. 8FB00018 LW S0,0018 (SP)
  160. 03E00008 JR RA
  161. 27BD0020 ADDIU SP,SP,0020
  162.  
  163. 0x20F38 80020250 alt. entry: size of A1 LBAs starting at LBA 0x18
  164. 24840018 ADDIU A0,A0,0018 ;last step
  165. ...
  166. 0x20F74
  167. 10000038 BEQ R0,R0,+0x38
  168. ...
  169. 0x20F84 change the order, then move third op to start of function
  170. 12200031 BEQ AT,V0,+0x31
  171. 24020001 ADDIU V0,R0,0001
  172.  
  173. 0x210CC 800203E4 IPL->cartROM
  174. 3C18B3CD LUI T8,B148 B3CDA028
  175. 3C048015
  176. 3718A028 `ORI T8,T8,7890 ;inserted, -0xA0000
  177. A20F0004
  178. AE18000C
  179. A2000009
  180. AE000010
  181. 24849444
  182. 0C005AD8
  183. 24050060
  184. 3C07A460 LUI A3,A460
  185. 34E30010 ORI V1,A3,0010
  186. 8C620000
  187. `3C07A460 moved!
  188. ...
  189. 0x2115C 80020474 read the EPI settings from beginning of cartrom
  190. 3C01A000 LUI AT,A000
  191. 8C2E0308 LW T6,0308 (AT)
  192.  
  193. 0x211E8 80020500 rewrite: send disk inquiry
  194. 3C028015 LUI V0,8015
  195. 8C4849B0 LW T0,49B0 (V0)
  196. 240C0001 ADDIU T4,R0,0001
  197. AD00000C SW R0,000C (T0)
  198. A10C000D SB T4,000D (T0)
  199. A10C000E SB T4,000E (T0)
  200. 03E00008 JR RA
  201. A1000004 SB R0,0004 (T0)
  202.  
  203. 0x212AC 800205C4 modify ASIC EPI handle at creation
  204. 24020040 ADDIU V0,R0,0040
  205. 24030007 ADDIU V1,R0,0007
  206. 3C0EAFF9 LUI T6,AFF9
  207. 240F0003 ADDIU T7,R0,0003
  208. 24181201 ADDIU T8,R0,1201
  209. 25CED828 ADDIU T6,T6,D828 ;ASIC correction AFF8D828
  210. 3C048015 <untouched>
  211. A6020004 SH V0,0004 (S0) ;800B94B0[4:] = 0040 07 03 1201 ---- AFF8D828
  212. AE0E000C SW T6,000C (S0)
  213. A6180008 SH T8,0008 (S0)
  214. A2030006 SB V1,0006 (S0)
  215. A20F0007 SB T7,0007 (S0)
  216.  
  217. 0x21398 800206B0 rewritten: read disk ID directly from cart header
  218. 27BDFFE8 ADDIU SP,SP,FFE8
  219. 3C058015 LUI A1,8015
  220. AFBF0014 SW RA,0014 (SP)
  221. 8CA549B0 LW A1,49B0 (A1)
  222. A4A00004 SH R0,0004 (A1)
  223. 24040018 ADDIU A0,R0,0018
  224. 24060020 ADDIU A2,R0,0020
  225. 0C0081F4 JAL 800207D0 ;read A2 bytes from offset A0 to rdram A1
  226. 8CA5000C LW A1,000C (A1)
  227. 8FBF0014 LW RA,0014 (SP)
  228. 08008453 J 8002114C ; unset disk changed flag in leo status flags
  229. 27BD0018 ADDIU SP,SP,0018
  230.  
  231. 0x214B8 800207D0 inserted: read A2 bytes from A0 to rdram A1
  232. 27BDFFE8 ADDIU SP,SP,FFE8
  233. AFBF0014 SW RA,0014 (SP)
  234. 3C038015 LUI V1,8015
  235. AC664A18 SW A2,4A18 (V1)
  236. 24624968 ADDIU V0,V1,4968
  237. 3C01000B LUI AT,000B
  238. AC644A14 SW A0,4A14 (V1)
  239. AC654A10 SW A1,4A10 (V1)
  240. AC624A0C SW V0,4A0C (V1)
  241. 00A02025 OR A0,A1,R0
  242. 00C02825 OR A1,A2,R0
  243. 0C00B7FC JAL 8002DFF0 ;cache A2 bytes at A1 before hardware read
  244. AC614A08 SW AT,4A08 (V1)
  245. 0C00BEC0 JAL 8002FB00 ;V0=0 if not @800732C0 else p->E/PI request queue [@800732C8]
  246. 00000000 NOP
  247. 3C058015 LUI A1,8015
  248. 00402025 OR A0,V0,R0
  249. 00003025 OR A2,R0,R0
  250. 0C009E28 JAL 800278A0 ;send msg A1 to queue A0
  251. 24A54A08 ADDIU A1,A1,4A08
  252. 3C048015 LUI A0,8015
  253. 24060001 ADDIU A2,R0,0001
  254. 00002825 OR A1,R0,R0
  255. 0C009F50 JAL 80027D40 ;wait to write msg f/ queue
  256. 24844968 ADDIU A0,A0,4968
  257. 8FBF0014 LW RA,0014 (SP)
  258. 03E00008 JR RA
  259. 27BD0018 ADDIU SP,SP,0018
  260.  
  261. 0x21528 80020840 eliminate 7 lines here to falsify reading ASIC Status
  262. alternate:
  263. 3C01B3E1 LUI AT,B3E1
  264. 3C0FA002 LUI T7,A002
  265. 3C0E8015 `LUI T6,8015
  266. 8C213270 LW AT,3270 (AT) ;AT = gameID
  267. 8DE2FAE0 LW V0,FAE0 (T7) ;V0 = cur. gameID
  268. 3C030100 `LUI V1,0100
  269. 54410002 BNEL V0,AT,+2
  270. ADC04B30 SW R0,4B30 (T6)
  271. ADC34B30 SW V1,4B30 (T6)
  272. ADE1FAE0 SW AT,FAE0 (T7)
  273. 8DCE4B30
  274.  
  275. 0x21DA8 800210C0 leo reset -> unconditonal return
  276.  
  277. 0x23B88 80022EA0 disk start/stop
  278. 3C018015 LUI AT,8015
  279. 8C2149B0 LW AT,49B0 (AT)
  280. 03E00008 JR RA
  281. A4200004 SH R0,0004 (AT)
  282.  
  283. 0x23C78 80022F90 IPL verification test function
  284. 0x23CF4 change base to ROM, change test to data at 0x1010
  285. 3C19B000 LUI T9,B000
  286. ....
  287. 0x23D18
  288. 3C016C78 LUI AT,6C78
  289. 34218490 ORI AT,AT,8490
  290.  
  291. 0x23D48 80023060 disk select
  292. 3C018015 LUI AT,8015
  293. 8C2149B0 LW AT,49B0 (AT)
  294. 03E00008 JR RA
  295. A4200004 SH R0,0004 (AT)
  296.  
  297. 0x24148 80023460 disk rezero
  298. 3C028015 LUI V0,8015
  299. 8C4E49B0 LW T6,49B0 (V0)
  300. A44049C2 SH R0,49B2 (V0)
  301. A04049C7 SB R0,49B7 (V0)
  302. A04049C8 SB R0,49B8 (V0)
  303. 03E00008 JR RA
  304. A1C00004 SB R0,0004 (T6)
  305.  
  306. 0x24828 80023B40 rewritten: read time from drive
  307. 3C038015 LUI V1,8015
  308. 3C048000 LUI A0,8000
  309. 8C6F49B0 LW T7,49B0 (V1)
  310. 908B01B1 LBU T3,01B1 (A0)
  311. 908201B2 LBU V0,01B2 (A0)
  312. 909801B3 LBU T8,01B3 (A0)
  313. A1E2000E SB V0,000E (T7)
  314. 908801B4 LBU T0,01B4 (A0)
  315. A1F8000F SB T8,000F (T7)
  316. 908A01B5 LBU T2,01B5 (A0)
  317. A1E80010 SB T0,0010 (T7)
  318. 908C01B6 LBU T4,01B6 (A0)
  319. A1EA0011 SB T2,0011 (T7)
  320. 908E01B7 LBU T6,01B7 (A0)
  321. A1EC0012 SB T4,0012 (T7)
  322. A1EE0013 SB T6,0013 (T7)
  323. A1E00004 SB R0,0004 (T7)
  324. 03E00008 JR RA
  325. A1EB000D SB T3,000D (T7)
  326.  
  327. 0x27CC8 80026FE0 process disk write request
  328. 24040018 ADDIU A0,R0,0018
  329. 08008030 J 800200C0
  330. 24050001 ADDIU A1,R0,0001
  331.  
  332. 0x283A8 800276C0 seek to LBA on disk
  333. 3C018015 LUI AT,8015
  334. 8C2149B0 LW AT,49B0 (AT)
  335. 03E00008 JR RA
  336. A4200004 SH R0,0004 (AT)
  337.  
  338. 0x2CAB8 8002BDD0 PI for boot device
  339. @0x2CB20 8002BE38 probably correct OP to add instead of OR
  340. 03284821 ADDU T1,T9,T0
  341.  
  342. @0x2F230 8002E548 EPI hardware LW
  343. 01475821
  344.  
  345. @0x31C80 80030F98 EPI hardware SW
  346. 01475821
  347.  
  348. 0x2F3F8 8002E710 EPI for handle A0
  349. @0x2F56C 8002E884 probably correct OP to add instead of OR
  350. 016C6821 ADDU T5,T6,T4
  351.  
  352. +_+ IPL music samples
  353.  
  354. 0x3C790
  355. 1461001E BNE V1,AT,+return # if not 3 return 0
  356. 3C01013E LUI AT,013E
  357. 24217890 ADDIU AT,AT,7890 # 0x1527890 - 0x140000
  358. 00273821 ADDU A3,AT,A3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement