SYMBOLS {
    __STACKSIZE__: type = weak, value = $0200;
}
MEMORY {
    ZP:      file = "", start = $0002, size = $00FE, type = rw, define = yes;
    PRGRAM:  file = "", start = $0200, size = $600, define = yes;
    DVGRAM:  file = "", start = $2000, size = $800, define = yes;

    # PRG ROM @ $9000 - $FFFF
    # - startup
    # - code
    # - rodata
    # - data (load)
    MAIN:  file = %O, start = $9000, size = $6FFA, fill = yes, define = yes;

    # CPU vectors
    VECTORS: file = %O, start = $FFFA, size = $0006, fill = yes;

    # DVG ROM @ $2800 - $5FFF
    DVGROM:  file = %O, start = $2800, size = $3800, fill = yes, define = yes;

}
SEGMENTS {
    ZEROPAGE: load = ZP,              type = zp;
    STARTUP:  load = MAIN,            type = ro,  define   = yes;
    LOWCODE:  load = MAIN,            type = ro,  optional = yes;
    CODE:     load = MAIN,            type = ro,  define   = yes;
    RODATA:   load = MAIN,            type = ro,  define   = yes;
    DATA:     load = MAIN, run = PRGRAM, type = rw,  define   = yes;
    ONCE:     load = MAIN,            type = ro,  define   = yes, optional = yes;
    VECTORS:  load = VECTORS,         type = ro;
    DVGROM:   load = DVGROM,          type = ro,  optional = yes;
    BSS:      load = PRGRAM,          type = bss, define   = yes;
}
FEATURES {
    CONDES: type    = constructor,
            label   = __CONSTRUCTOR_TABLE__,
            count   = __CONSTRUCTOR_COUNT__,
            segment = ONCE;
    CONDES: type    = destructor,
            label   = __DESTRUCTOR_TABLE__,
            count   = __DESTRUCTOR_COUNT__,
            segment = RODATA;
    CONDES: type    = interruptor,
            label   = __INTERRUPTOR_TABLE__,
            count   = __INTERRUPTOR_COUNT__,
            segment = RODATA,
            import  = __CALLIRQ__;
}
