Ok I figured out how to link objects (had to edit the objects file). Why doesn't this code work now?
| | | #include "sgl.h" // Required for basic sgl functions #include "sgl_cd.h" // Required for cd access #include "stdlib.h" // Don't know why I need this...don't feel like burning another cd to find out #include "fld_load.h" #define MAX_FILE 128 // Needed for CD functions #define READSECT 50 // Needed for CD functions Sint32 dirwork[SLCD_WORK_SIZE(MAX_FILE)/sizeof(Sint32)]; // Needed for CD function //Uint8 readbuf[(READSECT*CDBUF_FORM1/sizeof(Uint8))]; // Needed for CD function void ss_main(void) { void (*readbuf)(void); Sint32 ndir; CDHN cdhn; CDKEY key[2]; CDBUF buf[2]; Sint32 stat; Sint32 len[2]; Sint32 ypos=1; readbuf = (void*)0x0200000; slInitSystem(TV_320x224, NULL, 1); // Initializes screen ndir=slCdInit(MAX_FILE, dirwork); // initializes cd slPrint("SlCdInit:", slLocate(1, ypos)); slPrintFX(toFIXED(ndir), slLocate(11, ypos)); ypos++; key[0].cn=key[0].sm =key[0].ci=CDKEY_NON E; key[1].cn=CDKEY_TER M; cdhn=slCdOpen("fld_knl.bin", key); // opens cd slPrint("slCdOpen:", slLocate(1,ypos)); slDispHex((Uint32)cdhn, slLocate(11, ypos)); buf[0].type=CDBUF_C OPY; buf[0].trans.copy.a ddr=readbuf; buf[0].trans.copy.u nit=CDBUF_FORM1; buf[0].trans.copy.s ize=READSECT; buf[1].type=CDBUF_T ERM; slCdLoadFile(cdhn,buf); // loads file from cd ypos++; while(stat=CDSTAT_C OMPLETED) { slSynch(); stat=slCdGetStatus(cdhn, len); slPrint("stat:", slLocate(1, ypos)); slDispHex((Uint32)stat, slLocate(7, ypos)); ypos++; if(ypos>=27) ypos=1; if(stat==CDSTAT_COMPLETED) break; if(len[0]==CDBUF_FORM1* READSECT) { slCdResetBuf(cdhn, &(key[0])); } } slPrint("Bin final test loaded......................", slLocate(1,ypos)); FLD_ExecGame("GAMEIP.BIN", "DEATH", 1); //Sint32 FLD_ExecGame(Sint8 *ip_name, Sint8 *dir_name, Sint32 tno); slPrint("Exit...", slLocate(1,ypos)); while(1) { slSynch(); } } |
It displays the first slPrint, then the screen goes blanks, and then nothing. Also it seems as it's not copying the dukeip.bin to anyplace in memory. Any way to do an entire memory dump on satourne? If I can't get this to run, I'm going to start working on following the steps from the demo-demo loader doc.... |