BOUNTY: CPS1.5 games (with Q-Sound) on CPS2 multi

Doing a lot of ai assisted work on Punisher over the weekend, i have most of the prio bugs squashed.

1792961211104.png
1792961357709.png


1792961494399.png


The overlay is LUA debug showing stage, phase prio stuff, layers and x/y on the stage.
 
Thanks for giving it a try!

Try searching "vasm mirror" - there are several copies up on Github.

You shouldn't need the exact commit, it is just referenced for documentation. That said once you have cloned the MAME repo with git, you can switch to the exact commit like this:

git fetch origin <commit-sha>

Thanks for the help, just for reference, I did the following:

1. Found a mirror which seems to be up to date: https://github.com/StarWolf3000/vasm-mirror/tree/master, cloned it into the tools/build/ directory inside this project, renamed the clone directory to "vasm" and built it using your instructions. It built fine and it reports the right versions:
Code:
user@octane CPS15_to_CPS2$ ./tools/vasm -v
vasm 2.0f (c) in 2002-2026 Volker Barthelmann
vasm M68k/CPU32/ColdFire cpu backend 2.8c (c) 2002-2026 Frank Wille
vasm motorola syntax module 3.19f (c) 2002-2026 Frank Wille
vasm test output module 1.0 (c) 2002 Volker Barthelmann

user@octane CPS15_to_CPS2$

2. Cloned MAME tree to "~/mame" and used "git log" to get the full hash of the commit you suggested (dated August 31). After that, ran the command you suggested:
Code:
git fetch origin 017b8670f0ad3be2f64911bf587eb137e53f08bd
The patch seems to have applied correctly and right now I'm building MAME. I hope it works fine. If not, I'll report/ask here for help.

Thanks again.

Edit: After 93 minutes, MAME compiled with no issue. Yay!

Edit 2: Now I do not understand what to do: I verified the roms with MAME, put them in mame_roms, and then tried to create the coverage traces, but got this:

Code:
user@octane CPS15_to_CPS2$ python3 -m tools.coverage dino punisher
[1/6] cov_smoke1p_dino rc=255 0.1s
[2/6] cov_smoke_dino rc=255 0.1s
[3/6] cov_service_dino rc=255 0.1s
[4/6] cov_smoke_punisher rc=255 0.1s
[5/6] cov_smoke1p_punisher rc=255 0.1s
[6/6] cov_service_punisher rc=255 0.1s
FAILED cov_smoke1p_dino: 255
FAILED cov_smoke_dino: 255
FAILED cov_service_dino: 255
FAILED cov_smoke_punisher: 255
FAILED cov_smoke1p_punisher: 255
FAILED cov_service_punisher: 255
FAILED cov_smoke_dino: no coverage written
FAILED cov_smoke1p_dino: no coverage written
FAILED cov_service_dino: no coverage written
FAILED cov_smoke_punisher: no coverage written
FAILED cov_smoke1p_punisher: no coverage written
FAILED cov_service_punisher: no coverage written
user@octane CPS15_to_CPS2$

I'm not really sure what I did wrong or how to continue here.
 
Last edited:
Thanks for the help, just for reference, I did the following:

1. Found a mirror which seems to be up to date: https://github.com/StarWolf3000/vasm-mirror/tree/master, cloned it into the tools/build/ directory inside this project, renamed the clone directory to "vasm" and built it using your instructions. It built fine and it reports the right versions:
Code:
user@octane CPS15_to_CPS2$ ./tools/vasm -v
vasm 2.0f (c) in 2002-2026 Volker Barthelmann
vasm M68k/CPU32/ColdFire cpu backend 2.8c (c) 2002-2026 Frank Wille
vasm motorola syntax module 3.19f (c) 2002-2026 Frank Wille
vasm test output module 1.0 (c) 2002 Volker Barthelmann

user@octane CPS15_to_CPS2$

