Przeglądaj źródła

emul: embed blkfs in forth binary

This will allow us to read from blkfs in tests.
pull/102/head
Virgil Dupras 4 lat temu
rodzic
commit
b5c370a936
2 zmienionych plików z 8 dodań i 1 usunięć
  1. +1
    -1
      emul/Makefile
  2. +7
    -0
      emul/forth.c

+ 1
- 1
emul/Makefile Wyświetl plik

@@ -58,7 +58,7 @@ blkfs: $(BLKPACK)
blkfs-bin.h: blkfs $(BIN2C)
$(BIN2C) BLKFS < blkfs > $@

forth: forth.c $(OBJS) forth1-bin.h blkfs
forth: forth.c $(OBJS) forth1-bin.h blkfs-bin.h
$(CC) forth.c $(OBJS) -o $@

libz80/libz80.o: libz80/z80.c


+ 7
- 0
emul/forth.c Wyświetl plik

@@ -4,6 +4,7 @@
#include <termios.h>
#include "emul.h"
#include "forth1-bin.h"
#include "blkfs-bin.h"

// in sync with glue.asm
#define RAMSTART 0x900
@@ -102,6 +103,12 @@ int main(int argc, char *argv[])
return 1;
}
blkfp = fopen("blkfs", "r+");
if (blkfp) {
fprintf(stderr, "Using blkfs file\n");
} else {
blkfp = fmemopen((char*)BLKFS, sizeof(BLKFS), "r");
fprintf(stderr, "Using in-memory read-only blkfs\n");
}
Machine *m = emul_init();
m->ramstart = RAMSTART;
m->iord[STDIO_PORT] = iord_stdio;


Ładowanie…
Anuluj
Zapisz