diff options
-rw-r--r-- | Start.c | 34 |
1 files changed, 20 insertions, 14 deletions
@@ -49,6 +49,7 @@ #include <chlib.h> extern void exit(long); +extern void kprintf(char *, ...); extern struct ExecBase *SysBase; extern struct DosLibrary *DOSBase; @@ -99,7 +100,7 @@ ULONG radsize; /* Grösse der RAD-Disk */ ULONG radunit; /* Unit-Nummer der RAD-Disk */ UBYTE *fastbase; /* Startadresse des FAST-RAMs für Exec */ -LONG fastsize; /* Grösse des FAST-RAMs für Exec */ +ULONG fastsize; /* Grösse des FAST-RAMs für Exec */ UWORD dmaconsave,intenasave; ULONG attnflags,vblankfreq,sysbplcon0; @@ -129,6 +130,7 @@ local void Maus(UWORD col) } #endif + /***************************************************************************/ /* Gerettetes CHIP-RAM zurückkopieren */ @@ -140,6 +142,7 @@ local void RestoreChipRAM(void) memcpy(mc->Address,mc+1,mc->Size); } + /***************************************************************************/ /* Save-Buffers des CHIP-RAMs freigeben */ @@ -158,6 +161,7 @@ local void FreeChipRAMSaveBuffers(void) printf("Saved Chip-RAM = %ld bytes.\n",size); } + /***************************************************************************/ /* Alles allozierte CHIP-RAM retten und in eine Liste eintragen */ @@ -190,13 +194,13 @@ local BOOL SaveChipRAM(void) break; #ifdef VERBOSE - printf("$%06lx-$%06lx (%lu bytes)", last, last+size-1, size); + kprintf("$%06lx-$%06lx (%lu bytes)", last, last+size-1, size); #endif if (dc = AllocMem(size + sizeof(struct Mem), MEMF_FAST)) { #ifdef VERBOSE - printf("\t -> $%08lx\n", dc+1); + kprintf("\t -> $%08lx\n", dc+1); #endif dc->Next=NULL; dc->Address=(void *)last; @@ -211,7 +215,7 @@ local BOOL SaveChipRAM(void) else { Enable(); - DisownBlitter(); + //DisownBlitter(); printf("Can't allocate %lu bytes FAST RAM\n",size+sizeof(struct Mem)); FreeChipRAMSaveBuffers(); return FALSE; @@ -265,7 +269,7 @@ __saveds void ExitRoutine(ULONG D0, ULONG D1, void *A0, void *A1) SetCACR(oldcacr); WaitBlit(); - DisownBlitter(); + //DisownBlitter(); Enable(); RemakeDisplay(); @@ -359,7 +363,7 @@ radok: if(*(ULONG *)radmem == FFSMAGIC) /* 'DOS1' am Anfang ? */ { ULONG execentry; - printf("RAMDrive: $%08lx (%ldK)\n",radmem,radsize>>10); + kprintf("RAMDrive: $%08lx (%ldK)\n",radmem,radsize>>10); usestacktop = stacktop = (ULONG)SysBase->MaxLocMem; @@ -373,7 +377,7 @@ radok: } } - printf("Chip RAM: $00000000 (%ldK)\n",usestacktop>>10); + kprintf("Chip RAM: $00000000 (%ldK)\n",usestacktop>>10); if(!argv.NoFast) /* Grössten freien FAST-RAM-Block reservieren */ @@ -381,15 +385,14 @@ radok: if(fastsize = AvailMem(MEMF_FAST|MEMF_LARGEST) & ~0xff) { fastsize -= (stacktop-AvailMem(MEMF_CHIP)+10000); - if(fastsize>=10000L) + if((fastsize >= 10000L) && (fastbase = AllocMem(fastsize,MEMF_FAST))) { - fastbase = AllocMem(fastsize,MEMF_FAST); - printf("Fast RAM: $%08lx (%ldK)\n",fastbase,fastsize>>10); + kprintf("Fast RAM: $%08lx (%ldK)\n",fastbase,fastsize>>10); } else { + kprintf("Not enough FAST RAM available (largest: %ld)", fastsize); fastsize=0; - Puts("Not enough FAST RAM available :-)"); } } else Puts("No FAST RAM available."); @@ -398,7 +401,7 @@ radok: /* AB HIER DARF IM CHIP-RAM NICHTS MEHR VERÄNDERT WERDEN */ - OwnBlitter(); + //OwnBlitter(); WaitBlit(); Disable(); @@ -436,7 +439,8 @@ radok: #endif memcpy(NULL,&ExecModuleStart,&ExecModuleEnd-&ExecModuleStart); - for(execentry=0; *(ULONG *)execentry!=INITMAGIC; execentry+=2) ; /* Entry suchen */ + for(execentry=0; *(ULONG *)execentry!=INITMAGIC; execentry+=2) /* Entry suchen */ + ; execentry += 4; if(argv.NoSave) /* Kein Save -> ABORT macht ColdReboot() */ @@ -459,8 +463,9 @@ radok: register __a0 void *,register __a1 void *, register __a2 void *,register __a3 void *); - init =(void *)execentry; + kprintf("\n%s: Running Exec at $%08lx ...\r\n", ident+6, execentry); + init = (void *)execentry; init( attnflags, /* D0 */ sysbplcon0, /* D1 */ vblankfreq, /* D2 */ @@ -471,6 +476,7 @@ radok: fastbase, /* A2 : FAST-Startadresse */ fastbase+fastsize /* A3 : FAST-Endadresse */ ); + ExitRoutine(); /* not reached */ } |