Git Product home page Git Product logo

red-viper's Introduction

Red Viper

A Virtual Boy emulator for the Nintendo 3DS continuing mrdanielps's work on r3Ddragon, which is itself based on Reality Boy / Red Dragon. It uses a dynamic recompiler with busywait detection and a hardware-accelerated renderer to achieve high performance on the 3DS's limited hardware.

Features

  • All officially licensed games are playable at full speed, even on the original 3DS
  • 3D support
  • Game saves and savestates are supported
  • 3DS display runs at 50Hz, like the Virtual Boy
  • Map either the A/B buttons or the right D-Pad to the face buttons, with the other being on the touch screen
  • New 3DS C-Stick is also supported
  • Configurable face button mapping
  • Configurable color filter

Future additions:

  • Circle Pad Pro support
  • More versatile color filter
  • A forwarder to allow loading a specific game from the home menu

Usage

A modded 3DS is needed. Once that's sorted, you can install it using Universal Updater.

You can also scan this QR code with FBI.

image

Alternatively, the latest release can be manually downloaded here, provided as a 3DSX (can be loaded with Homebrew Launcher) and as a CIA (can be installed to the home menu with FBI). ROMs can be placed in any desired location on your SD card. The emulator will remember the location of the last ROM you loaded.

FAQ

It doesn't work! / What's this DSP firmware error?

Try updating your Luma3DS installation (I tested with v13.0.2). Once it's updated, you may need to dump your DSP firmware.

The depth slider is weird.

The Virtual Boy wasn't designed with a depth slider, so games can't have their depth scaled in the way 3DS games can. The alternative is to shift the entire image backwards or forwards, similar to how the Virtual Boy's IPD slider works. The default setting (3DS mode) starts at a "neutral" level and pushes the image further back as you move the slider up, keeping the metaphor fairly similar to how most 3DS games work. Alternatively, "Virtual Boy IPD" mode can be enabled, which unlocks the full range, from closest to furthest.

To use the "default" level, use 3DS mode and keep the depth slider on, but near the bottom.

What do the numbers in the performance info mean?

This displays the time taken for All processing in one frame, DRC processing (CPU emulation), Citro3D processing (CPU graphics), and PICA200 processing (GPU graphics). It also displays the Memory usage of the DRC cache (increases over time then resets).

As this is a developer option at heart, frametimes are displayed in milliseconds rather than FPS, as the former is much easier to reason about in this context. The target is usually 20ms, though some games only draw every other frame, so rendering has more leeway there.

Building

After setting up devkitPro, install the additional dependencies:

> pacman -S 3ds-zlib

After cloning the repository, fetch the last dependencies:

> git submodule update

Once that's all sorted, you can choose between four different make targets:

  • make release is the default, and adds -O3 to CFLAGS.
  • make testing adds -O3 to CFLAGS. It will output basic debug info to a connected debugger.
  • make debug adds -g -O0 to CFLAGS. It builds without optimizations so it can be debugged more easily.
  • make slowdebug adds -g -O0 to CFLAGS. It will output a lot of debug information, which will slow emulation down but might be helpful to debug game-specific issues.

License

Some of the code is distributed under the MIT License (check source files for that) but, since this is a port of Reality Boy, here is (part of) the original readme:

This Reality Boy emulator is copyright (C) David Tucker 1997-2008, all rights
reserved.   You may use this code as long as you make no money from the use of
this code and you acknowledge the original author (Me).  I reserve the right to
dictate who can use this code and how (Just so you don't do something stupid
with it).
Most Importantly, this code is swap ware.  If you use It send along your new
program (with code) or some other interesting tidbits you wrote, that I might be
interested in.
This code is in beta, there are bugs!  I am not responsible for any damage
done to your computer, reputation, ego, dog, or family life due to the use of
this code.  All source is provided as is, I make no guaranties, and am not
responsible for anything you do with the code (legal or otherwise).
Virtual Boy is a trademark of Nintendo, and V810 is a trademark of NEC.  I am
in no way affiliated with either party and all information contained hear was
found freely through public domain sources.

Acknowledgments:
----------------

Frostgiant, Parasyte, and DogP (and the rest of people that have contributed
to the VB sceen in the last five years) - Their work on Red_Dragon has been a
real inspiration. Its amazing how far they have gone with so little to start
with.

Bob VanderClay - most of the original code is based off
of his VB disassembler.

Ben Haynor - Provided me with a much better understanding of
the VB internals.

