Vanguard freeplay and high score save

philmurr

Active member
vacBacker
Feedback
46 (100%)
Credits
2,350CR
Well I know I said I wasn't going to do any more high score mods for a while. That was until I picked up a Vanguard machine a couple of weeks ago, and just last week got talking to someone else who'd also just got one and we were both having a moan about the lack of a high score save function.

Vanguard, for people who don't know the game, is probably best described as a bit similar to Scramble. Although it has horrible collision detection and firing, and plenty of bugs, I think it's awesome, love the game and have fond memories of playing it when I was a kid. But whilst it has a 7-position high score table, it doesn't save it on power-down, and lacks any kind of free play mode.

It also runs on 6502 hardware, and I've probably only programmed a couple of hundred bytes of 6502 code in my life. But I wanted to get the additional functions on my game, so armed with "Programming the 6502" book by Rodnay Zaks, and a couple of excellent online resources, I set out to learn some of the workings of the game to enable me to write the mods.

The high score save was actually easiest. The game uses a 1Kx8 4118 (socketed!) for programme memory which needs to be swapped out for a Dallas DS1220 module, then I just needed to bypass the code that clears the high score memory on startup. Add some code that does clear the high score memory when you hold down certain controls on power-up and that was it done.

The enhanced free play mod (maintains the attract demo whilst in free play mode) was more tricky. There is an unused DIP switch that I've used to set freeplay mode on and off. Vanguard relies on an NMI being generated when a coin is entered, so the programme doesn't have to keep checking for coins in software. As my code preloads the game with the right number of credits depending on P1 or P2 start buttons being pressed, I had to write a number of checks for the buttons being pressed during the demo mode. I then changed the code that writes the number of coins inserted onto the screen, and have it shown only in non-freeplay mode.

Finally when in freeplay mode, I didn't want coins being registered, so had to intercept the NMI routine to not accept coins unless in normal (paid) mode.

Happy to say I got all this working today, programmed and tested it in Mame, and extensively tested it on real hardware, I think all the bugs are out.

The code needs just 3 of the game ROMs changing, and a Dallas NVRAM module to save the high scores.

Obligatory pictures below, thanks as usual for everyone who appears in the high score table
smiley4.gif


Feature summary:-

High score table saved on power-down
Default high score table by holding down certain controls on power-up
Enhanced freeplay (maintains attract mode) selectable using unused DIP switch
Coins only accepted in paid mode
Coins only displayed on screen in paid mode
Correctly handles continue function in both paid and freeplay modes
Reduced the high score table scores from 10000 to 5000 to make it easier to get a high score!

Attract screen (freeplay mode, note no coin count displayed)

VG_demo_mame_2.JPG


Attract screen (paid mode - coins displayed)

VG_demo_mame_coins.JPG


High score table (saved to NVRAM)

VG_HST_Mame.JPG


On real hardware

VG_demo_hardware_1.JPG


Modifications to the board

VH_high_score_PCB.JPG
 
  • Like
Reactions: cNp

RGP

Meeter & Greeter
Feedback
5 (100%)
Credits
2,039CR
Hey Phil, only just seen this thread, i'd love to patch my cab so I don't have to put coin buttons on the front.

If I don't install an NVRAM will the game just reset the scores automatically or would you need to mod the code further to allow for that?

At shows its super useful to have freeplay but have the scores auto reset next day.

And DS1220's are starting to get hard to buy and going up in price - although......... I have been given some prototype boards using 6116's and a small battery.

Awesome work :)
 

philmurr

Active member
vacBacker
Feedback
46 (100%)
Credits
2,350CR
RGP said:
If I don't install an NVRAM will the game just reset the scores automatically or would you need to mod the code further to allow for that?

Probably a single byte to change to get it to reset the scores every time, I'll take a look at the weekend

RGP said:
And DS1220's are starting to get hard to buy and going up in price - although......... I have been given some prototype boards using 6116's and a small battery.

Interesting that you have some - I made a small board using a 6116, battery and DS1210 controller (which is essentially what the original DS1220 modules consisted of) but most boards can now use FRAM (unfortunately Vanguard isn't one of them...)
 

philmurr

Active member
vacBacker
Feedback
46 (100%)
Credits
2,350CR
RGP said:
Hey Phil, only just seen this thread, i'd love to patch my cab so I don't have to put coin buttons on the front.

If I don't install an NVRAM will the game just reset the scores automatically or would you need to mod the code further to allow for that?

OK code has been modded (1 byte, not elegant) so it will reset the scores every time on power up, but retains the attract mode in freeplay

You need to download the high score save ROMs from www.highscoresaves.com, then replace sk4_ic07.bin (IC7 on the board) with the ROM code found here http://www.ukvac.com/forum/uploads/183/sk4_ic07_reset_HST_every_time.zip

If (for whatever reason I can't think of) you want to use this modded ROM in Mame you need to rename it sk4_ic07.bin
 
Top