Merge branch 'master' into lightpen

This commit is contained in:
Greg King
2013-07-01 09:25:02 -04:00
40 changed files with 151 additions and 136 deletions

View File

@@ -67,7 +67,8 @@ clean:
else # TARGET
CFLAGS += -Osir -W error
CA65FLAGS =
CC65FLAGS = -Osir -W error
EXTZP = cbm510 \
cbm610 \
@@ -178,7 +179,7 @@ $$($1_OBJS): | $$($1_OBJDIR)
$$($1_DRVPAT): $$($1_OBJPAT) $$(ZPOBJ) | $$($1_DRVDIR)
@echo $$(TARGET) - $$(@F)
@$$(LD) -o $$@ -t module $$^
@$$(LD65) -o $$@ -t module $$^
$$($1_OBJDIR) $$($1_DRVDIR):
@$$(call MKDIR,$$@)
@@ -187,8 +188,8 @@ $(TARGET): $$($1_DRVS)
$$($1_STCPAT): $$($1_DRVPAT)
@echo $$(TARGET) - $$(<F)
@$$(CO) -o $$(@:.o=.s) --code-label _$$(subst -,_,$$(subst .,_,$$(<F))) $$<
@$$(CA) -t $$(TARGET) -o $$@ $$(@:.o=.s)
@$$(CO65) -o $$(@:.o=.s) --code-label _$$(subst -,_,$$(subst .,_,$$(<F))) $$<
@$$(CA65) -t $$(TARGET) -o $$@ $$(@:.o=.s)
OBJS += $$($1_STCS)
@@ -200,11 +201,11 @@ endef
$(foreach drvtype,$(DRVTYPES),$(eval $(call DRVTYPE_template,$(drvtype))))
AR := $(if $(wildcard ../bin/ar65*),../bin/ar65,ar65)
CA := $(if $(wildcard ../bin/ca65*),../bin/ca65,ca65)
CC := $(if $(wildcard ../bin/cc65*),../bin/cc65,cc65)
CO := $(if $(wildcard ../bin/co65*),../bin/co65,co65)
LD := $(if $(wildcard ../bin/ld65*),../bin/ld65,ld65)
AR65 := $(if $(wildcard ../bin/ar65*),../bin/ar65,ar65)
CA65 := $(if $(wildcard ../bin/ca65*),../bin/ca65,ca65)
CC65 := $(if $(wildcard ../bin/cc65*),../bin/cc65,cc65)
CO65 := $(if $(wildcard ../bin/co65*),../bin/co65,co65)
LD65 := $(if $(wildcard ../bin/ld65*),../bin/ld65,ld65)
export CC65_HOME := $(abspath ..)
@@ -213,7 +214,7 @@ export CC65_HOME := $(abspath ..)
define ASSEMBLE_recipe
$(if $(TRAVIS),,@echo $(TARGET) - $<)
@$(CA) -t $(TARGET) $(AFLAGS) --create-dep $(@:.o=.d) -o $@ $<
@$(CA65) -t $(TARGET) $(CA65FLAGS) --create-dep $(@:.o=.d) -o $@ $<
endef
@@ -222,8 +223,8 @@ endef
define COMPILE_recipe
$(if $(TRAVIS),,@echo $(TARGET) - $<)
@$(CC) -t $(TARGET) $(CFLAGS) --create-dep $(@:.o=.d) --dep-target $@ -o $(@:.o=.s) $<
@$(CA) -t $(TARGET) -o $@ $(@:.o=.s)
@$(CC65) -t $(TARGET) $(CC65FLAGS) --create-dep $(@:.o=.d) --dep-target $@ -o $(@:.o=.s) $<
@$(CA65) -t $(TARGET) -o $@ $(@:.o=.s)
endef
@@ -237,10 +238,10 @@ endef
$(EXTRA_OBJPAT): $(EXTRA_SRCPAT) | ../lib
@echo $(TARGET) - $(@F)
@$(CA) -t $(TARGET) $(AFLAGS) -o $@ $<
@$(CA65) -t $(TARGET) $(CA65FLAGS) -o $@ $<
../lib/$(TARGET).lib: $(OBJS) | ../lib
$(AR) a $@ $?
$(AR65) a $@ $?
../wrk/$(TARGET) ../lib ../targetutil:
@$(call MKDIR,$@)

View File

@@ -4,6 +4,6 @@ DEPS += ../wrk/$(TARGET)/loader.d
$(ASSEMBLE_recipe)
../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

View File

@@ -13,4 +13,4 @@
# DYNAMIC_DD - determine default disk device at runtime (SpartaDOS only)
# 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

View File

@@ -9,26 +9,26 @@
.importzp ptr1
.import setcursor
SCRSIZE = 960 ; 40x24: size of default atari screen
_clrscr:lda SAVMSC ; screen memory
sta ptr1
lda SAVMSC+1
clc
adc #>(40*24)
adc #>(SCRSIZE-1)
sta ptr1+1
lda #0 ; screen code of space char
sta OLDCHR
ldy #<(40*24) ; 40x24: size of default atari screen
ldx #>(40*24)
ldy #<(SCRSIZE-1)
ldx #>(SCRSIZE-1)
_clr1: sta (ptr1),y
dey
bne _clr1
sta (ptr1),y
dex
bmi done
ldy ptr1+1
dec ptr1+1
dey
sty ptr1+1
ldy #255
jmp _clr1
done: sta COLCRS

View File

@@ -11,7 +11,6 @@
.import fdt_to_fdi
.export clriocb
.export fdtoiocb_down
.export findfreeiocb
.export fddecusage
.export newfd
@@ -87,31 +86,6 @@ loop: sta ICHID,x
.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
; if 0 reached, it's marked as unused
; get fd index in tmp2

View 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

View File

@@ -0,0 +1,7 @@
;
; Christian Groessler, June-2013
;
.include "atari.inc"
.export findfreeiocb
.include "findfreeiocb.inc"

View File

@@ -11,7 +11,7 @@
jsr findfreeiocb
bne oserr
lda #48
lda #GETCWD
sta ICCOM,x
lda #<__cwd
sta ICBLL,x

View File

@@ -68,7 +68,7 @@ iocberr:jsr incsp6
; SEEK_CUR
cur: ldx tmp3
lda #38 ; NOTE
lda #NOTE
sta ICCOM,x
jsr CIOV ; read it
bmi xxerr
@@ -84,7 +84,7 @@ l01: lda ICAX3,x ; low byte of position
; SEEK_END
end: ldx tmp3
lda #39 ; get file size
lda #GETFL
sta ICCOM,x
jsr CIOV
bpl l01
@@ -126,7 +126,7 @@ ret: jsr incsp6
.if 0
; return exactly the position DOS has
ldx tmp3
lda #38 ; NOTE
lda #NOTE
sta ICCOM,x
jsr CIOV ; read it
bmi xxerr
@@ -168,7 +168,7 @@ seek: jsr ldax0sp ; get lower word of new offset
sta ICAX4,x
lda ptr4
sta ICAX5,x
lda #37 ;POINT
lda #POINT
sta ICCOM,x
jsr CIOV
bpl ret
@@ -201,7 +201,7 @@ chk_supp:
cmp #$40
bcs supp1 ; SD-X (ver 4.xx) supports seeking on all disks
ldx tmp3 ; iocb to use
lda #39 ; get file size
lda #GETFL
sta ICCOM,x
jsr CIOV
bmi notsupp ; error code ? should be 168 (invalid command)

View File

@@ -58,9 +58,9 @@ ucok1:
lda __dos_type
cmp #SPARTADOS
beq :+
lda #41
lda #CHDIR_MYDOS
.byte $2C ; BIT <abs>
: lda #44
: lda #CHDIR_SPDOS
sta ICCOM,x
lda #0
sta ICAX1,x

View File

@@ -61,7 +61,7 @@ ucok1:
sta ICBAH,y
tya
tax
lda #42
lda #MKDIR
sta ICCOM,x
lda #8
sta ICAX1,x

View File

@@ -47,7 +47,7 @@ static char GetKeyUpdate (void);
/* Color definitions */
#if defined(__PLUS4__) || defined(__C16__)
#if defined(__C16__)
# define COLOR_BORDER (BCOLOR_DARKBLUE | CATTR_LUMA6)
# define COLOR_BACKGROUND COLOR_WHITE
# define COLOR_TEXTHIGH COLOR_BLACK
@@ -63,7 +63,7 @@ static char GetKeyUpdate (void);
# define COLOR_FRAMEHIGH COLOR_WHITE
# define COLOR_FRAMELOW COLOR_GRAY3
# else
# if defined(__APPLE2__) || defined(__APPLE2ENH__)
# if defined(__APPLE2__)
# define COLOR_BORDER COLOR_BLACK
# define COLOR_BACKGROUND COLOR_BLACK
# define COLOR_TEXTHIGH COLOR_BLACK
@@ -93,7 +93,7 @@ static char GetKeyUpdate (void);
# define MAX_X 80
# define MAX_Y 25
# define DUMP_BYTES 16
#elif defined(__APPLE2__) || defined(__APPLE2ENH__) || defined(__ATARI__) || defined(__ATARIXL__)
#elif defined(__APPLE2__) || defined(__ATARI__)
# define MAX_X 40
# define MAX_Y 24
# define DUMP_BYTES 8
@@ -104,7 +104,7 @@ static char GetKeyUpdate (void);
#endif
/* 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 */
#endif

View File

@@ -1 +1 @@
AFLAGS += -I geos-apple -I geos-common
CA65FLAGS += -I geos-apple -I geos-common

View File

@@ -9,6 +9,6 @@ DEPS += ../wrk/$(TARGET)/convert.d
@$(MAKE) --no-print-directory apple2enh
../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

View File

@@ -1 +1 @@
AFLAGS += -I geos-cbm -I geos-common
CA65FLAGS += -I geos-cbm -I geos-common

View File

@@ -22,10 +22,3 @@ tmp2: .res 1
tmp3: .res 1
tmp4: .res 1
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

View File

@@ -6,8 +6,6 @@
.export __EXEHDR__ : absolute = 1 ; Linker referenced
; ------------------------------------------------------------------------
.segment "EXEHDR"
.byte .defined(__SIM65C02__)