Joseph LoCicero, Dave Shadoff - I stole the jump table ideas from their tg16
disassembler, thanks guys.

Neill Corlett - took many ideas (and some code)
from his Starscream CPU core

Kevin Banks - for donating a very nice pair of Frenzle 3D
viewers, and being an all around great guy.

Megan Tucker - For putting up with my tinkering all night, and resisting the
urge to toss all my video games out the window.

v810 is a trademark of NEC co.
Virtual Boy is a trade mark of Nintendo
Reality Boy is in no way affiliated with either of these parties

Credits

  • Everyone mentioned in the license. Without Reality Boy and Red Dragon it wouldn't have been possible.
  • smealum and contributors - ctrulib.
  • Vappy, Team Fail, HtheB, hippy dave and kane159 on GBAtemp - early testing.
  • benhoyt - inih.
  • Myria - libkhax
  • thunderstruck - CIA banner sound (taken from Fishbone).
  • nop90 - Reality Boy backports and fixes.
  • danielps - Initial 3DS port and V810 dynarec.
  • Floogle - 3DS hardware renderer; many optimizations, bugfixes, and other improvements.
  • djedditt - Enhanced 3D depth slider support.
  • Morintari - splash screen artwork
  • All GitHub contributors

red-viper's People

Contributors

skyfloogle avatar mrdanielps avatar nop90 avatar piiman avatar aconbere avatar jeffrulz avatar vaguerant avatar pizzarollsroyce avatar djedditt avatar ioistired avatar nevumx avatar

Stargazers

 avatar  avatar gregandcin avatar Stefaney Roberts avatar  avatar  avatar  avatar  avatar  avatar CarltonCrazeIsBackIGuess avatar Benjamin Funke avatar Akiko avatar lewis avatar Steve Cochrane avatar Ryan Crosby avatar José Emmanuel Sandoval Sánchez avatar Juan Alvarez Arquillos avatar  avatar C4ndyF1sh avatar JB avatar Loyla avatar Hudson Brendon avatar  avatar Emanuel Tavares avatar  avatar  avatar cybergen avatar  avatar  avatar  avatar  avatar ✔ hoaxlayer avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar Nicholas Willoughby avatar  avatar  avatar  avatar  avatar son avatar  avatar  avatar  avatar  avatar  avatar  avatar Joshua Grady avatar Moralek avatar  avatar bilibilixkz avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar Fra avatar Dawson avatar R B avatar Suna Asami avatar  avatar  avatar Matt Hackett avatar Samantha avatar  avatar  avatar Jared Cherup avatar City_Hunter avatar  avatar Pan Ip avatar Matt avatar  avatar  avatar Lord Friky avatar  avatar Pablo Sande avatar  avatar Jim Hendricks avatar Ongo Gablogian avatar  avatar Wwk-Kevin avatar Hans Koch avatar Penny Simitsi avatar Din avatar Samuel Gavassi Pismel avatar Alexis0377 avatar  avatar Artea avatar  avatar hwixlab avatar  avatar Hunter Irving avatar David Eiwen avatar

Watchers

Erik Kunze avatar Ryan Fantus avatar  avatar Pentarou avatar  avatar Alex Craik avatar  avatar  avatar Rin avatar  avatar  avatar  avatar LHBlitz avatar  avatar Nin10doGMod avatar  avatar  avatar Landon & Emma avatar  avatar  avatar  avatar Matthew Steiner avatar  avatar  avatar  avatar

red-viper's Issues

Support executing code from RAM

The emulator currently crashes when code is executed from any location other than ROM. In the past doing so has indicated an emulator bug, but Formula V does this occasionally and intentionally, and I understand other currently unreleased homebrew does as well.
The current dynarec basically assumes all code is in ROM. I'm not sure how easy it would be to support volatile code in it.
An interpreter would solve this issue, especially given these bits of code are generally not very large. It might be a large effort, but it would avoid increasing the dynarec's complexity, and interpreting the code every time is probably faster than recompiling it every time.

Zip file support?

Would be nice to be able to store zip file of a rom and it decompresses at load time, The roms arent that big so should be fine right?

[Suggestion] Support to color

Hello, first I want to give thanks for your awesome work : it is a awesome way to could enjoy this underrated machine.

I want to suggest the option of making it could use different colors as it does some gb emulators.

colorize your games

It would awesome user could do "patches" and maybe add this feature.
Maybe it could be implemented on a way than homebrew developers could use it when compilate their stuff allowing keep the colors on a external patch and their binary go on full 100% virtual boy compatibility. (I suppose it would be the part where the sprites are converted to vb format when the extra data would keep on the ips file).
Thanks

