Now that cc65 programs can run as SYS files themselves my ProDOS Loader ulimately has to change from a minimalistic shell replacement to a pure loader (without exit hook). This approach simplifies several things. However the "reboot after exit" option now present as a ProDOS Loader variant has to move into the cc65 program.
git-svn-id: svn://svn.cc65.org/cc65/trunk@4172 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
@@ -127,6 +127,7 @@ usage.
|
|||||||
<itemize>
|
<itemize>
|
||||||
<item>_dos_type
|
<item>_dos_type
|
||||||
<item>get_ostype
|
<item>get_ostype
|
||||||
|
<item>rebootafterexit
|
||||||
</itemize>
|
</itemize>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -127,6 +127,7 @@ usage.
|
|||||||
<itemize>
|
<itemize>
|
||||||
<item>_dos_type
|
<item>_dos_type
|
||||||
<item>get_ostype
|
<item>get_ostype
|
||||||
|
<item>rebootafterexit
|
||||||
<item>textframe
|
<item>textframe
|
||||||
<item>textframexy
|
<item>textframexy
|
||||||
<item>videomode
|
<item>videomode
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ function.
|
|||||||
<itemize>
|
<itemize>
|
||||||
<item>_dos_type
|
<item>_dos_type
|
||||||
<item><ref id="get_ostype" name="get_ostype">
|
<item><ref id="get_ostype" name="get_ostype">
|
||||||
|
<item>rebootafterexit
|
||||||
</itemize>
|
</itemize>
|
||||||
|
|
||||||
|
|
||||||
@@ -75,6 +76,7 @@ function.
|
|||||||
<itemize>
|
<itemize>
|
||||||
<item>_dos_type
|
<item>_dos_type
|
||||||
<item><ref id="get_ostype" name="get_ostype">
|
<item><ref id="get_ostype" name="get_ostype">
|
||||||
|
<item>rebootafterexit
|
||||||
<item>textframe
|
<item>textframe
|
||||||
<item>textframexy
|
<item>textframexy
|
||||||
<item><ref id="videomode" name="videomode">
|
<item><ref id="videomode" name="videomode">
|
||||||
|
|||||||
@@ -140,6 +140,9 @@ extern unsigned char _dos_type;
|
|||||||
unsigned char get_ostype (void);
|
unsigned char get_ostype (void);
|
||||||
/* Get the machine type. Returns one of the APPLE_xxx codes. */
|
/* Get the machine type. Returns one of the APPLE_xxx codes. */
|
||||||
|
|
||||||
|
void rebootafterexit (void);
|
||||||
|
/* Reboot machine after program termination has completed. */
|
||||||
|
|
||||||
/* The following #defines will cause the matching functions calls in conio.h
|
/* The following #defines will cause the matching functions calls in conio.h
|
||||||
* to be overlaid by macros with the same names, saving the function call
|
* to be overlaid by macros with the same names, saving the function call
|
||||||
* overhead.
|
* overhead.
|
||||||
|
|||||||
@@ -91,6 +91,7 @@ S_OBJS= _scrsize.o \
|
|||||||
randomize.o \
|
randomize.o \
|
||||||
rdkey.o \
|
rdkey.o \
|
||||||
read.o \
|
read.o \
|
||||||
|
reboot.o \
|
||||||
revers.o \
|
revers.o \
|
||||||
rwcommon.o \
|
rwcommon.o \
|
||||||
syschdir.o \
|
syschdir.o \
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
; Startup code for cc65 (Apple2 version)
|
; Startup code for cc65 (Apple2 version)
|
||||||
;
|
;
|
||||||
|
|
||||||
.export _exit
|
.export _exit, done, return
|
||||||
.export __STARTUP__ : absolute = 1 ; Mark as startup
|
.export __STARTUP__ : absolute = 1 ; Mark as startup
|
||||||
.import zerobss
|
.import zerobss
|
||||||
.import initlib, donelib
|
.import initlib, donelib
|
||||||
@@ -165,10 +165,6 @@ init: ldx #zpspace-1
|
|||||||
bne basic
|
bne basic
|
||||||
|
|
||||||
; Check ProDOS system bit map
|
; Check ProDOS system bit map
|
||||||
lda $BF58 ; protection for pages $00 - $07
|
|
||||||
and #%11110000 ; ignore protection of text pages
|
|
||||||
cmp #%11000000 ; only zero and stack pages are protected
|
|
||||||
bne basic
|
|
||||||
lda $BF6F ; protection for pages $B8 - $BF
|
lda $BF6F ; protection for pages $B8 - $BF
|
||||||
cmp #%00000001 ; exactly system global page is protected
|
cmp #%00000001 ; exactly system global page is protected
|
||||||
bne basic
|
bne basic
|
||||||
@@ -272,7 +268,7 @@ reset: stx SOFTEV
|
|||||||
sta SOFTEV+1
|
sta SOFTEV+1
|
||||||
eor #$A5
|
eor #$A5
|
||||||
sta PWREDUP
|
sta PWREDUP
|
||||||
rts
|
return: rts
|
||||||
|
|
||||||
; Quit to ProDOS dispatcher
|
; Quit to ProDOS dispatcher
|
||||||
quit: jsr $BF00 ; MLI call entry point
|
quit: jsr $BF00 ; MLI call entry point
|
||||||
|
|||||||
21
libsrc/apple2/reboot.s
Normal file
21
libsrc/apple2/reboot.s
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
;
|
||||||
|
; Oliver Schmidt, 14.09.2009
|
||||||
|
;
|
||||||
|
; void rebootafterexit (void);
|
||||||
|
;
|
||||||
|
|
||||||
|
.constructor initreboot
|
||||||
|
.export _rebootafterexit
|
||||||
|
.import done, return
|
||||||
|
|
||||||
|
_rebootafterexit := return
|
||||||
|
|
||||||
|
.segment "INIT"
|
||||||
|
|
||||||
|
initreboot:
|
||||||
|
; Quit to PWRUP
|
||||||
|
lda #<$FAA6
|
||||||
|
ldx #>$FAA6
|
||||||
|
sta done
|
||||||
|
stx done+1
|
||||||
|
rts
|
||||||
@@ -91,6 +91,7 @@ S_OBJS= _scrsize.o \
|
|||||||
randomize.o \
|
randomize.o \
|
||||||
rdkey.o \
|
rdkey.o \
|
||||||
read.o \
|
read.o \
|
||||||
|
reboot.o \
|
||||||
revers.o \
|
revers.o \
|
||||||
rwcommon.o \
|
rwcommon.o \
|
||||||
syschdir.o \
|
syschdir.o \
|
||||||
|
|||||||
Reference in New Issue
Block a user