Jump to content
IGNORED

Working Atari 2600/VCS games on VirtualVCS


doctorclu

Recommended Posts

OK, I did some more digging and also found a 2600 address guide to help me know what I'm looking for. I found the code which reads PIA port A & B. I think these are the RAM addresses:

 

Port A (SWCHA $280) = $14628

Port B (SWCHB $282) = $14629

 

The code explicitly says it does not support the two control regs which can change the ports from input to output (SWACNT and SWBCNT), which is why A and B are sequential addresses instead of separated by another byte. But that should be OK, as long as the code is consistent about virtually locating SWCHB adjacent to SWCHA.

 

Then I found the code that actually reads the virtual switches every time through the game loop, and I don't think it has support for dynamic modification. The difficulty switches would need to be mapped to a controller keypad button, and of course those are instantaneous, and not toggle switches like it was on the old 2600 console. Code snippet:

*	Check for console switches.
****	Don't forget the A/B and Color/BW switches.

	moveq #-1,d2		; Assume nothing is pressed.
	btst #OPTION,d0		; Is OPTION down?
	bne.s .not_option	; Nope.
	bclr #0,d2		; Else clear RESET bit.

.not_option:
	btst #KEY_1,d0		; Is 1 down?
	bne.s .not_1		; Nope.
	bclr #1,d2		; Else clear SELECT bit.

.not_1:
	move.b d2,em_ports+1	; Save port B data.

 

You can see the code does not read any physical button to determine the A/B switch settings. But good news! If we want to hard-code the two difficulty switches, we should just have to change the value stored in the first moveq operation. Right now, it's using -1 which is the same as $FFFF (in other words, all ones). The two difficulty switches are stored in bits 7 and 6, and the RESET and SELECT switches are stored in bits 0 and 1.  Color vs. B&W is stored in bit 3. So if we change the moveq value from -1 to $B, that should allow us to hard-code the two difficulty switches to the zero (easy) setting.

 

Next step: Look for 74FF in the ROM. Change FF to 0B, and see if that changes the difficulty switches to easy.

Edit: Use $0B instead of $03 to preserve the color switch setting.

Edited by Songbird
  • Like 3
Link to comment
Share on other sites

It works! Both switches now show B (amateur) instead of A (pro).

 

KGIgVMa4Gj7_789lfnUFJc9sh6-rCj9fW_1xAcMRiEUv0gNl3W7jqwP5TimxcDh463ffDAToaEl7tp1PigjRc_GVc_YVZXljdXIwat3vXYUENytX1l2SRLFVJUa-PMb1KpLjCJkLfxM9uuxlCYavQhQQo_ipFk1MlmzF_z5YCCpoGhtWFFy7DpiO_fqI4cudykAiG3nXlI7ME2zOgqzLlKqKgSRl051-yNBauy3K-pf2rQpCEQcLtIqDK0zHqP1UyMYGfuBq7pRurqaZcS2vjzSTF0eZB-aI6RAzesvkFODNI0knpodJBxXXvhIhHzKL_dsibVKaaJovpGZN0AGBAekiZRooLeVDS9ICLeEjD_pthDlG-ObgENopYnAc6EXE45i7sh7MZhD_Kxz3RSR0R768bn41javG0JpDmpX_qX-roqQso6qlDmyv2RQqg9ot0eQa0qQAXYgdyssJsex1sogrUqZd66t_kkn_fDIXG7PnkX7Y_PJ4nZDqEzjNfQ0oSnihdELHjntdNYziqAgd3QDkJHxnL2VV-9VTlX3E5LSr_ZcSPkuQ7Ykd8Q3CoyLUiHryx7v3V5WE2Wj-uwv_nn0x9WcvMVU0CldJvHWgW3s3tRO7v4yTx9JOkEpLsw2kRJVjNmWxwji4lO3XHhyiwTmDLJJ6y0pWgEudrodxbvoejqDFVQsoP7SWU7NPMqrWMfo4yQyIiKutMVnRuCXmJMvUHqCtuLQ0P6Q20sOhHgFr2rRA122rN8uGQFghpFCcK3TFkNA4M1OUw4aZEvxaWpv8IaxulWi_EcNeDyAjw9oFPmpXrfhn9GEnWAOGHVhJ9PDbUNiKoXEzi6TBNa3r_0rsrTDwGkySgHI6srKwXPtSrtNJZ26hx-2Y28wcKo0KBk6SzaMpaKs5ijALp7mKzrUEOLpqtmi82NtDbPj_S_oOom2oqtNSByHt9b5x8_KHsSPqt4BOJLMqTHl4MvO2hF2_7XKQVz1NTBukYhcjONj_35K9H1lG3VEd589zIxw0kdcK6EbRcZqZcMDmn5bKbZ4Ymd-SIA=w914-h685-no?authuser=1

 

A proper solution would involve mapping a keypad button to each switch and then treating each press as a toggle. But then you also have to handle the case of the player holds it down too long, so you need edge detection to debounce each button press. It's all doable, but not something I'm going to take on in the near term as I would also have to rebuild the entire ROM and not just portions of it like I did in the past.

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

13 hours ago, Songbird said:

It works! Both switches now show B (amateur) instead of A (pro).

 

[Long Link that doesn't work]

 

A proper solution would involve mapping a keypad button to each switch and then treating each press as a toggle. But then you also have to handle the case of the player holds it down too long, so you need edge detection to debounce each button press. It's all doable, but not something I'm going to take on in the near term as I would also have to rebuild the entire ROM and not just portions of it like I did in the past.

Wow, not sure what you tried to post, but this is sounding cool.

 

Will try this after Sventoonie on MeTV...

Link to comment
Share on other sites

I keep forgetting I can't cut-and-paste photos from the cloud directly to AA... it was just a simple pic of the 2600 switches test program. If a moderator wants to give me edit privileges for this thread, I'll remove the dead link (or you can do it directly).

 

image.thumb.png.0d4d1084def9b88e21ef8a40a9832dff.png

Edited by Songbird
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

13 hours ago, Songbird said:

I keep forgetting I can't cut-and-paste photos from the cloud directly to AA... it was just a simple pic of the 2600 switches test program. If a moderator wants to give me edit privileges for this thread, I'll remove the dead link (or you can do it directly).

 

image.thumb.png.0d4d1084def9b88e21ef8a40a9832dff.png

 

I'll ask.  :D   But this is an awesome moment for sure.   I've played regular difficulty Astrosmash and Space Attack now quite a lot and it is a more enjoyable experience.   Working on putting together a few more game packs of the games that are playable or mostly playable. 

 

Thanks for your help on this.

  • Like 3
Link to comment
Share on other sites

Thanks to the efforts of Songbird, and s0c7 for their helping tracking down the difficulty switch as well as Clint Thompson reminding me about Virtual VCS.  

 

I'm finally wrapping up the Sci-Fi pack I made for New Years 2019 with proper title screens and a choice between NORMAL and HARD difficulties.  VVCS was default hard difficulty before.   And the plan originally was to make a "Battlestar Galactica" game pack (something I'm a big fan of, at least the 1979 series).  If I get a few more things working on the sixth game "Space Chase", I might still make the Battlestar pack out of fun.

 

vvcs-Sci-Fi Pack A.rom.zip

20221106_212833.thumb.jpg.d0ed6f32da70185703e736e4ba9858e6.jpg

vvcs-Sci-Fi Pack B.rom.zip

20221106_213005.thumb.jpg.e1eb7f4080c804fdebdfff51b7de5071.jpg

 

1. Space Attack - Battlestar Galactica version

Since Space Attack/Space Battle (Intellivision) was supposed to be a Battlestar Galactica game this was my own game hack of it.

 

Normal difficulty is slower combat, and the battle pauses outside the immediate battle.

Hard difficulty is crazy (but fun) and the battle continues outside of the immediate battle.

 

[In the manual left controls difficulty on the flight screen, and right controls the difficulty on the radar screen.

I wonder if VVCS could switch difficulty individually?   Hmmm... ]

20221106_213023.jpg.1181b39f425c3de72eaca45a540e1c0c.jpg20221106_213030.jpg.f22e12a820e7cc6595bd6abc1e8b81b0.jpg

2. Space Attack - Star Wars Version

Found this in a game collection and actually the first Space Attack I found working in V VCS.  If you like Star Wars, this is for you.

20221106_213130.jpg.c3e75aadc7d422ad1680b599f9506262.jpg20221106_213136.jpg.226beb331b610b7050b183ae27ec31a9.jpg

3. Space Attack - Original

For the pureists out there.

As said before, missing the star field in the background, and the size of the ships are normally bigger as the enlarging effect is not working yet in VVCS.

20221106_213247.jpg.b4e18e4fc33793002a40c1f1dbde9d8b.jpg20221106_213332.jpg.5de25c3713993bd24510dd45edc66f4d.jpg

4. Astrosmash *

Normal difficulty is fun casual pace.  Hard is just crazy, can last a few minutes.

The lines on the screen are a glitch, but doesn't interfere with play.   Score is wonky but seem to display once the game is over.

Plays for one life.  Restarts with "option" on the controller.  

 

I think this is the game I enjoyed the normal difficulty setting on VVCS most on so far.

 

Battlestar pack: I actually hacked this to look like cylon ships flying in, and your cannon is like the one on the side of Galactica.  Still in progress.

 

* Actually this is "Astroblast".   Man, Mattel and their alternate names for the Atari versions.  :P

20221106_213442.thumb.jpg.d85f29a2a8ca8a2ba25cd25eb982d28d.jpg

 

5. SKY DIVER

 

No idea what normal or hard difficulties do on this.  Just fun to play.   As you can see, the score at the top in not quite placed right, but otherwise...

 

Battlestar pack: Why is a sky diving game on a Sci-Fi pack?  So this was in this pack as I was going to hack the airplanes to Galactica shuttles, and the troops were parachuting down to raid the planet Gamoray like they did on the episode "The Living Legend".   If I get the next game (Space Chase) working on V VCS with invisible shots, I might make this happen too.

20221106_213618.jpg.8f8b97a28ae799f73e60f31a4efbdbc5.jpg2145151595_ScreenShot2022-11-06at11_01_00PM.png.788850059561c25e7266d3537d1ed0be.png

6. Space Chase

This one is soooo close.   I either need to figure out how to get the the flashy "Ball" effect working (I don't have the source code to Virtual VCS so that is unlikely) or hack Space Chase and replace the "ball" or "Missile" effect with other shot methods that are visible in VVCS (more likely as I hack and am a hack)  :P

 

You can play this, estimate shots and move to hopefully not be a stationary target.  :P

20221106_213735.jpg.5266f2980ea6939229a4260bbec055de.jpg

Battlestar pack: This game always captured my imagination much like how the Viper's flew over Carillon in the Battlestar "Saga of a Star World" pilot episode.  Loved the scrolling terrain of the world beneath the battle that you orbit.   Those graphics blew my mind as a kid playing Atari.

 

It would be fairly easy (I would imagine) to hack the ship into a Viper, and the enemy ship into Cylons.

857761236_sagaofastarworld353-2775694270.thumb.jpg.84e089919fede29d5d36fac77be7e6fa.jpg

 

In the meantime, have fun with five very playable (granted three unique games in total here) Atari 2600/VCS games on the Atari Jaguar.  :D

 

  • Like 7
  • Thanks 2
Link to comment
Share on other sites

On 11/6/2022 at 11:01 PM, doctorclu said:

I wonder if VVCS could switch difficulty individually?   Hmmm...

Yes, this would be doable if I implemented metadata per ROM. The code could copy the difficulty switches from the metadata to the virtual register when the game is loaded. We could then have other ROM metadata, such as game name, ROM size, etc. That would make the whole thing more dynamic.

 

But that's a pretty low priority feature for VVCS; I would think bank-switching, collisions, and audio would be much higher on the list.

  • Like 3
Link to comment
Share on other sites

On 11/13/2022 at 7:20 AM, Songbird said:

But that's a pretty low priority feature for VVCS; I would think bank-switching, collisions, and audio would be much higher on the list.

I'd pick bank switching between those three.   I know collisions and sound would take a bit to add.   Bank switching however might have been closer to being in the existing code?   I know you've tried to make a bank switch version before, but maybe that just needs more tinkering and another look?

 

With bank switching that would open up many more games we could search to see if uses regular collision detection or not.  And some of those might be very playable.

Link to comment
Share on other sites

On 11/12/2022 at 7:37 PM, Songbird said:

No, sorry. The difficulty switch was rather easy to figure out, but still took me a couple hours. Sound would take way more than that!

 

One idea I had in the meantime for sound, adjusting the source a little bit, would be to assign a sound file to the fire button.   Granted, would not have the nice effect (explosion, etc) of whatever you were shooting at, but would add some atmosphere to the gameplay.   If the sound is consistent for movement direction, that could be added also.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...