Previous Thread
Next Thread
Print Thread
Page 2 of 5 1 2 3 4 5
Re: SNES ST-0010, ST-0011 [NEC uPD96050] emulation [Re: byuu] #66684 01/11/11 07:18 AM
Joined: May 2004
Posts: 1,608
H
Haze Offline
Very Senior Member
Offline
Very Senior Member
H
Joined: May 2004
Posts: 1,608
Is ST-0010 the same as the ST010 mentioned in ssv.c (MCU used for trig operations on Twin Eagle 2) or is it just another chip with a similar name?

The MAME sim of it is pretty minimal (but all TE2 needs)
Code:

static WRITE16_HANDLER( dsp_w )
{
	ssv_state *state = space->machine->driver_data<ssv_state>();
	UINT16 *dsp_ram = state->dsp_ram;

	COMBINE_DATA(dsp_ram+offset);
	if(offset == 0x21 && dsp_ram[0x21]) {
		switch(dsp_ram[0x20]) {
		case 0x0001:
			dsp_ram[0x11] = (UINT8)(128*atan2((double)(dsp_ram[0] - dsp_ram[1]), (double)(dsp_ram[2] - dsp_ram[3]))/M_PI) ^ 0x80;
			dsp_ram[0x21] = 0;
			break;
		default:
			dsp_ram[0x21] = 0;
			logerror("SSV DSP: unknown function %x (%x)\n", dsp_ram[0x20], cpu_get_pc(space->cpu));
			break;
		}
	}
}

possible? or not?

Re: SNES ST-0010, ST-0011 [NEC uPD96050] emulation [Re: byuu] #66686 01/11/11 08:31 AM
Joined: May 2004
Posts: 895
D
Duke Offline
Senior Member
Offline
Senior Member
D
Joined: May 2004
Posts: 895
It's possible I guess, here is the old simulation code: http://git.redump.net/cgit.cgi/mess/tree...0a88d8d804cd71e

Uses similar offsets and calculates arctans too.

Re: SNES ST-0010, ST-0011 [NEC uPD96050] emulation [Re: byuu] #66687 01/11/11 08:41 AM
Joined: Jun 2008
Posts: 205
B
byuu Offline OP
Senior Member
OP Offline
Senior Member
B
Joined: Jun 2008
Posts: 205
I can't find a good image for this PCB.

Some of those look very, very much like an ST-0010.

The checking of 0x20 and 0x21 like that is extremely similar to the function of F1 ROC II.

It would seem really strange for them to share the same exact program ROM ... but if they didn't, then what is the point of there being an ST-0010 and ST-0011? Those things were virtually identical sans clock divider.

If it is the same program, then this is opcode 0x01 in HLE:

Code:
void ST010_OP01(short X0, short Y0, short &X1, short &Y1, short &Quadrant, short &Theta)
{	
 	if ((X0 < 0) && (Y0 < 0))
	{	
		X1 = -X0;
		Y1 = -Y0;
		Quadrant = -0x8000;
	}
	else if (X0 < 0)
	{
		X1 = Y0;
		Y1 = -X0;
		Quadrant = -0x4000;
	}
	else if (Y0 < 0)
	{
		X1 = -Y0;
		Y1 = X0;
		Quadrant = 0x4000;
	}
	else
	{
		X1 = X0;
		Y1 = Y0;	
		Quadrant = 0x0000;
	}

 	while ((X1 > 0x1f) || (Y1 > 0x1f))
	{
		if (X1 > 1) X1 >>= 1;
		if (Y1 > 1) Y1 >>= 1;
	}

	if (Y1 == 0) Quadrant += 0x4000;

	Theta = (ST010_ArcTan[Y1][X1] << 8) ^ Quadrant;
}


They both talk about arctangent, so possibly.

Is this Twin Eagle 2 game mostly unemulated or did you remove most of its code? Only using one opcode is pretty insane.

Re: SNES ST-0010, ST-0011 [NEC uPD96050] emulation [Re: byuu] #66689 01/11/11 10:04 AM
Joined: Jul 2007
Posts: 4,625
A
Anna Wu Offline
Very Senior Member
Offline
Very Senior Member
A
Joined: Jul 2007
Posts: 4,625
Quote:
I can't find a good image for this PCB, only this:


The PCB looks like for Twin Eagle instead of Twin Eagle 2.
This Twin Eagle 2 PCB photo (below) looks a bit better.
The photo is bigger, so I suggest to save the picture.
But can not see ST010, maybe Im wrong. smile

Re: SNES ST-0010, ST-0011 [NEC uPD96050] emulation [Re: byuu] #66690 01/11/11 12:18 PM
Joined: Aug 2009
Posts: 1,140
Kale Offline
Very Senior Member
Offline
Very Senior Member
Joined: Aug 2009
Posts: 1,140
Guru readme says it has a ST-010, and I'm inclined to trust him. You might ask to him for a proper PCB pic for this.
Pic shown by Anna doesn't really follow this arrangement (can't read ROM names)?

Code:
                                Twin Eagle II
SETA, 1994

