User Tools

Site Tools


system_interface

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
system_interface [2025/07/03 16:11] reggiesystem_interface [2025/07/25 17:52] (current) reggie
Line 5: Line 5:
   const SIbaseAddress=$ff80   const SIbaseAddress=$ff80
   const SIrefreshOff=0, SIrefreshOn=1, SIgraphicsMode=2, SIkeyInterface=3;   const SIrefreshOff=0, SIrefreshOn=1, SIgraphicsMode=2, SIkeyInterface=3;
 +  const SIArrowButtons=4;
  
   SIrefreshOff       Write <any> to force OFF register refresh and display animation   SIrefreshOff       Write <any> to force OFF register refresh and display animation
Line 10: Line 11:
   SIgraphicsMode     Write <number of colours> to select graphics mode (2, 4, 16 allowed values)   SIgraphicsMode     Write <number of colours> to select graphics mode (2, 4, 16 allowed values)
   SIkeyInterface     Write 0 then read an ASCII code (if<128), write 255 to clear the keyboard buffer   SIkeyInterface     Write 0 then read an ASCII code (if<128), write 255 to clear the keyboard buffer
 +  SIArrowButtons     Read state of game controller buttons
      
 ==== Refresh ==== ==== Refresh ====
Line 71: Line 73:
     cmpa #escape                       ; flag Zero if ESC     cmpa #escape                       ; flag Zero if ESC
     rts     rts
 +    
 +A game controller is emulated using the keyboard. The arrow keys are for movement, plus Space and Enter can be used for 'Fire' and 'Bomb'. You can see their activity below the text screen. Read from the port to get a bitmap of these keys; logical AND with the appropriate mask to test whether a button is currently pressed or not. Note that these keys may interfere with normal functions of the HTML page such as scrolling and editing; click the Halt or Reset buttons to stop this.    
  
 +  const ArrowLeft=$01, ArrowRight=$02, ArrowUp=$04, ArrowDown=$08 
 +  const BtnFire=$10, BtnBomb=$20           
 +  readControls:   
 +    lda SIBaseAddress+SIArrowButtons 
 +    bita #BtnFire 
 +    bne fireWeapon
  
  
  
system_interface.1751559117.txt.gz · Last modified: 2025/07/03 16:11 by reggie

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki