Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge dev #451

Merged
merged 55 commits into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
0cf3fa2
refactor for RP2040
udo-munk Sep 4, 2024
649db75
don't want to include build, ignore
udo-munk Sep 4, 2024
a402a5e
update readme
udo-munk Sep 4, 2024
131af2d
update readme
udo-munk Sep 4, 2024
bc5ae11
improve cemmenting
udo-munk Sep 4, 2024
08c58a9
more refactoring
udo-munk Sep 5, 2024
76cb7ea
commenting
udo-munk Sep 6, 2024
1a3c7c8
comment
udo-munk Sep 6, 2024
05fa663
begin porting picosim to RP2350
udo-munk Sep 7, 2024
421d09b
build boot ROM for rp2350
udo-munk Sep 7, 2024
af857db
try to build for RP2350
udo-munk Sep 8, 2024
2502068
change defines that collide with RP2350 defines
udo-munk Sep 8, 2024
9ec269c
add inteömdssim to top level makefile and adjust to latest changes
udo-munk Sep 8, 2024
88c3829
set compiler
udo-munk Sep 8, 2024
d22cc84
time/date works different with RP2350, commented out for now
udo-munk Sep 8, 2024
38463ab
update
udo-munk Sep 8, 2024
8489e74
clean up
udo-munk Sep 8, 2024
81a4276
enable UART I/O by default
udo-munk Sep 8, 2024
7d68f0a
clean up
udo-munk Sep 8, 2024
75d667f
clean up
udo-munk Sep 8, 2024
511c421
clean up
udo-munk Sep 9, 2024
6189417
fix
udo-munk Sep 9, 2024
8819fba
Merge branch 'dev' of github.com:udo-munk/z80pack into dev
udo-munk Sep 9, 2024
97684de
so that we can use the default uart without connecting to usb
udo-munk Sep 9, 2024
628664a
reset machine after done
udo-munk Sep 9, 2024
ab405fd
take over improvements from the RP2350 research system
udo-munk Sep 9, 2024
9d63c25
RP2350 has no datetime RTC anymore, so worked some on using AON timer…
udo-munk Sep 9, 2024
9312bf5
more work on date/time
udo-munk Sep 10, 2024
c2e958a
not working es intended on RP2350, fix this later
udo-munk Sep 10, 2024
7a71280
we can set date/time now on the RP2350
udo-munk Sep 10, 2024
3248948
remove not working UART stuff
udo-munk Sep 10, 2024
e2c9405
remove not working UART stuff
udo-munk Sep 10, 2024
e4e5659
drop first random character from connecting to usb
udo-munk Sep 10, 2024
8a3f913
works more reliable with higher clock frequency
udo-munk Sep 10, 2024
359b9b2
is not RP2040 only
udo-munk Sep 10, 2024
68adaae
tune hardware a bit
udo-munk Sep 10, 2024
d27ac56
test with FatFs dev branch
udo-munk Sep 11, 2024
a1c0d7e
used FatFs dev branch
udo-munk Sep 11, 2024
8f043d4
test with new SPI mode 3
udo-munk Sep 11, 2024
b773fb4
fix wrong FatFs timestamps
udo-munk Sep 11, 2024
6b370fc
use consistent sizeof's
udo-munk Sep 11, 2024
ba67d5b
problem fixed in dev branch of FatFS, use the public sources from github
udo-munk Sep 11, 2024
f1dde1b
update documentation
udo-munk Sep 12, 2024
697c642
update to FatFs v3.3.1
udo-munk Sep 12, 2024
fed2df7
fix junk
udo-munk Sep 12, 2024
9b007c2
update to FatFs v3.3.1
udo-munk Sep 12, 2024
4d653bd
now we get the junk character here too, discard it
udo-munk Sep 12, 2024
7c3bbb3
now we can tune SPI access to the SD card here also
udo-munk Sep 12, 2024
03c56ad
now can use default UART only, without the need to connect to USB UART
udo-munk Sep 12, 2024
7dd11cd
try to improve the UART handling for RP2350
udo-munk Sep 13, 2024
05b92b1
change comment
udo-munk Sep 13, 2024
45affeb
improved handling of the RTC's
udo-munk Sep 13, 2024
9613aba
forgot copyright, added
udo-munk Sep 13, 2024
304af24
forgot to convert timer to localtime, fixed
udo-munk Sep 13, 2024
d11827e
fix UART handling
udo-munk Sep 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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