Virtual Lab won’t advance.

Virtual Lab exhibits a bug where the gameplay locks up but the music and background continue. It’s a falling-block puzzle game, so imagine you’re playing Tetris and the next piece appears at the top of the screen but never starts falling. You can’t control the game at this point including pressing start to pause.

Loving the app so far; I’m having a great time playing Mario Clash and Wario Land.

Suggestion: Alternative input on ROM picker

First off - awesome job! I know what's involved with these as I've been involved with Stella (Atari 2600 emulator) since the 90s when I ported it to OS/2.

I find the ROM picker to be very touchy - inevitably I'll accidentally launch a ROM while swiping up/down to scroll to a specific game.

I suspect part of the issue is I'm using my finger, instead of a stylus, to scroll the list. I use an after market grip/handle on my 3DS else my hands cramp, and the grip blocks access to the stylus slot.

If possible could the ROM picker be updated to also support the D pad and A/B buttons to maneuver thru the directory structure, select a game, and launch it?

Thanks!

unable to launch roms

I get into the redviper and load rom, select oneand it just sits there and freezes the whole 3ds. I have the cia and the 3dsx inside the 3ds folder i made.

True 50 Hz support

Consider this a "nice to have" backburner issue.

Apparently it is technically possible to fudge the refresh rate of the 3DS screen. This is done in the (closed-source) emulator ZXDS, which emulates the ZX Spectrum--a computer that was really only successful in PAL50 territories, where most of the software is designed around 50 Hz. As far as I know, there are no open-source implementations of the refresh delay implementation used by ZXDS, so unfortunately there's not much I can point to as far as how this can be achieved.

The ZXDS author did write down a lot of their process when developing the original DS version of their emulator which you can read here, but that page has not been updated since the emulator was ported to run on the 3DS. Forcing the original DS screen into refreshing at 50 Hz involved (ab)using the VCOUNT register, which is able to delay refreshes for the purpose of synchronizing wireless multiplayer games. I don't know whether the 3DS has something equivalent.

The ZXDS changelog is behind a Patreon subscription, but the version 2.0.1 changelog can be found online and implies there are at least two possible methods of delaying refreshes, one of which was problematic on certain 3DS models:

Changelog:

  • Fix top screen issues of 2DS and 3DS XL models by slowing the LCD display differently. Thanks Nige.
  • Disabled turning off of bottom screen backlight on 2DS as for some reason it affects both screens.
  • The optional ZL and ZR buttons are now bound to quick load and quick save actions, respectively.
  • Considerably increased speed of scanning directories.
  • Few more subtle changes (async file flush, display speed adjustment only at normal speed).

Speaking for myself, I really can't tell the difference while playing games, 50 FPS displaying with duped frames at 60 Hz is fine, especially considering the more advanced games like Red Alarm don't run at a full 50 anyway. Still, it would probably be even better to match the refresh rate to the original console for greater accuracy.

EDIT: Talking to asiekierka, I see that this has already been shared with you in much greater detail and that there is an open-source implementation in atari800-3ds. For the benefit of anybody else who happens to find this, I think asiekierka/atari800-3ds@133bb73 is the commit where the magic happened.

QR code for easy installation

Please add a qr code for the .cia download link so people can easily install it via FBI's remote install function.

3D depth slider not implemented?

It seems if the 3D is turned on, it only seems to simulate one "depth" instead of adjustable "depth" (image separation?) via the slider. I tend to prefer a pretty shallow 3D compared to the setting this emulator uses. Will the adjustment become available in a later revision?

Sample playback

Will mean doing the mixing ourselves rather than relying on the DSP to do it.

Locomotive games (SD Gundam, V-Tetris, Virtual Fishing) have incorrect colors

Issue

It looks like the shades of red are not displaying correctly in Virtual Fishing (EDIT: and other Locomotive games). Everything with the "one above black" shade, used in Virtual Fishing for highlights and backgrounds is an extremely dim shade of red somewhere in the decimal 16-17/255 range, making it difficult to tell which menu item is selected, etc.

image image

In these screenshots, FEMALE and START are (barely) highlighted on the respective images. These screenshots come from the English translation patch available on virtual-boy.com for ease of navigation, but the same issue occurs in a clean Japanese ROM.

Expected behavior

Here's some Mednafen shots:

Virtual Fishing (Japan)  English Translation -240327-221925 Virtual Fishing (Japan)  English Translation -240327-221936

