I'm new to Jaguar development (hi), and am looking for a way to get VBCC and vlink to compile/link for cartridge address space instead of to RAM, but I can't seem to get it to work.
Obviously, RAM is better + faster for testing, but it'd be nice to know how to make it compile/link at 0x802000 instead of 0x4000 (final game is too big for just RAM, want to take the Jag to a friend's house to show them what I made without lugging a computer along with it, etc.)
Here's what I've got so far.
Test program (main.c):
#include <jaglib.h>
#include <jagcore.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
puts("Hello, Jaguar world!");
for(; {
// live forever
}
}
Compiled with
vc +jaguar-cart.cfg -c99 main.c -o hello-cart.jag
jaguar-cart.cfg is exactly the same as the jaguar config file that comes with VBCC, but supplies a linker script for vlink:
MEMORY {
RAM (!rx) : ORIGIN = 0x004000, LENGTH = 2032K
ROM (rx) : ORIGIN = 0x802000, LENGTH = 6290944
}
SECTIONS {
.text: {
*(.text CODE text)
} > ROM
. = ALIGN(32);
.data: {
_DATA_START = .;
VBCC_CONSTRUCTORS
*(.data DATA data)
_DATA_END = .;
_DATA_INIT = LOADADDR(.data);
} > RAM AT>ROM
.bss (NOLOAD): {
_BSS_START = .;
*(.bss BSS bss)
*(COMMON)
_BSS_END = .;
} > RAM
}
Compiling and flashing to the Skunkboard works, but all I get is a blank screen. Compiling for RAM the normal way and launching with jcp -c hello-ram.jag works fine and shows the text as expected.
What am I missing? Thanks for any help!