#include #include #include "MagiDoor.h" void md_sendfile(const char *filename, int pause) { FILE *fptr; char c; int lines = 0; fptr = fopen(filename, "r"); if (fptr != NULL) { c = fgetc(fptr); while (!feof(fptr) && c != 0x1a) { if (c == '\n') { lines++; md_printf("\r\n"); if (lines == 22 && pause == TRUE) { md_printf("More (Y/N)"); c = md_getc(); if (tolower(c) == 'n') { fclose(fptr); return; } md_printf("\r\n"); lines = 0; } } else { md_putchar(c); } c = fgetc(fptr); } fclose(fptr); return; } return; }