Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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
- --- mupen64plus-bundle-src-1.99.4/source/mupen64plus-core/projects/unix/Makefile 2010-11-22 21:15:08.000000000 -0500
- +++ mupen64plus-bundle-src-1.99.4-new/source/mupen64plus-core/projects/unix/Makefile 2011-01-10 16:22:11.441258959 -0500
- @@ -242,6 +242,7 @@
- $(SRCDIR)/main/eventloop.c \
- $(SRCDIR)/main/md5.c \
- $(SRCDIR)/main/rom.c \
- + $(SRCDIR)/main/leodisk.c \
- $(SRCDIR)/main/ini_reader.c \
- $(SRCDIR)/main/savestates.c \
- $(SRCDIR)/main/adler32.c \
- 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
- --- mupen64plus-bundle-src-1.99.4/source/mupen64plus-core/src/main/leodisk.c 1969-12-31 19:00:00.000000000 -0500
- +++ mupen64plus-bundle-src-1.99.4-new/source/mupen64plus-core/src/main/leodisk.c 2011-01-10 16:44:02.089259350 -0500
- @@ -0,0 +1,33 @@
- +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- + * Mupen64plus - leodisk.c *
- + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
- + * Copyright (C) 2011 jrra *
- + * *
- + * This program is free software; you can redistribute it and/or modify *
- + * it under the terms of the GNU General Public License as published by *
- + * the Free Software Foundation; either version 2 of the License, or *
- + * (at your option) any later version. *
- + * *
- + * This program is distributed in the hope that it will be useful, *
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- + * GNU General Public License for more details. *
- + * *
- + * You should have received a copy of the GNU General Public License *
- + * along with this program; if not, write to the *
- + * Free Software Foundation, Inc., *
- + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
- + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
- +
- +
- +int leo_0000 = 0x0;
- +int leo_0500 = 0x0; // seems to be "outbox"
- +int leo_0508 = 0x02000000; // change to 0x03000000 when disk is inserted
- +int leo_050c = 0x60000000; // tracking?
- +int leo_0510 = 0x00000040;
- +int leo_0514 = 0x0;
- +int leo_0518 = 0x0;
- +int leo_0520 = 0x0;
- +int leo_0540 = 0x00030000; // 0x00030000 for commercial drive, 0x00040000 for dev drive
- +
- +int leo_index = 1; // this should probably be nonzero at all times
- \ No newline at end of file
- 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
- --- mupen64plus-bundle-src-1.99.4/source/mupen64plus-core/src/main/leodisk.h 1969-12-31 19:00:00.000000000 -0500
- +++ mupen64plus-bundle-src-1.99.4-new/source/mupen64plus-core/src/main/leodisk.h 2011-01-05 00:32:01.000000000 -0500
- @@ -0,0 +1,42 @@
- +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
- + * Mupen64plus - leodisk.h *
- + * Mupen64Plus homepage: http://code.google.com/p/mupen64plus/ *
- + * Copyright (C) 2011 jrra *
- + * *
- + * This program is free software; you can redistribute it and/or modify *
- + * it under the terms of the GNU General Public License as published by *
- + * the Free Software Foundation; either version 2 of the License, or *
- + * (at your option) any later version. *
- + * *
- + * This program is distributed in the hope that it will be useful, *
- + * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- + * GNU General Public License for more details. *
- + * *
- + * You should have received a copy of the GNU General Public License *
- + * along with this program; if not, write to the *
- + * Free Software Foundation, Inc., *
- + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
- + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
- +
- +#ifndef __LEODISK_H__
- +#define __LEODISK_H__
- +
- +#include "api/m64p_types.h"
- +
- +extern int leo_0000;
- +extern int leo_0500;
- +extern int leo_0508;
- +extern int leo_050c;
- +extern int leo_0510;
- +extern int leo_0514;
- +extern int leo_0518;
- +extern int leo_0520;
- +extern int leo_0540;
- +
- +extern int leo_index;
- +extern int leo_temp;
- +
- +// extern long long leo_magic_bootcode_extravaganza;
- +
- +#endif /* __LEODISK_H__ */
- 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
- --- mupen64plus-bundle-src-1.99.4/source/mupen64plus-core/src/memory/memory.c 2010-11-22 21:15:08.000000000 -0500
- +++ mupen64plus-bundle-src-1.99.4-new/source/mupen64plus-core/src/memory/memory.c 2011-01-10 16:58:27.445758695 -0500
- @@ -19,6 +19,7 @@
- * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
- * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
- +#include <time.h>
- #include <stdlib.h>
- #include "api/m64p_types.h"
- @@ -36,6 +37,7 @@
- #include "api/callbacks.h"
- #include "main/main.h"
- +#include "main/leodisk.h"
- #include "main/rom.h"
- #include "osal/preproc.h"
- #include "plugin/plugin.h"
- @@ -842,7 +844,7 @@
- readsi[0x18] = &si_register.si_stat;
- for (i=0x1c; i<0x10000; i++) readsi[i] = &trash;
- - for (i=0x481; i<0x800; i++)
- + for (i=0x481; i</*0x800*/0x500; i++)
- {
- readmem[0x8000+i] = read_nothing;
- readmem[0xa000+i] = read_nothing;
- @@ -861,7 +863,49 @@
- writememd[0x8000+i] = write_nothingd;
- writememd[0xa000+i] = write_nothingd;
- }
- -
- +
- + //init 64dd
- + for (i=0x500; i<0x600; i++)
- + {
- + readmem[0x8000+i] = read_64dd;
- + readmem[0xa000+i] = read_64dd;
- + readmemb[0x8000+i] = read_64ddb;
- + readmemb[0xa000+i] = read_64ddb;
- + readmemh[0x8000+i] = read_64ddh;
- + readmemh[0xa000+i] = read_64ddh;
- + readmemd[0x8000+i] = read_64ddd;
- + readmemd[0xa000+i] = read_64ddd;
- + writemem[0x8000+i] = write_64dd;
- + writemem[0xa000+i] = write_64dd;
- + writememb[0x8000+i] = write_64ddb;
- + writememb[0xa000+i] = write_64ddb;
- + writememh[0x8000+i] = write_64ddh;
- + writememh[0xa000+i] = write_64ddh;
- + writememd[0x8000+i] = write_64ddd;
- + writememd[0xa000+i] = write_64ddd;
- + }
- +
- + //init ddrom
- + for (i=0x600; i<0x800; i++)
- + {
- + readmem[0x8000+i] = read_ddrom;
- + readmem[0xa000+i] = read_ddrom;
- + readmemb[0x8000+i] = read_ddromb;
- + readmemb[0xa000+i] = read_ddromb;
- + readmemh[0x8000+i] = read_ddromh;
- + readmemh[0xa000+i] = read_ddromh;
- + readmemd[0x8000+i] = read_ddromd;
- + readmemd[0xa000+i] = read_ddromd;
- + writemem[0x8000+i] = write_nothing;
- + writemem[0xa000+i] = write_rom;
- + writememb[0x8000+i] = write_nothingb;
- + writememb[0xa000+i] = write_nothingb;
- + writememh[0x8000+i] = write_nothingh;
- + writememh[0xa000+i] = write_nothingh;
- + writememd[0x8000+i] = write_nothingd;
- + writememd[0xa000+i] = write_nothingd;
- + }
- +
- //init flashram / sram
- readmem[0x8800] = read_flashram_status;
- readmem[0xa800] = read_flashram_status;
- @@ -1424,8 +1468,7 @@
- void read_nothing(void)
- {
- - if (address == 0xa5000508) *rdword = 0xFFFFFFFF;
- - else *rdword = 0;
- + *rdword = 0;
- }
- void read_nothingb(void)
- @@ -3417,6 +3460,196 @@
- }
- }
- +void read_64dd()
- +{
- + // TODO
- + if (address == 0xa5000000) {
- + *rdword = leo_0000;
- + } else if (address == 0xa5000500) {
- + *rdword = leo_0500;
- + } else if (address == 0xa5000508) {
- + *rdword = leo_0508;
- + } else if (address == 0xa500050c) {
- + *rdword = leo_050c;
- + } else if (address == 0xa5000510) {
- + *rdword = leo_0510;
- + } else if (address == 0xa5000514) {
- + *rdword = leo_0514;
- + } else if (address == 0xa5000518) {
- + *rdword = leo_0518;
- + } else if (address == 0xa5000520) {
- + *rdword = leo_0520;
- + } else if (address == 0xa5000540) {
- + *rdword = leo_0540;
- + } else {
- + *rdword = 0;
- + }
- +}
- +
- +void read_64ddb()
- +{
- + // TODO
- + *rdword = 0;
- +}
- +
- +void read_64ddh()
- +{
- + // TODO
- + *rdword = 0;
- +}
- +
- +void read_64ddd()
- +{
- + // TODO
- + *rdword = 0;
- +}
- +
- +void write_64dd()
- +{
- + // TODO
- + if (address == 0xa5000520) {
- + leo_0520 = word;
- + } else if (address == 0xa5000508) {
- + add_interupt_event(SW2_INT, 100);
- + time_t *curtime_time = malloc(sizeof(time_t));
- + struct tm *curtime;
- + switch (word & 0xffff0000) {
- + case 0x00010000:
- + leo_index = leo_0500;
- + DebugMessage(M64MSG_INFO, "Leo command: %08x (seek) (NYI)", word);
- + break;
- + case 0x00020000:
- + DebugMessage(M64MSG_INFO, "Leo command: %08x (seek) (NYI)", word);
- + break;
- + case 0x00030000:
- + DebugMessage(M64MSG_INFO, "Leo command: %08x (recalibrate) (NYI)", word);
- + leo_0500 = 0;
- + break;
- + case 0x00090000:
- + DebugMessage(M64MSG_INFO, "Leo command: %08x (reset?)", word);
- + break;
- + case 0x000e0000:
- + DebugMessage(M64MSG_INFO, "Leo command: %08x (detect index) (NYI)", word);
- + leo_0500 = leo_index;
- + break;
- + case 0x000f0000:
- + DebugMessage(M64MSG_INFO, "Leo command: %08x (set time) (NYI)", word);
- + break;
- + case 0x00100000:
- + DebugMessage(M64MSG_INFO, "Leo command: %08x (set time) (NYI)", word);
- + break;
- + case 0x00110000:
- + DebugMessage(M64MSG_INFO, "Leo command: %08x (set time) (NYI)", word);
- + break;
- + case 0x00120000:
- + // time: get year/month
- + time(curtime_time);
- + curtime = localtime(curtime_time);
- + 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);
- + DebugMessage(M64MSG_INFO, "Leo command: %08x (get time year/month)", word);
- + break;
- + case 0x00130000:
- + // time: get day/hour
- + time(curtime_time);
- + curtime = localtime(curtime_time);
- + leo_0500 = (((curtime->tm_mday)/10) << 28) + (((curtime->tm_mday)%10) << 24) + (((curtime->tm_hour)/10) << 20) + (((curtime->tm_hour)%10) << 16);
- + DebugMessage(M64MSG_INFO, "Leo command: %08x (get time day/hours)", word);
- + break;
- + case 0x00140000:
- + // time: get minutes/seconds
- + time(curtime_time);
- + curtime = localtime(curtime_time);
- + leo_0500 = (((curtime->tm_min)/10) << 28) + (((curtime->tm_min)%10) << 24) + (((curtime->tm_sec)/10) << 20) + (((curtime->tm_sec)%10) << 16);
- + DebugMessage(M64MSG_INFO, "Leo command: %08x (get time minutes/seconds)", word);
- + break;
- + case 0x001b0000:
- + // inquiry: does drive support LEO_MOTOR_BREAK?
- + // source: /allman50/64ddman/dd07/07-02.htm#01
- + // leo_0500 = 0x00000000 // not supported, works like LEO_MOTOR_SLEEP instead
- + leo_0500 = 0x00010000; // supported
- + DebugMessage(M64MSG_INFO, "Leo command: %08x (inquiry)", word);
- + break;
- + default:
- + leo_0500 = 0;
- + DebugMessage(M64MSG_INFO, "Leo command: %08x (unknown)", word);
- + break;
- + }
- + free (curtime_time);
- + } else if (address == 0xa5000510) {
- + if ((word & 0x01000000) != 0) {
- + Cause &= 0xFFFFF7FF; // unset IP3
- + }
- +
- + leo_0510 = word;
- + }
- +}
- +
- +void write_64ddb()
- +{
- + // TODO
- +}
- +
- +void write_64ddh()
- +{
- + // TODO
- +}
- +
- +void write_64ddd()
- +{
- + // TODO
- +}
- +
- +void read_ddrom()
- +{
- + *rdword = 0;
- +
- + if (address == 0xa6001010) {
- + *rdword = 0x2129fff8;
- + } else if (address == 0xa609ff00) {
- +// region check. only most significant byte is checked.
- +// *rdword = 0x04000000; // what US games expect (except pokemon stadium)
- + *rdword = 0xC3000000; // what other games expect
- + }
- +}
- +
- +void read_ddromb()
- +{
- + // TODO
- + *rdword = 0;
- +}
- +
- +void read_ddromh()
- +{
- + // TODO
- + *rdword = 0;
- +}
- +
- +void read_ddromd()
- +{
- + // TODO
- + *rdword = 0;
- +}
- +
- +// void write_ddrom()
- +// {
- +// // TODO
- +// }
- +//
- +// void write_ddromb()
- +// {
- +// // TODO
- +// }
- +//
- +// void write_ddromh()
- +// {
- +// // TODO
- +// }
- +//
- +// void write_ddromd()
- +// {
- +// // TODO
- +// }
- +
- void read_flashram_status(void)
- {
- if (use_flashram != -1 && *address_low == 0)
- 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
- --- mupen64plus-bundle-src-1.99.4/source/mupen64plus-core/src/memory/memory.h 2010-11-22 21:15:08.000000000 -0500
- +++ mupen64plus-bundle-src-1.99.4-new/source/mupen64plus-core/src/memory/memory.h 2010-11-26 23:14:16.000000000 -0500
- @@ -327,6 +327,14 @@
- void read_sib(void);
- void read_sih(void);
- void read_sid(void);
- +void read_64dd();
- +void read_64ddb();
- +void read_64ddh();
- +void read_64ddd();
- +void read_ddrom();
- +void read_ddromb();
- +void read_ddromh();
- +void read_ddromd();
- void read_flashram_status(void);
- void read_flashram_statusb(void);
- void read_flashram_statush(void);
- @@ -404,6 +412,14 @@
- void write_sib(void);
- void write_sih(void);
- void write_sid(void);
- +void write_64dd();
- +void write_64ddb();
- +void write_64ddh();
- +void write_64ddd();
- +void write_ddrom();
- +void write_ddromb();
- +void write_ddromh();
- +void write_ddromd();
- void write_flashram_dummy(void);
- void write_flashram_dummyb(void);
- void write_flashram_dummyh(void);
- 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
- --- mupen64plus-bundle-src-1.99.4/source/mupen64plus-core/src/r4300/interupt.c 2010-11-22 21:15:08.000000000 -0500
- +++ mupen64plus-bundle-src-1.99.4-new/source/mupen64plus-core/src/r4300/interupt.c 2011-01-10 16:40:34.529759185 -0500
- @@ -529,6 +529,14 @@
- * interpreter or dynarec
- */
- break;
- +
- + case SW2_INT:
- + remove_interupt_event();
- +// Status &= 0xFFFFF7FF; // unset IM3
- + Cause |= 0x00000800; // set IP3
- + Cause &= 0xFFFFFF83; // mask out the old ExcCode
- + Cause |= 0x00000000; // mask in new ExcCode: Int
- + break;
- case NMI_INT:
- // Non Maskable Interrupt -- remove interrupt event from queue
- 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
- --- mupen64plus-bundle-src-1.99.4/source/mupen64plus-core/src/r4300/interupt.h 2010-11-22 21:15:08.000000000 -0500
- +++ mupen64plus-bundle-src-1.99.4-new/source/mupen64plus-core/src/r4300/interupt.h 2011-01-09 03:12:08.000000000 -0500
- @@ -50,4 +50,4 @@
- #define DP_INT 0x100
- #define HW2_INT 0x200
- #define NMI_INT 0x400
- -
- +#define SW2_INT 0x800
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement