Page 2 of 9

Re: Commodore 128 for the MiSTer?

Posted: Thu Sep 23, 2021 8:29 am
by virtuali
kathleen wrote: Wed Sep 22, 2021 6:34 pmdespite Sorg is right by saying that in case of the C128 core will be there, the 1st command that most of the people will type will be GO64
GO64 was usually the most used command back in the day, because if you had a real C128, you were using as a C64 most of the time to play games. That wouldn't be needed here, since there's a perfectly fine C64 core to be used instead.

Yes, the C128 is a very complex machine because you had:

- C128 mode in 40 columns, running Basic 7.0 with 8502 + 8564 VIC, running at 1Mhz
- C128 mode in 80 columns, running Basic 7.0 with 8502 + 8563 VDC and VIC disabled, running at 2Mhz
- CP/M mode in 40 columns, with Z80 + VIC, running at 2Mhz, 8502 used for some I/O
- CP/M mode in 80 columns, with Z80 + VDC, running at 2Mhz, 8502 used for some I/O
- C64 mode with 8502 + VIC, running at 1Mhz

And it was possible to switch between 40/80 columns mode on the fly, provided you had both composite and RGB connected. And if wasn't enough, the 1571 disk drive supported both GCR (standard Commodore) or MFM (CP/M or PC)

Quite tricky system, but also, very interesting. No idea if it's too complex for the MiSTer hardware, but surely would be very complex to create.

Re: Commodore 128 for the MiSTer?

Posted: Thu Sep 23, 2021 11:02 am
by rhester72
Not to get too off-forum, but if you don't want to wait, BMC64 includes a VERY good C128 emulator (straight from VICE) that even includes PIP for 40/80 column modes if desired. It'll do pretty much anything you throw at it with near-zero latency. Mine's in a proper C64c case with real keyboard and honestly the C64 emulation is superior to MiSTer, particularly in the display department (where I just invested a crazy amount of time tuning the custom video modes for 100% accuracy to original Commodore signalling).

If you've never seen it before, might want to check it out...I've never seen anything that could beat it for the 128.

Re: Commodore 128 for the MiSTer?

Posted: Fri Sep 24, 2021 3:55 pm
by cathrynmataga
In a way, seems to me, the C128 with it's Z80 and 6502 both would be exactly the kind of thing Mister is good at, that's a pain to sychronize with threads in software. But maybe doesn't even matter, if nothing depends on this. What did people use C128s for? I guess the 80 column would have been nice for calling into BBSs? Seems a lot of time those days went into 'managing pirate videogame collections' -- did anyone do this in 80-column C128 mode.

Re: Commodore 128 for the MiSTer?

Posted: Fri Sep 24, 2021 4:20 pm
by Bas
80-column would be used for productivity software like things running unde CP/M.

Re: Commodore 128 for the MiSTer?

Posted: Fri Sep 24, 2021 4:34 pm
by cathrynmataga
Everyone knows that, but on C128, exactly what programs did anyone actually run on this system? (I might try myself on emulator.)

For me, I think retro-word processing is actually okay, for anything small. 8-bit era spreadsheets might still be useful. I wouldn't want to do my taxes or keep my books on an -bit PC though. I don't know if there's much of a 'retro-productivity' community, really.

Re: Commodore 128 for the MiSTer?

Posted: Fri Sep 24, 2021 11:29 pm
by rhester72
I literally lived in GEOS 128 (on VDC) for about 2 years - I'd never have made it through high school research papers and the like without it.

80-column BBSing was indeed very nice as well, as were 80-column Infocom games. There were a few (VERY few) games that took advantage of 2MHz when available (like Uridium Plus), but ironically that was something I learned only long after the system was an afterthought for most people.

The keyboard was SUPER nice, for sure. =) Having true burst mode access to drives (especially on the 1581) was also a joy after so many years of abysmally slow drives (JiffyDOS was a toy for the rich at the time, but Epyx Fast Load was a decent-ish substitute for the lot of us). Having a built-in function ROM like The Servant (my personal favorite) was also INCREDIBLY handy.

These days, to be honest, the 128 side of the house is more of a novelty for me than anything. I never quite finished playing with CP/M, so I've been doing some of that. I've also spent some time learning the FAR more powerful BASIC on the 128 - man, it could do a LOT!

The truth of the matter is like the C65, the C128 was just too much, too late. The world had moved on and it just no longer had a place. But it still reigns supreme in my mind as the ULTIMATE 8-bit!

Re: Commodore 128 for the MiSTer?

Posted: Mon Sep 27, 2021 6:13 pm
by cathrynmataga
Oh yeah, GEOS 128, I was only on C64 for games, so never really used the computer for anything else. The keyboard and native floppy disk write speed on C64 was just so dodgy, I was mostly using atari 8bit for editing, things like this, until I went to PC/ST. I sort of appreciate the tinkering as much as the games, myself, and though the world won't come to a halt without Mister C128, I'd goof with it if it came out for sure. Emulation is such a huge amount of work relative to the rewarsd, it requires someone with C128 passion to dig into this, I think. And this one, not sexy either, like Saturn or PS1.

These days I find retro-BBSing more entertaining than retro-word processing/spread-sheeting, tbh. Was it possible to connect to BBS from CPM/80 column on the C128? Did CPM have access to the modems also? Was there a GEOS native terminal emulator?

Re: Commodore 128 for the MiSTer?

Posted: Mon Sep 27, 2021 7:10 pm
by rhester72
I don't know anyone that ever did anything with a modem in CP/M...I'm honestly not sure if it would have been possible or not. (Given the complexities of the user port, I'm leaning towards 'not'.)

There was certainly GeoTerm for GEOS, though - but it wasn't very feature-rich or performant, it seemed to me that it was to put a checkbox in the "GEOS has a terminal' box.

Re: Commodore 128 for the MiSTer?

Posted: Mon Sep 27, 2021 9:29 pm
by virtuali
There was plenty of terminal software running in native 128 mode, many supporting 80 columns too:

https://commodore.software/downloads/ca ... l-programs

No idea if it was ever possible to go online from CP/M mode. Could be the Z80 which was normally used in C128 mode to handle some I/O (not sure about the User Port), can't do it in CP/M mode because...it's running CP/M instead ?

Re: Commodore 128 for the MiSTer?

Posted: Fri Dec 17, 2021 3:58 pm
by mparson
virtuali wrote: Mon Sep 27, 2021 9:29 pm There was plenty of terminal software running in native 128 mode, many supporting 80 columns too:

https://commodore.software/downloads/ca ... l-programs

No idea if it was ever possible to go online from CP/M mode. Could be the Z80 which was normally used in C128 mode to handle some I/O (not sure about the User Port), can't do it in CP/M mode because...it's running CP/M instead ?
It's been a LONG time since I had my 128 up and running, but I do remember trying out some terminal programs uner CP/M. From what I remember, it could handle 1200 baud OK, but struggled with 2400 baud. At the time, I had a CMD Swiftlink and a 14.4k modem, so, I was able to go full-speed in native 128 mode. I don't think I was able to make use of the SL under CP/M, probably had to use my old Aprotek 2400 baud modem.

Re: Commodore 128 for the MiSTer?

Posted: Fri Dec 17, 2021 5:31 pm
by rhester72
Both the 64 and 128 could definitely handle 2400 baud, at least with an Aprotek Minimodem.

Re: Commodore 128 for the MiSTer?

Posted: Sun Dec 19, 2021 4:19 pm
by mparson
rhester72 wrote: Fri Dec 17, 2021 5:31 pm Both the 64 and 128 could definitely handle 2400 baud, at least with an Aprotek Minimodem.
Yes, and in native 128 mode, it handled 2400 just fine. With the Swiftlink cart, I was able to do 14.4k. When combined with a cart-port multiplexer, I was able to use the Swiftlink and an REU at the same time and use the REU as a RAM disk and even download things at the full speed my modem could deliver.

My memory is that the 128 in CP/M mode did not handle speeds over 1200 baud very well though.

Re: Commodore 128 for the MiSTer?

Posted: Sat May 21, 2022 11:59 am
by eriks5
I recently got myself a DE10 nano and saw there was no C128 core, so I figured this is a nice little project to get back into FPGA programming :D

The C128 was my second computer back in the eighties - traded in my C64 for it - and I loved it, and still do. I still have it, and though it needed some repairs over the years it's still functioning. But I'm always afraid to turn it on, as it might just die some day.

So, I dove in schematics, Programmer's reference guide, and even some books I still had from over 35 years ago, in an attempt to create a C128 core, and here it is. Forked from the C64 MiSTer core since the 128 is essentially a C64 with some extra chips hacked in. Not a 100% complete C128 implementation (yet), but some programs already work.

C128 features implemented
  • MMU fully implemented and tested. Configurable for 128K or 256K of system memory.
  • VDC partially implemented: memory interface is, video output is not.
  • Z80 implemented. Simple uses work, but CP/M does not yet boot.
  • C64 mode fully operational.
  • Support for C128 specific .CRT and .PRG files.
  • C128DCR or C128 ROMs and hardware differences implemented.
C128 features not (yet) implemented
  • C128 specific keys
  • 80 column display
  • CP/M mode
  • Loading internal function ROM (were there even any ROMs for this?)
  • 1571 drive and fast serial for disk I/O
  • ... probably other stuff I forgot or didn't realize is different from the C64
You can download the core from the repo at: https://github.com/eriks5/C128_MiSTer
The README of the repository has some more information on what is working and what is not.

And here's a short YouTube video showing the current state: https://youtu.be/DoZKi4JNWWs

I will be continuing to work on this. Next thing I want to dive into is implementing the extra keys and the 80 column video output.

Re: Commodore 128 for the MiSTer?

Posted: Sat May 21, 2022 1:55 pm
by thera34
Wow, that was unexpected :D Thank you @eriks5 !

Re: Commodore 128 for the MiSTer?

Posted: Sat May 21, 2022 2:08 pm
by AmintaMister
eriks5 wrote: Sat May 21, 2022 11:59 am I recently got myself a DE10 nano and saw there was no C128 core, so I figured this is a nice little project to get back into FPGA programming :D

The C128 was my second computer back in the eighties - traded in my C64 for it - and I loved it, and still do. I still have it, and though it needed some repairs over the years it's still functioning. But I'm always afraid to turn it on, as it might just die some day.

So, I dove in schematics, Programmer's reference guide, and even some books I still had from over 35 years ago, in an attempt to create a C128 core, and here it is. Forked from the C64 MiSTer core since the 128 is essentially a C64 with some extra chips hacked in. Not a 100% complete C128 implementation (yet), but some programs already work.

C128 features implemented
  • MMU fully implemented and tested. Configurable for 128K or 256K of system memory.
  • VDC partially implemented: memory interface is, video output is not.
  • Z80 implemented. Simple uses work, but CP/M does not yet boot.
  • C64 mode fully operational.
  • Support for C128 specific .CRT and .PRG files.
  • C128DCR or C128 ROMs and hardware differences implemented.
C128 features not (yet) implemented
  • C128 specific keys
  • 80 column display
  • CP/M mode
  • Loading internal function ROM (were there even any ROMs for this?)
  • 1571 drive and fast serial for disk I/O
  • ... probably other stuff I forgot or didn't realize is different from the C64
You can download the core from the repo at: https://github.com/eriks5/C128_MiSTer
The README of the repository has some more information on what is working and what is not.

And here's a short YouTube video showing the current state: https://youtu.be/DoZKi4JNWWs

I will be continuing to work on this. Next thing I want to dive into is implementing the extra keys and the 80 column video output.
AWESOME!

Thanks!!!!

Re: Commodore 128 for the MiSTer?

Posted: Sat May 21, 2022 2:11 pm
by NML32
Wow, this is very exciting news!! :)

Thank you @eriks5

Re: Commodore 128 for the MiSTer?

Posted: Sat May 21, 2022 2:34 pm
by rhester72
eriks5 wrote: Sat May 21, 2022 11:59 am Loading internal function ROM (were there even any ROMs for this?)
Yes, absolutely. For ease of testing, The Servant is probably your best bet.

Timing is going to increasingly become a bear the further you go, but I genuinely wish you all the luck in the world with this. I super-genuinely did not think it possible due to the timing issues...I hope to find I was wrong. =)

Re: Commodore 128 for the MiSTer?

Posted: Sat May 21, 2022 2:53 pm
by eriks5
Thank you everyone for all the positive reactions so far :)
rhester72 wrote: Sat May 21, 2022 2:34 pm
eriks5 wrote: Sat May 21, 2022 11:59 am Loading internal function ROM (were there even any ROMs for this?)
Yes, absolutely. For ease of testing, The Servant is probably your best bet.
Thanks, I'll look into that. The issue right now is that this core needs a lot of RAM cells in the FPGA, with 64k VDC RAM and a total of 128K for all the Basic and Kernal ROMs. And then there's the character rom and drive roms too. So the function ROM is going to have to live in the SDRAM I suppose.
rhester72 wrote: Sat May 21, 2022 2:34 pm Timing is going to increasingly become a bear the further you go, but I genuinely wish you all the luck in the world with this. I super-genuinely did not think it possible due to the timing issues...I hope to find I was wrong. =)
Z80 timing looks about right at the moment, although there is still some weirdness during VIC-II badlines. VDC timing is pretty much an unknown, I might cheat there and use dual port RAM for now :) My current goal is getting things working for non-timing critical programs, and worry about cycle perfectness later.

Re: Commodore 128 for the MiSTer?

Posted: Sat May 21, 2022 4:10 pm
by Alynna
So if this is actually being worked on I'd like to help. I know the Commodore computers inside and out.

Re: Commodore 128 for the MiSTer?

Posted: Sat May 21, 2022 4:13 pm
by akeley
Wonderful stuff. Extra bonus points for having working 15kHz support from the get go ;)

Re: Commodore 128 for the MiSTer?

Posted: Sat May 21, 2022 4:33 pm
by tontonkaloun
eriks5 wrote: Sat May 21, 2022 11:59 am I recently got myself a DE10 nano and saw there was no C128 core, so I figured this is a nice little project to get back into FPGA programming :D

The C128 was my second computer back in the eighties - traded in my C64 for it - and I loved it, and still do. I still have it, and though it needed some repairs over the years it's still functioning. But I'm always afraid to turn it on, as it might just die some day.

So, I dove in schematics, Programmer's reference guide, and even some books I still had from over 35 years ago, in an attempt to create a C128 core, and here it is. Forked from the C64 MiSTer core since the 128 is essentially a C64 with some extra chips hacked in. Not a 100% complete C128 implementation (yet), but some programs already work.

C128 features implemented
  • MMU fully implemented and tested. Configurable for 128K or 256K of system memory.
  • VDC partially implemented: memory interface is, video output is not.
  • Z80 implemented. Simple uses work, but CP/M does not yet boot.
  • C64 mode fully operational.
  • Support for C128 specific .CRT and .PRG files.
  • C128DCR or C128 ROMs and hardware differences implemented.
C128 features not (yet) implemented
  • C128 specific keys
  • 80 column display
  • CP/M mode
  • Loading internal function ROM (were there even any ROMs for this?)
  • 1571 drive and fast serial for disk I/O
  • ... probably other stuff I forgot or didn't realize is different from the C64
You can download the core from the repo at: https://github.com/eriks5/C128_MiSTer
The README of the repository has some more information on what is working and what is not.

And here's a short YouTube video showing the current state: https://youtu.be/DoZKi4JNWWs

I will be continuing to work on this. Next thing I want to dive into is implementing the extra keys and the 80 column video output.
A huge thank you!!
This is the core I was waiting for
:P :P :P

Re: Commodore 128 for the MiSTer?

Posted: Sat May 21, 2022 4:48 pm
by wark91
Thank you for your work !!!

Re: Commodore 128 for the MiSTer?

Posted: Sat May 21, 2022 5:04 pm
by breiztiger
thank you for this core !!!

Re: Commodore 128 for the MiSTer?

Posted: Sat May 21, 2022 5:54 pm
by Reed_Solomon
Great news. Thanks for working on this!

Re: Commodore 128 for the MiSTer?

Posted: Sat May 21, 2022 7:16 pm
by kathleen
Thank you @eriks5, this is a great news that I was waiting for since a while.
The C128 has more than its place here.

Re: Commodore 128 for the MiSTer?

Posted: Sat May 21, 2022 9:59 pm
by NML32
eriks5 wrote: Sat May 21, 2022 11:59 am You can download the core from the repo at: https://github.com/eriks5/C128_MiSTer
The README of the repository has some more information on what is working and what is not.

And here's a short YouTube video showing the current state: https://youtu.be/DoZKi4JNWWs

I will be continuing to work on this. Next thing I want to dive into is implementing the extra keys and the 80 column video output.
@eriks5
I followed the instructions on the Wiki to create loadable ROMs: ROM 1/4 and ROM 2/3. I think I did everything correctly since the 128 and 64 boot with Jiffydos.
I'm struggling to get Drive ROMs working. I'm guessing all I need to do is load either the 1541 or 1581 jiffy ROM from the OSD. After loading either 1541, 1541-II, or 1581 Jiffydos ROM and I do the @ command it displays the Dolphin DOS ROM information.
Maybe the loading of the Drive ROMs hasn't been implemented yet.

My real Commodore drives with Jiffydos are working on my ironclad MiSTer with the IEC adapter. :)

Thank you for working on bringing the C128 to the MiSTer.
MiSTer C128 Jiffydos.png
MiSTer C128 Jiffydos.png (96.53 KiB) Viewed 8563 times

Re: Commodore 128 for the MiSTer?

Posted: Sun May 22, 2022 1:20 am
by Alynna
tontonkaloun wrote: Sat May 21, 2022 4:33 pm
eriks5 wrote: Sat May 21, 2022 11:59 am I recently got myself a DE10 nano and saw there was no C128 core, so I figured this is a nice little project to get back into FPGA programming :D