STS0003 TWIN EAGLE
|-------------------------------------|
|                                     |
|                                     |
|                 SX002-09.u2         |
|                                     |
|                 SX002-08.u3         |
|                                     |
| SX002-11.u7     SX002-07.u6         |
|                                     |
|                                     |
| SX002-10.u14    SX002-06.u13        |
|                                     |
|                 SX002-05.u16        |
|                                     |
| SX002-12.u22    SX002-04.u19        |
|                                     |
| SX002-13                            |
|                 SX002-03.u22        |
|                                     |
|                 SX002-02.u28        |
|                                     |
|                 SX002-01.u32        |
| SETA ST010                          |
|-------------------------------------|

SX002-13 is GAL16V8B (undumped)
SETA ST010 is some type of MCU/Math chip?
All roms are 16M Mask roms

Re: SNES ST-0010, ST-0011 [NEC uPD96050] emulation [Re: byuu] #66691 01/11/11 12:42 PM
Joined: Jul 2007
Posts: 4,625
A
Anna Wu Offline
Very Senior Member
Offline
Very Senior Member
A
Joined: Jul 2007
Posts: 4,625
Quote:
Pic shown by Anna doesn't really follow this arrangement (can't read ROM names)?


If you want to read the ROM names, save the picture and load it with an picture viewer.

Re: SNES ST-0010, ST-0011 [NEC uPD96050] emulation [Re: byuu] #66692 01/11/11 02:39 PM
Joined: May 2004
Posts: 1,608
H
Haze Offline
Very Senior Member
Offline
Very Senior Member
H
Joined: May 2004
Posts: 1,608
Originally Posted By byuu

Is this Twin Eagle 2 game mostly unemulated or did you remove most of its code? Only using one opcode is pretty insane.


Arcade protection can be like that, we've seen it countless times before. Complex MCUs / chips which end up only being used for one thing.

Twin Eagle 2 works fine with just the sim code I posted, they use it to calculate the direction each enemy moves, and only that.

If it's the same, they possibly just used some leftover SNES chips.

The picture Anna posted is of a standalone TE2 PCB, It's possible it has different protection to the rom board one and is undumped (or the same, but in a less multi-purpose MCU?) Guru's readme is for the romboard version.


Re: SNES ST-0010, ST-0011 [NEC uPD96050] emulation [Re: byuu] #66694 01/11/11 04:27 PM
Joined: Jan 2011
Posts: 4
E
edge Offline
Member
Offline
Member
E
Joined: Jan 2011
Posts: 4
Google led me to an image that appears to match the layout Kale posted above. Rotated it looks like this.

Unfortunately the image size and perspective isn't great for this purpose, so I'm not even sure why I'm posting it now. It being an ST-0010 looks plausible to me, though I don't actually know what they look like...

Last edited by edge; 01/11/11 04:48 PM.
Re: SNES ST-0010, ST-0011 [NEC uPD96050] emulation [Re: byuu] #66705 01/11/11 10:17 PM
Joined: Jun 2008
Posts: 205
B
byuu Offline OP
Senior Member
OP Offline
Senior Member
B
Joined: Jun 2008
Posts: 205
Well okay, I am mostly convinced.
* same chip name
* same game maker
* same read/write address used for read and write I/O (1:4096 odds)
* same arctangent calculation for command 0x01

Shall we try hooking up the SNES ST-0010 image to the arcade game and see how it works?

Also, how goes SEGA Air Rescue and its 7725? smile

-----

As an aside, what are you guys' thoughts on how to handle the 7725 vs 96050? They are clearly the same arch and fully backwards-compatible. 96050 > 7725 > 7720.

The proper way is to have separate cores and trap bad jumps on each chip, but all that code duplication can lead to bugs in one implementation but not another.

What I did for mine was emulate the 96050, but make a new run-time variable-integer type that lets you set the number of bits it allows.

Eg: varuint_t pc, rp, dp;
Code:
if(revision == uPD7725) {
  pc.bits(11);
  rp.bits(10);
  dp.bits( 8);
} else if(revision == uPD96050) {
  pc.bits(14);
  rp.bits(11);
  dp.bits(11);
}


Run-time control because inheritance doesn't work in reverse unless you use templates, which would be nasty for an entire CPU core, even a small one. Internally it just masks by 1<<bits-1 on any write operation.

The BC is really nice, it won't allow you to read past the smaller ROM/RAM sizes of older chips, and the extra jump bits are silently ignored just like a real chip.

The only iffy part is that the new jump tests were probably NOPs on the older parts. Best I can think of there is to have all the 7720 ops at the start of exec_jp(). Then return if revision < 7725. Then test JDPLN0, JDPLNF. Then return if revision < 96050. Then test JMPSO, HJMP, HCALL.

Re: SNES ST-0010, ST-0011 [NEC uPD96050] emulation [Re: byuu] #66706 01/11/11 10:59 PM
Joined: Mar 2001
Posts: 16,473
R
R. Belmont Offline
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,473
My thinking is to have separate CPU types that set appropriate masks at init time and then are otherwise the same. Pretty much the same as what you're doing, but from the point of view of someone expecting to support GCC 4.0.x for another 12 months (PowerPC OS X).

Air Rescue I didn't quite understand how to hook up the 77c25, but I didn't try very hard yet either.

Page 2 of 5 1 2 3 4 5

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