2 // IDC File to disassemble Sega Genesis/Megadrive rom
\r
6 // launch IDA with "idag -a -p68000 -Smida.idc"
\r
7 // Select your .bin file
\r
8 // Press OK to the 2 dialog boxes following
\r
10 // 0.1 (12 Nov 2004 ): Initial release
\r
11 // 0.2 (01 Jun 2005 ): Support for start adress <0x200 (skip header)
\r
13 // Update on http://www.consoledev.fr.st
\r
18 //-------------------------------------------------------------------------
\r
19 static CW(off,name,cmt) {
\r
27 //-------------------------------------------------------------------------
\r
28 static CD(off,name,cmt) {
\r
36 //-------------------------------------------------------------------------
\r
37 static CB(off,name,cmt) {
\r
45 static CS(off,end,name,cmt) {
\r
53 static mdVector( ) {
\r
56 CD(0x00, "initStack", "Initial Stack");
\r
57 CD(0x04, "startAddress", "Start Address");
\r
58 CD(0x08, "", "Bus Error");
\r
59 CD(0x0C, "", "Address Error");
\r
60 CD(0x10, "", "Illegal instruction");
\r
61 CD(0x14, "", "Zero Divide");
\r
62 CD(0x18, "", "CHK instruction");
\r
63 CD(0x1C, "", "TRAPV instruction");
\r
64 CD(0x20, "", "Privilege Violation");
\r
65 CD(0x24, "", "Trace");
\r
66 CD(0x28, "", "Line 1010 Emulator");
\r
67 CD(0x2C, "", "Line 1111 Emulator");
\r
68 CD(0x30, "", "Reserved");
\r
69 CD(0x34, "", "Reserved");
\r
70 CD(0x38, "", "Reserved");
\r
71 CD(0x3C, "", "Unitialized Interrrupt");
\r
72 CD(0x40, "", "Reserved");
\r
73 CD(0x44, "", "Reserved");
\r
74 CD(0x48, "", "Reserved");
\r
75 CD(0x4C, "", "Reserved");
\r
76 CD(0x50, "", "Reserved");
\r
77 CD(0x54, "", "Reserved");
\r
78 CD(0x58, "", "Reserved");
\r
79 CD(0x5C, "", "Reserved");
\r
80 CD(0x60, "", "Spurious Interrupt");
\r
81 CD(0x64, "", "Level 1/gfx interrupt");
\r
82 CD(0x68, "", "Level 2/md interrupt");
\r
83 CD(0x6C, "", "Level 3/timer interrupt");
\r
84 CD(0x70, "", "Level 4/cdd interrupt");
\r
85 CD(0x74, "", "Level 5/cdc interrupt");
\r
86 CD(0x78, "", "Level 6/subcode interrupt");
\r
87 CD(0x7C, "", "Level 7 interrupt");
\r
97 CD(i,"", "Reserved");
\r
101 for ( i=0x08; i< 0x200; i=i+4 ) {
\r
107 static mdHeader( ) {
\r
110 addr = Dword( 0x04 );
\r
113 Warning("Start address unusual");
\r
116 CS(0x100,0x110,"","");
\r
117 CS(0x110,0x120,"","");
\r
118 CS(0x120,0x130,"","");
\r
119 CS(0x130,0x140,"","");
\r
120 CS(0x140,0x150,"","");
\r
121 CS(0x150,0x160,"","");
\r
122 CS(0x160,0x170,"","");
\r
123 CS(0x170,0x180,"","");
\r
124 CS(0x180,0x18D,"","Serial Number");
\r
125 CW(0x18E, "CheckSum","");
\r
126 CS(0x190,0x1A0,"","");
\r
127 CD(0x1A0, "RomStartAdr", "Rom Start Adress");
\r
128 CD(0x1A4, "RomEndAdr", "Rom End Adress");
\r
129 CD(0x1A8, "RamStartAdr", "Ram Start Adress");
\r
130 CD(0x1AC, "RamEndAdr", "Ram End Adress");
\r
131 CS(0x1B0, 0x1BC, "", "SRam data");
\r
132 CS(0x1BC, 0x1C8, "", "Modem data");
\r
133 CS(0x1C8, 0x1DC, "", "Memo");
\r
134 CS(0x1DC, 0x1F0, "", "");
\r
135 CS(0x1F0, 0x200, "Country", "Countries codes");
\r
138 static mdAddress( ){
\r
139 // CD(0xC00000, "VDP_Data","");
\r
142 //-------------------------------------------------------------------------
\r
143 static MakeIrq(addr,name) {
\r
144 MakeName(addr,name);
\r
146 MakeFunction(addr,BADADDR);
\r
153 SetPrcsr( "68000");
\r
155 SegCreate(0x000000,0x07FFFF,0,1,0,2);
\r
156 SegRename(0x000000,"prg_ram");
\r
158 SegCreate(0xFE0000,0xFE3FFF,0,1,0,2);
\r
159 SegRename(0xFE0000,"bram");
\r
161 SegCreate(0xFF0000,0xFF3FFF,0,1,0,2);
\r
162 SegRename(0xFF0000,"pcm");
\r
164 SegCreate(0xFF8000,0xFF81FF,0,1,0,2);
\r
165 SegRename(0xFF8000,"regs");
\r
171 MakeIrq(Dword(0x04), "main");
\r
172 MakeIrq(Dword(0x64), "gfx_irq");
\r
173 MakeIrq(Dword(0x68), "md_irq");
\r
174 MakeIrq(Dword(0x6c), "timer_irq");
\r
175 MakeIrq(Dword(0x70), "cdd_irq");
\r
176 MakeIrq(Dword(0x74), "cdc_irq");
\r
177 MakeIrq(Dword(0x78), "subcode_irq");
\r