home *** CD-ROM | disk | FTP | other *** search
/ Turbo Toolbox / Turbo_Toolbox.iso / 1990 / 01 / tricks / b_l_save.inc < prev    next >
Text File  |  1989-10-10  |  1KB  |  33 lines

  1. /* ------------------------------------------------------ */
  2. /*                   B_L-SAVE.INC                         */
  3. /*  -  bload bildet den BASIC Befehl BLOAD nach           */
  4. /*  -  bsave bildet den BASIC Befehl BSAVE nach           */
  5. /*  beide Befehle setzen einen CGA Modus voraus, mit dem  */
  6. /*  Programm B_L-DEMO.C wird die Anwendung demonstriert.  */
  7. /*       (c) 1989  Kurt Windolf  &  TOOLBOX               */
  8. /* ------------------------------------------------------ */
  9. void bload(char *name)
  10. {
  11.   int  i = 0;
  12.   FILE *stream;
  13.  
  14.   stream = fopen(name,"r");
  15.   rewind(stream);
  16.   while(!feof(stream))
  17.     poke(0xb800, i++, fgetc(stream));
  18.   fclose(stream);
  19. }
  20.  
  21. void bsave(char *name)
  22. {
  23.   int j;
  24.   FILE *stream;
  25.  
  26.   stream = fopen(name,"w");
  27.   rewind(stream);
  28.   for (j=0; j < 0x4000; j++)
  29.     fprintf(stream,"%c",peek(0xb800, j));
  30.   fclose(stream);
  31. }
  32. /* ------------------------------------------------------ */
  33. /*                  Ende von B_L-SAVE.INC                 */