Swami Posted May 16, 2018 Share Posted May 16, 2018 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! Quote Link to comment Share on other sites More sharing options...
baktra Posted May 17, 2018 Share Posted May 17, 2018 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". 1 Quote Link to comment Share on other sites More sharing options...
Xuel Posted May 17, 2018 Share Posted May 17, 2018 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. 2 Quote Link to comment Share on other sites More sharing options...
Swami Posted May 17, 2018 Author Share Posted May 17, 2018 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: 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. 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? Quote Link to comment Share on other sites More sharing options...
Xuel Posted May 17, 2018 Share Posted May 17, 2018 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. 2 Quote Link to comment Share on other sites More sharing options...
Swami Posted May 17, 2018 Author Share Posted May 17, 2018 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. 2 Quote Link to comment Share on other sites More sharing options...
baktra Posted May 18, 2018 Share Posted May 18, 2018 And let's not forget http://atariage.com/forums/topic/130940-article-transporting-atari-computer-programs-to-the-5200/ 2 Quote Link to comment Share on other sites More sharing options...
pirx Posted May 20, 2018 Share Posted May 20, 2018 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. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.