Skip to content

Commit

Permalink
Merge pull request #513 from udo-munk/dev
Browse files Browse the repository at this point in the history
merge dev
  • Loading branch information
udo-munk authored Jan 12, 2025
2 parents caa8f40 + 781da95 commit 07bb305
Show file tree
Hide file tree
Showing 53 changed files with 475 additions and 269 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ First install the needed dependencies for X11:

or for SDL2:

sudo apt install build-essential libsdl2-dev libsdl2-image-dev
sudo apt install build-essential libsdl2-dev libsdl2-image-dev libsdl2-mixer-dev

Then for X11 run

Expand Down
Binary file added altairsim/conf/fan.wav
Binary file not shown.
62 changes: 32 additions & 30 deletions altairsim/conf/panel.conf
Original file line number Diff line number Diff line change
Expand Up @@ -193,33 +193,35 @@ light LED_PROT pos=2.74,5.95
light LED_WAIT pos=2.09,4.65
light LED_HOLD pos=2.74,4.65

switch SW_15 type=object operate=toggle objects=sw_down,sw_up pos=3.99,3.34,0. size=.6,.6
switch SW_14 type=object operate=toggle objects=sw_down,sw_up pos=5.00,3.34,0. size=.6,.6
switch SW_13 type=object operate=toggle objects=sw_down,sw_up pos=5.60,3.34,0. size=.6,.6
switch SW_12 type=object operate=toggle objects=sw_down,sw_up pos=6.25,3.34,0. size=.6,.6

switch SW_11 type=object operate=toggle objects=sw_down,sw_up pos=7.20,3.34,0. size=.6,.6
switch SW_10 type=object operate=toggle objects=sw_down,sw_up pos=7.85,3.34,0. size=.6,.6
switch SW_09 type=object operate=toggle objects=sw_down,sw_up pos=8.50,3.34,0. size=.6,.6
switch SW_08 type=object operate=toggle objects=sw_down,sw_up pos=9.45,3.34,0. size=.6,.6

switch SW_07 type=object operate=toggle objects=sw_down,sw_up pos=10.10,3.34,0. size=.6,.6
switch SW_06 type=object operate=toggle objects=sw_down,sw_up pos=10.75,3.34,0. size=.6,.6
switch SW_05 type=object operate=toggle objects=sw_down,sw_up pos=11.70,3.34,0. size=.6,.6
switch SW_04 type=object operate=toggle objects=sw_down,sw_up pos=12.35,3.34,0. size=.6,.6

switch SW_03 type=object operate=toggle objects=sw_down,sw_up pos=12.95,3.34,0. size=.6,.6
switch SW_02 type=object operate=toggle objects=sw_down,sw_up pos=13.90,3.34,0. size=.6,.6
switch SW_01 type=object operate=toggle objects=sw_down,sw_up pos=14.55,3.34,0. size=.6,.6
switch SW_00 type=object operate=toggle objects=sw_down,sw_up pos=15.20,3.34,0. size=.6,.6

switch SW_PWR type=object operate=toggle objects=sw_down,sw_up pos=1.00,2.04,0. size=.6,.6

switch SW_RUN type=object operate=mom_off_mom objects=sw_down,sw_up,sw_center pos=4.04,2.04,0. size=.6,.6
switch SW_STEP type=object operate=mom_off_mom objects=sw_down,sw_up,sw_center pos=5.30,2.04,0. size=.6,.6
switch SW_EXAMINE type=object operate=mom_off_mom objects=sw_down,sw_up,sw_center pos=6.60,2.04,0. size=.6,.6
switch SW_DEPOSIT type=object operate=mom_off_mom objects=sw_down,sw_up,sw_center pos=7.85,2.04,0. size=.6,.6
switch SW_RESET type=object operate=mom_off_mom objects=sw_down,sw_up,sw_center pos=9.15,2.04,0. size=.6,.6
switch SW_PROTECT type=object operate=mom_off_mom objects=sw_down,sw_up,sw_center pos=10.45,2.04,0. size=.6,.6
switch SW_INT type=object operate=mom_off_mom objects=sw_down,sw_up,sw_center pos=11.70,2.04,0. size=.6,.6
switch SW_AUX type=object operate=mom_off_mom objects=sw_down,sw_up,sw_center pos=13.00,2.04,0. size=.6,.6
switch SW_15 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up pos=3.99,3.34,0. size=.6,.6
switch SW_14 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up pos=5.00,3.34,0. size=.6,.6
switch SW_13 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up pos=5.60,3.34,0. size=.6,.6
switch SW_12 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up pos=6.25,3.34,0. size=.6,.6

