Previous Thread
Next Thread
Print Thread
Page 1 of 5 1 2 3 4 5
SNES ST-0010, ST-0011 [NEC uPD96050] emulation #66603 01/08/11 03:21 AM
Joined: Jun 2008
Posts: 205
B
byuu Offline OP
Senior Member
OP Offline
Senior Member
B
Joined: Jun 2008
Posts: 205
Dr. Decapitator successfully dumped the ST-0010 from F1 Race of Champions II, and will tackle the ST-0011 from the currently unemulated Hayazashi Nidan Morita Shougi soon.

I've emulated the chip already, it's basically just a souped up 7725. In fact, it's probably best to treat the 7725 like a crippled 96050 so that you only need one emulation core.

I'll summarize:

Code:
Revision   | 7725          | 96050
--------------------------------------------
Clock      | 8.192MHz      | 20MHz (10MIPS)
Stack      | 4-level       | 8-level
ProgramROM | 2048 x 24-bit | 16384 x 24-bit
DataROM    | 1024 x 16-bit |  2048 x 16-bit
DataRAM    |  256 x 16-bit |  2048 x 16-bit
PC         | 11-bit        | 14-bit
RP         | 10-bit        | 11-bit
DP         |  8-bit        | 11-bit
SNES Link  | Exposes DR/SR | Exposes DataRAM


The most interesting part is the DataRAM, it's non-volatile (battery-backed), and the SNES can read/write it. The DR/SR are not connected to the SNES bus in any way this time.

This chip has a clock divider of 2, so it's not much faster than the 7725 after all.

Currently the big mystery is that we don't know how to access all that extra ProgramROM. I think there is a new long-jump command that takes a full 14-bit offset, but I can't prove it.

Anything else would break BC, and they seem to be trying very hard to maintain that here.

The good news is the ST-0010 only uses ~534 instructions or so. Yeah, over 80% of the chip is completely unused. Still, I am hoping the ST-0011 is larger, as I do want to emulate the ability to execute more than 2048 instructions.

If you need code to reference for some reason:
http://byuu.org/temp/bsnes_v073r04r.tar.bz2
But get it fast, I'll be removing that soon.
That's a quick hack-job that patches the 7725 to act like a 96050.

Here is how to map the chip:

Code:
<?xml version='1.0' encoding='UTF-8'?>
<cartridge region='NTSC'>
  <rom>
    <map mode='linear' address='00-7f:8000-ffff'/>
    <map mode='linear' address='80-ff:8000-ffff'/>
  </rom>
  <upd96050 program='st0010.bin'>
    <map address='68-6f:0000-0fff'/>
    <map address='e8-ef:0000-0fff'/>
  </upd96050>
</cartridge>


Lord Nightmare believes there may be arcade games using SETA ST-001x chips that use this same core. You'd have to raise money for Dr. Decapitator's services yourself though.

For those counting:
* we have three games left (MMX2, MMX3, HNMS2)
* we have two chips left (Cx4, ST-0018)
* we have one unemulated game left (HNMS2)

The Cx4 is a Hitachi HG51B169 DSP, and the only info we can find are some old patents that do not mention it by name. We believe it is part of the HG51BS series. This is a 20MHz chip.

The ST-0018 has not been imaged, but it's a 160-pin surface mount chip. We believe it's a NEC V-series RISC CPU. We don't believe at this time that it's the V810, but we aren't sure. Chis is a 21.47MHz chip.

Re: SNES ST-0010, ST-0011 [NEC uPD96050] emulation [Re: byuu] #66604 01/08/11 04:38 AM
Joined: Mar 2001
Posts: 16,539
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,539
Very nice smile

Re: SNES ST-0010, ST-0011 [NEC uPD96050] emulation [Re: byuu] #66607 01/08/11 08:49 AM
Joined: Apr 2004
Posts: 1,554
J
judge Online Content
Very Senior Member
Online Content
Very Senior Member
J
Joined: Apr 2004
Posts: 1,554
Perhaps they use some form of banking?

Re: SNES ST-0010, ST-0011 [NEC uPD96050] emulation [Re: byuu] #66609 01/08/11 10:25 AM
Joined: Jun 2008
Posts: 205
B
byuu Offline OP
Senior Member
OP Offline
Senior Member
B
Joined: Jun 2008
Posts: 205
Hard to change banking while executing opcodes.

I am almost certain there's a long-jump that can modify the upper 3-bits of the program counter. Whether it applies it as NA<<2, or uses the lower three bits of BRCH, I don't know.

We really just need to pray that the ST-0011 program is > 0x800 instruction words so we can know for sure. I'd love to emulate the larger ROM possibility.

