Miscellaneous > Projects

sf3:3rd strike widescreen

(1/6) > >>

bankbank:
as you may or may not be aware, the sf3 cps3 engine has widescreen capability built in, of which different games take advantage to differing degrees. sf3:2nd impact has an explicit soft DIP switch "WIDE" that can be enabled which changes the game's width from 384 pixels to 496 pixels. this can be enabled easily in FBNeo by going to the input menu->Set dipswitches... and change 'Screen mode' to Wide. you can see a video of widescreen 2i in action here: https://youtu.be/39ggq3T_K_o

sf3 new generation also has this functionality available, but there is no soft DIP switch in the operator's menu. it can be enabled in FBNeo in the same manner from the input menu. it's 16:9 aspect ratio, although unlike 2nd impact there are some visual issues here or there, like for example in Ibuki's stage some foreground graphic will pop in and out depending on the X position of the players.

sf3: 3rd strike also has this functionality available, but there is no soft DIP switch, and also no "Set dipswitches" functionality in FBNeo. Why? it seems for two reasons:
1) unlike with NG and 2I, Capcom did not enable the logic which permits the players to walk beyond the 4:3 X position boundaries. so even when this mode is enabled for 3s, the players are still "stuck" within the boundaries of the vanilla game. for this reason, I think the FBNeo devs decided that it wasn't worth it for players to play this way (which makes total sense!).
2) unlike with NG and 2I, Capcom did not modify the HUD depending on whether the game is running in vanilla or wide mode. so the player's meters and health are all scrunched up on the left side of the screen.

So my idea is to do a hack which will accomplish the following, in order of priority:
*permanently enable the wide mode by modifying the BIOS ROM region (necessary for anything else)
*remove the X position playfield boundaries when the game is running in wide mode
*improve/replace the HUD, either by solely changing the X positions (they would be relatively small looking) or by outright replacing the graphics (and probably modifying the X position as well)

I think that these are fairly modest goals and they are within my capabilities. so let's look at my todo list:

1) because displaying these games requires the emulator to modify the video output properties, I need a custom build of MAME. if we inspect the cps3 driver source here
https://raw.githubusercontent.com/mamedev/mame/master/src/mame/drivers/cps3.cpp
we can see layout info for 2i:

--- Code: ---GAMEL(1997, sfiii2,      0,        sfiii2,   cps3,      cps3_state, init_sfiii2,   ROT0, "Capcom", "Street Fighter III 2nd Impact: Giant Attack (USA 970930)", MACHINE_SUPPORTS_SAVE, layout_sfiii2 ) // layout is for widescreen support
GAMEL(1997, sfiii2j,     sfiii2,   sfiii2,   cps3,      cps3_state, init_sfiii2,   ROT0, "Capcom", "Street Fighter III 2nd Impact: Giant Attack (Japan 970930)", MACHINE_SUPPORTS_SAVE, layout_sfiii2 )
GAMEL(1997, sfiii2n,     sfiii2,   sfiii2,   cps3,      cps3_state, init_sfiii2,   ROT0, "Capcom", "Street Fighter III 2nd Impact: Giant Attack (Asia 970930, NO CD)", MACHINE_SUPPORTS_SAVE, layout_sfiii2 )
--- End code ---

see that "layout_sfiii2" flag? that's not present for NG or 3s. so I need to build MAME with that flag present for the 3s entries, because I need MAME for the SH2 debugger. for compiling FBNeo with these 3s changes, you need to do the following (thanks barbudreamon!):

--- Code: ---replace euroDIPInfo by sfiiiwideeuroDIPInfo at https://github.com/finalburnneo/FBNeo/blob/master/src/burn/drv/cps3/d_cps3.cpp#L1562
--- End code ---

I have only ever compiled FBNeo, so it should be a good learning experience to compile another emulator after making some modifications (I am not an expert in anything, these hacks are a good way to learn).

2) I need to develop some better tools. for example, the NEO*GEO binary I was modifying for the kof98ratio mod was interleaved amongst 2 files. the CPS3 binary, however, is interleaved amongst *4* files. the binman utility I've been using ( https://www.jammarcade.net/binman-utility/ ) has been super handy, but I'm not sure if I'm able to use it to interleave / de-interleave 4 files. I think this should be pretty straightforward to write myself in C, I should learn it. here's some examples I found https://unix.stackexchange.com/questions/140563/how-to-interleave-the-lines-of-two-or-more-files .

3) once I have custom MAME, I need to decrypt the 3s BIOS (using XCOPY) and permanently enable the widescreen mode by modifying the upper nibble of the region from 0 to 9, and then re-encrypting the BIOS. this should be trivial.

progress I've made thus far:
I used MAME debugger's SAVE command to get a dump of the binary. I loaded that in ghidra and everything matches up correctly, so that's all good news.

CPS3 ROMs are encrypted. I am using the program "X.C.O.P.Y." to decrypt and re-encrypt, however only two of the four files that I decrypted seemed to match up with the dumped binary, so that's a bit confusing. need to do more research on this one. I think writing a program in C to do the encryption/decryption could be a bit out of my league, although the source is definitely available in FBNeo and MAME so maybe it's just a matter of copying and pasting and adding some file i/o.

my dream workflow would be to execute one .BAT file that could re-interleave and re-encrypt and then run - but since the project is relatively low in scope I could deal with having to manually deal with GUI programs like XCOPY and binman if I needed to.

so anyway, very little sexy progress to report here, this is just the very beginning of things. hopefully I will have something more interesting to report soon. thank you for reading!

barbudreadmon:

--- Quote from: bankbank on October 27, 2021, 11:05:09 AM ---1) unlike with NG and 2I, Capcom did not enable the logic which permits the players to walk beyond the 4:3 X position boundaries. so even when this mode is enabled for 3s, the players are still "stuck" within the boundaries of the vanilla game. for this reason, I think the FBNeo devs decided that it wasn't worth it for players to play this way (which makes total sense!).

--- End quote ---

That's indeed the reason i didn't enable the widescreen dips for sfiii3 :).
Good luck with this new hack, we'll be happy to add it !

dink:
Wow, that sounds incredible - best of luck on your project :)

best regards,
- dink

bankbank:
huge thanks to TVIndustries, we now have python scripts for both the process of decrypting and merging and encrypting and splitting:

https://github.com/Strugglemeat/3stools/

bankbank:
thanks to yoshin222 for supplying me with a bunch of memory addresses for 2i and 3s. in 2i, the X position max/min for P1 aren't affected by the 4:3/wide setting.

I got MAME compiled with what I think are the necessary changes, now I'm trying to figure out how to properly decrypt the BIOS.

Navigation

[0] Message Index

[#] Next page

Go to full version