YUPPPII Knuckles in Sonic compilation

Ask anything your want about Megadrive/Genesis programming.

Moderator: BigEvilCorporation

Post Reply
Jorge Nuno
Very interested
Posts: 374
Joined: Mon Jun 11, 2007 3:09 am
Location: Azeitão, PT

YUPPPII Knuckles in Sonic compilation

Post by Jorge Nuno » Thu Feb 07, 2008 11:09 pm

That's right I've just modified a sonic compilation cart, to let you play with knuckles on sonic2. It needs extra hardware though.

So if anyone wants to play S2K and only have Scompilation + original S&K, there is a light at the end of the tunnel... Please wait a few moments, I'm setting up the post with result-pictures/schematics/partlist...

Part0:

The sonic compilation is a cart made of two ROMs:

-a 2Megabyte ROM (ROM0: MPR-18203) placed at 0h with a custom sonic2 at the top and th Dr. Robotnik mean machine at 100000h.
-a 1Megabyte ROM (ROM1: MPR-18204) placed at 200000h with a plain Sonic1 and some compilation code at 280000h.

Memory map:
000000-0FFFFFh: Sonic2 with different header and init code
100000-1FFFFFh: Dr. Robotniks
200000-27FFFFh: Sonic1 unmodified
280000-2FFFFFh: Sonic Compilation game select code + data

When placed on top of S&K you get this:
000000-1FFFFFh: Sonic & Knuckles
200000-27FFFFh: Sonic1 unmodified
280000-2FFFFFh: Sonic compilation...

^^Thats why you get the blue spheres challenge... instead of S2K, and almost makes one throw the SC cart to the wall :(

Part1:

We need to deactivate ROM1 at all, and put ROM0 at 200000h, so that S&K sees the Sonic2 ROM, but the header is wrong... S&K expects a
"GM 00001051-00" at location 200180-20018Fh and our Sonic2 has a "GM MK-1190 ". Grrrrrr :?

We need to apply some action replay codes in a hardware way, HEHE... In a more detailed way, we need to check if S&K is accessing to 20018Xh,
deactivate ROM0 and activate a mini ROM (16bytes long) that contains a Sonic2 game serial... The chksum can be anything from 0 to FFFFh (it isn't checked)

Part2:

It is required:

CART:
Solder pump/solder wick;
Solder + Iron;
Wires;
XC9536 (xilinx CPLD);
2* 74HC32 (quad OR);
Switch;

XILINX programmer:
2*74HC125 (hex tri-state buffers);
4* resistors from 100 to 330 Ohm;
Parallel port;

Download ISEwebpack, and download the project from here:
http://trapalhadas.no.sapo.pt/Sonic2K.7z


Part3:

Extract the .7z and open it up in ISE

Make the JTAG cable:
http://www.xilinx.com/support/programr/ ... 380507.pdf

R1, R8 and R13 aren't needed;
R2,R3,R4,R5,R6,R7 and R14 short them;
All capacitors can be omissed;
The diodes can be shorted.


Remove the 74HC00 from the board and cut all traces except 3to4, 7, 10to11 and 14. Put a 74HC32 in its place, use it to OR 5 68K addresses A10, A11, A12, A13, A14, connect pin 6 to pin 9 and leave the output for now...

Put the second 74HC32 anywhere, solder pin 7 to GND and pin 14 to VCC
connect pin 3 to 4, pin 10 to 11 and pin 6 to 9. Use it to OR more 5 68K addresses: A15, A16, A17, A18, A19. Leave the output...


Open pins.ucf in the ISE and connect the CPLD data pins to the databus,
the address pins to the corresponding 68K address pins. Orchain1&2 are to be connected to the output of each logical 74HC32 (order is not important). Connect ROM0CE to MPR-18203 CE pin and ROM1CE to MPR-18204 CE pin. C_CE goes to cart C_CE. Connect SEL to a switch that is to be tied to VCC or GND (to select normal or S&K compatibility).

Trigger is a Beta testing leftover, it isn't to be connected to anything :)

Man... I very happy with this "achievment" :D :lol: []

If the cart is left in the S&K compatiblility, it will not work alone, you have to toggle the switch to the normal position.

Thanks for sega to keep the critical S2 data at the same position in the sonic compilation ROM
Last edited by Jorge Nuno on Fri Feb 08, 2008 12:34 am, edited 7 times in total.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Thu Feb 07, 2008 11:42 pm

I'm not sure what your accomplishment here is - you could ALWAYS play Knuckles in Sonic 2 with the S&K cart with Sonic 2 plugged into it.

Jorge Nuno
Very interested
Posts: 374
Joined: Mon Jun 11, 2007 3:09 am
Location: Azeitão, PT

Post by Jorge Nuno » Thu Feb 07, 2008 11:52 pm

But I don't have Sonic2 alone, I only have Sonic compilation :wink: which has S2+S1+Dr. Robotnik inside it, and S&K treats it as a S1 Rom...

This is the whole point of this thread, it's for users who own a SC cart + S&K cart and not S2...

LocalH
Very interested
Posts: 152
Joined: Tue Dec 19, 2006 5:04 pm

Post by LocalH » Fri Feb 08, 2008 8:31 am

Are you sure that the S1 portion of the Classics/Compilation cart shows up at $200000? Normally, of course, S2 maps to $000000 but when used with S&K it maps to $200000 and S&K checks for the S2 product code and enables the extra ROM at $300000. The only sanity check S&K does on attached carts is the header, and of course the Classics header is not that of Sonic 2 so it throws the NO WAY screen. Is it the S1-style blue spheres game or the "any other cart" style one? Have you tried just editing the Classics ROM to have a standard Sonic 2 header (specifically, just the product code, the rest is irrelevant to S&K). If that would work, then you'd have a ROM that would work as-is both standalone and with S&K, when burnt to EPROMs and used in a real cartridge.

I guess the real question is: When you attach a hacked Classics with a S2 product code to S&K, does the detection code for S2 override what already exists at $300000 with the extra ROM? I have a strong feeling that it does but I have no way to test it because it doesn't quite work the same on emulation (if you take S&K, hacked Classics, and the extra ROM, and append them, it won't work because the extra ROM is not at $300000). If the extra ROM overrides what's already there (which I'm strongly thinking it does), then it probably doesn't matter if anything is above $33FFFF or not (since the extra ROM is only 256K, it doesn't go above that point in ROM).

