Removed initialization code to set the screen size and replaced it by a
separate module that contains a module constructor. In some cases, the code was even unnecessary, since the screen size is known in advance. git-svn-id: svn://svn.cc65.org/cc65/trunk@476 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -13,12 +13,26 @@
|
|||||||
|
|
||||||
C_OBJS =
|
C_OBJS =
|
||||||
|
|
||||||
S_OBJS = break.o clrscr.o cclear.o cgetc.o chline.o color.o \
|
S_OBJS= _scrsize.o \
|
||||||
cputc.o crt0.o ctype.o \
|
break.o \
|
||||||
cvline.o kbhit.o read.o revers.o where.o write.o
|
cclear.o \
|
||||||
|
cgetc.o \
|
||||||
|
chline.o \
|
||||||
|
clrscr.o \
|
||||||
|
color.o \
|
||||||
|
cputc.o \
|
||||||
|
crt0.o \
|
||||||
|
ctype.o \
|
||||||
|
cvline.o \
|
||||||
|
kbhit.o \
|
||||||
|
read.o \
|
||||||
|
revers.o \
|
||||||
|
where.o \
|
||||||
|
write.o
|
||||||
|
|
||||||
all: $(C_OBJS) $(S_OBJS)
|
all: $(C_OBJS) $(S_OBJS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -f $(C_OBJS:.c=.s) $(C_OBJS) $(S_OBJS) crt0.o
|
@rm -f $(C_OBJS:.c=.s) $(C_OBJS) $(S_OBJS) crt0.o
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
|
|
||||||
.export xsize, ysize
|
.export xsize, ysize
|
||||||
|
|
||||||
.bss
|
.rodata
|
||||||
|
|
||||||
xsize: .res 1
|
xsize: .byte 40
|
||||||
ysize: .res 1
|
ysize: .byte 24
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -16,7 +16,7 @@ ATARIDEFS = -DNUMDRVS=4
|
|||||||
|
|
||||||
C_OBJS =
|
C_OBJS =
|
||||||
|
|
||||||
S_OBJS = crt0.o kbhit.o conio.o clrscr.o cputc.o ctype.o chline.o cvline.o \
|
S_OBJS = crt0.o _scrsize.o kbhit.o clrscr.o cputc.o ctype.o chline.o cvline.o \
|
||||||
color.o gotoxy.o cclear.o revers.o readjoy.o break.o where.o write.o \
|
color.o gotoxy.o cclear.o revers.o readjoy.o break.o where.o write.o \
|
||||||
gotox.o gotoy.o savevec.o rwcommon.o cgetc.o read.o getargs.o close.o \
|
gotox.o gotoy.o savevec.o rwcommon.o cgetc.o read.o getargs.o close.o \
|
||||||
open.o oserror.o fdtable.o setcolor.o scroll.o mul40.o graphuse.o \
|
open.o oserror.o fdtable.o setcolor.o scroll.o mul40.o graphuse.o \
|
||||||
|
|||||||
15
libsrc/atari/_scrsize.s
Normal file
15
libsrc/atari/_scrsize.s
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
;
|
||||||
|
; Ullrich von Bassewitz, 26.10.2000
|
||||||
|
;
|
||||||
|
; Screen size variables
|
||||||
|
;
|
||||||
|
|
||||||
|
.export xsize, ysize
|
||||||
|
|
||||||
|
.rodata
|
||||||
|
|
||||||
|
xsize: .byte 40
|
||||||
|
ysize: .byte 24
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
;
|
|
||||||
; Christian Groessler
|
|
||||||
;
|
|
||||||
; Low level stuff for screen output/console input
|
|
||||||
;
|
|
||||||
|
|
||||||
.export initconio
|
|
||||||
.import xsize, ysize, plot
|
|
||||||
|
|
||||||
.include "atari.inc"
|
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
initconio:
|
|
||||||
ldx #40
|
|
||||||
ldy #24
|
|
||||||
stx xsize
|
|
||||||
sty ysize
|
|
||||||
rts
|
|
||||||
|
|
||||||
@@ -15,9 +15,9 @@ RESERVE_MOUSE_MEMORY = 1 ; for P/M
|
|||||||
.export mouse_pm0
|
.export mouse_pm0
|
||||||
.endif
|
.endif
|
||||||
.export _exit
|
.export _exit
|
||||||
.import getargs, argc, argv
|
.import getargs, argc, argv
|
||||||
.import initlib, donelib
|
.import initlib, donelib
|
||||||
.import initconio, zerobss, pushax
|
.import zerobss, pushax
|
||||||
.import _main,__filetab,getfd
|
.import _main,__filetab,getfd
|
||||||
.import __CODE_LOAD__, __BSS_LOAD__
|
.import __CODE_LOAD__, __BSS_LOAD__
|
||||||
.import __graphmode_used
|
.import __graphmode_used
|
||||||
@@ -124,8 +124,6 @@ L1: lda sp,x
|
|||||||
|
|
||||||
; Initialize conio stuff
|
; Initialize conio stuff
|
||||||
|
|
||||||
jsr initconio
|
|
||||||
|
|
||||||
lda #$FF
|
lda #$FF
|
||||||
sta CH
|
sta CH
|
||||||
|
|
||||||
|
|||||||
@@ -11,13 +11,19 @@
|
|||||||
%.o: %.s
|
%.o: %.s
|
||||||
@$(AS) -g -o $@ $(AFLAGS) $<
|
@$(AS) -g -o $@ $(AFLAGS) $<
|
||||||
|
|
||||||
C_OBJS =
|
OBJS = _scrsize.o \
|
||||||
|
break.o \
|
||||||
|
cgetc.o \
|
||||||
|
clrscr.o \
|
||||||
|
conio.o \
|
||||||
|
crt0.o \
|
||||||
|
color.o \
|
||||||
|
cputc.o \
|
||||||
|
kbhit.o \
|
||||||
|
readjoy.o
|
||||||
|
|
||||||
S_OBJS = crt0.o conio.o kbhit.o clrscr.o cgetc.o readjoy.o\
|
all: $(OBJS)
|
||||||
color.o cputc.o break.o
|
|
||||||
|
|
||||||
all: $(C_OBJS) $(S_OBJS)
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -f $(C_OBJS:.c=.s) $(C_OBJS) $(S_OBJS) crt0.o
|
@rm -f $(OBJS)
|
||||||
|
|
||||||
|
|||||||
29
libsrc/c128/_scrsize.s
Normal file
29
libsrc/c128/_scrsize.s
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
;
|
||||||
|
; Ullrich von Bassewitz, 26.10.2000
|
||||||
|
;
|
||||||
|
; Screen size variables
|
||||||
|
;
|
||||||
|
|
||||||
|
.export xsize, ysize
|
||||||
|
.constructor initscrsize
|
||||||
|
|
||||||
|
.include "../cbm/cbm.inc"
|
||||||
|
|
||||||
|
.code
|
||||||
|
|
||||||
|
initscrsize:
|
||||||
|
jsr SCREEN
|
||||||
|
inx
|
||||||
|
stx xsize
|
||||||
|
iny
|
||||||
|
sty ysize
|
||||||
|
rts
|
||||||
|
|
||||||
|
.bss
|
||||||
|
|
||||||
|
xsize: .res 1
|
||||||
|
ysize: .res 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -18,11 +18,6 @@ keyvec: .res 2
|
|||||||
.code
|
.code
|
||||||
|
|
||||||
initconio:
|
initconio:
|
||||||
jsr SCREEN
|
|
||||||
inx
|
|
||||||
stx xsize
|
|
||||||
iny
|
|
||||||
sty ysize
|
|
||||||
|
|
||||||
; Save the old vector
|
; Save the old vector
|
||||||
|
|
||||||
|
|||||||
@@ -11,13 +11,23 @@
|
|||||||
%.o: %.s
|
%.o: %.s
|
||||||
@$(AS) -g -o $@ $(AFLAGS) $<
|
@$(AS) -g -o $@ $(AFLAGS) $<
|
||||||
|
|
||||||
C_OBJS =
|
OBJS = _scrsize.o \
|
||||||
|
break.o \
|
||||||
|
crt0.o \
|
||||||
|
cgetc.o \
|
||||||
|
clrscr.o \
|
||||||
|
color.o \
|
||||||
|
conio.o \
|
||||||
|
cputc.o \
|
||||||
|
kbhit.o \
|
||||||
|
mouse.o \
|
||||||
|
read.o \
|
||||||
|
readjoy.o \
|
||||||
|
rs232.o \
|
||||||
|
write.o
|
||||||
|
|
||||||
S_OBJS = crt0.o read.o write.o kbhit.o conio.o clrscr.o mouse.o\
|
all: $(OBJS)
|
||||||
cputc.o cgetc.o color.o readjoy.o break.o rs232.o
|
|
||||||
|
|
||||||
all: $(C_OBJS) $(S_OBJS)
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -f $(C_OBJS:.c=.s) $(C_OBJS) $(S_OBJS) crt0.o
|
@rm -f $(OBJS)
|
||||||
|
|
||||||
|
|||||||
25
libsrc/c64/_scrsize.s
Normal file
25
libsrc/c64/_scrsize.s
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
;
|
||||||
|
; Ullrich von Bassewitz, 26.10.2000
|
||||||
|
;
|
||||||
|
; Screen size variables
|
||||||
|
;
|
||||||
|
|
||||||
|
.export xsize, ysize
|
||||||
|
.constructor initscrsize
|
||||||
|
|
||||||
|
.include "../cbm/cbm.inc"
|
||||||
|
|
||||||
|
.code
|
||||||
|
|
||||||
|
initscrsize:
|
||||||
|
jsr SCREEN
|
||||||
|
stx xsize
|
||||||
|
sty ysize
|
||||||
|
rts
|
||||||
|
|
||||||
|
.bss
|
||||||
|
|
||||||
|
xsize: .res 1
|
||||||
|
ysize: .res 1
|
||||||
|
|
||||||
|
|
||||||
@@ -4,20 +4,7 @@
|
|||||||
; Low level stuff for screen output/console input
|
; Low level stuff for screen output/console input
|
||||||
;
|
;
|
||||||
|
|
||||||
.export initconio
|
|
||||||
.exportzp CURS_X, CURS_Y
|
.exportzp CURS_X, CURS_Y
|
||||||
.import xsize, ysize
|
|
||||||
|
|
||||||
.include "../cbm/cbm.inc"
|
|
||||||
.include "c64.inc"
|
.include "c64.inc"
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
initconio:
|
|
||||||
jsr SCREEN
|
|
||||||
stx xsize
|
|
||||||
sty ysize
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
.export _exit
|
.export _exit
|
||||||
.import initlib, donelib
|
.import initlib, donelib
|
||||||
.import initconio, zerobss, push0
|
.import zerobss, push0
|
||||||
.import _main
|
.import _main
|
||||||
|
|
||||||
.include "c64.inc"
|
.include "c64.inc"
|
||||||
@@ -94,10 +94,6 @@ L1: lda sp,x
|
|||||||
|
|
||||||
jsr initlib
|
jsr initlib
|
||||||
|
|
||||||
; Initialize conio stuff
|
|
||||||
|
|
||||||
jsr initconio
|
|
||||||
|
|
||||||
; Pass an empty command line
|
; Pass an empty command line
|
||||||
|
|
||||||
jsr push0 ; argc
|
jsr push0 ; argc
|
||||||
|
|||||||
@@ -11,14 +11,25 @@
|
|||||||
%.o: %.s
|
%.o: %.s
|
||||||
@$(AS) -g -o $@ $(AFLAGS) $<
|
@$(AS) -g -o $@ $(AFLAGS) $<
|
||||||
|
|
||||||
C_OBJS =
|
OBJS = _scrsize.o \
|
||||||
|
banking.o \
|
||||||
|
break.o \
|
||||||
|
cgetc.o \
|
||||||
|
clrscr.o \
|
||||||
|
color.o \
|
||||||
|
cputc.o \
|
||||||
|
crt0.o \
|
||||||
|
crtc.o \
|
||||||
|
kbhit.o \
|
||||||
|
kirq.o \
|
||||||
|
kplot.o \
|
||||||
|
kscnkey.o \
|
||||||
|
kudtim.o \
|
||||||
|
pokesys.o \
|
||||||
|
rs232.o
|
||||||
|
|
||||||
S_OBJS = crt0.o kbhit.o conio.o clrscr.o cputc.o cgetc.o\
|
all: $(OBJS)
|
||||||
color.o break.o banking.o crtc.o pokesys.o\
|
|
||||||
kscnkey.o kplot.o kudtim.o kirq.o rs232.o
|
|
||||||
|
|
||||||
all: $(C_OBJS) $(S_OBJS)
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -f $(C_OBJS:.c=.s) $(C_OBJS) $(S_OBJS) crt0.o
|
@rm -f $(OBJS)
|
||||||
|
|
||||||
|
|||||||
15
libsrc/cbm610/_scrsize.s
Normal file
15
libsrc/cbm610/_scrsize.s
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
;
|
||||||
|
; Ullrich von Bassewitz, 26.10.2000
|
||||||
|
;
|
||||||
|
; Screen size variables
|
||||||
|
;
|
||||||
|
|
||||||
|
.export xsize, ysize
|
||||||
|
|
||||||
|
.rodata
|
||||||
|
|
||||||
|
xsize: .byte 80
|
||||||
|
ysize: .byte 25
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
;
|
|
||||||
; Ullrich von Bassewitz, 22.09.1998
|
|
||||||
;
|
|
||||||
; Low level stuff for screen output/console input
|
|
||||||
;
|
|
||||||
|
|
||||||
.export initconio
|
|
||||||
.import xsize, ysize
|
|
||||||
|
|
||||||
.include "cbm610.inc"
|
|
||||||
|
|
||||||
initconio:
|
|
||||||
lda #80
|
|
||||||
sta xsize
|
|
||||||
lda #25
|
|
||||||
sta ysize
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
@@ -7,7 +7,6 @@
|
|||||||
.export _exit
|
.export _exit
|
||||||
.import initlib, donelib
|
.import initlib, donelib
|
||||||
.import push0, _main
|
.import push0, _main
|
||||||
.import initconio
|
|
||||||
.import __BSS_RUN__, __BSS_SIZE__
|
.import __BSS_RUN__, __BSS_SIZE__
|
||||||
.import irq, nmi
|
.import irq, nmi
|
||||||
.import k_irq, k_nmi, k_plot, k_udtim, k_scnkey
|
.import k_irq, k_nmi, k_plot, k_udtim, k_scnkey
|
||||||
@@ -240,10 +239,6 @@ Z4:
|
|||||||
|
|
||||||
jsr initlib
|
jsr initlib
|
||||||
|
|
||||||
; Initialize conio stuff
|
|
||||||
|
|
||||||
jsr initconio
|
|
||||||
|
|
||||||
; Create the (empty) command line for the program
|
; Create the (empty) command line for the program
|
||||||
|
|
||||||
jsr push0 ; argc
|
jsr push0 ; argc
|
||||||
|
|||||||
@@ -11,16 +11,13 @@
|
|||||||
%.o: %.s
|
%.o: %.s
|
||||||
@$(AS) -g -o $@ $(AFLAGS) $<
|
@$(AS) -g -o $@ $(AFLAGS) $<
|
||||||
|
|
||||||
C_OBJS =
|
OBJS = _cursor.o \
|
||||||
|
cputhex.o \
|
||||||
|
cputs.o \
|
||||||
|
cursor.o \
|
||||||
|
scrsize.o
|
||||||
|
|
||||||
S_OBJS = _cursor.o \
|
all: $(OBJS)
|
||||||
_scrsize.o \
|
|
||||||
cputhex.o \
|
|
||||||
cputs.o \
|
|
||||||
cursor.o \
|
|
||||||
scrsize.o
|
|
||||||
|
|
||||||
all: $(C_OBJS) $(S_OBJS)
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -f *~ $(C_OBJS:.o=.s) $(C_OBJS) $(S_OBJS)
|
@rm -f *~ $(OBJS)
|
||||||
|
|||||||
@@ -11,11 +11,17 @@
|
|||||||
%.o: %.s
|
%.o: %.s
|
||||||
@$(AS) -g -o $@ $(AFLAGS) $<
|
@$(AS) -g -o $@ $(AFLAGS) $<
|
||||||
|
|
||||||
C_OBJS =
|
OBJS = _scrsize.o \
|
||||||
|
break.o \
|
||||||
|
cgetc.o \
|
||||||
|
clrscr.o \
|
||||||
|
color.o \
|
||||||
|
conio.o \
|
||||||
|
cputc.o \
|
||||||
|
crt0.o \
|
||||||
|
kbhit.o
|
||||||
|
|
||||||
S_OBJS = crt0.o kbhit.o conio.o clrscr.o cputc.o cgetc.o break.o color.o
|
all: $(OBJS)
|
||||||
|
|
||||||
all: $(C_OBJS) $(S_OBJS)
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -f $(C_OBJS:.c=.s) $(C_OBJS) $(S_OBJS) crt0.o
|
@rm -f $(OBJS)
|
||||||
|
|||||||
30
libsrc/pet/_scrsize.s
Normal file
30
libsrc/pet/_scrsize.s
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
;
|
||||||
|
; Ullrich von Bassewitz, 26.10.2000
|
||||||
|
;
|
||||||
|
; Screen size variables
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
|
.export xsize, ysize
|
||||||
|
.constructor initscrsize
|
||||||
|
|
||||||
|
.include "pet.inc"
|
||||||
|
|
||||||
|
.code
|
||||||
|
|
||||||
|
initscrsize:
|
||||||
|
ldx SCR_LINELEN
|
||||||
|
inx ; Variable is one less
|
||||||
|
stx xsize
|
||||||
|
lda #25
|
||||||
|
sta ysize
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
|
.bss
|
||||||
|
|
||||||
|
xsize: .res 1
|
||||||
|
ysize: .res 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -4,21 +4,7 @@
|
|||||||
; Low level stuff for screen output/console input
|
; Low level stuff for screen output/console input
|
||||||
;
|
;
|
||||||
|
|
||||||
.export initconio
|
|
||||||
.import xsize, ysize
|
|
||||||
.exportzp CURS_X, CURS_Y
|
.exportzp CURS_X, CURS_Y
|
||||||
|
|
||||||
.include "pet.inc"
|
.include "pet.inc"
|
||||||
|
|
||||||
.code
|
|
||||||
|
|
||||||
initconio:
|
|
||||||
ldx SCR_LINELEN
|
|
||||||
inx ; Variable is one less
|
|
||||||
stx xsize
|
|
||||||
lda #25
|
|
||||||
sta ysize
|
|
||||||
rts
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -4,9 +4,9 @@
|
|||||||
; This must be the *first* file on the linker command line
|
; This must be the *first* file on the linker command line
|
||||||
;
|
;
|
||||||
|
|
||||||
.export _exit
|
.export _exit
|
||||||
.import initlib, donelib
|
.import initlib, donelib
|
||||||
.import initconio, zerobss, push0
|
.import zerobss, push0
|
||||||
.import _main
|
.import _main
|
||||||
|
|
||||||
.include "pet.inc"
|
.include "pet.inc"
|
||||||
@@ -89,10 +89,6 @@ L1: lda sp,x
|
|||||||
|
|
||||||
jsr initlib
|
jsr initlib
|
||||||
|
|
||||||
; Initialize conio stuff
|
|
||||||
|
|
||||||
jsr initconio
|
|
||||||
|
|
||||||
; Pass an empty command line
|
; Pass an empty command line
|
||||||
|
|
||||||
jsr push0 ; argc
|
jsr push0 ; argc
|
||||||
|
|||||||
@@ -11,13 +11,19 @@
|
|||||||
%.o: %.s
|
%.o: %.s
|
||||||
@$(AS) -g -o $@ $(AFLAGS) $<
|
@$(AS) -g -o $@ $(AFLAGS) $<
|
||||||
|
|
||||||
C_OBJS =
|
OBJS = _scrsize.o \
|
||||||
|
break.o \
|
||||||
|
cgetc.o \
|
||||||
|
clrscr.o \
|
||||||
|
color.o \
|
||||||
|
conio.o \
|
||||||
|
cputc.o \
|
||||||
|
crt0.o \
|
||||||
|
kbhit.o \
|
||||||
|
readjoy.o
|
||||||
|
|
||||||
S_OBJS = crt0.o kbhit.o conio.o clrscr.o cputc.o cgetc.o\
|
all: $(OBJS)
|
||||||
color.o readjoy.o break.o
|
|
||||||
|
|
||||||
all: $(C_OBJS) $(S_OBJS)
|
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
@rm -f $(C_OBJS:.c=.s) $(C_OBJS) $(S_OBJS) crt0.o
|
@rm -f $(OBJS)
|
||||||
|
|
||||||
|
|||||||
25
libsrc/plus4/_scrsize.s
Normal file
25
libsrc/plus4/_scrsize.s
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
;
|
||||||
|
; Ullrich von Bassewitz, 26.10.2000
|
||||||
|
;
|
||||||
|
; Screen size variables
|
||||||
|
;
|
||||||
|
|
||||||
|
.export xsize, ysize
|
||||||
|
.constructor initscrsize
|
||||||
|
|
||||||
|
.include "../cbm/cbm.inc"
|
||||||
|
|
||||||
|
.code
|
||||||
|
|
||||||
|
initscrsize:
|
||||||
|
jsr SCREEN
|
||||||
|
stx xsize
|
||||||
|
sty ysize
|
||||||
|
rts
|
||||||
|
|
||||||
|
.bss
|
||||||
|
|
||||||
|
xsize: .res 1
|
||||||
|
ysize: .res 1
|
||||||
|
|
||||||
|
|
||||||
@@ -14,9 +14,6 @@
|
|||||||
.code
|
.code
|
||||||
|
|
||||||
initconio:
|
initconio:
|
||||||
jsr SCREEN
|
|
||||||
stx xsize
|
|
||||||
sty ysize
|
|
||||||
ldy #15
|
ldy #15
|
||||||
L1: lda fnkeys,y
|
L1: lda fnkeys,y
|
||||||
sta FKEY_SPACE,y
|
sta FKEY_SPACE,y
|
||||||
|
|||||||
Reference in New Issue
Block a user