Homebrew [Release] Vice3DS-C128 (C128 Emulator)

Badda

me too
OP
Member
Joined
Feb 26, 2016
Messages
321
Trophies
0
Location
in the riggin
XP
2,626
Country
Saint Kitts and Nevis
vice3ds128.png


This is a port of the VICE C128 emulator to 3DS.
VICE - the Versatile Commodore Emulator - http://vice-emu.sourceforge.net/

As a spin-off to the vice3DS C64-emulator, I ported the C128 emulator as well. Alas, the poor 3DS (even the N3DS) is not powerful enough to run the C128 emulator at an acceptable speed (especially in VDC-mode, better known as 80-colums mode, which is painfully slow - VIC-mode runs so so).
The UI and button mappings are mostly the same as the C64 emulator. Only the soft keyboard has slightly changed and there is a new soft button to switch between 40- and 80-columns mode (which simulates the hardware switch on your C128 monitor).
Currently, only .3dsx-file is available. If anybody finds this emulator useful, I will create a .cia and .3ds file as well.

Download here: https://github.com/badda71/vice3ds/releases

Current version is v0.1

Installation

Copy .3dsx file to /3ds/vice3ds on your SD card and launch in HBL
Important: If you have an older version (before 1.5) of vice3DS C64-emulator installed already, make sure to delete the config directory on your SD-card /3ds/vice3ds/config before starting the emulator. Otherwise new config settings, hotkeys and key mappings will not be updated and will not work.

Known bugs:
  • frequently crashes when switching to/from 80 columns mode
  • crash when switching to/from fullscreen many times
  • sound distortions when using bottom screen, caused by sound buffer underruns
  • 80-columns mode runs VERY slow, sound is garbled due to permanent buffer underruns
If anybody wants to help fix these bugs, you are welcome to help me with a pull request on github :D

Thanks to:
 
Last edited by Badda,

Vague Rant

Deceptively cute
Member
Joined
Aug 7, 2008
Messages
2,512
Trophies
2
Location
Melbourne
Website
vaguerant.tumblr.com
XP
3,768
Country
This is really exciting stuff; I grew up with the C64 but never had a 128, this seems like the perfect time to jump on board.

I don't have any 128 software yet, so I tried loading up a few C64 games since I recall the 128 was backward-compatible, but they all seem to crash on a blocky green screen. Is there anything I can do on my end about that, or is that a non-starter?

Regardless, thanks so much for making this. :) Off to check out what 128 games were good!
 

Badda

me too
OP
Member
Joined
Feb 26, 2016
Messages
321
Trophies
0
Location
in the riggin
XP
2,626
Country
Saint Kitts and Nevis
This is really exciting stuff; I grew up with the C64 but never had a 128, this seems like the perfect time to jump on board.

I don't have any 128 software yet, so I tried loading up a few C64 games since I recall the 128 was backward-compatible, but they all seem to crash on a blocky green screen. Is there anything I can do on my end about that, or is that a non-starter?

Regardless, thanks so much for making this. :) Off to check out what 128 games were good!

Maybe you have to hold down the CBM-key during reset? This way, the C128 will boot into C64 mode.
Actually, I never owned a C128 myself, too. Maybe @urherenow can give some clues?
 
Last edited by Badda,
  • Like
Reactions: Vague Rant

Vague Rant

Deceptively cute
Member
Joined
Aug 7, 2008
Messages
2,512
Trophies
2
Location
Melbourne
Website
vaguerant.tumblr.com
XP
3,768
Country
Maybe you have to hold down the CBM-key during reset? This way, the C128 will boot into C64 mode.
Been reading about the C128 a bit more and just found another tidbit: you can switch to C64 mode at any time from the BASIC shell by typing "GO64".

EDIT: I figured I should expand on why anybody would use a Commodore 128 emulator to play Commodore 64 games in backward-compatibility mode when there's already a perfectly good Commodore 64 emulator. The answer is pretty simple: both systems use 6502-based CPUs, but while the C64's is clocked at 1MHz, the C128 has a variable clockspeed that can run at 1MHz or, for C128 and C128-enhanced games, 2MHz. Because of this, there are several C64 games which take advantage of the bump to the 128's hardware to run better:

The disk for Qix had a normal C64 version on side A, and a C128-enhanced version on side B. Ultima V has no music on the C64, but play it in C64 mode on a C128 and it uses the extra processing time to have music playing throughout the game. This also extends to homebrew, like Zeropaige's Super Mario Bros. port, which runs pretty poorly on a stock C64 but can be enhanced by CPU addons or, drumroll, the C128. There's still some slowdown, but it's really night and day.
 
Last edited by Vague Rant,
  • Like
Reactions: Garcimak and Badda

urherenow

Well-Known Member
Member
Joined
Mar 8, 2009
Messages
4,894
Trophies
2
Age
48
Location
Japan
XP
3,964
Country
United States
WoW! All the really good stuff happens when I'm out to sea. Can hardly wait to dig into this one. Perhaps I'll upload a disk image of some music I transposed into C128 BASIC when I was young :P Gotta test it out on this first though.
 

Elwyndas

Well-Known Member
Member
Joined
Dec 19, 2018
Messages
197
Trophies
0
XP
691
Country
United States
Last edited by Elwyndas,

Computer_Freak_2004

Well-Known Member
Newcomer
Joined
Jun 1, 2019
Messages
64
Trophies
0
XP
1,683
Country
Germany
Is it possible to port the Vice-VIC-20 Emulator to the 3DS as well? I think this should run at a good framerate on the Old3DS because I get around 2000% speed when in warp mode in the Vice-VIC-20 emulator on my PC. But on Vice-C64 I only get around 300% speed in warp mode.
 
  • Like
Reactions: telengard

urherenow

Well-Known Member
Member
Joined
Mar 8, 2009
Messages
4,894
Trophies
2
Age
48
Location
Japan
XP
3,964
Country
United States
@Badda I've just updated my firmware to the latest, and Luma to the latest, and the c128 .3dsx file no longer works. It crashes the system! The installed c64 still works.

Building from source is kind of messed up as well. I'm assuming that the couple of uses for GSPGPU_FramebufferFormats are meant to be GSPGPU_FramebufferFormat (in the latest libraries... unless it really needs gfxFramebufferFormats?)

But I can't wrap my head around sceneInit in SDL_n3dsvideo.c. There is an implicit non-static declaration at line 421, but then a static declaration at line 723, and in the end, I end up with a defined but not used error on sceneInit anyway.

Edit: sceneInit wasn't an issue (since apparently it isn't used), I had to look farther up to see another GSPGPU_FramebufferFormats that I missed taking the "s" off of. But at the end, there are a ton of "undefined reference" errors to a buttload of important stuff, as well as cart/magicvoice.c having some things WAY out of the array bounds. Something is really fishy when it comes to linking... it must be in the makefile, but I don't see what's wrong.
 
Last edited by urherenow,

Badda

me too
OP
Member
Joined
Feb 26, 2016
Messages
321
Trophies
0
Location
in the riggin
XP
2,626
Country
Saint Kitts and Nevis
@Badda I've just updated my firmware to the latest, and Luma to the latest, and the c128 .3dsx file no longer works. It crashes the system! The installed c64 still works.

Building from source is kind of messed up as well. I'm assuming that the couple of uses for GSPGPU_FramebufferFormats are meant to be GSPGPU_FramebufferFormat (in the latest libraries... unless it really needs gfxFramebufferFormats?)

But I can't wrap my head around sceneInit in SDL_n3dsvideo.c. There is an implicit non-static declaration at line 421, but then a static declaration at line 723, and in the end, I end up with a defined but not used error on sceneInit anyway.

Edit: sceneInit wasn't an issue (since apparently it isn't used), I had to look farther up to see another GSPGPU_FramebufferFormats that I missed taking the "s" off of. But at the end, there are a ton of "undefined reference" errors to a buttload of important stuff, as well as cart/magicvoice.c having some things WAY out of the array bounds. Something is really fishy when it comes to linking... it must be in the makefile, but I don't see what's wrong.

I got it to compile again with the latest libctru version but I do not have enough time for testing.
Here is the new 3dsx: http://badda.de/dl/vice3DS-C128.3dsx
I'd be happy if you had some time to test ...
 

urherenow

Well-Known Member
Member
Joined
Mar 8, 2009
Messages
4,894
Trophies
2
Age
48
Location
Japan
XP
3,964
Country
United States
I got it to compile again with the latest libctru version but I do not have enough time for testing.
Here is the new 3dsx: http://badda.de/dl/vice3DS-C128.3dsx
I'd be happy if you had some time to test ...
It works! Thanks for re-compiling! Wish I could simply clone and compile myself though. You have a perfectly good .cia for C64, and I'd really like to build a .cia for 128. One thing to note, in case people with weird boot choices try to report bugs. Background first... I boot into a franken GW emunand quite often because I like their cheat engine. It seems that now, the only way for me to load up HBL (in GW mode), is via *hax.

With that in mind, the UI (at least on 128... didn't check c-64 just now) is super sluggish, and either I am impatient, or it freezes on a red BOTTOM screen when trying to quit the emulator. Again, this is only when getting into HBL via *hax. When loading HBL via Rosalina, it seems pretty much perfect to me :). This is my main reason for wanting a .cia for 128.

Edit: do you have local changes not committed to .git? In case you were using a wip ctrulib, I just pulled, compiled, and installed from the current source, and tried to build vice3ds again. right off the bat, it errors out on GSPGPU_FramebufferFormats (and changing that to GSPGPU_FramebufferFormat everywhere it appears gets past it). I still end up with linker problems in the end though. spits out a ton of undefined references that I know are actually in the source. All things installed under dkp-pacman are up to date, with a (now) fresh pull of the ctrulib source).

~/projects/vice3ds$ git checkout
Your branch is up to date with 'origin/master'.
 
Last edited by urherenow,

telengard

New Member
Newbie
Joined
Mar 1, 2022
Messages
3
Trophies
0
Age
53
Location
Hudson, NH
XP
46
Country
United States
Somewhat related question, what game is shown in the middle pic at the top of the post? It looks sorta like a Taipan type game with graphics. Would like to try it. :)

EDIT: google search for some of the terms got me to an Ahoy issue that mentioned it, Empire - A Trading Adventure
 
Last edited by telengard,

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • No one is chatting at the moment.
    Kirbydogs @ Kirbydogs: o damn that is sad