1
0
mirror of https://github.com/aap/pdp6.git synced 2026-03-06 03:19:57 +00:00

emu: redid pulse mechanism

This commit is contained in:
aap
2018-11-29 14:45:25 +01:00
parent 28cc63f3ba
commit 8b0849d160
3 changed files with 1003 additions and 912 deletions

1879
emu/apr.c

File diff suppressed because it is too large Load Diff

View File

@@ -27,8 +27,8 @@ connectmem cmem2 0 apr 2
connectmem cmem3 0 apr 3
attach tty /tmp/6tty
#attach ptr ../code/test.rim
attach ptr ../code/sysgen.rim
attach ptr ../code/test.rim
#attach ptr ../code/sysgen.rim
#attach ptr ../lars_sysgen/sysgen.pt
attach ptp ../code/ptp.out
#attach dx0 ../test/out.dt6

View File

@@ -37,7 +37,7 @@ void cli(FILE *f);
void *cmdthread(void *);
enum {
MAXPULSE = 5
MAXPULSE = 20
};
enum Mask {
@@ -274,6 +274,24 @@ struct IOBus
void setreq(IOBus *bus, int dev, u8 pia);
/* A pulse modeled as a function, and a name for debugging */
typedef struct Pulse Pulse;
struct Pulse
{
void (*f)(void *arg);
char *n;
};
/* A timed pulse in a linked list.
* t is time difference since last pulse */
typedef struct TPulse TPulse;
struct TPulse
{
TPulse *next;
Pulse *p;
int t;
};
/*
* Devices
*/
@@ -289,8 +307,6 @@ enum Extpulse {
EXT_NONEXIT_MEM = 4
};
typedef void Pulse(Apr *apr);
#define pulse(p) static void p(Apr *apr)
struct Apr
{
@@ -348,6 +364,9 @@ struct Apr
int cpa_pia;
bool iot_go;
bool iot_init_setup, iot_final_setup; // not used
bool iot_reset;
bool iot_go_pulse; // for edge detection
/* ?? */
bool a_long;
@@ -400,9 +419,10 @@ struct Apr
bool ia_inh; // this is asserted for some time
int pulsestepping;
Pulse *pulses1[MAXPULSE], *pulses2[MAXPULSE];
Pulse **clist, **nlist;
int ncurpulses, nnextpulses;
/* This could be abstracted away */
TPulse pulses[MAXPULSE];
TPulse *pfree;
TPulse *pulse;
};
#define APR_IDENT "apr166"
extern char *apr_ident;