找回密码
 注册
搜索

[L2] [T-25143]ラングリッサー2魔族編开发讨论专贴

[复制链接]
 楼主| 发表于 2009-6-12 08:32 | 显示全部楼层
MD的反彙編腳本.Kaneda
能理解這個的都歡迎加入能與我一同研究,我也會盡量交流我所知道的知識.

  1. // // IDC File to disassemble Sega Genesis/Megadrive rom
  2. // by Kaneda
  3. // // Useage:
  4. // launch IDA with "idag -a -p68000 -Smida.idc"
  5. // Select your .bin file
  6. // Press OK to the 2 dialog boxes following
  7. // // 0.1 (12 Nov 2004 ): Initial release
  8. // 0.2 (01 Jun 2005 ): Support for start adress <0x200 (skip header)
  9. // // Update on http://www.consoledev.fr.st
  10. //
  11. #include

  12. //-------------------------------------------------------------------------
  13. static CW(off,name,cmt) {
  14. auto x;
  15. x = off;
  16. MakeWord(x);
  17. MakeName(x,name);
  18. MakeRptCmt(x,cmt);
  19. }

  20. //-------------------------------------------------------------------------
  21. static CD(off,name,cmt) {
  22. auto x;
  23. x = off;
  24. MakeDword(x);
  25. MakeName(x,name);
  26. MakeRptCmt(x,cmt);
  27. }

  28. //-------------------------------------------------------------------------
  29. static CB(off,name,cmt) {
  30. auto x;
  31. x = off;
  32. MakeByte(x);
  33. MakeName(x,name);
  34. MakeRptCmt(x,cmt);
  35. }

  36. static CS(off,end,name,cmt) {
  37. auto x;
  38. x = off;
  39. MakeStr(x, end);
  40. MakeName(x,name);
  41. MakeRptCmt(x,cmt);
  42. }

  43. static mdVector( ) {
  44. auto i, addr;

  45. CD(0x00, "initStack", "Initial Stack");
  46. CD(0x04, "startAddress", "Start Address");
  47. CD(0x08, "", "Bus Error");
  48. CD(0x0C, "", "Address Error");
  49. CD(0x10, "", "Illegal instruction");
  50. CD(0x14, "", "Zero Divide");
  51. CD(0x18, "", "CHK instruction");
  52. CD(0x1C, "", "TRAPV instruction");
  53. CD(0x20, "", "Privilege Violation");
  54. CD(0x24, "", "Trace");
  55. CD(0x28, "", "Line 1010 Emulator");
  56. CD(0x2C, "", "Line 1111 Emulator");
  57. CD(0x30, "", "Reserved");
  58. CD(0x34, "", "Reserved");
  59. CD(0x38, "", "Reserved");
  60. CD(0x3C, "", "Unitialized Interrrupt");
  61. CD(0x40, "", "Reserved");
  62. CD(0x44, "", "Reserved");
  63. CD(0x48, "", "Reserved");
  64. CD(0x4C, "", "Reserved");
  65. CD(0x50, "", "Reserved");
  66. CD(0x54, "", "Reserved");
  67. CD(0x58, "", "Reserved");
  68. CD(0x5C, "", "Reserved");
  69. CD(0x60, "", "Spurious Interrupt");
  70. CD(0x64, "", "Level 1 interrupt");
  71. CD(0x68, "", "Level 2/External interrupt");
  72. CD(0x6C, "", "Level 3 interrupt");
  73. CD(0x70, "", "Level 4/Horizontal interrupt");
  74. CD(0x74, "", "Level 5 interrupt");
  75. CD(0x78, "", "Level 6/Vertical interrupt");
  76. CD(0x7C,"", "Level 7 interrupt");

  77. i=0x80;
  78. while (i <= 0xBC){
  79. CD(i,"", "Trap");
  80. i = i+1;
  81. }

  82. i=0xC0;
  83. while (i <= 0xFF){
  84. CD(i,"", "Reserved");
  85. i = i+1;
  86. }

  87. for ( i=0x08; i< 0x200; i=i+4 ) {
  88. addr = Dword( i );
  89. MakeCode(addr);
  90. }
  91. }

  92. static mdHeader( ) {
  93. auto addr;

  94. addr = Dword( 0x04 );
  95. if (addr < 0x200)
  96. {
  97. Warning("Start address unusual");
  98. return;
  99. }
  100. CS(0x100,0x110,"","Console name");
  101. CS(0x110,0x120,"","Release company/date");
  102. CS(0x120,0x130,"","Domestic name");
  103. CS(0x130,0x140,"","");
  104. CS(0x140,0x150,"","");
  105. CS(0x150,0x160,"","International name");
  106. CS(0x160,0x170,"","");
  107. CS(0x170,0x180,"","");
  108. CS(0x180,0x18D,"","Version/Serial Number");
  109. CW(0x18E, "CheckSum","Checksum");
  110. CS(0x190,0x1A0,"","I/O support");
  111. CD(0x1A0, "RomStartAdr", "Rom Start Adress");
  112. CD(0x1A4, "RomEndAdr", "Rom End Adress");
  113. CD(0x1A8, "RamStartAdr", "Ram Start Adress");
  114. CD(0x1AC, "RamEndAdr", "Ram End Adress");
  115. CS(0x1B0, 0x1BC, "", "SRam data");
  116. CS(0x1BC, 0x1C8, "", "Modem data");
  117. CS(0x1C8, 0x1DC, "", "Memo");
  118. CS(0x1DC, 0x1F0, "", "");
  119. CS(0x1F0, 0x200, "Country", "Countries codes");
  120. }

  121. static mdAddress( ){
  122. CD(0xC00000, "VDP_Data","");
  123. CD(0xC00004, "VDP_Control","");
  124. CD(0xC00008, "HV_Counter","");
  125. CB(0xC00011, "PSG","");

  126. CW(0xA10001, "HW_Info","7-MODE (R) 0: Domestic Model\n"
  127. " 1: Overseas Model\n"
  128. "6-VMOD (R) 0: NTSC CPU clock 7.67 MHz\n"
  129. " 1: PAL CPU clock 7.60 MHz\n"
  130. "5-DISK (R) 0: FDD unit connected\n"
  131. " 1: FDD unit not connected\n"
  132. "4-RSV (R) Currently not used\n"
  133. "3-0 VER (R) MEGA DRIVE version ($0 to $F)");

  134. CW(0xA10003,"DATA1", "PD7 (RW)\n"
  135. "PD6 (RW) TH\n"
  136. "PD5 (RW) TR\n"
  137. "PD4 (RW) TL\n"
  138. "PD3 (RW) RIGHT\n"
  139. "PD2 (RW) LEFT\n"
  140. "PD1 (RW) DOWN\n"
  141. "PDO (RW) UP\n" );
  142. CW(0xA10005,"DATA2","");
  143. CW(0xA10007,"DATA3","");
  144. CW(0xA10009,"CTRL1", "INT (RW) 0: TH-INT PROHIBITED\n"
  145. " 1: TH-INT ALLOWED\n"
  146. "PC6 (RW) 0: PD6 INPUT MODE\n"
  147. " 1: OUTPUT MODE\n"
  148. "PC5 (RW) 0: PD5 INPUT MODE\n"
  149. " 1: OUTPUT MODE\n"
  150. "PC4 (RW) 0: PD4 INPUT MODE\n"
  151. " 1: OUTPUT MODE\n"
  152. "PC3 (RW) 0: PD3 INPUT MODE\n"
  153. " 1: OUTPUT MODE\n"
  154. "PC2 (RW) 0: PD2 INPUT MODE\n"
  155. " 1: OUTPUT MODE\n"
  156. "PC1 (RW) 0: PD1 INPUT MODE\n"
  157. " 1: OUTPUT MODE\n"
  158. "PCO (RW) 0: PDO INPUT MODE\n"
  159. " 1: OUTPUT MODE");
  160. CW(0xA1000B,"CTRL2","");
  161. CW(0xA1000D,"CTRL3","");
  162. CW(0xA1000F,"TxDATA1","");
  163. CW(0xA10011,"RxDATA1","");
  164. CW(0xA10013,"SCTRL1","");
  165. CW(0xA10015,"TxDATA2","");
  166. CW(0xA10017,"RxDATA2","");
  167. CW(0xA10019,"SCTRL2","");
  168. CW(0xA1001B,"TxDATA3","");
  169. CW(0xA1001D,"RxDATA3","");
  170. CW(0xA1001F,"SCTRL3","");

  171. CW(0xA11000,"MemMode", "D8 ( W) 0: ROM MODE\n"
  172. " 1: D-RAM MODE");

  173. CW(0xA11100,"Z80BusReq","D8 ( W) 0: BUSREQ CANCEL\n"
  174. " 1: BUSREQ REQUEST\n"
  175. " ( R) 0: CPU FUNCTION STOP ACCESSIBLE\n"
  176. " 1: FUNCTIONING");
  177. CW(0xA11200,"Z80BusReset","D8 ( W) 0: RESET REQUEST\n"
  178. " 1: RESET CANCEL");
  179. }

  180. //-------------------------------------------------------------------------
  181. static main() {
  182. auto addr;

  183. SetPrcsr( "68000");

  184. SegCreate(0x000000,0x3FFFFF,0,0,0,2);
  185. SegRename(0x000000,"ROM");

  186. SegCreate(0xA00000,0xA0FFFF,0,0,0,2);
  187. SegRename(0xA00000,"Z80");

  188. SegCreate(0xA10000,0xA10FFF,0,0,0,2);
  189. SegRename(0xA10000,"IO");

  190. SegCreate(0xA11000,0xA11FFF,0,0,0,2);
  191. SegRename(0xA11000,"Control");

  192. SegCreate(0xC00000,0xDFFFFF,0,0,0,2);
  193. SegRename(0xC00000,"VDP");

  194. SegCreate(0xFF0000,0xFFFFFF,0,0,0,2);
  195. SegRename(0xFF0000,"RAM");

  196. mdVector( );
  197. mdHeader( );
  198. mdAddress( );

  199. addr = Dword( 0x04 );
  200. MakeName(addr,"main");
  201. //MakeCode(addr);
  202. MakeFunction(addr,BADADDR);
  203. Wait( );

  204. addr = Dword( 0x68 );
  205. MakeName(addr,"EInt");
  206. //MakeCode(addr);
  207. MakeFunction(addr,BADADDR);
  208. Wait( );

  209. addr = Dword( 0x70 );
  210. MakeName(addr,"HInt");
  211. //MakeCode(addr);
  212. MakeFunction(addr,BADADDR);
  213. Wait( );

  214. addr = Dword( 0x78 );
  215. MakeName(addr,"VInt");
  216. //MakeCode(addr);
  217. MakeFunction(addr,BADADDR);
  218. Wait( );
  219. }
