Jump to content
IGNORED

Caverns of Mars no Joy


Thomas A. Fine

Recommended Posts

Hi,

 

I hate to ask this because it feels like something really familiar that I've just forgotten from 30+ years ago...

When I run Caverns of Mars (on retroarch, as well as on atari800MacX) I get no movement from the joystick (the trigger works).  Do I have a corrupt copy?  Or is there some trivial thing that everyone knows that I've forgotten about?

 

       tom

 

Link to comment
Share on other sites

5 hours ago, Mr Robot said:

These both worked just now when I tried them, one CAR one XEX tried both with atari800 

Caverns of Mars.xex 9.9 kB · 4 downloads Caverns of Mars (1982)(Atari)(US)[!].car 16.02 kB · 5 downloads

Your cartridge matches mine byte for byte, except for having the .car header.  I get the same behavior.  My joystick doesn't work but the trigger does.

 

I feel like I must be doing something dumb, given that I'm seeing this across different emulators, on different operating systems (mac and android) and different versions of the software (cartridge and disk versions found in various places).  The last time I tried to get an emulator going I'm pretty sure the same thing happened.  Other games work fine.

Link to comment
Share on other sites

2 hours ago, _The Doctor__ said:

Try using the older OS B and see how it works for you...

I didn't realize there were multiple versions.  It turns out I was using V1 (this actually matches the checksum that libretro specifies on their web page).  So I found a V2 and installed it on my phone and still get no joystick motion.  So I had hoped we had found something to fix but it's still not working for me.  More confused every minute.

Link to comment
Share on other sites

1 hour ago, baktra said:

It is a known problem described in Altirra Hardware reference. Inaccurate PIA emulation is the root cause.

So is it maybe that this has been fixed in later Altirra and Atari800, but still broken in the older Atari800MacX I'm using, as well as the latest (from Play Store) retroarch?

 

And I just had bad luck with versions?  This makes sense but I'll have to see if any changelogs mention this fix to see if it's really the case.

Link to comment
Share on other sites

1 hour ago, invisible kid said:

What is your joystick setup? ps/xbox controller? atari via adapter?

 

What does SDL report?

 

sdl-jstest --list

 

If it reports something see if you can test it, might have to change '0':

sdl-jstest --test 0

I have an 8bitdo SN30 and an 8bitdo SN30 Pro, both on bluetooth.  I have AtariMacX800 on my desktop that I installed a while back and haven't used very much.  I have retroarch on my phone that I can use with the 8bitdo controllers, although just for testing I've been using the onscreen controls.  Don't think I can use sdl-jstest on the Mac (maybe a macports install?) and I definitely can't do it on my phone.  But it's a little bit beside the point since...

 

The ultimate goal here is that I'm installing retroarch on my new 85" Sony Bravia TV, that has Google TV built-in.  Just got that working a couple days ago and so far so good.  Caverns of Mars is the only thing that hasn't worked.  It was incredibly fiddly to set up because of input settings (there's a catch-22 for getting into the quick menu) and other issues.  But now that it's basically working this is probably going to be the most usable 8bit gaming setup I've had available in ages.  Star Raiders is amazing on a giant screen (there is some inconsistent lag in the bluetooth keyboard, but I haven't fiddled with the settings on that, and it is an old adesso bluetooth keyboard designed to work with phones).  Also have some Atari Lynx games I just tested today that work, though to me a big attraction of comfortable living room gaming is simultaneous multiplayer stuff.  I'll probably add two more controllers so we can do four player games — maybe a bluetooth adapter for my old wico command control joysticks.  But it does all need to be bluetooth to work with the TV.

 

It's pretty amazing that I can emulate these old systems on the built-in smart TV hardware, and an unexpected surprise with the new TV.  I haven't experience any lag (some hints of very brief glitches that haven't affected gameplay).  And Retroarch is, well, the least clumsy setup I've tried so far, especially since it can emulate so many systems.

 

If there's interest I can start a new thread where I describe all the work I had to do (as best as I can remember it) to get this working.

 

20210904_032531.jpg

Edited by Thomas A. Fine
  • Like 1
Link to comment
Share on other sites

11 hours ago, Thomas A. Fine said:

I hate to ask this because it feels like something really familiar that I've just forgotten from 30+ years ago...

When I run Caverns of Mars (on retroarch, as well as on atari800MacX) I get no movement from the joystick (the trigger works).

That's likely an emulation  issue. Caverns of Mars plays a bit with the PIA data-direction registers and does not emulate all properties of the PIAs correctly, I had the issue with an ancient version of  Atari++ many years ago. That was fixed back then.

Link to comment
Share on other sites

2 hours ago, Mr Robot said:

in atari800 you can set the joystick to the hat or not, if you are using a dpad it's probably required to be hat, but if you are using a stick with axis its probably not

 

No, that's really not related to the type of input. It is a problem of the PIA DDR registers and how PIA works. The issue is that PIA port A reads read the pin values directly, and not buffered values. That is, even if the port A is configured as output, but the output is pulled low by an external joystick, a port A read will read a zero-value. Caverns of Mars depends on that.

  • Like 1
Link to comment
Share on other sites

4 hours ago, invisible kid said:

OP might not want to use a different emulator, but I can confirm both images attached in OP work with atari800 4.2.0 on linux with ps3 pad or atari joystick via usb adapter.

Retroarch is the only emulator that supports atari800 at all that is available on Google Play Store for this TV.  It's possible I could sideload some other emulator that might work, but I'm trying to get away from jankiness.  And Caverns of Mars is just one game (how many other games are likely to have this PIA wierdness?).

 

Retroarch uses libretro, which does use the atari800 core, but it looks like they used the atari800 3.1.0 core and haven't updated that.

 

I've submitted a bug report to the github maintainers of this libretro core, and I'm calling this adequate for now.  I don't have time myself to dig through the code at the moment and try to fix it.

 

Thanks everybody.

  • Like 1
Link to comment
Share on other sites

PORTA direction is set to F0 (normal 00) and output to 00 (normal 00)

 

As such, PORTA will read with the top 4 bits cleared on real hardware and proper emulation.  The game reads PORTA directly and does compare against the normal stick values.

Likely the emulation isn't giving proper PORTA values with the top bits cleared so the compares are always failing and stick input is ignored.

 

Not many games read the controller ports directly and most that do will handle such inconsistencies fine so IMO the best fix would be to just patch the game.

Link to comment
Share on other sites

Did you patch to read the stick shadows or just the immediate compare values?

 

The problem with the compare thing is that a stick in port 2 could mess it up.

 

It's a mystery to me why he did it the way he did.  If you must read the port directly it's trivial to just AND out the bits you don't use.

  • Like 1
Link to comment
Share on other sites

I only fixed it quick-and-dirty.  Yes, a stick in port two would screw it up.  I didn't feel like changing all the CMP's to ANDs, and all the branches, etc.  I'll let someone else do that, I was just doing a quick fix to help the guy out... :)

 

EDIT: Hell, it was easier than expected.  Here's a shadow register fix:

Caverns Of Mars JSFIX2.rom

Edited by glurk
added fix #2
  • Like 3
  • Thanks 2
Link to comment
Share on other sites

On 9/6/2021 at 6:20 AM, glurk said:

I only fixed it quick-and-dirty.  Yes, a stick in port two would screw it up.  I didn't feel like changing all the CMP's to ANDs, and all the branches, etc.  I'll let someone else do that, I was just doing a quick fix to help the guy out... :)

 

EDIT: Hell, it was easier than expected.  Here's a shadow register fix:

Caverns Of Mars JSFIX2.rom 16 kB · 4 downloads

Thanks!  Can confirm that it works on both an older atari800, and on the latest retroarch.

 

(I still think the best solution is for libretro to update the core code for atari800.)

  • Like 1
Link to comment
Share on other sites

Thank You to Glurk for devising and sharing this modification to a game disk that I bought in 1981 from Atari Program Exchange. Over the years, my various attempts to play the atr version of this game with various emulators had problems with joystick emulation (and my continuing lack of eye-hand coordination).

   Maybe one more fabulous "fix" would be to resume the player's progress after an unfortunate collision while navigating deep down into the caverns of Mars. Maybe this would be as valuable as the patch for unlimited ships.

Thanks Again.

Edited by DFELD2005
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...