mirror of
https://github.com/cc65/cc65.git
synced 2024-09-29 17:56:21 +00:00
Turned the 'ST' status byte into a symbol resolved by the linker in order to allow to use it from code living in the 'cbm' directory.
Moved getdevice.s from 'c64'/'c128' to 'cbm' making use of the new 'ST' setup. git-svn-id: svn://svn.cc65.org/cc65/trunk@5834 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
1e3197691a
commit
59e96ef740
@ -56,7 +56,6 @@ OBJS = _scrsize.o \
|
|||||||
devnum.o \
|
devnum.o \
|
||||||
fast.o \
|
fast.o \
|
||||||
get_tv.o \
|
get_tv.o \
|
||||||
getdevice.o \
|
|
||||||
joy_stddrv.o \
|
joy_stddrv.o \
|
||||||
kbhit.o \
|
kbhit.o \
|
||||||
kernal.o \
|
kernal.o \
|
||||||
@ -66,6 +65,7 @@ OBJS = _scrsize.o \
|
|||||||
randomize.o \
|
randomize.o \
|
||||||
revers.o \
|
revers.o \
|
||||||
slow.o \
|
slow.o \
|
||||||
|
status.o \
|
||||||
systime.o \
|
systime.o \
|
||||||
sysuname.o \
|
sysuname.o \
|
||||||
tgi_colors.o \
|
tgi_colors.o \
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
.import RESTOR, BSOUT, CLRCH
|
.import RESTOR, BSOUT, CLRCH
|
||||||
.import __INTERRUPTOR_COUNT__
|
.import __INTERRUPTOR_COUNT__
|
||||||
.import __RAM_START__, __RAM_SIZE__, __STACKSIZE__
|
.import __RAM_START__, __RAM_SIZE__, __STACKSIZE__
|
||||||
|
.importzp ST
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
.include "c128.inc"
|
.include "c128.inc"
|
||||||
|
@ -1,67 +0,0 @@
|
|||||||
;
|
|
||||||
; Oliver Schmidt, 2012-09-04
|
|
||||||
;
|
|
||||||
; unsigned char getfirstdevice (void);
|
|
||||||
; unsigned char __fastcall__ getnextdevice (unsigned char device);
|
|
||||||
;
|
|
||||||
|
|
||||||
.export _getfirstdevice
|
|
||||||
.export _getnextdevice
|
|
||||||
|
|
||||||
.import isdisk
|
|
||||||
.import opencmdchannel
|
|
||||||
.import closecmdchannel
|
|
||||||
.importzp tmp2
|
|
||||||
|
|
||||||
.include "c128.inc"
|
|
||||||
|
|
||||||
;------------------------------------------------------------------------------
|
|
||||||
; _getfirstdevice
|
|
||||||
|
|
||||||
_getfirstdevice:
|
|
||||||
lda #$FF
|
|
||||||
; Fall through
|
|
||||||
|
|
||||||
;------------------------------------------------------------------------------
|
|
||||||
; _getnextdevice
|
|
||||||
|
|
||||||
_getnextdevice:
|
|
||||||
tax
|
|
||||||
next: inx
|
|
||||||
cpx #$FF
|
|
||||||
beq done
|
|
||||||
|
|
||||||
; [open|close]cmdchannel already call isdisk internally but they
|
|
||||||
; interpret a non-disk as a no-op while we need to interpret it
|
|
||||||
; as an error here
|
|
||||||
|
|
||||||
jsr isdisk
|
|
||||||
bcs next
|
|
||||||
|
|
||||||
; [open|close]cmdchannel don't call into the Kernal at all if they
|
|
||||||
; only [in|de]crement the reference count of the shared cmdchannel
|
|
||||||
; so we need to explicitly initialize ST here
|
|
||||||
|
|
||||||
lda #$00
|
|
||||||
sta ST
|
|
||||||
|
|
||||||
stx tmp2
|
|
||||||
jsr opencmdchannel
|
|
||||||
ldx tmp2
|
|
||||||
jsr closecmdchannel
|
|
||||||
ldx tmp2
|
|
||||||
|
|
||||||
; As we had to reference ST above anyway we can as well do so
|
|
||||||
; here too (instead of calling READST)
|
|
||||||
|
|
||||||
lda ST
|
|
||||||
|
|
||||||
; Either the Kernal calls above were successfull or there was
|
|
||||||
; already a cmdchannel to the device open - which is a pretty
|
|
||||||
; good indication of its existence ;-)
|
|
||||||
|
|
||||||
bmi next
|
|
||||||
|
|
||||||
done: txa
|
|
||||||
ldx #$00
|
|
||||||
rts
|
|
5
libsrc/c128/status.s
Normal file
5
libsrc/c128/status.s
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
;
|
||||||
|
; Oliver Schmidt, 2012-09-30
|
||||||
|
;
|
||||||
|
|
||||||
|
.exportzp ST := $90 ; IEC status byte
|
@ -61,6 +61,7 @@ OBJS = _scrsize.o \
|
|||||||
mainargs.o \
|
mainargs.o \
|
||||||
randomize.o \
|
randomize.o \
|
||||||
revers.o \
|
revers.o \
|
||||||
|
status.o \
|
||||||
systime.o \
|
systime.o \
|
||||||
sysuname.o
|
sysuname.o
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
.import callmain, zerobss
|
.import callmain, zerobss
|
||||||
.import MEMTOP, RESTOR, BSOUT, CLRCH
|
.import MEMTOP, RESTOR, BSOUT, CLRCH
|
||||||
.import __INTERRUPTOR_COUNT__
|
.import __INTERRUPTOR_COUNT__
|
||||||
|
.importzp ST
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
.include "plus4.inc"
|
.include "plus4.inc"
|
||||||
|
5
libsrc/c16/status.s
Normal file
5
libsrc/c16/status.s
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
;
|
||||||
|
; Oliver Schmidt, 2012-09-30
|
||||||
|
;
|
||||||
|
|
||||||
|
.exportzp ST := $90 ; IEC status byte
|
@ -55,7 +55,6 @@ OBJS = _scrsize.o \
|
|||||||
devnum.o \
|
devnum.o \
|
||||||
get_ostype.o \
|
get_ostype.o \
|
||||||
get_tv.o \
|
get_tv.o \
|
||||||
getdevice.o \
|
|
||||||
joy_stddrv.o \
|
joy_stddrv.o \
|
||||||
kbhit.o \
|
kbhit.o \
|
||||||
kernal.o \
|
kernal.o \
|
||||||
@ -65,6 +64,7 @@ OBJS = _scrsize.o \
|
|||||||
mouse_stddrv.o \
|
mouse_stddrv.o \
|
||||||
randomize.o \
|
randomize.o \
|
||||||
revers.o \
|
revers.o \
|
||||||
|
status.o \
|
||||||
systime.o \
|
systime.o \
|
||||||
sysuname.o \
|
sysuname.o \
|
||||||
tgi_colors.o \
|
tgi_colors.o \
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
.import __INTERRUPTOR_COUNT__
|
.import __INTERRUPTOR_COUNT__
|
||||||
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
|
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
|
||||||
.import __STACKSIZE__ ; Linker generated
|
.import __STACKSIZE__ ; Linker generated
|
||||||
|
.importzp ST
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
.include "c64.inc"
|
.include "c64.inc"
|
||||||
|
5
libsrc/c64/status.s
Normal file
5
libsrc/c64/status.s
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
;
|
||||||
|
; Oliver Schmidt, 2012-09-30
|
||||||
|
;
|
||||||
|
|
||||||
|
.exportzp ST := $90 ; IEC status byte
|
@ -76,6 +76,7 @@ S_OBJS = c_acptr.o \
|
|||||||
filename.o \
|
filename.o \
|
||||||
filetype.o \
|
filetype.o \
|
||||||
filevars.o \
|
filevars.o \
|
||||||
|
getdevice.o \
|
||||||
gotox.o \
|
gotox.o \
|
||||||
gotoxy.o \
|
gotoxy.o \
|
||||||
gotoy.o \
|
gotoy.o \
|
||||||
|
@ -11,10 +11,9 @@
|
|||||||
.import isdisk
|
.import isdisk
|
||||||
.import opencmdchannel
|
.import opencmdchannel
|
||||||
.import closecmdchannel
|
.import closecmdchannel
|
||||||
|
.importzp ST
|
||||||
.importzp tmp2
|
.importzp tmp2
|
||||||
|
|
||||||
.include "c64.inc"
|
|
||||||
|
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
; _getfirstdevice
|
; _getfirstdevice
|
||||||
|
|
@ -70,6 +70,7 @@ OBJS = _scrsize.o \
|
|||||||
mainargs.o \
|
mainargs.o \
|
||||||
randomize.o \
|
randomize.o \
|
||||||
revers.o \
|
revers.o \
|
||||||
|
status.o \
|
||||||
sysuname.o
|
sysuname.o
|
||||||
|
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
|
@ -6,8 +6,7 @@
|
|||||||
;
|
;
|
||||||
|
|
||||||
.export checkst
|
.export checkst
|
||||||
|
.importzp ST
|
||||||
.include "pet.inc"
|
|
||||||
|
|
||||||
|
|
||||||
.proc checkst
|
.proc checkst
|
||||||
@ -22,5 +21,3 @@
|
|||||||
rts
|
rts
|
||||||
|
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@
|
|||||||
.import callmain
|
.import callmain
|
||||||
.import CLRCH, BSOUT
|
.import CLRCH, BSOUT
|
||||||
.import __INTERRUPTOR_COUNT__
|
.import __INTERRUPTOR_COUNT__
|
||||||
|
.importzp ST
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
.include "pet.inc"
|
.include "pet.inc"
|
||||||
|
@ -5,8 +5,7 @@
|
|||||||
;
|
;
|
||||||
|
|
||||||
.export READST
|
.export READST
|
||||||
|
.importzp ST
|
||||||
.include "pet.inc"
|
|
||||||
|
|
||||||
|
|
||||||
.proc READST
|
.proc READST
|
||||||
|
5
libsrc/pet/status.s
Normal file
5
libsrc/pet/status.s
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
;
|
||||||
|
; Oliver Schmidt, 2012-09-30
|
||||||
|
;
|
||||||
|
|
||||||
|
.exportzp ST := $96 ; IEC status byte
|
@ -82,6 +82,7 @@ OBJS = _scrsize.o \
|
|||||||
mainargs.o \
|
mainargs.o \
|
||||||
randomize.o \
|
randomize.o \
|
||||||
revers.o \
|
revers.o \
|
||||||
|
status.o \
|
||||||
systime.o \
|
systime.o \
|
||||||
sysuname.o
|
sysuname.o
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
.import __INTERRUPTOR_COUNT__
|
.import __INTERRUPTOR_COUNT__
|
||||||
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
|
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
|
||||||
.import __STACKSIZE__ ; Linker generated
|
.import __STACKSIZE__ ; Linker generated
|
||||||
|
.importzp ST
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
.include "plus4.inc"
|
.include "plus4.inc"
|
||||||
|
5
libsrc/plus4/status.s
Normal file
5
libsrc/plus4/status.s
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
;
|
||||||
|
; Oliver Schmidt, 2012-09-30
|
||||||
|
;
|
||||||
|
|
||||||
|
.exportzp ST := $90 ; IEC status byte
|
@ -61,6 +61,7 @@ OBJS = _scrsize.o \
|
|||||||
mainargs.o \
|
mainargs.o \
|
||||||
randomize.o \
|
randomize.o \
|
||||||
revers.o \
|
revers.o \
|
||||||
|
status.o \
|
||||||
sysuname.o
|
sysuname.o
|
||||||
|
|
||||||
#--------------------------------------------------------------------------
|
#--------------------------------------------------------------------------
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
.import __INTERRUPTOR_COUNT__
|
.import __INTERRUPTOR_COUNT__
|
||||||
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
|
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
|
||||||
.import __STACKSIZE__ ; Linker generated
|
.import __STACKSIZE__ ; Linker generated
|
||||||
|
.importzp ST
|
||||||
|
|
||||||
.include "zeropage.inc"
|
.include "zeropage.inc"
|
||||||
.include "vic20.inc"
|
.include "vic20.inc"
|
||||||
|
5
libsrc/vic20/status.s
Normal file
5
libsrc/vic20/status.s
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
;
|
||||||
|
; Oliver Schmidt, 2012-09-30
|
||||||
|
;
|
||||||
|
|
||||||
|
.exportzp ST := $90 ; IEC status byte
|
Loading…
Reference in New Issue
Block a user