Advertisement
Guest User

Untitled

a guest
Mar 4th, 2011
1,168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 15.85 KB | None | 0 0
  1. diff -U 3 -H -d -r -N -- mupen64plus-bundle-src-1.99.4/source/mupen64plus-core/projects/unix/Makefile mupen64plus-bundle-src-1.99.4-new/source/mupen64plus-core/projects/unix/Makefile
  2. --- mupen64plus-bundle-src-1.99.4/source/mupen64plus-core/projects/unix/Makefile    2010-11-22 21:15:08.000000000 -0500
  3. +++ mupen64plus-bundle-src-1.99.4-new/source/mupen64plus-core/projects/unix/Makefile    2011-01-10 16:22:11.441258959 -0500
  4. @@ -242,6 +242,7 @@
  5.     $(SRCDIR)/main/eventloop.c \
  6.     $(SRCDIR)/main/md5.c \
  7.     $(SRCDIR)/main/rom.c \
  8. +   $(SRCDIR)/main/leodisk.c \
  9.     $(SRCDIR)/main/ini_reader.c \
  10.     $(SRCDIR)/main/savestates.c \
  11.     $(SRCDIR)/main/adler32.c \
  12. diff -U 3 -H -d -r -N -- mupen64plus-bundle-src-1.99.4/source/mupen64plus-core/src/main/leodisk.c mupen64plus-bundle-src-1.99.4-new/source/mupen64plus-core/src/main/leodisk.c
  13. --- mupen64plus-bundle-src-1.99.4/source/mupen64plus-core/src/main/leodisk.c    1969-12-31 19:00:00.000000000 -0500
  14. +++ mupen64plus-bundle-src-1.99.4-new/source/mupen64plus-core/src/main/leodisk.c    2011-01-10 16:44:02.089259350 -0500
  15. @@ -0,0 +1,33 @@
  16. +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  17. + *   Mupen64plus - leodisk.c                                               *
  18. + *   Mupen64Plus homepage: http://code.google.com/p/mupen64plus/           *
  19. + *   Copyright (C) 2011 jrra                                               *
  20. + *                                                                         *
  21. + *   This program is free software; you can redistribute it and/or modify  *
  22. + *   it under the terms of the GNU General Public License as published by  *
  23. + *   the Free Software Foundation; either version 2 of the License, or     *
  24. + *   (at your option) any later version.                                   *
  25. + *                                                                         *
  26. + *   This program is distributed in the hope that it will be useful,       *
  27. + *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
  28. + *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
  29. + *   GNU General Public License for more details.                          *
  30. + *                                                                         *
  31. + *   You should have received a copy of the GNU General Public License     *
  32. + *   along with this program; if not, write to the                         *
  33. + *   Free Software Foundation, Inc.,                                       *
  34. + *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.          *
  35. + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  36. +
  37. +
  38. +int leo_0000 = 0x0;
  39. +int leo_0500 = 0x0;    // seems to be "outbox"
  40. +int leo_0508 = 0x02000000; // change to 0x03000000 when disk is inserted
  41. +int leo_050c = 0x60000000; // tracking?
  42. +int leo_0510 = 0x00000040;
  43. +int leo_0514 = 0x0;
  44. +int leo_0518 = 0x0;
  45. +int leo_0520 = 0x0;
  46. +int leo_0540 = 0x00030000; // 0x00030000 for commercial drive, 0x00040000 for dev drive
  47. +
  48. +int leo_index = 1; // this should probably be nonzero at all times
  49. \ No newline at end of file
  50. diff -U 3 -H -d -r -N -- mupen64plus-bundle-src-1.99.4/source/mupen64plus-core/src/main/leodisk.h mupen64plus-bundle-src-1.99.4-new/source/mupen64plus-core/src/main/leodisk.h
  51. --- mupen64plus-bundle-src-1.99.4/source/mupen64plus-core/src/main/leodisk.h    1969-12-31 19:00:00.000000000 -0500
  52. +++ mupen64plus-bundle-src-1.99.4-new/source/mupen64plus-core/src/main/leodisk.h    2011-01-05 00:32:01.000000000 -0500
  53. @@ -0,0 +1,42 @@
  54. +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  55. + *   Mupen64plus - leodisk.h                                               *
  56. + *   Mupen64Plus homepage: http://code.google.com/p/mupen64plus/           *
  57. + *   Copyright (C) 2011 jrra                                               *
  58. + *                                                                         *
  59. + *   This program is free software; you can redistribute it and/or modify  *
  60. + *   it under the terms of the GNU General Public License as published by  *
  61. + *   the Free Software Foundation; either version 2 of the License, or     *
  62. + *   (at your option) any later version.                                   *
  63. + *                                                                         *
  64. + *   This program is distributed in the hope that it will be useful,       *
  65. + *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
  66. + *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
  67. + *   GNU General Public License for more details.                          *
  68. + *                                                                         *
  69. + *   You should have received a copy of the GNU General Public License     *
  70. + *   along with this program; if not, write to the                         *
  71. + *   Free Software Foundation, Inc.,                                       *
  72. + *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.          *
  73. + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  74. +
  75. +#ifndef __LEODISK_H__
  76. +#define __LEODISK_H__
  77. +
  78. +#include "api/m64p_types.h"
  79. +
  80. +extern int leo_0000;
  81. +extern int leo_0500;
  82. +extern int leo_0508;
  83. +extern int leo_050c;
  84. +extern int leo_0510;
  85. +extern int leo_0514;
  86. +extern int leo_0518;
  87. +extern int leo_0520;
  88. +extern int leo_0540;
  89. +
  90. +extern int leo_index;
  91. +extern int leo_temp;
  92. +
  93. +// extern long long leo_magic_bootcode_extravaganza;
  94. +
  95. +#endif /* __LEODISK_H__ */
  96. diff -U 3 -H -d -r -N -- mupen64plus-bundle-src-1.99.4/source/mupen64plus-core/src/memory/memory.c mupen64plus-bundle-src-1.99.4-new/source/mupen64plus-core/src/memory/memory.c
  97. --- mupen64plus-bundle-src-1.99.4/source/mupen64plus-core/src/memory/memory.c   2010-11-22 21:15:08.000000000 -0500
  98. +++ mupen64plus-bundle-src-1.99.4-new/source/mupen64plus-core/src/memory/memory.c   2011-01-10 16:58:27.445758695 -0500
  99. @@ -19,6 +19,7 @@
  100.   *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.          *
  101.   * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  102.  
  103. +#include <time.h>
  104.  #include <stdlib.h>
  105.  
  106.  #include "api/m64p_types.h"
  107. @@ -36,6 +37,7 @@
  108.  
  109.  #include "api/callbacks.h"
  110.  #include "main/main.h"
  111. +#include "main/leodisk.h"
  112.  #include "main/rom.h"
  113.  #include "osal/preproc.h"
  114.  #include "plugin/plugin.h"
  115. @@ -842,7 +844,7 @@
  116.     readsi[0x18] = &si_register.si_stat;
  117.    
  118.     for (i=0x1c; i<0x10000; i++) readsi[i] = &trash;
  119. -   for (i=0x481; i<0x800; i++)
  120. +   for (i=0x481; i</*0x800*/0x500; i++)
  121.       {
  122.      readmem[0x8000+i] = read_nothing;
  123.      readmem[0xa000+i] = read_nothing;
  124. @@ -861,7 +863,49 @@
  125.      writememd[0x8000+i] = write_nothingd;
  126.      writememd[0xa000+i] = write_nothingd;
  127.       }
  128. -  
  129. +    
  130. +   //init 64dd
  131. +   for (i=0x500; i<0x600; i++)
  132. +     {
  133. +    readmem[0x8000+i] = read_64dd;
  134. +    readmem[0xa000+i] = read_64dd;
  135. +    readmemb[0x8000+i] = read_64ddb;
  136. +    readmemb[0xa000+i] = read_64ddb;
  137. +    readmemh[0x8000+i] = read_64ddh;
  138. +    readmemh[0xa000+i] = read_64ddh;
  139. +    readmemd[0x8000+i] = read_64ddd;
  140. +    readmemd[0xa000+i] = read_64ddd;
  141. +    writemem[0x8000+i] = write_64dd;
  142. +    writemem[0xa000+i] = write_64dd;
  143. +    writememb[0x8000+i] = write_64ddb;
  144. +    writememb[0xa000+i] = write_64ddb;
  145. +    writememh[0x8000+i] = write_64ddh;
  146. +    writememh[0xa000+i] = write_64ddh;
  147. +    writememd[0x8000+i] = write_64ddd;
  148. +    writememd[0xa000+i] = write_64ddd;
  149. +     }
  150. +    
  151. +   //init ddrom
  152. +   for (i=0x600; i<0x800; i++)
  153. +     {
  154. +    readmem[0x8000+i] = read_ddrom;
  155. +    readmem[0xa000+i] = read_ddrom;
  156. +    readmemb[0x8000+i] = read_ddromb;
  157. +    readmemb[0xa000+i] = read_ddromb;
  158. +    readmemh[0x8000+i] = read_ddromh;
  159. +    readmemh[0xa000+i] = read_ddromh;
  160. +    readmemd[0x8000+i] = read_ddromd;
  161. +    readmemd[0xa000+i] = read_ddromd;
  162. +    writemem[0x8000+i] = write_nothing;
  163. +    writemem[0xa000+i] = write_rom;
  164. +    writememb[0x8000+i] = write_nothingb;
  165. +    writememb[0xa000+i] = write_nothingb;
  166. +    writememh[0x8000+i] = write_nothingh;
  167. +    writememh[0xa000+i] = write_nothingh;
  168. +    writememd[0x8000+i] = write_nothingd;
  169. +    writememd[0xa000+i] = write_nothingd;
  170. +     }
  171. +    
  172.     //init flashram / sram
  173.     readmem[0x8800] = read_flashram_status;
  174.     readmem[0xa800] = read_flashram_status;
  175. @@ -1424,8 +1468,7 @@
  176.  
  177.  void read_nothing(void)
  178.  {
  179. -   if (address == 0xa5000508) *rdword = 0xFFFFFFFF;
  180. -   else *rdword = 0;
  181. +   *rdword = 0;
  182.  }
  183.  
  184.  void read_nothingb(void)
  185. @@ -3417,6 +3460,196 @@
  186.       }
  187.  }
  188.  
  189. +void read_64dd()
  190. +{
  191. +   // TODO
  192. +   if (address == 0xa5000000) {
  193. +     *rdword = leo_0000;
  194. +   } else if (address == 0xa5000500) {
  195. +     *rdword = leo_0500;
  196. +   } else if (address == 0xa5000508) {
  197. +     *rdword = leo_0508;
  198. +   } else if (address == 0xa500050c) {
  199. +     *rdword = leo_050c;
  200. +   } else if (address == 0xa5000510) {
  201. +     *rdword = leo_0510;
  202. +   } else if (address == 0xa5000514) {
  203. +     *rdword = leo_0514;
  204. +   } else if (address == 0xa5000518) {
  205. +     *rdword = leo_0518;
  206. +   } else if (address == 0xa5000520) {
  207. +     *rdword = leo_0520;
  208. +   } else if (address == 0xa5000540) {
  209. +     *rdword = leo_0540;
  210. +   } else {
  211. +     *rdword = 0;
  212. +   }
  213. +}
  214. +
  215. +void read_64ddb()
  216. +{
  217. +   // TODO
  218. +   *rdword = 0;
  219. +}
  220. +
  221. +void read_64ddh()
  222. +{
  223. +   // TODO
  224. +   *rdword = 0;
  225. +}
  226. +
  227. +void read_64ddd()
  228. +{
  229. +   // TODO
  230. +   *rdword = 0;
  231. +}
  232. +
  233. +void write_64dd()
  234. +{
  235. +   // TODO
  236. +   if (address == 0xa5000520) {
  237. +     leo_0520 = word;
  238. +   } else if (address == 0xa5000508) {
  239. +       add_interupt_event(SW2_INT, 100);
  240. +       time_t *curtime_time = malloc(sizeof(time_t));
  241. +       struct tm *curtime;
  242. +       switch (word & 0xffff0000) {
  243. +    case 0x00010000:
  244. +      leo_index = leo_0500;
  245. +      DebugMessage(M64MSG_INFO, "Leo command: %08x (seek) (NYI)", word);
  246. +      break;
  247. +    case 0x00020000:
  248. +      DebugMessage(M64MSG_INFO, "Leo command: %08x (seek) (NYI)", word);
  249. +      break;
  250. +    case 0x00030000:
  251. +      DebugMessage(M64MSG_INFO, "Leo command: %08x (recalibrate) (NYI)", word);
  252. +      leo_0500 = 0;
  253. +      break;
  254. +    case 0x00090000:
  255. +      DebugMessage(M64MSG_INFO, "Leo command: %08x (reset?)", word);
  256. +      break;
  257. +    case 0x000e0000:
  258. +      DebugMessage(M64MSG_INFO, "Leo command: %08x (detect index) (NYI)", word);
  259. +      leo_0500 = leo_index;
  260. +      break;
  261. +    case 0x000f0000:
  262. +      DebugMessage(M64MSG_INFO, "Leo command: %08x (set time) (NYI)", word);
  263. +      break;
  264. +    case 0x00100000:
  265. +      DebugMessage(M64MSG_INFO, "Leo command: %08x (set time) (NYI)", word);
  266. +      break;
  267. +    case 0x00110000:
  268. +      DebugMessage(M64MSG_INFO, "Leo command: %08x (set time) (NYI)", word);
  269. +      break;
  270. +    case 0x00120000:
  271. +      // time: get year/month
  272. +      time(curtime_time);
  273. +      curtime = localtime(curtime_time);
  274. +      leo_0500 = (((curtime->tm_year)/10 - 10) << 28) + (((curtime->tm_year)%10) << 24) + (((curtime->tm_mon+1)/10) << 20) + (((curtime->tm_mon+1)%10) << 16);
  275. +      DebugMessage(M64MSG_INFO, "Leo command: %08x (get time year/month)", word);
  276. +      break;
  277. +    case 0x00130000:
  278. +      // time: get day/hour
  279. +      time(curtime_time);
  280. +      curtime = localtime(curtime_time);
  281. +      leo_0500 = (((curtime->tm_mday)/10) << 28) + (((curtime->tm_mday)%10) << 24) + (((curtime->tm_hour)/10) << 20) + (((curtime->tm_hour)%10) << 16);
  282. +      DebugMessage(M64MSG_INFO, "Leo command: %08x (get time day/hours)", word);
  283. +      break;
  284. +    case 0x00140000:
  285. +      // time: get minutes/seconds
  286. +      time(curtime_time);
  287. +      curtime = localtime(curtime_time);
  288. +      leo_0500 = (((curtime->tm_min)/10) << 28) + (((curtime->tm_min)%10) << 24) + (((curtime->tm_sec)/10) << 20) + (((curtime->tm_sec)%10) << 16);
  289. +      DebugMessage(M64MSG_INFO, "Leo command: %08x (get time minutes/seconds)", word);
  290. +      break;
  291. +    case 0x001b0000:
  292. +      // inquiry: does drive support LEO_MOTOR_BREAK?
  293. +      // source: /allman50/64ddman/dd07/07-02.htm#01
  294. +      // leo_0500 = 0x00000000 // not supported, works like LEO_MOTOR_SLEEP instead
  295. +      leo_0500 = 0x00010000;   // supported
  296. +      DebugMessage(M64MSG_INFO, "Leo command: %08x (inquiry)", word);
  297. +      break;
  298. +    default:
  299. +      leo_0500 = 0;
  300. +      DebugMessage(M64MSG_INFO, "Leo command: %08x (unknown)", word);
  301. +      break;
  302. +       }
  303. +       free (curtime_time);
  304. +   } else if (address == 0xa5000510) {
  305. +       if ((word & 0x01000000) != 0) {
  306. +          Cause &= 0xFFFFF7FF; // unset IP3
  307. +       }
  308. +      
  309. +       leo_0510 = word;
  310. +   }
  311. +}
  312. +
  313. +void write_64ddb()
  314. +{
  315. +   // TODO
  316. +}
  317. +
  318. +void write_64ddh()
  319. +{
  320. +   // TODO
  321. +}
  322. +
  323. +void write_64ddd()
  324. +{
  325. +   // TODO
  326. +}
  327. +
  328. +void read_ddrom()
  329. +{
  330. +   *rdword = 0;
  331. +  
  332. +   if (address == 0xa6001010) {
  333. +       *rdword = 0x2129fff8;
  334. +   } else if (address == 0xa609ff00) {
  335. +//        region check. only most significant byte is checked.
  336. +//        *rdword = 0x04000000;    // what US games expect (except pokemon stadium)
  337. +       *rdword = 0xC3000000; // what other games expect
  338. +   }
  339. +}
  340. +
  341. +void read_ddromb()
  342. +{
  343. +   // TODO
  344. +   *rdword = 0;
  345. +}
  346. +
  347. +void read_ddromh()
  348. +{
  349. +   // TODO
  350. +   *rdword = 0;
  351. +}
  352. +
  353. +void read_ddromd()
  354. +{
  355. +   // TODO
  356. +   *rdword = 0;
  357. +}
  358. +
  359. +// void write_ddrom()
  360. +// {
  361. +//    // TODO
  362. +// }
  363. +//
  364. +// void write_ddromb()
  365. +// {
  366. +//    // TODO
  367. +// }
  368. +//
  369. +// void write_ddromh()
  370. +// {
  371. +//    // TODO
  372. +// }
  373. +//
  374. +// void write_ddromd()
  375. +// {
  376. +//    // TODO
  377. +// }
  378. +
  379.  void read_flashram_status(void)
  380.  {
  381.     if (use_flashram != -1 && *address_low == 0)
  382. diff -U 3 -H -d -r -N -- mupen64plus-bundle-src-1.99.4/source/mupen64plus-core/src/memory/memory.h mupen64plus-bundle-src-1.99.4-new/source/mupen64plus-core/src/memory/memory.h
  383. --- mupen64plus-bundle-src-1.99.4/source/mupen64plus-core/src/memory/memory.h   2010-11-22 21:15:08.000000000 -0500
  384. +++ mupen64plus-bundle-src-1.99.4-new/source/mupen64plus-core/src/memory/memory.h   2010-11-26 23:14:16.000000000 -0500
  385. @@ -327,6 +327,14 @@
  386.  void read_sib(void);
  387.  void read_sih(void);
  388.  void read_sid(void);
  389. +void read_64dd();
  390. +void read_64ddb();
  391. +void read_64ddh();
  392. +void read_64ddd();
  393. +void read_ddrom();
  394. +void read_ddromb();
  395. +void read_ddromh();
  396. +void read_ddromd();
  397.  void read_flashram_status(void);
  398.  void read_flashram_statusb(void);
  399.  void read_flashram_statush(void);
  400. @@ -404,6 +412,14 @@
  401.  void write_sib(void);
  402.  void write_sih(void);
  403.  void write_sid(void);
  404. +void write_64dd();
  405. +void write_64ddb();
  406. +void write_64ddh();
  407. +void write_64ddd();
  408. +void write_ddrom();
  409. +void write_ddromb();
  410. +void write_ddromh();
  411. +void write_ddromd();
  412.  void write_flashram_dummy(void);
  413.  void write_flashram_dummyb(void);
  414.  void write_flashram_dummyh(void);
  415. diff -U 3 -H -d -r -N -- mupen64plus-bundle-src-1.99.4/source/mupen64plus-core/src/r4300/interupt.c mupen64plus-bundle-src-1.99.4-new/source/mupen64plus-core/src/r4300/interupt.c
  416. --- mupen64plus-bundle-src-1.99.4/source/mupen64plus-core/src/r4300/interupt.c  2010-11-22 21:15:08.000000000 -0500
  417. +++ mupen64plus-bundle-src-1.99.4-new/source/mupen64plus-core/src/r4300/interupt.c  2011-01-10 16:40:34.529759185 -0500
  418. @@ -529,6 +529,14 @@
  419.               * interpreter or dynarec
  420.               */
  421.              break;
  422. +      
  423. +        case SW2_INT:
  424. +            remove_interupt_event();
  425. +//         Status &= 0xFFFFF7FF;   // unset IM3
  426. +            Cause |= 0x00000800;   // set IP3
  427. +            Cause &= 0xFFFFFF83;   // mask out the old ExcCode
  428. +            Cause |= 0x00000000;   // mask in new ExcCode: Int
  429. +            break;
  430.  
  431.          case NMI_INT:
  432.              // Non Maskable Interrupt -- remove interrupt event from queue
  433. diff -U 3 -H -d -r -N -- mupen64plus-bundle-src-1.99.4/source/mupen64plus-core/src/r4300/interupt.h mupen64plus-bundle-src-1.99.4-new/source/mupen64plus-core/src/r4300/interupt.h
  434. --- mupen64plus-bundle-src-1.99.4/source/mupen64plus-core/src/r4300/interupt.h  2010-11-22 21:15:08.000000000 -0500
  435. +++ mupen64plus-bundle-src-1.99.4-new/source/mupen64plus-core/src/r4300/interupt.h  2011-01-09 03:12:08.000000000 -0500
  436. @@ -50,4 +50,4 @@
  437.  #define DP_INT      0x100
  438.  #define HW2_INT     0x200
  439.  #define NMI_INT     0x400
  440. -
  441. +#define SW2_INT     0x800
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement