Jump to content
IGNORED

Can I learn to hack 5200 pole position controller code?


Recommended Posts

If I wanted to learn to hack the 5200 pole position rom controller code for a PC racing wheel with a homemade 5200 to 15pin PC adapter, is this a reasonable short term goal for learning to program for the 5200? I know pretty much nothing, like should I learn to do such a thing in BASIC or assembly? Where can I learn step by step to get to this point?

 

The end goal of this project would be to move the acceleration and braking from fire 1 and 2 to up and down, to have analog gas and brake that work on old PC wheels, to move the shifter to fire1 and fire2, since the PC wheel shifters are digital, and, finally, be able to fine tune trigger values for these four functions to work with variations in wheel voltage outputs.

 

Thanks!

Link to comment
Share on other sites

It is most certainly an ambitious goal.

You would need to do it in assembly language. that is for sure.

 

As your project involves also hardware, let us test feasibility.

Each 5200 controller has two analog inputs (two joystick axes, in modern terminology), that should be sufficient. One axis for steering, other axis for braking/acceleration.

 

In terms of the software, you would have to hack P.P's controller reading code (reading axes instead of buttons), and update also the game physics (so it not only recognizes "braking on/off", but "how much of braking".

  • Like 1
Link to comment
Share on other sites

In terms of the software, you would have to hack P.P's controller reading code (reading axes instead of buttons), and update also the game physics (so it not only recognizes "braking on/off", but "how much of braking".

 

One way to handle braking without modifying the game physics too much would be to convert the analog braking value into pulse-width-modulated braking on/off. Varying the number of frames of braking "on" per, say, 20 frames would give you 20 levels of braking. So, for example, a very light braking could convert to braking "on" for 1 out of every 20 frames and full braking could convert to braking "on" 20 out of every 20 frames.

 

But maybe it's just as easy to modify the physics engine to handle variable amount of braking.

 

If I wanted to learn to hack the 5200 pole position rom controller code for a PC racing wheel with a homemade 5200 to 15pin PC adapter, is this a reasonable short term goal for learning to program for the 5200? I know pretty much nothing, like should I learn to do such a thing in BASIC or assembly? Where can I learn step by step to get to this point?

 

The end goal of this project would be to move the acceleration and braking from fire 1 and 2 to up and down, to have analog gas and brake that work on old PC wheels, to move the shifter to fire1 and fire2, since the PC wheel shifters are digital, and, finally, be able to fine tune trigger values for these four functions to work with variations in wheel voltage outputs.

 

Thanks!

 

You're going to need to disassemble the original game code into assembly so 1) you can understand how it works and 2) you know where to modify it.

 

Here's a quick disassembly the 8-bit computer version of Pole Position to give you an idea:

 

pp.zip

 

I included my disassembler "dis" and xasm. I didn't label anything other than the standard OS and hardware memory locations. Disassembly is an art. You have to figure out what various parts of code do but the main thing is figuring out how the data and variables are laid out. Once you know which memory locations correspond to various aspects of the game it becomes much easier to understand what's going on throughout the code. For example, one byte may be used by the code to store the velocity of your car. Figuring out which one will help you unravel other bits of code since you'll see all the places that refer to that byte and then understand they must have something to do with either setting or reacting to the velocity of the car. It's a multidimensional puzzle.

  • Like 2
Link to comment
Share on other sites

It is most certainly an ambitious goal.

You would need to do it in assembly language. that is for sure.

 

As your project involves also hardware, let us test feasibility.

Each 5200 controller has two analog inputs (two joystick axes, in modern terminology), that should be sufficient. One axis for steering, other axis for braking/acceleration.

 

In terms of the software, you would have to hack P.P's controller reading code (reading axes instead of buttons), and update also the game physics (so it not only recognizes "braking on/off", but "how much of braking".

 

One way to handle braking without modifying the game physics too much would be to convert the analog braking value into pulse-width-modulated braking on/off. Varying the number of frames of braking "on" per, say, 20 frames would give you 20 levels of braking. So, for example, a very light braking could convert to braking "on" for 1 out of every 20 frames and full braking could convert to braking "on" 20 out of every 20 frames.

 

But maybe it's just as easy to modify the physics engine to handle variable amount of braking.

 

 

 

You're going to need to disassemble the original game code into assembly so 1) you can understand how it works and 2) you know where to modify it.

 

Here's a quick disassembly the 8-bit computer version of Pole Position to give you an idea:

 

attachicon.gifpp.zip

 

I included my disassembler "dis" and xasm. I didn't label anything other than the standard OS and hardware memory locations. Disassembly is an art. You have to figure out what various parts of code do but the main thing is figuring out how the data and variables are laid out. Once you know which memory locations correspond to various aspects of the game it becomes much easier to understand what's going on throughout the code. For example, one byte may be used by the code to store the velocity of your car. Figuring out which one will help you unravel other bits of code since you'll see all the places that refer to that byte and then understand they must have something to do with either setting or reacting to the velocity of the car. It's a multidimensional puzzle.

Thank you. That is helpful. Would you or anyone else know of a book or internet based tutorial that would be an introduction to 8 bit/5200 programming that would include 5200 controller (analog/digital/trackball) programming? Or two sequential sources that would get me to the same point more or less?

Link to comment
Share on other sites

 

Thank you. That is helpful. Would you or anyone else know of a book or internet based tutorial that would be an introduction to 8 bit/5200 programming that would include 5200 controller (analog/digital/trackball) programming? Or two sequential sources that would get me to the same point more or less?

 

The Altirra Hardware Reference Manual is a comprehensive Atari 8-bit computer and 5200 reference. The only other thing you need is a 6502 CPU fundamentals guide. Maybe this one is good? I haven't gone through it but superficially it looks OK.

  • Like 2
Link to comment
Share on other sites

 

The Altirra Hardware Reference Manual is a comprehensive Atari 8-bit computer and 5200 reference. The only other thing you need is a 6502 CPU fundamentals guide. Maybe this one is good? I haven't gone through it but superficially it looks OK.

Okay, I'm making pixels in a 6502 assembly environment in a Java 6502 emulator, I think...

Thanks for getting me started.

  • Like 2
Link to comment
Share on other sites

what about doing this in e.g. arduino? this way not much of a 6052 learning would be involved (sadly), but other games could benefit. and finding old PC analog joysticks would be possibly easier than 5200 controllers, so it'd be a winwinwin situation.

  • Like 1
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...