switch SW_11 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up pos=7.20,3.34,0. size=.6,.6
switch SW_10 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up pos=7.85,3.34,0. size=.6,.6
switch SW_09 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up pos=8.50,3.34,0. size=.6,.6
switch SW_08 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up pos=9.45,3.34,0. size=.6,.6

switch SW_07 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up pos=10.10,3.34,0. size=.6,.6
switch SW_06 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up pos=10.75,3.34,0. size=.6,.6
switch SW_05 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up pos=11.70,3.34,0. size=.6,.6
switch SW_04 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up pos=12.35,3.34,0. size=.6,.6

switch SW_03 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up pos=12.95,3.34,0. size=.6,.6
switch SW_02 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up pos=13.90,3.34,0. size=.6,.6
switch SW_01 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up pos=14.55,3.34,0. size=.6,.6
switch SW_00 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up pos=15.20,3.34,0. size=.6,.6

switch SW_PWR type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up pos=1.00,2.04,0. size=.6,.6

switch SW_RUN type=object operate=mom_off_mom onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up,sw_center pos=4.04,2.04,0. size=.6,.6
switch SW_STEP type=object operate=mom_off_mom onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up,sw_center pos=5.30,2.04,0. size=.6,.6
switch SW_EXAMINE type=object operate=mom_off_mom onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up,sw_center pos=6.60,2.04,0. size=.6,.6
switch SW_DEPOSIT type=object operate=mom_off_mom onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up,sw_center pos=7.85,2.04,0. size=.6,.6
switch SW_RESET type=object operate=mom_off_mom onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up,sw_center pos=9.15,2.04,0. size=.6,.6
switch SW_PROTECT type=object operate=mom_off_mom onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up,sw_center pos=10.45,2.04,0. size=.6,.6
switch SW_INT type=object operate=mom_off_mom onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up,sw_center pos=11.70,2.04,0. size=.6,.6
switch SW_AUX type=object operate=mom_off_mom onsound=switch_on.wav offsound=switch_off.wav objects=sw_down,sw_up,sw_center pos=13.00,2.04,0. size=.6,.6

fansound fan.wav
Binary file added altairsim/conf/switch_off.wav
Binary file not shown.
Binary file added altairsim/conf/switch_on.wav
Binary file not shown.
20 changes: 12 additions & 8 deletions altairsim/srcsim/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ include $(CORE_DIR)/Makefile.in-os
###
ifeq ($(WANT_SDL),YES)
PLAT_DEFS = -DWANT_SDL
PLAT_SRCS = simsdl.c
ifeq ($(TARGET_OS),BSD)
PLAT_INCS = -I/usr/local/include/SDL2
PLAT_LDFLAGS = -L/usr/local/lib
Expand Down Expand Up @@ -89,9 +90,12 @@ FP_DEFS = -DFRONTPANEL
FP_LIB = $(FP_DIR)/libfrontpanel.a
ifeq ($(WANT_SDL),YES)
ifeq ($(TARGET_OS),OSX)
FP_LDLIBS = -lfrontpanel -framework SDL2_image -framework OpenGL
FP_INCS = -I/Library/Frameworks/SDL2_image.framework/Headers \
-I/Library/Frameworks/SDL2_mixer.framework/Headers
FP_LDLIBS = -lfrontpanel -framework SDL2_image -framework SDL2_mixer \
-framework OpenGL
else
FP_LDLIBS = -lfrontpanel -lSDL2_image -lGL
FP_LDLIBS = -lfrontpanel -lSDL2_image -lSDL2_mixer -lGL
endif
else
FP_LDLIBS = -lfrontpanel -ljpeg -lGL
Expand All @@ -103,7 +107,7 @@ endif

DEFS = -DCONFDIR=\"$(CONF_DIR)\" -DDISKSDIR=\"$(DISKS_DIR)\" \
-DBOOTROM=\"$(ROMS_DIR)\" $(FP_DEFS) $(PLAT_DEFS)
INCS = -I. -I$(CORE_DIR) -I$(IO_DIR) -I$(FP_DIR) $(PLAT_INCS)
INCS = -I. -I$(CORE_DIR) -I$(IO_DIR) -I$(FP_DIR) $(PLAT_INCS) $(FP_INCS)
CPPFLAGS = $(DEFS) $(INCS)

CSTDS = -std=c99 -D_DEFAULT_SOURCE # -D_XOPEN_SOURCE=700L
Expand Down Expand Up @@ -133,9 +137,9 @@ INSTALL_DATA = $(INSTALL) -m 644

# core system source files for the CPU simulation
CORE_SRCS = sim8080.c simcore.c simdis.c simfun.c simglb.c simice.c simint.c \
simmain.c simsdl.c simz80.c simz80-cb.c simz80-dd.c simz80-ddcb.c \
simz80-ed.c simz80-fd.c simz80-fdcb.c
SRCS = $(CORE_SRCS) $(MACHINE_SRCS) $(IO_SRCS)
simmain.c simz80.c simz80-cb.c simz80-dd.c simz80-ddcb.c simz80-ed.c \
simz80-fd.c simz80-fdcb.c
SRCS = $(CORE_SRCS) $(MACHINE_SRCS) $(IO_SRCS) $(PLAT_SRCS)
OBJS = $(SRCS:.c=.o)
DEPS = $(SRCS:.c=.d)

Expand Down Expand Up @@ -168,10 +172,10 @@ uninstall:
clean: _rm_obj _rm_deps

_rm_obj:
rm -f $(OBJS)
rm -f *.o

_rm_deps:
rm -f $(DEPS)
rm -f *.d

distclean: clean
rm -f $(SIM)
Expand Down
10 changes: 6 additions & 4 deletions altairsim/srcsim/simctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ static BYTE fp_led_wait;
static int cpu_switch;
static int reset;
static BYTE power_switch = 1;
static int power;
static BYTE power;

static void run_clicked(int state, int val), step_clicked(int state, int val);
static void reset_clicked(int state, int val);
Expand Down Expand Up @@ -120,6 +120,7 @@ void mon(void)
fp_framerate(fp_fps);
fp_bindSimclock(&fp_clock);
fp_bindRunFlag(&cpu_state);
fp_bindPowerFlag(&power);