Jorge Nuno
Very interested
Posts: 374
Joined: Mon Jun 11, 2007 3:09 am
Location: Azeitão, PT

Post by Jorge Nuno » Fri Feb 08, 2008 9:43 am

- Yes it is sonic1 that is present at 200000h in SC plain mode. The blue sphere is the Sonic1's style: Codes, sequential levels, vivid colors, animated characters in the no-way screen...

The appending method of S&K+SC+Patch on the computer doesn't work because you will have this "crap" in the end:

@loc0: S&K
@loc200000: S2 with SC header
@loc300000: Dr. Robotniks
@loc400000: Sonic1
@loc480000: SC code
@loc500000: S2 patch

For that to work (on the PC) you have to remove everything except the S2, change it's serial number to a Sonic2 one and put the patch at the end of Sonic2... (I think REV and CHKsum don't matter) 8) I used -01 and chksum 0000h :D .

Sonic2 + Dr Robotniks (ROM0) is never activated when SC is locked-on... Why? Because Sonic2 appears @ 0 but has a 74HC00 to decode it's chip-select: /Rom0CE = C_CE AND /A21... But in S&K C_CE is only active when A21 is High (from 200000 to 3FFFFFh) so that makes Rom0CE always inactive in S&K mode... That's why just replacing the serial isn't enough -> S&K only sees Sonic1 + SC code.

Now if we take a look into ROM1 (S1+SC) it has its Chip select mapped like this: /Rom1CE = C_CE AND A21 (hence appearing @ 200000h in SC mode).

If the locked cart is a anything except S2, the locked cart C_CE is already mapped to 200000h so the decoding logic in ROM1 in S&K mode is redundant


About Roms overlapping @ 300000h, it doesn't happen when S&K detects a S2 header, because S&K has some decoding logic that enbales the locked cart C_CE only in locations 200000-2FFFFFh (if S2 is detected), if not then C_CE is active from 200000 to 3FFFFFh. :wink:


I seems to work perfectly, though I didn't test some levels yet...

I noticed 4 different "things" in this S&K + S2 mode:

- There are no more 2 bottom lines of crap in the Emerald Hill, they are always displayed correctly (thank god); Every sonic2 I played had this bug...

- The Wing Fortress had a bug, that lets you walk on air when you stood on the rising plats (WTF!? :x ), it's fixed!

- The shield instead of being blue, it's gray, probably because there is no blue anymore, and a red flashing shield would burnoff your eyes... But the water surface in Aquatic ruin is in knuckles colors, that's right red and green :?

- When you leave the special stage/die in a pit, the amount of rings you had before is restored :shock: (instead of being cleared) and all game objects are reset.

Chilly Willy
Very interested
Posts: 2984
Joined: Fri Aug 17, 2007 9:33 pm

Post by Chilly Willy » Fri Feb 08, 2008 10:25 pm

Jorge Nuno wrote:But I don't have Sonic2 alone, I only have Sonic compilation :wink: which has S2+S1+Dr. Robotnik inside it, and S&K treats it as a S1 Rom...

This is the whole point of this thread, it's for users who own a SC cart + S&K cart and not S2...
Ah! Okay, that makes more sense then. :)

Post Reply