1
0
mirror of https://github.com/rcornwell/sims.git synced 2026-02-15 20:27:12 +00:00

I7000: Cleanup to support common card reader code.

Cleaned up i7090 reader/punch code to use new sim_card module.
This commit is contained in:
Richard Cornwell
2016-06-05 21:42:56 -04:00
parent 06c9c9c770
commit 11b663e3ec
6 changed files with 41 additions and 14 deletions

View File

@@ -224,11 +224,11 @@ typedef struct dib DIB;
#define DEBUG_TRAP 0x0000002 /* Show CPU Traps */
#define DEBUG_CMD 0x0000004 /* Show device commands */
#define DEBUG_DATA 0x0000008 /* Show data transfers */
#define DEBUG_DETAIL 0x0000010 /* Show details */
#define DEBUG_EXP 0x0000020 /* Show error conditions */
#define DEBUG_SNS 0x0000040 /* Shows sense data for 7909 devs */
#define DEBUG_CTSS 0x0000080 /* Shows CTSS specail instructions */
#define DEBUG_PROT 0x0000100 /* Protection traps */
#define DEBUG_DETAIL 0x0000020 /* Show details */
#define DEBUG_EXP 0x0000040 /* Show error conditions */
#define DEBUG_SNS 0x0000080 /* Shows sense data for 7909 devs */
#define DEBUG_CTSS 0x0000100 /* Shows CTSS specail instructions */
#define DEBUG_PROT 0x0000200 /* Protection traps */
extern DEBTAB dev_debug[];

View File

@@ -22,6 +22,7 @@
*/
#include "i7090_defs.h"
#include "sim_card.h"
#include <ctype.h>
t_stat parse_sym(CONST char *cptr, t_addr addr, UNIT * uptr, t_value * val, int32 sw);
@@ -108,6 +109,16 @@ DEBTAB dev_debug[] = {
{"SENSE", DEBUG_SNS, "Show sense data on 7909 channel"},
{0, 0}
};
DEBTAB crd_debug[] = {
{"CHAN", DEBUG_CHAN},
{"CMD", DEBUG_CMD},
{"DATA", DEBUG_DATA},
{"DETAIL", DEBUG_DETAIL},
{"EXP", DEBUG_EXP},
{"CARD", DEBUG_CARD},
{0, 0}
};
/* Character conversion tables */
extern const char sim_six_to_ascii[64];

View File

@@ -81,7 +81,7 @@ DEVICE cdp_dev = {
"CP", cdp_unit, NULL, cdp_mod,
NUM_DEVS_CDP, 8, 15, 1, 8, 36,
NULL, NULL, &cdp_reset, NULL, &cdp_attach, &cdp_detach,
&cdp_dib, DEV_DISABLE | DEV_DEBUG, 0, dev_debug,
&cdp_dib, DEV_DISABLE | DEV_DEBUG, 0, crd_debug,
NULL, NULL, &cdp_help, NULL, NULL, &cdp_description
};
@@ -205,7 +205,7 @@ t_stat cdp_srv(UNIT * uptr)
sim_debug(DEBUG_DATA, &cdp_dev, "unit=%d write column %d ", u, pos);
wd = 0;
data = (struct _card_data *)uptr->u3;
data = (struct _card_data *)uptr->up7;
switch (chan_read(chan, &wd, 0)) {
case DATA_OK:
sim_debug(DEBUG_DATA, &cdp_dev, " %012llo\n", wd);

View File

@@ -88,7 +88,7 @@ DEVICE cdr_dev = {
"CR", cdr_unit, NULL, cdr_mod,
NUM_DEVS_CDR, 8, 15, 1, 8, 36,
NULL, NULL, &cdr_reset, &cdr_boot, &cdr_attach, &cdr_detach,
&cdr_dib, DEV_DISABLE | DEV_DEBUG, 0, dev_debug,
&cdr_dib, DEV_DISABLE | DEV_DEBUG, 0, crd_debug,
NULL, NULL, &cdr_help, NULL, NULL, &cdr_description
};
@@ -124,7 +124,8 @@ t_stat cdr_srv(UNIT * uptr)
{
int chan = UNIT_G_CHAN(uptr->flags);
int u = (uptr - cdr_unit);
int pos, col, bit, b;
int pos, col, b;
uint16 bit;
t_uint64 mask, wd;
struct _card_data *data;
@@ -202,7 +203,7 @@ t_stat cdr_srv(UNIT * uptr)
return SCPE_OK;
}
data = (struct _card_data *)uptr->u3;
data = (struct _card_data *)uptr->up7;
/* Bit flip into read buffer */
bit = 1 << (pos / 2);
mask = 1;
@@ -265,10 +266,10 @@ cdr_boot(int32 unit_num, DEVICE * dptr)
return r;
/* Copy first three records. */
data = (struct _card_data *)uptr->u3;
data = (struct _card_data *)uptr->up7;
uptr->u5 &= ~CDRPOSMASK;
for(pos = 0; pos <3; pos++) {
int bit = 1 << (pos / 2);
uint16 bit = 1 << (pos / 2);
t_uint64 mask = 1;
int b = (pos & 1)?36:0;
int col;
@@ -280,8 +281,10 @@ cdr_boot(int32 unit_num, DEVICE * dptr)
if (data->image[col-- + b] & bit)
M[pos] |= mask;
}
sim_debug(DEBUG_DATA, &cdr_dev, "boot read row %d %012llo\n",
pos, M[pos]);
}
uptr->u5 |= pos << CDRPOSSHIFT;
uptr->u5 |= pos << CDRPOSSHIFT;
/* Make sure channel is set to start reading rest. */
return chan_boot(unit_num, dptr);
}

View File

@@ -81,8 +81,9 @@ int chan_read(int chan, t_uint64 *data, int flags);
void chan_proc();
/* Simulator debug controls */
extern DEBTAB crd_debug[];
/* SPRA device pulses */
extern uint16 dev_pulse[NUM_CHAN]; /* Device pulse */
#define PUNCH_1 00001
#define PUNCH_2 00002

View File

@@ -22,6 +22,7 @@
*/
#include "i7090_defs.h"
#include "sim_card.h"
#include <ctype.h>
t_stat parse_sym(CONST char *cptr, t_addr addr, UNIT * uptr, t_value * val, int32 sw);
@@ -168,6 +169,17 @@ DEBTAB dev_debug[] = {
{"PROT", DEBUG_PROT},
{0, 0}
};
DEBTAB crd_debug[] = {
{"CHAN", DEBUG_CHAN},
{"CMD", DEBUG_CMD},
{"DATA", DEBUG_DATA},
{"DETAIL", DEBUG_DETAIL},
{"EXP", DEBUG_EXP},
{"CARD", DEBUG_CARD},
{0, 0}
};
/* Character conversion tables */
const char mem_to_ascii[64] = {