2. Cloned MAME tree to "~/mame" and used "git log" to get the full hash of the commit you suggested (dated August 31). After that, ran the command you suggested:
Code:
git fetch origin 017b8670f0ad3be2f64911bf587eb137e53f08bd
The patch seems to have applied correctly and right now I'm building MAME. I hope it works fine. If not, I'll report/ask here for help.

Thanks again.

Edit: After 93 minutes, MAME compiled with no issue. Yay!

Edit 2: Now I do not understand what to do: I verified the roms with MAME, put them in mame_roms, and then tried running the just-built MAME to create the coverage traces, but got this:

Code:
user@octane CPS15_to_CPS2$ python3 -m tools.coverage dino punisher
[1/6] cov_smoke1p_dino rc=255 0.1s
[2/6] cov_smoke_dino rc=255 0.1s
[3/6] cov_service_dino rc=255 0.1s
[4/6] cov_smoke_punisher rc=255 0.1s
[5/6] cov_smoke1p_punisher rc=255 0.1s
[6/6] cov_service_punisher rc=255 0.1s
FAILED cov_smoke1p_dino: 255
FAILED cov_smoke_dino: 255
FAILED cov_service_dino: 255
FAILED cov_smoke_punisher: 255
FAILED cov_smoke1p_punisher: 255
FAILED cov_service_punisher: 255
FAILED cov_smoke_dino: no coverage written
FAILED cov_smoke1p_dino: no coverage written
FAILED cov_service_dino: no coverage written
FAILED cov_smoke_punisher: no coverage written
FAILED cov_smoke1p_punisher: no coverage written
FAILED cov_service_punisher: no coverage written
user@octane CPS15_to_CPS2$

I'm not really sure what I did wrong or how to continue here.
Thanks for the update! It looks like you are very close.

Exit code 255 means MAME stopped before emulating anything: it couldn't start SDL video. SDL video is started even with -video none, which the runs use. This usually happens over SSH or on a machine without a desktop session. Could you post work/jobs/cov_smoke_dino/stdout.txt? It has MAME's own error message. Meanwhile, try SDL_VIDEODRIVER=dummy python3 -m tools.coverage dino punisher. Also check that ~/mame is on commit 017b8670f0a (git -C ~/mame log -1 --format=%h): git fetch alone doesn't switch to it, you need git checkout 017b8670f0a.

I'll also see about improving the build instructions/tools so that you don't have to specify this manually in the future (assuming it works).
 
Thanks for the update! It looks like you are very close.

Exit code 255 means MAME stopped before emulating anything: it couldn't start SDL video. SDL video is started even with -video none, which the runs use. This usually happens over SSH or on a machine without a desktop session. Could you post work/jobs/cov_smoke_dino/stdout.txt? It has MAME's own error message. Meanwhile, try SDL_VIDEODRIVER=dummy python3 -m tools.coverage dino punisher. Also check that ~/mame is on commit 017b8670f0a (git -C ~/mame log -1 --format=%h): git fetch alone doesn't switch to it, you need git checkout 017b8670f0a.

I'll also see about improving the build instructions/tools so that you don't have to specify this manually in the future (assuming it works).
Thanks again for the help, in fact I am running this on another machine, through SSH. Setting teh SDL_VIDEODRIVER variable to "dummy" fixed the error.

Code:
user@octane CPS15_to_CPS2$ SDL_VIDEODRIVER=dummy python3 -m tools.coverage dino punisher
[1/6] cov_service_dino rc=0 8.0s
[2/6] cov_service_punisher rc=0 11.1s
[3/6] cov_smoke_punisher rc=0 29.2s
[4/6] cov_smoke1p_punisher rc=0 32.0s
[5/6] cov_smoke1p_dino rc=0 33.3s
[6/6] cov_smoke_dino rc=0 34.3s

user@octane CPS15_to_CPS2$

Then generated the output files:

