]> git.sur5r.net Git - cc65/commitdiff
Rename c1p target to osic1p
authorStephan Mühlstrasser <stephan.muehlstrasser@web.de>
Tue, 3 Feb 2015 21:42:35 +0000 (22:42 +0100)
committerStephan Mühlstrasser <stephan.muehlstrasser@web.de>
Tue, 3 Feb 2015 21:42:35 +0000 (22:42 +0100)
49 files changed:
cfg/c1p-asm.cfg [deleted file]
cfg/c1p.cfg [deleted file]
cfg/osic1p-asm.cfg [new file with mode: 0644]
cfg/osic1p.cfg [new file with mode: 0644]
include/c1p.h [deleted file]
include/conio.h
include/osic1p.h [new file with mode: 0644]
libsrc/Makefile
libsrc/c1p/_scrsize.s [deleted file]
libsrc/c1p/c1p.inc [deleted file]
libsrc/c1p/cclear.s [deleted file]
libsrc/c1p/cgetc.s [deleted file]
libsrc/c1p/chline.s [deleted file]
libsrc/c1p/clrscr.s [deleted file]
libsrc/c1p/cputc.s [deleted file]
libsrc/c1p/crt0.s [deleted file]
libsrc/c1p/ctype.s [deleted file]
libsrc/c1p/cvline.s [deleted file]
libsrc/c1p/extzp.inc [deleted file]
libsrc/c1p/extzp.s [deleted file]
libsrc/c1p/gotox.s [deleted file]
libsrc/c1p/gotoxy.s [deleted file]
libsrc/c1p/gotoy.s [deleted file]
libsrc/c1p/oserror.s [deleted file]
libsrc/c1p/wherex.s [deleted file]
libsrc/c1p/wherey.s [deleted file]
libsrc/osic1p/_scrsize.s [new file with mode: 0644]
libsrc/osic1p/cclear.s [new file with mode: 0644]
libsrc/osic1p/cgetc.s [new file with mode: 0644]
libsrc/osic1p/chline.s [new file with mode: 0644]
libsrc/osic1p/clrscr.s [new file with mode: 0644]
libsrc/osic1p/cputc.s [new file with mode: 0644]
libsrc/osic1p/crt0.s [new file with mode: 0644]
libsrc/osic1p/ctype.s [new file with mode: 0644]
libsrc/osic1p/cvline.s [new file with mode: 0644]
libsrc/osic1p/extzp.inc [new file with mode: 0644]
libsrc/osic1p/extzp.s [new file with mode: 0644]
libsrc/osic1p/gotox.s [new file with mode: 0644]
libsrc/osic1p/gotoxy.s [new file with mode: 0644]
libsrc/osic1p/gotoy.s [new file with mode: 0644]
libsrc/osic1p/oserror.s [new file with mode: 0644]
libsrc/osic1p/osic1p.inc [new file with mode: 0644]
libsrc/osic1p/wherex.s [new file with mode: 0644]
libsrc/osic1p/wherey.s [new file with mode: 0644]
src/c1p65.vcxproj [deleted file]
src/ca65/main.c
src/cc65/main.c
src/common/target.c
src/common/target.h

diff --git a/cfg/c1p-asm.cfg b/cfg/c1p-asm.cfg
deleted file mode 100644 (file)
index 57689b9..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-FEATURES {
-    STARTADDRESS: default = $0200;
-}
-SYMBOLS {
-    __STACKSIZE__: type = weak, value = $0400; # 1 kB stack
-    __HIMEM__:     type = weak, value = $8000; # 32 kB RAM
-}
-MEMORY {
-    # for size of ZP see runtime/zeropage.s and c1p/extzp.s
-    ZP:       file = "", define = yes, start = $0002, size = $001A + $0006;
-    RAM:      file = %O, define = yes, start = %S, size = __HIMEM__ - __STACKSIZE__ - %S;
-}
-SEGMENTS {
-    INIT:     load = RAM, type = ro,  define = yes, optional = yes;
-    CODE:     load = RAM, type = rw;
-    RODATA:   load = RAM, type = rw;
-    DATA:     load = RAM, type = rw;
-    BSS:      load = RAM, type = bss, define = yes;
-    ZEROPAGE: load = ZP,  type = zp;
-}
\ No newline at end of file
diff --git a/cfg/c1p.cfg b/cfg/c1p.cfg
deleted file mode 100644 (file)
index 59fdd34..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-FEATURES {
-    STARTADDRESS: default = $0200;
-}
-SYMBOLS {
-    __STACKSIZE__: type = weak, value = $0400; # 1 kB stack
-    __HIMEM__:     type = weak, value = $8000; # 32 kB RAM
-}
-MEMORY {
-    # for size of ZP see runtime/zeropage.s and c1p/extzp.s
-    ZP:       file = "", define = yes, start = $0002, size = $001A + $0006;
-    RAM:      file = %O, define = yes, start = %S, size = __HIMEM__ - __STACKSIZE__ - %S;
-}
-SEGMENTS {
-    STARTUP:  load = RAM, type = ro;
-    LOWCODE:  load = RAM, type = ro,                optional = yes;
-    INIT:     load = RAM, type = ro,  define = yes, optional = yes;
-    CODE:     load = RAM, type = rw;
-    RODATA:   load = RAM, type = rw;
-    DATA:     load = RAM, type = rw;
-    BSS:      load = RAM, type = bss, define = yes;
-    ZEROPAGE: load = ZP,  type = zp;
-    EXTZP:    load = ZP,  type = rw,  define = yes;
-}
-FEATURES {
-    CONDES: type    = constructor,
-            label   = __CONSTRUCTOR_TABLE__,
-            count   = __CONSTRUCTOR_COUNT__,
-            segment = INIT;
-    CONDES: type    = destructor,
-            label   = __DESTRUCTOR_TABLE__,
-            count   = __DESTRUCTOR_COUNT__,
-            segment = RODATA;
-}
diff --git a/cfg/osic1p-asm.cfg b/cfg/osic1p-asm.cfg
new file mode 100644 (file)
index 0000000..57689b9
--- /dev/null
@@ -0,0 +1,20 @@
+FEATURES {
+    STARTADDRESS: default = $0200;
+}
+SYMBOLS {
+    __STACKSIZE__: type = weak, value = $0400; # 1 kB stack
+    __HIMEM__:     type = weak, value = $8000; # 32 kB RAM
+}
+MEMORY {
+    # for size of ZP see runtime/zeropage.s and c1p/extzp.s
+    ZP:       file = "", define = yes, start = $0002, size = $001A + $0006;
+    RAM:      file = %O, define = yes, start = %S, size = __HIMEM__ - __STACKSIZE__ - %S;
+}
+SEGMENTS {
+    INIT:     load = RAM, type = ro,  define = yes, optional = yes;
+    CODE:     load = RAM, type = rw;
+    RODATA:   load = RAM, type = rw;
+    DATA:     load = RAM, type = rw;
+    BSS:      load = RAM, type = bss, define = yes;
+    ZEROPAGE: load = ZP,  type = zp;
+}
\ No newline at end of file
diff --git a/cfg/osic1p.cfg b/cfg/osic1p.cfg
new file mode 100644 (file)
index 0000000..59fdd34
--- /dev/null
@@ -0,0 +1,33 @@
+FEATURES {
+    STARTADDRESS: default = $0200;
+}
+SYMBOLS {
+    __STACKSIZE__: type = weak, value = $0400; # 1 kB stack
+    __HIMEM__:     type = weak, value = $8000; # 32 kB RAM
+}
+MEMORY {
+    # for size of ZP see runtime/zeropage.s and c1p/extzp.s
+    ZP:       file = "", define = yes, start = $0002, size = $001A + $0006;
+    RAM:      file = %O, define = yes, start = %S, size = __HIMEM__ - __STACKSIZE__ - %S;
+}
+SEGMENTS {
+    STARTUP:  load = RAM, type = ro;
+    LOWCODE:  load = RAM, type = ro,                optional = yes;
+    INIT:     load = RAM, type = ro,  define = yes, optional = yes;
+    CODE:     load = RAM, type = rw;
+    RODATA:   load = RAM, type = rw;
+    DATA:     load = RAM, type = rw;
+    BSS:      load = RAM, type = bss, define = yes;
+    ZEROPAGE: load = ZP,  type = zp;
+    EXTZP:    load = ZP,  type = rw,  define = yes;
+}
+FEATURES {
+    CONDES: type    = constructor,
+            label   = __CONSTRUCTOR_TABLE__,
+            count   = __CONSTRUCTOR_COUNT__,
+            segment = INIT;
+    CONDES: type    = destructor,
+            label   = __DESTRUCTOR_TABLE__,
+            count   = __DESTRUCTOR_COUNT__,
+            segment = RODATA;
+}
diff --git a/include/c1p.h b/include/c1p.h
deleted file mode 100644 (file)
index 5789d71..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*****************************************************************************/\r
-/*                                                                           */\r
-/*                                   c1p.h                                   */\r
-/*                                                                           */\r
-/*                Challenger 1P system specific definitions                  */\r
-/*                                                                           */\r
-/*                                                                           */\r
-/*                                                                           */\r
-/* (C) 2014 Stephan Muehlstrasser                                            */\r
-/*                                                                           */\r
-/*                                                                           */\r
-/* This software is provided 'as-is', without any expressed or implied       */\r
-/* warranty.  In no event will the authors be held liable for any damages    */\r
-/* arising from the use of this software.                                    */\r
-/*                                                                           */\r
-/* Permission is granted to anyone to use this software for any purpose,     */\r
-/* including commercial applications, and to alter it and redistribute it    */\r
-/* freely, subject to the following restrictions:                            */\r
-/*                                                                           */\r
-/* 1. The origin of this software must not be misrepresented; you must not   */\r
-/*    claim that you wrote the original software. If you use this software   */\r
-/*    in a product, an acknowledgment in the product documentation would be  */\r
-/*    appreciated but is not required.                                       */\r
-/* 2. Altered source versions must be plainly marked as such, and must not   */\r
-/*    be misrepresented as being the original software.                      */\r
-/* 3. This notice may not be removed or altered from any source              */\r
-/*    distribution.                                                          */\r
-/*                                                                           */\r
-/*****************************************************************************/\r
-\r
-#ifndef _C1P_H\r
-#define _C1P_H\r
-\r
-/* Check for errors */\r
-#if !defined(__OSIC1P__)\r
-#  error "This module may only be used when compiling for the Challenger 1P!"\r
-#endif\r
-\r
-/* The following #defines will cause the matching functions calls in conio.h\r
-** to be overlaid by macros with the same names, saving the function call\r
-** overhead.\r
-*/\r
-#define _textcolor(color)       COLOR_WHITE\r
-#define _bgcolor(color)         COLOR_BLACK\r
-#define _bordercolor(color)     COLOR_BLACK\r
-\r
-#endif\r
index f59375a633b88f0a1f4c7ad633a990319b2ccb31..10806785c87785ef29d5da9f5a9e97eab2f80685 100644 (file)
@@ -78,7 +78,7 @@
 #elif defined(__NES__)
 #  include <nes.h>
 #elif defined(__OSIC1P__)
-#  include <c1p.h>
+#  include <osic1p.h>
 #endif
 
 