复制代码
 楼主| 发表于 2009-6-12 08:49 | 显示全部楼层
本帖最后由 フラナガン機關 于 2009-6-13 13:11 编辑

-
至於命令前面#103時已經說過了:
http://www.langrissera.com/forum ... p;page=11#pid163500

-

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
发表于 2009-6-12 18:38 | 显示全部楼层
複雜的可以。。
发表于 2009-6-12 18:41 | 显示全部楼层
機關你也想多做些其他新的兵種嗎?
 楼主| 发表于 2009-6-12 23:35 | 显示全部楼层
本帖最后由 フラナガン機關 于 2009-6-13 23:08 编辑

首先謝謝哥哥的關注。
還不能明確說,因爲我還沒有徹底研究透,至今也還沒人願意幫助我,現在只能完全靠自己摸索,下班時間也不多,各種自定義方面還不到完全實用化階段,不過我也想去實現更多........做出更理想的..................




曾看過ken_tse這莫一段其中一種壓縮圖片(LZSS压缩)反彙編的M68000命令:
大航海时代2的图片解压缩,从源代码可以看和传统LZSS压缩差不多,下面是源代码:
不過還是不太理解....

  1. seg000:00003FB4 sub_3FB4: ; CODE XREF: sub_B744+3Ep
  2. seg000:00003FB4 ; sub_F6EC+2Ap ...
  3. seg000:00003FB4
  4. seg000:00003FB4 arg_0 = 4
  5. seg000:00003FB4 arg_4 = 8
  6. seg000:00003FB4
  7. seg000:00003FB4 movem.l d2-d7/a2-a6,-(sp)
  8. seg000:00003FB8 movea.l $2C+arg_0(sp),a0
  9. seg000:00003FBC movea.l $2C+arg_4(sp),a1
  10. seg000:00003FC0 movea.l #$FF8D54,a3
  11. seg000:00003FC6 movea.l #$3EB2,a4
  12. seg000:00003FCC movea.l #$C00000,a5
  13. seg000:00003FD2 movea.l #$C00004,a6
  14. seg000:00003FD8 clr.w ($FFA916).l
  15. seg000:00003FDE pea ($10).w
  16. seg000:00003FE2 jsr (a4)
  17. seg000:00003FE4 addq.l #4,sp
  18. seg000:00003FE6
  19. seg000:00003FE6 loc_3FE6: ; CODE XREF: sub_3FB4+25Ej
  20. seg000:00003FE6 move.b (a1)+,($FF7454).l ; 开始解压缩图片数据
  21. seg000:00003FEC clr.w d4
  22. seg000:00003FEE
  23. seg000:00003FEE loc_3FEE: ; CODE XREF: sub_3FB4+25Aj
  24. seg000:00003FEE move.b ($FF7454).l,d0
  25. seg000:00003FF4 btst #7,d0
  26. seg000:00003FF8 beq.s loc_4006
  27. seg000:00003FFA move.b (a1)+,d0
  28. seg000:00003FFC jsr sub_3F62
  29. seg000:00004000
  30. seg000:00004000 loc_4000: ; DATA XREF: sub_10AC0:loc_10AE6o
  31. seg000:00004000 ; sub_134CC+22o ...
  32. seg000:00004000 addq.l #1,a0
  33. seg000:00004002 bra.w loc_41FC
  34. seg000:00004006 ; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪?
  35. seg000:00004006
  36. seg000:00004006 loc_4006: ; CODE XREF: sub_3FB4+44j
  37. seg000:00004006 move.w (a3),d0
  38. seg000:00004008 andi.w #$8000,d0
  39. seg000:0000400C beq.s loc_4014
  40. seg000:0000400E moveq #1,d3
  41. seg000:00004010 bra.w loc_40CA
  42. seg000:00004014 ; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪?
  43. seg000:00004014
  44. seg000:00004014 loc_4014: ; CODE XREF: sub_3FB4+58j
  45. seg000:00004014 move.w (a3),d0
  46. seg000:00004016 andi.w #$4000,d0
  47. seg000:0000401A beq.s loc_4030
  48. seg000:0000401C move.w (a3),d3
  49. seg000:0000401E andi.l #$6000,d3
  50. seg000:00004024 moveq #$D,d0
  51. seg000:00004026 asr.l d0,d3
  52. seg000:00004028 pea (2).w
  53. seg000:0000402C bra.w loc_40C6
  54. seg000:00004030 ; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪?
  55. seg000:00004030
  56. seg000:00004030 loc_4030: ; CODE XREF: sub_3FB4+66j
  57. seg000:00004030 move.w (a3),d0
  58. seg000:00004032 andi.w #$2000,d0
  59. seg000:00004036 beq.s loc_404A
  60. seg000:00004038 move.w (a3),d3
  61. seg000:0000403A andi.l #$3800,d3
  62. seg000:00004040 moveq #$B,d0
  63. seg000:00004042 asr.l d0,d3
  64. seg000:00004044 pea (4).w
  65. seg000:00004048 bra.s loc_40C6
  66. seg000:0000404A ; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪?
  67. seg000:0000404A
  68. seg000:0000404A loc_404A: ; CODE XREF: sub_3FB4+82j
  69. seg000:0000404A move.w (a3),d0
  70. seg000:0000404C andi.w #$1000,d0
  71. seg000:00004050 beq.s loc_4064
  72. seg000:00004052 move.w (a3),d3
  73. seg000:00004054 andi.l #$1E00,d3
  74. seg000:0000405A moveq #9,d0
  75. seg000:0000405C asr.l d0,d3
  76. seg000:0000405E pea (6).w
  77. seg000:00004062 bra.s loc_40C6
  78. seg000:00004064 ; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪?
  79. seg000:00004064
  80. seg000:00004064 loc_4064: ; CODE XREF: sub_3FB4+9Cj
  81. seg000:00004064 move.w (a3),d0
  82. seg000:00004066 andi.w #$800,d0
  83. seg000:0000406A beq.s loc_407C
  84. seg000:0000406C move.w (a3),d3
  85. seg000:0000406E andi.l #$F80,d3
  86. seg000:00004074 asr.l #7,d3
  87. seg000:00004076 pea (8).w
  88. seg000:0000407A bra.s loc_40C6
  89. seg000:0000407C ; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪?
  90. seg000:0000407C
  91. seg000:0000407C loc_407C: ; CODE XREF: sub_3FB4+B6j
  92. seg000:0000407C move.w (a3),d0
  93. seg000:0000407E andi.w #$400,d0
  94. seg000:00004082 beq.s loc_4094
  95. seg000:00004084 move.w (a3),d3
  96. seg000:00004086 andi.l #$7E0,d3
  97. seg000:0000408C asr.l #5,d3
  98. seg000:0000408E pea ($A).w
  99. seg000:00004092 bra.s loc_40C6
  100. seg000:00004094 ; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪?
  101. seg000:00004094
  102. seg000:00004094 loc_4094: ; CODE XREF: sub_3FB4+CEj
  103. seg000:00004094 move.w (a3),d0
  104. seg000:00004096 andi.w #$200,d0
  105. seg000:0000409A beq.s loc_40AC
  106. seg000:0000409C move.w (a3),d3
  107. seg000:0000409E andi.l #$3F8,d3
  108. seg000:000040A4 asr.l #3,d3
  109. seg000:000040A6 pea ($C).w
  110. seg000:000040AA bra.s loc_40C6
  111. seg000:000040AC ; 哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪哪?
  112. seg000:000040AC
  113. seg000:000040AC loc_40AC: ; CODE XREF: sub_3FB4+E6j
  114. seg000:000040AC move.w (a3),d3
  115. seg000:000040AE andi.l #$1FC,d3
  116. seg000:000040B4 asr.l #2,d3
  117. seg000:000040B6 addi.w #$80,d3 ; '
