mirror of
https://github.com/cc65/cc65.git
synced 2025-04-06 20:37:16 +00:00
Merge remote-tracking branch 'upstream/master' into cassette
Conflicts: asminc/atari.inc libsrc/atari/mou/atrst.s
This commit is contained in:
commit
3bd5d3f88b
4
Makefile
4
Makefile
@ -1,4 +1,4 @@
|
||||
all mostlyclean clean:
|
||||
all mostlyclean clean install:
|
||||
@$(MAKE) -C src --no-print-directory $@
|
||||
@$(MAKE) -C libsrc --no-print-directory $@
|
||||
|
||||
@ -14,6 +14,6 @@ lib:
|
||||
%:
|
||||
@$(MAKE) -C libsrc --no-print-directory $@
|
||||
|
||||
.PHONY: all mostlyclean clean avail unavail bin lib
|
||||
.PHONY: all mostlyclean clean install avail unavail bin lib
|
||||
|
||||
.SUFFIXES:
|
||||
|
@ -318,7 +318,7 @@ APPMHI = $0E ;APPLICATIONS MEMORY HI LIMIT
|
||||
|
||||
INTZBS = $10 ;INTERRUPT HANDLER
|
||||
|
||||
POKMSK = $10 ;SYSTEM MASK FOR POKEY IRQ ENABLE
|
||||
POKMSK = $10 ;SYSTEM MASK FOR POKEY IRQ ENABLE (shadow of IRQEN)
|
||||
BRKKEY = $11 ;BREAK KEY FLAG
|
||||
RTCLOK = $12 ;REAL TIME CLOCK (IN 16 MSEC UNITS>
|
||||
BUFADR = $15 ;INDIRECT BUFFER ADDRESS REGISTER
|
||||
|
@ -8,13 +8,15 @@ SYMBOLS {
|
||||
__LOADSIZE__: type = weak, value = __BSS_RUN__ - __CODE_RUN__;
|
||||
}
|
||||
MEMORY {
|
||||
ZP: start = $0080, size = $001A, define = yes;
|
||||
HEADER: file = %O, start = $0000, size = $0004;
|
||||
RAM: file = %O, start = %S, size = $C000 - %S;
|
||||
}
|
||||
SEGMENTS {
|
||||
EXEHDR: load = HEADER, type = ro, optional = yes;
|
||||
CODE: load = RAM, type = rw, optional = yes, define = yes;
|
||||
RODATA: load = RAM, type = ro, optional = yes;
|
||||
DATA: load = RAM, type = rw, optional = yes;
|
||||
BSS: load = RAM, type = bss, optional = yes, define = yes;
|
||||
ZEROPAGE: load = ZP, type = zp, optional = yes;
|
||||
EXEHDR: load = HEADER, type = ro, optional = yes;
|
||||
CODE: load = RAM, type = rw, optional = yes, define = yes;
|
||||
RODATA: load = RAM, type = ro, optional = yes;
|
||||
DATA: load = RAM, type = rw, optional = yes;
|
||||
BSS: load = RAM, type = bss, optional = yes, define = yes;
|
||||
}
|
||||
|
@ -24,6 +24,7 @@ SEGMENTS {
|
||||
RODATA: load = RAM, type = ro optional = yes;
|
||||
DATA: load = RAM, type = rw optional = yes;
|
||||
BSS: load = RAM, type = bss, define = yes, optional = yes;
|
||||
ZEROPAGE: load = ZP, type = zp;
|
||||
ZEROPAGE: load = ZP, type = zp, optional = yes;
|
||||
EXTZP: load = ZP, type = zp, optional = yes; # to enable modules to be able to link to C and assembler programs
|
||||
AUTOSTRT: load = TRAILER, type = ro, optional = yes;
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ SEGMENTS {
|
||||
DATA: load = ROM, run = RAM, type = rw, define = yes, optional = yes;
|
||||
BSS: load = RAM, type = bss, define = yes, optional = yes;
|
||||
CARTHDR: load = CARTID, type = ro;
|
||||
ZEROPAGE: load = ZP, type = zp;
|
||||
ZEROPAGE: load = ZP, type = zp, optional = yes;
|
||||
EXTZP: load = ZP, type = zp, optional = yes;
|
||||
}
|
||||
FEATURES {
|
||||
|
@ -5,6 +5,7 @@ SYMBOLS {
|
||||
__LOADADDR__: type = import;
|
||||
}
|
||||
MEMORY {
|
||||
ZP: file = "", start = $0002, size = $001A, define = yes;
|
||||
LOADADDR: file = %O, start = %S - 2, size = $0002;
|
||||
RAM: file = %O, start = %S, size = $D000 - %S;
|
||||
}
|
||||
@ -15,4 +16,5 @@ SEGMENTS {
|
||||
RODATA: load = RAM, type = ro, optional = yes;
|
||||
DATA: load = RAM, type = rw, optional = yes;
|
||||
BSS: load = RAM, type = bss, optional = yes;
|
||||
ZEROPAGE: load = ZP, type = zp, optional = yes;
|
||||
}
|
||||
|
@ -169,9 +169,16 @@ extern char *_getdefdev(void); /* get default floppy device */
|
||||
|
||||
/* global variables */
|
||||
extern unsigned char _dos_type; /* the DOS flavour */
|
||||
#ifndef __ATARIXL__
|
||||
extern void atr130_emd[];
|
||||
extern void atrstd_joy[]; /* referred to by joy_static_stddrv[] */
|
||||
extern void atrmj8_joy[];
|
||||
extern void atrjoy_mou[];
|
||||
extern void atrst_mou[]; /* referred to by mouse_static_stddrv[] */
|
||||
extern void atrami_mou[];
|
||||
extern void atrtrk_mou[];
|
||||
extern void atrtt_mou[];
|
||||
extern void atrrdev_ser[];
|
||||
extern void atr3_tgi[];
|
||||
extern void atr4_tgi[];
|
||||
extern void atr5_tgi[];
|
||||
@ -187,6 +194,32 @@ extern void atr11_tgi[];
|
||||
extern void atr14_tgi[];
|
||||
extern void atr15_tgi[];
|
||||
extern void atr15p2_tgi[];
|
||||
#else
|
||||
extern void atrx130_emd[];
|
||||
extern void atrxstd_joy[]; /* referred to by joy_static_stddrv[] */
|
||||
extern void atrxmj8_joy[];
|
||||
extern void atrxjoy_mou[];
|
||||
extern void atrxst_mou[]; /* referred to by mouse_static_stddrv[] */
|
||||
extern void atrxami_mou[];
|
||||
extern void atrxtrk_mou[];
|
||||
extern void atrxtt_mou[];
|
||||
extern void atrxrdev_ser[];
|
||||
extern void atrx3_tgi[];
|
||||
extern void atrx4_tgi[];
|
||||
extern void atrx5_tgi[];
|
||||
extern void atrx6_tgi[];
|
||||
extern void atrx7_tgi[];
|
||||
extern void atrx8_tgi[]; /* referred to by tgi_static_stddrv[] */
|
||||
extern void atrx8p2_tgi[];
|
||||
extern void atrx9_tgi[];
|
||||
extern void atrx9p2_tgi[];
|
||||
extern void atrx10_tgi[];
|
||||
extern void atrx10p2_tgi[];
|
||||
extern void atrx11_tgi[];
|
||||
extern void atrx14_tgi[];
|
||||
extern void atrx15_tgi[];
|
||||
extern void atrx15p2_tgi[];
|
||||
#endif
|
||||
|
||||
/* provide old names for backwards compatibility */
|
||||
#ifdef ATARI_COMPAT_PRE_2_11
|
||||
|
@ -50,10 +50,18 @@ endif
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
.PHONY: all lib $(TARGETS) mostlyclean clean
|
||||
.PHONY: all lib $(TARGETS) mostlyclean clean install
|
||||
|
||||
ifndef TARGET
|
||||
|
||||
datadir = $(prefix)/share/cc65
|
||||
|
||||
INSTALLDIRS = ../asminc ../cfg ../include \
|
||||
$(filter-out $(wildcard ../include/*.*),$(wildcard ../include/*)) \
|
||||
../lib ../targetutil $(addprefix ../,$(DRVTYPES))
|
||||
|
||||
INSTALL = install
|
||||
|
||||
all lib: $(TARGETS)
|
||||
|
||||
$(TARGETS):
|
||||
@ -65,6 +73,21 @@ mostlyclean:
|
||||
clean:
|
||||
$(call RMDIR,../wrk ../lib ../targetutil $(addprefix ../,$(DRVTYPES)))
|
||||
|
||||
install:
|
||||
$(foreach dir,$(INSTALLDIRS),$(INSTALL_recipe))
|
||||
|
||||
##########
|
||||
|
||||
define INSTALL_recipe
|
||||
|
||||
$(if $(prefix),,$(error variable `prefix' must be set))
|
||||
$(INSTALL) -d $(subst ..,$(DESTDIR)$(datadir),$(dir))
|
||||
$(INSTALL) -m644 $(dir)/* $(subst ..,$(DESTDIR)$(datadir),$(dir))
|
||||
|
||||
endef
|
||||
|
||||
##########
|
||||
|
||||
else # TARGET
|
||||
|
||||
CA65FLAGS =
|
||||
|
@ -107,7 +107,7 @@ exit: ldx #$02
|
||||
txs ; Re-init stack pointer
|
||||
|
||||
; We're done
|
||||
jmp (done)
|
||||
jmp done
|
||||
|
||||
.segment "INIT"
|
||||
|
||||
@ -148,8 +148,8 @@ init: ldx #zpspace-1
|
||||
; No BASIC.SYSTEM so quit to ProDOS dispatcher instead
|
||||
lda #<quit
|
||||
ldx #>quit
|
||||
sta done
|
||||
stx done+1
|
||||
sta done+1
|
||||
stx done+2
|
||||
|
||||
; No BASIC.SYSTEM so use addr of ProDOS system global page
|
||||
lda #<$BF00
|
||||
@ -202,8 +202,8 @@ q_param:.byte $04 ; param_count
|
||||
|
||||
.data
|
||||
|
||||
; Location to jump to when we're done
|
||||
done: .addr DOSWARM
|
||||
; Final jump when we're done
|
||||
done: jmp DOSWARM ; Potentially patched at runtime
|
||||
|
||||
.segment "ZPSAVE"
|
||||
|
||||
|
@ -161,8 +161,8 @@ setbuf: lda #$00 ; Low byte
|
||||
; Call loader stub after C libary shutdown
|
||||
lda #<target
|
||||
ldx #>target
|
||||
sta done
|
||||
stx done+1
|
||||
sta done+1
|
||||
stx done+2
|
||||
|
||||
; Initiate C libary shutdown
|
||||
jmp _exit
|
||||
|
@ -16,6 +16,6 @@ initreboot:
|
||||
; Quit to PWRUP
|
||||
lda #<$FAA6
|
||||
ldx #>$FAA6
|
||||
sta done
|
||||
stx done+1
|
||||
sta done+1
|
||||
stx done+2
|
||||
rts
|
||||
|
@ -7,8 +7,16 @@
|
||||
;
|
||||
|
||||
.export _joy_static_stddrv
|
||||
.ifdef __ATARIXL__
|
||||
.import _atrxstd_joy
|
||||
.else
|
||||
.import _atrstd_joy
|
||||
.endif
|
||||
|
||||
.rodata
|
||||
|
||||
.ifdef __ATARIXL__
|
||||
_joy_static_stddrv := _atrxstd_joy
|
||||
.else
|
||||
_joy_static_stddrv := _atrstd_joy
|
||||
.endif
|
||||
|
@ -10,4 +10,9 @@
|
||||
|
||||
.rodata
|
||||
|
||||
_joy_stddrv: .asciiz "atrstd.joy"
|
||||
_joy_stddrv:
|
||||
.ifdef __ATARIXL__
|
||||
.asciiz "atrxstd.joy"
|
||||
.else
|
||||
.asciiz "atrstd.joy"
|
||||
.endif
|
||||
|
@ -446,6 +446,14 @@ IOCTL: lda #<MOUSE_ERR_INV_IOCTL ; We don't support ioclts for now
|
||||
|
||||
IRQ:
|
||||
|
||||
; Turn mouse polling IRQ back on in case it disabled itself due to CRITIC
|
||||
; flag being set.
|
||||
|
||||
lda POKMSK
|
||||
ora #%00000001 ; timer 1 enable
|
||||
sta POKMSK
|
||||
sta IRQEN
|
||||
|
||||
; Check for a pressed button and place the result into Buttons
|
||||
|
||||
ldx #0
|
||||
@ -514,7 +522,12 @@ IRQ:
|
||||
; T1Han: Local IRQ routine to poll mouse
|
||||
;
|
||||
|
||||
T1Han: tya
|
||||
T1Han: lda CRITIC ; if CRITIC flag is set, disable the
|
||||
bne disable_me ; high frequency polling IRQ, in order
|
||||
; not to interfere with SIO I/O (e.g.
|
||||
; floppy access)
|
||||
|
||||
tya
|
||||
pha
|
||||
txa
|
||||
pha
|
||||
@ -695,3 +708,22 @@ mmexit: sty oldval
|
||||
pla
|
||||
rti
|
||||
.endif
|
||||
|
||||
|
||||
; Disable the interrupt source which caused us to be called.
|
||||
; The interrupt will be enabled again by the "IRQ" routine.
|
||||
; The "IRQ" routine, despite its name, is called from the
|
||||
; vertical blank NMI interrupt *only* if the CRITIC flag has
|
||||
; been cleared.
|
||||
|
||||
disable_me:
|
||||
lda POKMSK
|
||||
and #%11111110 ; timer 1 disable
|
||||
sta IRQEN
|
||||
sta POKMSK
|
||||
.ifdef __ATARIXL__
|
||||
rts
|
||||
.else
|
||||
pla
|
||||
rti
|
||||
.endif
|
||||
|
@ -7,8 +7,16 @@
|
||||
;
|
||||
|
||||
.export _tgi_static_stddrv
|
||||
.ifdef __ATARIXL__
|
||||
.import _atrx8_tgi
|
||||
.else
|
||||
.import _atr8_tgi
|
||||
.endif
|
||||
|
||||
.rodata
|
||||
|
||||
.ifdef __ATARIXL__
|
||||
_tgi_static_stddrv := _atrx8_tgi
|
||||
.else
|
||||
_tgi_static_stddrv := _atr8_tgi
|
||||
.endif
|
||||
|
@ -10,4 +10,9 @@
|
||||
|
||||
.rodata
|
||||
|
||||
_tgi_stddrv: .asciiz "atr8.tgi"
|
||||
_tgi_stddrv:
|
||||
.ifdef __ATARIXL__
|
||||
.asciiz "atrx8.tgi"
|
||||
.else
|
||||
.asciiz "atr8.tgi"
|
||||
.endif
|
||||
|
30
src/Makefile
30
src/Makefile
@ -12,19 +12,14 @@ PROGS = ar65 \
|
||||
sim65 \
|
||||
sp65
|
||||
|
||||
ifdef prefix
|
||||
CA65_INC = $(prefix)/lib/cc65/asminc
|
||||
CC65_INC = $(prefix)/lib/cc65/include
|
||||
LD65_LIB = $(prefix)/lib/cc65/lib
|
||||
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
|
||||
bindir := $(prefix)/bin
|
||||
datadir := $(if $(prefix),$(prefix)/share/cc65,$(abspath ..))
|
||||
|
||||
CA65_INC = $(datadir)/asminc
|
||||
CC65_INC = $(datadir)/include
|
||||
LD65_LIB = $(datadir)/lib
|
||||
LD65_OBJ = $(datadir)/lib
|
||||
LD65_CFG = $(datadir)/cfg
|
||||
|
||||
CFLAGS += -MMD -MP -O -std=c89 -I common \
|
||||
-Wall -Wextra -Wno-char-subscripts -Werror $(USER_CFLAGS) \
|
||||
@ -33,9 +28,11 @@ CFLAGS += -MMD -MP -O -std=c89 -I common \
|
||||
|
||||
LDLIBS += -lm
|
||||
|
||||
INSTALL = install
|
||||
|
||||
.SUFFIXES:
|
||||
|
||||
.PHONY: all bin $(PROGS) mostlyclean clean avail unavail
|
||||
.PHONY: all bin $(PROGS) mostlyclean clean install avail unavail
|
||||
|
||||
all bin: $(PROGS)
|
||||
|
||||
@ -45,6 +42,11 @@ mostlyclean:
|
||||
clean:
|
||||
$(RM) -r ../wrk ../bin
|
||||
|
||||
install:
|
||||
$(if $(prefix),,$(error variable `prefix' must be set))
|
||||
$(INSTALL) -d $(DESTDIR)$(bindir)
|
||||
$(INSTALL) ../bin/* $(DESTDIR)$(bindir)
|
||||
|
||||
avail:
|
||||
$(foreach prog,$(PROGS),$(AVAIL_recipe))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user