nes emulator for snes

Anything DreamSNES-related can be asked in this forum, such as general questions about the emulator, how to burn it, etc.
Post Reply
reaper2k2
DC Developer
DC Developer
Posts: 2648
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Sun Mar 24, 2002 7:48 pm
Has thanked: 0
Been thanked: 0
Contact:

nes emulator for snes

Post by reaper2k2 »

code source


home page http://www.playoffline.com/others/junk/index.html

#include <stdio.h>
#include <string.h>

#define FILENAME "fcemu.rom"

static char *gtFileName[] =
{
"donkey",
"donkeyjr",
"popeye",
};

static unsigned short gtDonkey[] =
{
#include "donkey.h"
};

static unsigned short gtDonkeyJr[] =
{
#include "donkeyjr.h"
};

static unsigned short gtPopeye[] =
{
#include "popeye.h"
};

static unsigned short *gtPatch[sizeof gtFileName / sizeof *gtFileName] =
{
gtDonkey,
gtDonkeyJr,
gtPopeye,
};

static int gtSize[sizeof gtFileName / sizeof *gtFileName] =
{
sizeof gtDonkey / sizeof *gtDonkey,
sizeof gtDonkeyJr / sizeof *gtDonkeyJr,
sizeof gtPopeye / sizeof *gtPopeye,
};

void main(int argc, char *argv[])
{
printf("FC-Emulator for SuperFamicom\n");

unsigned char buf[0x200 + 0x8000];
memset(buf, 0, sizeof buf);

//header
buf[0] = 0x04;
buf[8] = 0xaa;
buf[9] = 0xbb;
buf[10] = 0x04;

FILE *fp = fopen(FILENAME, "rb");
if (fp == NULL)
{
printf("error: can't open " FILENAME "\n");
return;
}
fread(&buf[0x200], 1, 0x800, fp);
fclose(fp);

for (int n = 0; n < (sizeof gtFileName / sizeof *gtFileName); n++)
{
char tmp[256];
sprintf(tmp, "%s.nes", gtFileName[n]);
fp = fopen(tmp, "rb");
if (fp == NULL)
{
printf("error: can't open %s\n", tmp);
continue;
}
unsigned char header[16];
fread(header, 1, sizeof header, fp);
if (header[0] != 'N'
|| header[1] != 'E'
|| header[2] != 'S'
|| header[4] != 1
|| header[5] != 1)
{
printf("error: not supported mapper %s\n", tmp);
fclose(fp);
continue;
}
fread(&buf[0x200 + 0x4000], 1, 0x4000, fp);
fread(&buf[0x200 + 0x2000], 1, 0x2000, fp);
fclose(fp);

//reset
buf[0x200 + 0x0297] = buf[0x200 + 0x7ffc];
buf[0x200 + 0x0298] = buf[0x200 + 0x7ffd];
//nmi
buf[0x200 + 0x02be] = buf[0x200 + 0x7ffa];
buf[0x200 + 0x02bf] = buf[0x200 + 0x7ffb];
//patch
for (int p = 0; p < gtSize[n] / 2; p++)
{
buf[0x200 + 0x4000 + gtPatch[n][p * 2 + 0]] = (unsigned char)gtPatch[n][p * 2 + 1];
}

sprintf(tmp, "%s.smc", gtFileName[n]);
fp = fopen(tmp, "wb");
if (fp == NULL)
{
printf("error: can't open %s\n", tmp);
continue;
}
fwrite(buf, 1, sizeof buf, fp);
fclose(fp);
}
}
http://www.playoffline.com/others/junk/index.html to get a compiled
version ......with some rewiting of the code it could convert all most any nes rom to work on a snes emulator go try it works

this is very neat code to change nes roms into snes roms with this code and a few bits of thinking you could do some think good with it


any ways just thought it was kool
koz
DCEmu Fast Newbie
DCEmu Fast Newbie
Posts: 18
Joined: Tue Apr 09, 2002 2:09 pm
Location: Eastern USA
Has thanked: 0
Been thanked: 0

Post by koz »

hmmmmm.......very interesting, thanks for posting
clessoulis
DCEmu Uncool Newbie
DCEmu Uncool Newbie
Posts: 2718
Joined: Tue Apr 09, 2002 8:09 pm
Location: On top of the World
Has thanked: 0
Been thanked: 0

Post by clessoulis »

Or you could use NesterDC.
DNR the current kickass dc programer. Thanks
for the emulator I've been waiting 2 years for.

Thanks to Reaper2k2 also for showing interest into WSC emulation.

Selfbooting for Noobs
mrinsulto
Psychotic DCEmu
Psychotic DCEmu
Posts: 518
Joined: Sat Nov 24, 2001 10:26 am
Has thanked: 0
Been thanked: 0

Post by mrinsulto »

yes, dont you know what this means?

nesterdc never got light gun support, and probally never will. dreamsnes has it, and it just needs to be perfected. so this means we can convert all those nes games to snes roms, and play duckhunt, hogans alley, and wild gunman on our dreamcast.

you are a god dam genuis for posting this, every last person who ever wanted to play a lightgun game will thank you for this. thank you :)
mrinsulto
Psychotic DCEmu
Psychotic DCEmu
Posts: 518
Joined: Sat Nov 24, 2001 10:26 am
Has thanked: 0
Been thanked: 0

Post by mrinsulto »

only one prob, the site is in jap, someone is going to have to try to find a alturnative download site, i will try to find a english site.
User avatar
az_bont
Administrator
Administrator
Posts: 13567
Joined: Sat Mar 09, 2002 8:35 am
Location: Swansea, Wales
Has thanked: 0
Been thanked: 0
Contact:

Post by az_bont »

mrinsulto wrote:yes, dont you know what this means?

nesterdc never got light gun support, and probally never will. dreamsnes has it, and it just needs to be perfected. so this means we can convert all those nes games to snes roms, and play duckhunt, hogans alley, and wild gunman on our dreamcast.

you are a god dam genuis for posting this, every last person who ever wanted to play a lightgun game will thank you for this. thank you :)
Just because it can emulate the game, that doesn't mean it will emulate the gun. They work in very different ways. You'd be better off waiting for NesterDC to support the gun.
Sick of sub-par Dreamcast web browsers that fail to impress? Visit Psilocybin Dreams!
mrinsulto
Psychotic DCEmu
Psychotic DCEmu
Posts: 518
Joined: Sat Nov 24, 2001 10:26 am
Has thanked: 0
Been thanked: 0

Post by mrinsulto »

yeah, i know, but it cant hurt to try at least, what i dont get is, the program will not run, you open it, then it closes it self.

but, anyways, emulating the light zapper for nes would be far simpler than emulating the super scope, now, i know both are complex to do, and very hard as well. which is why i was surprized that the dreamsnes team got it befor nesterdc, they should keep up the good work ther doing.

they are talented, and i would like to give them my thanks for all the work they have been doing on it, it is a very cool emulator, and once it reaches 1.0, im sure it will be the bomb emulator, and once it becomes perfect, in the run all games 97 to 100% full speed, and at least 85% light gun accuracy, it will be voted better than nester dc in a since. but for now, nester dc is the king of emulation.
Post Reply