CP/M-65 for the SNES

A place where you can keep others updated about your SNES-related projects through screenshots, videos or information in general.

Moderator: Moderators

Post Reply
hjalfi
Posts: 12
Joined: Fri Oct 18, 2024 4:36 pm

CP/M-65 for the SNES

Post by hjalfi »

I've just done a port of CP/M for the Super Nintendo!

There's a video demonstration here: https://twitter.com/hjalfi/status/1851758552203038957 (I don't think I can get video files inline on the forums?)

This is CP/M-65, which is a rewrite of the Digital Research CP/M-80 from 1977 for the 6502. It currently runs on a whole bunch of systems. See https://github.com/davidgiven/cpm65. CP/M's a basic disk operating system; MS-DOS was heavily inspired by it. It comes with some editors, system tools, a port of Atari BASIC, an assembler, and a byte-compiled Pascal compiler, all of which will run locally. The console is 64x28 (using mode 5 high resolution).

Obviously you need a keyboard and, preferably, a floppy drive (although you do get a 128kB persistent ramdisk in the cartridge SRAM). The only ones I could find emulation support for was the unnamed piece of development hardware referenced by SFX-DOS and the SMK track editor, so that's what I targeted. AFAIK the only emulator which supports it is a fork of BSNES here: https://github.com/MrL314/bsnes-plus/tree/sfx-dos At some point it'd be nice to support the XBAND keyboard and at least one of the magicom-style floppy disk based cartridge copiers, to make it at least slightly possible to run on real hardware.

It's super quick compared to the other 6502 platforms, although of course still very slow compared to modern hardware. I'm currently recompiling the Pascal compiler on it as I speak and it's been going for 20 minutes!
creaothceann
Posts: 709
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: CP/M-65 for the SNES

Post by creaothceann »

hjalfi wrote: Wed Oct 30, 2024 4:07 pm I don't think I can get video files inline on the forums?
GIFs would work.
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
User avatar
segaloco
Posts: 400
Joined: Fri Aug 25, 2023 11:56 am
Contact:

Re: CP/M-65 for the SNES

Post by segaloco »

LUnix on the NES and now this? It's a good year for operating systems on game consoles :D
hjalfi
Posts: 12
Joined: Fri Oct 18, 2024 4:36 pm

Re: CP/M-65 for the SNES

Post by hjalfi »

A NES port might be possible, but I don't know if there were any disk accessories for the NES... a FDS + family BASIC keyboard might work. Looking at the memory map, you'd only get RAM from 0x6000 to 0xdfff, which is only 32kB. That's kinda anaemic but workable. The trickier part is the disk system. FDS disks are only 64kB and... how do I put this... really bad? The Mitsumi QuickDisk system which the FDS uses doesn't support true random access. Writing any data anywhere requires traversing the entire disk.

Were there any other disk systems (e.g. for cartridge copiers) released for the NES?
User avatar
segaloco
Posts: 400
Joined: Fri Aug 25, 2023 11:56 am
Contact:

Re: CP/M-65 for the SNES

Post by segaloco »

Yeah I would think Family BASIC qualifies as the type example of a general computer monitor on the Famicom/NES. There is again the LUnix port[1]. Either way, getting CP/M on the SNES is already admirable enough work, I don't think anyone would fault you for not going further down the rabbit hole right away.

[1] - viewtopic.php?p=291504#p291504
Oziphantom
Posts: 1728
Joined: Tue Feb 07, 2017 2:03 am

Re: CP/M-65 for the SNES

Post by Oziphantom »

On one hand First Class, brilliant. Shame CP/M on a 6502 is not a well supported platform, which is ironic in that the largest singular CP/M machine shipped with a 6502 just it had such pisspoor support for it native OS that people used CP/M on it, making it the dominate CP/M format. But does make me wonder if people did back in the day, actually switch back to the 6502 to enhance their programs, given the discs used were in GCR that was only read by it. Sadly if they did we still couldn't use them in this case as we can't read the GCR disks here either.

Shame really as having a 2.68Mhz( not the "It's super quick; the SNES has a 7MHz 65816" you claim, if you have your main ROM as Fast ROM you get up to 3.58 but anything loaded into RAM will be 2.68) 65816 native version with a charmap display and 128K of RAM+VRAM would be a really solid CP/M machine, if you had a native 65816 program it would probably destroy a 6mhz Z80 machine, with DMA and charmap probably even be faster to use than an 8mhz Z80 machine in practical use cases. It would be nice to have a "computerized" SNES as the Russians did with their MegaDrive clones.

The NES does have Magicom style devices. Via the Magic Card and Game Doctor (which latter got more famous Super versions ) https://www.famicomdisksystem.com/game-doctor-copiers/ they all hook into/exploit the FDS though so we don't have them in the west to my knowledge.
creaothceann
Posts: 709
Joined: Mon Jan 23, 2006 7:47 am
Location: Germany
Contact:

Re: CP/M-65 for the SNES

Post by creaothceann »

Oziphantom wrote: Sat Nov 02, 2024 12:11 am (not the "It's super quick; the SNES has a 7MHz 65816" you claim, if you have your main ROM as Fast ROM you get up to 3.58 but anything loaded into RAM will be 2.68)
Unless of course you put a couple MB of RAM into the cartridge, or more with an MMU (mapper) :)
My current setup:
Super Famicom ("2/1/3" SNS-CPU-GPM-02) → SCART → OSSC → StarTech USB3HDCAP → AmaRecTV 3.10
Post Reply