/* bind frontpanel LED's to variables */
fp_bindLight16("LED_ADDR_{00-15}", &fp_led_address, 1);
Expand Down Expand Up @@ -233,6 +234,7 @@ void mon(void)
#ifdef FRONTPANEL
if (F_flag) {
/* all LED's off and update front panel */
power = 0;
cpu_bus = 0;
bus_request = 0;
IFF = 0;
Expand Down Expand Up @@ -558,7 +560,7 @@ static void power_clicked(int state, int val)
case FP_SW_DOWN:
if (power)
break;
power++;
power = 1;
cpu_bus = CPU_WO | CPU_M1 | CPU_MEMR;
fp_led_address = PC;
fp_led_data = fp_read(PC);
Expand All @@ -569,7 +571,7 @@ static void power_clicked(int state, int val)
case FP_SW_UP:
if (!power)
break;
power--;
power = 0;
cpu_switch = 0;
cpu_state = ST_STOPPED;
cpu_error = POWEROFF;
Expand All @@ -584,7 +586,7 @@ static void power_clicked(int state, int val)
*/
static void quit_callback(void)
{
power--;
power = 0;
cpu_switch = 0;
cpu_state = ST_STOPPED;
cpu_error = POWEROFF;
Expand Down
8 changes: 4 additions & 4 deletions cpmsim/srcsim/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ INSTALL_DATA = $(INSTALL) -m 644

# core system source files for the CPU simulation
CORE_SRCS = sim8080.c simcore.c simdis.c simfun.c simglb.c simice.c simint.c \
simmain.c simsdl.c simz80.c simz80-cb.c simz80-dd.c simz80-ddcb.c \
simz80-ed.c simz80-fd.c simz80-fdcb.c
simmain.c simz80.c simz80-cb.c simz80-dd.c simz80-ddcb.c simz80-ed.c \
simz80-fd.c simz80-fdcb.c
SRCS = $(CORE_SRCS) $(MACHINE_SRCS) $(IO_SRCS)
OBJS = $(SRCS:.c=.o)
DEPS = $(SRCS:.c=.d)
Expand Down Expand Up @@ -98,10 +98,10 @@ uninstall:
clean: _rm_obj _rm_deps

_rm_obj:
rm -f $(OBJS)
rm -f *.o

_rm_deps:
rm -f $(DEPS)
rm -f *.d

distclean: clean
rm -f $(SIM)
Expand Down
Binary file added cromemcosim/conf_2d/fan.wav
Binary file not shown.
54 changes: 28 additions & 26 deletions cromemcosim/conf_2d/panel.conf
Original file line number Diff line number Diff line change
Expand Up @@ -144,32 +144,32 @@ v 0 1

#switches

switch SW_15 type=object operate=toggle objects=blue_sw_down,blue_sw_up pos=.7,1.6,0. size=.65,1.2,1
switch SW_14 type=object operate=toggle objects=blue_sw_down,blue_sw_up pos=1.37,1.6,0. size=.65,1.2,1
switch SW_13 type=object operate=toggle objects=blue_sw_down,blue_sw_up pos=2.02,1.6,0. size=.65,1.2,1
switch SW_12 type=object operate=toggle objects=blue_sw_down,blue_sw_up pos=2.67,1.6,0. size=.65,1.2,1

switch SW_11 type=object operate=toggle objects=red_sw_down,red_sw_up pos=3.32,1.6,0. size=.65,1.2,1
switch SW_10 type=object operate=toggle objects=red_sw_down,red_sw_up pos=3.97,1.6,0. size=.65,1.2,1
switch SW_09 type=object operate=toggle objects=red_sw_down,red_sw_up pos=4.64,1.6,0. size=.65,1.2,1
switch SW_08 type=object operate=toggle objects=red_sw_down,red_sw_up pos=5.31,1.6,0. size=.65,1.2,1

switch SW_07 type=object operate=toggle objects=blue_sw_down,blue_sw_up pos=6.65,1.6,0. size=.65,1.2,1
switch SW_06 type=object operate=toggle objects=blue_sw_down,blue_sw_up pos=7.33,1.6,0. size=.65,1.2,1
switch SW_05 type=object operate=toggle objects=blue_sw_down,blue_sw_up pos=7.98,1.6,0. size=.65,1.2,1
switch SW_04 type=object operate=toggle objects=blue_sw_down,blue_sw_up pos=8.63,1.6,0. size=.65,1.2,1

switch SW_03 type=object operate=toggle objects=red_sw_down,red_sw_up pos=9.28,1.6,0. size=.65,1.2,1
switch SW_02 type=object operate=toggle objects=red_sw_down,red_sw_up pos=9.95,1.6,0. size=.65,1.2,1
switch SW_01 type=object operate=toggle objects=red_sw_down,red_sw_up pos=10.62,1.6,0. size=.65,1.2,1
switch SW_00 type=object operate=toggle objects=red_sw_down,red_sw_up pos=11.28,1.6,0. size=.65,1.2,1

switch SW_EXAMINE type=object operate=mom_off_mom objects=blue_sw_down,blue_sw_up,blue_sw_center pos=12.65,1.6,0. size=.6,1.2,1
switch SW_DEPOSIT type=object operate=mom_off_mom objects=red_sw_down,red_sw_up,red_sw_center pos=13.30,1.6,0. size=.6,1.2,1
switch SW_RESET type=object operate=mom_off_mom objects=blue_sw_down,blue_sw_up,blue_sw_center pos=13.95,1.6,0. size=.6,1.2,1
switch SW_RUN type=object operate=mom_off_mom objects=red_sw_down,red_sw_up,red_sw_center pos=14.60,1.6,0. size=.6,1.2,1
switch SW_STEP type=object operate=mom_off_mom objects=blue_sw_down,blue_sw_up,blue_sw_center pos=15.25,1.6,0. size=.6,1.2,1
switch SW_PWR type=object operate=toggle objects=pwr_sw_dn,pwr_sw_up pos=15.90,1.6,0. size=.7,1.2,1
switch SW_15 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=blue_sw_down,blue_sw_up pos=.7,1.6,0. size=.65,1.2,1
switch SW_14 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=blue_sw_down,blue_sw_up pos=1.37,1.6,0. size=.65,1.2,1
switch SW_13 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=blue_sw_down,blue_sw_up pos=2.02,1.6,0. size=.65,1.2,1
switch SW_12 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=blue_sw_down,blue_sw_up pos=2.67,1.6,0. size=.65,1.2,1

switch SW_11 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=red_sw_down,red_sw_up pos=3.32,1.6,0. size=.65,1.2,1
switch SW_10 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=red_sw_down,red_sw_up pos=3.97,1.6,0. size=.65,1.2,1
switch SW_09 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=red_sw_down,red_sw_up pos=4.64,1.6,0. size=.65,1.2,1
switch SW_08 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=red_sw_down,red_sw_up pos=5.31,1.6,0. size=.65,1.2,1

switch SW_07 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=blue_sw_down,blue_sw_up pos=6.65,1.6,0. size=.65,1.2,1
switch SW_06 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=blue_sw_down,blue_sw_up pos=7.33,1.6,0. size=.65,1.2,1
switch SW_05 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=blue_sw_down,blue_sw_up pos=7.98,1.6,0. size=.65,1.2,1
switch SW_04 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=blue_sw_down,blue_sw_up pos=8.63,1.6,0. size=.65,1.2,1

switch SW_03 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=red_sw_down,red_sw_up pos=9.28,1.6,0. size=.65,1.2,1
switch SW_02 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=red_sw_down,red_sw_up pos=9.95,1.6,0. size=.65,1.2,1
switch SW_01 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=red_sw_down,red_sw_up pos=10.62,1.6,0. size=.65,1.2,1
switch SW_00 type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=red_sw_down,red_sw_up pos=11.28,1.6,0. size=.65,1.2,1

switch SW_EXAMINE type=object operate=mom_off_mom onsound=switch_on.wav offsound=switch_off.wav objects=blue_sw_down,blue_sw_up,blue_sw_center pos=12.65,1.6,0. size=.6,1.2,1
switch SW_DEPOSIT type=object operate=mom_off_mom onsound=switch_on.wav offsound=switch_off.wav objects=red_sw_down,red_sw_up,red_sw_center pos=13.30,1.6,0. size=.6,1.2,1
switch SW_RESET type=object operate=mom_off_mom onsound=switch_on.wav offsound=switch_off.wav objects=blue_sw_down,blue_sw_up,blue_sw_center pos=13.95,1.6,0. size=.6,1.2,1
switch SW_RUN type=object operate=mom_off_mom onsound=switch_on.wav offsound=switch_off.wav objects=red_sw_down,red_sw_up,red_sw_center pos=14.60,1.6,0. size=.6,1.2,1
switch SW_STEP type=object operate=mom_off_mom onsound=switch_on.wav offsound=switch_off.wav objects=blue_sw_down,blue_sw_up,blue_sw_center pos=15.25,1.6,0. size=.6,1.2,1
switch SW_PWR type=object operate=toggle onsound=switch_on.wav offsound=switch_off.wav objects=pwr_sw_dn,pwr_sw_up pos=15.90,1.6,0. size=.7,1.2,1

#address lights

Expand Down Expand Up @@ -230,3 +230,5 @@ light LED_RUN pos=14.95,3.85
light LED_INTEN pos=14.30,3.85
light LED_WAIT pos=15.50,3.85
light LED_HOLD pos=16.10,3.85

fansound fan.wav
Binary file added cromemcosim/conf_2d/switch_off.wav
Binary file not shown.
Binary file added cromemcosim/conf_2d/switch_on.wav
Binary file not shown.
Binary file added cromemcosim/conf_3d/fan.wav
Binary file not shown.
Loading

0 comments on commit 07bb305

Please sign in to comment.