Homebrew [Release] Vice3DS (C64 Emulator)

Badda

me too
OP
Member
Joined
Feb 26, 2016
Messages
318
Trophies
0
Location
under the bridge
XP
2,398
Country
Tokelau
JiffyDOS: It's just a popular physical ROM replacement that greatly improved floppy speed back in the days (10x), with practically 100% compatibility (definitely better than true drive emulation off). In your software you can select it by going to Machine Settings, then ROM settings, and replace Drive ROM and Kernal with the JiffyDOS Roms (those images can be easily found on the internets). I know this works in WinVICE. IMO this is better than turning off true drive emulation. Good speed, still the original feeling :)

True Drive emulation on/off is a staple of VICE, to improve speed of loading from disk without ROM replacements like JiffyDOS, or warping all the time. I wouldn't want it to be removed :)
I had to remove a couple of things to get Vice to compile on devkitARM, e.g. anything related to RS232 emulation. Maybe that is the cause why turning off true drive emu is not working (maybe also JiffyDOS). Unfortunately, devkitARM does not feature a full fledged glibc linke Linux or Windows and some features are missing (e.g. https://devkitpro.org/viewtopic.php?f=15&t=8644 - this is the reason I had to remove RS232 support). I will check into this though ...
 

Vague Rant

Deceptively cute
Member
Joined
Aug 7, 2008
Messages
2,463
Trophies
2
Location
Melbourne
Website
vaguerant.tumblr.com
XP
3,302
Country
The emulator is set so that one C64 pixel is exactly one pixel on the 3DS screen (it clips some parts of the upper and lower border).
Set Video Settings -> Render Filter to "none", then it should be clearer. You can also try to set another palette with Video options -> VICII colors -> External Palette and then choose a good palette under "Available palette files". Maybe that helps with a better visibility as well ...
Thanks Badda. I do have Render Filter set to None but there's still some filtering going on with the image.

Here's a portion of a screenshot I took on my 3DS, blown up to 8x scale:

muRyBoJ.png


There's a bit of blurring going on between individual pixels here: those castle bricks are just supposed to be solid brown, but they're taking on darker edges from the color of the black space between them, the bricks around the edges are sort of "ghosting" onto the sky, the white flag is exhibiting a sort of "bloom", etc.

I know literally nothing about VICE, SDL or SDL-VICE, but Googling around a bit I see there's a config option to enable/disable OpenGL linear filtering in the "normal" (non-3DS-targeting!) builds--0 is for nearest-neighbor scaling, 1 is for linear scaling:

Code:
SDLGLFilter=0

However, since the 3DS port isn't employing OpenGL anyway, adding this setting to your port's config doesn't do anything.

Sorry I can't be more helpful; this is a fantastic project and I'm already having tons of fun with it!
 
Last edited by Vague Rant,

spinal_cord

Knows his stuff
Member
Joined
Jul 21, 2007
Messages
3,224
Trophies
1
Age
43
Location
somewhere
Website
spinalcode.co.uk
XP
3,366
Country
An earlier version was able to set the pixels to 1:1 ratio if you messed about with the display settings enough, can't remember what you needed to do exactly, but it didn't seem to save the settings, so you had to do it every time. Not sure about later versions.

how would you expect a mouse to work on a 3DS?
touch screen in the same way as a laptop...
 
  • Like
Reactions: kenseiden

Elwyndas

Well-Known Member
Member
Joined
Dec 19, 2018
Messages
197
Trophies
0
XP
680
Country
United States
Here's a portion of a screenshot I took on my 3DS, blown up to 8x scale:
I think what's going on here is that Vice3DS is set to "CRT Emulation" ON. This is also the default setting on WinVICE 3.3
It successfully emulates the appearance of the picture on a TV or Commodore monitor back in the day (cathode-ray tube). Even though the video chip produced exact pixels, the monitors would blur it, add scan lines. and create the effect you captured on your emulation screen shot. You will actually find that a totally perfect representation of the pixels does not look "authentic", simply because we are used to the way it was displayed on CRT screens. The CRT emulation came later because people were not happy with the perfect pixels of the first emulators. It's actually a great achievement.
I loaded Ultima IV with CRT emulation on and it just looks perfect to me. Perfectly blurry. I guess there is a reason why it's the default in WinVICE.
The video settings in Vice3DS don't seem to do anything. It always stays on the same CRT mode ON. IMO that's fine for now.
 
Last edited by Elwyndas,

Vague Rant

Deceptively cute
Member
Joined
Aug 7, 2008
Messages
2,463
Trophies
2
Location
Melbourne
Website
vaguerant.tumblr.com
XP
3,302
Country
The video settings in Vice3DS don't seem to do anything. It always stays on the same CRT mode ON. IMO that's fine for now.
I don't think that's the case. Here's a screenshot of the exact same scene with the CRT filter enabled:

lbddu0S.png


It's noticeably different from my previous screenshot with the CRT filter turned off. The colors are washed out, there are faint but also inaccurate scanlines (you can't really add scanlines to an image that's the same resolution as the original image, which is what we're looking at here), there's significantly more pixel blur on the X-axis than the Y-axis (multiple pixels in the same scanline blurring together on a "CRT"), etc. This is clearly a CRT filter.

