Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
189
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.06 KB | None | 0 0
  1. #include <exec/types.h>
  2. #include <exec/memory.h>
  3.  
  4. #include <proto/exec.h>
  5. #include <proto/dos.h>
  6. #include <proto/intuition.h>
  7. #include <proto/expansion.h>
  8.  
  9. #include <stdlib.h>
  10. #include <stdio.h>
  11. #include <string.h>
  12.  
  13. struct Library   *ExpansionBase = NULL;
  14.  
  15. int main (int argc, char ** argv)
  16. {
  17.   struct ConfigDev *configDev;
  18.  
  19.   if((ExpansionBase=OpenLibrary("expansion.library",0L))==NULL)
  20.   {
  21.     printf("FATAL: Unable to open expansion.library\n");
  22.     exit(RETURN_FAIL);
  23.   }
  24.  
  25.   // Now we can use expansion.library
  26.  
  27.   configDev = NULL;
  28.   configDev = AllocConfigDev();
  29.  
  30.   if (configDev == NULL)
  31.   {
  32.     printf("FATAL: unable to allocate the config dev structure\n");
  33.     exit(RETURN_FAIL);    
  34.   }
  35.  
  36.   // read the expansion ROM
  37.   ReadExpansionRom(EZ3_EXPANSIONBASE, configDev );
  38.  
  39.   for (int i = 0; i < 10; i++)
  40.     {
  41.       printf("tick %d\n", i);
  42.     }
  43.  
  44.   printf("INFO: Board Found. Configuring\n");
  45.   configDev->cd_BoardAddr = (void *) EZ3_EXPANSIONBASE;
  46.   ConfigBoard(EZ3_EXPANSIONBASE, configDev );
  47.  
  48.   CloseLibrary(ExpansionBase);
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement