Merge branch 'master' into popptr1
This commit is contained in:
@@ -7,9 +7,44 @@
|
||||
|
||||
.include "atmos.inc"
|
||||
|
||||
_atmos_ping := PING
|
||||
_atmos_shoot := SHOOT
|
||||
_atmos_explode := EXPLODE
|
||||
_atmos_zap := ZAP
|
||||
_atmos_tick := TICK
|
||||
_atmos_tock := TOCK
|
||||
.proc _atmos_ping
|
||||
bit $31
|
||||
bvs L1 ; Atmos?
|
||||
jmp PING
|
||||
L1: jmp PING1
|
||||
.endproc
|
||||
|
||||
.proc _atmos_shoot
|
||||
bit $31
|
||||
bvs L1 ; Atmos?
|
||||
jmp SHOOT
|
||||
L1: jmp SHOOT1
|
||||
.endproc
|
||||
|
||||
.proc _atmos_explode
|
||||
bit $31
|
||||
bvs L1 ; Atmos?
|
||||
jmp EXPLODE
|
||||
L1: jmp EXPLODE1
|
||||
.endproc
|
||||
|
||||
.proc _atmos_zap
|
||||
bit $31
|
||||
bvs L1 ; Atmos?
|
||||
jmp ZAP
|
||||
L1: jmp ZAP1
|
||||
.endproc
|
||||
|
||||
.proc _atmos_tick
|
||||
bit $31
|
||||
bvs L1 ; Atmos?
|
||||
jmp TICK
|
||||
L1: jmp TICK1
|
||||
.endproc
|
||||
|
||||
.proc _atmos_tock
|
||||
bit $31
|
||||
bvs L1 ; Atmos?
|
||||
jmp TOCK
|
||||
L1: jmp TOCK1
|
||||
.endproc
|
||||
|
||||
@@ -6,7 +6,6 @@
|
||||
;
|
||||
|
||||
.export _cgetc
|
||||
.constructor initcgetc
|
||||
|
||||
.import cursor
|
||||
.forceimport disable_caps
|
||||
@@ -53,14 +52,3 @@
|
||||
@L3: rts
|
||||
|
||||
.endproc
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Switch the cursor off. Code goes into the ONCE segment,
|
||||
; which will be reused after it is run.
|
||||
|
||||
.segment "ONCE"
|
||||
|
||||
initcgetc:
|
||||
lsr STATUS
|
||||
asl STATUS ; Clear bit zero
|
||||
rts
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
|
||||
.export _cputcxy, _cputc
|
||||
.export setscrptr, putchar
|
||||
.constructor initcputc
|
||||
.import rvs
|
||||
.import popax
|
||||
.importzp ptr2
|
||||
@@ -95,3 +96,13 @@ ScrTabHi:
|
||||
.byte >(SCREEN + Line * SCREEN_XSIZE)
|
||||
.endrep
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Switch the cursor off. Code goes into the ONCE segment,
|
||||
; which will be reused after it is run.
|
||||
|
||||
.segment "ONCE"
|
||||
|
||||
initcputc:
|
||||
lsr STATUS
|
||||
asl STATUS ; Clear bit zero
|
||||
rts
|
||||
|
||||
134
libsrc/atmos/joy/atmos-ijk.s
Normal file
134
libsrc/atmos/joy/atmos-ijk.s
Normal file
@@ -0,0 +1,134 @@
|
||||
;
|
||||
; IJK joystick driver for the Atmos
|
||||
; Can be used multiple times when statically linked to the application.
|
||||
;
|
||||
; 2002-12-20, Based on Ullrich von Bassewitz's code.
|
||||
; 2017-11-01, Stefan Haubenthal
|
||||
;
|
||||
|
||||
.include "joy-kernel.inc"
|
||||
.include "joy-error.inc"
|
||||
.include "atmos.inc"
|
||||
|
||||
.macpack module
|
||||
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Header. Includes jump table
|
||||
|
||||
module_header _atmos_ijk_joy
|
||||
|
||||
; Driver signature
|
||||
|
||||
.byte $6A, $6F, $79 ; "joy"
|
||||
.byte JOY_API_VERSION ; Driver API version number
|
||||
|
||||
; Library reference
|
||||
|
||||
.addr $0000
|
||||
|
||||
; Jump table.
|
||||
|
||||
.addr INSTALL
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READ
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
||||
JOY_COUNT = 2 ; Number of joysticks we support
|
||||
|
||||
.code
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; INSTALL routine. Is called after the driver is loaded into memory. If
|
||||
; possible, check if the hardware is present and determine the amount of
|
||||
; memory available.
|
||||
; Must return an JOY_ERR_xx code in a/x.
|
||||
;
|
||||
|
||||
INSTALL:
|
||||
lda #%11000000
|
||||
sta VIA::DDRA
|
||||
sta VIA::PRA
|
||||
lda VIA::PRA
|
||||
and #%00100000
|
||||
bne ijkPresent
|
||||
lda #<JOY_ERR_NO_DEVICE
|
||||
.byte $2C ; Skip next opcode
|
||||
ijkPresent:
|
||||
lda #<JOY_ERR_OK
|
||||
ldx #>JOY_ERR_OK
|
||||
; rts ; Run into UNINSTALL instead
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; UNINSTALL routine. Is called before the driver is removed from memory.
|
||||
; Can do cleanup or whatever. Must not return anything.
|
||||
;
|
||||
|
||||
UNINSTALL:
|
||||
rts
|
||||
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; COUNT: Return the total number of available joysticks in a/x.
|
||||
;
|
||||
|
||||
COUNT:
|
||||
lda #<JOY_COUNT
|
||||
ldx #>JOY_COUNT
|
||||
rts
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; READ: Read a particular joystick passed in A.
|
||||
;
|
||||
|
||||
READ:
|
||||
bne right
|
||||
|
||||
; Ensure Printer Strobe is set to Output
|
||||
lda #%10110111
|
||||
sta VIA::DDRB
|
||||
; Set Strobe Low
|
||||
lda #%00000000
|
||||
sta VIA::PRB
|
||||
; Set Top two bits of PortA to Output and rest as Input
|
||||
lda #%11000000
|
||||
sta VIA::DDRA
|
||||
|
||||
; Select Left Joystick
|
||||
lda #%01111111
|
||||
sta VIA::PRA
|
||||
; Read back Left Joystick state
|
||||
lda VIA::PRA
|
||||
; Mask out unused bits
|
||||
and #%00011111
|
||||
; Invert Bits
|
||||
eor #%00011111
|
||||
; Index table to conform to Generic Format
|
||||
tax
|
||||
lda GenericIJKBits,X
|
||||
bne L1
|
||||
|
||||
right:
|
||||
; Select Right Joystick
|
||||
lda #%10111111
|
||||
sta VIA::PRA
|
||||
; Read back Right Joystick state and rejig bits
|
||||
lda VIA::PRA
|
||||
and #%00011111
|
||||
eor #%00011111
|
||||
tax
|
||||
lda GenericIJKBits,X
|
||||
|
||||
; Restore VIA PortA state
|
||||
L1: ldx #%11111111
|
||||
stx VIA::DDRA
|
||||
inx ; x=0
|
||||
rts
|
||||
|
||||
.rodata
|
||||
GenericIJKBits:
|
||||
.byte 0,2,1,3,32,34,33,0,8,10,9,0,40,42,41,0
|
||||
.byte 16,18,17,0,48,50,49,0,0,0,0,0,0,0,0,0
|
||||
@@ -34,7 +34,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READ
|
||||
.addr 0 ; IRQ entry unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
||||
@@ -59,7 +59,6 @@ YSIZE = 8 ; System font height
|
||||
.addr BAR
|
||||
.addr TEXTSTYLE
|
||||
.addr OUTTEXT
|
||||
.addr 0 ; IRQ entry is unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Data.
|
||||
|
||||
@@ -59,7 +59,6 @@ YSIZE = 8 ; System font height
|
||||
.addr BAR
|
||||
.addr TEXTSTYLE
|
||||
.addr OUTTEXT
|
||||
.addr 0 ; IRQ entry is unused
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Data.
|
||||
|
||||
@@ -1,8 +0,0 @@
|
||||
;
|
||||
; Target-specific black & white values for use by the target-shared TGI kernel
|
||||
;
|
||||
|
||||
.include "tgi-kernel.inc"
|
||||
|
||||
.export tgi_color_black:zp = $00
|
||||
.export tgi_color_white:zp = $01
|
||||
@@ -1,14 +0,0 @@
|
||||
;
|
||||
; char __fastcall__ toascii (char c);
|
||||
; /* Convert a target-specific character to ASCII. */
|
||||
;
|
||||
|
||||
.export _toascii
|
||||
|
||||
.proc _toascii
|
||||
|
||||
; .X must be zero, on return.
|
||||
ldx #>$0000
|
||||
rts
|
||||
|
||||
.endproc
|
||||
Reference in New Issue
Block a user