1
0
mirror of https://github.com/cc65/cc65.git synced 2024-06-08 15:29:37 +00:00

Redesigned GEOS VLIR linking:

- No more post-linking with resource compiler, rather ld65 directly creates the VLIR CVT file.
- No more dynamic linker config creation, rather the built-in 'geos' config is usable both for SEQ CVT and VLIR CVT files.

ToDos:
- Have ld65 accept alignment to $FD.
- Adjust docs / samples.

git-svn-id: svn://svn.cc65.org/cc65/trunk@5314 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
ol.sc 2011-12-26 22:54:04 +00:00
parent 1947d15c48
commit d810ed97d2
4 changed files with 646 additions and 647 deletions

View File

@ -7,7 +7,7 @@
.export _exit
.export __STARTUP__ : absolute = 1 ; Mark as startup
.import __RAM_START__, __RAM_SIZE__ ; Linker generated
.import __VLIR0_START__, __VLIR0_SIZE__ ; Linker generated
.import __STACKSIZE__ ; Linker generated
.import initlib, donelib
.import callmain
@ -26,9 +26,9 @@
; Setup stack
lda #<(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
lda #<(__VLIR0_START__ + __VLIR0_SIZE__ + __STACKSIZE__)
sta sp
lda #>(__RAM_START__ + __RAM_SIZE__ + __STACKSIZE__)
lda #>(__VLIR0_START__ + __VLIR0_SIZE__ + __STACKSIZE__)
sta sp+1 ; Set argument stack ptr
; Call module constructors

File diff suppressed because it is too large Load Diff

View File

@ -1,77 +0,0 @@
/* I hope that no one will be able to create a .grc bigger than this... */
#define BLOODY_BIG_BUFFER 65000
/* there are no 6MB GEOS binaries... I hope! */
#define THIS_BUFFER_IS_SOOO_HUGE 6000000
struct menuitem {
char *name;
char *type;
char *target;
struct menuitem *next; };
struct menu {
char *name;
int top, left;
int bot, right;
char *type;
struct menuitem *item; };
struct appheader {
int year,month,day,hour,min;
int mode;
int dostype;
int geostype;
int structure;
char *dosname;
char *classname;
char *version;
char *author;
char *info; };
const char *mainToken[] = {
"MENU", "HEADER", "ICON", "DIALOG", "VLIR", "" };
const char *hdrFTypes[] = {
"APPLICATION", "AUTO_EXEC", "DESK_ACC", "ASSEMBLY", "DISK_DEVICE", "PRINTER", "SYSTEM", "" };
const char *hdrFields[] = {
"author", "info", "date", "dostype", "mode", "structure", "" };
const char *hdrDOSTp[] = {
"seq", "SEQ", "prg", "PRG", "usr", "USR", "" };
const char *hdrStructTp[] = {
"seq", "SEQ", "vlir", "VLIR", "" };
const char *hdrModes[] = {
"any", "40only", "80only", "c64only", "" };
const int BSWTab[] = { 0,
0x005, 0x007, 0x00b, 0x011, 0x017,
0x01d, 0x023, 0x025, 0x029, 0x02d, 0x033, 0x039, 0x03c, 0x041, 0x043,
0x04a, 0x04f, 0x052, 0x056, 0x05a, 0x05f, 0x063, 0x068, 0x06d, 0x072,
0x077, 0x079, 0x07c, 0x080, 0x084, 0x088, 0x08e, 0x094, 0x09a, 0x09f,
0x0a4, 0x0a9, 0x0ad, 0x0b1, 0x0b6, 0x0bc, 0x0be, 0x0c2, 0x0c8, 0x0cc,
0x0d4, 0x0da, 0x0e0, 0x0e5, 0x0eb, 0x0f0, 0x0f5, 0x0f9, 0x0fe, 0x104,
0x10c, 0x112, 0x118, 0x11e, 0x121, 0x129, 0x12c, 0x132, 0x13a, 0x13e,
0x143, 0x148, 0x14d, 0x152, 0x157, 0x15a, 0x15f, 0x164, 0x166, 0x168,
0x16d, 0x16f, 0x177, 0x17c, 0x182, 0x187, 0x18c, 0x18f, 0x193, 0x196,
0x19b, 0x1a1, 0x1a9, 0x1af, 0x1b4, 0x1ba, 0x1be, 0x1c0, 0x1c4, 0x1ca,
0x1d2, 0x1dd };
const unsigned char icon1[] = {
255, 255, 255, 128, 0, 1, 128, 0, 1, 128, 0, 1, 128, 0, 1, 128, 0, 1,
128, 0, 1, 128, 0, 1, 128, 0, 1, 128, 0, 1, 128, 0, 1,
128, 0, 1, 128, 0, 1, 128, 0, 1, 128, 0, 1, 128, 0, 1,
128, 0, 1, 128, 0, 1, 128, 0, 1, 128, 0, 1, 255, 255, 255 };
char *ProgName; /* for AbEnd, later remove and use common/cmdline.h */
char *outputCName=NULL, *outputSName=NULL, *outputVName=NULL;
FILE *outputCFile, *outputSFile, *outputVFile;
int CFnum=0, SFnum=0, VFnum=0;
int forceFlag=0;
char outputCMode[2]="w";
char outputSMode[2]="w";
char outputVMode[2]="w";

