GCNCodeTypes.txt 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956
  1. --------------------------------
  2. GCN AR CODES TYPES EXPLANATION
  3. --------------------------------
  4. v1.1 by kenobi
  5. History :
  6. v1.1 : Removed the 'NCT' codes types.
  7. Added 'Byte Copy', 'Pointer Mod' and 'AND/OR' codes type.
  8. Added some notes about the (m) codes, the 'write to CCxxxxxx' code.
  9. Fixed some typos.
  10. v1.0 : Initial release.
  11. Special thanks to Parasyte for his help/informations about some codes types.
  12. This document has been written for educational purpose.
  13. It may help you create codes for the GCN AR, or they might be useless
  14. junk... Your call !
  15. If you know the GBA's ARv3 codes types, you'll find the GCN AR codes types
  16. quite similar...
  17. Also note that the PS2's AR MAX codes types are very close to the GCN ones.
  18. Warning : This document is meant for advanced codes creators, NOT FOR
  19. NEWBIES OR WANNABES. Sorry.
  20. *************** If you are an experienced, known (by me or gscentral
  21. admins) code hacker, and you don't
  22. understand this document, you may try to ask help using the
  23. gscentral.com forums
  24. (or PM me there).
  25. Special Note 1 : All adresses MUST be compatible with the data size you want
  26. the codes are using.
  27. *************** That means : -ANY address can be used for BYTE
  28. reading/writing.
  29. -Address MUST be a multiple of 2 for HALFWORD
  30. reading/writing.
  31. (Last hex number of the address must be either
  32. :0,2,4,6,8,A,C,E)
  33. -Address MUST be a multiple of 4 for WORD
  34. reading/writing.
  35. (Last hex number of the address must be either
  36. :0,4,8,C)
  37. If you don't follow this rule, the codes won't work (or the
  38. AR might crash)...!
  39. Special Note 2 : All codes are formatted like that : XXXXXXXX YYYYYYYY.
  40. I called ADDRESS (in caps) the XXXXXXXX, and VALUE (in
  41. caps) the YYYYYYYY.
  42. Special Note 3 : GCN memory range is 0x80000000 - 0x817FFFFF cached, and
  43. 0xC0000000 - 0xC17FFFFF uncached.
  44. (don't ask what it means, I don't get it either :P).
  45. The codes will usualy write to the cached area.
  46. Special Note 4 : The codes type numbers I give after a code name is a number
  47. created like this:
  48. For "Type zX" codes , the number X is :
  49. AAA (3 most significant bits of the code's "VALUE")
  50. For normal codes, the number in parenthesis after the name
  51. of the code is :
  52. AAABBCC (7 most significant bits of the code's
  53. "ADDRESS")
  54. AAA : type bits.
  55. BB : subtype bits.
  56. CC : value bits.
  57. You can use them as reference, or just ignore them...
  58. Special Note 5 : Any "unused" data could be filled with random numbers to
  59. create a "unique encryption",
  60. which could "sign" your codes. I randomly explained how it
  61. works. It might not work
  62. with every code. This feature isn't really interessing, but
  63. I felt like it should be
  64. noticed.
  65. Special Note 6 : "Register 1BB4" is one of the register (= a given place in
  66. the NGC memory) that the AR
  67. uses to store some data while executing codes.
  68. Special Note 7 : The addresses, values, and all the numbers starting by
  69. "0x", or having the letter(s)
  70. A, B, C, D, E and/or F in them are Hexadecimal numbers. If
  71. you don't know what hexadecimal
  72. is, make a search in Google.
  73. Special Note 8 : If you don't know C/C++, be aware that "<<" means "Shift
  74. left", and ">>" "Shift right".
  75. "Shift left" is the "Lsh" button of the Windows calculator
  76. (in "Scientific" mode).
  77. "Shift right" is gotten by clicking the "Inv" checkbox,
  78. then the "Lsh" button of the
  79. Windows calculator (in "Scientific" mode).
  80. ________________
  81. ----------------
  82. | Type z Codes |
  83. ----------------
  84. "Type z" are codes which have an ADDRESS eqal to 00000000 ("z" stands for
  85. "zero").
  86. For any "Type zX" codes : X = code type = (VALUE >> 29) AND 0x07.
  87. (If X>4, the code will be skipped)
  88. -------------------------------
  89. // Type "z0" : END OF CODES //
  90. -------------------------------
  91. 1 line code.
  92. 00000000 00000000
  93. It means "end of the code" (or "no more codes are executed").
  94. The AR will "give" back the hand to the game, and then will start execute
  95. codes
  96. from the very 1st of the list.
  97. --------------------------------------------
  98. // Type "z2" : Normal execution of codes //
  99. --------------------------------------------
  100. 1 line code.
  101. 00000000 40000000
  102. Set register 1BB4 to 0.
  103. It means that the AR goes back to the normal execution of codes.
  104. (And it should break a "stop executing codes", set when register 1BB4 is =
  105. 2).
  106. -----------------------------------------------------
  107. // Type "z3" : Executes all codes in the same row //
  108. -----------------------------------------------------
  109. 1 line code.
  110. 00000000 60000000
  111. Set register 1BB4 to 1.
  112. It means the AR will execute all the codes, without giving back the hand to
  113. the
  114. game, unless register 1BB4 changes value (with a "z2" code for exemple).
  115. -------------------------------
  116. // Type "z4" : Fill & Slide //
  117. -------------------------------
  118. 2 lines code.
  119. 00000000 8XXXXXXX
  120. Y1Y2Y3Y4 Z1Z2Z3Z4
  121. Address = 8XXXXXXX AND 0x81FFFFFF.
  122. Size = (address >> 25) AND 0x03.
  123. (Size 0 = 8bits, Size 1 = 16 bits, Size 2 = 32 bits. Size 3 = Unused)
  124. Value = Y1Y2Y3Y4.
  125. Address increment = 0000Z3Z4 if (Z1 >> 3 = 0).
  126. = FFFFZ3Z4 if (Z1 >> 3 = 1).
  127. NOTE : When using halfword (or word), make address increment >> 1 (or >> 2)
  128. when
  129. computing the code.
  130. Value increment = 00000000Z1 if (Z1 >> 3 = 0).
  131. = FFFFFFFFZ1 if (Z1 >> 3 = 1).
  132. Number of values to write = Z2.
  133. NOTE : If Z2 = 0, nothing will be written (it'll be like the code isn't
  134. executed).
  135. Small note :
  136. ------------
  137. As the sign of the address increment and the value increment are shared, you
  138. MUST start
  139. from the 1st address when using a positive value increment, and start from
  140. the last address
  141. when using a negative value increment.
  142. ------------------------------------------
  143. // Type "z4 - Size 3" : Memory Copy //
  144. ------------------------------------------
  145. These codes were 'created' by me (kenobi).
  146. The only way to use them is to enter and enable the 'Enablers' codes.
  147. You also HAVE TO add the Master Code flag to these Enabler codes'
  148. indentifier
  149. (or to include it into the (m) code), else they won't work properly.
  150. Finally, the 'Enabler' codes and the actual codes must be entered
  151. separately.
  152. They should work on ANY AR (at least up to version 1.14b).
  153. A - Memory Copy Without Pointer Support :
  154. -----------------------------------------
  155. Enabler (must be on!) :
  156. 04001E48 48000769
  157. 040025B0 5525043E
  158. 040025B4 4BFFF644
  159. Exemple of byte copy :
  160. 00000000 86393FA8
  161. 80393FA0 00000001
  162. Here is how it works :
  163. 00000000 8XXXXXXX
  164. YYYYYYYY 0000ZZZZ
  165. 8XXXXXXX = [Destination address] OR 0x06000000.
  166. YYYYYYYY = [Source address].
  167. ZZZZ = number of bytes to copy (0x0000 will copy 0 byte, 0xFFFF will copy
  168. 65535 bytes).
  169. Important : the 16-bits number before ZZZZ MUST BE '0000', else it'll create
  170. errors !!!
  171. So, if you follow what I explained, you can see that my code exemple will
  172. copy 2 bytes,
  173. from 80393FA0 to 80393FA8.
  174. B - Memory Copy With Pointers Support :
  175. ---------------------------------------
  176. Enabler (must be on!) :
  177. 04001E48 48000769
  178. 040025B0 5525043E
  179. 040025B4 2C060000
  180. 040025B8 4182000C
  181. 040025BC 80630000
  182. 040025C0 80840000
  183. 040025C4 4BFFF634
  184. With this code, if you put any data in the 8 upper bits of the value, the AR
  185. will use
  186. the addresses in the code as pointers addresses
  187. Exemple :
  188. 00000000 86002F04
  189. 80002F00 01000138
  190. Important : the 8-bits number before ZZZZ MUST BE '00', else it'll create
  191. errors !!!
  192. As the value start with '01' (could have been anything, but '00'), the AR
  193. will load
  194. the 32bits value at 80002F00 and use it as the source address, then load the
  195. 32bits
  196. value at 80002F04 and use it as the destination address, and finally will
  197. copy 138 bytes
  198. from the source address to the destination address.
  199. Note that if you put '00' in the start of the value, the code will work just
  200. like
  201. the 'Memory Copy Without Pointer Support' code.
  202. If you need to add an offset to the pointer addresses, you'll have to do
  203. this trick :
  204. copy the source pointer address to 80002F00, the destination pointer address
  205. to 80002F04,
  206. add the offset values to theses pointer addresses (using the 'Add' code
  207. type), and finally
  208. use the 'Memory Copy with Pointers Support' to copy the bytes.
  209. Exemple :
  210. 00000000 86002F00 <- Copy the 32bits (=4 bytes) source pointer address
  211. 804C8268 00000004 from 804C8268 to 80002F00.
  212. 00000000 86002F04 <- Copy the 32bits (=4 bytes) destination pointer address
  213. 804C8268 00000004 from 804C8268 to 80002F04.
  214. 84002F00 00000098 <- Add the offset 0x98 to the source pointer address at
  215. 80002F00.
  216. 84002F04 000001D0 <- Add the offset 0x1D0 to the source pointer address at
  217. 80002F04.
  218. 4A44F0A8 00000030 <- (if the user press R+Z...).
  219. 00000000 86002F04 <- Copy 0x138 bytes from the address stored at 80002F00
  220. (=pointer address+0x98)
  221. 80002F00 01000138 to the address stored at 80002F04 (=pointer address +
  222. 0x1D0).
  223. ________________
  224. ----------------
  225. | Normal Codes |
  226. ----------------
  227. For any "Normal Codes", you have :
  228. SubType = (ADDRESS >> 30) AND 0x03.
  229. Type = (ADDRESS >> 27) AND 0x07.
  230. Size = (ADDRESS >> 25) AND 0x03.
  231. (usually, Size 0 = 8bits, Size 1 = 16 bits, Size 2 = 32 bits.
  232. For some codes, Size 3 = Floating point single precision)
  233. ------------
  234. // Type 0 //
  235. ------------
  236. --------------------------------------
  237. // SubType 0 : Ram write (and fill) // (can be called "00", "01" and "02")
  238. --------------------------------------
  239. 1 line code.
  240. 0.0.x
  241. -----
  242. 0wXXXXXX Y1Y2Y3Y4
  243. (w < 8!)
  244. Address = ((0x0wXXXXXXX) AND 0x01FFFFFF) OR 0x80000000).
  245. Size = (address >> 25) AND 0x03.
  246. If Size = 0 [00] :
  247. fills area [Address ; Address + Y1Y2Y3] with value Y4.
  248. If Size = 1 [02] :
  249. fills area [Address ; Address + (Y1Y2 << 1)] with value Y3Y4.
  250. If Size = 2 [04] :
  251. writes word Y1Y2Y3Y4 to Address.
  252. Examples :
  253. 00023000 00000312
  254. will write byte 0x12 to 80023000, 80023001, 80023002, 80023003.
  255. 02023000 00011234
  256. will write halfword 0x1234 to 80023000, 80023002.
  257. 05023000 12345678
  258. will write halfword 0x12345678 to 81023000.
  259. -------------------------------
  260. // SubType 1 : Write to pointer (can be called "04", "05" and "06")
  261. -------------------------------
  262. 1 line code.
  263. 0.1.x
  264. -----
  265. 1 line code.
  266. 4wXXXXXX Y1Y2Y3Y4
  267. (w < 8!)
  268. Address = ((0x4wXXXXXX) AND 0x01FFFFFF) OR 0x80000000.
  269. Size = (Address >> 25) AND 0x03.
  270. Pointer Address = [Word stored at Address].
  271. This code will make the AR load the word stored at the address provided in
  272. the code,
  273. (also called the "Pointer Address"), and check if it's a valid address (ie.
  274. if it's in
  275. the [80000000~81800000[ range). It it is one, it will add an offset to it,
  276. and it will
  277. write the data provided in the code to this new address.
  278. If Size = 0 [40] :
  279. AR will write the byte Y4 at [Pointer Address + Y1Y2Y3].
  280. If Size = 1 [42] :
  281. AR will write the halfword Y3Y4 at [Pointer Address + (Y1Y2 << 1)].
  282. If Size = 2 [44] :
  283. AR will write the word Y1Y2Y3Y4 at [Pointer Address].
  284. REMOVE THE 'VALID ADDRESS' CHECK, AKA 'POINTER MOD' :
  285. -----------------------------------------------------
  286. This code was 'created' by me (kenobi).
  287. The only way to use it is to enter and enable the 'Enabler' code.
  288. You also HAVE TO add the Master Code flag to these Enabler codes'
  289. indentifier
  290. (or to include it into the (m) code), else they won't work properly.
  291. Finally, the 'Enabler' codes and the actual codes must be entered
  292. separately.
  293. It should work on ANY AR (at least up to version 1.14b).
  294. Enabler (must be on) :
  295. 04001FA4 48000014
  296. Once you use this code, the 'Write to Pointer' code will stop checking if
  297. the address you
  298. point to is a valid address.
  299. That means that you can write to virtual memory without a TLB (m) code, but
  300. you have to make
  301. sure that the address the pointer code reads is a valid address (else, it'll
  302. crash).
  303. Exemple (courtesy of donny2112) :
  304. 04002F0C 7FC39C9C
  305. 42002F0C 00010000
  306. 42002F0C 03ED0000
  307. 42002F0C 04F70000
  308. 42002F0C 05BB0000
  309. The first line will write '7FC39C9C' to 80002F0C.
  310. Then, the other lines will write 0x0000 to 0x7FC39C9C+2*1,
  311. 0x7FC39C9C+2*0x3ED, 0x7FC39C9C+2*0x4F7,
  312. and finally 0x7FC39C9C+2*0x5BB.
  313. The advantage of this code, over a TLB (m) code, is that it only needs a 1
  314. lines enabler, it is
  315. compatible with all games and all ARs, and it allows you to use 8/16/32bits
  316. ram write.
  317. The downside is that if you point to an invalid address, the GC will just
  318. crash.
  319. If you're not sure that you'll point to a valid address, you can use this
  320. combinaison of code to check
  321. it manually (in this exemple, I make sure that the address is in the
  322. 0x80000000~817F0000 range) :
  323. 74XXXXXX 80000000 <- If value > 0x80000000
  324. 2CXXXXXX 81800000 <- and If value < 0x81800000
  325. 44XXXXXX Y1Y2Y3Y4 <- then execute this pointer code.
  326. XXXXXXXX being the address where the Pointer Address is stored.
  327. -----------------------
  328. // SubType 2 : Add code (can be called "08", "09" and "0A")
  329. -----------------------
  330. 1 line code.
  331. 0.2.x
  332. -----
  333. 1 line code.
  334. 8wXXXXXX Y1Y2Y3Y4
  335. (w < 8!)
  336. Address = (0x8wXXXXXX AND 0x81FFFFFF).
  337. Size = (Address >> 25) AND 0x03.
  338. if Size = 0 [80] :
  339. Loads byte stored at [Address], adds Y1Y2Y3Y4 to it, and stores the
  340. resulting byte
  341. (= result AND 0xFF) at [Address].
  342. if Size = 1 [82] :
  343. Loads halfword stored at [Address], adds Y1Y2Y3Y4 to it, and stores the
  344. resulting halfword
  345. (= result AND 0xFFFF) at [Address].
  346. if Size = 2 [84] :
  347. Loads word stored at [Address], adds Y1Y2Y3Y4 to it, and stores the result
  348. at [Address].
  349. if Size = 3 [86] :
  350. Loads floating value stored at [Address], adds Y1Y2Y3Y4 (must be a
  351. floating point single precision value)
  352. to it, and stores the result at [Address].
  353. Change ADD to AND :
  354. ------------------
  355. This code was 'created' by me (kenobi).
  356. The only way to use it is to enter and enable the 'Enabler' code.
  357. You also HAVE TO add the Master Code flag to these Enabler codes'
  358. indentifier
  359. (or to include it into the (m) code), else they won't work properly.
  360. Finally, the 'Enabler' codes and the actual codes must be entered
  361. separately.
  362. This change is definitive (until you reboot the Game) :
  363. Enable 8-bits AND :
  364. 0400200C 7C002038
  365. Enable 16-bits AND :
  366. 0400201C 7C002038
  367. Enable 32-bits AND :
  368. 0400202C 7C002038
  369. Enable 8~32bits AND :
  370. 00000000 8400200C
  371. 7C002038 00030004
  372. Change ADD to OR :
  373. ------------------
  374. This code was 'created' by me (kenobi).
  375. The only way to use it is to enter and enable the 'Enabler' code.
  376. You also HAVE TO add the Master Code flag to these Enabler codes'
  377. indentifier
  378. (or to include it into the (m) code), else they won't work properly.
  379. Finally, the 'Enabler' codes and the actual codes must be entered
  380. separately.
  381. This change is definitive (until you reboot the Game) :
  382. Enable 8-bits OR :
  383. 0400200C 7C002378
  384. Enable 16-bits OR :
  385. 0400201C 7C002378
  386. Enable 32-bits OR :
  387. 0400202C 7C002378
  388. Enable 8~32bits OR :
  389. 00000000 8400200C
  390. 7C002378 00030004
  391. Note : you can't mix 'ADD', 'AND' and 'OR' codes for the same code type
  392. (8/16/32bits).
  393. ----------------------------------------------
  394. // SubType 3 : Master Code & Write to CCXXXXXX (can be called "0E" and "0F")
  395. ----------------------------------------------
  396. 1 line code.
  397. 0.3.x
  398. -----
  399. 1 line code.
  400. CwXXXXXX Y1Y2Y3Y4
  401. (w < 8!)
  402. Address = ((0x6wXXXXXX) AND 0x01FFFFFF) OR 0x80000000).
  403. Size = (Address >> 25) AND 0x03.
  404. If Size = 2 (0.3.2) : Master Code (C4XXXXXX Y1Y2Y3Y4)
  405. -----------------------------------------------------
  406. Y4 = Master Code Number.
  407. 0x00 : executed only once, just before the game bootup.
  408. Only one (m) code can have the '00' number (the others will be
  409. skipped),
  410. and it must be the very one in the (m) code list (else it'll be
  411. skipped).
  412. 0x01~0x0F : executed continuously during the game execution.
  413. (2 (or more) master codes that have the same Master Code
  414. Number can't
  415. be executed correctly if they are put one just after
  416. another.
  417. Only the first one will be executed, the other(s) will be
  418. skipped).
  419. Y3 = number of codes to execute each time the AR "has the hand".
  420. Y2 AND 0x03 = Master Code Type :
  421. Type 0 : create a branch to SUBROUTINE 1.
  422. (Save : R0 R3 R28 R29 R30 R31)
  423. Type 1 : backup 4 asm lines from the game, and write a Branch to MAIN
  424. ROUTINE.
  425. (Save : R3 R28 R29 R30 R31, Destroys : R0?)
  426. Type 2 : create a branch to 1 copy of SUBROUTINE 1.
  427. (Save : R0 R3 R28 R29 R30 R31)
  428. Type 3 : create a branch to MAIN ROUTINE START (will execute the 4 asm lines
  429. backed up
  430. in Type 1, if any).
  431. (Save : R0 R3 R28 R29 R30 R31)
  432. Note : Putting random numbers in Y1 should change the encryption, thus
  433. "signing" your
  434. code (untested).
  435. Note : Don't use the Type 1 alone with a Master Code Number >0, else the AR
  436. will backup its own
  437. hook, and enter an infinite loop. So put a conditional code type make
  438. that this code isn't
  439. executed more than once.
  440. If (Size = 3) AND ((address AND 0x01FFFFFF ) < 0x01000000) (0.3.3):
  441. -------------------------------------------------------------------
  442. Write halfword to CCXXXXXX (C6XXXXXX Y1Y2Y3Y4)
  443. ----------------------------------------------
  444. Address = 0xCCXXXXXX
  445. Stores the halfword Y3Y4 at Address.
  446. Note : Putting random numbers in Y1Y2 should change the encryption, thus
  447. "signing" your
  448. code (untested).
  449. If (Size = 3) AND ((address AND 0x01FFFFFF ) >= 0x01000000) (0.3.3):
  450. --------------------------------------------------------------------
  451. Write word to CDXXXXXX (C7XXXXXX Y1Y2Y3Y4)
  452. ------------------------------------------
  453. Address = 0xCDXXXXXX
  454. Stores the word Y1Y2Y3Y4 at Address.
  455. Note : Parasyte informed me that writing to 0xCDXXXXXX doesn't makes any
  456. sense, and he thinks
  457. it might be some kind of AR bug...
  458. **************************************************
  459. * NOTES FOR ALL CONDITIONAL CODES (TYPE 1 TO 7). *
  460. **************************************************
  461. All the Conditional Codes are 1 line code, but you "need" to add another
  462. line to make them work.
  463. Conditional Code are used to trigger the next code(s) when an event happens,
  464. for exemple give the
  465. player 99 lifes when buttons L+R are pushed, or make the life becomes full
  466. when it reaches 50%
  467. of its value...
  468. They all come in 3 "flavors" : 8, 16 and 32 bits. You select it by changing
  469. the size data in the code.
  470. Reminder : Size = (Address >> 25) AND 0x03
  471. For all the Conditional Codes, you first take the value of the IN GAME data,
  472. and compare it to
  473. the value provided in the CODE data. The result, which should be read as
  474. 'True' (or 'False'), will
  475. tell if the Conditional Code will activate the next codes.
  476. Anyway, Conditional Codes should be used by advanced code makers.
  477. And don't ask for the "paddle" values, they seem to change for every game...
  478. So find them yourself :-)
  479. The number I give as exemples has been made using BYTE size :
  480. 08XXXXXX YYYYYY is the "If equal execute next code" generic value for a BYTE
  481. comparison.
  482. For halfwords, it'll be 0AXXXXXX YYYYYYYY, and for words 0CXXXXXX
  483. YYYYYYYY...
  484. --------------------------
  485. // Type 1 : If equal... // (can be called "10", "11" and "12")
  486. --------------------------
  487. 1.y.x
  488. -----
  489. 08XXXXXX YYYYYYYY
  490. (w >= 8!)
  491. Subtype 0 [08] : If equal, execute next line (else skip next line).
  492. Subtype 1 [48] : If equal, execute next 2 lines (else skip next 2 lines).
  493. Sybtype 2 [88] : If equal, execute all the codes below this one in the same
  494. row (else execute
  495. none of the codes below).
  496. Subtype 3 [C8] : While NOT EQUAL,turn off all codes (infinite loop on the
  497. code).
  498. ------------------------------
  499. // Type 2 : If NOT equal... // (can be called "20", "21" and "22")
  500. ------------------------------
  501. 2.y.x
  502. -----
  503. 10XXXXXX YYYYYYYY
  504. Subtype 0 [10] : If NOT equal, execute next line (else skip next line).
  505. Subtype 1 [50] : If NOT equal, execute next 2 lines (else skip next 2
  506. lines).
  507. Sybtype 2 [90] : If NOT equal, execute all the codes below this one in the
  508. same row (else execute
  509. none of the codes below).
  510. Subtype 3 [D0] : While EQUAL, turn off all codes (infinite loop on the
  511. code).
  512. ------------------------------------
  513. // Type 3 : If lower... (signed) // (can be called "30", "31" and "32")
  514. ------------------------------------
  515. Signed means :
  516. For Bytes : values go from -128 to +127.
  517. For Halfword : values go from -32768/+32767.
  518. For Words : values go from -2147483648 to 2147483647.
  519. For exemple, for the Byte comparison, 7F (127) will be > to FFFFFFFF (-1).
  520. You HAVE to enter a 32bits signed number as value, even if you just want to
  521. make an halfword
  522. comparison. That's because 0000FFFF = 65535, and FFFFFFFF = -1).
  523. You could choose any value (for exemple, +65536 for halfword code, but the
  524. result will be always True
  525. (or always False if you choose -65537...).
  526. 3.y.x
  527. -----
  528. 18XXXXXX YYYYYYYY
  529. * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING *
  530. WARNING * WARNING *
  531. If you used a "byte" size, this Type 3 code will actually be a "If lower...
  532. (UNSIGNED)" !
  533. That means, no signed comparison for byte values !!! (AR bug?)
  534. * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING *
  535. WARNING * WARNING *
  536. Subtype 0 [18] : If lower, execute next line (else skip next line).
  537. Subtype 1 [58] : If lower, execute next 2 lines (else skip next 2 lines).
  538. Sybtype 2 [98] : If lower, execute all the codes below this one in the same
  539. row (else execute
  540. none of the codes below).
  541. Subtype 3 [D8] : While higher, turn off all codes (infinite loop on the
  542. code).
  543. Note 1 : For 8 and 16 bits codes, you *could* fill the unused numbers in the
  544. Value to change
  545. the encrypted code, and "sign" them (unverified).
  546. ------------------------------------
  547. // Type 4 : If higher... (signed) // (can be called "40", "41" and "42")
  548. ------------------------------------
  549. Signed means :
  550. For Bytes : values go from -128 to +127.
  551. For Halfword : values go from -32768/+32767.
  552. For Words : values go from -2147483648 to 2147483647.
  553. For exemple, for the Byte comparison, 7F (127) will be > to FFFFFFFF (-1).
  554. You HAVE to enter a 32bits signed number as value, even if you just want to
  555. make an halfword
  556. comparison. That's because 0000FFFF = 65535, and FFFFFFFF = -1).
  557. You could choose any value (for exemple, +65536 for halfword code, but the
  558. result will be always True
  559. (or always False if you choose -65537...).
  560. 4.y.x
  561. -----
  562. 20XXXXXX YYYYYYYY
  563. * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING *
  564. WARNING * WARNING *
  565. If you used a "byte" size, this Type 4 code will actually be a "If lower...
  566. (UNSIGNED)" !
  567. That means, no signed comparison for byte values !!! (AR bug?)
  568. * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING * WARNING *
  569. WARNING * WARNING *
  570. Subtype 0 [20] : If higher, execute next line (else skip next line).
  571. Subtype 1 [60] : If higher, execute next 2 lines (else skip next 2 lines).
  572. Sybtype 2 [A0] : If higher, execute all the codes below this one in the same
  573. row (else execute
  574. none of the codes below).
  575. Subtype 3 [E0] : While lower, turn off all codes (infinite loop on the
  576. code).
  577. Note 1 : For 8 and 16 bits codes, you *could* fill the unused numbers in the
  578. Value to change
  579. the encrypted code, and "sign" them (unverified).
  580. -------------------------------------
  581. // Type 5 : If lower... (unsigned) // (can be called "50", "51" and "52")
  582. -------------------------------------
  583. Unsigned means :
  584. For Bytes : values go from 0 to +255.
  585. For Halfword : values go from 0 to +65535.
  586. For Words : values go from 0 to 4294967295.
  587. For exemple, for the Byte comparison, 7F (127) will be < to FF (255).
  588. 5.y.x
  589. -----
  590. 28XXXXXX YYYYYYYY
  591. Subtype 0 [28] : If lower, execute next line (else skip next line).
  592. Subtype 1 [68] : If lower, execute next 2 lines (else skip next 2 lines).
  593. Sybtype 2 [A8] : If lower, execute all the codes below this one in the same
  594. row (else execute
  595. none of the codes below).
  596. Subtype 3 [E8] : While higher, turn off all codes (infinite loop on the
  597. code).
  598. --------------------------------------
  599. // Type 6 : If higher... (unsigned) // (can be called "60", "61" and "62")
  600. --------------------------------------
  601. Unsigned means :
  602. For Bytes : values go from 0 to +255.
  603. For Halfword : values go from 0 to +65535.
  604. For Words : values go from 0 to 4294967295.
  605. For exemple, for the Byte comparison, 7F (127) will be < to FF (255).
  606. 6.y.x
  607. -----
  608. 30XXXXXX YYYYYYYY
  609. Subtype 0 [30] : If higher, execute next line (else skip next line).
  610. Subtype 1 [70] : If higher, execute next 2 lines (else skip next 2 lines).
  611. Sybtype 2 [B0] : If higher, execute all the codes below this one in the same
  612. row (else execute
  613. none of the codes below).
  614. Subtype 3 [F0] : While lower, turn off all codes (infinite loop on the
  615. code).
  616. ------------------------
  617. // Type 7 : If AND... // (can be called "70", "71" and "72")
  618. ------------------------
  619. (if the result of ANDing the IN GAME and IN CODE values is <>0)
  620. 7.y.x
  621. -----
  622. 38XXXXXX YYYYYYYY
  623. Subtype 0 [38] : If AND, execute next line (else skip next line).
  624. Subtype 1 [78] : If AND, execute next 2 lines (else skip next 2 lines).
  625. Sybtype 2 [B8] : If AND, execute all the codes below this one in the same
  626. row (else execute
  627. none of the codes below).
  628. Subtype 3 [F8] : While NOT AND, turn off all codes (infinite loop on the
  629. code).
  630. * THE END *