When the CRT filter is turned off, all that's left is some kind of linear filter over the image which isn't doing anything "CRT-ish", it's just blurring equally in every direction with none of the other effects. If anything, I think I'd guess that the linear filter is being applied after the CRT filter, so with CRT mode enabled you're getting both.
 

Badda

me too
OP
Member
Joined
Feb 26, 2016
Messages
318
Trophies
0
Location
under the bridge
XP
2,398
Country
Tokelau
I don't think that's the case. Here's a screenshot of the exact same scene with the CRT filter enabled:

lbddu0S.png


It's noticeably different from my previous screenshot with the CRT filter turned off. The colors are washed out, there are faint but also inaccurate scanlines (you can't really add scanlines to an image that's the same resolution as the original image, which is what we're looking at here), there's significantly more pixel blur on the X-axis than the Y-axis (multiple pixels in the same scanline blurring together on a "CRT"), etc. This is clearly a CRT filter.

When the CRT filter is turned off, all that's left is some kind of linear filter over the image which isn't doing anything "CRT-ish", it's just blurring equally in every direction with none of the other effects. If anything, I think I'd guess that the linear filter is being applied after the CRT filter, so with CRT mode enabled you're getting both.

I'm able to reproduce the issue. It's there on the bottom screen as well - even the keyboard comes out blurry. That seems to be an SDL issue, I'm researching the topic.
 
  • Like
Reactions: Vague Rant

Elwyndas

Well-Known Member
Member
Joined
Dec 19, 2018
Messages
197
Trophies
0
XP
680
Country
United States
Are you taking these screenshots via Rosalina? I have done that too. It's not a perfect representation of what you see with your eyes on the real screen, not even close. Just open the 3DS and look closely. You can see that there are scan lines. I can only assume that Nintendo put them into the hardware on purpose. I attached an actual photo taken with my phone, of the default C64 screen on Vice3DS. As somebody who has stared at that screen for many years in real life on a real Commodore 64, I can attest that it looks perfect on the 3DS. The screenshots you took with the Rosalina hack are not what you actually see, they misrepresent reality.
 

Attachments

  • 20190425_211527.jpg
    20190425_211527.jpg
    365 KB · Views: 179
Last edited by Elwyndas,

Vague Rant

Deceptively cute
Member
Joined
Aug 7, 2008
Messages
2,463
Trophies
2
Location
Melbourne
Website
vaguerant.tumblr.com
XP
3,302
Country
Rosalina screenshots, yep.

Those "scanlines" on the 3DS screen are just a side effect of the way the 3D screen works; you don't get the same quasi-scanline look on a 2DS, for example. It is a bit of a happy accident, though. Still, drawing fake scanlines to the screen (as the CRT filter does if you let it) doesn't really make sense if you've already got the "actual" scanlines from the hardware.
 

Elwyndas

Well-Known Member
Member
Joined
Dec 19, 2018
Messages
197
Trophies
0
XP
680
Country
United States
Sorry, but I think the photo I took would look the same on the 2DS. I have one here, and if you challenge it I will install it. I think we should discount Rosalina screenshots as a measurement of how good the emulation is. I prefer my own eye. We know from system theory that observers manipulate the subject of their observation simply by observing. It's pretty obvious to me.
 
Last edited by Elwyndas,

Vague Rant

Deceptively cute
Member
Joined
Aug 7, 2008
Messages
2,463
Trophies
2
Location
Melbourne
Website
vaguerant.tumblr.com
XP
3,302
Country
These aren't my photos, credit to @captaineos, but here's what the 3DS and 2DS screens look like, side by side:

9YzOjaK.jpg


The 3DS screen is fairly unique in that it has double the DPI horizontally to what it has vertically (for a total resolution of 800*240), because when you're using 3D, it's sending half of those pixels to each eye (400*240 each). The 2DS screen by comparison is a standard 400*240 display. The "scanline" effect when you aren't using 3D is just what happens when you're looking at pixels that are packed twice as densely, horizontally: they tend to look like one long bar, while the vertical columns of pixels are spread further apart. On the 2DS, the pixels have equal spacing in any direction, so you could either view it as no scanlines or simultaneous vertical and horizontal scanlines (which broadly don't exist in "nature").

I've been testing out VICE on Windows to see what sort of things the CRT filter is doing, and I've realized I misunderstood part of what's going on. What I was calling "inaccurate scanlines" previously are actually the "Odd lines offset", a feature which tries to replicate the variance in color reproduction between individual lines in a PAL signal. i.e. Alternating lines are simply colored differently. Scanlines in the sense of gaps between lines are in fact are completely non-functioning in Vice3DS, because that feature requires "double size" toggle to be enabled: it doubles the image size then makes every second line a scanline. We can't double the image size on 3DS because we just don't have the resolution for it. No double size, no scanlines.

I want to be clear that I'm in no way questioning the accuracy of the emulation, just pointing out an actual flaw in the way the image is presented on-screen in this port, which is not intentional on the part of either the VICE authors or Badda. Badda has recognized this issue and brought it up in the SDL thread. This isn't a subjective issue like whether or not the CRT filter looks nice/accurate, it's some form of bug or oversight which is unintentionally adding filtering to the image on 3DS. I'm not using the screenshots to argue that things don't look the way I find appealing, I'm using them to demonstrate a reproducible issue with the display of this app. This isn't a matter of your eyes or mine or anybody's; you can have a subjective opinion that the filtering looks good, but it's objectively an error.

Lastly, I promise you that observing this bug definitely isn't the cause of this bug.
 

spinal_cord

Knows his stuff
Member
Joined
Jul 21, 2007
Messages
3,224
Trophies
1
Age
43
Location
somewhere
Website
spinalcode.co.uk
XP
3,366
Country
No matter how 'close' to a crt screen the effect give, a lot of people prefer images to be pixel perfect. On a screen that can easily create a 1:1 pixel image from the C64, that option should not be ignored. It's similar to saying new DVD players should blur the image on purpose just because old TV weren't as clear as new LCD ones.
Defending an unintended gfx issue should never be the way to deal with a simple request and lets remember, artificially blurring a screen will never look the same as viewing an image on an old computer monitor or TV.
 

Badda

me too
OP
Member
Joined
Feb 26, 2016
Messages
318
Trophies
0
Location
under the bridge
XP
2,398
Country
Tokelau
Badda has recognized this issue and brought it up in the SDL thread.

@nop90 is not replying but I guess I know the reason. There is no way to easily fix this with the SDL implementation approach he chose. The way he is bringing the pixels on the screen is by means of the GPU 3D texturing functions which always do some filtering. The only way to work around this is to rewrite the video-part of his SDL-port - which would be quite some effort. Maybe someone is up for the task? :D
 

Vague Rant

Deceptively cute
Member
Joined
Aug 7, 2008
Messages
2,463
Trophies
2
Location
Melbourne
Website
vaguerant.tumblr.com
XP
3,302
Country
The way he is bringing the pixels on the screen is by means of the GPU 3D texturing functions which always do some filtering.
You'd know much better than I would, so I apologize if this comes across badly, but I thought filtering on the GPU was optional. 3dbrew has this page about GPU registers which seems to describe a filter toggle for textures between nearest (unfiltered) and linear (filtered). Again, sorry if that's not relevant here.
 

Elwyndas

Well-Known Member
Member
Joined
Dec 19, 2018
Messages
197
Trophies
0
XP
680
Country
United States
What does everybody think about the following fundamental change:

Move the settings/loading screen to the bottom. The emulation continues to run, while you make your selection.
This means it would temporarily overwrite the soft keyboard, and any widgets that might be there. But it will create a much better experience overall. The touch screen will still be filled by default with the keyboard and essential widgets, but when more action is needed, the settings menu pops up down there.

Imagine, if you are in a demo or game, and need to change disks, or switch joysticks, or whatever, this can be done without interrupting the flow of the emulation.

I basically envision the 3DS hardware being a superior controller of the C64. The top screen always stays on as it is originally. All manipulation is done on the bottom screen or with hardware buttons/d-pads etc.

With the combination of the touch screen and the countless buttons and "joysticks", it will create the feeling of a monster controller plugged into the real C64, easily achieving the formerly tedious tasks of stuff like: Switching joystick ports, loading disks, pausing the game (!), saving states, loading them, reset, doing run/stop restore, injecting Load"*",8,1 and Run, increasing/decreasing emulation speed, adding/removing SID chips, messing around with other machine settings, all this while the emulation continues to run uninterrupted, just like it would be on the real deal.

The C64 didn't pop up a black screen when you changed the disk.

This to me is the ultimate usability goal, and all other Vice platforms will pale in comparison.

It will feel like a revolutionary hardware extension of the C64, without compromising the original.
 
  • Like
Reactions: kineticUk and Muxi

Elwyndas

Well-Known Member
Member
Joined
Dec 19, 2018
Messages
197
Trophies
0
XP
680
Country
United States
^ Sounds a bit like the way ZXDS works for the Spectrum.

Bingo! When you look through this 5 min review of ZXDS you see a lot of great ideas already implemented on that emulator.
For example a great looking mapping tool, where the DS buttons are represented on the touch screen and can easily be mapped to ZX keys or joystick functions. No more guessing or messing around.
upload_2019-4-28_10-12-9.png

 
  • Like
Reactions: kineticUk

snoofly

Well-Known Member
Member
Joined
Aug 18, 2015
Messages
1,012
Trophies
0
Age
54
XP
2,133
Country
United Kingdom
ZXDS is exactly how I’d like to see a C64 emu evolve.
The way the emulation runs in parallel to the actions on the bottom screen makes the whole experience seamless
and intuitive.

My only minor gripe with ZXDS is the border effects like loading lines are displayed on the bottom screen only and not on the main gameplay screen as expected.

EDIT2:
Came back just to say this is looking nice now Badda!
Had some issues a few weeks back with screen display but coming back to my N3DS just now, after removing all remnants of older builds and installing the latest 1.1 cia, all looks good. ;)
 
Last edited by snoofly,
  • Like
Reactions: Elwyndas

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Xdqwerty @ Xdqwerty: https://gbatemp.net/profile-posts/163064/