BESM6: Now builds without SDL, fixed CPU reset regression, output to parallel terminals works.

This commit is contained in:
Leo Broukhis 2015-01-15 00:07:03 -08:00
parent ad6dd02f18
commit 0d41242520
4 changed files with 33 additions and 7 deletions

View file

@ -148,7 +148,7 @@ MTAB cpu_mod[] = {
{ MTAB_XTD|MTAB_VDV, 0, "IDLE", "IDLE", &sim_set_idle, &sim_show_idle, NULL, "Enables idle detection mode" }, { MTAB_XTD|MTAB_VDV, 0, "IDLE", "IDLE", &sim_set_idle, &sim_show_idle, NULL, "Enables idle detection mode" },
{ MTAB_XTD|MTAB_VDV, 0, NULL, "NOIDLE", &sim_clr_idle, NULL, NULL, "Disables idle detection" }, { MTAB_XTD|MTAB_VDV, 0, NULL, "NOIDLE", &sim_clr_idle, NULL, NULL, "Disables idle detection" },
{ MTAB_XTD|MTAB_VDV, 0, NULL, "REQ", &cpu_req, NULL, NULL, "Sends a request interrupt" }, { MTAB_XTD|MTAB_VDV, 0, NULL, "REQ", &cpu_req, NULL, NULL, "Sends a request interrupt" },
{ MTAB_XTD|MTAB_VDV, 0, "PANEL", "PANEL", &besm6_init_panel, NULL, NULL, "Displays graphical panel" }, { MTAB_XTD|MTAB_VDV, 0, "PANEL", "PANEL", &besm6_init_panel, &besm6_show_panel, NULL, "Displays graphical panel" },
{ MTAB_XTD|MTAB_VDV, 0, NULL, "NOPANEL", &besm6_close_panel, NULL, NULL, "Closes graphical panel" }, { MTAB_XTD|MTAB_VDV, 0, NULL, "NOPANEL", &besm6_close_panel, NULL, NULL, "Closes graphical panel" },
{ MTAB_XTD|MTAB_VDV|MTAB_VALO, 0, "PULT", "PULT", &cpu_set_pult, &cpu_show_pult, NULL, "Selects a hardwired program or switch reg." }, { MTAB_XTD|MTAB_VDV|MTAB_VALO, 0, "PULT", "PULT", &cpu_set_pult, &cpu_show_pult, NULL, "Selects a hardwired program or switch reg." },
{ 0 } { 0 }
@ -364,7 +364,8 @@ t_stat cpu_reset (DEVICE *dptr)
SPSW_INTR_DISABLE; SPSW_INTR_DISABLE;
GRP = MGRP = 0; GRP = MGRP = 0;
PC = 1; /* "reset cpu; go" should start from 1 */ // Disabled due to a conflict with loading
// PC = 1; /* "reset cpu; go" should start from 1 */
sim_brk_types = SWMASK ('E') | SWMASK('R') | SWMASK('W'); sim_brk_types = SWMASK ('E') | SWMASK('R') | SWMASK('W');
sim_brk_dflt = SWMASK ('E'); sim_brk_dflt = SWMASK ('E');
@ -404,7 +405,7 @@ t_stat cpu_set_pult (UNIT *u, int32 val, char *cptr, void *desc)
t_stat cpu_show_pult (FILE *st, struct sim_unit *up, int32 v, void *dp) t_stat cpu_show_pult (FILE *st, struct sim_unit *up, int32 v, void *dp)
{ {
sim_printf("Pult packet switch position is %d\n", pult_packet_switch); fprintf(st, "Pult packet switch position is %d", pult_packet_switch);
return SCPE_OK; return SCPE_OK;
} }

View file

@ -360,7 +360,8 @@ t_stat fprint_sym (FILE *of, t_addr addr, t_value *val,
void besm6_draw_panel (int force); void besm6_draw_panel (int force);
t_stat besm6_init_panel (UNIT *u, int32 val, char *cptr, void *desc); t_stat besm6_init_panel (UNIT *u, int32 val, char *cptr, void *desc);
t_stat besm6_close_panel (UNIT *u, int32 val, char *cptr, void *desc); t_stat besm6_close_panel (UNIT *u, int32 val, char *cptr, void *desc);
t_stat besm6_show_panel (FILE *st, struct sim_unit *up, int32 v, void *dp);
/* /*
* Арифметика. * Арифметика.
*/ */

View file

@ -29,6 +29,7 @@
* authorization from Leonid Broukhis and Serge Vakulenko. * authorization from Leonid Broukhis and Serge Vakulenko.
*/ */
#include "besm6_defs.h"
#if defined (HAVE_LIBSDL) #if defined (HAVE_LIBSDL)
#if !defined (FONTFILE) #if !defined (FONTFILE)
#include "besm6_panel_font.h" #include "besm6_panel_font.h"
@ -39,8 +40,6 @@
#endif /* defined (HAVE_LIBSDL) */ #endif /* defined (HAVE_LIBSDL) */
#ifdef HAVE_LIBSDL #ifdef HAVE_LIBSDL
#include "besm6_defs.h"
#include <stdlib.h> #include <stdlib.h>
/* /*
@ -389,6 +388,15 @@ t_stat besm6_close_panel (UNIT *u, int32 val, char *cptr, void *desc)
return SCPE_OK; return SCPE_OK;
} }
t_stat besm6_show_panel (FILE *st, struct sim_unit *up, int32 v, void *dp)
{
if (screen)
fprintf(st, "Panel displayed");
else
fprintf(st, "Panel closed");
return SCPE_OK;
}
#if SDL_MAJOR_VERSION == 2 #if SDL_MAJOR_VERSION == 2
static SDL_Window *sdlWindow; static SDL_Window *sdlWindow;
@ -468,6 +476,7 @@ t_stat besm6_init_panel (UNIT *u, int32 val, char *cptr, void *desc)
SDL_RenderClear(sdlRenderer); SDL_RenderClear(sdlRenderer);
SDL_RenderCopy(sdlRenderer, sdlTexture, NULL, NULL); SDL_RenderCopy(sdlRenderer, sdlTexture, NULL, NULL);
SDL_RenderPresent (sdlRenderer); SDL_RenderPresent (sdlRenderer);
return SCPE_OK;
} }
/* /*
@ -560,6 +569,7 @@ t_stat besm6_init_panel (UNIT *u, int32 val, char *cptr, void *desc)
/* Tell SDL to update the whole screen */ /* Tell SDL to update the whole screen */
SDL_UpdateRect (screen, 0, 0, WIDTH, HEIGHT); SDL_UpdateRect (screen, 0, 0, WIDTH, HEIGHT);
return SCPE_OK;
} }
/* /*
@ -597,6 +607,20 @@ void besm6_draw_panel (int force)
#endif /* SDL_MAJOR_VERSION */ #endif /* SDL_MAJOR_VERSION */
#else /* HAVE_LIBSDL */ #else /* HAVE_LIBSDL */
t_stat besm6_init_panel (UNIT *u, int32 val, char *cptr, void *desc)
{
return sim_messagef(SCPE_OPENERR, "Need SDL and SDLttf libraries");
}
t_stat besm6_close_panel (UNIT *u, int32 val, char *cptr, void *desc)
{
return SCPE_NOTATT;
}
t_stat besm6_show_panel (FILE *st, struct sim_unit *up, int32 v, void *dp)
{
}
void besm6_draw_panel (int force) void besm6_draw_panel (int force)
{ {
} }

View file

@ -1228,7 +1228,7 @@ void consul_print (int dev_num, uint32 cmd)
besm6_debug(">>> CONSUL%o: Native charset not implemented", line_num); besm6_debug(">>> CONSUL%o: Native charset not implemented", line_num);
break; break;
} }
// PRP |= CONS_CAN_PRINT[dev_num]; PRP |= CONS_CAN_PRINT[dev_num];
vt_idle = 0; vt_idle = 0;
} }