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

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