Skip to content

Commit

Permalink
Merge pull request #451 from udo-munk/dev
Browse files Browse the repository at this point in the history
merge dev
  • Loading branch information
udo-munk authored Sep 15, 2024
2 parents 678a856 + d11827e commit 6aae148
Show file tree
Hide file tree
Showing 441 changed files with 57,874 additions and 1,662 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ cromemcosim/cromemcosim
imsaisim/imsaisim
intelmdssim/intelmdssim
mosteksim/mosteksim
picosim/build
picosim/rp2040/build
picosim/rp2350/build
z80asm/z80asm
z80sim/*.hex
z80sim/*.lis
Expand Down
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ BIOSES = cpmsim/srccpm2 cpmsim/srccpm3 cpmsim/srcmpm cpmsim/srcucsd-iv \
intelmdssim/srccpm2 imsaisim/srcucsd-iv picosim/srccpm2 \
picosim/srccpm3 picosim/srcucsd-iv
MISC = z80sim cpmtools
MACHINES = altairsim cpmsim cromemcosim imsaisim mosteksim z80sim
#MACHINES = altairsim cpmsim cromemcosim imsaisim mosteksim # FIXME: z80sim build is broken
MACHINES = altairsim cpmsim cromemcosim imsaisim mosteksim z80sim intelmdssim

Z80ASMDIR = z80asm
Z80ASM = $(Z80ASMDIR)/z80asm
Expand Down
30 changes: 15 additions & 15 deletions altairsim/srcsim/simctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,15 +247,15 @@ static void run_clicked(int state, int val)

switch (state) {
case FP_SW_DOWN:
if (cpu_state != CONTIN_RUN) {
cpu_state = CONTIN_RUN;
if (cpu_state != ST_CONTIN_RUN) {
cpu_state = ST_CONTIN_RUN;
fp_led_wait = 0;
cpu_switch = 1;
}
break;
case FP_SW_UP:
if (cpu_state == CONTIN_RUN) {
cpu_state = STOPPED;
if (cpu_state == ST_CONTIN_RUN) {
cpu_state = ST_STOPPED;
fp_led_wait = 1;
cpu_switch = 0;
}
Expand All @@ -275,7 +275,7 @@ static void step_clicked(int state, int val)
if (!power)
return;

if (cpu_state == CONTIN_RUN)
if (cpu_state == ST_CONTIN_RUN)
return;

switch (state) {
Expand All @@ -296,7 +296,7 @@ int wait_step(void)
{
int ret = 0;

if (cpu_state != SINGLE_STEP) {
if (cpu_state != ST_SINGLE_STEP) {
cpu_bus &= ~CPU_M1;
m1_step = 0;
return ret;
Expand Down Expand Up @@ -332,7 +332,7 @@ int wait_step(void)
*/
void wait_int_step(void)
{
if (cpu_state != SINGLE_STEP)
if (cpu_state != ST_SINGLE_STEP)
return;

cpu_switch = 3;
Expand All @@ -358,7 +358,7 @@ static void reset_clicked(int state, int val)
case FP_SW_UP:
/* reset CPU only */
reset = 1;
cpu_state |= RESET;
cpu_state |= ST_RESET;
IFF = 0;
m1_step = 0;
break;
Expand All @@ -370,7 +370,7 @@ static void reset_clicked(int state, int val)
if (!R_flag)
PC = _boot_switch[M_flag];
reset = 0;
cpu_state &= ~RESET;
cpu_state &= ~ST_RESET;

/* update front panel */
fp_led_address = PC;
Expand All @@ -385,7 +385,7 @@ static void reset_clicked(int state, int val)
case FP_SW_DOWN:
/* reset CPU and I/O devices */
reset = 2;
cpu_state |= RESET;
cpu_state |= ST_RESET;
m1_step = 0;
IFF = 0;
reset_io();
Expand All @@ -405,7 +405,7 @@ static void examine_clicked(int state, int val)
if (!power)
return;

if ((cpu_state == CONTIN_RUN) || (cpu_bus & CPU_HLTA))
if ((cpu_state == ST_CONTIN_RUN) || (cpu_bus & CPU_HLTA))
return;

switch (state) {
Expand Down Expand Up @@ -442,7 +442,7 @@ static void deposit_clicked(int state, int val)
if (!power)
return;

if ((cpu_state == CONTIN_RUN) || (cpu_bus & CPU_HLTA))
if ((cpu_state == ST_CONTIN_RUN) || (cpu_bus & CPU_HLTA))
return;

if ((p_tab[PC >> 8] == MEM_RO) || (p_tab[PC >> 8] == MEM_WPROT)) {
Expand Down Expand Up @@ -478,7 +478,7 @@ static void protect_clicked(int state, int val)
if (!power)
return;

if (cpu_state == CONTIN_RUN)
if (cpu_state == ST_CONTIN_RUN)
return;

switch (state) {
Expand Down Expand Up @@ -547,7 +547,7 @@ static void power_clicked(int state, int val)
break;
power--;
cpu_switch = 0;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
cpu_error = POWEROFF;
break;
default:
Expand All @@ -562,7 +562,7 @@ static void quit_callback(void)
{
power--;
cpu_switch = 0;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
cpu_error = POWEROFF;
}
#endif /* FRONTPANEL */
6 changes: 3 additions & 3 deletions altairsim/srcsim/simio.c
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ static void hwctl_out(BYTE data)

if (data & 128) { /* halt system */
cpu_error = IOHALT;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
}

#if !defined (EXCLUDE_I8080) && !defined(EXCLUDE_Z80)
Expand Down Expand Up @@ -348,7 +348,7 @@ static void lpt_data_out(BYTE data)
if ((printer = creat("printer.txt", 0664)) == -1) {
LOGE(TAG, "can't create printer.txt");
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
printer = 0;
return;
}
Expand All @@ -362,7 +362,7 @@ static void lpt_data_out(BYTE data)
} else {
LOGE(TAG, "can't write to printer.txt");
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
}
}
}
Expand Down
40 changes: 20 additions & 20 deletions cpmsim/srcsim/simio.c
Original file line number Diff line number Diff line change
Expand Up @@ -1004,7 +1004,7 @@ static BYTE nets1_in(void)
if ((s = getaddrinfo(cs_host, service, &hints, &result)) != 0) {
LOGE(TAG, "getaddrinfo failed: %s", gai_strerror(s));
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
return (BYTE) 0;
}

Expand All @@ -1023,7 +1023,7 @@ static BYTE nets1_in(void)
if (rp == NULL) {
LOGE(TAG, "can't connect to host %s", cs_host);
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
return (BYTE) 0;
}

Expand Down Expand Up @@ -1137,7 +1137,7 @@ static BYTE cond1_in(void)
} else {
LOGE(TAG, "can't read console 1");
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
return (BYTE) 0;
}
}
Expand Down Expand Up @@ -1174,7 +1174,7 @@ static BYTE cond2_in(void)
} else {
LOGE(TAG, "can't read console 2");
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
return (BYTE) 0;
}
}
Expand Down Expand Up @@ -1211,7 +1211,7 @@ static BYTE cond3_in(void)
} else {
LOGE(TAG, "can't read console 3");
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
return (BYTE) 0;
}
}
Expand Down Expand Up @@ -1248,7 +1248,7 @@ static BYTE cond4_in(void)
} else {
LOGE(TAG, "can't read console 4");
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
return (BYTE) 0;
}
}
Expand Down Expand Up @@ -1279,7 +1279,7 @@ static BYTE netd1_in(void)
if (read(cs, &c, 1) != 1) {
LOGE(TAG, "can't read client socket");
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
return (BYTE) 0;
}
#ifdef CNETDEBUG
Expand Down Expand Up @@ -1308,7 +1308,7 @@ static void cond_out(BYTE data)
} else {
LOGE(TAG, "can't write console 0");
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
}
}
}
Expand All @@ -1334,7 +1334,7 @@ static void cond1_out(BYTE data)
} else {
LOGE(TAG, "can't write console 1");
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
}
}
#else /* !NETWORKING */
Expand Down Expand Up @@ -1363,7 +1363,7 @@ static void cond2_out(BYTE data)
} else {
LOGE(TAG, "can't write console 2");
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
}
}
#else /* !NETWORKING */
Expand Down Expand Up @@ -1392,7 +1392,7 @@ static void cond3_out(BYTE data)
} else {
LOGE(TAG, "can't write console 3");
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
}
}
#else /* !NETWORKING */
Expand Down Expand Up @@ -1421,7 +1421,7 @@ static void cond4_out(BYTE data)
} else {
LOGE(TAG, "can't write console 4");
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
}
}
#else /* !NETWORKING */
Expand Down Expand Up @@ -1450,7 +1450,7 @@ static void netd1_out(BYTE data)
} else {
LOGE(TAG, "can't write client socket");
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
}
}
#else /* !NETWORKING */
Expand Down Expand Up @@ -1495,7 +1495,7 @@ static void prtd_out(BYTE data)
if ((printer = creat("printer.txt", 0664)) == -1) {
LOGE(TAG, "can't create printer.txt");
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
printer = 0;
return;
}
Expand All @@ -1509,7 +1509,7 @@ static void prtd_out(BYTE data)
} else {
LOGE(TAG, "can't write to printer.txt");
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
}
}
}
Expand Down Expand Up @@ -1851,15 +1851,15 @@ static void mmui_out(BYTE data)
LOGE(TAG, "Try to init %d banks, available %d banks",
data, MAXSEG);
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
return;
}

