PDP11: Fix register definitions.

This commit is contained in:
Lars Brinkhoff 2020-03-18 14:13:55 +01:00
parent 89cd649c77
commit 45d7a1155b
4 changed files with 20 additions and 18 deletions

View file

@ -1,7 +1,7 @@
/* pdp11_ch.c: CH11 Chaosnet interface. /* pdp11_ch.c: CH11 Chaosnet interface.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
Copyright (c) 2018, Lars Brinkhoff. Copyright (c) 2018, 2002, Lars Brinkhoff.
Permission is hereby granted, free of charge, to any person obtaining a Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"), copy of this software and associated documentation files (the "Software"),
@ -101,11 +101,13 @@ t_stat ch_help (FILE *, DEVICE *, UNIT *, int32, const char *);
t_stat ch_help_attach (FILE *, DEVICE *, UNIT *, int32, const char *); t_stat ch_help_attach (FILE *, DEVICE *, UNIT *, int32, const char *);
const char *ch_description (DEVICE *); const char *ch_description (DEVICE *);
#define CH11_NO_ADDRESS 0XFFFF
static char peer[256]; static char peer[256];
static int status; static uint16 status;
static int address = -1; static uint16 address = CH11_NO_ADDRESS;
static int rx_count; static uint16 rx_count;
static int tx_count; static uint16 tx_count;
static uint8 rx_buffer[512+100]; static uint8 rx_buffer[512+100];
static uint8 tx_buffer[512+100]; static uint8 tx_buffer[512+100];
@ -117,11 +119,11 @@ UNIT ch_unit[] = {
}; };
REG ch_reg[] = { REG ch_reg[] = {
{ GRDATADF(CSR, status, 16, 16, 0, "Control and status", ch_csr_bits), REG_FIT }, { GRDATADF(CSR, status, 16, 16, 0, "Control and status", ch_csr_bits), 0 },
{ GRDATAD(RXCNT, rx_count, 16, 16, 0, "Receive word count"), REG_FIT|REG_RO}, { GRDATAD(RXCNT, rx_count, 16, 16, 0, "Receive word count"), REG_RO},
{ GRDATAD(TXCNT, tx_count, 16, 16, 0, "Transmit word count"), REG_FIT|REG_RO}, { GRDATAD(TXCNT, tx_count, 16, 16, 0, "Transmit word count"), REG_RO},
{ BRDATAD(RXBUF, rx_buffer, 16, 8, sizeof rx_buffer, "Receive packet buffer"), REG_FIT}, { BRDATAD(RXBUF, rx_buffer, 16, 8, sizeof rx_buffer, "Receive packet buffer"), 0},
{ BRDATAD(TXBUF, tx_buffer, 16, 8, sizeof tx_buffer, "Transmit packet buffer"), REG_FIT}, { BRDATAD(TXBUF, tx_buffer, 16, 8, sizeof tx_buffer, "Transmit packet buffer"), 0},
{ BRDATAD(PEER, peer, 16, 8, sizeof peer, "Network peer"), REG_HRO}, { BRDATAD(PEER, peer, 16, 8, sizeof peer, "Network peer"), REG_HRO},
{ GRDATAD(NODE, address, 16, 16, 0, "Node address"), REG_HRO}, { GRDATAD(NODE, address, 16, 16, 0, "Node address"), REG_HRO},
{ NULL } }; { NULL } };
@ -414,7 +416,7 @@ t_stat ch_attach (UNIT *uptr, CONST char *cptr)
char *linkinfo; char *linkinfo;
t_stat r; t_stat r;
if (address == -1) if (address == CH11_NO_ADDRESS)
return sim_messagef (SCPE_2FARG, "Must set Chaosnet NODE address first \"SET CH NODE=val\"\n"); return sim_messagef (SCPE_2FARG, "Must set Chaosnet NODE address first \"SET CH NODE=val\"\n");
if (peer[0] == '\0') if (peer[0] == '\0')
return sim_messagef (SCPE_2FARG, "Must set Chaosnet PEER \"SET CH PEER=host:port\"\n"); return sim_messagef (SCPE_2FARG, "Must set Chaosnet PEER \"SET CH PEER=host:port\"\n");
@ -488,7 +490,7 @@ t_stat ch_set_peer (UNIT* uptr, int32 val, CONST char* cptr, void* desc)
t_stat ch_show_node (FILE* st, UNIT* uptr, int32 val, CONST void* desc) t_stat ch_show_node (FILE* st, UNIT* uptr, int32 val, CONST void* desc)
{ {
if (address == -1) if (address == CH11_NO_ADDRESS)
fprintf (st, "node=unspecified"); fprintf (st, "node=unspecified");
else else
fprintf (st, "node=%o", address); fprintf (st, "node=%o", address);

View file

@ -45,8 +45,8 @@ t_stat daz_boot(int32 unit, DEVICE *dptr);
t_stat daz_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr); t_stat daz_help (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, const char *cptr);
const char *daz_description (DEVICE *dptr); const char *daz_description (DEVICE *dptr);
static int devadd = 0; static uint16 devadd = 0;
static int buttons[4] = { ~0, ~0, ~0, ~0 }; static uint16 buttons[4] = { ~0, ~0, ~0, ~0 };
#define IOLN_DAZ 4 #define IOLN_DAZ 4
DIB daz_dib = { DIB daz_dib = {

View file

@ -63,8 +63,8 @@ UNIT ng_unit = {
REG ng_reg[] = { REG ng_reg[] = {
{ DRDATAD (CYCLE, ng_unit.wait, 24, "NG cycle"), REG_NZ + PV_LEFT }, { DRDATAD (CYCLE, ng_unit.wait, 24, "NG cycle"), REG_NZ + PV_LEFT },
{ GRDATAD(TYPE, ng_type, 16, 16, 0, "Hardware type"), REG_FIT}, { GRDATAD(TYPE, ng_type, 16, 32, 0, "Hardware type"), 0},
{ GRDATAD(SCALE, ng_scale, 16, 16, 0, "Pixel Scale Factor"), REG_FIT}, { GRDATAD(SCALE, ng_scale, 16, 32, 0, "Pixel Scale Factor"), 0},
{ NULL } { NULL }
}; };

View file

@ -45,8 +45,8 @@ typedef unsigned int uint32;
#ifndef PIX_SCALE #ifndef PIX_SCALE
#define PIX_SCALE RES_FULL #define PIX_SCALE RES_FULL
#endif #endif
extern int ng_type; extern int32 ng_type;
extern int ng_scale; extern int32 ng_scale;
extern int32 ng_get_csr(void); extern int32 ng_get_csr(void);
extern int32 ng_get_reloc(void); extern int32 ng_get_reloc(void);