]> git.sur5r.net Git - cc65/commitdiff
Now that cc65 programs can run as SYS files themselves my ProDOS Loader ulimately...
authorol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 14 Sep 2009 19:58:06 +0000 (19:58 +0000)
committerol.sc <ol.sc@b7a2c559-68d2-44c3-8de9-860c34a00d81>
Mon, 14 Sep 2009 19:58:06 +0000 (19:58 +0000)
git-svn-id: svn://svn.cc65.org/cc65/trunk@4172 b7a2c559-68d2-44c3-8de9-860c34a00d81

doc/apple2.sgml
doc/apple2enh.sgml
doc/funcref.sgml
include/apple2.h
libsrc/apple2/Makefile
libsrc/apple2/crt0.s
libsrc/apple2/reboot.s [new file with mode: 0644]
libsrc/apple2enh/Makefile

index 22416013dde81e415cbe97d4d2d90f98ee21358e..1abcf3edab3e17f79cf88bdde675d863e8812636 100644 (file)
@@ -127,6 +127,7 @@ usage.
 <itemize>
 <item>_dos_type
 <item>get_ostype
+<item>rebootafterexit
 </itemize>
 
 
index dac70e877774599933e42b069d01ebceb4ed1ca0..af7fb4a515cd88e767cde98717bf8527f3e63be7 100644 (file)
@@ -127,6 +127,7 @@ usage.
 <itemize>
 <item>_dos_type
 <item>get_ostype
+<item>rebootafterexit
 <item>textframe
 <item>textframexy
 <item>videomode
index 628362d87af465502cf5f98a955023fa4ff84398..54d23f5527374f97c4a4f46fdb9dcfd824b58c2d 100644 (file)
@@ -67,6 +67,7 @@ function.
 <itemize>
 <item>_dos_type
 <item><ref id="get_ostype" name="get_ostype">
+<item>rebootafterexit
 </itemize>
 
 
@@ -75,6 +76,7 @@ function.
 <itemize>
 <item>_dos_type
 <item><ref id="get_ostype" name="get_ostype">
+<item>rebootafterexit
 <item>textframe
 <item>textframexy
 <item><ref id="videomode" name="videomode">
index 1aee91e40fc4bd48651db724564b264f1d8d9c2b..779f83b7a9143d8b34af4a6bd4d2cc36bbb507a9 100644 (file)
@@ -140,6 +140,9 @@ extern unsigned char _dos_type;
 unsigned char get_ostype (void);
 /* 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
  * to be overlaid by macros with the same names, saving the function call
  * overhead.
index 2a067e21a29c8e5c92d1b391d5c6d8d8e979e885..802c404f5868de9fb72984a4af43d4aec55b928a 100644 (file)
@@ -91,6 +91,7 @@ S_OBJS=       _scrsize.o      \
         randomize.o     \
         rdkey.o         \
        read.o          \
+       reboot.o        \
        revers.o        \
        rwcommon.o      \
        syschdir.o      \
index b0ffabf1ccb5ede4a9eb16fdbc313c5957444610..565e5ffb1975829d8c2e580747ba61a63af14c6d 100644 (file)
@@ -2,7 +2,7 @@
 ; Startup code for cc65 (Apple2 version)
 ;
 
-        .export         _exit
+        .export         _exit, done, return
         .export         __STARTUP__ : absolute = 1      ; Mark as startup
         .import         zerobss
         .import        initlib, donelib
@@ -165,10 +165,6 @@ init:   ldx     #zpspace-1
         bne     basic
         
         ; 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
         cmp     #%00000001      ; exactly system global page is protected
         bne     basic
@@ -272,7 +268,7 @@ reset:  stx     SOFTEV
         sta     SOFTEV+1
         eor     #$A5
         sta     PWREDUP
-        rts
+return: rts
 
         ; Quit to ProDOS dispatcher
 quit:   jsr     $BF00           ; MLI call entry point
diff --git a/libsrc/apple2/reboot.s b/libsrc/apple2/reboot.s
new file mode 100644 (file)
index 0000000..9986371
--- /dev/null
@@ -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
index deb046d87499b6e9fcb2fced3e090386ea8472e4..11609b2caad4cf42088b078a43e0fd0c656a8f47 100644 (file)
@@ -91,6 +91,7 @@ S_OBJS=       _scrsize.o      \
         randomize.o     \
         rdkey.o         \
        read.o          \
+       reboot.o        \
        revers.o        \
        rwcommon.o      \
        syschdir.o      \