View File

@ -1,22 +1,64 @@
SYMBOLS {
__STACKSIZE__: type = weak, value = $0400; # 1k stack
__STACKSIZE__: type = weak, value = $0400; # 1k stack
__OVERLAYSIZE__: type = weak, value = $0000; # no overlays by default
__OVERLAYADDR__: type = weak, value = $6000 - __OVERLAYSIZE__;
}
MEMORY {
ZP: file = "", define = yes, start = $0058, size = $0028;
HEADER: file = %O, start = $0204, size = $01FC;
RAM: file = %O, define = yes, start = $0400, size = $5C00 - __STACKSIZE__;
CVT: file = %O, start = $0, size = $80000;
ZP: define = yes, start = $58, size = $1A + $06;
VLIR0: define = yes, start = $0400, size = __OVERLAYADDR__ - __STACKSIZE__ - $0400;
VLIR1: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR2: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR3: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR4: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR5: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR6: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR7: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR8: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR9: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR10: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR11: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR12: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR13: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR14: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR15: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR16: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR17: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR18: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
VLIR19: define = yes, start = __OVERLAYADDR__, size = __OVERLAYSIZE__;
}
SEGMENTS {
HEADER: load = HEADER, type = ro;
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;
BSS: load = RAM, type = bss, define = yes;
ZEROPAGE: load = ZP, type = zp;
EXTZP: load = ZP, type = zp;
ZEROPAGE: type = zp, load = ZP;
EXTZP: type = zp, load = ZP;
DIRENTRY: type = ro, load = CVT, align = $FE;
FILEINFO: type = ro, load = CVT, align = $FE;
RECORDS: type = ro, load = CVT, align = $FE, optional = yes;
STARTUP: type = ro, run = VLIR0, load = CVT, align_load = $FE, define = yes;
LOWCODE: type = ro, run = VLIR0, load = CVT, optional = yes;
INIT: type = ro, run = VLIR0, load = CVT, define = yes, optional = yes;
CODE: type = ro, run = VLIR0, load = CVT;
RODATA: type = ro, run = VLIR0, load = CVT;
DATA: type = rw, run = VLIR0, load = CVT;
BSS: type = bss, load = VLIR0, define = yes;
OVERLAY1: type = ro, run = VLIR1, load = CVT, align_load = $FE, optional = yes;
OVERLAY2: type = ro, run = VLIR2, load = CVT, align_load = $FE, optional = yes;
OVERLAY3: type = ro, run = VLIR3, load = CVT, align_load = $FE, optional = yes;
OVERLAY4: type = ro, run = VLIR4, load = CVT, align_load = $FE, optional = yes;
OVERLAY5: type = ro, run = VLIR5, load = CVT, align_load = $FE, optional = yes;
OVERLAY6: type = ro, run = VLIR6, load = CVT, align_load = $FE, optional = yes;
OVERLAY7: type = ro, run = VLIR7, load = CVT, align_load = $FE, optional = yes;
OVERLAY8: type = ro, run = VLIR8, load = CVT, align_load = $FE, optional = yes;
OVERLAY9: type = ro, run = VLIR9, load = CVT, align_load = $FE, optional = yes;
OVERLAY10: type = ro, run = VLIR10, load = CVT, align_load = $FE, optional = yes;
OVERLAY11: type = ro, run = VLIR11, load = CVT, align_load = $FE, optional = yes;
OVERLAY12: type = ro, run = VLIR12, load = CVT, align_load = $FE, optional = yes;
OVERLAY13: type = ro, run = VLIR13, load = CVT, align_load = $FE, optional = yes;
OVERLAY14: type = ro, run = VLIR14, load = CVT, align_load = $FE, optional = yes;
OVERLAY15: type = ro, run = VLIR15, load = CVT, align_load = $FE, optional = yes;
OVERLAY16: type = ro, run = VLIR16, load = CVT, align_load = $FE, optional = yes;
OVERLAY17: type = ro, run = VLIR17, load = CVT, align_load = $FE, optional = yes;
OVERLAY18: type = ro, run = VLIR18, load = CVT, align_load = $FE, optional = yes;
OVERLAY19: type = ro, run = VLIR19, load = CVT, align_load = $FE, optional = yes;
}
FEATURES {
CONDES: segment = INIT,