The C128 was my second computer back in the eighties - traded in my C64 for it - and I loved it, and still do. I still have it, and though it needed some repairs over the years it's still functioning. But I'm always afraid to turn it on, as it might just die some day.

So, I dove in schematics, Programmer's reference guide, and even some books I still had from over 35 years ago, in an attempt to create a C128 core, and here it is. Forked from the C64 MiSTer core since the 128 is essentially a C64 with some extra chips hacked in. Not a 100% complete C128 implementation (yet), but some programs already work.

C128 features implemented
  • MMU fully implemented and tested. Configurable for 128K or 256K of system memory.
  • VDC partially implemented: memory interface is, video output is not.
  • Z80 implemented. Simple uses work, but CP/M does not yet boot.
  • C64 mode fully operational.
  • Support for C128 specific .CRT and .PRG files.
  • C128DCR or C128 ROMs and hardware differences implemented.
C128 features not (yet) implemented
  • C128 specific keys
  • 80 column display
  • CP/M mode
  • Loading internal function ROM (were there even any ROMs for this?)
  • 1571 drive and fast serial for disk I/O
  • ... probably other stuff I forgot or didn't realize is different from the C64
You can download the core from the repo at: https://github.com/eriks5/C128_MiSTer
The README of the repository has some more information on what is working and what is not.

And here's a short YouTube video showing the current state: https://youtu.be/DoZKi4JNWWs

I will be continuing to work on this. Next thing I want to dive into is implementing the extra keys and the 80 column video output.
A huge thank you!!
This is the core I was waiting for
:P :P :P
I will get this downloaded and start working on it too ASAP. :)
I think my priorities will be
  • 80 column screen
  • CP/M mode
  • C128 keys
  • A turbo mode that allow the 8502 and Z80 to live outside of eachother's bus occupation time a little more (4mhz 8502/8mhz Z80), primarily to enhance CP/M speed
Dual SID should be able to be done with the second SID in the D4xx memory space (like $D420?)

Re: Commodore 128 for the MiSTer?

Posted: Sun May 22, 2022 1:30 am
by Dazed
I had a 128 as a kid and loved it, but I think I could probably count on one hand the amount of times I actually used the 128 or cpm mode. For me it was 64 mode mostly.

Of course I’d love a core just for the trip down memory lane :)

Re: Commodore 128 for the MiSTer?

Posted: Sun May 22, 2022 6:43 am
by eriks5
NML32 wrote: Sat May 21, 2022 9:59 pm I followed the instructions on the Wiki to create loadable ROMs: ROM 1/4 and ROM 2/3. I think I did everything correctly since the 128 and 64 boot with Jiffydos.
I'm struggling to get Drive ROMs working.
I haven't touched the drive rom loading option from the menu, so that should still work as it works in the C64 core. However, I did remove the feature where you could join C64 and drive roms and upload those as a single unit. I removed that so it was possible to have a single unit for international versions of the C128 roms. I figured that uploading drive roms separately was possible using the drive rom upload option.

But maybe the drive rom upload feature works differently from what I expected, and by removing loading of joined roms it broke. I'll look into it.
NML32 wrote: Sat May 21, 2022 9:59 pm My real Commodore drives with Jiffydos are working on my ironclad MiSTer with the IEC adapter.
Nice! I'm still waiting for my Ironclad MiSTer to arrive, currently running the DE10 bare with only a USB hub ;). Also already have the IEC adapter for it and last time I tried it my 1571 still worked so fingers crossed. From what I understand the IEC adapter won't support fast serial though as that line is not connected.

Re: Commodore 128 for the MiSTer?

Posted: Sun May 22, 2022 6:46 am
by eriks5
Alynna wrote: Sun May 22, 2022 1:20 am A turbo mode that allow the 8502 and Z80 to live outside of eachother's bus occupation time a little more (4mhz 8502/8mhz Z80), primarily to enhance CP/M speed
Changing from the current serial coprocessing model to true multiprocessing would be a huge change to the hardware and also requiring major changes to the Kernal and Z80 Bios. Currently the whole system expects only one CPU to run and the other waiting to be allowed to continue. There's already enough room in the core timing to have them run in parallel at 2MHz each, but the result would not be a C128 anymore.
Alynna wrote: Sun May 22, 2022 1:20 am Dual SID should be able to be done with the second SID in the D4xx memory space (like $D420?)
Yes that's already one of the four available options inherited from the C64 core. $D500 is still in that list but won't work in this core right now. It just needs to be removed from the menu and right SID selection logic adjusted.