2 * Minimalistic overlay demo program.
4 * 2009-10-02, Oliver Schmidt (ol.sc@web.de)
16 extern void _OVERLAY1_LOAD__, _OVERLAY1_SIZE__;
17 extern void _OVERLAY2_LOAD__, _OVERLAY2_SIZE__;
18 extern void _OVERLAY3_LOAD__, _OVERLAY3_SIZE__;
23 printf ("Log: %s\n", msg);
27 #pragma code-name (push, "OVERLAY1");
31 log ("Calling main from overlay 1");
34 #pragma code-name (pop);
37 #pragma code-name (push, "OVERLAY2");
41 log ("Calling main from overlay 2");
44 #pragma code-name (pop);
47 #pragma code-name (push, "OVERLAY3");
51 log ("Calling main from overlay 3");
54 #pragma code-name(pop);
57 unsigned char loadfile (char *name, void *addr, void *size)
59 int file = open (name, O_RDONLY);
61 log ("Opening overlay file failed");
65 read (file, addr, (unsigned) size);
73 log ("Calling overlay 1 from main");
74 if (loadfile ("ovrldemo.1", &_OVERLAY1_LOAD__, &_OVERLAY1_SIZE__)) {
78 log ("Calling overlay 2 from main");
79 if (loadfile ("ovrldemo.2", &_OVERLAY2_LOAD__, &_OVERLAY2_SIZE__)) {
83 log ("Calling overlay 3 from main");
84 if (loadfile ("ovrldemo.3", &_OVERLAY3_LOAD__, &_OVERLAY3_SIZE__)) {