1
0
mirror of https://github.com/aap/pdp6.git synced 2026-04-03 20:52:56 +00:00

small changes

This commit is contained in:
aap
2019-04-09 07:47:01 +02:00
parent cf1c868ae0
commit 05611ad2ec
5 changed files with 101 additions and 6558 deletions

View File

@@ -3,8 +3,8 @@ H=pdp6.h ../tools/pdp6common.h threading.h
# clang
#CFLAGS= -Wno-shift-op-parentheses -Wno-logical-op-parentheses \
# -Wno-bitwise-op-parentheses
CFLAGS= -O3 -Wall -Wno-parentheses -fno-diagnostics-show-caret
#CFLAGS= -g -Wall -Wno-parentheses -fno-diagnostics-show-caret
CFLAGS= -g -O3 -Wall -Wno-parentheses -fno-diagnostics-show-caret
#CFLAGS= -g -Wall -Wno-parentheses -fno-diagnostics-show-caret
SDLFLAGS=`sdl2-config --cflags` `pkg-config SDL2_image --cflags` -DGRAPHICS
LIBS=-lpthread -lm

View File

@@ -2354,10 +2354,11 @@ defpulse_(ar_pm1_t1)
ar_cry_in(apr, 1); // 6-6
// There must be some delay after the carry is done
// but I don't quite know how this works,
// so we just use 50ns a an imaginary value
// so we just use 100ns as the average value
// given in "The Evolution of the DECsystem-10"
if(!apr->ar_com_cont)
pulse(apr, &art3, 50); // 6-9
pulse(apr, &ar_cry_comp, 50); // 6-9
pulse(apr, &art3, 100); // 6-9
pulse(apr, &ar_cry_comp, 100); // 6-9
}
defpulse(ar_pm1_t0)

6557
emu/mem_0

File diff suppressed because it is too large Load Diff

View File

@@ -65,6 +65,92 @@ readwbak(FILE *fp)
}
static int prevbyte = -1;
static void
flush(FILE *fp)
{
if(prevbyte == 015)
putc(0356, fp);
else if(prevbyte == 0177)
putc(0357, fp);
prevbyte = -1;
}
static void
binword(word w, FILE *fp)
{
flush(fp);
putc(w>>32 & 017 | 0360, fp);
putc(w>>24 & 0377, fp);
putc(w>>16 & 0377, fp);
putc(w>>8 & 0377, fp);
putc(w & 0377, fp);
}
static void
asciiword(word w, FILE *fp)
{
int i;
char b, bytes[5];
bytes[0] = w>>29 & 0177;
bytes[1] = w>>22 & 0177;
bytes[2] = w>>15 & 0177;
bytes[3] = w>>8 & 0177;
bytes[4] = w>>1 & 0177;
for(i = 0; i < 5; i++){
b = bytes[i];
again:
if(prevbyte == 015){
prevbyte = -1;
if(b == 012)
putc(012, fp);
else{
putc(0356, fp);
goto again;
}
}else if(prevbyte == 0177){
prevbyte = -1;
switch(b){
case 7: putc(0177, fp); break;
case 012: putc(0215, fp); break;
case 015: putc(0212, fp); break;
case 0177: putc(0207, fp); break;
default:
if(b <= 0155)
putc(b + 0200, fp);
else{
putc(0357, fp);
goto again;
}
}
}else if(b == 015 || b == 0177)
prevbyte = b;
else if(b == 012)
putc(015, fp);
else
putc(b, fp);
}
}
/* write word in ITS evacuate format. */
void
writewits(word w, FILE *fp)
{
if(w == ~0){
flush(fp);
return;
}
if(w & 1)
binword(w, fp);
else
asciiword(w, fp);
}
/* read word in ITS evacuate format. */
static int leftover = -1;
word
@@ -75,8 +161,10 @@ readwits(FILE *fp)
word w;
int bits;
if(feof(fp))
if(fp == NULL || feof(fp)){
leftover = -1;
return ~0;
}
w = 0;
bits = 0;

View File

@@ -12,6 +12,7 @@ void writew(word w, FILE *fp);
word readw(FILE *fp);
void writewbak(word w, FILE *fp);
word readwbak(FILE *fp);
void writewits(word w, FILE *fp);
word readwits(FILE *fp);
void decompdbl(double d, int *s, word *e, uint64_t *m);