Star Force Free Play * Updated *

edwoodjnr

Active member
vacBacker
Feedback
2 (100%)
Credits
243CR
** Updated 30/05/2017 **

Although adding an XOR D0 enabled my mod to work on my encrypted PCB it meant changing some hex to make it work if you wanted to use it in MAME. GadgetFreak suggested an alternative approach and now the Free Play mod works in MAME and a real PCB with encrypted ROMs.

All zip files below have been updated.

** Updated 30/05/2017 **

I recently got a Star Force PCB and as I like to have a free
play setting on my cabs and boards I decided to have a go at this one. The game I have is a Star Force (encrypted
set 1) PCB with the 315-5069 encrypted z80 CPU.

The original PCB has various coin settings using bits set on
DSW1 depending on whether 1 or 2 coins have been inserted but no free play
setting. If you insert a coin then a
screen is displayed indefinitely asking you to press P1 or P2 to begin. So I wanted the changes to include just
hitting P1 or P2 to begin the game, display “FREE PLAY” on the attract screen
and to never ask for a coin input.

I used the MAME source code, debugger and unencrypted romset
to work out the main variables used, such as screen number, coin count, P1 and
P2 input and set about on the hack. As
with most roms there is little space to inject new code and it took a while to
figure out what was needed and where to put it. I initially could get the game to start but
it would either return to the main screen after launching the ship or would
finish a game and return to a blank screen.

After finally getting the game working in MAME using the unencrypted
romset I applied the same changes to the encrypted version I have. It took quite a while to work out the
encrypted hex using the MAME debugger.

Star_Force_screenshot.PNG


Next, having tested my code in MAME, I burned a set of roms,
plugged them into my board and gave it a go.
I had a nice “FREE PLAY” displayed but the game did not start when I hit
P1 or P2. I checked my connections
with my multimeter, reburned the roms and checked my code, it should be working
fine.

Thinking there is maybe some kind of interrupt timing issue,
I rewrote the code. Again, working in
MAME but not on the real PCB. At this
point I was about to throw the towel in and put it down as a lost cause. I was convinced the code was fine so decided
to find out what the PCB is seeing when P1 or P2 is hit. I decided to send DSW1 value located at D002
to the coin counter that is displayed on the screen. I was expecting to see 00 when there was no
input (MAME showed 00) but was seeing D0.
If P1 was hit, it wasn’t 04 that MAME was showing me but E2 and instead
of 08 for P2 I was seeing E6. I can
only assume that the P1 and P2 input presented in MAME is decrypted by the
debugger.

Adding an XOR D0 to the code did the trick and the game now
plays perfectly on my PCB although not in MAME.

Star_Force_PCB_small.jpg


I have only tested this hack on my Star Force (encrypted set
1) PCB and I am sure that the other versions I have coded should work fine. In the zip files below you will find the code
contained in patch files with full instructions on how to update your roms - there
are no roms in these files. I have used patch files as a way of making sure the correct rom is being patched. The patcher program will report an error if you have selected the wrong rom to update.

Star Force

https://www.ukvac.com/forum/data/uploads/1335/starforc.zip

Star Force (encrypted set 1) – for MAME set $16D3 to A8 in
rom starfore.003

https://www.ukvac.com/forum/data/uploads/1335/starforce.zip

Star Force (encrypted set 2) – for MAME set $16D4 to 80 in rom
3.bin

https://www.ukvac.com/forum/data/uploads/1335/starforca.zip

Star Force (encrypted bootleg) – for MAME set $16D4 to 88 in
rom a4.8j
https://www.ukvac.com/forum/data/uploads/1335/starforcb.zip

edwoodjnr2017-05-30 19:19:15
 

philmurr

Active member
vacBacker
Feedback
46 (100%)
Credits
2,350CR
Excellent work again Gavin, and just like Food Fight I love the labels you've made for the EPROMs
smiley32.gif


Really enjoying all of this homebrew coding that's happening at the moment
 

edwoodjnr

Active member
vacBacker
Feedback
2 (100%)
Credits
243CR
philmurr said:
No schematics and encrypted ROMs...I do like a challenge
smiley5.gif

Yes, I couldn't find any either.

I applied a minor code tweek today, all patch files updated.

The fix allows
you to press P1 or P2 on the screen where you enter the high score and
not have to wait until the high score music ends.
 

philmurr

Active member
vacBacker
Feedback
46 (100%)
Credits
2,350CR
edwoodjnr said:
philmurr said:
No schematics and encrypted ROMs...I do like a challenge
smiley5.gif

Yes, I couldn't find any either.

I applied a minor code tweek today, all patch files updated.

The fix allows
you to press P1 or P2 on the screen where you enter the high score and
not have to wait until the high score music ends.

Nice update

As a matter of interest, how do you work out the patch when the code is encrypted? Is it a matter of using Mame to disassemble the code then do the patch in reverse?
 

edwoodjnr

Active member
vacBacker
Feedback
2 (100%)
Credits
243CR
I wrote and tested the code on the unencrypted version first and then I had to work out each encrypted op code and address manually, mainly by trial and error. It is quicker using a hex editor to change each byte and see the results in the MAME debugger; when it matches move on to the next one. Eventually you begin to see patterns in the hex.

The new fix behaves exactly like the original code when you have already inserted coins and hit P1 or P2.
 

Dazzer

Newbie
Feedback
1 (100%)
Credits
31CR
Well this is one of my all time fav games... and agree free play is a nice feature.... (will add shortly) and get back and confirm if it works.... but would really really love to see a High score save done for this one....... ONE DAY.... ONE DAY......
 
Top