Jump to content
IGNORED

Vectrex - timer/interrupt?


BinaryStar

Recommended Posts

Hi,

 

I have a centipede-style shmup in development for vectrex at the moment and I have added I initial support for the Atari CX80 trackball (in trackball mode).

 

Currently I am reading the trackball values once per frame which tracks nicely when moving the trackball slowly or more carefully but it fails to read accurately when the ball is rotated quickly.

 

I was wondering, can anyone advise the best way to update my trackball reading code? Is there a way I can set this code to execute every x milliseconds/cycles, independent of my main loop?

 

Any advice greatly appreciated,

 

Chris

Link to comment
Share on other sites

  • 1 month later...

How long does polling the trackball take?

 

Are you doing anything while waiting for the electron gun to move/draw/reset? If not, you could read the trackball every time you move/draw/reset (or at least every big move/draw). I'd try to plan out your drawing and game calcs so you're reading the trackball at a constant-ish rate. If you poll the trackball 50 times in the first half of each frame but ignore it in the second half, you're still going to get poor results.

 

IIRC the 6809 is capable of interupts but I never used one and it's ages since I looked at the manual. But if you need to poll the trackball so frequently that you need an interrupt multiple times per frame to make it work properly maybe it's just not an appropriate input device. Due to the Vectrex's archetecture, maintaining a stable image at a sufficient frame rate is both the most important and most difficult task. If you've already cranked up the frame rate you may have a serious problem drawing everything you want. Particularly if you're trying for as many potential on screen items as in a Centipede game.

 

My advice would be to skip messing around with exotic hardware for now and run some tests to see the limits of what you can display. If you're hoping to display a screen full of mushrooms you may be in for some difficulty.

Link to comment
Share on other sites

Hi,

 

I have a centipede-style shmup in development for vectrex at the moment and I have added I initial support for the Atari CX80 trackball (in trackball mode).

 

Currently I am reading the trackball values once per frame which tracks nicely when moving the trackball slowly or more carefully but it fails to read accurately when the ball is rotated quickly.

 

I was wondering, can anyone advise the best way to update my trackball reading code? Is there a way I can set this code to execute every x milliseconds/cycles, independent of my main loop?

 

Any advice greatly appreciated,

 

Chris

 

If I may ask some basic questions (I am not a Vectrex programmer though that is a dream of mine for later) about how you are doing this, I'm assuming the Atari CX80 outputs grey code in trackball mode, yes? And the Vectrex analog joystick outputs voltages? Are you feeding the trackball through the joystick pins or through the fire buttons?

 

The reason I ask is I have wondered how to set up a trackball for the Vectrex, I was wondering if the solution might work out the same as for the Atari 5200 since that also has an analog joystick and has a trackball controller that appears to feed through the same pins. At the very least it doesn't appear to send grey code through the fire buttons or the keypad. So I was wondering how it would work for the Vectrex without needing to take out fire buttons in the process (I am envisioning a true trackball Missile Command conversion that has 3 missile bases) but the only way that could work would be using the joystick output pins. Would it be possible to make a conversion board that would translate the trackball's grey code into voltages? Because that would probably solve the interrupt problem since the trackball could be read just like a joystick.

 

I don't pretend to really know what I'm talking about here in terms of pinouts and Vectrex programming, I'm just interested in how to make a Vectrex accept a trackball controller.

Link to comment
Share on other sites

  • 1 month later...

Hadn't noticed there had been some response to this, thanks for your advice.

 

Christopher - I had figured regular reads broken up within the frame would probably be the best bet for this. Thanks for the advice, I will likely stick to using the analog stick if I cannot get satisfying results with the trackball. As far as items on screen, the 'centipede' parts become bombs which quickly fall down the screen so its never filled with too many objects. I will likely get back to this soon (working on another game) , I'll let you know how I get on with doing as you suggested.

 

ledzep - there are two types of cx80 - one that uses grey code like an atari st mouse and the (i think more common) one that i have that indicates direction and movement on two axes using two pins each 0/1 or direction and 0/1 patterns for each 'click'. Both use the 4 vectrex buttons to read the data, I have programmed this to read trackball movement in port 2 and the standard vectrex controller (for fire/pause) in port 1. Hope that makes sense.

Link to comment
Share on other sites

  • 1 year later...

Actually, thinking about it further - I'd completely avoid timer interupts unless you're willing to turn the interupts off at critical times (which may defeat their purpose). I could easily envision a situation where you're pushing values onto a register(s) to start drawing, a timer interupt happens, and that results in a very visible problem with your drawing.

Link to comment
Share on other sites

  • 9 months later...

Why not add a small microcontroller to the trackball like a 12C509 (8 pin PIC). It can feed you the track ball position serially once per frame when you ask for it and during the frame it can keep track of the track ball at a very high precision. The 12C509 should be a few dollars plus you might need the optional external crystal maybe.

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...