diff os9/makerom.c @ 1:3c736a81b886

add disk
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Mon, 02 Jul 2018 19:07:39 +0900
parents 9a224bd9b45f
children 9c2602e1d716
line wrap: on
line diff
--- a/os9/makerom.c	Mon Jul 02 02:12:31 2018 +0900
+++ b/os9/makerom.c	Mon Jul 02 19:07:39 2018 +0900
@@ -8,7 +8,7 @@
 #include <sys/stat.h>
 
 #define IOBASE 0xe000
-#define IOSIZE 0x800
+#define IOSIZE 0x100
 
 typedef struct os9module {
    int size;
@@ -57,6 +57,9 @@
    putchar(*p & 0x7f);
 }
 
+// calcurate position from the botton
+// avoid v09 IO map on 0xe000-0xe800
+// os9p1 have to be last and at 0xf800
 int findLocation(MPTR m, int loc) {
    if (m==0) return loc;
    int top = findLocation(m->next, loc) - m->size;
@@ -106,7 +109,7 @@
  pos = start;
  for(struct os9module *cur = root.next; cur ; cur = cur->next ) {
     if ( cur->size && (cur->name[0]=='O' && cur->name[1]=='S' && cur->name[2]== -71)) {
-       for(; pos < 0xf800 ; pos++) {
+       for(; pos < 0xf800 ; pos++) {   // os9p1 begins at 0xf800
           fputc(0xff,romfile);
        }
     }