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 #534

Merged
merged 33 commits into from
Jan 29, 2025
Merged

merge dev #534

merged 33 commits into from
Jan 29, 2025

Conversation

udo-munk
Copy link
Owner

No description provided.

sneakywumpus and others added 30 commits January 21, 2025 11:38
Currently a straight port from the RP2xxx-GEEK-80 register panel.
Works with SDL2 & X11 (at least on my Linux machine). I'm not really a X11
programmer, hacked this together by looking at a simple X11 PNG image
display program I found on the internet.
Panel will be enhanced now that the basic stuff works.

Also works with the command line only machines (cpmsim, mosteksim, z80sim),
but disabled by default. Compile with INFOPANEL=YES, and than use '-p' option.

Add defines for cpu_switch values.

Only set cpu_state to ST_CONTIN_RUN/ST_SINGLE_STEP in run_cpu()/step_cpu(),
needed for the frequency calculation in the panel.

Set cpu_state to ST_STOPPED when RUN switch is pressed, seems counter intuitive
but will get changed to ST_CONTIN_RUN by the setting of cpu_switch to CPUSW_RUN,
which than causes the call of run_cpu().
Added fp_sampleData() to beginning of cpu_8080()/cpu_z80() so the RUN LED
gets updated immediately.

Removed all the cpu_time adjustments around frontpanel code, but added
them to wait_step()/wait_int_step(), since these do sleeps and are called
from deep inside the CPU simulator. Displayed frequency is now stable enough
while single stepping.

Some small clean-ups and continuing boolification...
add a basic introspection panel
Still not right with the frequency in cpmsim, working on it.
fix typo in Makefile's, add back HALT and I/O ports cpu time adjustments
Changed get_clock_us() to ensure time doesn't go backwards.
Happens a lot in intelmdssim, probably because of a lot of really
close (timewise) calls in the 260us loop in the timing/interrupt thread.

Removed checks in the code for negative time differences. This
uncovered a bug in altair-88-sio.c, altair-88-2sio.c and imsai-sio2.c.
Added a reset function for these that initialize the timing variables.
It previously worked only because of integer arithmetic overflows.

We really should be using something like clock_gettime(CLOCK_MONOTONIC,...)
for time measurements.

The global variable cpu_tadj accumulates time spend doing stuff
not related to the CPU core. This is currently done in io_in()/io_out()
and wait_step()/wait_int_step() and HALT/HLT.

Added a parameter to wait_step() to not calculate a time adjustment.
Needed for io_in()/io_out() since they also calclate an adjustment.
This caused the wild frequency estimation jumps before.

Timing is now calculated in cpu_8080()/cpu_z80() in the speed adjustment
code block (which is now also used for timing calculations when f_value=0
every 100000 T-states) and at the end of these functions.

Redid the timing code in all loops what repeat at a specific interval,
so they all use equal code for this.
Add back adjustment calculations to fp_sample*() calls including in
memrdr()/memwrt() which wasn't done before.

Remove parameter from wait_step(), not needed anymore, because of
memrdr()/memwrt() changes.

Only use cpu_tadj when in free running mode (f_value == 0) to get
a hopefully sensible CPU frequency. In frequency locked mode the
adjustment doesn't make sense in my opinion.

When single stepping pretend we spent the right amount of time, or
in free running mode use an arbitrary 100 MHz value.

Changed simbdos.c to use dma_read/write() instead of memrdr()/memwrt().
Seems to make more sense, and it was the only I/O device that used
memrdr()/memwrt() and using these in I/O devices screws up the time
adjustment calculations.
more time work, hopefully last one; use dma_read/write() in simbdos.c
Still needs way to change address of display memory page.:x

Fixes compilation with X11.
add memory display to introspection panel
Remove unnecessary single_step stuff.

Keep a constantly updated cpu_freq frequency estimate variable and
use integer arithmetic for frequency calculations.

When sleeping for CPU speed adjustment don't use the timing adjustment,
in all other cases subtract it from the spent time.

Move "leave" label inside the "if (int_int)" block, looks cleaner.
Left/Right changes base address by 1.
Up/Down by 16.
Page Up/Page Down by 256.
Begin rounds down to xxx0.
End rounds up to xxx0.
Shift multiplies/rounding change by 16.
Mouse wheel works too.

Also move "leave" label back. My Mac compiler didn't like it.
add some keyboard/mouse controls to change memory display base address
fix mouse wheel with multiple windows in SDL2
Adds buttons to switch between memory and ports display.
Sticky button in ports display makes the port lights sticky,
so one can see all the ports accessed in a code run.
add I/O ports view to introspection panel
udo-munk and others added 3 commits January 26, 2025 18:49
make buttons static, no draw debug by default
make buttons behave a bit more like in a GUI
@udo-munk udo-munk merged commit 8f50e92 into master Jan 29, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants