1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-07 23:29:39 +00:00

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:
cuz 2000-11-23 19:05:32 +00:00
parent ea8541e932
commit 99ecc9a609
25 changed files with 241 additions and 141 deletions

View File

@ -13,12 +13,26 @@
C_OBJS =
S_OBJS = break.o clrscr.o cclear.o cgetc.o chline.o color.o \
cputc.o crt0.o ctype.o \
cvline.o kbhit.o read.o revers.o where.o write.o
S_OBJS= _scrsize.o \
break.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)
clean:
@rm -f $(C_OBJS:.c=.s) $(C_OBJS) $(S_OBJS) crt0.o

View File

@ -6,10 +6,10 @@
.export xsize, ysize
.bss
.rodata
xsize: .res 1
ysize: .res 1
xsize: .byte 40
ysize: .byte 24

View File

@ -16,7 +16,7 @@ ATARIDEFS = -DNUMDRVS=4
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 \
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 \

15
libsrc/atari/_scrsize.s Normal file
View File

@ -0,0 +1,15 @@
;
; Ullrich von Bassewitz, 26.10.2000
;
; Screen size variables
;
.export xsize, ysize
.rodata
xsize: .byte 40
ysize: .byte 24

View File

@ -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

View File

@ -15,9 +15,9 @@ RESERVE_MOUSE_MEMORY = 1 ; for P/M
.export mouse_pm0
.endif
.export _exit
.import getargs, argc, argv
.import getargs, argc, argv
.import initlib, donelib
.import initconio, zerobss, pushax
.import zerobss, pushax
.import _main,__filetab,getfd
.import __CODE_LOAD__, __BSS_LOAD__
.import __graphmode_used
@ -124,8 +124,6 @@ L1: lda sp,x
; Initialize conio stuff
jsr initconio
lda #$FF
sta CH

View File

@ -11,13 +11,19 @@
%.o: %.s
@$(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\
color.o cputc.o break.o
all: $(C_OBJS) $(S_OBJS)
all: $(OBJS)
clean:
@rm -f $(C_OBJS:.c=.s) $(C_OBJS) $(S_OBJS) crt0.o
@rm -f $(OBJS)

29
libsrc/c128/_scrsize.s Normal file
View 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

View File

@ -18,11 +18,6 @@ keyvec: .res 2
.code
initconio:
jsr SCREEN
inx
stx xsize
iny
sty ysize
; Save the old vector

View File

@ -11,13 +11,23 @@
%.o: %.s
@$(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\
cputc.o cgetc.o color.o readjoy.o break.o rs232.o
all: $(C_OBJS) $(S_OBJS)
all: $(OBJS)
clean:
@rm -f $(C_OBJS:.c=.s) $(C_OBJS) $(S_OBJS) crt0.o
@rm -f $(OBJS)

25
libsrc/c64/_scrsize.s Normal file
View 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

View File

@ -4,20 +4,7 @@
; Low level stuff for screen output/console input
;
.export initconio
.exportzp CURS_X, CURS_Y
.import xsize, ysize
.include "../cbm/cbm.inc"
.include "c64.inc"
.code
initconio:
jsr SCREEN
stx xsize
sty ysize
rts

View File

@ -6,7 +6,7 @@
.export _exit
.import initlib, donelib
.import initconio, zerobss, push0
.import zerobss, push0
.import _main
.include "c64.inc"
@ -94,10 +94,6 @@ L1: lda sp,x
jsr initlib
; Initialize conio stuff
jsr initconio
; Pass an empty command line
jsr push0 ; argc

View File

@ -11,14 +11,25 @@
%.o: %.s
@$(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\
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)
all: $(OBJS)
clean:
@rm -f $(C_OBJS:.c=.s) $(C_OBJS) $(S_OBJS) crt0.o
@rm -f $(OBJS)

15
libsrc/cbm610/_scrsize.s Normal file
View File

@ -0,0 +1,15 @@
;
; Ullrich von Bassewitz, 26.10.2000
;
; Screen size variables
;
.export xsize, ysize
.rodata
xsize: .byte 80
ysize: .byte 25

View File

@ -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

View File

@ -7,7 +7,6 @@
.export _exit
.import initlib, donelib
.import push0, _main
.import initconio
.import __BSS_RUN__, __BSS_SIZE__
.import irq, nmi
.import k_irq, k_nmi, k_plot, k_udtim, k_scnkey
@ -240,10 +239,6 @@ Z4:
jsr initlib
; Initialize conio stuff
jsr initconio
; Create the (empty) command line for the program
jsr push0 ; argc

View File

@ -11,16 +11,13 @@
%.o: %.s
@$(AS) -g -o $@ $(AFLAGS) $<
C_OBJS =
OBJS = _cursor.o \
cputhex.o \
cputs.o \
cursor.o \
scrsize.o
S_OBJS = _cursor.o \
_scrsize.o \
cputhex.o \
cputs.o \
cursor.o \
scrsize.o
all: $(C_OBJS) $(S_OBJS)
all: $(OBJS)
clean:
@rm -f *~ $(C_OBJS:.o=.s) $(C_OBJS) $(S_OBJS)
@rm -f *~ $(OBJS)

View File

@ -11,11 +11,17 @@
%.o: %.s
@$(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: $(C_OBJS) $(S_OBJS)
all: $(OBJS)
clean:
@rm -f $(C_OBJS:.c=.s) $(C_OBJS) $(S_OBJS) crt0.o
@rm -f $(OBJS)

30
libsrc/pet/_scrsize.s Normal file
View 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

View File

@ -4,21 +4,7 @@
; Low level stuff for screen output/console input
;
.export initconio
.import xsize, ysize
.exportzp CURS_X, CURS_Y
.include "pet.inc"
.code
initconio:
ldx SCR_LINELEN
inx ; Variable is one less
stx xsize
lda #25
sta ysize
rts

View File

@ -4,9 +4,9 @@
; This must be the *first* file on the linker command line
;
.export _exit
.export _exit
.import initlib, donelib
.import initconio, zerobss, push0
.import zerobss, push0
.import _main
.include "pet.inc"
@ -89,10 +89,6 @@ L1: lda sp,x
jsr initlib
; Initialize conio stuff
jsr initconio
; Pass an empty command line
jsr push0 ; argc

View File

@ -11,13 +11,19 @@
%.o: %.s
@$(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\
color.o readjoy.o break.o
all: $(C_OBJS) $(S_OBJS)
all: $(OBJS)
clean:
@rm -f $(C_OBJS:.c=.s) $(C_OBJS) $(S_OBJS) crt0.o
@rm -f $(OBJS)

25
libsrc/plus4/_scrsize.s Normal file
View 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

View File

@ -14,9 +14,6 @@
.code
initconio:
jsr SCREEN
stx xsize
sty ysize
ldy #15
L1: lda fnkeys,y
sta FKEY_SPACE,y