Jump to content
IGNORED

Core Wars


OX.

Recommended Posts

Found this C source code without any compiled version to run, does anyone know if it's for TI99/4A or Geneve?

 

/* COREW_C  The game of Core War, as described by A.K. Dewdney in
**		  the May 1984 issue of Scientific American (pp 14-24)
**
**  Copyright (c) 1984 Kevin A. Bjorke
**  Released to the Public Domain for Non-Commercial Use Only
**
**  c99 conversion by Clint Pulley - last edit 990418 1820
*/
/* Opcode format :
**
** Since the Redcode Instruction set has only 9 instruction and 3 addressing
** modes, the code is split into three fields:
**
**  Bit:  7 6 5 4 3 2 1 0
**	    a a b b i i i i
**
** where a = mode of argument a
**	   b = mode of argument b
**	   i = instruction (0-8 -- 9-15 treated as 0, or invalid)
**
** modes:  0 = immediate    1 = direct    2 = indirect
*/
#include "hds1.c99.h.STDIO_H"
#include "hds1.c99.h.CTYPE_H"
#include "hds1.c99.h.STRING_H"
#include "hds1.c99.h.STDLIB_H"
#include "corew_h"
/*
** Global Variables **
*/
char *proga,*progb;  /* names of the battle programs */
char *line;	 /* input buffer */
int pc[2];	  /* Redcode program counters */
int toss,b1,b2; /* Variables for random starting loc */
int bot,top;    /* Start/end location counters */
int instr;	  /* Current instruction */
int modea,modeb;/* Current addressing modes -- see below */
int now;	    /* programs 0 and 1 (pc index) */
int a,b,res;    /* working storage for Redcode instructions */
int show;	   /* used to differentiate between showing and executing code */
int fulist;	 /* flag for full list option */
int *code;	  /* Redcode Instructions */
int *arga;	  /* Battle Prog Arguments */
int *argb;	  /* Total: 6 bytes per "location" */
FILE fp;
/*
** Main Program **
*/
main()
{ proga=malloc(41);
 progb=malloc(41);
 line=malloc(20);
 code=malloc(2*MAXSIZE);
 arga=malloc(2*MAXSIZE);
 argb=malloc(2*MAXSIZE);
 randomize();
 while (TRUE) {
   logo();
   clean();
   prepare();
   fight();
   puts("\nList Memory? ");
   if (toupper(getchar()) == 'Y') showmem(0,MAXSIZE);
   puts("\n\nPlay Again (Y/N) ? ");
   if (toupper(getchar()) != 'Y') break;
 }
 puts("\n\n\tThththththat\'s all, folks....\n");
}
/* Advertise the program and get game options
*/
logo()
{ puts("\f\n\n\t\t****************************************\n");
 puts("\t\t**								    **\n");
 puts("\t\t**		  C O R E    W A R		  **\n");
 puts("\t\t**								    **\n");
 puts("\t\t****************************************\n\n\n");
 printf("\t\t   Core memory size = %4d locations\n\n",MAXSIZE);
 printf("\t\tMARS Version %s   Kevin Bjorke 5/28/84\n\n",VERSION);
 printf("\t\tc99 conversion by Clint Pulley  %s\n\n",REVDATE);
 puts( "\t\t\tFull listings? (y/n) ");
 fulist=0;
 if(toupper(getchar())=='Y')fulist=1;
 puts("\n\n");
}
/* Input Routines **
*/
/* Read in both programs
*/
prepare()
{ char *p;
 puts("\n\tEnter the name of Battle-Program A: ");
 gets(proga);
 puts("\n\tEnter the name of Battle-Program B: ");
 gets(progb);
 for (p = progb; *p; ++p)
   *p = toupper(*p);
 for (p = proga; *p; ++p)
   *p = toupper(*p);
 toss=rnd(2);
 b=MAXSIZE/5;
 b1 = rnd(b);
 b2 =(MAXSIZE / 2)+rnd(b);
 if(toss) bot=b1;
 else bot=b2;
 if ((fp = fopen(proga,"r")) == NULL) {
   printf("\f\n\nPlease enter code for %s:\n\n",proga);
   top = getprog(proga,bot);
 } else top = fgetprog(fp,bot);
 printf("\nNow listing Program %s:\n",proga);
 showmem(bot,top);
 pc[0] = bot;
 getpc(0);
 if(toss) bot=b2;
 else bot=b1;
 if ((fp = fopen(progb,"r")) == NULL) {
   printf("\f\n\nPlease enter code for %s:\n\n",progb);
   top = getprog(progb,bot);
 } else top = fgetprog(fp,bot);
 printf("\nNow listing Program %s:\n",progb);
 showmem(bot,top);
 pc[1] = bot;
 getpc(1);
}
/* get a program from the keyboard
*/
getprog(prg,ct) char *prg; int ct;
{ int i,row; char *pt;
 row = 10;
 puts("Enter program one line at a time.\n");
 puts("Pressing RETURN between arguments.\n");
 puts("	 Use END to finish\n\n");
 header(9);
 while (TRUE) {
   modea = modeb = DIRECT;
   locate(row,1);
   stout(ct);
   locate(row,10);
   gets(line);
   for (i = 0; line[i]; ++i) {
  if ((line[i] == '\t') || (line[i] == ' ')) line[i] = '\0';
  line[i] = toupper(line[i]);
   }
   if ((i = getinst(ct)) == NULL) break;
   if (i == ERROR) {
  locate(row,10);
  puts("\007???\n");
  continue;
   }
   locate(row,50);
   puts(line);
   if (code[ct] != 0) {
  locate(row,20);
  gets(line);
  pt = line;
  locate(row,60);
  if (*pt == '@') {
    puts("Indirect");
    modea = INDEXED;
    ++pt;
  } else if (*pt == '#') {
    puts("Immediate");
    modea = IMMEDIATE;
    ++pt;
  }  else puts("Direct");
  i = atoi(pt);
  arga[ct] = i;
   }
   if (code[ct] != 4) {
  locate(row,30);
  gets(line);
  pt = line;
  locate(row,70);
  if (*pt == '@') {
    puts("Indirect");
    modeb = INDEXED;
    ++pt;
  } else if (*pt == '#') {
    puts("Immediate");
    modeb = IMMEDIATE;
    ++pt;
  } else puts("Direct");
  i = atoi(pt);
  argb[ct] = i;
   }
   modea = modea*64;
   modeb = modeb*16;
   code[ct] = code[ct]+(modea&192)+(modeb&48);
   ++ct;
   if ((++row) > 23) {
  row = 2;
  puts("\f");
  header(1);
   }
 }
 printf("\n\tCode for %s completed.\n",prg);
 return(ct);
}
/* get a program from a file
*/
fgetprog(prg,ct) int prg,ct;
{ int i; char *pt;
 puts("\nNow reading program file...\n\n");
 while (TRUE) {
   modea = modeb = DIRECT;
   if (nextword(prg) == FALSE) break;
   if ((i = getinst(ct)) == NULL) break;
   if (i == ERROR) {
  puts("\007\nError - file fouled up!!!\n");
  exit(7);
   }
   if (code[ct] != 0) {
  nextword(prg);
  arga[ct] = rdarg(&modea);
   }
   if (code[ct] != 4) {
  nextword(prg);
  argb[ct] = rdarg(&modeb);
   }
   modea = modea*64;
   modeb = modeb*16;
   code[ct] = code[ct]+(modea&192)+(modeb&48);
   ++ct;
 }
 fclose(prg);
 return(ct);
}
/* select an instruction from the value in line[]
*/
getinst(indx) int indx;
{ if (strcmp(line,"MOV") == NULL) code[indx] = 1;
 else if (strcmp(line,"ADD") == NULL) code[indx] = 2;
 else if (strcmp(line,"SUB") == NULL) code[indx] = 3;
 else if (strcmp(line,"JMP") == NULL) code[indx] = 4;
 else if (strcmp(line,"JMZ") == NULL) code[indx] = 5;
 else if (strcmp(line,"JMG") == NULL) code[indx] = 6;
 else if (strcmp(line,"DJZ") == NULL) code[indx] = 7;
 else if (strcmp(line,"CMP") == NULL) code[indx] = 8;
 else if (strcmp(line,"DAT") == NULL) code[indx] = 0;
 else if (strcmp(line,"END") == NULL) return(NULL);
 else return(ERROR);
 return(TRUE);
}
/* get an argument value from line[]
*/
rdarg(md) int *md;
{ char *pt; int i;
 pt = line;
 if (*pt == '@') {
   *md = INDEXED;
   ++pt;
 } else if (*pt == '#') {
   *md = IMMEDIATE;
   ++pt;
 }
 i = atoi(pt);
 return(i);
}
/* set the program counters to their initial locations
*/
getpc(i) int i;
{ puts("\nStart execution at location: ");
 gets(line);
 pc[i] = reladr(atoi(line),0);
}
/* print programming header on screen
*/
header(rw) int rw;
{ locate(rw,1);
 puts("Addr");
 locate(rw,10);
 puts("Instr");
 locate(rw,20);
 putchar('A');
 locate(rw,30);
 putchar('B');
 locate(rw,55);
 puts("Modes:");
}
/* Get the next word from a TEXTfile, making sure to capitalize
*/
nextword(fil) int fil;
{ char *pt; int c;
 pt = line;
 c = '\t';
 while (isspace(c)) if ((c = toupper(getc(fil))) == EOF) return (FALSE);
 while (!isspace(c)) {
   *pt++ = c;
   if ((c = toupper(getc(fil))) == EOF) return (FALSE);
 }
 *pt++ = '\0';
 return(TRUE);
}
/* Show memory
*/
showmem(start,finish) int start, finish;
{ int ct;
 printf("\n\nAddresses %4d through %4d.\n",start,(finish-1));
 puts("\nPress ^E to Abort, any other key to pause\n\n");
 show = TRUE;
 for (ct = start; ct < finish; ++ct) {
   readloc(ct);
   putchar('\n');
   if (keypaus() == ENQ) break;
 }
}
/* MASTER BATTLE ROUTINES **
*/
/* Fight it out
*/
fight()
{ int ct, i; char *w;
 show = FALSE;
 w=NULL;
 puts("\n\tPRESS ANY KEY TO BEGIN ");
 while(poll(0)); while(!poll(0));
 puts("\f\t\t\tBeginning Battle!!!\n\n");
 puts("\tPress ^E to Abort, any other key to pause\n\n");
 printf("\tLeft side is  %s\n\tRight side is %s\n\n\n",proga,progb);
 for (ct = 0; ct < CUTOFF; ++ct) {
   if ((ct % 5) == 0) putchar('\n');
   stout(ct);
   now = 0;
   if (readloc(pc[0]) == NULL) {
  w=progb;
  break;
   }
   puts("  ");
   now = 1;
   if (readloc(pc[1]) == NULL) {
  w=proga;
  break;
   }
   putchar('\n');
   if (keypaus() == ENQ) break;
   for (i = 0; i <2; ++i)
  pc[i] = reladr(pc[i],0);
 }
 sound(30,220,0,440,1,880,3);
 printf("\n\nBattle Completed after %d instruction cycles!\n\n",ct);
 if (ct == CUTOFF || !w) puts("The outcome is a DRAW\n");
 else printf("The winning program is %s\n",w);
}
/* read a location, print the mnemonic, and perform it
*/
readloc(loc) int loc;
{ instr = modea = modeb = code[loc];
 instr = instr&15;
 modea = (modea / 64) & 3;
 modeb = (modeb / 16) & 3;
 res = -1;
 switch(instr) {
case 1 : mov(); break;
case 2 : add(); break;
case 3 : sub(); break;
case 4 : jmp(); break;
case 5 : jmz(); break;
case 6 : jmg(); break;
case 7 : djz(); break;
case 8 : cmp(); break;
default: puts("DAT");
 if(fulist && !show) puts("		    ");
 res = NULL;
 }
 printf(" %c%4d %c%4d [%4d]",mnem(modea),
   arga[loc],mnem(modeb),argb[loc],loc);
 return(res);
}
/* functions to perform Redcode operations **
*/
/* Redcode MOV instruction
*/
mov()
{ puts("MOV");
 if (show) return(NULL);
 b = findadr(pc[now], argb, modeb);
 if (modea == IMMEDIATE) {
   code[b] = 0;	  /* make it a DAT */
   argb[b] = arga[pc[now]];
   if(fulist) printf("|#%4d>%4d|",arga[pc[now]],b);
 } else {
   a = findadr(pc[now], arga, modea);
   if(fulist) printf("| %4d>%4d|",a,b);
   code[b] = code[a];
   arga[b] = arga[a];
   argb[b] = argb[a];
 }
 ++pc[now];
}
/* Redcode ADD instruction
*/
add()
{ puts("ADD");
 if (show) return(NULL);
 b = findadr(pc[now], argb, modeb);
 if (modea == IMMEDIATE) {
   argb[b] = argb[b]+arga[pc[now]];
   if(fulist) printf("|#%4d+%4d|",arga[pc[now]],b);
 } else {
   a = findadr(pc[now], arga, modea);
   if(fulist) printf("| %4d+%4d|",b,a);
   argb[b] = argb[b]+arga[a];
 }
 ++pc[now];
}
/* Redcode SUB instruction
*/
sub()
{ puts("SUB");
 if (show) return(NULL);
 b = findadr(pc[now], argb, modeb);
 if (modea == IMMEDIATE) {
   argb[b] = argb[b]-arga[pc[now]];
   if(fulist) printf("|%4d-#%4d|",b,arga[pc[now]]);
 } else {
   a = findadr(pc[now], arga,modea);
   if(fulist) printf("|%4d- %4d|",b,a);
   argb[b] = argb[b]-arga[a];
 }
 ++pc[now];
}
/* Redcode JMP Instruction
*/
jmp()
{ puts("JMP");
 if (show) return(NULL);
 pc[now] = findadr(pc[now], arga, modea);
 if(fulist) printf("| %4d	 |",pc[now]);
}
/* Redcode JMZ instruction
*/
jmz()
{ puts("JMZ");
 if (show) return(NULL);
 b = findadr(pc[now], argb, modeb);
 if(fulist) printf("| %4d	 |",b);
 if (argb[b] == 0) pc[now] = findadr(pc[now], arga, modea);
 else ++pc[now];
}
/* Redcode JMG Instruction
*/
jmg()
{ puts("JMG");
 if (show) return(NULL);
 b = findadr(pc[now], argb, modeb);
 if(fulist) printf("| %4d	 |",b);
 if (argb[b] > 0) pc[now] = findadr(pc[now], arga, modea);
 else ++pc[now];
}
/* Redcode DJZ Instruction
*/
djz()
{ puts("DJZ");
 if (show) return(NULL);
 b = findadr(pc[now], argb, modeb);
 if(fulist) printf("| %4d	 |",b);
 if ((--argb[b]) == NULL) pc[now] = findadr(pc[now], arga, modea);
 else ++pc[now];
}
/* Redcode CMP Instruction
*/
cmp()
{ puts("CMP");
 if (show) return(NULL);
 if (modea != IMMEDIATE) {
   a = findadr(pc[now], arga, modea);
   a = argb[a];
 } else a = arga[pc[now]];
 if (modeb != IMMEDIATE) {
   b = findadr(pc[now], argb, modeb);
   b = argb[b];
 } else b = argb[pc[now]];
 ++pc[now];
 if(fulist) printf("|%4d==%4d|",a,b);
 if (a != b) ++pc[now];
}
/* Addressing Routines **
*/
/* find an address via direct or indirect
*/
findadr(orig,pab,mod) int orig, *pab, mod;
{ int p;
 if (mod == IMMEDIATE) return(orig);
 p = reladr(orig,pab[orig]);
 if (mod == INDEXED) p = reladr(p,argb[p]);
 return(p);
}
/* return an absolute address in the circular arena from a relative one
*/
reladr(abs,rel) int abs,rel;
{ int j;
 if ((j = abs + rel) >= MAXSIZE) j = reladr((j - MAXSIZE),0);
 else if (j < 0) j = reladr((j + MAXSIZE),0);
 return(j);
}
/* Miscellaneous routines **
*/
/* Start with a "clean slate" in the battle-code arena
*/
clean()
{ int i;
 for (i = 0; i < MAXSIZE; ++i) {
   code[i] = '\0';
   arga[i] = NULL;
   argb[i] = NULL;
 }
}
/* return appropriate character for addressing modes
*/
mnem(c) int c;
{ c = c&255;
 if (c == IMMEDIATE) return('#');
 else if (c == INDEXED) return('@');
 else return('.');
}
/* print a string to stderr from an integer <= 9999
*/
stout(i) int i;
{ printf("%4d:",i);
}
/* pause if key pressed - return key value
*/
keypaus()
{ int c;
 c=poll(0);
 while(poll(0));
 return(c);
}

Link to comment
Share on other sites

Just offhand, what makes it Geneve specific? I'm not seeing anything with a quick scan of the source...? I went so far as to try a quick port to Windows.. seems to be all console I/O except for a single call sound, which the 4A could do. :)

 

That said, the header isn't included so I don't know how big the program can be, or how to actually play it... :)

Link to comment
Share on other sites

Just offhand, what makes it Geneve specific? I'm not seeing anything with a quick scan of the source...? I went so far as to try a quick port to Windows.. seems to be all console I/O except for a single call sound, which the 4A could do. :)

 

That said, the header isn't included so I don't know how big the program can be, or how to actually play it... :)

 

hmm, possible TI99/4A conversion here?

Link to comment
Share on other sites

The header says it's a c99 source code, by the author of c99 no less, so I'd have to assume yes. If not, it's not hard to put together a quick memory allocator. ;) It never frees the memory it allocates so they could just as easily be statically defined.

Link to comment
Share on other sites

The header says it's a c99 source code, by the author of c99 no less, so I'd have to assume yes. If not, it's not hard to put together a quick memory allocator. ;) It never frees the memory it allocates so they could just as easily be statically defined.

 

So we can has Core Wars 4A ;-)

Link to comment
Share on other sites

I downloaded the original string of articles on Core Wars as published in Scientific American, and it seems to me that a version could be done in XB or even TI BASIC. How fast it will run is a different animal though. A few years ago I programmed Robot War in XB which also used pseudocode to program the robots, and it's just a matter of modifying the interpreter to accommodate the 9 Redcode instructions and their arguments as well as the addressing scheme.

The original game used a "core memory" with 8000 addresses, each potentially containing a single integer. Assuming 1 byte per integer, that 7.81K needed for the memory array, which should leave plenty of space for the rest of the code (maybe, if coded very efficiently and depending on the display options). From what I have seen on You Tube, most representations of the playing field were simply strings of boxes filling up the screen, one for each memory location, and a color scheme to represent the different numeric values in each. One would then watch the screen light up with a variety of colors as the war programs battled it out. While this is a nifty representation, it does present a problem on the TI: clearly, we can't use bitmap here because of the eight byte horizontal color limitation on the TI, and multicolor mode can only give us 3200 screen locations. Obviously XB or TI BASIC only have 768 screen locations. Sooo, either a different screen representation has to be devised, or the memory array has to be reduced in size. I am more in favor of the former so as to stay as faithful to the original game as possible.

Any suggestions here? How did Clint represent the playing field with his c99 program?

 

EDIT: Upon reading subsequent articles on Core War, it appears that a new instruction, namely SPL, was officially added to the original 9 Redcode instructions, bringing them up to a total of 10. SPL allows the splitting on the execution stream of a particular program into 2 separate processes, which can be repeated indefinitely. This obviously complicates the design of Code War significantly because now we have to keep track of a large number of separate processes. SPL was not implemented by Clint Pulley in his c99 version. The main limiting factor to the use of SPL is the fact that each SPL slows down the execution of the resulting separate streams by half since the interpreter executes only one instruction at a time, alternating between the 2 (or more) battle programs.

Edited by Vorticon
Link to comment
Share on other sites

  • 5 months later...

What kind of color density is needed for a bitmap visual representation? At 1-byte per memory location, the max possible colors would be 255, but that many colors would be useless to a human as far as meaningful information. It might look cool or pretty, but would not tell you much. Beyond about 5 or 6 colors per pixel and a human would begin to forget what they mean.

 

The F18A can provide up to four colors per pixel with the Bitmap Layer, and up to eight colors in ECM3 using tiles. The 90x90 or so grid could be represented with 144 8x8 tiles, so it would be possible to do a seven color bitmap display for the field.

Link to comment
Share on other sites

Here's a TI Forth version of Core War I just completed based on the original 1984 Redcode instructions. Since there are only 9 of these, I had more than enough colors to use from the standard palette.

This version has an 832 address core memory and uses the TI Forth integrated editor for battle program entry. The original IMP, DWARF and GEMINI battle bots are included.

Please refer to the PDF manual for instructions on loading and battle program development.

 

http://www.youtube.com/watch?v=pkjJCxK32tw

 

I would love to launch a friendly competition to see who can come up with the deadliest battle program, and I have a ready prize for the winner!

 

Note: This program will run in V9t9, Win994a and Classic99 as well as real hardware with 32K RAM and 2 disk drives. However, in Classic99, you won't be able to save your battle programs. There seems to be some issue with MESS running this at the moment.

 

The attached zip file contains the latest version of Core War as of 12/6/2012 and an updated manual.

COREWAR.zip

Edited by Vorticon
  • Like 1
Link to comment
Share on other sites

Excellent job! Major thumbs up! :thumbsup: :thumbsup:

 

I'm very impressed that you did this in Forth! How did you find the "Forth experience"?

 

Is the game in bitmap mode? I must admit, I don't really understand what it is I'm looking at. Can you explain how the game works?

 

[ EDIT: Ah I see there's a PDF in the ZIP file...! ]

Link to comment
Share on other sites

Thanks :) Forth is unlike anything I have ever used before, and it took some getting used to. Being a relatively low level language, I had to figure out how to do simple things like placing text on the graphics screen or making sounds etc... It's also a tricky language to debug from a standpoint of structure. It's major advantage is its modularity in that I can break the program into small screens that can be debugged individually. It still takes me 2-3 times as much time to create a Forth program compared to XB, comparable to assembly programming. But I'm much more comfortable with the language now, and I'm starting to explore advanced topics. Turbo Forth is clearly a more advanced version of Forth than TI Forth, and I plan on switching over to it once the new cart is released. My hope is to be able to come up with a bitmap library for it because most of the programs I create require bitmap graphics :-D .

Core War uses the split bitmap mode of TI Forth, where the top 2/3 of the screen is bitmap graphics and the bottom 1/3 is standard console text mode.

And yeah, Core War has been dubbed the "programmer's game", and there is certainly some truth to that. But with only 9 instructions and 3 addressing modes, it's quite easy to pick up, although surprising complexity can arise from such a small set of instructions. It's definitely not an arcade game though he he...

Edited by Vorticon
Link to comment
Share on other sites

Nice work Walid, got it working in Classic99 but your TI Forth disk image does'nt want to play in MESS, tried it with a version of TI Forth I already had and it seems to just lock up after the 91 load command, yet still works fine in Classic99, any ideas?

Link to comment
Share on other sites

Nice work Walid, got it working in Classic99 but your TI Forth disk image does'nt want to play in MESS, tried it with a version of TI Forth I already had and it seems to just lock up after the 91 load command, yet still works fine in Classic99, any ideas?

 

Right now I'm having a little trouble with MESS; but, trying it on Classic99, I see that DISK_HI is 90. It should be 180 for two 90KB disks. IIRC Classic99 does not use a regular TI DSR for disk emulating disk access. It works on Classic99, but shouldn't because attempting to load beyond screen 89 should fail with DISK_HI containing 90. Once you load TI Forth, type the following to change DISK_HI to 180:

 

180 DISK_HI !

91 LOAD

 

I can't guarantee this is the problem because I can't check it until I get MESS working for me again. :(

 

..lee

Link to comment
Share on other sites

Sorry OX but I don't have MESS. The TIF image runs fine in Classic 99, Win994a and V9t9, so I'm not sure why it would not do so in MESS... Lee does use MESS for his Forh work, so maybe he can pitch in.

 

Walid...

 

I haven't finished reading your manual, but I noticed something you may want to correct. You say that screens 119-189 are available for the user. I believe it should be 119-179 for a two-90KB-disk system.

 

...lee

Link to comment
Share on other sites

Right now I'm having a little trouble with MESS; but, trying it on Classic99, I see that DISK_HI is 90. It should be 180 for two 90KB disks. IIRC Classic99 does not use a regular TI DSR for disk emulating disk access. It works on Classic99, but shouldn't because attempting to load beyond screen 89 should fail with DISK_HI containing 90. Once you load TI Forth, type the following to change DISK_HI to 180:

 

180 DISK_HI !

91 LOAD

 

I can't guarantee this is the problem because I can't check it until I get MESS working for me again. :(

 

..lee

 

Lee, on screen 91, I set DISK_HI to 180. I know, technically this should be set prior to loading a screen above 89, but it seems to work fine on real hardware and all the emulators I tested... I stumbled across this anomaly accidentally during my early experiments with Forth, and I used this fact to avoid having the user set DISK_HI to a 2 disk environment prior to loading the program.

Edited by Vorticon
Link to comment
Share on other sites

Lee, on screen 91, I set DISK_HI to 180. I know, technically this should be set prior to loading a screen above 89, but it seems to work fine on real hardware and all the emulators I tested... I stumbled across this anomaly accidentally during my early experiments with Forth, and I used this fact to avoid having the user set DISK_HI to a 2 disk environment prior to loading the program.

 

H-m-m-m---I need to look into that one to see where (if?) it is used in TI Forth. :-o

 

...lee

Link to comment
Share on other sites

Right now I'm having a little trouble with MESS; but, trying it on Classic99, I see that DISK_HI is 90. It should be 180 for two 90KB disks. IIRC Classic99 does not use a regular TI DSR for disk emulating disk access. It works on Classic99, but shouldn't because attempting to load beyond screen 89 should fail with DISK_HI containing 90. Once you load TI Forth, type the following to change DISK_HI to 180:

 

180 DISK_HI !

91 LOAD

 

I can't guarantee this is the problem because I can't check it until I get MESS working for me again. :(

 

..lee

 

It made no difference Lee, I'm using MESS 140.

Link to comment
Share on other sites

It made no difference Lee, I'm using MESS 140.

 

OK... TIF.DSK seems to be corrupted in some way---at least, for use with MESS. The attached file should work. It should also work with Classic99; but, like Walid said, you can't save anything because Classic99 won't do sector writes.

 

...lee

 

TIF-Vorticon.zip

Link to comment
Share on other sites

Sorry OX but I don't have MESS. The TIF image runs fine in Classic 99, Win994a and V9t9, so I'm not sure why it would not do so in MESS... Lee does use MESS for his Forh work, so maybe he can pitch in.

 

Walid...

 

My last post has a TI Forth DSK file that I tried to make the same as yours (the one that doesn't play nice with MESS). You might want to check it to see that I got it right.

 

...lee

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...