mirror of
https://github.com/cc65/cc65.git
synced 2024-12-23 04:30:10 +00:00
Nominal support for target Ohio Scientific Challenger 1P
This commit is contained in:
parent
c9c66dcfdd
commit
b3b3578f08
30
cfg/c1p.cfg
Normal file
30
cfg/c1p.cfg
Normal file
@ -0,0 +1,30 @@
|
||||
SYMBOLS {
|
||||
__STACKSIZE__: type = weak, value = $0400; # 1k stack
|
||||
}
|
||||
MEMORY {
|
||||
ZP: file = "", define = yes, start = $0002, size = $001A;
|
||||
LOADADDR: file = %O, start = $0FFF, size = $0002;
|
||||
HEADER: file = %O, start = $1001, size = $000C;
|
||||
RAM: file = %O, define = yes, start = $100D, size = $0DF3 - __STACKSIZE__;
|
||||
}
|
||||
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 = ro;
|
||||
RODATA: load = RAM, type = ro;
|
||||
DATA: load = RAM, type = rw;
|
||||
ZPSAVE: load = RAM, type = bss;
|
||||
BSS: load = RAM, type = bss, define = yes;
|
||||
ZEROPAGE: load = ZP, type = zp;
|
||||
}
|
||||
FEATURES {
|
||||
CONDES: type = constructor,
|
||||
label = __CONSTRUCTOR_TABLE__,
|
||||
count = __CONSTRUCTOR_COUNT__,
|
||||
segment = INIT;
|
||||
CONDES: type = destructor,
|
||||
label = __DESTRUCTOR_TABLE__,
|
||||
count = __DESTRUCTOR_COUNT__,
|
||||
segment = RODATA;
|
||||
}
|
@ -15,6 +15,7 @@ TARGETS = apple2 \
|
||||
atari \
|
||||
atarixl \
|
||||
atmos \
|
||||
c1p \
|
||||
$(CBMS) \
|
||||
$(GEOS) \
|
||||
lynx \
|
||||
|
54
libsrc/c1p/crt0.s
Normal file
54
libsrc/c1p/crt0.s
Normal file
@ -0,0 +1,54 @@
|
||||
; ---------------------------------------------------------------------------
|
||||
; 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 copydata, zerobss, initlib, donelib
|
||||
|
||||
.include "zeropage.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
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; Set cc65 argument stack pointer
|
||||
|
||||
LDA #<(__RAM_START__ + __RAM_SIZE__)
|
||||
STA sp
|
||||
LDA #>(__RAM_START__ + __RAM_SIZE__)
|
||||
STA sp+1
|
||||
|
||||
; ---------------------------------------------------------------------------
|
||||
; Initialize memory storage
|
||||
|
||||
; 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
|
||||
|
@ -298,6 +298,10 @@ static void SetSys (const char* Sys)
|
||||
NewSymbol ("__SIM65C02__", 1);
|
||||
break;
|
||||
|
||||
case TGT_C1P:
|
||||
NewSymbol ("__OSIC1P__", 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
AbEnd ("Invalid target name: `%s'", Sys);
|
||||
|
||||
|
@ -254,6 +254,10 @@ static void SetSys (const char* Sys)
|
||||
DefineNumericMacro ("__SIM65C02__", 1);
|
||||
break;
|
||||
|
||||
case TGT_C1P:
|
||||
DefineNumericMacro ("__OSIC1P__", 1);
|
||||
break;
|
||||
|
||||
default:
|
||||
AbEnd ("Unknown target system type %d", Target);
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ struct TargetEntry {
|
||||
};
|
||||
|
||||
/* Table that maps target names to ids. Sorted alphabetically for bsearch.
|
||||
* Allows mupltiple entries for one target id (target name aliases).
|
||||
* Allows multiple entries for one target id (target name aliases).
|
||||
*/
|
||||
static const TargetEntry TargetMap[] = {
|
||||
{ "apple2", TGT_APPLE2 },
|
||||
@ -130,6 +130,7 @@ 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 },
|
||||
@ -160,6 +161,7 @@ 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 },
|
||||
|
@ -58,6 +58,7 @@ typedef enum {
|
||||
TGT_ATARIXL,
|
||||
TGT_VIC20,
|
||||
TGT_C16,
|
||||
TGT_C1P,
|
||||
TGT_C64,
|
||||
TGT_C128,
|
||||
TGT_PLUS4,
|
||||
|
Loading…
Reference in New Issue
Block a user