mirror of
https://github.com/cc65/cc65.git
synced 2024-09-22 02:57:36 +00:00
Merge branch 'master' into lightpen
This commit is contained in:
commit
a555b5f6a5
@ -44,9 +44,34 @@ CLOSE = $0C ;close
|
|||||||
STATIS = $0D ;status
|
STATIS = $0D ;status
|
||||||
SPECIL = $0E ;special
|
SPECIL = $0E ;special
|
||||||
|
|
||||||
; Special Entry Command Equates
|
; DOS IOCB command codes
|
||||||
|
|
||||||
; Screen Commands
|
RENAME = $20 ;rename disk file
|
||||||
|
DELETE = $21 ;delete disk file
|
||||||
|
LOCKFL = $23 ;lock file (set to read-only)
|
||||||
|
UNLOCK = $24 ;unlock file
|
||||||
|
POINT = $25 ;point sector
|
||||||
|
NOTE = $26 ;note sector
|
||||||
|
GETFL = $27 ;get file length
|
||||||
|
CHDIR_MYDOS = $29 ;change directory (MyDOS)
|
||||||
|
MKDIR = $2A ;make directory (MyDOS/SpartaDOS)
|
||||||
|
CHDIR_SPDOS = $2C ;change directory (SpartaDOS)
|
||||||
|
FORMAT = $FE ;format
|
||||||
|
|
||||||
|
GETCWD = $30 ;get current directory (MyDOS/SpartaDOS)
|
||||||
|
|
||||||
|
; Special Entry Command Equates
|
||||||
|
; DOS Commands
|
||||||
|
; Command line table, Index values for (DOSVEC),Y -- COMTAB
|
||||||
|
; Compatible with OS/A+, DOS XL and SpartaDOS
|
||||||
|
|
||||||
|
COMTAB = 0 ;DOS entry jump vector
|
||||||
|
ZCRNAME = 3 ;file name crunch routine jump vector
|
||||||
|
BUFOFF = 10 ;next parameter buffer offset
|
||||||
|
COMFNAM = 33 ;destination buffer for crunch routine
|
||||||
|
LBUF = 63 ;command line input buffer
|
||||||
|
|
||||||
|
; Screen IOCB Commands
|
||||||
|
|
||||||
DRAWLN = $11 ;draw line
|
DRAWLN = $11 ;draw line
|
||||||
FILLIN = $12 ;draw line with right fill
|
FILLIN = $12 ;draw line with right fill
|
||||||
@ -710,6 +735,9 @@ FPSCR1 = $05EC ;6-byte floating point temporary
|
|||||||
|
|
||||||
;LBFEND = $05FF ;##old## END OF LBUFF
|
;LBFEND = $05FF ;##old## END OF LBUFF
|
||||||
|
|
||||||
|
|
||||||
|
DOS = $0700
|
||||||
|
|
||||||
;-------------------------------------------------------------------------
|
;-------------------------------------------------------------------------
|
||||||
; Cartridge Address Equates
|
; Cartridge Address Equates
|
||||||
;-------------------------------------------------------------------------
|
;-------------------------------------------------------------------------
|
||||||
@ -1022,29 +1050,6 @@ STOPLN = $BA ;2-byte stopped line number
|
|||||||
ERRSAVE = $C3 ;1-byte error code
|
ERRSAVE = $C3 ;1-byte error code
|
||||||
PTABW = $C9 ;1-byte tab width
|
PTABW = $C9 ;1-byte tab width
|
||||||
|
|
||||||
;-------------------------------------------------------------------------
|
|
||||||
; DOS
|
|
||||||
;-------------------------------------------------------------------------
|
|
||||||
|
|
||||||
DOS = $0700
|
|
||||||
|
|
||||||
RENAME = $20 ;RENAME DISK FILE
|
|
||||||
DELETE = $21 ;DELETE DISK FILE
|
|
||||||
LOCKFL = $23 ;LOCK FILE TO READ ONLY
|
|
||||||
UNLOCK = $24 ;UNLOCK LOCKED FILE
|
|
||||||
POINT = $25 ;POINT SECTOR
|
|
||||||
NOTE = $26 ;NOTE SECTOR
|
|
||||||
FORMAT = $FE ;FORMAT
|
|
||||||
|
|
||||||
; Command line table, Index values for (DOSVEC),Y -- COMTAB
|
|
||||||
; Compatible with OS/A+, DOS XL and SpartaDOS
|
|
||||||
|
|
||||||
COMTAB = 0 ;DOS entry jump vector
|
|
||||||
ZCRNAME = 3 ;file name crunch routine jump vector
|
|
||||||
BUFOFF = 10 ;next parameter buffer offset
|
|
||||||
COMFNAM = 33 ;destination buffer for crunch routine
|
|
||||||
LBUF = 63 ;command line input buffer
|
|
||||||
|
|
||||||
;-------------------------------------------------------------------------
|
;-------------------------------------------------------------------------
|
||||||
; ATASCII CHARACTER DEFS
|
; ATASCII CHARACTER DEFS
|
||||||
;-------------------------------------------------------------------------
|
;-------------------------------------------------------------------------
|
||||||
|
@ -41,9 +41,9 @@ _IOLBF = 1
|
|||||||
_IONBF = 2
|
_IONBF = 2
|
||||||
BUFSIZ = 256
|
BUFSIZ = 256
|
||||||
EOF = -1
|
EOF = -1
|
||||||
.if .defined(__APPLE2__) .or .defined(__APPLE2ENH__)
|
.if .defined(__APPLE2__)
|
||||||
FILENAME_MAX = 64+1
|
FILENAME_MAX = 64+1
|
||||||
.elseif .defined(__ATARI__) .or .defined(__ATARIXL__)
|
.elseif .defined(__ATARI__)
|
||||||
FILENAME_MAX = 12+1
|
FILENAME_MAX = 12+1
|
||||||
.elseif .defined(__LUNIX__)
|
.elseif .defined(__LUNIX__)
|
||||||
FILENAME_MAX = 80+1
|
FILENAME_MAX = 80+1
|
||||||
|
@ -10,7 +10,7 @@ SEGMENTS {
|
|||||||
DATA: load = COMBINED, type = rw, define = yes;
|
DATA: load = COMBINED, type = rw, define = yes;
|
||||||
BSS: load = COMBINED, type = bss, define = yes;
|
BSS: load = COMBINED, type = bss, define = yes;
|
||||||
ZEROPAGE: load = ZP, type = zp;
|
ZEROPAGE: load = ZP, type = zp;
|
||||||
EXTZP: load = ZP, type = zp;
|
EXTZP: load = ZP, type = zp, optional = yes;
|
||||||
}
|
}
|
||||||
FILES {
|
FILES {
|
||||||
%O: format = o65;
|
%O: format = o65;
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Check for errors */
|
/* Check for errors */
|
||||||
#if !defined(__APPLE2__) && !defined(__APPLE2ENH__)
|
#if !defined(__APPLE2__)
|
||||||
# error This module may only be used when compiling for the Apple ][!
|
# error This module may only be used when compiling for the Apple ][!
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ extern unsigned char _filetype; /* Default 6 */
|
|||||||
extern unsigned int _auxtype; /* Default 0 */
|
extern unsigned int _auxtype; /* Default 0 */
|
||||||
|
|
||||||
/* The addresses of the static drivers */
|
/* The addresses of the static drivers */
|
||||||
#ifndef __APPLE2ENH__
|
#if !defined(__APPLE2ENH__)
|
||||||
extern void a2_auxmem_emd[];
|
extern void a2_auxmem_emd[];
|
||||||
extern void a2_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */
|
extern void a2_stdjoy_joy[]; /* Referred to by joy_static_stddrv[] */
|
||||||
extern void a2_stdmou_mou[]; /* Referred to by mouse_static_stddrv[] */
|
extern void a2_stdmou_mou[]; /* Referred to by mouse_static_stddrv[] */
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Check for errors */
|
/* Check for errors */
|
||||||
#if !defined(__ATARI__) && !defined(__ATARIXL__)
|
#if !defined(__ATARI__)
|
||||||
# error This module may only be used when compiling for the Atari!
|
# error This module may only be used when compiling for the Atari!
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Check for errors */
|
/* Check for errors */
|
||||||
#if !defined(__PLUS4__) && !defined(__C16__)
|
#if !defined(__C16__)
|
||||||
# error This module may only be used when compiling for the Plus/4 or C16!
|
# error This module may only be used when compiling for the Plus/4 or C16!
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -59,11 +59,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Include the correct machine-specific file */
|
/* Include the correct machine-specific file */
|
||||||
#if defined(__APPLE2__)
|
#if defined(__APPLE2ENH__)
|
||||||
# include <apple2.h>
|
|
||||||
#elif defined(__APPLE2ENH__)
|
|
||||||
# include <apple2enh.h>
|
# include <apple2enh.h>
|
||||||
#elif defined(__ATARI__) || defined(__ATARIXL__)
|
#elif defined(__APPLE2__)
|
||||||
|
# include <apple2.h>
|
||||||
|
#elif defined(__ATARI__)
|
||||||
# include <atari.h>
|
# include <atari.h>
|
||||||
#elif defined(__ATMOS__)
|
#elif defined(__ATMOS__)
|
||||||
# include <atmos.h>
|
# include <atmos.h>
|
||||||
|
@ -43,7 +43,7 @@
|
|||||||
|
|
||||||
typedef struct DIR DIR;
|
typedef struct DIR DIR;
|
||||||
|
|
||||||
#if defined(__APPLE2__) || defined(__APPLE2ENH__)
|
#if defined(__APPLE2__)
|
||||||
|
|
||||||
struct dirent {
|
struct dirent {
|
||||||
char d_name[16];
|
char d_name[16];
|
||||||
@ -78,7 +78,7 @@ struct dirent {
|
|||||||
#define _DE_ISLBL(t) (0)
|
#define _DE_ISLBL(t) (0)
|
||||||
#define _DE_ISLNK(t) (0)
|
#define _DE_ISLNK(t) (0)
|
||||||
|
|
||||||
#elif defined(__ATARI__) || defined(__ATARIXL__)
|
#elif defined(__ATARI__)
|
||||||
|
|
||||||
struct dirent {
|
struct dirent {
|
||||||
char d_name[13]; /* 8.3 + trailing 0 */
|
char d_name[13]; /* 8.3 + trailing 0 */
|
||||||
|
@ -69,9 +69,9 @@ extern FILE* stderr;
|
|||||||
#define TMP_MAX 256
|
#define TMP_MAX 256
|
||||||
|
|
||||||
/* Standard defines that are platform dependent */
|
/* Standard defines that are platform dependent */
|
||||||
#if defined(__APPLE2__) || defined(__APPLE2ENH__)
|
#if defined(__APPLE2__)
|
||||||
# define FILENAME_MAX (64+1)
|
# define FILENAME_MAX (64+1)
|
||||||
#elif defined(__ATARI__) || defined(__ATARIXL__)
|
#elif defined(__ATARI__)
|
||||||
# define FILENAME_MAX (12+1)
|
# define FILENAME_MAX (12+1)
|
||||||
#elif defined(__LUNIX__)
|
#elif defined(__LUNIX__)
|
||||||
# define FILENAME_MAX (80+1)
|
# define FILENAME_MAX (80+1)
|
||||||
|
@ -76,7 +76,7 @@ extern struct _timezone {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
#if defined(__ATARI__) || defined(__ATARIXL__)
|
#if defined(__ATARI__)
|
||||||
/* The clock depends on the video standard, so read it at runtime */
|
/* The clock depends on the video standard, so read it at runtime */
|
||||||
unsigned _clocks_per_sec (void);
|
unsigned _clocks_per_sec (void);
|
||||||
# define CLK_TCK _clocks_per_sec()
|
# define CLK_TCK _clocks_per_sec()
|
||||||
|
@ -67,7 +67,8 @@ clean:
|
|||||||
|
|
||||||
else # TARGET
|
else # TARGET
|
||||||
|
|
||||||
CFLAGS += -Osir -W error
|
CA65FLAGS =
|
||||||
|
CC65FLAGS = -Osir -W error
|
||||||
|
|
||||||
EXTZP = cbm510 \
|
EXTZP = cbm510 \
|
||||||
cbm610 \
|
cbm610 \
|
||||||
@ -178,7 +179,7 @@ $$($1_OBJS): | $$($1_OBJDIR)
|
|||||||
|
|
||||||
$$($1_DRVPAT): $$($1_OBJPAT) $$(ZPOBJ) | $$($1_DRVDIR)
|
$$($1_DRVPAT): $$($1_OBJPAT) $$(ZPOBJ) | $$($1_DRVDIR)
|
||||||
@echo $$(TARGET) - $$(@F)
|
@echo $$(TARGET) - $$(@F)
|
||||||
@$$(LD) -o $$@ -t module $$^
|
@$$(LD65) -o $$@ -t module $$^
|
||||||
|
|
||||||
$$($1_OBJDIR) $$($1_DRVDIR):
|
$$($1_OBJDIR) $$($1_DRVDIR):
|
||||||
@$$(call MKDIR,$$@)
|
@$$(call MKDIR,$$@)
|
||||||
@ -187,8 +188,8 @@ $(TARGET): $$($1_DRVS)
|
|||||||
|
|
||||||
$$($1_STCPAT): $$($1_DRVPAT)
|
$$($1_STCPAT): $$($1_DRVPAT)
|
||||||
@echo $$(TARGET) - $$(<F)
|
@echo $$(TARGET) - $$(<F)
|
||||||
@$$(CO) -o $$(@:.o=.s) --code-label _$$(subst -,_,$$(subst .,_,$$(<F))) $$<
|
@$$(CO65) -o $$(@:.o=.s) --code-label _$$(subst -,_,$$(subst .,_,$$(<F))) $$<
|
||||||
@$$(CA) -t $$(TARGET) -o $$@ $$(@:.o=.s)
|
@$$(CA65) -t $$(TARGET) -o $$@ $$(@:.o=.s)
|
||||||
|
|
||||||
OBJS += $$($1_STCS)
|
OBJS += $$($1_STCS)
|
||||||
|
|
||||||
@ -200,11 +201,11 @@ endef
|
|||||||
|
|
||||||
$(foreach drvtype,$(DRVTYPES),$(eval $(call DRVTYPE_template,$(drvtype))))
|
$(foreach drvtype,$(DRVTYPES),$(eval $(call DRVTYPE_template,$(drvtype))))
|
||||||
|
|
||||||
AR := $(if $(wildcard ../bin/ar65*),../bin/ar65,ar65)
|
AR65 := $(if $(wildcard ../bin/ar65*),../bin/ar65,ar65)
|
||||||
CA := $(if $(wildcard ../bin/ca65*),../bin/ca65,ca65)
|
CA65 := $(if $(wildcard ../bin/ca65*),../bin/ca65,ca65)
|
||||||
CC := $(if $(wildcard ../bin/cc65*),../bin/cc65,cc65)
|
CC65 := $(if $(wildcard ../bin/cc65*),../bin/cc65,cc65)
|
||||||
CO := $(if $(wildcard ../bin/co65*),../bin/co65,co65)
|
CO65 := $(if $(wildcard ../bin/co65*),../bin/co65,co65)
|
||||||
LD := $(if $(wildcard ../bin/ld65*),../bin/ld65,ld65)
|
LD65 := $(if $(wildcard ../bin/ld65*),../bin/ld65,ld65)
|
||||||
|
|
||||||
export CC65_HOME := $(abspath ..)
|
export CC65_HOME := $(abspath ..)
|
||||||
|
|
||||||
@ -213,7 +214,7 @@ export CC65_HOME := $(abspath ..)
|
|||||||
define ASSEMBLE_recipe
|
define ASSEMBLE_recipe
|
||||||
|
|
||||||
$(if $(TRAVIS),,@echo $(TARGET) - $<)
|
$(if $(TRAVIS),,@echo $(TARGET) - $<)
|
||||||
@$(CA) -t $(TARGET) $(AFLAGS) --create-dep $(@:.o=.d) -o $@ $<
|
@$(CA65) -t $(TARGET) $(CA65FLAGS) --create-dep $(@:.o=.d) -o $@ $<
|
||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@ -222,8 +223,8 @@ endef
|
|||||||
define COMPILE_recipe
|
define COMPILE_recipe
|
||||||
|
|
||||||
$(if $(TRAVIS),,@echo $(TARGET) - $<)
|
$(if $(TRAVIS),,@echo $(TARGET) - $<)
|
||||||
@$(CC) -t $(TARGET) $(CFLAGS) --create-dep $(@:.o=.d) --dep-target $@ -o $(@:.o=.s) $<
|
@$(CC65) -t $(TARGET) $(CC65FLAGS) --create-dep $(@:.o=.d) --dep-target $@ -o $(@:.o=.s) $<
|
||||||
@$(CA) -t $(TARGET) -o $@ $(@:.o=.s)
|
@$(CA65) -t $(TARGET) -o $@ $(@:.o=.s)
|
||||||
|
|
||||||
endef
|
endef
|
||||||
|
|
||||||
@ -237,10 +238,10 @@ endef
|
|||||||
|
|
||||||
$(EXTRA_OBJPAT): $(EXTRA_SRCPAT) | ../lib
|
$(EXTRA_OBJPAT): $(EXTRA_SRCPAT) | ../lib
|
||||||
@echo $(TARGET) - $(@F)
|
@echo $(TARGET) - $(@F)
|
||||||
@$(CA) -t $(TARGET) $(AFLAGS) -o $@ $<
|
@$(CA65) -t $(TARGET) $(CA65FLAGS) -o $@ $<
|
||||||
|
|
||||||
../lib/$(TARGET).lib: $(OBJS) | ../lib
|
../lib/$(TARGET).lib: $(OBJS) | ../lib
|
||||||
$(AR) a $@ $?
|
$(AR65) a $@ $?
|
||||||
|
|
||||||
../wrk/$(TARGET) ../lib ../targetutil:
|
../wrk/$(TARGET) ../lib ../targetutil:
|
||||||
@$(call MKDIR,$@)
|
@$(call MKDIR,$@)
|
||||||
|
@ -4,6 +4,6 @@ DEPS += ../wrk/$(TARGET)/loader.d
|
|||||||
$(ASSEMBLE_recipe)
|
$(ASSEMBLE_recipe)
|
||||||
|
|
||||||
../targetutil/loader.system: ../wrk/$(TARGET)/loader.o $(SRCDIR)/targetutil/loader.cfg | ../targetutil
|
../targetutil/loader.system: ../wrk/$(TARGET)/loader.o $(SRCDIR)/targetutil/loader.cfg | ../targetutil
|
||||||
$(LD) -o $@ -C $(filter %.cfg,$^) $(filter-out %.cfg,$^)
|
$(LD65) -o $@ -C $(filter %.cfg,$^) $(filter-out %.cfg,$^)
|
||||||
|
|
||||||
$(TARGET): ../targetutil/loader.system
|
$(TARGET): ../targetutil/loader.system
|
||||||
|
@ -13,4 +13,4 @@
|
|||||||
# DYNAMIC_DD - determine default disk device at runtime (SpartaDOS only)
|
# DYNAMIC_DD - determine default disk device at runtime (SpartaDOS only)
|
||||||
# needs DEFAULT_DEVICE to be defined, otherwise no effect
|
# needs DEFAULT_DEVICE to be defined, otherwise no effect
|
||||||
|
|
||||||
AFLAGS += -D NUMDRVS=4 -D LINEBUF=80 -D UCASE_FILENAME=1 -D DEFAULT_DEVICE=1 -D DYNAMIC_DD=1
|
CA65FLAGS += -D NUMDRVS=4 -D LINEBUF=80 -D UCASE_FILENAME=1 -D DEFAULT_DEVICE=1 -D DYNAMIC_DD=1
|
||||||
|
@ -9,26 +9,26 @@
|
|||||||
.importzp ptr1
|
.importzp ptr1
|
||||||
.import setcursor
|
.import setcursor
|
||||||
|
|
||||||
|
SCRSIZE = 960 ; 40x24: size of default atari screen
|
||||||
|
|
||||||
_clrscr:lda SAVMSC ; screen memory
|
_clrscr:lda SAVMSC ; screen memory
|
||||||
sta ptr1
|
sta ptr1
|
||||||
lda SAVMSC+1
|
lda SAVMSC+1
|
||||||
clc
|
clc
|
||||||
adc #>(40*24)
|
adc #>(SCRSIZE-1)
|
||||||
sta ptr1+1
|
sta ptr1+1
|
||||||
lda #0 ; screen code of space char
|
lda #0 ; screen code of space char
|
||||||
sta OLDCHR
|
sta OLDCHR
|
||||||
ldy #<(40*24) ; 40x24: size of default atari screen
|
ldy #<(SCRSIZE-1)
|
||||||
ldx #>(40*24)
|
ldx #>(SCRSIZE-1)
|
||||||
_clr1: sta (ptr1),y
|
_clr1: sta (ptr1),y
|
||||||
dey
|
dey
|
||||||
bne _clr1
|
bne _clr1
|
||||||
sta (ptr1),y
|
sta (ptr1),y
|
||||||
dex
|
dex
|
||||||
bmi done
|
bmi done
|
||||||
ldy ptr1+1
|
dec ptr1+1
|
||||||
dey
|
dey
|
||||||
sty ptr1+1
|
|
||||||
ldy #255
|
|
||||||
jmp _clr1
|
jmp _clr1
|
||||||
|
|
||||||
done: sta COLCRS
|
done: sta COLCRS
|
||||||
|
@ -11,7 +11,6 @@
|
|||||||
.import fdt_to_fdi
|
.import fdt_to_fdi
|
||||||
.export clriocb
|
.export clriocb
|
||||||
.export fdtoiocb_down
|
.export fdtoiocb_down
|
||||||
.export findfreeiocb
|
|
||||||
.export fddecusage
|
.export fddecusage
|
||||||
.export newfd
|
.export newfd
|
||||||
|
|
||||||
@ -87,31 +86,6 @@ loop: sta ICHID,x
|
|||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
|
|
||||||
; find a free iocb
|
|
||||||
; no entry parameters
|
|
||||||
; return ZF = 0/1 for not found/found
|
|
||||||
; index in X if found
|
|
||||||
; all registers destroyed
|
|
||||||
|
|
||||||
.proc findfreeiocb
|
|
||||||
|
|
||||||
ldx #0
|
|
||||||
ldy #$FF
|
|
||||||
loop: tya
|
|
||||||
cmp ICHID,x
|
|
||||||
beq found
|
|
||||||
txa
|
|
||||||
clc
|
|
||||||
adc #$10
|
|
||||||
tax
|
|
||||||
cmp #$80
|
|
||||||
bcc loop
|
|
||||||
inx ; return ZF cleared
|
|
||||||
found: rts
|
|
||||||
|
|
||||||
.endproc ; findfreeiocb
|
|
||||||
|
|
||||||
|
|
||||||
; decrements usage counter for fd
|
; decrements usage counter for fd
|
||||||
; if 0 reached, it's marked as unused
|
; if 0 reached, it's marked as unused
|
||||||
; get fd index in tmp2
|
; get fd index in tmp2
|
||||||
|
23
libsrc/atari/findfreeiocb.inc
Normal file
23
libsrc/atari/findfreeiocb.inc
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
; find a free iocb
|
||||||
|
; no entry parameters
|
||||||
|
; return ZF = 0/1 for not found/found
|
||||||
|
; index in X if found
|
||||||
|
; all registers destroyed
|
||||||
|
|
||||||
|
.proc findfreeiocb
|
||||||
|
|
||||||
|
ldx #0
|
||||||
|
ldy #$FF
|
||||||
|
loop: tya
|
||||||
|
cmp ICHID,x
|
||||||
|
beq found
|
||||||
|
txa
|
||||||
|
clc
|
||||||
|
adc #$10
|
||||||
|
tax
|
||||||
|
cmp #$80
|
||||||
|
bcc loop
|
||||||
|
inx ; return ZF cleared
|
||||||
|
found: rts
|
||||||
|
|
||||||
|
.endproc ; findfreeiocb
|
7
libsrc/atari/findfreeiocb.s
Normal file
7
libsrc/atari/findfreeiocb.s
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
;
|
||||||
|
; Christian Groessler, June-2013
|
||||||
|
;
|
||||||
|
|
||||||
|
.include "atari.inc"
|
||||||
|
.export findfreeiocb
|
||||||
|
.include "findfreeiocb.inc"
|
@ -11,7 +11,7 @@
|
|||||||
|
|
||||||
jsr findfreeiocb
|
jsr findfreeiocb
|
||||||
bne oserr
|
bne oserr
|
||||||
lda #48
|
lda #GETCWD
|
||||||
sta ICCOM,x
|
sta ICCOM,x
|
||||||
lda #<__cwd
|
lda #<__cwd
|
||||||
sta ICBLL,x
|
sta ICBLL,x
|
||||||
|
@ -68,7 +68,7 @@ iocberr:jsr incsp6
|
|||||||
|
|
||||||
; SEEK_CUR
|
; SEEK_CUR
|
||||||
cur: ldx tmp3
|
cur: ldx tmp3
|
||||||
lda #38 ; NOTE
|
lda #NOTE
|
||||||
sta ICCOM,x
|
sta ICCOM,x
|
||||||
jsr CIOV ; read it
|
jsr CIOV ; read it
|
||||||
bmi xxerr
|
bmi xxerr
|
||||||
@ -84,7 +84,7 @@ l01: lda ICAX3,x ; low byte of position
|
|||||||
|
|
||||||
; SEEK_END
|
; SEEK_END
|
||||||
end: ldx tmp3
|
end: ldx tmp3
|
||||||
lda #39 ; get file size
|
lda #GETFL
|
||||||
sta ICCOM,x
|
sta ICCOM,x
|
||||||
jsr CIOV
|
jsr CIOV
|
||||||
bpl l01
|
bpl l01
|
||||||
@ -126,7 +126,7 @@ ret: jsr incsp6
|
|||||||
.if 0
|
.if 0
|
||||||
; return exactly the position DOS has
|
; return exactly the position DOS has
|
||||||
ldx tmp3
|
ldx tmp3
|
||||||
lda #38 ; NOTE
|
lda #NOTE
|
||||||
sta ICCOM,x
|
sta ICCOM,x
|
||||||
jsr CIOV ; read it
|
jsr CIOV ; read it
|
||||||
bmi xxerr
|
bmi xxerr
|
||||||
@ -168,7 +168,7 @@ seek: jsr ldax0sp ; get lower word of new offset
|
|||||||
sta ICAX4,x
|
sta ICAX4,x
|
||||||
lda ptr4
|
lda ptr4
|
||||||
sta ICAX5,x
|
sta ICAX5,x
|
||||||
lda #37 ;POINT
|
lda #POINT
|
||||||
sta ICCOM,x
|
sta ICCOM,x
|
||||||
jsr CIOV
|
jsr CIOV
|
||||||
bpl ret
|
bpl ret
|
||||||
@ -201,7 +201,7 @@ chk_supp:
|
|||||||
cmp #$40
|
cmp #$40
|
||||||
bcs supp1 ; SD-X (ver 4.xx) supports seeking on all disks
|
bcs supp1 ; SD-X (ver 4.xx) supports seeking on all disks
|
||||||
ldx tmp3 ; iocb to use
|
ldx tmp3 ; iocb to use
|
||||||
lda #39 ; get file size
|
lda #GETFL
|
||||||
sta ICCOM,x
|
sta ICCOM,x
|
||||||
jsr CIOV
|
jsr CIOV
|
||||||
bmi notsupp ; error code ? should be 168 (invalid command)
|
bmi notsupp ; error code ? should be 168 (invalid command)
|
||||||
|
@ -58,9 +58,9 @@ ucok1:
|
|||||||
lda __dos_type
|
lda __dos_type
|
||||||
cmp #SPARTADOS
|
cmp #SPARTADOS
|
||||||
beq :+
|
beq :+
|
||||||
lda #41
|
lda #CHDIR_MYDOS
|
||||||
.byte $2C ; BIT <abs>
|
.byte $2C ; BIT <abs>
|
||||||
: lda #44
|
: lda #CHDIR_SPDOS
|
||||||
sta ICCOM,x
|
sta ICCOM,x
|
||||||
lda #0
|
lda #0
|
||||||
sta ICAX1,x
|
sta ICAX1,x
|
||||||
|
@ -61,7 +61,7 @@ ucok1:
|
|||||||
sta ICBAH,y
|
sta ICBAH,y
|
||||||
tya
|
tya
|
||||||
tax
|
tax
|
||||||
lda #42
|
lda #MKDIR
|
||||||
sta ICCOM,x
|
sta ICCOM,x
|
||||||
lda #8
|
lda #8
|
||||||
sta ICAX1,x
|
sta ICAX1,x
|
||||||
|
@ -47,7 +47,7 @@ static char GetKeyUpdate (void);
|
|||||||
|
|
||||||
|
|
||||||
/* Color definitions */
|
/* Color definitions */
|
||||||
#if defined(__PLUS4__) || defined(__C16__)
|
#if defined(__C16__)
|
||||||
# define COLOR_BORDER (BCOLOR_DARKBLUE | CATTR_LUMA6)
|
# define COLOR_BORDER (BCOLOR_DARKBLUE | CATTR_LUMA6)
|
||||||
# define COLOR_BACKGROUND COLOR_WHITE
|
# define COLOR_BACKGROUND COLOR_WHITE
|
||||||
# define COLOR_TEXTHIGH COLOR_BLACK
|
# define COLOR_TEXTHIGH COLOR_BLACK
|
||||||
@ -63,7 +63,7 @@ static char GetKeyUpdate (void);
|
|||||||
# define COLOR_FRAMEHIGH COLOR_WHITE
|
# define COLOR_FRAMEHIGH COLOR_WHITE
|
||||||
# define COLOR_FRAMELOW COLOR_GRAY3
|
# define COLOR_FRAMELOW COLOR_GRAY3
|
||||||
# else
|
# else
|
||||||
# if defined(__APPLE2__) || defined(__APPLE2ENH__)
|
# if defined(__APPLE2__)
|
||||||
# define COLOR_BORDER COLOR_BLACK
|
# define COLOR_BORDER COLOR_BLACK
|
||||||
# define COLOR_BACKGROUND COLOR_BLACK
|
# define COLOR_BACKGROUND COLOR_BLACK
|
||||||
# define COLOR_TEXTHIGH COLOR_BLACK
|
# define COLOR_TEXTHIGH COLOR_BLACK
|
||||||
@ -93,7 +93,7 @@ static char GetKeyUpdate (void);
|
|||||||
# define MAX_X 80
|
# define MAX_X 80
|
||||||
# define MAX_Y 25
|
# define MAX_Y 25
|
||||||
# define DUMP_BYTES 16
|
# define DUMP_BYTES 16
|
||||||
#elif defined(__APPLE2__) || defined(__APPLE2ENH__) || defined(__ATARI__) || defined(__ATARIXL__)
|
#elif defined(__APPLE2__) || defined(__ATARI__)
|
||||||
# define MAX_X 40
|
# define MAX_X 40
|
||||||
# define MAX_Y 24
|
# define MAX_Y 24
|
||||||
# define DUMP_BYTES 8
|
# define DUMP_BYTES 8
|
||||||
@ -104,7 +104,7 @@ static char GetKeyUpdate (void);
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Replacement key definitions */
|
/* Replacement key definitions */
|
||||||
#if defined(__APPLE2__) || defined(__LYNX__) || defined(__SIM6502__) || defined (__SIM65C02__) || defined(__SUPERVISION__)
|
#ifndef CH_DEL
|
||||||
# define CH_DEL ('H' - 'A' + 1) /* Ctrl+H */
|
# define CH_DEL ('H' - 'A' + 1) /* Ctrl+H */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1 +1 @@
|
|||||||
AFLAGS += -I geos-apple -I geos-common
|
CA65FLAGS += -I geos-apple -I geos-common
|
||||||
|
@ -9,6 +9,6 @@ DEPS += ../wrk/$(TARGET)/convert.d
|
|||||||
@$(MAKE) --no-print-directory apple2enh
|
@$(MAKE) --no-print-directory apple2enh
|
||||||
|
|
||||||
../targetutil/convert.system: ../wrk/$(TARGET)/convert.o ../lib/apple2enh.lib | ../targetutil
|
../targetutil/convert.system: ../wrk/$(TARGET)/convert.o ../lib/apple2enh.lib | ../targetutil
|
||||||
$(LD) -o $@ -C apple2enh-system.cfg $^
|
$(LD65) -o $@ -C apple2enh-system.cfg $^
|
||||||
|
|
||||||
$(TARGET): ../targetutil/convert.system
|
$(TARGET): ../targetutil/convert.system
|
||||||
|
@ -1 +1 @@
|
|||||||
AFLAGS += -I geos-cbm -I geos-common
|
CA65FLAGS += -I geos-cbm -I geos-common
|
||||||
|
@ -22,10 +22,3 @@ tmp2: .res 1
|
|||||||
tmp3: .res 1
|
tmp3: .res 1
|
||||||
tmp4: .res 1
|
tmp4: .res 1
|
||||||
regbank: .res regbanksize ; Register bank
|
regbank: .res regbanksize ; Register bank
|
||||||
|
|
||||||
; Add an empty EXTZP zeropage segment to avoid linker warnings that this
|
|
||||||
; segment does not exist (it does not exist in most builtin linker configs
|
|
||||||
; but is used when linking modules).
|
|
||||||
|
|
||||||
.segment "EXTZP" : zeropage
|
|
||||||
|
|
||||||
|
@ -6,8 +6,6 @@
|
|||||||
|
|
||||||
.export __EXEHDR__ : absolute = 1 ; Linker referenced
|
.export __EXEHDR__ : absolute = 1 ; Linker referenced
|
||||||
|
|
||||||
; ------------------------------------------------------------------------
|
|
||||||
|
|
||||||
.segment "EXEHDR"
|
.segment "EXEHDR"
|
||||||
|
|
||||||
.byte .defined(__SIM65C02__)
|
.byte .defined(__SIM65C02__)
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#define divfp(_a,_b) ((((signed long)_a)<<fpshift)/(_b))
|
#define divfp(_a,_b) ((((signed long)_a)<<fpshift)/(_b))
|
||||||
|
|
||||||
/* Workaround missing clock stuff */
|
/* Workaround missing clock stuff */
|
||||||
#if defined(__APPLE2__) || defined(__APPLE2ENH__)
|
#ifdef __APPLE2__
|
||||||
# define clock() 0
|
# define clock() 0
|
||||||
# define CLK_TCK 1
|
# define CLK_TCK 1
|
||||||
#endif
|
#endif
|
||||||
|
@ -57,7 +57,7 @@ void log (char *msg)
|
|||||||
|
|
||||||
|
|
||||||
/* In a real-world overlay program one would probably not use a #pragma but
|
/* In a real-world overlay program one would probably not use a #pragma but
|
||||||
* rather place the all the code of certain source files into the overlay by
|
* rather place all the code of certain source files into the overlay by
|
||||||
* compiling them with --code-name OVERLAY1.
|
* compiling them with --code-name OVERLAY1.
|
||||||
*/
|
*/
|
||||||
#pragma code-name (push, "OVERLAY1");
|
#pragma code-name (push, "OVERLAY1");
|
||||||
|
@ -33,7 +33,7 @@ void log (char *msg)
|
|||||||
|
|
||||||
|
|
||||||
/* In a real-world overlay program one would probably not use a #pragma but
|
/* In a real-world overlay program one would probably not use a #pragma but
|
||||||
* rather place the all the code of certain source files into the overlay by
|
* rather place all the code of certain source files into the overlay by
|
||||||
* compiling them with --code-name OVERLAY1.
|
* compiling them with --code-name OVERLAY1.
|
||||||
*/
|
*/
|
||||||
#pragma code-name (push, "OVERLAY1");
|
#pragma code-name (push, "OVERLAY1");
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/* Workaround missing clock stuff */
|
/* Workaround missing clock stuff */
|
||||||
#if defined(__APPLE2__) || defined(__APPLE2ENH__)
|
#ifdef __APPLE2__
|
||||||
# define clock() 0
|
# define clock() 0
|
||||||
# define CLOCKS_PER_SEC 1
|
# define CLOCKS_PER_SEC 1
|
||||||
#endif
|
#endif
|
||||||
|
18
src/Makefile
18
src/Makefile
@ -12,11 +12,19 @@ PROGS = ar65 \
|
|||||||
sim65 \
|
sim65 \
|
||||||
sp65
|
sp65
|
||||||
|
|
||||||
CA65_INC := $(abspath ../asminc)
|
ifdef prefix
|
||||||
CC65_INC := $(abspath ../include)
|
CA65_INC = $(prefix)/lib/cc65/asminc
|
||||||
LD65_LIB := $(abspath ../lib)
|
CC65_INC = $(prefix)/lib/cc65/include
|
||||||
LD65_OBJ := $(abspath ../lib)
|
LD65_LIB = $(prefix)/lib/cc65/lib
|
||||||
LD65_CFG := $(abspath ../cfg)
|
LD65_OBJ = $(prefix)/lib/cc65/lib
|
||||||
|
LD65_CFG = $(prefix)/lib/cc65/cfg
|
||||||
|
else
|
||||||
|
CA65_INC := $(abspath ../asminc)
|
||||||
|
CC65_INC := $(abspath ../include)
|
||||||
|
LD65_LIB := $(abspath ../lib)
|
||||||
|
LD65_OBJ := $(abspath ../lib)
|
||||||
|
LD65_CFG := $(abspath ../cfg)
|
||||||
|
endif
|
||||||
|
|
||||||
CFLAGS += -MMD -MP -O -std=c89 -I common \
|
CFLAGS += -MMD -MP -O -std=c89 -I common \
|
||||||
-Wall -Wextra -Wno-char-subscripts -Werror \
|
-Wall -Wextra -Wno-char-subscripts -Werror \
|
||||||
|
@ -209,6 +209,7 @@ static void SetSys (const char* Sys)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TGT_ATARIXL:
|
case TGT_ATARIXL:
|
||||||
|
NewSymbol ("__ATARI__", 1);
|
||||||
NewSymbol ("__ATARIXL__", 1);
|
NewSymbol ("__ATARIXL__", 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -229,7 +230,8 @@ static void SetSys (const char* Sys)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TGT_PLUS4:
|
case TGT_PLUS4:
|
||||||
CBMSystem ("__PLUS4__");
|
CBMSystem ("__C16__");
|
||||||
|
NewSymbol ("__PLUS4__", 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TGT_CBM510:
|
case TGT_CBM510:
|
||||||
@ -253,6 +255,7 @@ static void SetSys (const char* Sys)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TGT_APPLE2ENH:
|
case TGT_APPLE2ENH:
|
||||||
|
NewSymbol ("__APPLE2__", 1);
|
||||||
NewSymbol ("__APPLE2ENH__", 1);
|
NewSymbol ("__APPLE2ENH__", 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -412,7 +412,7 @@ int CE_IsKnownImm (const CodeEntry* E, unsigned long Num)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
int CE_UseLoadFlags (const CodeEntry* E)
|
int CE_UseLoadFlags (CodeEntry* E)
|
||||||
/* Return true if the instruction uses any flags that are set by a load of
|
/* Return true if the instruction uses any flags that are set by a load of
|
||||||
* a register (N and Z).
|
* a register (N and Z).
|
||||||
*/
|
*/
|
||||||
@ -427,7 +427,7 @@ int CE_UseLoadFlags (const CodeEntry* E)
|
|||||||
while (E->Info & OF_UBRA) {
|
while (E->Info & OF_UBRA) {
|
||||||
|
|
||||||
/* Remember the entry so we can detect loops */
|
/* Remember the entry so we can detect loops */
|
||||||
CollAppend (&C, (void*) E);
|
CollAppend (&C, E);
|
||||||
|
|
||||||
/* Check the target */
|
/* Check the target */
|
||||||
if (E->JumpTo == 0 || CollIndex (&C, E->JumpTo->Owner) >= 0) {
|
if (E->JumpTo == 0 || CollIndex (&C, E->JumpTo->Owner) >= 0) {
|
||||||
|
@ -219,7 +219,7 @@ INLINE int CE_IsCallTo (const CodeEntry* E, const char* Name)
|
|||||||
# define CE_IsCallTo(E, Name) ((E)->OPC == OP65_JSR && strcmp ((E)->Arg, (Name)) == 0)
|
# define CE_IsCallTo(E, Name) ((E)->OPC == OP65_JSR && strcmp ((E)->Arg, (Name)) == 0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int CE_UseLoadFlags (const CodeEntry* E);
|
int CE_UseLoadFlags (CodeEntry* E);
|
||||||
/* Return true if the instruction uses any flags that are set by a load of
|
/* Return true if the instruction uses any flags that are set by a load of
|
||||||
* a register (N and Z).
|
* a register (N and Z).
|
||||||
*/
|
*/
|
||||||
|
@ -165,6 +165,7 @@ static void SetSys (const char* Sys)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TGT_ATARIXL:
|
case TGT_ATARIXL:
|
||||||
|
DefineNumericMacro ("__ATARI__", 1);
|
||||||
DefineNumericMacro ("__ATARIXL__", 1);
|
DefineNumericMacro ("__ATARIXL__", 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -185,7 +186,8 @@ static void SetSys (const char* Sys)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TGT_PLUS4:
|
case TGT_PLUS4:
|
||||||
cbmsys ("__PLUS4__");
|
cbmsys ("__C16__");
|
||||||
|
DefineNumericMacro ("__PLUS4__", 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TGT_CBM510:
|
case TGT_CBM510:
|
||||||
@ -209,6 +211,7 @@ static void SetSys (const char* Sys)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case TGT_APPLE2ENH:
|
case TGT_APPLE2ENH:
|
||||||
|
DefineNumericMacro ("__APPLE2__", 1);
|
||||||
DefineNumericMacro ("__APPLE2ENH__", 1);
|
DefineNumericMacro ("__APPLE2ENH__", 1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -16,10 +16,10 @@
|
|||||||
#define DRIVERNAME "cbm510-ram.emd"
|
#define DRIVERNAME "cbm510-ram.emd"
|
||||||
#elif defined(__CBM610__)
|
#elif defined(__CBM610__)
|
||||||
#define DRIVERNAME "cbm610-ram.emd"
|
#define DRIVERNAME "cbm610-ram.emd"
|
||||||
#elif defined(__APPLE2__)
|
|
||||||
#define DRIVERNAME "a2.auxmem.emd"
|
|
||||||
#elif defined(__APPLE2ENH__)
|
#elif defined(__APPLE2ENH__)
|
||||||
#define DRIVERNAME "a2e.auxmem.emd"
|
#define DRIVERNAME "a2e.auxmem.emd"
|
||||||
|
#elif defined(__APPLE2__)
|
||||||
|
#define DRIVERNAME "a2.auxmem.emd"
|
||||||
#else
|
#else
|
||||||
#define DRIVERNAME "unknown"
|
#define DRIVERNAME "unknown"
|
||||||
#error "Unknown target system"
|
#error "Unknown target system"
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
extern int getsp(void); /* is provided in getsp.s */
|
extern int getsp(void); /* is provided in getsp.s */
|
||||||
|
|
||||||
/* Atari's fd indirection table */
|
/* Atari's fd indirection table */
|
||||||
#if defined(__ATARI__) || defined(__ATARIXL__)
|
#ifdef __ATARI__
|
||||||
extern char __fd_index[];
|
extern char __fd_index[];
|
||||||
struct fd_t {
|
struct fd_t {
|
||||||
char usage;
|
char usage;
|
||||||
@ -74,7 +74,7 @@ int main(int argc,char **argv)
|
|||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
printf("open success -- handle = $%x, sp = %d\n",fd,csp);
|
printf("open success -- handle = $%x, sp = %d\n",fd,csp);
|
||||||
#if defined(__ATARI__) || defined(__ATARIXL__)
|
#ifdef __ATARI__
|
||||||
printf("fd_index:\n ");
|
printf("fd_index:\n ");
|
||||||
for (i=0; i<12; i++) printf("%02X ",__fd_index[i]);
|
for (i=0; i<12; i++) printf("%02X ",__fd_index[i]);
|
||||||
printf("\nfd_table:\n");
|
printf("\nfd_table:\n");
|
||||||
|
@ -18,7 +18,7 @@ static const unsigned char small_bar[8] = {
|
|||||||
' ', 0xa5, 0xb4, 0xb5, 0xa1, 0xb6, 0xaa, 0xa7
|
' ', 0xa5, 0xb4, 0xb5, 0xa1, 0xb6, 0xaa, 0xa7
|
||||||
};
|
};
|
||||||
|
|
||||||
#elif defined(__ATARI__) || defined(__ATARIXL__)
|
#elif defined(__ATARI__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Screen co-ordinates for the progress meter */
|
/* Screen co-ordinates for the progress meter */
|
||||||
@ -39,7 +39,7 @@ static void ProgressMeter (unsigned Val)
|
|||||||
revers (revers_bar[Val]);
|
revers (revers_bar[Val]);
|
||||||
cputc (small_bar[Val]);
|
cputc (small_bar[Val]);
|
||||||
|
|
||||||
#elif defined(__ATARI__) || defined(__ATARIXL__)
|
#elif defined(__ATARI__)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
revers (0);
|
revers (0);
|
||||||
|
@ -13,10 +13,10 @@
|
|||||||
#define DRIVERNAME "plus4-stdser.ser"
|
#define DRIVERNAME "plus4-stdser.ser"
|
||||||
#elif defined(__CBM610__)
|
#elif defined(__CBM610__)
|
||||||
#define DRIVERNAME "cbm610-std.ser"
|
#define DRIVERNAME "cbm610-std.ser"
|
||||||
#elif defined(__APPLE2__)
|
|
||||||
#define DRIVERNAME "a2.ssc.ser"
|
|
||||||
#elif defined(__APPLE2ENH__)
|
#elif defined(__APPLE2ENH__)
|
||||||
#define DRIVERNAME "a2e.ssc.ser"
|
#define DRIVERNAME "a2e.ssc.ser"
|
||||||
|
#elif defined(__APPLE2__)
|
||||||
|
#define DRIVERNAME "a2.ssc.ser"
|
||||||
#else
|
#else
|
||||||
#define DRIVERNAME "unknown"
|
#define DRIVERNAME "unknown"
|
||||||
#error "Unknown target system"
|
#error "Unknown target system"
|
||||||
|
Loading…
Reference in New Issue
Block a user