Re: SNES ST-0010, ST-0011 [NEC uPD96050] emulation [Re: byuu] #66610 01/08/11 11:42 AM
Joined: Apr 2004
Posts: 1,554
J
judge Online Content
Very Senior Member
Online Content
Very Senior Member
J
Joined: Apr 2004
Posts: 1,554
changing the upper 3 bits of the program counter could be considered a kind of banking wink


Re: SNES ST-0010, ST-0011 [NEC uPD96050] emulation [Re: byuu] #66611 01/08/11 01:51 PM
Joined: Mar 2001
Posts: 16,539
R
R. Belmont Online Content
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 16,539
Banking changes at the current PC location aren't exactly unknown, especially when the CPU in question doesn't have a prefetch.

Re: SNES ST-0010, ST-0011 [NEC uPD96050] emulation [Re: byuu] #66612 01/08/11 03:23 PM
Joined: Feb 2004
Posts: 2,156
Vas Crabb Online Content
Very Senior Member
Online Content
Very Senior Member
Joined: Feb 2004
Posts: 2,156
hehe switching on address translation on SPARCv9 is kind of like a bank switch - you execute a jump instruction with the instruction to switch on address translation in the delay slot

Re: SNES ST-0010, ST-0011 [NEC uPD96050] emulation [Re: byuu] #66615 01/08/11 07:28 PM
Joined: Oct 2006
Posts: 985
S
Stiletto Offline
Senior Member
Offline
Senior Member
S
Joined: Oct 2006
Posts: 985
Nice! Great job, byuu. laugh

Re: SNES ST-0010, ST-0011 [NEC uPD96050] emulation [Re: byuu] #66636 01/10/11 02:33 AM
Joined: Jun 2008
Posts: 205
B
byuu Offline OP
Senior Member
OP Offline
Senior Member
B
Joined: Jun 2008
Posts: 205
ST-0011 is more complex than I had hoped.
Could anyone here give me a hand?

The problem, info and source is posted here:
http://board.byuu.org/viewtopic.php?f=5&t=1313

You will need WIP forum access, which I'll give to any active MAME/MESS devs that lack it.


Re: SNES ST-0010, ST-0011 [NEC uPD96050] emulation [Re: byuu] #66683 01/11/11 06:59 AM
Joined: Jun 2008
Posts: 205
B
byuu Offline OP
Senior Member
OP Offline
Senior Member
B
Joined: Jun 2008
Posts: 205
Turns out there was some corruption in the initial dump.
I was able to figure it out once cleaned up. This dump shows us three new jump commands, and an extended meaning for the rest:

Code:
void NECDSP::exec_jp(uint24 opcode) {
  uint9 brch = opcode >> 13;  //branch
  uint11 na  = opcode >>  2;  //next address
  uint2 bank = opcode >>  0;  //bank address

  uint16 jps = (regs.pc & 0x2000) | (bank << 11) | (na << 0);
  uint16 jpl = (bank << 11) | (na << 0);

  switch(brch) {
    case 0x000: regs.pc = regs.so; return;  //JMPSO
    ...
    case 0x080: if(regs.flaga.c == 0) regs.pc = jps; return;  //JNCA
    case 0x082: if(regs.flaga.c == 1) regs.pc = jps; return;  //JCA
    case 0x084: if(regs.flagb.c == 0) regs.pc = jps; return;  //JNCB
    case 0x086: if(regs.flagb.c == 1) regs.pc = jps; return;  //JCB
    ...
    case 0x100: regs.pc = 0x0000 | jpl; return;  //LJMP
    case 0x101: regs.pc = 0x2000 | jpl; return;  //HJMP

    case 0x140: regs.stack[regs.sp++] = regs.pc; regs.pc = 0x0000 | jpl; return;  //LCALL
    case 0x141: regs.stack[regs.sp++] = regs.pc; regs.pc = 0x2000 | jpl; return;  //HCALL
  }
}


Also some corrections:
DSP-1,2,3,4 runs at 8.00MHz (8000000hz) (no clock divider)
ST-0010 runs at 10.00MHz effective (20MHz / 2)
ST-0011 runs at 15.00MHz (no clock divider)

The ST-0011 is not fucking around. 99% usage of 16,384 instructions, 98% usage of 2,048 data words, fifteen million operations per second.

You can get the full emulation source here:
http://bsnes.googlecode.com/files/bsnes_v074.tar.bz2
See: bsnes/snes/chip/necdsp (merged 7725+96050 support)

And the beautiful results:



The only SNES module to still use HLE is the Cx4 (Megaman X2, Megaman X3); and the only unemulated chip is the ST-0018 (Hayazashi Nidan Morita Shougi 2.)

Page 1 of 5 1 2 3 4 5

Who's Online Now
1 registered members (Carbon), 53 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
ShoutChat Box
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,791
Posts115,714
Members4,908
Most Online890
Jan 17th, 2020
Powered by UBB.threads™ PHP Forum Software 7.7.3