You can see here that I have MALE and START highlighted on the respective screens, the name plate and RECORDS section have a visible background color, etc.

Versions tested

  • Red Viper 407550d (current HEAD)
  • Red Viper ffacc69 (v0.9.1)
  • Red Viper 81ee977 (v0.9.0)
  • Virtual Fishing (Japan).vb (matches No-Intro CRC32: 526CC969)
  • Virtual Fishing (Japan) [English Translation].vb (above ROM with English patch applied)

Same behavior on all versions of Red Viper I've tested; this does not appear to be a regression.

Edit

I just noticed that V-Tetris also displays dimly and has barely-visible "one-shade-above-black" display. The Mode Select menu in V-Tetris has a BPS (Bullet Proof Software) logo scrolling across the background which is mostly obscured in Red Viper. Comparison shot from Mednafen.

image V-Tetris (Japan)-240327-233349

Locomotive was also responsible for SD Gundam: Dimension War, so that's another case that may be (EDIT: definitely is) impacted by the same issue.

Software won't close

On my new 3ds, the software takes so long to close, im convinced the system froze and I it power off. Not sure if this is normal for now or not.

Language Support

There could be a setting to select the language or read it from the console settings.

Got a crash in VB Wario Land, debug text file included

Running on 9f7fc6a [3dsx build]

I got a DRC crash after playing 3-ish levels in a row at a screen transition in Level 3 in Virtual Boy Wario Land.
It threw this debug txt file at me, so here that is. This happened to me on the current release build once too but I don't think it saved the debug text file that time for whatever reason.

debug_info.txt

It's fairly easy to reproduce, just sit down and play VB Wario Land a while and usually you get a crash at a screen transition in Level 3 or Level 5.

3D Tetris is extremely unstable, crashes on intro

Loading 3D Tetris as your first ROM leads it to an arm11 crash during the intro, before the title screen (dump). Loading it after some other game is loaded gives it varying degrees of stability, from working seemingly just fine to crashing after a couple minutes of gameplay seemingly at random, with an error popup (changing ROMs to 3D Tetris while in Virtual Boy Wario Land’s post stage completion treasure screen seems to make for a decently stable run, fwiw).

Please support more buttons

The control in game Red Alarm is quite difficult. please add personalized button palette and allow use ZL ZR button🙏

Golf color issues

On some occasion when pressing the "shot" button while playing golf, the entire field turns black, goes back to color when I exit out the option. Not sure if this is part of the game or from the emulator. Using Old 2DS

DSP1 audio help

Red Viper is complaining that it doesn't have audio, and if I try to load any game without sound it will freeze when you load a rom.

I dumped my audio with DSP1 3DS and it still doesn't detect the audio.

What do I need to do?

Suggestion: Option to choose which eye view is default

Virtual Boy always outputted two images: one for the left eye and one for the right eye. Red Viper, when the depth is turned off, currently shows just the right eye information. It would be nice if the user could choose which one is the one used when the 3D is turned off (or unavailable, for our 2DS users).

Red Alarm - samples missing

Hi - awesome emulator. Thank you so much. Have some problems playing red alarm:

  • the voice samples are missing

  • not possible to finish first stage, freeze, but not reproducible as always on different parts

Using New 3DS XL

Crash when launching VB Wario Land

When booting Wario Land, the application crashes everytime. I have not tested with other games yet. I'm on an O3DS, with the latest stable version (2024-03-24).
Here's the dump file:
crash_dump_00000000.dmp

EDIT: this only happens on the .cia version of the emulator, the .3dsx boots the game just fine

Sudden Freeze/Hard crash on Tetris 3D

Have been using this emulator for a while. Every once in a while, I‘m playing 3D Tetris, and a/v crashes, and the entire system stops responding. New3DSXL if you need the model.

Suggestion: Fully customizable controls

I think it would be an improvement to be able to completely remap the controls including the controls on the touch screen, preferably on a game by game basis. My ideal would be the Right D Pad mapped to the face buttons, A & B are mapped to ZL and ZR, and the touch screen simply pauses the emulator. But then for games that don't use the Right D Pad, A & B would just be mapped to A & B, hence the option for game-specific remaps.

Ghosting effect with black background

I've been noticing some ghost effect on the upper screen when using Red Viper. At first I thought my 3DS was broken or something. Then I learned that this is normal when the image has contrast, like in this case, a 100% black background. The image of one eye slightly bleeds into the other eye.

Maybe the background color could be changed to something less dark?

