Skip to content

Releases: dfernande132/CPC4Mega65

CPC4MEGA65 v1.0.1

Choose a tag to compare

@dfernande132 dfernande132 released this 05 Oct 19:36

A bug-fix release. One fix, no new features.

Version 1.0 reported 192 KB of RAM instead of 128 KB, and real CPC diagnostic
software hung when it tested the upper RAM bank. Found and reported by joe65 on Discord, running
CPC Doctor and
Amstrad-Diagnostics on a released 1.0 core - which is exactly the kind of report
that is worth more than any amount of my own testing - neither tool is something
I would have thought to run.

Should you update?

If you only play games and use CP/M, 1.0 was already behaving correctly for
you.
Ordinary CPC software uses the base 64 KB and the single expansion bank,
and both of those were right. What was broken only showed up when something
asked for expansion bank 1 or higher - which on a 6128 means diagnostic tools
and software written for 512 KB expansions.

Update anyway if you want the machine to answer honestly when asked what it is.

What was wrong

A real 6128 does not decode the bank-select bits of its RAM paging register: its
single 64 KB expansion is mirrored across all eight bank values, so C4, CC,
D4 and so on all reach the same memory.

The MiSTer core this port is built on does decode them, and correctly so - in
6128 mode it is deliberately a 576 KB machine, backed by 8 MB of SDRAM. This
port gives it 128 KB of block RAM and was truncating the address to fit, which
left only the parity of the page number reaching memory. Expansion bank 1
therefore did not mirror bank 0 as the hardware does: it landed on the machine's
own base RAM.

Two consequences. Diagnostics counted that as a genuine third 64 KB block and
reported 192 KB. And any program that then tested the block wrote over itself
while it was running, which is why CPC Doctor hung and Amstrad-Diagnostics
dropped back to BASIC.

Expansion accesses now all reach the one expansion block, as on real hardware.
.research/tb_rampage.vhd is a GHDL testbench that checks all 32 page values and
fails against the old code.

Verified

RAM : 128KB in CPC Doctor, its upper RAM test completes, and CP/M Plus - which
uses the full 128 KB through the expansion bank - still boots and runs. Timing
closes at WNS +0.206 ns on R6 and +0.246 ns on R3.

Nothing else changed. The floppy subsystem is untouched.

Installing

Unchanged from 1.0. The
v1.0 release notes
have the full instructions: which .cor goes with which board, the three Amstrad
ROM files the core will not boot without, and where they go on the SD card.

CPC4MEGA65 v1.0

Choose a tag to compare

@dfernande132 dfernande132 released this 24 Sep 11:04

An Amstrad CPC 6128 for the MEGA65, built on the
MiSTer2MEGA65 framework and the
MiSTer-devel Amstrad core.

What makes this port unusual is that the MEGA65's internal 3.5" floppy drive
works as a real CPC drive
. It reads genuine CPC disks, formats them, writes
.DSK images onto physical disks and writes changed tracks back. All of it is
verified in both directions against a real CPC 6128: a disk formatted on the
MEGA65 is read by the CPC, and a game copied on the MEGA65 boots on the CPC.

Which file do I download?

Your MEGA65 File
R6 CPC4MEGA65-CoreCPC-v1.0_r6.cor
R3 CPC4MEGA65-CoreCPC-v1.0_r3.cor

R3 is confirmed working by an external tester. R4 and R5 are untested.

You need three ROM files. The core does not boot without them.

Create a folder /cpc4mega65/ on your SD card and put these in it:

File Size
os6128.rom 16 KB
basic6128.rom 16 KB
amsdos.rom 16 KB

They are Amstrad firmware and are not mine to distribute, so they are not
included here. If one is missing, the core tells you which file it could not
find rather than failing silently. Copy the m2mcfg file from this release into
the same folder.

GETTING-STARTED.md walks through all of it from scratch, and assumes you have
never used a CPC. MANUAL-floppy.md is the technical manual for the floppy
drive.

The real floppy drive

Set Internal floppy to Drive A: or Drive B: in the Options menu and that
drive stops being an image and becomes the physical drive in your MEGA65.

Menu item What it does
Read disk now Reads the whole disk into an image the CPC then uses as a normal drive. About 26 seconds, no file needed on the SD card.
FORMAT WHOLE DISK !! Formats 40 tracks in CPC DATA format. A real CPC reports 178 KB free. Destroys the disk.
COPY IMAGE TO DISK !! Writes the .DSK mounted in the other drive onto the physical disk. Destroys the disk.
WRITE BACK TO DISK !! Writes back only the tracks the CPC has modified.
Auto write-back The same, automatically, one second after the CPC stops writing.

The drive LED is the feedback channel: green for success, amber for a bad result
or an empty drive, red for a refusal, and steady amber while modified tracks
are still waiting to be written — do not eject while it is amber.

The whole source image is validated before the write gate opens once, so a disk
is either copied or left untouched. It is never left half-overwritten because a
problem turned up on track 30.

Known limits

  • The copier reproduces what it can reproduce exactly, and refuses the rest
    rather than writing a disk that looks finished and is not. It handles sector
    sizes from 128 to 8192 bytes, up to ten sectors per track, tracks with no
    index mark, and what copy-protected originals use: deleted data marks,
    sectors with no data field, and deliberately wrong data CRCs. In a test
    collection of 29 images, 27 copy and 2 are refused — one whose own signature
    has bit flips, and one with a track whose sector headers share a single
    physical data area, which no .DSK file can describe.
  • Reading a physical disk supports the standard DATA format only. Serving
    tracks straight off the disk, which removes the 26-second pre-read entirely,
    is on the roadmap.
  • The CPC runs at its authentic 50.08 Hz while HDMI outputs exactly 50.000 Hz,
    so one frame is dropped every 12.5 seconds. Fixing this is the first item in
    1.1.
  • Only the CPC 6128. No tape yet. The 464, the 664 and tape are on the
    roadmap.

Credits

The Amstrad CPC hardware is Amstrad plc's, the emulation core is the MiSTer
Development Team's, the framework is MiSTer2MEGA65's, and the MEGA65 port is
mine. See AUTHORS. No Amstrad ROMs are included.

Two framework bugs found during this port were reported upstream rather than
worked around silently, and doc/m2m/exceptions.md documents every change made
to shared framework files with the reasoning behind it.