Commit graph

27 commits

Author SHA1 Message Date
431e905354 standalone patcher program 2025-03-27 11:42:43 -05:00
ce55830a1b disable via T2 irq for now
it broke more things than it solved
2025-03-22 12:32:53 -05:00
47b254f58e remove duplicate 'via_assess_irq' lines 2025-03-22 12:32:44 -05:00
697c8859c6 Merge remote-tracking branch 'origin/main' into soundemu 2025-03-22 10:24:07 -05:00
f8274158d4 debug prints must die 2025-03-22 10:13:26 -05:00
7b8b26f0e0 Start implementing via "timer 2"
This makes clicking "show notes" in the "Addresses" stack of
HyperCardBootSystem7.img succeed.

It also allows `play "Boing"` to work, but not `play "Boing" "a c e g"`.

It also makes running on RP2350 really, really slow.

It also makes glider come up complaining of a missing math co-processor(!?)
2025-03-22 10:04:44 -05:00
bc6529ea4b Turbocharge mouse movement
.. by storing directly into the vars used by the mac plus ROM,
rather than working through the IRQ & I/O subsystems.
2025-03-20 21:19:59 -05:00
e2a74064a0 Fix sound buffer address in BootBeep 2025-03-20 13:44:59 -05:00
4dea595da2 overlay audio data on screen 2025-03-20 13:09:07 -05:00
0be2290d4a audio: Make the last byte of the audio buffer a trap address
at that point, there should be 370 contiguous, sensible samples
available, so let the front end grab them.

Sadly this adds a test to the "store byte in RAM" fast path, but it seems
to be unavoidable.

In the unix frontend, vsync is now presented based on the SDL audio
callback when enabled, instead of gettimeofday.
2025-03-19 13:31:38 -05:00
c5ac98dffb Minimal audio implementation
This is good enough to play the system beep (which is at a multiple of
the refresh rate, so every buffer contains an integer number of cycles
of the tone)

However, because the audio buffer filling is not synchronized with
vertical retrace, it's probably not good enough for playing other
kinds of audio.
2025-03-19 11:14:10 -05:00
Matt Evans
b62d3c6e72 Bump external/Musashi
Fixes some pesky build warnings, mostly cosmetic.
2025-01-01 18:38:50 +00:00
Matt Evans
606f7f75fe README: updates for screen resolution configuration
Bump to v0.22
2024-12-16 23:16:43 +00:00
Matt Evans
59109b5f6a mem2scr: Make resolution-agnostic by reading OS X/Y resolution
This tool can now take screenshots of non-standard screen resolution builds by
reading the screen res from OS variables.
2024-12-16 23:16:43 +00:00
Matt Evans
a9be35c7b3 rom: Support variable screen res in MacPlusV3 ROM
This change adds a boatload of ROM patches to alter screen base, resolution,
words-per-line, and related variables so that MacOS will function correctly
with a framebuffer other than 512x342 (which remains the default).

The majority of the patches are actually to make ROM-drawn low-level things
(such as disc icons, happy/sad Mac icons/crash hexadecimal info) render
right and be positioned correctly.

This works up to about 800x600; the limiting factor is patching int16
immediates for certain instructions, meaning a ~64KB framebuffer size
is the current limit without more work.

The Makefile can now take DISP_WIDTH/DISP_HEIGHT parameters to configure
a build.  There is no support for dynamic switching, or runtime-selected
switching.
2024-12-16 23:16:43 +00:00
Matt Evans
183a1472bb umac.h: Calculate screen base based on resolution defines, remove hardwiring 2024-12-16 23:16:43 +00:00
Matt Evans
9b3dd31d56 unix_main: Remove hardcoded X display resolution 2024-12-16 23:16:43 +00:00
Matt Evans
83ca8a1cfe Clean up compilation warnings
Various functions dropped a void declaration (lazy), which is added.
Removed an unused variable in unix_main.
2024-12-16 23:16:43 +00:00
Matt Evans
5d23667c8e Update README with info on memory configs
Bumps to v0.21
2024-08-27 01:11:39 +01:00
Matt Evans
954636e9db Support 'strange' memory sizes, such as 256K, 192K
Additional ROM patches manually set the memTop variable to a given
memory size, and the memory test routine is skipped.  This allows
the Plus ROM to cope with a Mac 256K configuration, but also non-
power-of-two sizes.  That's useful for an MCU, making a Mac 208K,
Mac 192K, etc. possible.

Memory addresses are clamped such that wrapping within the RAM
region works, and any emulated address can be used without
overflowing the host RAM allocation.  For a power-of-two memory
size this boils down (after compiler optimisation) to a plain
tmask; for non-Po2, this involves a divide/mod in the weird ROM
probing "off the end" cases, and a simple compare in all other
runtime cases (so shouldn't be too slow).
2024-08-27 01:11:39 +01:00
Matt Evans
1ada25b956 README: bump version/date 2024-08-18 17:45:54 +01:00
Matt Evans
854e89e162 Add disc read/write callbacks
Instead of relying on the disc data being directly mapped, and
accessing blocks by memcpy'ing from it, provide op_read/op_write
callbacks so that the host can do disc ops itself (e.g. access SD).

The disc_descr_t describes the callbacks (and an opaque pointer
passed as an argument when they are invoked), per-disc.
2024-08-18 17:45:54 +01:00
Matt Evans
f0ff05081c Add MEMSIZE build-time parameter to set memory size
By default, this is 128 (for 128KB).  Usable values are 128, 512,
1024, 2048, 4096.
2024-08-18 17:45:54 +01:00
Matt Evans
5449bb9697 scc: Improve RR0 status bits
...slightly.  This shows the sync/hunt status, and TxUnderrun, which
are expected by system 7's startup.  (It enables SDLC mode and probes
stuff.)

With this (and increasing memory, e.g. 4MB), umac boots 7.5.5 :)
2024-08-18 17:45:54 +01:00
Matt Evans
fda1246f63 Update README 2024-07-15 23:41:20 +01:00
Matt Evans
1ce7c5bc91 discs: Add write support
The unix_main gets another option, -w, that enables the disc
mapping to reflect writes back to the backing file.

The disc emulation code now handles writes, which are copied
back to the disc data.

This still doesn't abstract read/write ops to disc, which will
be the next step (to support, for example, block-based storage).
2024-07-15 23:28:03 +01:00
Matt Evans
563626a382 First public release
Squashed for release at v0.1
2024-06-15 21:10:48 +01:00