A forum to show appreciation and respect for classic video game systems and games. Whether you're a modder, a programmer, or just a collector, this forum is about appreciating classic games and systems in a constructive community environment.
 
HomeHome  CalendarCalendar  FAQFAQ  SearchSearch  MemberlistMemberlist  UsergroupsUsergroups  RegisterRegister  Log in  

Share | 
 

 Getting NON-cps1 street fighter 2 hacks to work on a CPS1

View previous topic View next topic Go down 
AuthorMessage
Drakon
Admin
Admin
avatar

Posts : 1607
Join date : 2012-01-25
Location : Canada

PostSubject: Getting NON-cps1 street fighter 2 hacks to work on a CPS1   Fri Mar 16, 2012 6:42 pm

There's a lot of great hacked street fighter 2 arcade rom dumps that came from completely bootlegged arcade boards. Only a couple of these rom dumps were designed to be burned into eproms and used on a regular cps1 street fighter 2 champion edition pcb. The hacked / bootleg rom dumps that directly work on a regular CE board are:

ranbow set 3
red wave
possibly v004 / accellerator part 1 but these hacks suck so much I never bothered testing them out

I also found out that the accelerator part 2 hack works fine on a cps1 if you just pad the 21 rom to 512k

Now moving onto the far more complicated dumps are the m5 and m7 dumps. These dumps are Anything but ready to be copied and pasted into the champion edition zip to be played under the regular cps1 profile. The m5 / m7 dumps have the files split in an interlaced pattern:



The top hex is from the regular sf2 champion edition rom, the second / third hex boxes are from the m5 hack dumps

I did some web searching and wound up on this site:

http://www.darkfader.net/toolbox/

I downloaded the "interleave.zip" tool. It's a dos command based program so I wrote a batch file for it that takes files named 1, 2, and combines them back together in the regular interleaved pattern. Doing so made the hex look just like the champion edition rom dump



Then I split the file into the two 512 k separate files it needs. I split the roms at the proper spot and copied them into the sf2ce folder and it ran but unfortunately the sprite layer is flickering. The good news is that everything else works perfectly, audio is fine, controls are fine, even all the m5 hacks are running great even though the system is running it like it would be on a normal cps1. So I've managed to decrypt these roms on my own using tools I found on the net. I tested this M5 dump running as CE in multiple emulators and each emulator has the graphics flickering. I even did the same process on the m7 hack and got the same results, it ran but gave me flickering graphics in the emulator when loaded under the normal cps1 profile.

I also seem to have found the code that makes it run right.

This's taken from the latest release of cps1.c

1336 /* from here onwards the CPS-B board has suicide battery and multiply protection */

1262 /* name CPSB gfx mapper in2 in3 out2 kludge */

1359 {"sf2ce", CPS_B_21_DEF, mapper_S9263B, 0x36 },
1379 {"sf2m5", CPS_B_21_DEF, mapper_S9263B, 0x36, 0, 0, 1 },

it seems to be calling kludge, found some kludge code

1840 /* Some of the sf2 hacks use only sprite port 0x9100 and the scroll layers are offset */
1841 if (state->m_game_config->bootleg_kludge == 1)
1842 {
1843 state->m_cps_a_regs[CPS1_OBJ_BASE] = 0x9100;
1844 state->m_obj = cps1_base(machine, CPS1_OBJ_BASE, state->m_obj_size);
1845 scroll1xoff = -0x0c;
1846 scroll2xoff = -0x0e;
1847 scroll3xoff = -0x10;
1848 }
1849 else
1850 {
1851 state->m_obj = cps1_base(machine, CPS1_OBJ_BASE, state->m_obj_size);
1852 scroll1xoff = 0;
1853 scroll2xoff = 0;
1854 scroll3xoff = 0;
1855 }

also I'm pretty certain this's what causes the sprite flickering issue.

2337 /* some sf2 hacks draw the sprites in reverse order */
2338 if (state->m_game_config->bootleg_kludge == 1)
2339 {
2340 base += state->m_last_sprite_offset;
2341 baseadd = -4;
2342 }
2343 else
2344 {
2345 baseadd = 4;
2346 }
2347

I'm going to assume that the graphic flickering is caused by it drawing the sprites in reverse order. The sprite offeset just makes sprites draw in the wrong areas in the menu


(more random code that might be relevant)

434 /* CPSB ID multiply protection unknown ctrl priority masks palctrl layer enable masks */

448 #define CPS_B_21_DEF 0x32, -1, 0x00,0x02,0x04,0x06, 0x08, -1, -1, 0x26,{0x28,0x2a,0x2c,0x2e},0x30, {0x02,0x04,0x08,0x30,0x30}

Link is here:
http://mamedev.org/source/src/mame/video/cps1.c.html

It looks like someone would need to hack the roms to not draw sprites in reverse order...don't know if I could do that...I have no idea how to hack the rom to draw sprites in the proper order. The sprite offset doesn't cause any real issues but the sprite reverse order thing causes flickering and that's no good

Back to top Go down
View user profile http://16bitgamer.canadian-forum.com/
Drakon
Admin
Admin
avatar

Posts : 1607
Join date : 2012-01-25
Location : Canada

PostSubject: Re: Getting NON-cps1 street fighter 2 hacks to work on a CPS1   Sat Mar 17, 2012 12:33 pm

