1
0
mirror of https://github.com/rcornwell/sims.git synced 2026-03-28 02:33:22 +00:00

SCP: Updated to current.

This commit is contained in:
Richard Cornwell
2022-09-21 18:19:55 -04:00
parent 101e806a51
commit 774aa676ee
5 changed files with 102 additions and 43 deletions

View File

@@ -70,9 +70,6 @@ struct ROM_File_Descriptor {
{"PDP11/dazzledart/dazzle.lda", "PDP11/pdp11_dazzle_dart_rom.h", 6096, 0xFFF83848, "dazzle_lda"},
{"PDP11/11logo/11logo.lda", "PDP11/pdp11_11logo_rom.h", 26009, 0xFFDD77F7, "logo_lda"},
{"swtp6800/swtp6800/swtbugv10.bin", "swtp6800/swtp6800/swtp_swtbugv10_bin.h", 1024, 0xFFFE4FBC, "swtp_swtbugv10_bin"},
{"3B2/rom_rev2.bin", "3B2/rom_rev2_bin.h", 32768, 0xFFD55762, "rom_rev2_bin"},
{"3B2/rom_rev2_demon.bin", "3B2/rom_rev2_demon_bin.h", 65536, 0xFFB345BB, "rom_rev2_demon_bin"},
{"3B2/rom_rev3.bin", "3B2/rom_rev3_bin.h", 131072, 0xFFDC0EB8, "rom_rev3_bin"},
};

View File

@@ -1067,26 +1067,26 @@ struct MEMFILE {
_RegCheck(#nm,&(loc),rdx,wd,pos,1,desc,flds,0,0,sizeof((loc)),GRDATADF)
/* Arrayed register whose data is kept in a standard C array Register */
#define BRDATA(nm,aloc,rdx,wd,dep) \
_RegCheck(#nm,aloc,rdx,wd,0,dep,NULL,NULL,0,0,sizeof(*(aloc)),BRDATA)
_RegCheck(#nm,aloc,rdx,wd,0,dep,NULL,NULL,0,sizeof(*(aloc)),sizeof(*(aloc)),BRDATA)
#define BRDATAD(nm,aloc,rdx,wd,dep,desc) \
_RegCheck(#nm,aloc,rdx,wd,0,dep,desc,NULL,0,0,sizeof(*(aloc)),BRDATAD)
_RegCheck(#nm,aloc,rdx,wd,0,dep,desc,NULL,0,sizeof(*(aloc)),sizeof(*(aloc)),BRDATAD)
#define BRDATADF(nm,aloc,rdx,wd,dep,desc,flds) \
_RegCheck(#nm,aloc,rdx,wd,0,dep,desc,flds,0,0,sizeof(*(aloc)),BRDATADF)
/* Arrayed register whose data is kept in a standard C array Register */
_RegCheck(#nm,aloc,rdx,wd,0,dep,desc,flds,0,sizeof(*(aloc)),sizeof(*(aloc)),BRDATADF)
/* Arrayed register whose data is kept in a standard C two dimensional array Register */
#define CRDATA(nm,aloc,rdx,wd,dep) \
_RegCheck(#nm,aloc,rdx,wd,0,dep,NULL,NULL,0,0,sizeof(**(aloc)),CRDATA)
_RegCheck(#nm,&(aloc),rdx,wd,0,dep,NULL,NULL,0,sizeof(**(aloc)),sizeof(**(aloc)),CRDATA)
#define CRDATAD(nm,aloc,rdx,wd,dep,desc) \
_RegCheck(#nm,aloc,rdx,wd,0,dep,desc,NULL,0,0,sizeof(**(aloc)),CRDATAD)
_RegCheck(#nm,&(aloc),rdx,wd,0,dep,desc,NULL,0,sizeof(**(aloc)),sizeof(**(aloc)),CRDATAD)
#define CRDATADF(nm,aloc,rdx,wd,dep,desc,flds) \
_RegCheck(#nm,aloc,rdx,wd,0,dep,desc,flds,0,0,sizeof(**(aloc)),CRDATADF)
_RegCheck(#nm,&(aloc),rdx,wd,0,dep,desc,flds,0,sizeof(**(aloc)),sizeof(**(aloc)),CRDATADF)
/* Range of memory whose data is successive scalar values accessed like an array Register */
#define VBRDATA(nm,loc,rdx,wd,dep) \
_RegCheck(#nm,&(loc),rdx,wd,0,dep,NULL,NULL,0,0,sizeof(loc),VBRDATA)
_RegCheck(#nm,&(loc),rdx,wd,0,dep,NULL,NULL,0,wd/8,sizeof(loc),VBRDATA)
#define VBRDATAD(nm,loc,rdx,wd,dep,desc) \
_RegCheck(#nm,&(loc),rdx,wd,0,dep,desc,NULL,0,0,sizeof(loc),VBRDATAD)
_RegCheck(#nm,&(loc),rdx,wd,0,dep,desc,NULL,0,wd/8,sizeof(loc),VBRDATAD)
#define VBRDATADF(nm,loc,rdx,wd,dep,desc,flds) \
_RegCheck(#nm,&(loc),rdx,wd,0,dep,desc,flds,0,0,sizeof(loc),VBRDATADF)
_RegCheck(#nm,&(loc),rdx,wd,0,dep,desc,flds,0,wd/8,sizeof(loc),VBRDATADF)
/* Arrayed register whose data is part of the UNIT structure */
#define URDATA(nm,loc,rdx,wd,off,dep,fl) \
_RegCheck(#nm,&(loc),rdx,wd,off,dep,NULL,NULL,0,sizeof(UNIT),sizeof((loc)),URDATA),(fl)

View File

@@ -490,6 +490,9 @@ scsi_set_req (bus); /* request to send data
void scsi_mode_sel6 (SCSI_BUS *bus, uint8 *data, uint32 len)
{
UNIT *uptr = bus->dev[bus->target];
SCSI_DEV *dev = (SCSI_DEV *)uptr->up7;
uint32 blk_size;
if (bus->phase == SCSI_CMD) {
scsi_debug_cmd (bus, "Mode Select(6) - CMD\n");
memcpy (&bus->cmd[0], &data[0], 6);
@@ -499,9 +502,24 @@ if (bus->phase == SCSI_CMD) {
}
else if (bus->phase == SCSI_DATO) {
scsi_debug_cmd (bus, "Mode Select(6) - DATO\n");
/* Not currently implemented so just return
good status for now */
scsi_status (bus, STS_OK, KEY_OK, ASC_OK);
if (dev->devtype == SCSI_TAPE && uptr->flags & SCSI_QIC) {
blk_size = ((uint32)bus->buf[9]) << 16 |
((uint32)bus->buf[10]) << 8 |
(uint32)bus->buf[11];
/* QIC tape ONLY supports requesting a fixed block size of
* 0x200 bytes. Any other block size will cause an illegal
* request. */
if (blk_size == SCSI_QIC_BLKSZ) {
scsi_status(bus, STS_OK, KEY_OK, ASC_OK);
}
else {
scsi_status(bus, STS_CHK, KEY_ILLREQ|KEY_M_ILI, ASC_INVCDB);
}
}
else {
/* Not implemented for disk and non-QIC tape */
scsi_status(bus, STS_OK, KEY_OK, ASC_OK);
}
}
}
@@ -784,8 +802,9 @@ void scsi_read6_tape (SCSI_BUS *bus, uint8 *data, uint32 len)
{
UNIT *uptr = bus->dev[bus->target];
SCSI_DEV *dev = (SCSI_DEV *)uptr->up7;
t_seccnt sects, sectsread;
t_seccnt sects, sectsread, new_buf_b;
t_stat r;
uint32 i;
if ((data[1] & 0x3) == 0x3) { /* SILI and FIXED? */
scsi_status (bus, STS_CHK, KEY_ILLREQ, ASC_INVCDB);
@@ -793,6 +812,7 @@ if ((data[1] & 0x3) == 0x3) { /* SILI and FIXED? */
}
sects = GETW (data, 3) | (data[2] << 16);
new_buf_b = 0;
sectsread = 0;
if (sects == 0) { /* no data to read */
@@ -803,35 +823,64 @@ if (sects == 0) { /* no data to read */
scsi_debug_cmd (bus, "Read(6) blks %d fixed %d\n", sects, (data[1] & 0x1));
if (uptr->flags & UNIT_ATT) {
if (data[1] & 0x1) {
r = sim_tape_rdrecf (uptr, &bus->buf[0], &sectsread, (sects * dev->block_size));
scsi_debug_cmd (bus, "Read tape blk %d, read %d, r = %d\n", sects, sectsread, r);
if (uptr->flags & SCSI_QIC) {
if (data[1] & 0x1) {
/* If this is a QIC tape drive and bit 0 is set, this is a
request to read multiple fixed-length blocks. */
scsi_debug_cmd(bus, "QIC in fixed block mode\n");
for (i = 0; i < sects; i++) {
r = sim_tape_rdrecf(uptr, &bus->buf[new_buf_b], &sectsread, SCSI_QIC_BLKSZ);
scsi_debug_cmd(bus, "Read tape blk %d, read %d, r = %d\n",
sects, sectsread, r);
if (r == MTSE_OK) {
new_buf_b += SCSI_QIC_BLKSZ;
} else {
scsi_tape_status(bus, r);
scsi_status(bus, bus->status, bus->sense_key, bus->sense_code);
return;
}
}
} else {
/* QIC drives respond with an illegal request when the
request does not specify fixed-block mode */
scsi_debug_cmd(bus, "QIC not in fixed block mode, invalid command\n");
scsi_status(bus, STS_CHK, KEY_ILLREQ|KEY_M_ILI, ASC_INVCDB);
return;
}
}
else {
r = sim_tape_rdrecf (uptr, &bus->buf[0], &sectsread, sects);
scsi_debug_cmd (bus, "Read tape max %d, read %d, r = %d\n", sects, sectsread, r);
if (r == MTSE_INVRL) { /* overlength condition */
scsi_debug_cmd (bus, "Overlength\n");
if ((data[1] & 0x2) && (dev->block_size == 0)) { /* SILI set */
scsi_debug_cmd (bus, "SILI set\n");
/* Otherwise, this is a normal streaming tape read */
if (data[1] & 0x1) {
r = sim_tape_rdrecf (uptr, &bus->buf[0], &sectsread, (sects * dev->block_size));
scsi_debug_cmd (bus, "Read tape blk %d, read %d, r = %d\n", sects, sectsread, r);
}
else {
r = sim_tape_rdrecf (uptr, &bus->buf[0], &sectsread, sects);
scsi_debug_cmd (bus, "Read tape max %d, read %d, r = %d\n", sects, sectsread, r);
if (r == MTSE_INVRL) { /* overlength condition */
scsi_debug_cmd (bus, "Overlength\n");
if ((data[1] & 0x2) && (dev->block_size == 0)) { /* SILI set */
scsi_debug_cmd (bus, "SILI set\n");
}
else {
scsi_debug_cmd (bus, "SILI not set - check condition\n");
scsi_status (bus, STS_CHK, (KEY_OK | KEY_M_ILI), ASC_OK);
return;
}
}
else {
scsi_debug_cmd (bus, "SILI not set - check condition\n");
scsi_status (bus, STS_CHK, (KEY_OK | KEY_M_ILI), ASC_OK);
return;
}
}
else if ((r == MTSE_OK) && (sectsread < sects)) { /* underlength condition */
scsi_debug_cmd (bus, "Underlength\n");
if (data[1] & 0x2) { /* SILI set */
scsi_debug_cmd (bus, "SILI set\n");
}
else {
scsi_debug_cmd (bus, "SILI not set - check condition\n");
scsi_status_deferred (bus, STS_CHK, (KEY_OK | KEY_M_ILI), ASC_OK);
bus->sense_info = (sects - sectsread);
else if ((r == MTSE_OK) && (sectsread < sects)) { /* underlength condition */
scsi_debug_cmd (bus, "Underlength\n");
if (data[1] & 0x2) { /* SILI set */
scsi_debug_cmd (bus, "SILI set\n");
}
else {
scsi_debug_cmd (bus, "SILI not set - check condition\n");
scsi_status_deferred (bus, STS_CHK, (KEY_OK | KEY_M_ILI), ASC_OK);
bus->sense_info = (sects - sectsread);
}
}
}
new_buf_b = sectsread;
}
if (r != MTSE_OK) {
@@ -845,7 +894,7 @@ else {
}
if (sectsread > 0) {
bus->buf_b = sectsread;
bus->buf_b = new_buf_b;
scsi_set_phase (bus, SCSI_DATI); /* data in phase next */
}
else {

View File

@@ -68,10 +68,13 @@
#define SCSI_DBG_TAP 0x10000000 /* tape activity */
#define SCSI_V_NOAUTO ((DKUF_V_UF > MTUF_V_UF) ? DKUF_V_UF : MTUF_V_UF)/* noautosize */
#define SCSI_V_UF (SCSI_V_NOAUTO + 1)
#define SCSI_V_QIC (SCSI_V_NOAUTO + 1)
#define SCSI_V_UF (SCSI_V_QIC + 1)
#define SCSI_QIC (1 << SCSI_V_QIC)
#define SCSI_WLK (UNIT_WLK|UNIT_RO) /* hwre write lock */
#define SCSI_NOAUTO DKUF_NOAUTOSIZE
#define SCSI_QIC_BLKSZ 0x200
struct scsi_dev_t {
uint8 devtype; /* device type */

View File

@@ -509,6 +509,11 @@ main_argc = argc;
main_argv = argv;
SDL_SetHint (SDL_HINT_RENDER_DRIVER, "software");
#if defined (SDL_HINT_VIDEO_ALLOW_SCREENSAVER)
/* If this hint is defined, the default is to disable the screen saver.
We want to leave the screen saver enabled. */
SDL_SetHint (SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1");
#endif
status = SDL_Init (SDL_INIT_VIDEO);
@@ -2138,6 +2143,11 @@ VID_DISPLAY *vptr = (VID_DISPLAY *)arg;
int stat;
SDL_SetHint (SDL_HINT_RENDER_DRIVER, "software");
#if defined (SDL_HINT_VIDEO_ALLOW_SCREENSAVER)
/* If this hint is defined, the default is to disable the screen saver.
We want to leave the screen saver enabled. */
SDL_SetHint (SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1");
#endif
stat = SDL_Init (SDL_INIT_VIDEO);