** 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.
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.
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
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.
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.
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