I did some experimentation with my eprom burner yesterday. I tried burning the accellerator part 2 roms but they wouldn't work at all on my cps1 it looked like it was just constantly resetting. This is really odd because when I copied these roms into the champion edition zip and ran the champion edition zip it ran no problem.

The other thing I did was I burned my m5 roms that I interleaved / decombined just to see what would happen on a real cps1. Surprisingly it ran! However it still will need a lot of work. Since the sprites were drawing backwards they would rarely be visible. Only very occasionally you would see flickering sprites. For some bizarre reason the ryu tile set from the test menu was permanently pasted over top of the graphics....possibly because of the offset or the sprite drawing issue. Also the controller inputs weren't working so this confirms that the programming changes in cps1.c for the bootlegs do represent the hardware differences between the bootleg pcbs and the real cps1. That's the BAD news.....

The GOOD news is however....I got M5 to RUN on a real cps1! I watched the attract mode for a bit and during one of the moments where you actually saw flickering sprites you could see that ryu was indeed shooting two intercrossing fireballs so the code is fully working. Sound is working great too.

The next step is something I really have no clue if I'll ever be able to figure out. Finding out the programming in the rom images that tells it what order to draw the sprites in would be fairly difficult. Also finding out how to re-program the controller inputs would be difficult but I imaging using mame debug to freeze when I hit a button in champion edition would point me to the correct code. Basically....I have NO ability to read and / or understand assembly or whatever type of programming these roms are. I'm also terrible with using mame debug. So the next step would be to make friends with someone who really knows this stuff well.

The mame debug is anything but user friendly...it was hard finding any documentation on it and all the functions of it are command line based like a dos window. This's why I need someone who knows their stuff.
Back to top Go down
View user profile http://16bitgamer.canadian-forum.com/
Drakon
Admin
Admin
avatar

Posts : 1607
Join date : 2012-01-25
Location : Canada

PostSubject: Re: Getting NON-cps1 street fighter 2 hacks to work on a CPS1   Sun Mar 18, 2012 4:46 pm

I'm proud to announce that this project is 100% done. Here's what I did. Since the champion edition rom dumps and the m5 cleaned up dump are very similar I tried copying data back and forth between the two rom sets and seeing what effect it would have. I did a LOT of trial and error and eventually found the programming that applies all the game hacks while keeping the cps1 compatible programming in tact. The M5 bootleg romset now runs 100% flawlessly on my official cps1 pcb.



Here's the rom zip:

mediafire.com ?7tkputeihk775e2

If you rename this zip sf2ce.zip winkawaks will run it fine and I assume other cps1 emulators will run it too. To upgrade your champion edition, turbo, or rainbow edition to this m5 hack just burn the 21, 22 and 23 roms and it should run fine on your regular cps1 arcade pcb. The 21 rom is just the regular champion edition rom and the 22 / 23 roms are the hacked up m5 roms.

Here's the video to prove it works:

Back to top Go down
View user profile http://16bitgamer.canadian-forum.com/
Drakon
Admin
Admin
avatar

Posts : 1607
Join date : 2012-01-25
Location : Canada

PostSubject: Re: Getting NON-cps1 street fighter 2 hacks to work on a CPS1   Sun Mar 18, 2012 11:42 pm

Here's a playthrough video:

Back to top Go down
View user profile http://16bitgamer.canadian-forum.com/
Drakon
Admin
Admin
avatar

Posts : 1607
Join date : 2012-01-25
Location : Canada

PostSubject: Re: Getting NON-cps1 street fighter 2 hacks to work on a CPS1   Mon Mar 19, 2012 10:01 pm

While working on this I made some pretty funny glitch versions of the game. This one's my favourite. The first guy you fight is bison and after you beat him you get the ending laughing

mediafire.com ?dkzrjcob3n6c444
Back to top Go down
View user profile http://16bitgamer.canadian-forum.com/
silverfox0786



Posts : 8
Join date : 2014-01-14

PostSubject: Re: Getting NON-cps1 street fighter 2 hacks to work on a CPS1   Tue Jan 14, 2014 11:11 pm

would it be possible to get the link reuploaded please
Back to top Go down
View user profile
Drakon
Admin
Admin
avatar

Posts : 1607
Join date : 2012-01-25
Location : Canada

PostSubject: Re: Getting NON-cps1 street fighter 2 hacks to work on a CPS1   Thu Jan 16, 2014 9:03 pm

I don't have the files for this I've since made a custom hack which is in another thread.
Back to top Go down
View user profile http://16bitgamer.canadian-forum.com/
Sponsored content




PostSubject: Re: Getting NON-cps1 street fighter 2 hacks to work on a CPS1   

Back to top Go down
 
Getting NON-cps1 street fighter 2 hacks to work on a CPS1
View previous topic View next topic Back to top 
Page 1 of 1
 Similar topics
-
» Getting the Street Fighter Wolf 3D mod to work.
» NECA - Street Fighter IV series I & 2 & Mini SF
» Sota SF rounds 1,2,3 and 4 and old dcd...
» MORTAL KOMBAT VS STREET FIGHTER :O
» Street Fighter RYU Half scale statue

Permissions in this forum:You cannot reply to topics in this forum
 :: Projects / Showcase :: Completed Projects-
Jump to: