1. Badda

    OP Badda Nu Member

    Feb 26, 2016

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

    @spinal_cord made a C64 emulator (Breadbox) based on Frodo but it does not work anymore with recent firmwares and he is not updating it anymore, so I gave it a shot to port the Vice C64 emulator v3.3 to the 3DS. Vice does support SDL1 but porting was not quite as easy as "just compile": A new sounddriver for the 3DS needed to be written, devkitpro libraries do not support all functionality required by full fledged Vice (so I had to strip them in quite some places) and lots of other things that needed tweaking or adaption. Apart from this, the 3DS needed a UI for the bottom screen, so this needed to be written from scratch.
    The result is: Vice3DS

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

    Install .cia file with FBI - or - copy .3dsx file to /3ds/vice3DS-C64 directory on your SD card and launch in HBL - or - launch .3ds file from flashcard
    Apart from this, a DSP-dump is required for sound to work correctly in the CIA version.

    Preconfigured button functions:
    • Select: open Vice menu
    • Start: open Gamebase64 launcher
    • Directional Pad / A-Button: Joystick
    • B-Button: Joystick Up
    • R-button: Autofire. Within vice menu, R-button starts the mapping of a hotkey.
    • C-Stick: cursor keys
    • L/ZL-buttons: left/right mouse buttons if mouse is enabled.
    • 3D-slider: Emulation speed (0 = 100%, max = Warp-mode)
    • Soft buttons functions (from left to right, top to bottom) :
      • Autostart image
      • Hit RUN/STOP
      • Toggle joystick ports
      • Toggle C-Pad / D-Pad for joystick
      • Warp Mode

      • Quickload snapshot
      • Quicksave snapshot
      • Toggle True Drive Emulation
      • Hard Reset
      • Pause emulation

      • Attach disk image to drive 8
      • Toggle Sprite-Sprite collisions
      • Power off bottom screen backlight
      • Type command: LOAD\"*\",8,1 - RUN
      • Type command: LOAD\"$\",8 - LIST

      • Hit RUN/STOP
      • Hit SPACE
      • Hit RETURN
      • Enable Mouse
      • Toggle No borders / Fullscreen
    This (and a lot of other things) can be changed in Vice menu. To change the mapping of a soft button (or actually any other button incl. all the 3DS- and soft keyboard buttons) to a menu item in Vice menu, press the R-button when the menu item is selected, then touch/press the button. This button will now be mapped to the selected menu entry.

    From v1.6 on, Vice3DS will run with acceptable framerates (~20 fps with fastSID emulation) on O3DS. However, a N3DS is recommended: Only here, you will get the full 50fps and incredible reSID sound.

    Current stable version is v2.4.1 Senbei

    v2.4.1 Senbei
    • bugfix: fix gamebase64 launcher crash if more than 64 games are downloaded
    v2.4 Senbei
    • enhancement: netplay is now possible
    • optimization: issue warning at startup if 3D-slider is not set to OFF
    • bugfix: no more sound errors on resume after pressing home button
    v2.3 Mochi
    • enhancement: gamebase64 launcher now works on O3DS with reduced database size (and lots of other memory optimizations)
    • enhancement: auto switch to (hopefully) correct joyport/control scheme when starting a game in gamebase64 launcher
    • enhancement: new joystick handling (only 1 joystick, plugable in p1/p2 and switchable between dpad/cpad, B-button = joy up, R-button = autofire)
    • enhancement: auto-switching PAL/NTSC / TDE / Control scheme in gb64 launcher can now be turned off
    • enhancement: soft button positions are now saved in snapshot files when saving configuration
    • enhancement: volume can now be increased to 200%. This will make some games more audible but will most probably result in sound distortions for most games.
    • enhancement: VICE menu cleanup & restructure
    • enhancement: all downloads are a lot faster
    • enhancement: if no fliplist is active, the currently attached image directory or current directory is automatically a fliplist
    • enhancement: cracker group info in gb64 database/screen
    • enhancement: list of "popular" games extended in gamebase64 launcher
    • enhancement: issue UI warnings if true drive emulation is disabled but a program needs it
    • optimization: START button now starts gb64 launcher, moved rs/restore soft button back to top, included "enable mouse" in soft buttons again
    • optimization: removed lots of unused or unnecessary vice code
    • optimization: remove cartridge before autostarting an image if not default cartridge
    • optimization: true drive emulation enabled by default but autostart initially loads without TDE
    • optimization: autostart will not require selecting a file within the image anymore, new menu entry "autostart file in image"
    • optimization: numbers in download/installation progress now better readable
    • optimization: Option to turn off database update prompts in gamebase64 launcher
    • optimization: directory structure for downloaded games now resembles gb64 structure
    • optimization: make statusbar wider & remove keyboard status bar (who needs this anyways?)
    • optimization: Default drive idle method is "None" for N3DS and "Skip cycles" for O3DS
    • optimization: game files are directly downloaded with ftp from 8bitfiles.net, not over http proxy anymore (needs a custom build version of libcurl, fincs does not want to fix it in devkitARM https://github.com/devkitPro/pacman-packages/issues/130 )
    • bugfix: no more freeze/crash when switching from/to fullscreen multiple times
    • bugfix: last selected file was not always identified correctly in file dialog
    • bugfix: no more crash when restoring default settings on NTSC machine
    • lots of other bugfixes and small enhancements
    v2.2 Onigiri
    • enhancement: gamebase64 UI
    • optimization: setting AutostartHandleTrueDriveEmulation turned on per default
    • bugfix: key mappings were not saved correctly
    • bugfix: icon generation for "L btn", "ZL btn" etc did not work as expected
    • bugfix: Emulation was paused after installing a memhack
    • bugfix: When autostarting two tape images, the second image would not RUN automatically
    • many other small enhancements, optimizations and bug fixes
    v2.1 Congee
    • enhancement: Online-Updater
    • enhancement: Key mappings now support multiple target keys, key combos are obsolete & removed
    • enhancement: "Settings management" menu - added option to hide menu button on bottom screen
    • enhancements for building custom vice3ds games:
      • if file romfs:/prefix.txt exists, changes default directory on SD card to /3ds/vice3DS-C64/<contents of file>
      • added "ChgRootDirectory" resource to change root of file selection dialog
      • added "AutostartImage" resource to specify exact location of autostart image
      • at startup, all files in romfs:/autocopy will be copied to default dir without overwriting existing files
      • Custom help texts for keys (configurable in in menu "Help")
    • some other small enhancements, optimizations and bug fixes
    v2.0 Screw Driver
    • enhancement: vice menu moved from top to bottom screen, emulation does not pause anymore while menu is open
    • enhancement: vice menu now useable with stylus
    • enhancement: customizeable C64 keyboard command shortcuts
    • enhancement: show hint about how to exit edit sbuttons mode
    • enhancement: "power off bottom screen" is now a toggle button
    • enhancement: file sorting now case insensitive
    • enhancement: vice3DS checks for autostart.*-files in romfs:/ and vice directory and autostarts at startup
    • enhancement: autofire can now be configured in the joystick keysets
    • enhancement: support of zip files for autostart
    • enhancement: configurable key combos
    • optimization: cancel-key moves one directory up in file dialog
    • optimization: move statusbar menu entry back to original location (main menu)
    • optimization: changed button functions in menu: map hotkey with R-button, press L-button to use the emulation while menu is active
    • optimization: smooth scrolling scroll bar in menu, file and imgfile dialog
    • optimization: speed reducion/speedup ranges in slider adjusted
    • optimzation: passing end/beginning in file/imgfile dialog wraps the cursor to beginning/end
    • bugfix: removed monitor from cpujam messagebox
    • bugfix: sometimes d64 files were corrupted after autostart
    • bugfix: fixed crash when closing the 3ds lid, home button works now
    • multiple bugfixes in file selection dialog, screen update routine
    • lots of other bugfixes, optimizations and small enhancements
    v1.6 Espresso
    • enhancement: major performance increase by optimizing and merging top (SDL) and bottom (citro3D) screen update routines
    • enhancement: reSID sound engine support. Default engine is fastSID for O3DS, reSID for N3DS. reSID is more performance-hungry than fastSID, but sound is by far better. To change this setting, open VICE menu and go to "Machine settings" -> "Model settings" -> "SID settings" -> "SID model"
    • enhancement: new help screen to show all current button functions (in emu and in menu)
    • enhancement: soft button positions can now be changed by activating edit-mode (VICE menu: "Misc" -> "Edit bottom screen button positions") and dragging the soft buttons with the stylus. New positions are saved when saving settings
    • enhancement: applying default setting will not require restart anymore
    • enhancement: config files (vicerc, ROMs, icons etc.) are stored internally per default, files on SD card override internal files. Added menu entry in "Settings" menu to copy all internal config files to SD card.
    • optimization: remove SDL joystick - all 3ds buttons and pad directions are now "keys" for vice3DS. These keys can be mapped to C64-joysticks via definition of keysets.
    • optimization: define all default settings in code, no sdl-vicerc config file needed anymore
    • optimization: optimize compiler flags for speed
    • bugfix: eliminated sound distortions when using bottom screen (result of performance increase)
    • bugfix: some soft buttons wouldn't unstick, fixed bug in MaxScreen softbutton
    • multiple other small enhancements, optimizations and bug fixes
    v1.5 Cappuccino
    • spin-off: Exerimental C128-emulator (.3dsx only). It runs ok, but VDC-mode is painfully slow. https://gbatemp.net/threads/release-vice3ds-c128-c128-emulator.545436/
    • enhancement: added sampler device "3DS built in microphone audio input". Haven't you always wished to record 4bit samples with your 3DS that you can play on your C64 computer?
    • enhancement: added sampler settings menu & other devices for joyports
    • enhancement: add 'advance frame' menu entry to vice menu
    • enhancement: show mouse button mappings on touchpad
    • optimization: optimized keyboard handling (e.g. c-stick mapping & file dialogs)
    • optimization: remove RS232 stuff from vice menu (wasn't working anyway)
    • optimization: revamp build system, no more buildtools necessary

    v1.4 Cereal
    • enhancement: speed up directory loading times in file selection dialogs
    • enhancement: enabled mouse support / bottom screen is now a touchpad when mouse is enabled, L- and ZL-buttons are mapped to left and right mouse button per default. Mouse sensitivity configurable. Tested for hours with Arkanoid :-)
    • enhancement: create button mappings in "Misc" menu (key->key, key->joy, key->mousebutton), icons for mapped soft buttons are auto-generated. Now, B-button can be mapped to Joy-UP easily ...
    • enhancement: added option to save key mappings and hotkeys in snapshots
    • enhancement: added hotkey management entries in menu "Misc" (list hotkeys, unmap hotkey). Haven't you wished to easily get rid of your hotkey mappings?
    • enhancement: cleaned up "Settings management" menu, hotkeys are now saved with other settings in file sdl-vicerc.
    • enhancement: added menu entry/icon for no borders & fullscreen. No more magnifying glasses needed when playing.
    • enhancement: added video size menu (fullscreen with multiple stretch options, etc.)
    • enhancement: added video border mode menu
    • enhancement: new icon (yay!)
    • enhancement: status bar now on bottom of emulator screen (like standard SDL-Vice)
    • optimization: moved button to create hotkey mapping from ZL-button to L-button
    • lots of other small enhancements and bug fixes
    v1.3 Pancake
    • enhancement: button to show/hide the keyboard, more soft buttons below keyboard
    • enhancement: pixel perfect screen representation (required change in libSDL, thanks to @Vague Rant)
    • enhancement: paint color keys on keyboard with palette colors
    • enhancement: added help menu
    • enhancement: remember current directory for file dialogs across restarts
    • enhancement: standard soft button icons are copied to SD-card at startup, they can now be modified/amended by the user
    • enhancement: added some more helper menu entries in menu "Misc"
    • enhancement: added some soft button icons
    • bugfix: no more freeze when exiting via home or power button
    • bugfix: roms added for all C64 machine types
    • bugfix: re-center display after machine type change
    • optimization: stripped some unnecessary code (vkbd, hvsc)
    v1.2.1 Bacon&Eggs
    • fix random lock-ups (was actually a bug in libSDL)
    • fix for "not possible to select external palette files"
    • fix for "crackling sound when using keyboard"
    • fix for "not possible to change back to stock rom from another rom"
    • fix for "menu entry 'Restore default settings' messes up screen"
    • added menu entry/icon 'Misc/Power off bottom screen backlight'
    • added two icons for sprite collision menu entries
    • added menu entry to restore all default settings (incl. hotkeys etc)
    • quicksave/-load now always saves to/loads from /3ds/vice3ds
    • added "RUN" to LOAD"*",8,1 menu entry
    • Added F2/F4/F6/F8 keys to keyboard for easy access
    • Added pause icon / ability to pause via soft button
    • Nice new banner / startup logo
    • other minor bugfixes and optimizations
    v1.1 Breakfast Toast
    • Customizeable soft buttons on bottom screen.
    • Changed standard assignment of autofire buttons: Joy1=R, Joy2=ZR
    • True drive emulation now turned off by default
    • Emu-speed adjustable with 3d slider (0=100%, max=Warp)
    • Added menu 'Misc' with some helpers: RUN/STOP + RESTORE; LOAD"*",8,1
    • Bugfix for loading external ROMs and other sysfiles
    v1.0.1 Sunshine
    • clearer keyboard
    • bugfix for "Vice menu sometimes does not update screen when navigating"
    • bugfix for autofire
    v1.0 Morning Glory
    • Autofire support (configurable in VICE menu under "Machine settings" -> "Joystick settings")
    • New keyboard layout
    • Bugfixes
    v0.9 beta
    • Bugfixes
    • CIA/3DS build
    • Larger keyboard / keys
    • Configuration files in romfs - will be copied to SD card if not existing there.
    • Key names showing correctly now in vice menu
    • vice3DS now exits gracefully when pressing the menu button
    • Show drive status in notification LED (settings in "Drive" menu)
    • v0.3 was accidentally a debug build, so v0.4 is faster
    • OSK works now in vice menu when inputting file names
    • new, flashy background and keyboard images compiled in binary
    • removed some menu entries that will break things on 3ds
    • C-stick/ZL/ZR working, C-Stick mapped to cursor keys
    • status bar (can be activated in menu "Settings management")
    • when switching machines, bottomscreen is no more blanked
    • On screen keyboard on bottom screen
    v0.1 Dawn of Vice3DS

    There are no open tasks, todos or known bugs, but if anybody has a good idea on how to make this emulator better or wants to contribute with some nice new functionality, you are welcome to create a pull request on github :D
    Any other bugs can be reported here: https://github.com/badda71/vice3ds/issues

    Thanks to:
    • The Vice-Team of course
    • @Elwyndas for the good ideas on how to make this project better, for the great test support and for sending me the O3DS so I can test there, too!
    • www.gamebase64.com for providing the C64 games library and an easy way to integrate
    • @nop90 for the 3DS libSDL port - porting VICE to 3DS would not have been possible without it (even though I had to tweak it in a couple of places ...)
    • @spinal_cord for breadbox, the keyboard images and design ideas
    • @thealgorithm for providing the essential clue on how to enable reSID support
    Last edited by Badda, Jul 16, 2020
    turilo, Jack8to16bit, Joelb and 48 others like this.
  2. Elwyndas

    Elwyndas GBAtemp Regular

    Dec 19, 2018
    United States
    You are a hero! I have no words!
    Caronteone likes this.
  3. Rj.MoG

    Rj.MoG GBAtemp Fan

    Jun 8, 2015
    United States
    I was just messing with breadbox myself and ended up using FrodoDS yesterday! Awesome job man. Thanks for this
  4. spinal_cord

    spinal_cord Knows his stuff

    Jul 21, 2007
    Excellent work so far!
    If only I could be bothered to set up the 3DS dev stuff on my computer.
    I don't know if you want to use these, but these didn't make it into breadbox, they might be useful for your bottom screen keyboard...
  5. Badda

    OP Badda Nu Member

    Feb 26, 2016
    Very useful, thank you. I was actually already looking for something like that but could not find anything suitable
    lincruste and H1B1Esquire like this.
  6. Muxi

    Muxi GBAtemp Advanced Fan

    Jun 1, 2016
    @Badda Great work! Thanks for this!
  7. urherenow

    urherenow GBAtemp Psycho!

    Mar 8, 2009
    United States

    THANK YOU! Looking forward to trying it out.

    As you get more familiar with it, please don't disregard the possibility of getting C128 working as well. Wrote my favorite music piece in C128 BASIC (not favorite music, but my proudest attempt at writing music on a computer) and would just love to be able to show it off again on the 3DS.

    EDIT: First thing I notice is the readme (yes... a man that actually reads instructions beforehand... spent 24 years in a job where people could die if you didn't, ok?). Not every system has pacman, and I'm not too sure if p7zip can be installed with the pacman/dkp-pacman that comes from dkp. I installed p7zip long ago, but used apt-get for that one. AFAIK it also works in MSYS2 on Windows.

    Next: Where to place disk images? I'm guessing you can navigate, but you could/should suggest a standard location (eg. make a floppy, tape, and cart directory in 3ds/vice3ds)
    EDIT: if you’re not using a whole library, it’s best to put your games in 3ds/vice3ds. This is always the starting point when you attach a disk image.

    EDIT2: yup, you can navigate (but it doesn't remember the path for later). And I was preparing to be mad as hell if this was an April fool's joke. But it's not :). Figuring out the shift key(s) takes a minute to figure out as well. May want to add that info to the readme. And the fact that you need to move the cursor to an unused spot on the keyboard in order to hit B to make it go away...

    Edit3: It's going to be tricky laying bait in Ghostbusters to prevent a "marshmallow catastrophe" fast enough. You may want to think about using the top screen for emulation, and the bottom touch screen for the OSK, so it's easer to use the keyboard, and allowing to use keys and joystick at the same time.

    Edit4: I played a bit of Ghostbusters. And I'm looking at, and listening to, the start screen/demo of Windham Classics: Below The Root. @Badda ... I love you, man :wub:
    Last edited by urherenow, Apr 1, 2019
  8. Elwyndas

    Elwyndas GBAtemp Regular

    Dec 19, 2018
    United States
    The DS family is clearly the only handheld (!) device where C64 emulation makes sense. This is due to the 2nd screen, that is also a touch screen. The second (lower) screen can be used for the keyboard, besides navigation for the emulation functionality. On every other handheld without a physical keyboard, the virtual keyboard needs to be launched on top of the emulation. This makes the virtual C64 extremely annoying to use in any case where you are not just loading a game with joystick use. Any cracked game with intros etc will usually make you use the keyboard just to get through the opening screens.

    I know I'm stating the obvious here, but it really is the killer advantage and why this project has a great future ahead.

    For future keyboard customization I would love to see the ability to create a custom keyboard with just the keys you need. For example if you are playing Ultima IV you need a lot of keys, but not all of them, and if they are all neatly lined up you can use them with the fingers instead of stylus.

    Other possible features exploiting the bottom touch screen advantage: A graphic menu (icons) allowing quick access to important functions, like:
    • Switching joystick ports
    • Launching virtual keyboard
    • Save / Load state
    • Quickloading and autorun disk image image
    • Reset
    The bottom screen just sets this project apart from all other VICE ports. It will make it shine!

    I was able to play many games that wouldn't run correctly on Frodo, for example Fort Apocalypse.

    I tried to load the fan made cartridge version of "Ultima IV Remastered", but it refused to load.

    I ran some top demos from CSDb, like Booze Design's "The Edge of Disgrace" which has a crazy soundtrack and effects manipulating the hell out of the graphics engine, and it seems to be flawless!

    Very happy to finally see VICE on the 3DS!
    Garcimak likes this.
  9. urherenow

    urherenow GBAtemp Psycho!

    Mar 8, 2009
    United States
    lol... I still got the 1337 80's haxing skills with a sector editor. Check out that spirit and stamina :). Getting used to the interface. OSK with touch screen support on the bottom (simultaneous keyboard and joystick use) is still on the top of my wish list.

    Last edited by urherenow, Apr 1, 2019
  10. Badda

    OP Badda Nu Member

    Feb 26, 2016
    @Elwyndas @urherenow
    Thanks for the feedback :D Soft keyboard on bottom screen is prio 1 - I'm on it right now. The customizeable buttons are a great idea but need to wait until the most important things are fixed and working.
    Elwyndas likes this.
  11. Elwyndas

    Elwyndas GBAtemp Regular

    Dec 19, 2018
    United States
    Thanks Badda! I'm getting all my old wishes about C64 on 3DS out now :)
    You got a great idea btw to have both joysticks active by utilizing the two "joysticks" on the left side. But we have a THIRD on the N3DS! That underused "C Stick" as Nintendo christened it on the top right. Show me any other VICE port that can work with 2-3 analog joysticks ready to go out of the box!
    It should be mapped by default to the directional keys IMO (cursor position.) The cursor keys are a huge nuisance if you don't have a real C64 keyboard because of that awkward requirement to press shift to use the opposite direction. Later down the road it can emulate the real mouse on GEOS while having two joystick ports live :) That will make every other port pale :)

    In terms of joystick emulation: All the advanced joysticks of the Atari/C64 glory times had an autofire, or rapid fire) functionality. IMO this is an important part of recreating the original feeling. Also a way to beat games without cheats. I would assign one of the two right shoulder keys with default autofire, one for each port. The left shoulder keys could be used for basic navigational stuff like opening images or save states.

    And so on.
  12. SLiV3R

    SLiV3R 3DS Friend Code: 0473-9069-2206

    Jan 9, 2006
    Amiga next?
    Alfonx likes this.
  13. urherenow

    urherenow GBAtemp Psycho!

    Mar 8, 2009
    United States
    baby steps. Next logical port would be c128. I wouldn't want to rush polishing up this one first, though. When this one is done right, I would assume c128 will be much faster to take care of.
    Alfonx likes this.
  14. maorninja

    maorninja GBAtemp Advanced Fan

    Feb 7, 2016
    United States
    I've never used a C64 so I guess this will be the first time I'll ever experience a "C64" by myself
  15. Badda

    OP Badda Nu Member

    Feb 26, 2016
    Just released v0.2 - with onscreen keyboard on bottom screen (thanks @spinal_cord for the images).
    Including the keyboard was a lot harder than I thought. I had to find out that SDL1 does not support multiple screens, so I had to use one big screen that stretches across both displays and "persuade" Vice to only show in the upper portion of the screen. For this, I really had to get into the guts of Vice. I really hope, that I did not break anything while doing so and that the rest of the ToDos will be easier to implement from now on.
    Mark McDonut, SLiV3R, Muxi and 2 others like this.
  16. TVL

    TVL #|

    Feb 17, 2004
    Awesome! Could you possibly add an option so the current keysets are saved with the snapshots?

    That way each game could have it's own keyset. In every game where you can jump, and do so with up, I have to change it so that in that keyset Joystick up is coupled with the B-button. Then in the sport games where you waggle the joystick left and right you have that linked to two buttons instead. Racing games with Accelerate, break and gear shift.

    Would be good to have keyboard keys as an option too. So you can have space or F1 etc. linked to the 3DS buttons. That way you could probably have a keyset set up to play The Sentinel using every button on the N3DS. :lol:
    MightyJAK likes this.
  17. ArugulaZ

    ArugulaZ GBAtemp Advanced Fan

    Sep 17, 2009
    United States
    Ho man, this sounds groovy. Is there a CIA version that I can install directly on my system's front page, letting me bypass the Homebrew Channel?
  18. urherenow

    urherenow GBAtemp Psycho!

    Mar 8, 2009
    United States
    @Badda the makefile is tailored to your personal setup. Following your directions to compile, it will do *almost everything except actually putting the .3dsx together. It will error out with “can’t open directory”.

    I say *almost, because most people should use dkp exclusively, so p7zip and pkg-config need to be installed separately using apt-get. They will get an error and nothing at all will install, unless they research how to add REPOs to pacman or dkp-pacman (depending on what setup they have).
    Last edited by urherenow, Apr 6, 2019
  19. Badda

    OP Badda Nu Member

    Feb 26, 2016
    It's on the todo list :-)
    Muxi and kenseiden like this.
  20. Jayro

    Jayro MediCat USB and Malwarebytes Bootable Developer

    Jul 23, 2012
    United States
    Holy shit...This was my first ever computer in the early 90's, and to see it running on such a gutless handheld impresses the hell outta me! GOOD JOB!

    (And the last version of MediCat I did in October was themed around the Commodore 64, as it turned 36.)

    Last edited by Jayro, Apr 6, 2019
Draft saved Draft deleted

Hide similar threads Similar threads with keywords - [Release], Emulator), Vice3DS