for (i = 1; i < data; i++) {
if ((memory[i] = (BYTE *) malloc(segsize)) == NULL) {
LOGE(TAG, "can't allocate memory for bank %d", i);
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
return;
}
}
Expand All @@ -1885,7 +1885,7 @@ static void mmus_out(BYTE data)
if (data > maxbnk - 1) {
LOGE(TAG, "%04x: try to select unallocated bank %d", PC, data);
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
return;
}
selbnk = data;
Expand All @@ -1910,7 +1910,7 @@ static void mmuc_out(BYTE data)
if (memory[1] != NULL) {
LOGE(TAG, "Not possible to resize already allocated segments");
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
return;
}
segsize = data << 8;
Expand Down Expand Up @@ -2024,7 +2024,7 @@ static void hwctl_out(BYTE data)

if (data & 128) { /* halt system */
cpu_error = IOHALT;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
return;
}

Expand Down
2 changes: 1 addition & 1 deletion cpmsim/srcsim/simmem.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void init_memory(void)
if ((memory[0] = (BYTE *) malloc(65536)) == NULL) {
LOGE(TAG, "can't allocate memory for bank 0");
cpu_error = IOERROR;
cpu_state = STOPPED;
cpu_state = ST_STOPPED;
return;
}
maxbnk = 1;
Expand Down
Loading

0 comments on commit 6aae148

Please sign in to comment.