Saved some more memory by introducing a multi stage boot process:

1. The STARTUP segment handles control over immediately to the BOOT segment.

2. The BOOT segment will be overwritten by the BSS segment. It relocates the CODE segment into the language card and the INIT segment beyond the BSS segment. Then it handles control over to the INIT segment.

3. The INIT segment will be overwritten by the heap. Is initializes the BSS segment (thus destroying the BOOT segment) and the C-Library. Then it handles control over to main().

With this change a very recent cc65 snapshot with INIT segment support is necessary for building.
2 files changed
tree: de50c0346f7246507094e6a7ef0ad4ef8a0b79b8
  1. contiki-apple2/