Problems making a config for CC65

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Problems making a config for CC65
by on (#84574)
I'm trying to get my code to start at $C000, but my cc65 config file isn't working.. What am I doing wrong?

Code:
MEMORY {
  ZP:     start = $0, size = $ff, type = rw;

  HEADER: start = 0, size = $0010, type = ro, file = %O, fill=yes, fillval=$00;
  RAM:    start = $0200, size = $0600, type = rw;
  ROM:  start = $C000, size = $C000, type = ro, file = %O, fill=yes, fillval=$FF;

}

SEGMENTS {
  ZEROPAGE: load = ZP, type = zp;
  BSS:      load = RAM, type = bss, define = yes, align = $100;

  INESHDR:  load = HEADER, type = ro, align = $10;
  BANK:   load = ROM, type = ro, align = $100;
  VECT:   load = ROM, type = ro, start = $FFFA;

  }

FILES {
  %O: format = bin;
}


What is happening is the code is starting at $8000 after explicitly telling the segment to start at $C000 and my vectors are missing at the end of the file. What am I doing wrong?

by on (#84575)
Start $c000 and size $c000 too? The size should be $4000 with this start value.

by on (#84577)
Ugh! I fail at hex math :(

Found a more elegant setup anyway..

Code:
MEMORY {
   ZP:      start = $0, size = $ff, type = rw;
   HEADER:   start = 0, size = $0010, type = ro, file = %O, fill=yes, fillval=$00;
   WRAM:   start = $0200, size = $0600, type = rw;
   RAM:   start = $8000, size = $4000, type = rw fill=yes, fillval=$FF;
   ROM:   start = $c000, size = $4000, type = ro;
}

SEGMENTS {
   INESHDR:  load = HEADER, type = ro, align = $10;
   BSS:      load = WRAM, type = bss, define = yes, align = $100;
   DATA:     load = RAM, type = rw;
   CODE:     load = ROM, type = ro;
   VECTORS:  load = ROM, type = ro, start = $fffa;
}
 

by on (#84578)
halkun wrote:
Code:
   RAM:   start = $8000, size = $4000, type = rw fill=yes, fillval=$FF;

What mapper has RAM here?

Quote:
DATA: load = RAM, type = rw;

How, from power-on to when it is used, does the data get loaded into RAM?