复制代码
发表于 2009-6-13 00:12 | 显示全部楼层
机关该休息啦
 楼主| 发表于 2009-6-13 05:04 | 显示全部楼层
昨晚你説話的同時就休息了。
剛醒來!
壞迪一日不見你又變美女了!~快把你頭像原尺寸的發出來!..... 我要....
发表于 2009-6-13 15:30 | 显示全部楼层
种子还要么?

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

×
 楼主| 发表于 2009-6-13 16:03 | 显示全部楼层
今天去這裡看了半天,學習到不少知識,等我能靈活運用時遊戲中各種條件與和因素應該都可以加入了~
技術一併共享出來,感興趣的也可以去學習
只是相對日文來説,我英文理解不太樂觀....
http://www.hacking-cult.org/?r/18

其中的這些都很實用:
ASM Guide:
1. Basics
2. Let's start
3. Compares, branches...
4. Logical operations
5. Editing the game code
6. Loops & arrays

Genesis informations:
1. 68000 memory map
2. ROM header
3. Genesis security
4. I/O ports
5. VDP
6. DMA
7. VDP programming calculator
发表于 2009-6-13 17:04 | 显示全部楼层
本帖最后由 好迪 于 2009-6-13 17:14 编辑

限时发售
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|虎纹猫家园

GMT+8, 2024-11-22 22:46 , Processed in 0.023868 second(s), 12 queries .

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表