/*****************************************************************************
* Change Log
* Date | Change
*-----------+-----------------------------------------------------------------
* 15-Nov-85 | [1.37] Created
* 15-Dec-85 | [1.199] Implemented set_logic
* 15-Dec-85 | [1.201] Changed system so set_compare sets only the state, not
* | the indicators (reduces overhead); show_compare now shows the
* | state. 'compare_state' is part of the global machine state
* 20-Dec-85 | [1.221] set_logic_output => show_logic_output
* 20-Dec-85 | [1.221] Added show_ovf with parm, removed old set_OVF, clear_OVF
* 26-Dec-85 | [1.237] Added logic_state to show display string of logic
* 30-Dec-85 | [1.274] Arranged displays to conform to 1401 order for B=A,
* | B!=A, B>A, B added chars.h, use char_ne to get accurate
* | representation of not-equal symbol
*****************************************************************************/
/*****************************************************************************
1401 Emulator
Logic Box Display
This module maintains and updates the 'logic' display on the screen
*****************************************************************************/
/* #include "graph.h" */
#include "stdio.h"
#include "boolean.h"
#include "btypes.h"
#include "scdspmsg.h"
#include "panel.h"
#include "mach.h"
#include "hercules.h"
#include "disp.h"
#include "display.h"
#include "logic.h"
#include "color.h"
#include "kb.h"
#include "scan.h"
#include "chars.h"
#define NLOGIC 5
logic_signal logics[NLOGIC] = {
{0,0," OVF ",false,logic_OVF},
{0,0," B=A ",false,logic_BEQA},
{0,0," BØA ",false,logic_BNEA}, /* logics[2].id[3] is ne symbol */
{0,0," B>A ",false,logic_BGTA},
{0,0," B>= 1;
} /* show it */
}
/****************************************************************************
* show_logic_output
* Inputs:
* unsigned char ch: Character which represents logic output. Only
* BA8421 is looked at
* Effect:
* Updates the logic output display
****************************************************************************/
void show_logic_output(unsigned char ch)
{
mark_logic_output(last_logic,false);
mark_logic_output(ch,true);
last_logic = ch;
}
/****************************************************************************
* show_ovf
* Inputs:
* boolean overflow: State of overflow flag
* Effect:
* Shows the overflow flag state in the logic display
****************************************************************************/
void show_ovf(boolean overflow)
{
set_logic(logic_OVF,overflow);
}
/****************************************************************************
* logic_state
* Inputs:
* short ls: logic state
* Result: char *
* Printable text of logic state
****************************************************************************/
char * logic_state(short ls)
{
switch(ls)
{ /* decode */
case logic_BLTA: return "BA";
case logic_BEQA: return "B=A";
} /* decode */
return "B?A";
}