diff --git a/include/osic1p.h b/include/osic1p.h
new file mode 100644 (file)
index 0000000..57fe0cd
--- /dev/null
@@ -0,0 +1,47 @@
+/*****************************************************************************/\r
+/*                                                                           */\r
+/*                                osic1p.h                                   */\r
+/*                                                                           */\r
+/*                Challenger 1P system specific definitions                  */\r
+/*                                                                           */\r
+/*                                                                           */\r
+/*                                                                           */\r
+/* (C) 2015 Stephan Muehlstrasser                                            */\r
+/*                                                                           */\r
+/*                                                                           */\r
+/* This software is provided 'as-is', without any expressed or implied       */\r
+/* warranty.  In no event will the authors be held liable for any damages    */\r
+/* arising from the use of this software.                                    */\r
+/*                                                                           */\r
+/* Permission is granted to anyone to use this software for any purpose,     */\r
+/* including commercial applications, and to alter it and redistribute it    */\r
+/* freely, subject to the following restrictions:                            */\r
+/*                                                                           */\r
+/* 1. The origin of this software must not be misrepresented; you must not   */\r
+/*    claim that you wrote the original software. If you use this software   */\r
+/*    in a product, an acknowledgment in the product documentation would be  */\r
+/*    appreciated but is not required.                                       */\r
+/* 2. Altered source versions must be plainly marked as such, and must not   */\r
+/*    be misrepresented as being the original software.                      */\r
+/* 3. This notice may not be removed or altered from any source              */\r
+/*    distribution.                                                          */\r
+/*                                                                           */\r
+/*****************************************************************************/\r
+\r
+#ifndef _OSIC1P_H\r
+#define _OSIC1P_H\r
+\r
+/* Check for errors */\r
+#if !defined(__OSIC1P__)\r
+#  error "This module may only be used when compiling for the Challenger 1P!"\r
+#endif\r
+\r
+/* The following #defines will cause the matching functions calls in conio.h\r
+** to be overlaid by macros with the same names, saving the function call\r
+** overhead.\r
+*/\r
+#define _textcolor(color)       COLOR_WHITE\r
+#define _bgcolor(color)         COLOR_BLACK\r
+#define _bordercolor(color)     COLOR_BLACK\r
+\r
+#endif\r
index b35ae1e382c171441999cbe96deadb11a471e7a9..42aaf078b8a936e211a9c71bb78ce4c286d1057f 100644 (file)
@@ -20,11 +20,11 @@ TARGETS = apple2    \
           atarixl   \
           atari5200 \
           atmos     \
-          c1p       \
           $(CBMS)   \
           $(GEOS)   \
           lynx      \
           nes       \
+          osic1p    \
           sim6502   \
           sim65c02  \
           supervision
diff --git a/libsrc/c1p/_scrsize.s b/libsrc/c1p/_scrsize.s
deleted file mode 100644 (file)
index 3b0d71c..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-;
-; based on PET implementation
-;
-; originally by:
-; Ullrich von Bassewitz, 26.10.2000
-;
-; Screen size variables
-;
-
-        .export         screensize
-
-        .include        "extzp.inc"
-
-.proc   screensize
-
-        ldx     SCR_LINELEN
-        inx                     ; Variable is one less
-        ldy     #25
-        rts
-
-.endproc
diff --git a/libsrc/c1p/c1p.inc b/libsrc/c1p/c1p.inc
deleted file mode 100644 (file)
index ad05837..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-\r
-SCRNBASE        := $D000    ; Base of video RAM\r
-VIDEORAMSIZE    := $0400    ; Size of C1P video RAM (1 kB)\r
-INPUTC          := $FD00    ; Input character from keyboard\r
diff --git a/libsrc/c1p/cclear.s b/libsrc/c1p/cclear.s
deleted file mode 100644 (file)
index 4e18c70..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-;
-; Copied from CBM implementation
-;
-; originally by:
-; Ullrich von Bassewitz, 08.08.1998
-;
-; void cclearxy (unsigned char x, unsigned char y, unsigned char length);
-; void cclear (unsigned char length);
-;
-
-        .export         _cclearxy, _cclear
-        .import         popa, _gotoxy, cputdirect
-        .importzp       tmp1
-
-_cclearxy:
-        pha                     ; Save the length
-        jsr     popa            ; Get y
-        jsr     _gotoxy         ; Call this one, will pop params
-        pla                     ; Restore the length and run into _cclear
-
-_cclear:
-        cmp     #0              ; Is the length zero?
-        beq     L9              ; Jump if done
-        sta     tmp1                                 
-L1:     lda     #$20            ; Blank - screen code
-        jsr     cputdirect      ; Direct output
-        dec     tmp1
-        bne     L1
-L9:     rts
diff --git a/libsrc/c1p/cgetc.s b/libsrc/c1p/cgetc.s
deleted file mode 100644 (file)
index b17e765..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-;\r
-; char cgetc (void);\r
-;\r
-        .export         _cgetc\r
-        .import         cursor\r
-\r
-        .include        "c1p.inc"\r
-        .include        "extzp.inc"\r
-\r
-; Input routine from 65V PROM MONITOR, show cursor if enabled\r
-_cgetc:\r
-        lda     cursor          ; show cursor?\r
-        beq     nocursor\r
-        ldy     CURS_X\r
-        lda     (SCREEN_PTR),y  ; fetch current character\r
-        sta     CURS_SAV        ; save it\r
-        lda     #$A1            ; full white square\r
-        sta     (SCREEN_PTR),y  ; store at cursor position\r
-nocursor:\r
-        jsr     INPUTC\r
-        pha                     ; save retrieved character\r
-        lda     cursor          ; was cursor on?\r
-        beq     nocursor2\r
-        lda     CURS_SAV        ; fetch saved character\r
-        ldy     CURS_X\r
-        sta     (SCREEN_PTR),y  ; store at cursor position\r
-nocursor2:\r
-        pla                     ; restore retrieved character\r
-        rts\r
diff --git a/libsrc/c1p/chline.s b/libsrc/c1p/chline.s
deleted file mode 100644 (file)
index da07e83..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-;
-; based on CBM implementation
-;
-; originally by:
-; Ullrich von Bassewitz, 08.08.1998
-;
-; void chlinexy (unsigned char x, unsigned char y, unsigned char length);
-; void chline (unsigned char length);
-;
-
-        .export         _chlinexy, _chline
-        .import         popa, _gotoxy, cputdirect
-        .importzp       tmp1
-
-_chlinexy:
-        pha                     ; Save the length
-        jsr     popa            ; Get y
-        jsr     _gotoxy         ; Call this one, will pop params
-        pla                     ; Restore the length
-
-_chline:
-        cmp     #0              ; Is the length zero?
-        beq     L9              ; Jump if done
-        sta     tmp1
-L1:     lda     #$94             ; Horizontal line, screen code
-        jsr     cputdirect      ; Direct output
-        dec     tmp1
-        bne     L1
-L9:     rts
diff --git a/libsrc/c1p/clrscr.s b/libsrc/c1p/clrscr.s
deleted file mode 100644 (file)
index ce221f3..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-;\r
-; void clrscr (void);\r
-;\r
-        .export         _clrscr\r
-        .import         plot\r
-        .importzp       CURS_X, CURS_Y\r
-        .include        "c1p.inc"\r
-\r
-; Adapted from the Challenger Character Graphics\r
-; Reference Manual, "2.3.3 MACHINE LANGUAGE SCREEN CLEAR"\r
-; This is self-modifying code!\r
-BANKS = VIDEORAMSIZE / $100\r
-\r
-_clrscr:\r
-        lda       #$20 ;' '\r
-               ldy       #BANKS\r
-               ldx       #$00\r
-staloc:\r
-               sta       SCRNBASE,X\r
-               inx\r
-               bne       staloc\r
-               inc       staloc+2\r
-               dey\r
-               bne       staloc\r
-               lda       #>(SCRNBASE); load high byte\r
-               sta       staloc+2    ; restore base address\r
-\r
-               lda       #$00        ; cursor in upper left corner\r
-        sta       CURS_X\r
-        sta       CURS_Y\r
-               jmp       plot        ; Set the cursor position\r
diff --git a/libsrc/c1p/cputc.s b/libsrc/c1p/cputc.s
deleted file mode 100644 (file)
index ca9152a..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-;
-; cputc/cputcxy for Challenger 1P
-; Based on PET/CBM implementation
-;
-; void cputcxy (unsigned char x, unsigned char y, char c);
-; void cputc (char c);
-;
-        .export         _cputcxy, _cputc, cputdirect, putchar
-        .export         newline, plot
-        .import         popa, _gotoxy
-
-        .include        "c1p.inc"
-        .include        "extzp.inc"
-
-_cputcxy:
-        pha                     ; Save C
-        jsr     popa            ; Get Y
-        jsr     _gotoxy         ; Set cursor, drop x
-        pla                     ; Restore C
-
-; Plot a character - also used as internal function
-
-_cputc: cmp     #$0A            ; CR?
-        bne     L1
-        lda     #0
-        sta     CURS_X
-        beq     plot            ; Recalculate pointers
-
-L1:     cmp     #$0D            ; LF?
-        beq     newline         ; Recalculate pointers
-
-cputdirect:
-        jsr     putchar         ; Write the character to the screen
-
-; Advance cursor position
-
-advance:
-        cpy     SCR_LINELEN     ; xsize-1
-        bne     L3
-        jsr     newline         ; new line
-        ldy     #$FF            ; + cr
-L3:     iny
-        sty     CURS_X
-        rts
-
-newline:
-        inc     CURS_Y
-        lda     CURS_Y
-        cmp     #24             ; screen height 25 lines hardcoded
-        bne     plot
-        lda     #0              ; wrap around to line 0
-        sta     CURS_Y
-
-plot:   ldy     CURS_Y
-        lda     ScrLo,y
-        sta     SCREEN_PTR
-        lda     ScrHi,y
-        sta     SCREEN_PTR+1
-        rts
-
-; Write one character to the screen without doing anything else, return X
-; position in Y
-
-putchar:
-        ldy     CURS_X
-        sta     (SCREEN_PTR),y  ; Set char
-        rts
-
-; Screen address tables - offset to real screen
-
-.rodata
-
-ScrLo:  .byte   $83, $A3, $C3, $E3, $03, $23, $43, $63
-        .byte   $83, $A3, $C3, $E3, $03, $23, $43, $63
-        .byte   $83, $A3, $C3, $E3, $03, $23, $43, $63
-        .byte   $83
-
-ScrHi:  .byte   $D0, $D0, $D0, $D0, $D1, $D1, $D1, $D1
-        .byte   $D1, $D1, $D1, $D1, $D2, $D2, $D2, $D2
-        .byte   $D2, $D2, $D2, $D2, $D3, $D3, $D3, $D3
-        .byte   $D3
diff --git a/libsrc/c1p/crt0.s b/libsrc/c1p/crt0.s
deleted file mode 100644 (file)
index 908943e..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-; ---------------------------------------------------------------------------
-; crt0.s
-; ---------------------------------------------------------------------------
-;
-; Startup code for Ohio Scientific Challenger 1P
-
-.export   _init, _exit
-.import   _main
-
-.export   __STARTUP__ : absolute = 1        ; Mark as startup
-.import   __RAM_START__, __RAM_SIZE__       ; Linker generated
-
-.import    zerobss, initlib, donelib
-
-.include  "zeropage.inc"
-.include  "extzp.inc"
-
-; ---------------------------------------------------------------------------
-; Place the startup code in a special segment
-
-.segment  "STARTUP"
-
-; ---------------------------------------------------------------------------
-; A little light 6502 housekeeping
-
-_init:    ldx     #$FF                 ; Initialize stack pointer to $01FF
-          txs
-          cld                          ; Clear decimal mode
-
-; ---------------------------------------------------------------------------
-; Initialize screen width
-; TODO: Can initialization be done in a more idiomatic way?
-; TODO: Create function for changing screen width
-          lda     #$18
-          sta     SCR_LINELEN
-
-; ---------------------------------------------------------------------------
-; Set cc65 argument stack pointer
-
-          lda     #<(__RAM_START__ + __RAM_SIZE__)
-          sta     sp
-          lda     #>(__RAM_START__ + __RAM_SIZE__)
-          sta     sp+1
-
-; ---------------------------------------------------------------------------
-; Initialize memory storage
-; copydata seems to be only necessary for special systems
-
-          jsr     zerobss              ; Clear BSS segment
-          ; jsr     copydata           ; Initialize DATA segment
-          jsr     initlib              ; Run constructors
-
-; ---------------------------------------------------------------------------
-; Call main()
-
-          jsr     _main
-
-; ---------------------------------------------------------------------------
-; Back from main (this is also the _exit entry):  force a software break
-
-_exit:    jsr     donelib              ; Run destructors
-          brk
diff --git a/libsrc/c1p/ctype.s b/libsrc/c1p/ctype.s
deleted file mode 100644 (file)
index fa901c1..0000000
+++ /dev/null
@@ -1,289 +0,0 @@
-;
-; Character specification table.
-;
-; Ullrich von Bassewitz, 02.06.1998
-; 2003-05-02, Greg King
-;
-; Copied from cbm/ctype.s
-
-; The following 256-byte-wide table specifies attributes for the isxxx type
-; of functions.  Doing it by a table means some overhead in space, but it
-; has major advantages:
-;
-;   * It is fast.  If it weren't for the slow parameter-passing of cc65,
-;     one even could define C-language macroes for the isxxx functions
-;     (as it usually is done, on other platforms).
-;
-;   * It is highly portable.  The only unportable part is the table itself;
-;     all real code goes into the common library.
-;
-;   * We save some code in the isxxx functions.
-
-; This table is taken from Craig S. Bruce's technical docs. for the ACE OS.
-
-        .include        "ctype.inc"
-
-; The table is read-only, put it into the RODATA segment.
-
-        .rodata
-
-__ctype:
-        .byte   CT_CTRL                                 ;   0/00 ___rvs_@___
-        .byte   CT_CTRL                                 ;   1/01 ___rvs_a___
-        .byte   CT_CTRL                                 ;   2/02 ___rvs_b___
-        .byte   CT_CTRL                                 ;   3/03 ___rvs_c___
-        .byte   CT_CTRL                                 ;   4/04 ___rvs_d___
-        .byte   CT_CTRL                                 ;   5/05 ___rvs_e___
-        .byte   CT_CTRL                                 ;   6/06 ___rvs_f___
-        .byte   CT_CTRL                                 ;   7/07 _BEL/rvs_g_
-        .byte   CT_CTRL                                 ;   8/08 ___rvs_h___
-        .byte   CT_CTRL | CT_OTHER_WS | CT_SPACE_TAB    ;   9/09 _TAB/rvs_i_
-        .byte   CT_CTRL | CT_OTHER_WS                   ;  10/0a _BOL/rvs_j_
-        .byte   CT_CTRL                                 ;  11/0b ___rvs_k___
-        .byte   CT_CTRL                                 ;  12/0c ___rvs_l___
-        .byte   CT_CTRL | CT_OTHER_WS                   ;  13/0d _CR_/rvs_m_
-        .byte   CT_CTRL                                 ;  14/0e ___rvs_n___
-        .byte   CT_CTRL                                 ;  15/0f ___rvs_o___
-        .byte   CT_CTRL                                 ;  16/10 ___rvs_p___
-        .byte   CT_CTRL | CT_OTHER_WS                   ;  17/11 _VT_/rvs_q_
-        .byte   CT_CTRL                                 ;  18/12 ___rvs_r___
-        .byte   CT_CTRL | CT_OTHER_WS                   ;  19/13 HOME/rvs_s_
-        .byte   CT_CTRL | CT_OTHER_WS                   ;  20/14 _BS_/rvs_t_
-        .byte   CT_CTRL                                 ;  21/15 ___rvs_u___
-        .byte   CT_CTRL                                 ;  22/16 ___rvs_v___
-        .byte   CT_CTRL                                 ;  23/17 ___rvs_w___
-        .byte   CT_CTRL                                 ;  24/18 ___rvs_x___
-        .byte   CT_CTRL                                 ;  25/19 ___rvs_y___
-        .byte   CT_CTRL                                 ;  26/1a ___rvs_z___
-        .byte   CT_CTRL                                 ;  27/1b ___rvs_[___
-        .byte   CT_CTRL                                 ;  28/1c ___rvs_\___
-        .byte   CT_CTRL | CT_OTHER_WS                   ;  29/1d cursr-right
-        .byte   CT_CTRL                                 ;  30/1e ___rvs_^___
-        .byte   CT_CTRL                                 ;  31/1f _rvs_under_
-        .byte   CT_SPACE | CT_SPACE_TAB                 ;  32/20 ___SPACE___
-        .byte   $00                                     ;  33/21 _____!_____
-        .byte   $00                                     ;  34/22 _____"_____
-        .byte   $00                                     ;  35/23 _____#_____
-        .byte   $00                                     ;  36/24 _____$_____
-        .byte   $00                                     ;  37/25 _____%_____
-        .byte   $00                                     ;  38/26 _____&_____
-        .byte   $00                                     ;  39/27 _____'_____
-        .byte   $00                                     ;  40/28 _____(_____
-        .byte   $00                                     ;  41/29 _____)_____
-        .byte   $00                                     ;  42/2a _____*_____
-        .byte   $00                                     ;  43/2b _____+_____
-        .byte   $00                                     ;  44/2c _____,_____
-        .byte   $00                                     ;  45/2d _____-_____
-        .byte   $00                                     ;  46/2e _____._____
-        .byte   $00                                     ;  47/2f _____/_____
-        .byte   CT_DIGIT | CT_XDIGIT                    ;  48/30 _____0_____
-        .byte   CT_DIGIT | CT_XDIGIT                    ;  49/31 _____1_____
-        .byte   CT_DIGIT | CT_XDIGIT                    ;  50/32 _____2_____
-        .byte   CT_DIGIT | CT_XDIGIT                    ;  51/33 _____3_____
-        .byte   CT_DIGIT | CT_XDIGIT                    ;  52/34 _____4_____
-        .byte   CT_DIGIT | CT_XDIGIT                    ;  53/35 _____5_____
-        .byte   CT_DIGIT | CT_XDIGIT                    ;  54/36 _____6_____
-        .byte   CT_DIGIT | CT_XDIGIT                    ;  55/37 _____7_____
-        .byte   CT_DIGIT | CT_XDIGIT                    ;  56/38 _____8_____
-        .byte   CT_DIGIT | CT_XDIGIT                    ;  57/39 _____9_____
-        .byte   $00                                     ;  58/3a _____:_____
-        .byte   $00                                     ;  59/3b _____;_____
-        .byte   $00                                     ;  60/3c _____<_____
-        .byte   $00                                     ;  61/3d _____=_____
-        .byte   $00                                     ;  62/3e _____>_____
-        .byte   $00                                     ;  63/3f _____?_____
-
-        .byte   $00                                     ;  64/40 _____@_____
-        .byte   CT_LOWER | CT_XDIGIT                    ;  65/41 _____a_____
-        .byte   CT_LOWER | CT_XDIGIT                    ;  66/42 _____b_____
-        .byte   CT_LOWER | CT_XDIGIT                    ;  67/43 _____c_____
-        .byte   CT_LOWER | CT_XDIGIT                    ;  68/44 _____d_____
-        .byte   CT_LOWER | CT_XDIGIT                    ;  69/45 _____e_____
-        .byte   CT_LOWER | CT_XDIGIT                    ;  70/46 _____f_____
-        .byte   CT_LOWER                                ;  71/47 _____g_____
-        .byte   CT_LOWER                                ;  72/48 _____h_____
-        .byte   CT_LOWER                                ;  73/49 _____i_____
-        .byte   CT_LOWER                                ;  74/4a _____j_____
-        .byte   CT_LOWER                                ;  75/4b _____k_____
-        .byte   CT_LOWER                                ;  76/4c _____l_____
-        .byte   CT_LOWER                                ;  77/4d _____m_____
-        .byte   CT_LOWER                                ;  78/4e _____n_____
-        .byte   CT_LOWER                                ;  79/4f _____o_____
-        .byte   CT_LOWER                                ;  80/50 _____p_____
-        .byte   CT_LOWER                                ;  81/51 _____q_____
-        .byte   CT_LOWER                                ;  82/52 _____r_____
-        .byte   CT_LOWER                                ;  83/53 _____s_____
-        .byte   CT_LOWER                                ;  84/54 _____t_____
-        .byte   CT_LOWER                                ;  85/55 _____u_____
-        .byte   CT_LOWER                                ;  86/56 _____v_____
-        .byte   CT_LOWER                                ;  87/57 _____w_____
-        .byte   CT_LOWER                                ;  88/58 _____x_____
-        .byte   CT_LOWER                                ;  89/59 _____y_____
-        .byte   CT_LOWER                                ;  90/5a _____z_____
-        .byte   $00                                     ;  91/5b _____[_____
-        .byte   $00                                     ;  92/5c _____\_____
-        .byte   $00                                     ;  93/5d _____]_____
-        .byte   $00                                     ;  94/5e _____^_____
-        .byte   $00                                     ;  95/5f _UNDERLINE_
-        .byte   $00                                     ;  96/60 _A`_grave__
-        .byte   $00                                     ;  97/61 _A'_acute__
-        .byte   $00                                     ;  98/62 _A^_circum_
-        .byte   $00                                     ;  99/63 _A~_tilde__
-        .byte   $00                                     ; 100/64 _A"_dieres_
-        .byte   $00                                     ; 101/65 _A__ring___
-        .byte   $00                                     ; 102/66 _AE________
-        .byte   $00                                     ; 103/67 _C,cedilla_
-        .byte   $00                                     ; 104/68 _E`_grave__
-        .byte   $00                                     ; 105/69 _E'_acute__
-        .byte   $00                                     ; 106/6a _E^_circum_
-        .byte   $00                                     ; 107/6b _E"_dieres_
-        .byte   $00                                     ; 108/6c _I`_grave__
-        .byte   $00                                     ; 109/6d _I'_acute__
-        .byte   $00                                     ; 110/6e _I^_circum_
-        .byte   $00                                     ; 111/6f _I"_dieres_
-        .byte   $00                                     ; 112/70 _D-_Eth_lr_
-        .byte   $00                                     ; 113/71 _N~_tilde__
-        .byte   $00                                     ; 114/72 _O`_grave__
-        .byte   $00                                     ; 115/73 _O'_acute__
-        .byte   $00                                     ; 116/74 _O^_circum_
-        .byte   $00                                     ; 117/75 _O~_tilde__
-        .byte   $00                                     ; 118/76 _O"_dieres_
-        .byte   $00                                     ; 119/77 __multiply_
-        .byte   $00                                     ; 120/78 _O/_slash__
-        .byte   $00                                     ; 121/79 _U`_grave__
-        .byte   $00                                     ; 122/7a _U'_acute__
-        .byte   $00                                     ; 123/7b _U^_circum_
-        .byte   $00                                     ; 124/7c _U"_dieres_
-        .byte   $00                                     ; 125/7d _Y'_acute__
-        .byte   $00                                     ; 126/7e _cap_thorn_
-        .byte   $00                                     ; 127/7f _Es-sed_B__
-
-        .byte   CT_CTRL                                 ; 128/80 __bullet___
-        .byte   CT_CTRL                                 ; 129/81 __v_line___
-        .byte   CT_CTRL                                 ; 130/82 __h_line___
-        .byte   CT_CTRL                                 ; 131/83 ___cross___
-        .byte   CT_CTRL                                 ; 132/84 _tl_corner_
-        .byte   CT_CTRL                                 ; 133/85 _tr_corner_
-        .byte   CT_CTRL                                 ; 134/86 _bl_corner_
-        .byte   CT_CTRL                                 ; 135/87 _br_corner_
-        .byte   CT_CTRL                                 ; 136/88 ___l_tee___
-        .byte   CT_CTRL                                 ; 137/89 ___r_tee___
-        .byte   CT_CTRL                                 ; 138/8a ___t_tee___
-        .byte   CT_CTRL                                 ; 139/8b ___b_tee___
-        .byte   CT_CTRL                                 ; 140/8c ___heart___
-        .byte   CT_CTRL | CT_OTHER_WS                   ; 141/8d _CR/diamond
-        .byte   CT_CTRL                                 ; 142/8e ___club____
-        .byte   CT_CTRL                                 ; 143/8f ___spade___
-        .byte   CT_CTRL                                 ; 144/90 _s_circle__
-        .byte   CT_CTRL | CT_OTHER_WS                   ; 145/91 _cursor-up_
-        .byte   CT_CTRL                                 ; 146/92 ___pound___
-        .byte   CT_CTRL | CT_OTHER_WS                   ; 147/93 _CLS/check_
-        .byte   CT_CTRL | CT_OTHER_WS                   ; 148/94 __INSert___
-        .byte   CT_CTRL                                 ; 149/95 ____+/-____
-        .byte   CT_CTRL                                 ; 150/96 __divide___
-        .byte   CT_CTRL                                 ; 151/97 __degree___
-        .byte   CT_CTRL                                 ; 152/98 _c_checker_
-        .byte   CT_CTRL                                 ; 153/99 _f_checker_
-        .byte   CT_CTRL                                 ; 154/9a _solid_sq__
-        .byte   CT_CTRL                                 ; 155/9b __cr_char__
-        .byte   CT_CTRL                                 ; 156/9c _up_arrow__
-        .byte   CT_CTRL | CT_OTHER_WS                   ; 157/9d cursor-left
-        .byte   CT_CTRL                                 ; 158/9e _left_arro_
-        .byte   CT_CTRL                                 ; 159/9f _right_arr_
-        .byte   CT_SPACE | CT_SPACE_TAB                 ; 160/a0 _req space_
-        .byte   $00                                     ; 161/a1 _!_invertd_
-        .byte   $00                                     ; 162/a2 ___cent____
-        .byte   $00                                     ; 163/a3 ___pound___
-        .byte   $00                                     ; 164/a4 __currency_
-        .byte   $00                                     ; 165/a5 ____yen____
-        .byte   $00                                     ; 166/a6 _|_broken__
-        .byte   $00                                     ; 167/a7 __section__
-        .byte   $00                                     ; 168/a8 __umulaut__
-        .byte   $00                                     ; 169/a9 _copyright_
-        .byte   $00                                     ; 170/aa __fem_ord__
-        .byte   $00                                     ; 171/ab _l_ang_quo_
-        .byte   $00                                     ; 172/ac ____not____
-        .byte   $00                                     ; 173/ad _syl_hyphn_
-        .byte   $00                                     ; 174/ae _registerd_
-        .byte   $00                                     ; 175/af _overline__
-        .byte   $00                                     ; 176/b0 __degrees__
-        .byte   $00                                     ; 177/b1 ____+/-____
-        .byte   $00                                     ; 178/b2 _2_supersc_
-        .byte   $00                                     ; 179/b3 _3_supersc_
-        .byte   $00                                     ; 180/b4 ___acute___
-        .byte   $00                                     ; 181/b5 ____mu_____
-        .byte   $00                                     ; 182/b6 _paragraph_
-        .byte   $00                                     ; 183/b7 __mid_dot__
-        .byte   $00                                     ; 184/b8 __cedilla__
-        .byte   $00                                     ; 185/b9 _1_supersc_
-        .byte   $00                                     ; 186/ba __mas_ord__
-        .byte   $00                                     ; 187/bb _r_ang_quo_
-        .byte   $00                                     ; 188/bc ____1/4____
-        .byte   $00                                     ; 189/bd ____1/2____
-        .byte   $00                                     ; 190/be ____3/4____
-        .byte   $00                                     ; 191/bf _?_invertd_
-
-        .byte   $00                                     ; 192/c0 _____`_____
-        .byte   CT_UPPER | CT_XDIGIT                    ; 193/c1 _____A_____
-        .byte   CT_UPPER | CT_XDIGIT                    ; 194/c2 _____B_____
-        .byte   CT_UPPER | CT_XDIGIT                    ; 195/c3 _____C_____
-        .byte   CT_UPPER | CT_XDIGIT                    ; 196/c4 _____D_____
-        .byte   CT_UPPER | CT_XDIGIT                    ; 197/c5 _____E_____
-        .byte   CT_UPPER | CT_XDIGIT                    ; 198/c6 _____F_____
-        .byte   CT_UPPER                                ; 199/c7 _____G_____
-        .byte   CT_UPPER                                ; 200/c8 _____H_____
-        .byte   CT_UPPER                                ; 201/c9 _____I_____
-        .byte   CT_UPPER                                ; 202/ca _____J_____
-        .byte   CT_UPPER                                ; 203/cb _____K_____
-        .byte   CT_UPPER                                ; 204/cc _____L_____
-        .byte   CT_UPPER                                ; 205/cd _____M_____
-        .byte   CT_UPPER                                ; 206/ce _____N_____
-        .byte   CT_UPPER                                ; 207/cf _____O_____
-        .byte   CT_UPPER                                ; 208/d0 _____P_____
-        .byte   CT_UPPER                                ; 209/d1 _____Q_____
-        .byte   CT_UPPER                                ; 210/d2 _____R_____
-        .byte   CT_UPPER                                ; 211/d3 _____S_____
-        .byte   CT_UPPER                                ; 212/d4 _____T_____
-        .byte   CT_UPPER                                ; 213/d5 _____U_____
-        .byte   CT_UPPER                                ; 214/d6 _____V_____
-        .byte   CT_UPPER                                ; 215/d7 _____W_____
-        .byte   CT_UPPER                                ; 216/d8 _____X_____
-        .byte   CT_UPPER                                ; 217/d9 _____Y_____
-        .byte   CT_UPPER                                ; 218/da _____Z_____
-        .byte   $00                                     ; 219/db _____{_____
-        .byte   $00                                     ; 220/dc _____|_____
-        .byte   $00                                     ; 221/dd _____}_____
-        .byte   $00                                     ; 222/de _____~_____
-        .byte   $00                                     ; 223/df ___HOUSE___
-        .byte   $00                                     ; 224/e0 _a`_grave__
-        .byte   $00                                     ; 225/e1 _a'_acute__
-        .byte   $00                                     ; 226/e2 _a^_circum_
-        .byte   $00                                     ; 227/e3 _a~_tilde__
-        .byte   $00                                     ; 228/e4 _a"_dieres_
-        .byte   $00                                     ; 229/e5 _a__ring___
-        .byte   $00                                     ; 230/e6 _ae________
-        .byte   $00                                     ; 231/e7 _c,cedilla_
-        .byte   $00                                     ; 232/e8 _e`_grave__
-        .byte   $00                                     ; 233/e9 _e'_acute__
-        .byte   $00                                     ; 234/ea _e^_circum_
-        .byte   $00                                     ; 235/eb _e"_dieres_
-        .byte   $00                                     ; 236/ec _i`_grave__
-        .byte   $00                                     ; 237/ed _i'_acute__
-        .byte   $00                                     ; 238/ee _i^_circum_
-        .byte   $00                                     ; 239/ef _i"_dieres_
-        .byte   $00                                     ; 240/f0 _o^x_Eth_s_
-        .byte   $00                                     ; 241/f1 _n~_tilda__
-        .byte   $00                                     ; 242/f2 _o`_grave__
-        .byte   $00                                     ; 243/f3 _o'_acute__
-        .byte   $00                                     ; 244/f4 _o^_circum_
-        .byte   $00                                     ; 245/f5 _o~_tilde__
-        .byte   $00                                     ; 246/f6 _o"_dieres_
-        .byte   $00                                     ; 247/f7 __divide___
-        .byte   $00                                     ; 248/f8 _o/_slash__
-        .byte   $00                                     ; 249/f9 _u`_grave__
-        .byte   $00                                     ; 250/fa _u'_acute__
-        .byte   $00                                     ; 251/fb _u^_circum_
-        .byte   $00                                     ; 252/fc _u"_dieres_
-        .byte   $00                                     ; 253/fd _y'_acute__
-        .byte   $00                                     ; 254/fe _sm_thorn__
-        .byte   $00                                     ; 255/ff _y"_dieres_
diff --git a/libsrc/c1p/cvline.s b/libsrc/c1p/cvline.s
deleted file mode 100644 (file)
index c485918..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-;
-; based on CBM version
-; originally by:
-; Ullrich von Bassewitz, 08.08.1998
-;
-; void cvlinexy (unsigned char x, unsigned char y, unsigned char length);
-; void cvline (unsigned char length);
-;
-
-        .export         _cvlinexy, _cvline
-        .import         popa, _gotoxy, putchar, newline
-        .importzp       tmp1
-
-_cvlinexy:
-        pha                     ; Save the length
-        jsr     popa            ; Get y
-        jsr     _gotoxy         ; Call this one, will pop params
-        pla                     ; Restore the length and run into _cvline
-
-_cvline:
-        cmp     #0              ; Is the length zero?
-        beq     L9              ; Jump if done
-        sta     tmp1
-L1:     lda     #$95             ; Vertical bar
-        jsr     putchar         ; Write, no cursor advance
-        jsr     newline         ; Advance cursor to next line
-        dec     tmp1
-        bne     L1
-L9:     rts
diff --git a/libsrc/c1p/extzp.inc b/libsrc/c1p/extzp.inc
deleted file mode 100644 (file)
index c5bb2b5..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-;
-; Additional zero page locations for the Challenger 1P.
-;
-
-; ------------------------------------------------------------------------
-
-        .globalzp       CURS_X, CURS_Y, CURS_SAV, SCR_LINELEN, SCREEN_PTR
diff --git a/libsrc/c1p/extzp.s b/libsrc/c1p/extzp.s
deleted file mode 100644 (file)
index c55156f..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-;
-; Additional zero page locations for the Challenger 1P.
-; NOTE: The zeropage locations contained in this file get initialized
-; in the startup code, so if you change anything here, be sure to check
-; not only the linker config, but also the startup file.
-;
-
-; ------------------------------------------------------------------------
-
-        .include        "extzp.inc"
-
-.segment        "EXTZP" : zeropage
-
-CURS_X:         .byte   0
-CURS_Y:         .byte   0
-CURS_SAV:       .byte   0
-SCR_LINELEN:    .byte   24
-SCREEN_PTR:     .res    2
-
-; size 6
-; Adjust size of this segment in c1p.cfg if the size changes
diff --git a/libsrc/c1p/gotox.s b/libsrc/c1p/gotox.s
deleted file mode 100644 (file)
index fb84975..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-;
-; copied from CBM implementation
-; originally by:
-; Ullrich von Bassewitz, 07.08.1998
-;
-; void gotox (unsigned char x);
-;
-        .export         _gotox
-        .import         plot           
-        .importzp       CURS_X
-
-_gotox: sta     CURS_X          ; Set new position
-        jmp     plot            ; And activate it
diff --git a/libsrc/c1p/gotoxy.s b/libsrc/c1p/gotoxy.s
deleted file mode 100644 (file)
index 32d1f1d..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-;
-; copied from CBM implementation
-;
-; originally by:
-; Ullrich von Bassewitz, 06.08.1998
-;
-; void gotoxy (unsigned char x, unsigned char y);
-;
-        .export         _gotoxy
-        .import         popa, plot
-        .importzp       CURS_X, CURS_Y
-
-_gotoxy:
-        sta     CURS_Y          ; Set Y
-        jsr     popa            ; Get X
-        sta     CURS_X          ; Set X
-        jmp     plot            ; Set the cursor position
diff --git a/libsrc/c1p/gotoy.s b/libsrc/c1p/gotoy.s
deleted file mode 100644 (file)
index fcd60dd..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-;
-; copied from CBM implementation
-; originally by:
-; Ullrich von Bassewitz, 0.08.1998
-;
-; void gotoy (unsigned char y);
-;
-        .export         _gotoy
-        .import         plot
-        .importzp       CURS_Y
-
-_gotoy: sta     CURS_Y          ; Set the new position
-        jmp     plot            ; And activate it
diff --git a/libsrc/c1p/oserror.s b/libsrc/c1p/oserror.s
deleted file mode 100644 (file)
index 073691a..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-;
-; dummy implementation for Challenger 1P based on atmos implementation
-;
-; original by
-; Stefan Haubenthal, 2011-04-18
-;
-; int __fastcall__ _osmaperrno (unsigned char oserror);
-; /* Map a system specific error into a system independent code */
-;
-
-        .include        "errno.inc"
-        .export         __osmaperrno
-
-.proc   __osmaperrno
-
-        lda     #<EUNKNOWN
-        ldx     #>EUNKNOWN
-        rts
-
-.endproc
diff --git a/libsrc/c1p/wherex.s b/libsrc/c1p/wherex.s
deleted file mode 100644 (file)
index 7c772a5..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-;
-; Ullrich von Bassewitz, 06.08.1998
-; Copied from cbm/wherex.s
-
-; unsigned char wherex (void);
-;
-        .export         _wherex
-        .import         CURS_X: zp
-
-.proc   _wherex
-        lda     CURS_X
-        ldx     #$00
-        rts
-.endproc
diff --git a/libsrc/c1p/wherey.s b/libsrc/c1p/wherey.s
deleted file mode 100644 (file)
index 7449c1c..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-;
-; Ullrich von Bassewitz, 06.08.1998
-; Copied from cbm/wherey.s
-;
-; unsigned char wherey (void);
-;
-        .export         _wherey
-        .import         CURS_Y: zp
-
-.proc   _wherey
-        lda     CURS_Y
-        ldx     #$00
-        rts
-.endproc
diff --git a/libsrc/osic1p/_scrsize.s b/libsrc/osic1p/_scrsize.s
new file mode 100644 (file)
index 0000000..3b0d71c
--- /dev/null
@@ -0,0 +1,21 @@
+;
+; based on PET implementation
+;
+; originally by:
+; Ullrich von Bassewitz, 26.10.2000
+;
+; Screen size variables
+;
+
+        .export         screensize
+
+        .include        "extzp.inc"
+
+.proc   screensize
+
+        ldx     SCR_LINELEN
+        inx                     ; Variable is one less
+        ldy     #25
+        rts
+
+.endproc
diff --git a/libsrc/osic1p/cclear.s b/libsrc/osic1p/cclear.s
new file mode 100644 (file)
index 0000000..4e18c70
--- /dev/null
@@ -0,0 +1,29 @@
+;
+; Copied from CBM implementation
+;
+; originally by:
+; Ullrich von Bassewitz, 08.08.1998
+;
+; void cclearxy (unsigned char x, unsigned char y, unsigned char length);
+; void cclear (unsigned char length);
+;
+
+        .export         _cclearxy, _cclear
+        .import         popa, _gotoxy, cputdirect
+        .importzp       tmp1
+
+_cclearxy:
+        pha                     ; Save the length
+        jsr     popa            ; Get y
+        jsr     _gotoxy         ; Call this one, will pop params
+        pla                     ; Restore the length and run into _cclear
+
+_cclear:
+        cmp     #0              ; Is the length zero?
+        beq     L9              ; Jump if done
+        sta     tmp1                                 
+L1:     lda     #$20            ; Blank - screen code
+        jsr     cputdirect      ; Direct output
+        dec     tmp1
+        bne     L1
+L9:     rts
diff --git a/libsrc/osic1p/cgetc.s b/libsrc/osic1p/cgetc.s
new file mode 100644 (file)
index 0000000..b5a5196
--- /dev/null
@@ -0,0 +1,29 @@
+;\r
+; char cgetc (void);\r
+;\r
+        .export         _cgetc\r
+        .import         cursor\r
+\r
+        .include        "osic1p.inc"\r
+        .include        "extzp.inc"\r
+\r
+; Input routine from 65V PROM MONITOR, show cursor if enabled\r
+_cgetc:\r
+        lda     cursor          ; show cursor?\r
+        beq     nocursor\r
+        ldy     CURS_X\r
+        lda     (SCREEN_PTR),y  ; fetch current character\r
+        sta     CURS_SAV        ; save it\r
+        lda     #$A1            ; full white square\r
+        sta     (SCREEN_PTR),y  ; store at cursor position\r
+nocursor:\r
+        jsr     INPUTC\r
+        pha                     ; save retrieved character\r
+        lda     cursor          ; was cursor on?\r
+        beq     nocursor2\r
+        lda     CURS_SAV        ; fetch saved character\r
+        ldy     CURS_X\r
+        sta     (SCREEN_PTR),y  ; store at cursor position\r
+nocursor2:\r
+        pla                     ; restore retrieved character\r
+        rts\r
diff --git a/libsrc/osic1p/chline.s b/libsrc/osic1p/chline.s
new file mode 100644 (file)
index 0000000..da07e83
--- /dev/null
@@ -0,0 +1,29 @@
+;
+; based on CBM implementation
+;
+; originally by:
+; Ullrich von Bassewitz, 08.08.1998
+;
+; void chlinexy (unsigned char x, unsigned char y, unsigned char length);
+; void chline (unsigned char length);
+;
+
+        .export         _chlinexy, _chline
+        .import         popa, _gotoxy, cputdirect
+        .importzp       tmp1
+
+_chlinexy:
+        pha                     ; Save the length
+        jsr     popa            ; Get y
+        jsr     _gotoxy         ; Call this one, will pop params
+        pla                     ; Restore the length
+
+_chline:
+        cmp     #0              ; Is the length zero?
+        beq     L9              ; Jump if done
+        sta     tmp1
+L1:     lda     #$94             ; Horizontal line, screen code
+        jsr     cputdirect      ; Direct output
+        dec     tmp1
+        bne     L1
+L9:     rts
diff --git a/libsrc/osic1p/clrscr.s b/libsrc/osic1p/clrscr.s
new file mode 100644 (file)
index 0000000..3297552
--- /dev/null
@@ -0,0 +1,31 @@
+;\r
+; void clrscr (void);\r
+;\r
+        .export         _clrscr\r
+        .import         plot\r
+        .importzp       CURS_X, CURS_Y\r
+        .include        "osic1p.inc"\r
+\r
+; Adapted from the Challenger Character Graphics\r
+; Reference Manual, "2.3.3 MACHINE LANGUAGE SCREEN CLEAR"\r
+; This is self-modifying code!\r
+BANKS = VIDEORAMSIZE / $100\r
+\r
+_clrscr:\r
+        lda       #$20 ;' '\r
+               ldy       #BANKS\r
+               ldx       #$00\r
+staloc:\r
+               sta       SCRNBASE,X\r
+               inx\r
+               bne       staloc\r
+               inc       staloc+2\r
+               dey\r
+               bne       staloc\r
+               lda       #>(SCRNBASE); load high byte\r
+               sta       staloc+2    ; restore base address\r
+\r
+               lda       #$00        ; cursor in upper left corner\r
+        sta       CURS_X\r
+        sta       CURS_Y\r
+               jmp       plot        ; Set the cursor position\r
diff --git a/libsrc/osic1p/cputc.s b/libsrc/osic1p/cputc.s
new file mode 100644 (file)
index 0000000..d343da9
--- /dev/null
@@ -0,0 +1,81 @@
+;
+; cputc/cputcxy for Challenger 1P
+; Based on PET/CBM implementation
+;
+; void cputcxy (unsigned char x, unsigned char y, char c);
+; void cputc (char c);
+;
+        .export         _cputcxy, _cputc, cputdirect, putchar
+        .export         newline, plot
+        .import         popa, _gotoxy
+
+        .include        "osic1p.inc"
+        .include        "extzp.inc"
+
+_cputcxy:
+        pha                     ; Save C
+        jsr     popa            ; Get Y
+        jsr     _gotoxy         ; Set cursor, drop x
+        pla                     ; Restore C
+
+; Plot a character - also used as internal function
+
+_cputc: cmp     #$0A            ; CR?
+        bne     L1
+        lda     #0
+        sta     CURS_X
+        beq     plot            ; Recalculate pointers
+
+L1:     cmp     #$0D            ; LF?
+        beq     newline         ; Recalculate pointers
+
+cputdirect:
+        jsr     putchar         ; Write the character to the screen
+
+; Advance cursor position
+
+advance:
+        cpy     SCR_LINELEN     ; xsize-1
+        bne     L3
+        jsr     newline         ; new line
+        ldy     #$FF            ; + cr
+L3:     iny
+        sty     CURS_X
+        rts
+
+newline:
+        inc     CURS_Y
+        lda     CURS_Y
+        cmp     #24             ; screen height 25 lines hardcoded
+        bne     plot
+        lda     #0              ; wrap around to line 0
+        sta     CURS_Y
+
+plot:   ldy     CURS_Y
+        lda     ScrLo,y
+        sta     SCREEN_PTR
+        lda     ScrHi,y
+        sta     SCREEN_PTR+1
+        rts
+
+; Write one character to the screen without doing anything else, return X
+; position in Y
+
+putchar:
+        ldy     CURS_X
+        sta     (SCREEN_PTR),y  ; Set char
+        rts
+
+; Screen address tables - offset to real screen
+
+.rodata
+
+ScrLo:  .byte   $83, $A3, $C3, $E3, $03, $23, $43, $63
+        .byte   $83, $A3, $C3, $E3, $03, $23, $43, $63
+        .byte   $83, $A3, $C3, $E3, $03, $23, $43, $63
+        .byte   $83
+
+ScrHi:  .byte   $D0, $D0, $D0, $D0, $D1, $D1, $D1, $D1
+        .byte   $D1, $D1, $D1, $D1, $D2, $D2, $D2, $D2
+        .byte   $D2, $D2, $D2, $D2, $D3, $D3, $D3, $D3
+        .byte   $D3
diff --git a/libsrc/osic1p/crt0.s b/libsrc/osic1p/crt0.s
new file mode 100644 (file)
index 0000000..908943e
--- /dev/null
@@ -0,0 +1,62 @@
+; ---------------------------------------------------------------------------
+; crt0.s
+; ---------------------------------------------------------------------------
+;
+; Startup code for Ohio Scientific Challenger 1P
+
+.export   _init, _exit
+.import   _main
+
+.export   __STARTUP__ : absolute = 1        ; Mark as startup
+.import   __RAM_START__, __RAM_SIZE__       ; Linker generated
+
+.import    zerobss, initlib, donelib
+
+.include  "zeropage.inc"
+.include  "extzp.inc"
+
+; ---------------------------------------------------------------------------
+; Place the startup code in a special segment
+
+.segment  "STARTUP"
+
+; ---------------------------------------------------------------------------
+; A little light 6502 housekeeping
+
+_init:    ldx     #$FF                 ; Initialize stack pointer to $01FF
+          txs
+          cld                          ; Clear decimal mode
+
+; ---------------------------------------------------------------------------
+; Initialize screen width
+; TODO: Can initialization be done in a more idiomatic way?
+; TODO: Create function for changing screen width
+          lda     #$18
+          sta     SCR_LINELEN
+
+; ---------------------------------------------------------------------------
+; Set cc65 argument stack pointer
+
+          lda     #<(__RAM_START__ + __RAM_SIZE__)
+          sta     sp
+          lda     #>(__RAM_START__ + __RAM_SIZE__)
+          sta     sp+1
+
+; ---------------------------------------------------------------------------
+; Initialize memory storage
+; copydata seems to be only necessary for special systems
+
+          jsr     zerobss              ; Clear BSS segment
+          ; jsr     copydata           ; Initialize DATA segment
+          jsr     initlib              ; Run constructors
+
+; ---------------------------------------------------------------------------
+; Call main()
+
+          jsr     _main
+
+; ---------------------------------------------------------------------------
+; Back from main (this is also the _exit entry):  force a software break
+
+_exit:    jsr     donelib              ; Run destructors
+          brk
diff --git a/libsrc/osic1p/ctype.s b/libsrc/osic1p/ctype.s
new file mode 100644 (file)
index 0000000..fa901c1
--- /dev/null
@@ -0,0 +1,289 @@
+;
+; Character specification table.
+;
+; Ullrich von Bassewitz, 02.06.1998
+; 2003-05-02, Greg King
+;
+; Copied from cbm/ctype.s
+
+; The following 256-byte-wide table specifies attributes for the isxxx type
+; of functions.  Doing it by a table means some overhead in space, but it
+; has major advantages:
+;
+;   * It is fast.  If it weren't for the slow parameter-passing of cc65,
+;     one even could define C-language macroes for the isxxx functions
+;     (as it usually is done, on other platforms).
+;
+;   * It is highly portable.  The only unportable part is the table itself;
+;     all real code goes into the common library.
+;
+;   * We save some code in the isxxx functions.
+
+; This table is taken from Craig S. Bruce's technical docs. for the ACE OS.
+
+        .include        "ctype.inc"
+
+; The table is read-only, put it into the RODATA segment.
+
+        .rodata
+
+__ctype:
+        .byte   CT_CTRL                                 ;   0/00 ___rvs_@___
+        .byte   CT_CTRL                                 ;   1/01 ___rvs_a___
+        .byte   CT_CTRL                                 ;   2/02 ___rvs_b___
+        .byte   CT_CTRL                                 ;   3/03 ___rvs_c___
+        .byte   CT_CTRL                                 ;   4/04 ___rvs_d___
+        .byte   CT_CTRL                                 ;   5/05 ___rvs_e___
+        .byte   CT_CTRL                                 ;   6/06 ___rvs_f___
+        .byte   CT_CTRL                                 ;   7/07 _BEL/rvs_g_
+        .byte   CT_CTRL                                 ;   8/08 ___rvs_h___
+        .byte   CT_CTRL | CT_OTHER_WS | CT_SPACE_TAB    ;   9/09 _TAB/rvs_i_
+        .byte   CT_CTRL | CT_OTHER_WS                   ;  10/0a _BOL/rvs_j_
+        .byte   CT_CTRL                                 ;  11/0b ___rvs_k___
+        .byte   CT_CTRL                                 ;  12/0c ___rvs_l___
+        .byte   CT_CTRL | CT_OTHER_WS                   ;  13/0d _CR_/rvs_m_
+        .byte   CT_CTRL                                 ;  14/0e ___rvs_n___
+        .byte   CT_CTRL                                 ;  15/0f ___rvs_o___
+        .byte   CT_CTRL                                 ;  16/10 ___rvs_p___
+        .byte   CT_CTRL | CT_OTHER_WS                   ;  17/11 _VT_/rvs_q_
+        .byte   CT_CTRL                                 ;  18/12 ___rvs_r___
+        .byte   CT_CTRL | CT_OTHER_WS                   ;  19/13 HOME/rvs_s_
+        .byte   CT_CTRL | CT_OTHER_WS                   ;  20/14 _BS_/rvs_t_
+        .byte   CT_CTRL                                 ;  21/15 ___rvs_u___
+        .byte   CT_CTRL                                 ;  22/16 ___rvs_v___
+        .byte   CT_CTRL                                 ;  23/17 ___rvs_w___
+        .byte   CT_CTRL                                 ;  24/18 ___rvs_x___
+        .byte   CT_CTRL                                 ;  25/19 ___rvs_y___
+        .byte   CT_CTRL                                 ;  26/1a ___rvs_z___
+        .byte   CT_CTRL                                 ;  27/1b ___rvs_[___
+        .byte   CT_CTRL                                 ;  28/1c ___rvs_\___
+        .byte   CT_CTRL | CT_OTHER_WS                   ;  29/1d cursr-right
+        .byte   CT_CTRL                                 ;  30/1e ___rvs_^___
+        .byte   CT_CTRL                                 ;  31/1f _rvs_under_
+        .byte   CT_SPACE | CT_SPACE_TAB                 ;  32/20 ___SPACE___
+        .byte   $00                                     ;  33/21 _____!_____
+        .byte   $00                                     ;  34/22 _____"_____
+        .byte   $00                                     ;  35/23 _____#_____
+        .byte   $00                                     ;  36/24 _____$_____
+        .byte   $00                                     ;  37/25 _____%_____
+        .byte   $00                                     ;  38/26 _____&_____
+        .byte   $00                                     ;  39/27 _____'_____
+        .byte   $00                                     ;  40/28 _____(_____
+        .byte   $00                                     ;  41/29 _____)_____
+        .byte   $00                                     ;  42/2a _____*_____
+        .byte   $00                                     ;  43/2b _____+_____
+        .byte   $00                                     ;  44/2c _____,_____
+        .byte   $00                                     ;  45/2d _____-_____
+        .byte   $00                                     ;  46/2e _____._____
+        .byte   $00                                     ;  47/2f _____/_____
+        .byte   CT_DIGIT | CT_XDIGIT                    ;  48/30 _____0_____
+        .byte   CT_DIGIT | CT_XDIGIT                    ;  49/31 _____1_____
+        .byte   CT_DIGIT | CT_XDIGIT                    ;  50/32 _____2_____
+        .byte   CT_DIGIT | CT_XDIGIT                    ;  51/33 _____3_____
+        .byte   CT_DIGIT | CT_XDIGIT                    ;  52/34 _____4_____
+        .byte   CT_DIGIT | CT_XDIGIT                    ;  53/35 _____5_____
+        .byte   CT_DIGIT | CT_XDIGIT                    ;  54/36 _____6_____
+        .byte   CT_DIGIT | CT_XDIGIT                    ;  55/37 _____7_____
+        .byte   CT_DIGIT | CT_XDIGIT                    ;  56/38 _____8_____
+        .byte   CT_DIGIT | CT_XDIGIT                    ;  57/39 _____9_____
+        .byte   $00                                     ;  58/3a _____:_____
+        .byte   $00                                     ;  59/3b _____;_____
+        .byte   $00                                     ;  60/3c _____<_____
+        .byte   $00                                     ;  61/3d _____=_____
+        .byte   $00                                     ;  62/3e _____>_____
+        .byte   $00                                     ;  63/3f _____?_____
+
+        .byte   $00                                     ;  64/40 _____@_____
+        .byte   CT_LOWER | CT_XDIGIT                    ;  65/41 _____a_____
+        .byte   CT_LOWER | CT_XDIGIT                    ;  66/42 _____b_____
+        .byte   CT_LOWER | CT_XDIGIT                    ;  67/43 _____c_____
+        .byte   CT_LOWER | CT_XDIGIT                    ;  68/44 _____d_____
+        .byte   CT_LOWER | CT_XDIGIT                    ;  69/45 _____e_____
+        .byte   CT_LOWER | CT_XDIGIT                    ;  70/46 _____f_____
+        .byte   CT_LOWER                                ;  71/47 _____g_____
+        .byte   CT_LOWER                                ;  72/48 _____h_____
+        .byte   CT_LOWER                                ;  73/49 _____i_____
+        .byte   CT_LOWER                                ;  74/4a _____j_____
+        .byte   CT_LOWER                                ;  75/4b _____k_____
+        .byte   CT_LOWER                                ;  76/4c _____l_____
+        .byte   CT_LOWER                                ;  77/4d _____m_____
+        .byte   CT_LOWER                                ;  78/4e _____n_____
+        .byte   CT_LOWER                                ;  79/4f _____o_____
+        .byte   CT_LOWER                                ;  80/50 _____p_____
+        .byte   CT_LOWER                                ;  81/51 _____q_____
+        .byte   CT_LOWER                                ;  82/52 _____r_____
+        .byte   CT_LOWER                                ;  83/53 _____s_____
+        .byte   CT_LOWER                                ;  84/54 _____t_____
+        .byte   CT_LOWER                                ;  85/55 _____u_____
+        .byte   CT_LOWER                                ;  86/56 _____v_____
+        .byte   CT_LOWER                                ;  87/57 _____w_____
+        .byte   CT_LOWER                                ;  88/58 _____x_____
+        .byte   CT_LOWER                                ;  89/59 _____y_____
+        .byte   CT_LOWER                                ;  90/5a _____z_____
+        .byte   $00                                     ;  91/5b _____[_____
+        .byte   $00                                     ;  92/5c _____\_____
+        .byte   $00                                     ;  93/5d _____]_____
+        .byte   $00                                     ;  94/5e _____^_____
+        .byte   $00                                     ;  95/5f _UNDERLINE_
+        .byte   $00                                     ;  96/60 _A`_grave__
+        .byte   $00                                     ;  97/61 _A'_acute__
+        .byte   $00                                     ;  98/62 _A^_circum_
+        .byte   $00                                     ;  99/63 _A~_tilde__
+        .byte   $00                                     ; 100/64 _A"_dieres_
+        .byte   $00                                     ; 101/65 _A__ring___
+        .byte   $00                                     ; 102/66 _AE________
+        .byte   $00                                     ; 103/67 _C,cedilla_
+        .byte   $00                                     ; 104/68 _E`_grave__
+        .byte   $00                                     ; 105/69 _E'_acute__
+        .byte   $00                                     ; 106/6a _E^_circum_
+        .byte   $00                                     ; 107/6b _E"_dieres_
+        .byte   $00                                     ; 108/6c _I`_grave__
+        .byte   $00                                     ; 109/6d _I'_acute__
+        .byte   $00                                     ; 110/6e _I^_circum_
+        .byte   $00                                     ; 111/6f _I"_dieres_
+        .byte   $00                                     ; 112/70 _D-_Eth_lr_
+        .byte   $00                                     ; 113/71 _N~_tilde__
+        .byte   $00                                     ; 114/72 _O`_grave__
+        .byte   $00                                     ; 115/73 _O'_acute__
+        .byte   $00                                     ; 116/74 _O^_circum_
+        .byte   $00                                     ; 117/75 _O~_tilde__
+        .byte   $00                                     ; 118/76 _O"_dieres_
+        .byte   $00                                     ; 119/77 __multiply_
+        .byte   $00                                     ; 120/78 _O/_slash__
+        .byte   $00                                     ; 121/79 _U`_grave__
+        .byte   $00                                     ; 122/7a _U'_acute__
+        .byte   $00                                     ; 123/7b _U^_circum_
+        .byte   $00                                     ; 124/7c _U"_dieres_
+        .byte   $00                                     ; 125/7d _Y'_acute__
+        .byte   $00                                     ; 126/7e _cap_thorn_
+        .byte   $00                                     ; 127/7f _Es-sed_B__
+
+        .byte   CT_CTRL                                 ; 128/80 __bullet___
+        .byte   CT_CTRL                                 ; 129/81 __v_line___
+        .byte   CT_CTRL                                 ; 130/82 __h_line___
+        .byte   CT_CTRL                                 ; 131/83 ___cross___
+        .byte   CT_CTRL                                 ; 132/84 _tl_corner_
+        .byte   CT_CTRL                                 ; 133/85 _tr_corner_
+        .byte   CT_CTRL                                 ; 134/86 _bl_corner_
+        .byte   CT_CTRL                                 ; 135/87 _br_corner_
+        .byte   CT_CTRL                                 ; 136/88 ___l_tee___
+        .byte   CT_CTRL                                 ; 137/89 ___r_tee___
+        .byte   CT_CTRL                                 ; 138/8a ___t_tee___
+        .byte   CT_CTRL                                 ; 139/8b ___b_tee___
+        .byte   CT_CTRL                                 ; 140/8c ___heart___
+        .byte   CT_CTRL | CT_OTHER_WS                   ; 141/8d _CR/diamond
+        .byte   CT_CTRL                                 ; 142/8e ___club____
+        .byte   CT_CTRL                                 ; 143/8f ___spade___
+        .byte   CT_CTRL                                 ; 144/90 _s_circle__
+        .byte   CT_CTRL | CT_OTHER_WS                   ; 145/91 _cursor-up_
+        .byte   CT_CTRL                                 ; 146/92 ___pound___
+        .byte   CT_CTRL | CT_OTHER_WS                   ; 147/93 _CLS/check_
+        .byte   CT_CTRL | CT_OTHER_WS                   ; 148/94 __INSert___
+        .byte   CT_CTRL                                 ; 149/95 ____+/-____
+        .byte   CT_CTRL                                 ; 150/96 __divide___
+        .byte   CT_CTRL                                 ; 151/97 __degree___
+        .byte   CT_CTRL                                 ; 152/98 _c_checker_
+        .byte   CT_CTRL                                 ; 153/99 _f_checker_
+        .byte   CT_CTRL                                 ; 154/9a _solid_sq__
+        .byte   CT_CTRL                                 ; 155/9b __cr_char__
+        .byte   CT_CTRL                                 ; 156/9c _up_arrow__
+        .byte   CT_CTRL | CT_OTHER_WS                   ; 157/9d cursor-left
+        .byte   CT_CTRL                                 ; 158/9e _left_arro_
+        .byte   CT_CTRL                                 ; 159/9f _right_arr_
+        .byte   CT_SPACE | CT_SPACE_TAB                 ; 160/a0 _req space_
+        .byte   $00                                     ; 161/a1 _!_invertd_
+        .byte   $00                                     ; 162/a2 ___cent____
+        .byte   $00                                     ; 163/a3 ___pound___
+        .byte   $00                                     ; 164/a4 __currency_
+        .byte   $00                                     ; 165/a5 ____yen____
+        .byte   $00                                     ; 166/a6 _|_broken__
+        .byte   $00                                     ; 167/a7 __section__
+        .byte   $00                                     ; 168/a8 __umulaut__
+        .byte   $00                                     ; 169/a9 _copyright_
+        .byte   $00                                     ; 170/aa __fem_ord__
+        .byte   $00                                     ; 171/ab _l_ang_quo_
+        .byte   $00                                     ; 172/ac ____not____
+        .byte   $00                                     ; 173/ad _syl_hyphn_
+        .byte   $00                                     ; 174/ae _registerd_
+        .byte   $00                                     ; 175/af _overline__
+        .byte   $00                                     ; 176/b0 __degrees__
+        .byte   $00                                     ; 177/b1 ____+/-____
+        .byte   $00                                     ; 178/b2 _2_supersc_
+        .byte   $00                                     ; 179/b3 _3_supersc_
+        .byte   $00                                     ; 180/b4 ___acute___
+        .byte   $00                                     ; 181/b5 ____mu_____
+        .byte   $00                                     ; 182/b6 _paragraph_
+        .byte   $00                                     ; 183/b7 __mid_dot__
+        .byte   $00                                     ; 184/b8 __cedilla__
+        .byte   $00                                     ; 185/b9 _1_supersc_
+        .byte   $00                                     ; 186/ba __mas_ord__
+        .byte   $00                                     ; 187/bb _r_ang_quo_
+        .byte   $00                                     ; 188/bc ____1/4____
+        .byte   $00                                     ; 189/bd ____1/2____
+        .byte   $00                                     ; 190/be ____3/4____
+        .byte   $00                                     ; 191/bf _?_invertd_
+
+        .byte   $00                                     ; 192/c0 _____`_____
+        .byte   CT_UPPER | CT_XDIGIT                    ; 193/c1 _____A_____
+        .byte   CT_UPPER | CT_XDIGIT                    ; 194/c2 _____B_____
+        .byte   CT_UPPER | CT_XDIGIT                    ; 195/c3 _____C_____
+        .byte   CT_UPPER | CT_XDIGIT                    ; 196/c4 _____D_____
+        .byte   CT_UPPER | CT_XDIGIT                    ; 197/c5 _____E_____
+        .byte   CT_UPPER | CT_XDIGIT                    ; 198/c6 _____F_____
+        .byte   CT_UPPER                                ; 199/c7 _____G_____
+        .byte   CT_UPPER                                ; 200/c8 _____H_____
+        .byte   CT_UPPER                                ; 201/c9 _____I_____
+        .byte   CT_UPPER                                ; 202/ca _____J_____
+        .byte   CT_UPPER                                ; 203/cb _____K_____
+        .byte   CT_UPPER                                ; 204/cc _____L_____
+        .byte   CT_UPPER                                ; 205/cd _____M_____
+        .byte   CT_UPPER                                ; 206/ce _____N_____
+        .byte   CT_UPPER                                ; 207/cf _____O_____
+        .byte   CT_UPPER                                ; 208/d0 _____P_____
+        .byte   CT_UPPER                                ; 209/d1 _____Q_____
+        .byte   CT_UPPER                                ; 210/d2 _____R_____
+        .byte   CT_UPPER                                ; 211/d3 _____S_____
+        .byte   CT_UPPER                                ; 212/d4 _____T_____
+        .byte   CT_UPPER                                ; 213/d5 _____U_____
+        .byte   CT_UPPER                                ; 214/d6 _____V_____
+        .byte   CT_UPPER                                ; 215/d7 _____W_____
+        .byte   CT_UPPER                                ; 216/d8 _____X_____
+        .byte   CT_UPPER                                ; 217/d9 _____Y_____
+        .byte   CT_UPPER                                ; 218/da _____Z_____
+        .byte   $00                                     ; 219/db _____{_____
+        .byte   $00                                     ; 220/dc _____|_____
+        .byte   $00                                     ; 221/dd _____}_____
+        .byte   $00                                     ; 222/de _____~_____
+        .byte   $00                                     ; 223/df ___HOUSE___
+        .byte   $00                                     ; 224/e0 _a`_grave__
+        .byte   $00                                     ; 225/e1 _a'_acute__
+        .byte   $00                                     ; 226/e2 _a^_circum_
+        .byte   $00                                     ; 227/e3 _a~_tilde__
+        .byte   $00                                     ; 228/e4 _a"_dieres_
+        .byte   $00                                     ; 229/e5 _a__ring___
+        .byte   $00                                     ; 230/e6 _ae________
+        .byte   $00                                     ; 231/e7 _c,cedilla_
+        .byte   $00                                     ; 232/e8 _e`_grave__
+        .byte   $00                                     ; 233/e9 _e'_acute__
+        .byte   $00                                     ; 234/ea _e^_circum_
+        .byte   $00                                     ; 235/eb _e"_dieres_
+        .byte   $00                                     ; 236/ec _i`_grave__
+        .byte   $00                                     ; 237/ed _i'_acute__
+        .byte   $00                                     ; 238/ee _i^_circum_
+        .byte   $00                                     ; 239/ef _i"_dieres_
+        .byte   $00                                     ; 240/f0 _o^x_Eth_s_
+        .byte   $00                                     ; 241/f1 _n~_tilda__
+        .byte   $00                                     ; 242/f2 _o`_grave__
+        .byte   $00                                     ; 243/f3 _o'_acute__
+        .byte   $00                                     ; 244/f4 _o^_circum_
+        .byte   $00                                     ; 245/f5 _o~_tilde__
+        .byte   $00                                     ; 246/f6 _o"_dieres_
+        .byte   $00                                     ; 247/f7 __divide___
+        .byte   $00                                     ; 248/f8 _o/_slash__
+        .byte   $00                                     ; 249/f9 _u`_grave__
+        .byte   $00                                     ; 250/fa _u'_acute__
+        .byte   $00                                     ; 251/fb _u^_circum_
+        .byte   $00                                     ; 252/fc _u"_dieres_
+        .byte   $00                                     ; 253/fd _y'_acute__
+        .byte   $00                                     ; 254/fe _sm_thorn__
+        .byte   $00                                     ; 255/ff _y"_dieres_
diff --git a/libsrc/osic1p/cvline.s b/libsrc/osic1p/cvline.s
new file mode 100644 (file)
index 0000000..c485918
--- /dev/null
@@ -0,0 +1,29 @@
+;
+; based on CBM version
+; originally by:
+; Ullrich von Bassewitz, 08.08.1998
+;
+; void cvlinexy (unsigned char x, unsigned char y, unsigned char length);
+; void cvline (unsigned char length);
+;
+
+        .export         _cvlinexy, _cvline
+        .import         popa, _gotoxy, putchar, newline
+        .importzp       tmp1
+
+_cvlinexy:
+        pha                     ; Save the length
+        jsr     popa            ; Get y
+        jsr     _gotoxy         ; Call this one, will pop params
+        pla                     ; Restore the length and run into _cvline
+
+_cvline:
+        cmp     #0              ; Is the length zero?
+        beq     L9              ; Jump if done
+        sta     tmp1
+L1:     lda     #$95             ; Vertical bar
+        jsr     putchar         ; Write, no cursor advance
+        jsr     newline         ; Advance cursor to next line
+        dec     tmp1
+        bne     L1
+L9:     rts
diff --git a/libsrc/osic1p/extzp.inc b/libsrc/osic1p/extzp.inc
new file mode 100644 (file)
index 0000000..c5bb2b5
--- /dev/null
@@ -0,0 +1,7 @@
+;
+; Additional zero page locations for the Challenger 1P.
+;
+
+; ------------------------------------------------------------------------
+
+        .globalzp       CURS_X, CURS_Y, CURS_SAV, SCR_LINELEN, SCREEN_PTR
diff --git a/libsrc/osic1p/extzp.s b/libsrc/osic1p/extzp.s
new file mode 100644 (file)
index 0000000..dfa84a6
--- /dev/null
@@ -0,0 +1,21 @@
+;
+; Additional zero page locations for the Challenger 1P.
+; NOTE: The zeropage locations contained in this file get initialized
+; in the startup code, so if you change anything here, be sure to check
+; not only the linker config, but also the startup file.
+;
+
+; ------------------------------------------------------------------------
+
+        .include        "extzp.inc"
+
+.segment        "EXTZP" : zeropage
+
+CURS_X:         .byte   0
+CURS_Y:         .byte   0
+CURS_SAV:       .byte   0
+SCR_LINELEN:    .byte   24
+SCREEN_PTR:     .res    2
+
+; size 6
+; Adjust size of this segment in osic1p.cfg if the size changes
diff --git a/libsrc/osic1p/gotox.s b/libsrc/osic1p/gotox.s
new file mode 100644 (file)
index 0000000..fb84975
--- /dev/null
@@ -0,0 +1,13 @@
+;
+; copied from CBM implementation
+; originally by:
+; Ullrich von Bassewitz, 07.08.1998
+;
+; void gotox (unsigned char x);
+;
+        .export         _gotox
+        .import         plot           
+        .importzp       CURS_X
+
+_gotox: sta     CURS_X          ; Set new position
+        jmp     plot            ; And activate it
diff --git a/libsrc/osic1p/gotoxy.s b/libsrc/osic1p/gotoxy.s
new file mode 100644 (file)
index 0000000..32d1f1d
--- /dev/null
@@ -0,0 +1,17 @@
+;
+; copied from CBM implementation
+;
+; originally by:
+; Ullrich von Bassewitz, 06.08.1998
+;
+; void gotoxy (unsigned char x, unsigned char y);
+;
+        .export         _gotoxy
+        .import         popa, plot
+        .importzp       CURS_X, CURS_Y
+
+_gotoxy:
+        sta     CURS_Y          ; Set Y
+        jsr     popa            ; Get X
+        sta     CURS_X          ; Set X
+        jmp     plot            ; Set the cursor position
diff --git a/libsrc/osic1p/gotoy.s b/libsrc/osic1p/gotoy.s
new file mode 100644 (file)
index 0000000..fcd60dd
--- /dev/null
@@ -0,0 +1,13 @@
+;
+; copied from CBM implementation
+; originally by:
+; Ullrich von Bassewitz, 0.08.1998
+;
+; void gotoy (unsigned char y);
+;
+        .export         _gotoy
+        .import         plot
+        .importzp       CURS_Y
+
+_gotoy: sta     CURS_Y          ; Set the new position
+        jmp     plot            ; And activate it
diff --git a/libsrc/osic1p/oserror.s b/libsrc/osic1p/oserror.s
new file mode 100644 (file)
index 0000000..073691a
--- /dev/null
@@ -0,0 +1,20 @@
+;
+; dummy implementation for Challenger 1P based on atmos implementation
+;
+; original by
+; Stefan Haubenthal, 2011-04-18
+;
+; int __fastcall__ _osmaperrno (unsigned char oserror);
+; /* Map a system specific error into a system independent code */
+;
+
+        .include        "errno.inc"
+        .export         __osmaperrno
+
+.proc   __osmaperrno
+
+        lda     #<EUNKNOWN
+        ldx     #>EUNKNOWN
+        rts
+
+.endproc
diff --git a/libsrc/osic1p/osic1p.inc b/libsrc/osic1p/osic1p.inc
new file mode 100644 (file)
index 0000000..ad05837
--- /dev/null
@@ -0,0 +1,4 @@
+\r
+SCRNBASE        := $D000    ; Base of video RAM\r
+VIDEORAMSIZE    := $0400    ; Size of C1P video RAM (1 kB)\r
+INPUTC          := $FD00    ; Input character from keyboard\r
diff --git a/libsrc/osic1p/wherex.s b/libsrc/osic1p/wherex.s
new file mode 100644 (file)
index 0000000..7c772a5
--- /dev/null
@@ -0,0 +1,14 @@
+;
+; Ullrich von Bassewitz, 06.08.1998
+; Copied from cbm/wherex.s
+
+; unsigned char wherex (void);
+;
+        .export         _wherex
+        .import         CURS_X: zp
+
+.proc   _wherex
+        lda     CURS_X
+        ldx     #$00
+        rts
+.endproc
diff --git a/libsrc/osic1p/wherey.s b/libsrc/osic1p/wherey.s
new file mode 100644 (file)
index 0000000..7449c1c
--- /dev/null
@@ -0,0 +1,14 @@
+;
+; Ullrich von Bassewitz, 06.08.1998
+; Copied from cbm/wherey.s
+;
+; unsigned char wherey (void);
+;
+        .export         _wherey
+        .import         CURS_Y: zp
+
+.proc   _wherey
+        lda     CURS_Y
+        ldx     #$00
+        rts
+.endproc
diff --git a/src/c1p65.vcxproj b/src/c1p65.vcxproj
deleted file mode 100644 (file)
index dcc8f99..0000000
+++ /dev/null
@@ -1,94 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>\r
-<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">\r
-  <ItemGroup Label="ProjectConfigurations">\r
-    <ProjectConfiguration Include="Debug|Win32">\r
-      <Configuration>Debug</Configuration>\r
-      <Platform>Win32</Platform>\r
-    </ProjectConfiguration>\r
-    <ProjectConfiguration Include="Release|Win32">\r
-      <Configuration>Release</Configuration>\r
-      <Platform>Win32</Platform>\r
-    </ProjectConfiguration>\r
-  </ItemGroup>\r
-  <ItemGroup>\r
-    <ClCompile Include="c1p65\main.c" />\r
-  </ItemGroup>\r
-  <PropertyGroup Label="Globals">\r
-    <ProjectGuid>{4E031DE0-82B4-4204-8529-536626F7E0DF}</ProjectGuid>\r
-    <Keyword>Win32Proj</Keyword>\r
-    <RootNamespace>c1p65</RootNamespace>\r
-  </PropertyGroup>\r
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">\r
-    <ConfigurationType>Application</ConfigurationType>\r
-    <UseDebugLibraries>true</UseDebugLibraries>\r
-    <PlatformToolset>v120</PlatformToolset>\r
-    <CharacterSet>\r
-    </CharacterSet>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">\r
-    <ConfigurationType>Application</ConfigurationType>\r
-    <UseDebugLibraries>false</UseDebugLibraries>\r
-    <PlatformToolset>v120</PlatformToolset>\r
-    <WholeProgramOptimization>true</WholeProgramOptimization>\r
-    <CharacterSet>\r
-    </CharacterSet>\r
-  </PropertyGroup>\r
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />\r
-  <ImportGroup Label="ExtensionSettings">\r
-  </ImportGroup>\r
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
-  </ImportGroup>\r
-  <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
-    <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />\r
-  </ImportGroup>\r
-  <PropertyGroup Label="UserMacros" />\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
-    <LinkIncremental>true</LinkIncremental>\r
-    <OutDir>$(SolutionDir)..\bin\</OutDir>\r
-    <IntDir>$(SolutionDir)..\wrk\$(ProjectName)\$(Configuration)\</IntDir>\r
-  </PropertyGroup>\r
-  <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
-    <LinkIncremental>false</LinkIncremental>\r
-    <OutDir>$(SolutionDir)..\bin\</OutDir>\r
-    <IntDir>$(SolutionDir)..\wrk\$(ProjectName)\$(Configuration)\</IntDir>\r
-  </PropertyGroup>\r
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">\r
-    <ClCompile>\r
-      <PrecompiledHeader>\r
-      </PrecompiledHeader>\r
-      <WarningLevel>Level3</WarningLevel>\r
-      <Optimization>Disabled</Optimization>\r
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <AdditionalIncludeDirectories>common</AdditionalIncludeDirectories>\r
-    </ClCompile>\r
-    <Link>\r
-      <SubSystem>Console</SubSystem>\r
-      <GenerateDebugInformation>true</GenerateDebugInformation>\r
-      <AdditionalDependencies>$(IntDir)..\..\common\$(Configuration)\common.lib</AdditionalDependencies>\r
-    </Link>\r
-  </ItemDefinitionGroup>\r
-  <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">\r
-    <ClCompile>\r
-      <WarningLevel>Level3</WarningLevel>\r
-      <PrecompiledHeader>\r
-      </PrecompiledHeader>\r
-      <Optimization>MaxSpeed</Optimization>\r
-      <FunctionLevelLinking>true</FunctionLevelLinking>\r
-      <IntrinsicFunctions>true</IntrinsicFunctions>\r
-      <PreprocessorDefinitions>_CRT_SECURE_NO_WARNINGS;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>\r
-      <AdditionalIncludeDirectories>common</AdditionalIncludeDirectories>\r
-    </ClCompile>\r
-    <Link>\r
-      <SubSystem>Console</SubSystem>\r
-      <GenerateDebugInformation>true</GenerateDebugInformation>\r
-      <EnableCOMDATFolding>true</EnableCOMDATFolding>\r
-      <OptimizeReferences>true</OptimizeReferences>\r
-      <AdditionalDependencies>$(IntDir)..\..\common\$(Configuration)\common.lib</AdditionalDependencies>\r
-    </Link>\r
-  </ItemDefinitionGroup>\r
-  <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />\r
-  <ImportGroup Label="ExtensionTargets">\r
-  </ImportGroup>\r
-</Project>
\ No newline at end of file
index 50878f47a44256fd2c3c4a2d88d560145116e234..508f49603ed82eea736bad892f94be586e7cb936 100644 (file)
@@ -303,7 +303,7 @@ static void SetSys (const char* Sys)
             NewSymbol ("__SIM65C02__", 1);
             break;
 
-               case TGT_C1P:
+        case TGT_OSIC1P:
             NewSymbol ("__OSIC1P__", 1);
             break;
 
index b8963258d6eb2a581781560ca7959054b530ad57..ece22041a491542c9e0f6245edaeb7464009eff9 100644 (file)
@@ -258,7 +258,7 @@ static void SetSys (const char* Sys)
             DefineNumericMacro ("__SIM65C02__", 1);
             break;
 
-               case TGT_C1P:
+        case TGT_OSIC1P:
             DefineNumericMacro ("__OSIC1P__", 1);
             break;
 
index b909e4d70971d6370bcbd48407e9fc4b5650c3a8..0b44ffa30e6fc7b8a0402350c728561698f226fb 100644 (file)
@@ -131,7 +131,6 @@ static const TargetEntry TargetMap[] = {
     {   "bbc",          TGT_BBC         },
     {   "c128",         TGT_C128        },
     {   "c16",          TGT_C16         },
-       {   "c1p",          TGT_C1P         },
     {   "c64",          TGT_C64         },
     {   "cbm510",       TGT_CBM510      },
     {   "cbm610",       TGT_CBM610      },
@@ -143,6 +142,7 @@ static const TargetEntry TargetMap[] = {
     {   "module",       TGT_MODULE      },
     {   "nes",          TGT_NES         },
     {   "none",         TGT_NONE        },
+    {   "osic1p",       TGT_OSIC1P      },
     {   "pet",          TGT_PET         },
     {   "plus4",        TGT_PLUS4       },
     {   "sim6502",      TGT_SIM6502     },
@@ -163,12 +163,12 @@ static const TargetProperties PropertyTable[TGT_COUNT] = {
     { "atarixl",        CPU_6502,       BINFMT_BINARY,      CTAtari },
     { "vic20",          CPU_6502,       BINFMT_BINARY,      CTPET   },
     { "c16",            CPU_6502,       BINFMT_BINARY,      CTPET   },
-    { "c1p",            CPU_6502,       BINFMT_BINARY,      CTNone  },
     { "c64",            CPU_6502,       BINFMT_BINARY,      CTPET   },
     { "c128",           CPU_6502,       BINFMT_BINARY,      CTPET   },
     { "plus4",          CPU_6502,       BINFMT_BINARY,      CTPET   },
     { "cbm510",         CPU_6502,       BINFMT_BINARY,      CTPET   },
     { "cbm610",         CPU_6502,       BINFMT_BINARY,      CTPET   },
+       { "osic1p",         CPU_6502,       BINFMT_BINARY,      CTNone  },
     { "pet",            CPU_6502,       BINFMT_BINARY,      CTPET   },
     { "bbc",            CPU_6502,       BINFMT_BINARY,      CTNone  },
     { "apple2",         CPU_6502,       BINFMT_BINARY,      CTNone  },
@@ -201,7 +201,7 @@ static int Compare (const void* Key, const void* Entry)
     return strcmp ((const char*) Key, ((const TargetEntry*)Entry)->Name);
 }
 
-
+#include <stdio.h>
 
 target_t FindTarget (const char* Name)
 /* Find a target by name and return the target id. TGT_UNKNOWN is returned if
index 067352deb68734ff035fc4d757d1814b92c84928..edce36fa5ec1852e7a93dc1f1dd76a229719372e 100644 (file)
@@ -59,13 +59,13 @@ typedef enum {
     TGT_ATARIXL,
     TGT_VIC20,
     TGT_C16,
-       TGT_C1P,
     TGT_C64,
     TGT_C128,
     TGT_PLUS4,
     TGT_CBM510,
     TGT_CBM610,
-    TGT_PET,
+       TGT_OSIC1P,
+       TGT_PET,
     TGT_BBC,
     TGT_APPLE2,
     TGT_APPLE2ENH,
@@ -76,7 +76,7 @@ typedef enum {
     TGT_NES,
     TGT_SUPERVISION,
     TGT_LYNX,
-    TGT_SIM6502,
+       TGT_SIM6502,
     TGT_SIM65C02,
     TGT_COUNT                   /* Number of target systems */
 } target_t;