Code:
user@octane CPS15_to_CPS2$ SDL_VIDEODRIVER=dummy python3 -m cps15to2.convert dino punisher
dinoc2: cave 0x382e, 165 sites, 27996 overlay tiles
punisherc2: cave 0x3778, 270 sites, 18664 overlay tiles

user@octane CPS15_to_CPS2$

All of this seems to work fine, however I am getting different hashes on all directories :(

Code:
user@octane CPS15_to_CPS2$ export LC_ALL=C
for d in out/mame/*c2/ out/darksoft/*c2/; do
  echo "$(cd "$d" && sha1sum * | sha1sum | cut -c1-40)  $d"
done
b2899b9eed6608834dd7266ddfa37360e30025e7  out/mame/dinoc2/
28626132ab9b5fb8e34dedf269a7074db953f7ff  out/mame/punisherc2/
4754527b13958b6beeccd6840c0383c2e39efa21  out/darksoft/dinoc2/
277e910df83dd0c29af3ffbd61e56a32b63ff8e7  out/darksoft/punisherc2/

user@octane CPS15_to_CPS2$
 
Thanks again for the help, in fact I am running this on another machine, through SSH. Setting teh SDL_VIDEODRIVER variable to "dummy" fixed the error.

Code:
user@octane CPS15_to_CPS2$ SDL_VIDEODRIVER=dummy python3 -m tools.coverage dino punisher
[1/6] cov_service_dino rc=0 8.0s
[2/6] cov_service_punisher rc=0 11.1s
[3/6] cov_smoke_punisher rc=0 29.2s
[4/6] cov_smoke1p_punisher rc=0 32.0s
[5/6] cov_smoke1p_dino rc=0 33.3s
[6/6] cov_smoke_dino rc=0 34.3s

user@octane CPS15_to_CPS2$

Then generated the output files:

Code:
user@octane CPS15_to_CPS2$ SDL_VIDEODRIVER=dummy python3 -m cps15to2.convert dino punisher
dinoc2: cave 0x382e, 165 sites, 27996 overlay tiles
punisherc2: cave 0x3778, 270 sites, 18664 overlay tiles

user@octane CPS15_to_CPS2$

All of this seems to work fine, however I am getting different hashes on all directories :(

Code:
user@octane CPS15_to_CPS2$ export LC_ALL=C
for d in out/mame/*c2/ out/darksoft/*c2/; do
  echo "$(cd "$d" && sha1sum * | sha1sum | cut -c1-40)  $d"
done
b2899b9eed6608834dd7266ddfa37360e30025e7  out/mame/dinoc2/
28626132ab9b5fb8e34dedf269a7074db953f7ff  out/mame/punisherc2/
4754527b13958b6beeccd6840c0383c2e39efa21  out/darksoft/dinoc2/
277e910df83dd0c29af3ffbd61e56a32b63ff8e7  out/darksoft/punisherc2/

user@octane CPS15_to_CPS2$
Nice! Those hashes are valid but just match an earlier commit of the repo (commit 3aac11e from a few days ago).

I'd suggest pulling down the latest changes (git pull origin master), then re-run the coverage traces (may not be needed but just to be sure), and re-run the last convert step.

In any case if you try out the builds from your output they should work, there's just been a few bugs squashed since.
 
Nice! Those hashes are valid but just match an earlier commit of the repo (commit 3aac11e from a few days ago).

I'd suggest pulling down the latest changes (git pull origin master), then re-run the coverage traces (may not be needed but just to be sure), and re-run the last convert step.

In any case if you try out the builds from your output they should work, there's just been a few bugs squashed since.

So I should just download latest MAME revision (October 27th?), apply the patch to it, build it again and recreate the output files, correct?
 
So I should just download latest MAME revision (October 27th?), apply the patch to it, build it again and recreate the output files, correct?
No you should be good with MAME as-is (no need to update or rebuild). You just need to update your local copy of the CPS15_to_CPS2 repository, then run the conversion script and your output files should match the current hashes.
 
No you should be good with MAME as-is (no need to update or rebuild). You just need to update your local copy of the CPS15_to_CPS2 repository, then run the conversion script and your output files should match the current hashes.
Success! the hashes now match the repo ones. I will try the games and post here any findings. Thanks @kuze !
 
Moving along to Dinos, and using some tricks inspired by Kuze i now have this working:

Those who have worked on this before, @kuze (and me) are basically cheating here.
The tree and bushes, on cps1 these are done as part of the background with some pen/mask trick that instructs the cps1 to draw them 'above' the objects.
On CPS2 this trick is not supported. Why? It's not needed. The CPS2 supports a lot more and bigger sprites.

So what do we do? We draw them again, as sprites, with transparant pixels so you can look thru certain areas and the edges look nice.
The original tree and bushes are still present but they are drawn below them.
AI bakes the obj tiles and uses some unused cps2 gfx rom, we have plenty of space there.

@kuze:
The only problem we had left is free pal slots, and speed. I let AI optimize the routines, and for Punisher (it doesn't do pen tricks a lot) the layer draw order helps us out a lot. Punisher fixes combine the 'if stage=value, and scrollX = >0100 and <0250' it flips the draw order, and so on.
I don't think i used a lot of baked tiles in Punisher, it was almost not needed.

This still needs testing on real hw. Punisher is 100% done. I need to clean up my work still.

Dinos still needs work to find proper free pal slots/dynamic fixes, but i'm getting there.

1793134500714.png
 
I don't know that it's cheating, but rather just working with the differences in the two sets of hardware. Ultimately it's pretty much the same way the existing Punisher conversion worked, but neocps1 was doing all the fixes by hand.

With advancements in tech/AI, we can now automate that and apply the workaround every time it comes up on a given game. It's kind of like with the Kabuki discussion though, it needs lots of testing on hardware to make sure everything has been found.
 
Yeah i'm still tweaking a lot by hand to not have the object overlay active all the time and eat slots/cpu, even in its current fast implementation.
Dinos is a real 'offender' with its lush forest and the 'near cps1 limit' of the dang car driving scene.
 
Yeah i'm still tweaking a lot by hand to not have the object overlay active all the time and eat slots/cpu, even in its current fast implementation.
Dinos is a real 'offender' with its lush forest and the 'near cps1 limit' of the dang car driving scene.
The original CPS 1.5 games (not talking about the conversions) do have some slowdown in spots occasionally. CPS2 has a higher 68000 clock (16 mhz versus 12 mhz) which gives some more wiggle room for the overlay engine and look up tables.

I agree though, the more things can be streamlined the better. :)
 
I started working on it, then i heard from @Hammy that Kuze also was working on the same thing.
Both our AI assisted attempts have a different approach. I've supplied some additional security fixes as well, all found by AI.
We both made a significant efforts to get the security patches done by having long AI sessions of the games.
Punisher and Cadilacs are not that big of a deal. Slammasters is totally insane, and also not a favorite of mine. WoF i didn't bother with, at all.

So I've focused on Cadilacs and Punisher for now. It took a long weekend of manual tracking and fine-tuning several fixes over both games.
I'm at a point where i don't really even want to play these games anymore currently lol. I think i did a decent albeit AI assisted job to get them playable.

Punisher is based on the earlier NeoCPS1 drop, but with large improvements and all security fixed. The 'life bar' and 'Kingpin' bugs are symptoms of a larger network of security patches. Just the NOP for the lifebar was not enough. The idea is doing most of the work with the layers and swapping the layer order around as needed during specific part(s) of the stages where it can be applied. Not all stages were fixed, and this took some time to get right, playing the game, and adjusting the X/Y postions where a fix was valid and where not. In this way, the game runs 99% 'original' with only minor extra sprite/obj tricks active where needed, and layer swaps where applicable. I just binged that work and got it done. There is exactly one little place you may see a layer overlap, if your screen position is right. But it takes special care to hide it.. It keeps the game at its original speed and routines the other 99% of the time.
The place where it does OBJ tricks are also tuned to use free PAL slots(and recycle where possible) so the GFX we draw are never overwriting slots for enemy sprites. (This finetuning was all manual work. I also heavily optimised the routines doing this.)

Cadilacs is a different story, i was feeling very optimistic after doing Punisher, but this game did not work with me on the layer swapping, they used the pen/tile trick in a lot of different places. Nothing was fixable with a layer-order swap. My engine applies an extra set of OBJ's to hide the missing pen/tile effect and it does its best to make it nearly invisible. Again this is behind Stage/Area/XY detection and manually tuned. (AI can do a lot, but getting proper positions on where to apply tricks is hard.). There are places where i don't use any tricks, and places where a lot of them are active, the garage internal is a point that may show bugs on 3-player scenerios that i didn't test!. Also, the fast scroll car area if you know where to look, it has issues. I've played the game a lot, and also can't really stand it anymore. Probably later.

I've decided to release my own patcher for Punisher & Dinos that unlocks this work, which you can now find here:

https://github.com/Asure/CPSConverter/tree/main

- It includes no roms, and does 1-click patching. You supply the roms. It builds Darksoft multi and real board sets.
- Resulting sets have been tested (extensively) on real hardware (1-player) with a Darksoft multi.
- Two player runs were done in parts where i suspect PAL issues (Dinos, garage, all 32 slots used, smart logic in place.)

It has one dependancy where it downloads a python version on Windows to your work folder, but doesn't install it. Clicking convert.bat after adding the right roms will make the magic happen.

Note: I'm not after the bounty, it was something to pass the time.

1793194918363.png
1793195386507.png
 
Last edited:
Just to clarify on my side as well, I'm not trying to claim the bounty and like @Asure this is just something I am personally interested in and want to see 100% completed. It's been great collaborating with @Asure and his findings have been super helpful. I took the approach of starting from scratch and finding a method that could be broadly applied across all of the CPS1.5 games/sets. There's also benefits to directly targeting one game too and manual patching.

Looking forward to continuing to chip away at this together and get all games perfect.
 
The original CPS 1.5 games (not talking about the conversions) do have some slowdown in spots occasionally. CPS2 has a higher 68000 clock (16 mhz versus 12 mhz) which gives some more wiggle room for the overlay engine and look up tables.

I agree though, the more things can be streamlined the better. :)
Yeah , the extra speed is also good for the mulu based protection, i remember the KOD B21 i did years ago ran like ass on the 10mhz board due to the extra maths but great on the 12mhz board.

WoF i didn't bother with, at all.

WOF seemed to be the easiest of them all in regards to the layers , not sure about the protection on it though.
 
I have only tried C&D and The Punisher and the only thing I have found is that whenever the main character goes behind some object (like the first building entrance on C&D first level or the Final bus fight in The Punisher) the sprites go weird. The games seem to be completely playable though, however so far I have only player their first levels (and the beginning of The Punisher's second, where the palm trees go weird when the main character is behind them. Other than that, no issues that I can see. Just in case it matters, I am playing on CPS2 DarkSoft multi, one of the first ones with an older firmware, because it requires connecting some device to it in order to upgrade it and I do not have the required device.
 
I have only tried C&D and The Punisher and the only thing I have found is that whenever the main character goes behind some object (like the first building entrance on C&D first level or the Final bus fight in The Punisher) the sprites go weird. The games seem to be completely playable though, however so far I have only player their first levels (and the beginning of The Punisher's second, where the palm trees go weird when the main character is behind them. Other than that, no issues that I can see. Just in case it matters, I am playing on CPS2 DarkSoft multi, one of the first ones with an older firmware, because it requires connecting some device to it in order to upgrade it and I do not have the required device.

@kuze are my findings related to sprites expected so far? or is something wrong with my setup?

@Asure thanks for publishing your work too. I'll try it and let you know how it goes for me.

Thank you both for your work!
 
Back
Top