Again, this is not a Red Viper issue at all, just asking if this is possible or makes sense.

Thanks.

[Suggestion] Port for PSVITA

Hi, since there is no way to psvita for virtual boy it would be interesting to see a porting of this homebrew, possibly with state saves

[Suggestion] RGB wave mode

While changing the color during is neat, I'd love to see a mode that has a gradual color shift during gameplay, like on those gaming laptops if it's possible that is.

Anaglyph mode

Could be useful for 2DS owners and potential ports to other hardware.
Some code for anaglyph drawing was added in 754362d, but it's missing a UI frontend.
Anaglyph mode inherently conflicts with all current video settings (colour filter, default eye, and depth slider mode since the 2DS doesn't have one). It would probably make sense to reflect this in the UI design somehow.

unable to build from source due to ini.h dependency

Sorry if this is a stupid question since im not very experienced with dealing with source code, but when building from source I get this error:

red-viper/source/common/vb_set.c:8:10: fatal error: inih/ini.h: No such file or directory

In an attempt to fix this, i installed the inih packages from my package manager, but the error persists. I went to see where the makefile sources the include directories, and I put the ini.h headers in /opt/devkitpro/ibctru/inih and it gives me a different, still inih related error while building. Am i missing a package or something? I can't seem to find any devkitpro package with inih and running "git submodule update" does not appear to do anything.

I feel like I'm missing something obvious but i didn't know how else to figure it out than open an issue. Tried building on both msys2 ucrt64 and arch linux.

Crashed when entering home screen

I went to close the emulator by pressing the home button. Just about a second later, the system crashed. It doesn't seem to have done any damage, but it was certainly a scare.

Sound issue, what to do?

PXL_20240225_233853958

Happened on a new 2DS XL and new 3DS running under different CFW updates, one with arm9loaderx and the other one on luma (but not up to date).

This is not a crash, but I'd like to play with the sound on 😄
Is there a documentation to fix this ? :)

Bug: Red Alarm Crashes on New 3DS XL

As the title says, Red Alarm has a tendency to crash when playing. Usually I've had it crash during the face miniboss in Stage 1, but I did manage to make it to Stage 2 once before it crashed.

I'm unsure of the cause of this crash, but I will state that I am playing on a New 3DS XL running Luma3DS v13.0.2 with the 3D on.

I also have "Redirect app. syscore threads to core2" turned on, will test with that off just to see if that affects anything. EDIT: Red Alarm still crashed with this turned off in the Luma settings.

ips support

i cannot load a ips rom hack please add support for it

Suggestion: Have a volume slider

I can usually just leave the volume slider at the same level for everything on the 3DS. But for some reason Red Viper is louder than other things I use on the 3DS. I have to move the 3DS's volume slider down every time I use Red Viper, and move it back up when using anything else.

It might be a minor inconvenience overall, but it would be appreciated if there was a way to change volume level in Red Viper itself. I have had sliders stop working correctly on other devices from frequent adjustment so I would prefer not to be having to adjust the physical slider on the 3DS especially for that reason.

3-D Tetris Freeze

3-D Tetris froze not very far into 3-D Tetris Type A mode. Playing on an original 3DS XL.

Suggestion: Add this emulator to Universal-DB

I know this isn't exactly a big issue given that this emulator is easily installable via the .CIA and .3DSX files, but I think having the option to install it via Universal Updater would be ideal. Not only would it allow for more users to discover it, but it would also ensure that more people download future updates of the app.

LED

Is it possible to create a vector matrix on 3DS, as it was in those distant days, from 1982 to 1985? The image will be more realistic than on a regular 3DS matrix. Am I wrong?

=====================================================================================

Since 1985, a red LED eyepiece display technology called Scanned Linear Array was developed by Massachusetts-based Reflection Technology, Inc. (RTI). The company produced a stereoscopic head-tracking prototype called the Private Eye, featuring a tank game. Seeking funding and partnerships by which to develop it into a commercial technology, RTI demonstrated Private Eye to the consumer electronics market, including Mattel and Hasbro. Sega declined the technology, due to its single-color display and concerns about motion sickness.

bandicam.2024-04-01.23-52-16-388.mp4

Feature Request: Fast forward hotkey (but mostly just thanks)

I want to thank you a million times over for making my dream come true. You're a hero, man.

I only have one small request. Can you make one of the triggers act as a fast forward button, preferably with the choice of hold or toggle in the settings? Thank you if you implement this, and thank you again for everything else!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.