Advertisement
Guest User

M88kai+ patch (cheat code) function

a guest
Oct 12th, 2011
427
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.84 KB | None | 0 0
  1. M88kai+ patch (cheat code) function
  2.  
  3. [Intro]
  4. This is a translation of the P88SR patch documentation, which was the basis for the patch (cheat code) feature in M88kai+.
  5.  
  6. [Usage]
  7. Create a text file in the format below and change the extension to .PAT. The patch file will load automatically with a game if it has the same name as the game and is in the same directory.
  8.  
  9. [Format]
  10. ------------
  11. ; ... Comments
  12.  
  13. # name1 ... Name of code, 20 letters max (also applies to M88?)
  14. code1
  15. code2
  16.  
  17. # name2
  18. code3
  19. code4
  20. .
  21. .
  22. .
  23. # name15 ... maximum of 15 individual code groups (also applies to M88?)
  24. code63
  25. code64 ... maximum of 64 individual codes (also applies to M88?)
  26. ------------
  27.  
  28. [Ys example]
  29. Ys1.D88 Game disk image
  30. Ys1.PAT Patch file
  31.  
  32. Content of Ys1.PAT:
  33. ------------
  34. ;
  35. ; Ys patch
  36. ;
  37. #HP MAX
  38. D00047CF 4B00
  39. 80004B00 FFFF
  40.  
  41. #GOLD MAX
  42. D00047CF 4B00
  43. 80004B04 FFFF
  44.  
  45. #EXP MAX
  46. D00047CF 4B00
  47. 80004B06 FFFF
  48. ------------
  49.  
  50. [Codes]
  51. All codes are in hexadecimal.
  52. aa = RAM/ROM type
  53. bbbb = address
  54. yyzz = data
  55.  
  56. aa Location Address range (bbbb)
  57. -----------------------------------------
  58. 00 Main RAM 0000-FFFF
  59. 01 N88BASIC ROM 0000-5FFF
  60. 02 High-speed RAM F000-FFFF
  61. 03 Sub-CPU RAM 4000-7FFF
  62. 04 Sub-CPU ROM 0000-1FFF
  63. 05 NBASIC ROM 6000-7FFF
  64. 06 NBASIC ROM 0000-5FFF
  65. 07 N88BASIC ROM 6000-7FFF
  66. 08 E0-ROM 6000-7FFF
  67. 09 E1-ROM 6000-7FFF
  68. 0A E2-ROM 6000-7FFF
  69. 0B E3-ROM 6000-7FFF
  70. 0C Ext. RAM-bank0 0000-7FFF
  71. 0D Ext. RAM-bank1 0000-7FFF
  72. 0E Ext. RAM-bank2 0000-7FFF
  73. 0F Ext. RAM-bank3 0000-7FFF
  74.  
  75. [1] Write commands
  76.  
  77. [1-1] Overwrite
  78.  
  79. 80aabbbb yyzz 16-bit
  80. 30aabbbb yyzz 8-bit (zz only)
  81.  
  82. Writes the value yyzz/zz to the specified address (aabbbb).
  83.  
  84. [1-2] Add
  85.  
  86. 10aabbbb yyzz 16-bit
  87. 20aabbbb yyzz 8-bit (zz only)
  88.  
  89. Continually adds the value yyzz/zz to the value at the specified address (aabbbb).
  90.  
  91. [1-3] Subtract
  92.  
  93. 11aabbbb yyzz 16-bit
  94. 21aabbbb yyzz 8-bit (zz only)
  95.  
  96. Continually subtracts the value yyzz/zz to the value at the specified address (aabbbb).
  97.  
  98. Typically, the add/subtract commands are used in conjunction with the compare commands below.
  99.  
  100.  
  101. [2] Compare commands
  102.  
  103. [2-1] Equals
  104.  
  105. D0aabbbb yyzz 16-bit
  106. E0aabbbb yyzz 8-bit (zz only)
  107.  
  108. When the value at the specified address (aabbbb) equals yyzz/zz, the next code is evaluated.
  109.  
  110. [2-2] Does not equal
  111.  
  112. D1aabbbb yyzz 16-bit
  113. E1aabbbb yyzz 8-bit (zz only)
  114.  
  115. When the value at the specified address (aabbbb) does not equal yyzz/zz, the next code is evaluated.
  116.  
  117. [2-3] Less than
  118.  
  119. D2aabbbb yyzz 16-bit
  120. E2aabbbb yyzz 8-bit (zz only)
  121.  
  122. When the value at the specified address (aabbbb) is less than yyzz/zz, the next code is evaluated.
  123.  
  124. [2-4] Greater than
  125.  
  126. D3aabbbb yyzz 16-bit
  127. E3aabbbb yyzz 8-bit (zz only)
  128.  
  129. When the value at the specified address (aabbbb) is greater than yyzz/zz, the next code is evaluated.
  130.  
  131. *Multiple codes (stacking compare codes)
  132.  
  133. By stacking the compare codes D0 to D3 and E0 to E3), it is possible to apply multiple compare conditions to a single code.
  134.  
  135. Example:
  136. D0008000 0100 When the value at address 008000 is equal to 0100,
  137. E0034000 0006 and when the value at address 034000 is equal to 06,
  138. 8000D000 0713 keep address 00D000 at the value 0713.
  139.  
  140.  
  141. [3] Special codes
  142.  
  143. [3-1] Serial
  144.  
  145. Not supported in M88.
  146.  
  147.  
  148. [4] Other
  149.  
  150. [4-1] Equals (strong)
  151.  
  152. Not supported in M88.
  153.  
  154. [4-2] Timer
  155.  
  156. C1000000 zzzz
  157.  
  158. Specifies a time starting at boot up until the next code activates.
  159. The units of zzzz are approximately 1/600th of a second, so specifying 0258 (600 in decimal) gives approximately 1 min.
  160.  
  161. *In M88 the timer probably doesn't start until you activate the code group.
  162.  
  163. [4-3] Byte copy
  164.  
  165. Not supported in M88.
  166.  
  167. [4-4] Compare key input
  168.  
  169. Not supported in M88.
  170.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement