Jump to content
  • entries
    46
  • comments
    9
  • views
    48,134

Joystick Port 1 Output Control Accessory for Diamond GOS


k-Pack

1,021 views

At some point during the writing of the last blog entry it dawned on me that accessories could be written to toggle the logic output for the joystick port from within any Diamond application that uses the drop down menu. Six machine language programs were developed to do just that.

 

JSP1OUT.APP Application to set the joystick port 1(JSP1) to output.

JSP1IN.APP Application to set JSP1 for input.

JSP1P1.ACC – JSP1P4.ACC Accessories to toggle the pins on and off when loaded during boot up.

 

Down load this video to view the programs in action.

dControl acc.wmv

 

As you can see by the MAC/65 listings that these files are small. Just be aware that they were written to control JSP1 while using JSP2 for mouse input. Small is a good thing when writing accessories. Only 6 .ACC flies can be loaded at one time and there is 300 bytes reserved for their use.

 

JSP1OUT.APP - This program sets the JSP1 PIN1-4 as outputs. Then sets the output values to 0. The jump to Diamond function #48 returns you to the Diamond desktop.

1000 ;PROGRAM TO SET UP THE JOYSTICK1010 ;PORT FOR OUTPUT TO BE1020 ;CONTROL BY DIAMOND.ACCs1030 ;1040 ; BY PACK007 V1.0  JUNE 20151050 ;1060     .OPT NO LIST1070 PORTA = $D3001080 PACTL = $D3021090 DIAMOND = $8E001100 ;1110     *=  $30001120 ;1130 START LDA #481140     STA PACTL1150     LDA #151160     STA PORTA1170     LDA #521180     STA PACTL1190     LDA #01200     STA PORTA1210     LDA #48     ;DIAMOND FUNCTION1220     JSR DIAMOND1230 ;1240     *=  $02E01250     .WORD START

 

JSP1IN.APP – Sets the JSP1 pins to inputs. No need to reset the logic levels

.

1000 ;PROGRAM TO RESET JSP11010 ;FOR INPUT 1020 ;1030 ;1040 ; BY PACK007 V1.0  JUNE 20151050 ;1060     .OPT NO LIST1070 PORTA = $D3001080 PACTL = $D3021090 DIAMOND = $8E001100 ;1110     *=  $30001120 ;1130 START LDA #481140     STA PACTL1150     LDA #01160     STA PORTA1170     LDA #521180     STA PACTL1190     LDA #48     ;DIAMOND FUNCTION1200     JSR DIAMOND1210 ;1220     *=  $02E01230     .WORD START

JSP1P1 to JSP1P4.ACC – Toggles the appropriate pin on and off. Writing accessories is a bit more complicated due to Diamond’s need for some header information in order to add the program to the drop down menu. It also needs to know where put the program in memory and its length. SKELETON.M65 is setup to organize this information in the required order while assembling an .OBJ file. This .OBJ file is then read by the MAKEACC.APP, manipulated, and then written as an accessory (.ACC).

 

JS1P1 is listed. There are but two lines to change for the other pins. Line 1130 contains the 10 Character title. Line 1210 uses the bit value 1, 2, 4, and 8 for pins 1 – 4 of JSP1.

1000 ;ACC TO TOGGLE OUTPUT ON PIN 11010 ;Of JSP11020 ;1030 ;PACK007 V1.0 JUNE 20151040 ;1050 ;Start with SKELETON.M651060 ;for Desk Accessories1070 ;1080     .OPT NO LIST1090 ;1100 ;1110     *=  $2FF01120 ;1130     .BYTE "PIN 1     " ;10 Byte Name1140     .WORD ENDACC ;End of Accessory1150     .WORD 01160     .WORD RUNACC ;Run Address1170 ;1180 ;ACCESSORY VARIABLES1190 ;1200 RUNACC1210     LDA #1      ; PIN BIT VALUE1220     EOR $D300   ;PORTA1230     STA $D300   ;PORTA NEW VALUE1240     RTS1250 ENDACC

 

One possible use for these pins is suggested in this “Out of the Pack” blog entry.

http://atariage.com/forums/blog/572/entry-11626-relay-boards-under-atari-8bit-control/

 

 

References:

Chadwick, Ian, Mapping the Atari, Compute! Books, 1985

 

Chasin, Mark, Assemble Language Programming for the Atari Computer, A Byte Book, 1984

 

Diamond Develop User Manual, Third Addition, Reeve Softs, 1991

 

Lawrow, Stephen D., Mac/65 reference manual For Atari, Optimized System Software, 1984

 

Mansfield, Richard, Machine Language For Beginners, Compute! Books, 1983

 

 

 

 

0 Comments


Recommended Comments

There are no comments to display.

Guest
Add a comment...

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