Move constructor code into the INIT segment

git-svn-id: svn://svn.cc65.org/cc65/trunk@3405 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz
2005-02-26 09:28:46 +00:00
parent 6ec87c5dd9
commit d0bee35728
23 changed files with 166 additions and 59 deletions

View File

@@ -45,7 +45,8 @@ CFLAGS = -Osir -g -T -t $(SYS) --forget-inc-paths -I . -I ../../include
#--------------------------------------------------------------------------
# Object files
OBJS = cgetc.o \
OBJS = cartread.o \
cgetc.o \
crt0.o \
ctype.o \
eeprom.o \

49
libsrc/lynx/cartread.s Normal file
View File

@@ -0,0 +1,49 @@
; ***
; CC65 Lynx Library
;
; Originally by Bastian Schick
; http://www.geocities.com/SiliconValley/Byte/4242/lynx/
;
; Ported to cc65 (http://www.cc65.org) by
; Shawn Jefferson, June 2004
;
; ***
;
; void __fastcall__ read_cart_block(unsigned char block, char *dest)
;
; Reads an entire block (1024 bytes) from the cartridge into the buffer
; pointed to by dest.
.export _read_cart_block
.import FileSelectBlock, FileReadBytes
.import popa
.include "extzp.inc"
.code
;*******************************************
; void read_cart_block (unsigned char block, char *dest);
; loads one Block (1024 bytes) to pDest
_read_cart_block:
sta _FileDestPtr ; lo
stx _FileDestPtr+1 ; hi
jsr popa ; bBlock
sta _FileCurrBlock
jsr FileSelectBlock ; select block# (Accu)
lda #<1024 ; load a whole block (1024 bytes)
eor #$ff
tax
lda #>1024
eor #$ff
tay
jmp FileReadBytes

View File

@@ -10,7 +10,10 @@
;---------------------------------------------------------------------------
; Setup arguments for main
; Get possible command-line arguments. Goes into the special INIT segment,
; which may be reused after the startup code is run
.segment "INIT"
.proc initmainargs