Merge branch 'master' into popptr1
This commit is contained in:
@@ -6,9 +6,9 @@
|
||||
;
|
||||
|
||||
.include "atari.inc"
|
||||
.export _cgetc,setcursor
|
||||
.export _cgetc
|
||||
.import setcursor
|
||||
.import KEYBDV_handler
|
||||
.import cursor,mul40
|
||||
|
||||
_cgetc:
|
||||
jsr setcursor
|
||||
@@ -29,43 +29,3 @@ _cgetc:
|
||||
pha
|
||||
rts
|
||||
.endif
|
||||
|
||||
.proc setcursor
|
||||
|
||||
ldy #0
|
||||
lda OLDCHR
|
||||
sta (OLDADR),y
|
||||
|
||||
lda ROWCRS
|
||||
jsr mul40
|
||||
clc
|
||||
adc SAVMSC ; add start of screen memory
|
||||
sta OLDADR
|
||||
txa
|
||||
adc SAVMSC+1
|
||||
sta OLDADR+1
|
||||
lda COLCRS
|
||||
adc OLDADR
|
||||
sta OLDADR
|
||||
bcc nc
|
||||
inc OLDADR+1
|
||||
nc: lda (OLDADR),y
|
||||
sta OLDCHR
|
||||
|
||||
ldx cursor ; current cursor setting as requested by the user
|
||||
beq off
|
||||
ldx #0
|
||||
beq cont
|
||||
|
||||
off: inx
|
||||
cont: stx CRSINH ; update system variable
|
||||
|
||||
beq turnon
|
||||
and #$7f ; clear high bit / inverse flag
|
||||
finish: sta (OLDADR),y ; update on-screen display
|
||||
rts
|
||||
|
||||
turnon: ora #$80 ; set high bit / inverse flag
|
||||
bne finish
|
||||
|
||||
.endproc
|
||||
|
||||
78
libsrc/atari/getdevice.s
Normal file
78
libsrc/atari/getdevice.s
Normal file
@@ -0,0 +1,78 @@
|
||||
;
|
||||
; Oliver Schmidt, 2012-09-04
|
||||
; Christian Groessler, 2017-12-28
|
||||
;
|
||||
; unsigned char getfirstdevice (void);
|
||||
; unsigned char __fastcall__ getnextdevice (unsigned char device);
|
||||
;
|
||||
|
||||
.include "atari.inc"
|
||||
.export _getfirstdevice
|
||||
.export _getnextdevice
|
||||
|
||||
MAX_DIO_DEVICES = 8
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; _getfirstdevice
|
||||
|
||||
_getfirstdevice:
|
||||
lda #$FF
|
||||
; Fall through
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; _getnextdevice
|
||||
|
||||
_getnextdevice:
|
||||
tax
|
||||
next: inx
|
||||
cpx #MAX_DIO_DEVICES
|
||||
beq none
|
||||
|
||||
jsr check_device
|
||||
bmi next
|
||||
|
||||
done: txa
|
||||
ldx #$00
|
||||
rts
|
||||
|
||||
none: ldx #255 ; INVALID_DEVICE (see include/device.h)
|
||||
bne done ; jump always
|
||||
|
||||
;------------------------------------------------------------------------------
|
||||
; check_device - checks if a disk device is present
|
||||
; input: X - device id (0 = D1, 1 = D2, ...)
|
||||
; output: NF - 0/1 for detected/not detected
|
||||
; X register preserved
|
||||
|
||||
check_device:
|
||||
txa
|
||||
pha
|
||||
lda #SIO_STAT
|
||||
sta DCOMND ; set command into DCB
|
||||
lda #%01000000 ; direction value, "receive data"
|
||||
sta DSTATS ; set data flow directon
|
||||
lda #15
|
||||
sta DTIMLO ; value got from DOS source
|
||||
lda #4
|
||||
sta DAUX1 ; set sector # (dummy: 4)
|
||||
sta DBYTLO ; # of bytes to transfer
|
||||
lda #0
|
||||
sta DAUX2
|
||||
sta DBYTHI
|
||||
lda #>DVSTAT
|
||||
sta DBUFHI
|
||||
lda #<DVSTAT
|
||||
sta DBUFLO ; set buffer address into DCB
|
||||
lda #DISKID ; SIO bus ID of diskette drive
|
||||
sta DDEVIC
|
||||
inx
|
||||
stx DUNIT ; unit number (1-based)
|
||||
|
||||
jsr SIOV ; execute SIO command
|
||||
|
||||
pla
|
||||
tax
|
||||
lda DSTATS
|
||||
rts
|
||||
|
||||
.end
|
||||
@@ -41,7 +41,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READJOY
|
||||
.addr 0 ; IRQ entry not used
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
||||
@@ -40,7 +40,6 @@
|
||||
.addr UNINSTALL
|
||||
.addr COUNT
|
||||
.addr READJOY
|
||||
.addr 0 ; IRQ entry not used
|
||||
|
||||
; ------------------------------------------------------------------------
|
||||
; Constants
|
||||
|
||||
48
libsrc/atari/setcursor.s
Normal file
48
libsrc/atari/setcursor.s
Normal file
@@ -0,0 +1,48 @@
|
||||
;
|
||||
; Christian Groessler, November-2002
|
||||
;
|
||||
; cursor handling, internal function
|
||||
|
||||
.include "atari.inc"
|
||||
.import cursor,mul40
|
||||
.export setcursor
|
||||
|
||||
.proc setcursor
|
||||
|
||||
ldy #0
|
||||
lda OLDCHR
|
||||
sta (OLDADR),y
|
||||
|
||||
lda ROWCRS
|
||||
jsr mul40
|
||||
clc
|
||||
adc SAVMSC ; add start of screen memory
|
||||
sta OLDADR
|
||||
txa
|
||||
adc SAVMSC+1
|
||||
sta OLDADR+1
|
||||
lda COLCRS
|
||||
adc OLDADR
|
||||
sta OLDADR
|
||||
bcc nc
|
||||
inc OLDADR+1
|
||||
nc: lda (OLDADR),y
|
||||
sta OLDCHR
|
||||
|
||||
ldx cursor ; current cursor setting as requested by the user
|
||||
beq off
|
||||
ldx #0
|
||||
beq cont
|
||||
|
||||
off: inx
|
||||
cont: stx CRSINH ; update system variable
|
||||
|
||||
beq turnon
|
||||
and #$7f ; clear high bit / inverse flag
|
||||
finish: sta (OLDADR),y ; update on-screen display
|
||||
rts
|
||||
|
||||
turnon: ora #$80 ; set high bit / inverse flag
|
||||
bne finish
|
||||
|
||||
.endproc
|
||||
@@ -68,7 +68,6 @@ libref: .addr $0000 ; Library reference
|
||||
.addr BAR
|
||||
.addr TEXTSTYLE
|
||||
.addr OUTTEXT
|
||||
.addr 0 ; IRQ entry is unused
|
||||
|
||||
; ******************************************************************************
|
||||
|
||||
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user