Jump to content

Recommended Posts

Thanks! You didn't mention how far you moved the trackball to get those counts. Did you use a the same value (10cm) as I did?

That's based on 10 cm.

I actually did 10 a bunch of times and did 20 & 30 several times and a little math to normalize everything @ 10 cm. I could be off by a few counts as they rarely came up exactly the same.

 

But, by comparison, I can see as I suspected that the CX-53 has higher resolution. It was obviously higher res. than my modded Wico. I didn't think to test the Wico, but again it's "non-standard" hardware so I'm not sure of what value it would be.

 

[Edit]

The modded Wico with quadrature output (ST Mouse) is 240 @ 10cm.

  • Like 1
Link to comment
Share on other sites

Since my hardware appears to be more counts/rev, I'll try the new program later to see if any of my hardware maxes out the counts per page.

 

I was at a pizza place the other day and saw a Super Monkey Ball arcade game. I had been wondering what it would be like to make a trackball out of a bowling ball. Now I'm convinced that it wouldn't be such a great idea for the types of games we're dealing with. The inertia of that massive ball makes quick direction changes practically impossible.

 

I wouldn't mind finding one of the older, larger diameter arcade trackballs, but the bowling ball size is out. :)

Link to comment
Share on other sites

 

Here is a version which displays the highest counts per frame reached so far for each axis. Like the coordinates, it is zeroed by pressing the button.

The max value that can be detected is limited by the polling rate to 78 counts for PAL and 65 for NTSC. (about 3900 counts/sec)

Was able to hit 65 per axis, but it took a serious spin to do it: like I used to see those old football games played, nothing like I'd imagine would be done with a small, light, handheld controller.

  • Like 1
Link to comment
Share on other sites

When I first started doing these trackball hacks, I came up with a 22 and 24 cycle routine for reading X and Y axis at the same time for a CX22. Later on I wrote a 33 cycle routine for reading the Amiga and ST Mouse.

 

 

I now use the 33 cycle for all three trackballs to keep the basic code the same. I just compile in different tables for the trackball being used. Today I looked at the 33 cycle routine again and cut it down to 29 or 31 cycles by using some ram mirrors, and being more restrictive on the selection of ram registers that I use in the routine.

  MAC READ_TRACKBALL_31
    LDX    SWCHA                 ;4  @4
    LDA    lastTrack             ;3  @7
    ORA    SwchaTab,X            ;4  @11    shift 4 and ORA quickly...   lastTrack | (newTrack >> 4)
    STX    lastTrack             ;3  @14
    TAX                          ;2  @16
    LDA    MoveTab,X             ;4  @20
    TAX                          ;2  @22
    BMI    .dec                  ;2³ @24/25
    .byte $FE                    ;7  @31   INC $6DD6,X
.dec:
    DEC    diff,X                ;6  @31   DEC $6D,X
  ENDM


  MAC READ_TRACKBALL_29
    LDX    SWCHA                 ;4  @4
    LDA    lastTrack             ;3  @7
    ORA    SwchaTab,X            ;4  @11    shift 4 and ORA quickly...   lastTrack | (newTrack >> 4)
    STX    lastTrack             ;3  @14
    TAY                          ;2  @16
    LDX    MoveTab,Y             ;4  @20
    BMI    .dec                  ;2³ @22/23
    .byte $FE                    ;7  @29   INC $6DD6,X
.dec:
    DEC    diff,X                ;6  @29   DEC $6D,X
  ENDM

Here are the registers indexed by "diff". You need to define diff_1 to diff_4, but they don't have to be sequential.

;choose any ram register ($ED to $FF)
diff_1  = $FC
diff_2  = $FD
diff_3  = $FE
diff_4  = $FF


diff_0  = $2F          ; do not change, waste register, read/write invalid

DEC_ZEROPAGE_X__OPCODE    = $D6
HIGH_ADDR_RIOT_RAM_MIRROR = $6D
diff = HIGH_ADDR_RIOT_RAM_MIRROR

DEC_0 = diff_0 - HIGH_ADDR_RIOT_RAM_MIRROR
DEC_1 = diff_1 - HIGH_ADDR_RIOT_RAM_MIRROR
DEC_2 = diff_2 - HIGH_ADDR_RIOT_RAM_MIRROR
DEC_3 = diff_3 - HIGH_ADDR_RIOT_RAM_MIRROR
DEC_4 = diff_4 - HIGH_ADDR_RIOT_RAM_MIRROR

INC_0 = diff_0 - DEC_ZEROPAGE_X__OPCODE
INC_1 = diff_1 - DEC_ZEROPAGE_X__OPCODE
INC_2 = diff_2 - DEC_ZEROPAGE_X__OPCODE
INC_3 = diff_3 - DEC_ZEROPAGE_X__OPCODE
INC_4 = diff_4 - DEC_ZEROPAGE_X__OPCODE

  MAC CX_22_MOVEMENT_TAB
    .byte INC_0,INC_1,DEC_1,INC_1,DEC_2,INC_3,DEC_4,INC_3,INC_2,INC_4,DEC_3,INC_4,DEC_2,INC_3,DEC_4,INC_3
    .byte DEC_1,INC_0,DEC_1,INC_1,DEC_4,DEC_2,DEC_4,INC_3,DEC_3,INC_2,DEC_3,INC_4,DEC_4,DEC_2,DEC_4,INC_3
    .byte DEC_1,INC_1,INC_0,INC_1,DEC_4,INC_3,DEC_2,INC_3,DEC_3,INC_4,INC_2,INC_4,DEC_4,INC_3,DEC_2,INC_3
    .byte DEC_1,INC_1,DEC_1,INC_0,DEC_4,INC_3,DEC_4,DEC_2,DEC_3,INC_4,DEC_3,INC_2,DEC_4,INC_3,DEC_4,DEC_2
    .byte INC_2,INC_4,DEC_3,INC_4,INC_0,INC_1,DEC_1,INC_1,INC_2,INC_4,DEC_3,INC_4,DEC_2,INC_3,DEC_4,INC_3
    .byte DEC_3,INC_2,DEC_3,INC_4,DEC_1,INC_0,DEC_1,INC_1,DEC_3,INC_2,DEC_3,INC_4,DEC_4,DEC_2,DEC_4,INC_3
    .byte DEC_3,INC_4,INC_2,INC_4,DEC_1,INC_1,INC_0,INC_1,DEC_3,INC_4,INC_2,INC_4,DEC_4,INC_3,DEC_2,INC_3
    .byte DEC_3,INC_4,DEC_3,INC_2,DEC_1,INC_1,DEC_1,INC_0,DEC_3,INC_4,DEC_3,INC_2,DEC_4,INC_3,DEC_4,DEC_2
    .byte INC_2,INC_4,DEC_3,INC_4,DEC_2,INC_3,DEC_4,INC_3,INC_0,INC_1,DEC_1,INC_1,DEC_2,INC_3,DEC_4,INC_3
    .byte DEC_3,INC_2,DEC_3,INC_4,DEC_4,DEC_2,DEC_4,INC_3,DEC_1,INC_0,DEC_1,INC_1,DEC_4,DEC_2,DEC_4,INC_3
    .byte DEC_3,INC_4,INC_2,INC_4,DEC_4,INC_3,DEC_2,INC_3,DEC_1,INC_1,INC_0,INC_1,DEC_4,INC_3,DEC_2,INC_3
    .byte DEC_3,INC_4,DEC_3,INC_2,DEC_4,INC_3,DEC_4,DEC_2,DEC_1,INC_1,DEC_1,INC_0,DEC_4,INC_3,DEC_4,DEC_2
    .byte INC_2,INC_4,DEC_3,INC_4,DEC_2,INC_3,DEC_4,INC_3,INC_2,INC_4,DEC_3,INC_4,INC_0,INC_1,DEC_1,INC_1
    .byte DEC_3,INC_2,DEC_3,INC_4,DEC_4,DEC_2,DEC_4,INC_3,DEC_3,INC_2,DEC_3,INC_4,DEC_1,INC_0,DEC_1,INC_1
    .byte DEC_3,INC_4,INC_2,INC_4,DEC_4,INC_3,DEC_2,INC_3,DEC_3,INC_4,INC_2,INC_4,DEC_1,INC_1,INC_0,INC_1
    .byte DEC_3,INC_4,DEC_3,INC_2,DEC_4,INC_3,DEC_4,DEC_2,DEC_3,INC_4,DEC_3,INC_2,DEC_1,INC_1,DEC_1,INC_0
  ENDM

  MAC ST_MOUSE_MOVEMENT_TAB
    .byte INC_0,DEC_1,INC_1,INC_0,INC_2,DEC_3,INC_4,INC_2,DEC_2,DEC_4,INC_3,DEC_2,INC_0,DEC_1,INC_1,INC_0
    .byte INC_1,INC_0,INC_0,DEC_1,INC_4,INC_2,INC_2,DEC_3,INC_3,DEC_2,DEC_2,DEC_4,INC_1,INC_0,INC_0,DEC_1
    .byte DEC_1,INC_0,INC_0,INC_1,DEC_3,INC_2,INC_2,INC_4,DEC_4,DEC_2,DEC_2,INC_3,DEC_1,INC_0,INC_0,INC_1
    .byte INC_0,INC_1,DEC_1,INC_0,INC_2,INC_4,DEC_3,INC_2,DEC_2,INC_3,DEC_4,DEC_2,INC_0,INC_1,DEC_1,INC_0
    .byte DEC_2,DEC_4,INC_3,DEC_2,INC_0,DEC_1,INC_1,INC_0,INC_0,DEC_1,INC_1,INC_0,INC_2,DEC_3,INC_4,INC_2
    .byte INC_3,DEC_2,DEC_2,DEC_4,INC_1,INC_0,INC_0,DEC_1,INC_1,INC_0,INC_0,DEC_1,INC_4,INC_2,INC_2,DEC_3
    .byte DEC_4,DEC_2,DEC_2,INC_3,DEC_1,INC_0,INC_0,INC_1,DEC_1,INC_0,INC_0,INC_1,DEC_3,INC_2,INC_2,INC_4
    .byte DEC_2,INC_3,DEC_4,DEC_2,INC_0,INC_1,DEC_1,INC_0,INC_0,INC_1,DEC_1,INC_0,INC_2,INC_4,DEC_3,INC_2
    .byte INC_2,DEC_3,INC_4,INC_2,INC_0,DEC_1,INC_1,INC_0,INC_0,DEC_1,INC_1,INC_0,DEC_2,DEC_4,INC_3,DEC_2
    .byte INC_4,INC_2,INC_2,DEC_3,INC_1,INC_0,INC_0,DEC_1,INC_1,INC_0,INC_0,DEC_1,INC_3,DEC_2,DEC_2,DEC_4
    .byte DEC_3,INC_2,INC_2,INC_4,DEC_1,INC_0,INC_0,INC_1,DEC_1,INC_0,INC_0,INC_1,DEC_4,DEC_2,DEC_2,INC_3
    .byte INC_2,INC_4,DEC_3,INC_2,INC_0,INC_1,DEC_1,INC_0,INC_0,INC_1,DEC_1,INC_0,DEC_2,INC_3,DEC_4,DEC_2
    .byte INC_0,DEC_1,INC_1,INC_0,DEC_2,DEC_4,INC_3,DEC_2,INC_2,DEC_3,INC_4,INC_2,INC_0,DEC_1,INC_1,INC_0
    .byte INC_1,INC_0,INC_0,DEC_1,INC_3,DEC_2,DEC_2,DEC_4,INC_4,INC_2,INC_2,DEC_3,INC_1,INC_0,INC_0,DEC_1
    .byte DEC_1,INC_0,INC_0,INC_1,DEC_4,DEC_2,DEC_2,INC_3,DEC_3,INC_2,INC_2,INC_4,DEC_1,INC_0,INC_0,INC_1
    .byte INC_0,INC_1,DEC_1,INC_0,DEC_2,INC_3,DEC_4,DEC_2,INC_2,INC_4,DEC_3,INC_2,INC_0,INC_1,DEC_1,INC_0
  ENDM

  MAC AMIGA_MOVEMENT_TAB
    .byte INC_0,DEC_2,INC_1,INC_3,INC_2,INC_0,INC_4,INC_1,DEC_1,DEC_4,INC_0,DEC_2,DEC_3,DEC_1,INC_2,INC_0
    .byte INC_2,INC_0,INC_4,INC_1,INC_0,DEC_2,INC_1,INC_3,DEC_3,DEC_1,INC_2,INC_0,DEC_1,DEC_4,INC_0,DEC_2
    .byte DEC_1,DEC_4,INC_0,DEC_2,DEC_3,DEC_1,INC_2,INC_0,INC_0,DEC_2,INC_1,INC_3,INC_2,INC_0,INC_4,INC_1
    .byte DEC_3,DEC_1,INC_2,INC_0,DEC_1,DEC_4,INC_0,DEC_2,INC_2,INC_0,INC_4,INC_1,INC_0,DEC_2,INC_1,INC_3
    .byte DEC_2,INC_0,INC_3,INC_1,INC_0,INC_2,INC_1,INC_4,DEC_4,DEC_1,DEC_2,INC_0,DEC_1,DEC_3,INC_0,INC_2
    .byte INC_0,INC_2,INC_1,INC_4,DEC_2,INC_0,INC_3,INC_1,DEC_1,DEC_3,INC_0,INC_2,DEC_4,DEC_1,DEC_2,INC_0
    .byte DEC_4,DEC_1,DEC_2,INC_0,DEC_1,DEC_3,INC_0,INC_2,DEC_2,INC_0,INC_3,INC_1,INC_0,INC_2,INC_1,INC_4
    .byte DEC_1,DEC_3,INC_0,INC_2,DEC_4,DEC_1,DEC_2,INC_0,INC_0,INC_2,INC_1,INC_4,DEC_2,INC_0,INC_3,INC_1
    .byte INC_1,INC_3,INC_0,DEC_2,INC_4,INC_1,INC_2,INC_0,INC_0,DEC_2,DEC_1,DEC_4,INC_2,INC_0,DEC_3,DEC_1
    .byte INC_4,INC_1,INC_2,INC_0,INC_1,INC_3,INC_0,DEC_2,INC_2,INC_0,DEC_3,DEC_1,INC_0,DEC_2,DEC_1,DEC_4
    .byte INC_0,DEC_2,DEC_1,DEC_4,INC_2,INC_0,DEC_3,DEC_1,INC_1,INC_3,INC_0,DEC_2,INC_4,INC_1,INC_2,INC_0
    .byte INC_2,INC_0,DEC_3,DEC_1,INC_0,DEC_2,DEC_1,DEC_4,INC_4,INC_1,INC_2,INC_0,INC_1,INC_3,INC_0,DEC_2
    .byte INC_3,INC_1,DEC_2,INC_0,INC_1,INC_4,INC_0,INC_2,DEC_2,INC_0,DEC_4,DEC_1,INC_0,INC_2,DEC_1,DEC_3
    .byte INC_1,INC_4,INC_0,INC_2,INC_3,INC_1,DEC_2,INC_0,INC_0,INC_2,DEC_1,DEC_3,DEC_2,INC_0,DEC_4,DEC_1
    .byte DEC_2,INC_0,DEC_4,DEC_1,INC_0,INC_2,DEC_1,DEC_3,INC_3,INC_1,DEC_2,INC_0,INC_1,INC_4,INC_0,INC_2
    .byte INC_0,INC_2,DEC_1,DEC_3,DEC_2,INC_0,DEC_4,DEC_1,INC_1,INC_4,INC_0,INC_2,INC_3,INC_1,DEC_2,INC_0
  ENDM

  MAC SWCHA_TAB
    .byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
    .byte 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1
    .byte 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2
    .byte 3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3
    .byte 4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4
    .byte 5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5
    .byte 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6
    .byte 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7
    .byte 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
    .byte 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9
    .byte 10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10
    .byte 11,11,11,11,11,11,11,11,11,11,11,11,11,11,11,11
    .byte 12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12
    .byte 13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13
    .byte 14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14
    .byte 15,15,15,15,15,15,15,15,15,15,15,15,15,15,15,15
  ENDM

I believe other registers can be used by selecting different ram mirrors, but for myself using any between $ED to $FF is good enough.

  • Like 2
Link to comment
Share on other sites

Currently I am using 4 temp registers plus one for "lastTrack" in my routine. I should mention the above routines can be made faster if there is more ram available. Using 8 temp registers allows a 28 or 26 cycle routine which handles both axises at the same time. The lookup tables above would have to be changed. These routines can also be split up to be used over a few lines. :)

  MAC READ_TRACKBALL_28
    LDX    SWCHA                 ;4  @4
    LDA    lastTrack             ;3  @7
    ORA    SwchaTab,X            ;4  @11    shift 4 and ORA quickly...   lastTrack | (newTrack >> 4)
    STX    lastTrack             ;3  @14
    TAX                          ;2  @16
    LDA    MoveTab,X             ;4  @20
    TAX                          ;2  @22
    INC    diff,X                ;6  @28
  ENDM


  MAC READ_TRACKBALL_26
    LDX    SWCHA                 ;4  @4
    LDA    lastTrack             ;3  @7
    ORA    SwchaTab,X            ;4  @11    shift 4 and ORA quickly...   lastTrack | (newTrack >> 4)
    STX    lastTrack             ;3  @14
    TAY                          ;2  @16
    LDX    MoveTab,Y             ;4  @20
    INC    diff,X                ;6  @26
  ENDM
  • Like 1
Link to comment
Share on other sites

Here are a 24 and 22 cycle solution. I'm a little bit hesitant to use the output bits in SWCHA because they can get corrupted by a joystick, or mess with an AtariVox. Nonetheless it is a fast solution for reading both axises.

  MAC READ_TRACKBALL_24
    LDX    SWCHA                 ;4  @4
    LDA    Shift4Tab,X           ;4  @8
    STA    SWCHA                 ;4  @12
    LDA    MoveTab,X             ;4  @16
    TAX                          ;2  @18
    INC    diff,X                ;6  @24
  ENDM

  MAC READ_TRACKBALL_22
    LDY    SWCHA                 ;4  @4
    LDA    Shift4Tab,Y           ;4  @8
    STA    SWCHA                 ;4  @12
    LDX    MoveTab,Y             ;4  @16
    INC    diff,X                ;6  @22
  ENDM 

I'm not sure if it is possible to go faster in the kernel without stuffing values and dealing with them later...

  • Like 2
Link to comment
Share on other sites

In the context of reading a trackball, it seems like corruption of those register bits by a joystick wouldn't be a concern.

Is it typical to leave the AtariVox plugged in all the time? I can see how it would be, but I don't have one.

 

(btw - plural of axis is "axes", believe it or not)

Link to comment
Share on other sites

Is it typical to leave the AtariVox plugged in all the time? I can see how it would be, but I don't have one.

 

(btw - plural of axis is "axes", believe it or not)

I would say yes. See earlier in this thread. While the sound might be annoying it is fixable by removing the Vox. However if any saved data gets overwritten before removal then it's a bad problem.

 

Axes is a funny spelling. I read in the US people spell axe as ax. So when I see that it looks like the plural for axe. :ponder:

Link to comment
Share on other sites

I would say yes. See earlier in this thread. While the sound might be annoying it is fixable by removing the Vox. However if any saved data gets overwritten before removal then it's a bad problem.

 

Axes is a funny spelling. I read in the US people spell axe as ax. So when I see that it looks like the plural for axe. :ponder:

Axes is the plural of axis, is it not? If so, then what is the plural of ax? English is so funny because it is a hodge podge of every freaking language in Europe. Old English is a fusion of germanic and Anglox Saxxon, but during the middle ages borrowed heavily from Latin, creating much of it's root words which borrow from the romance languages. Then there's British English and American English, and every rule has a multitude of exceptions.

 

Take the i before e except after c rule. If so, then please explain the title of this 80s cult classic movie:

weird-science.jpg

  • Like 1
Link to comment
Share on other sites

Yeah I've seen some of those ridiculously long runon words for places or ideas they come up with. Longer than many simple sentences in English:

That's the easy part. But to remember that a table is male, a door is female and a window is neuter etc. pp., that's the fun part. :)

 

All hardwired in our German brains! :P

  • Like 1
Link to comment
Share on other sites

SpaceMaster X-7 has now been converted to use a trackball, and added to the first post.

 

post-7074-0-19052500-1451712624_thumb.png

 

The trackball should make it easier to dodge enemies, and slip inside the force field. After reviewing some of the scores in the high score club, I decided to make a change to how many bases you must destroy to get a bonus ship.

 

The original game gave a bonus ship for every two bases destroyed. The trackball game will give a bonus ship:

- Every 4 bases destroyed with the left P0 difficulty switch in the B (amateur, novice) position.

- Every 8 bases destroyed with the left P0 difficulty switch in the A (pro, expert) position.

 

You still get an extra ship for every 10,000 points. No change there. Also remember that the Color/BW switch can be used to pause the game.

 

Otherwise, enjoy. :)

  • Like 3
Link to comment
Share on other sites

Since 2600 Millipede was one of the games recently modded to include Trak-Ball support, I thought I'd briefly mention something I just came across...

 

There's a claim that Dave Staugas created a 1.1 version of 2600 Millipede after it had already been commercially released. Supposedly, Steve R. Hastings has a copy of it… 5 spiders can attack at once.

 

That and there's some reference in commercial 2600 Millipede stating "Dave Staugas loves Beatrice Hablig". Apparently, this statement is embedded in the source code of all of his projects, including the ST's TOS operating system and possibly NEOchrome.

 

http://www.digitpress.com/eastereggs/26millipede.htm

 

https://tcrf.net/Millipede_(Atari_2600)

 

http://www.atariprotos.com/2600/software/millipede/millipede.htm

 

I just checked the membership of the Atari Museum Facebook group and Dave isn't a member. He's probably on LinkedIn though; Beatrice is.

 

If there actually is a 2600 Millipede 1.1 version out there and Trak-Ball support could be added to it, that might sell pretty well in the AtariAge Store. And there's also a GCC version of the game based upon what AtariProtos reported...

Link to comment
Share on other sites

^^I would be excited to purchase a CX-22 Millipede in the AA store. That game is crazy addictive.

 

Thanks for all the hard work so far, now to track down a cx-22

Get a CX-80 as the build quality is superior. The fast majority of CX-80s function identical to a CX-22 unless they were factory modded.

Link to comment
Share on other sites

^^I would be excited to purchase a CX-22 Millipede in the AA store. That game is crazy addictive.

 

Get a CX-80 as the build quality is superior. The fast majority of CX-80s function identical to a CX-22 unless they were factory modded.

 

Hi Kosmic, I thought I should get the CX-22 as I though it would be the most compatible with the trak ball Roms as there seems to be more CX-22 version Roms than CX-80 Roms.

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