RELEASE [RELEASE] Amiga Emulator UAE4All2 for Switch

Discussion in 'Switch - Emulation, Homebrew & Software Projects' started by rsn8887, Nov 5, 2018.

  1. rsn8887
    OP

    rsn8887 GBAtemp Fan

    Member
    6
    Oct 8, 2015
    United States
    This is the Amiga emulator UAE4All2 v1.77. I ported this emulator to the Switch, based on my latest Vita version. I had to adjust the code from 32bit to 64bit. The Switch is faster than the Vita, for example Jim Power plays without slow-down.

    Download Link:
    https://github.com/rsn8887/uae4all2/releases/latest

    Changes in this Version
    ======
    1.77

    - increase max files per dir from 3072 to 10240
    - on Switch, in split JoyCon mode, make SL/SR act as L/R also in menu
    - on Switch, in split JoyCon mode, disable L/R/ZL/ZR in menu

    [​IMG]

    [​IMG]

    [​IMG]


    Description
    =====
    Use4All2 Mod is an Amiga emulator for Vita and Switch. This is my mod of this great Amiga emulator that was originally ported to the Vita by Cpasjuste. Depending on when you read this, this mod might be ahead or behind his version.

    ![Screenshot of UAE4All2 running on Vita](https://s14.postimg.cc/lzgf1988h/uae4all_b.jpg)

    ![Photo of UAE4All2 running on Switch in tabletop mode](https://i.postimg.cc/3RD6Lr7j/Split-Joycon-b.jpg)

    Thanks to Cpasjuste for the original port and for jumping in and adding shader support and making the assembler optimizations work.

    Thanks to ScHlAuChi for extensive testing, ideas, and for contributing the new larger virtual keyboard images.

    Thanks to the original authors Chui, john4p, TomB, notaz, Bernd Schneider, Toni Wilen, Pickle, smoku, AnotherGuest, Anonymous engineer, finkel, Lubomyr, pelya and many more.

    Thanks to my supporters on Patreon: Andyways, CountDuckula, Matthew Machnee, and RadicalR.

    Installation
    ======
    * Vita:
    * Install .vpk
    * Obtain and copy BIOS files "kick13.rom", "kick20.rom" and "kick31.rom" to "ux0:/data/uae4all/kickstarts"

    * Switch:
    * Download and unzip `uae4all2_switch.zip`
    * Copy the resulting folder `uae4all2` to `/switch/` onto your SDCard, ensure none of the "archive" flags is set.
    * You should now have the executable `/switch/uae4all2/uae4all2.nro` and a folder `/switch/uae4all2/data/` with the keyboard icons and other data files on your SDCard.
    * Obtain and copy BIOS files `kick13.rom` (size: 262,144 bytes), `kick20.rom` (size: 524,288 bytes) and `kick31.rom` (size: 524,288 bytes) to your SDCard into `/switch/uae4all2/kickstarts/`
    * Use your favorite Homebrew Launcher or Homebrew Loader to start Uaeall2

    Vita/Switch-exclusive Features
    ======
    - Full speed emulation of most Amiga games with zero frameskip
    - Large, complete virtual keyboard with adjustable position and adjustable transparency
    - Three fully mappable custom control sets: map Vita buttons to any Amiga joystick or key input, three custom control sets supported
    - Multiple hard-file support: up to 4 hdf files (size <2GB each) can be mounted simultaneously
    - Multiple controller support on Vita TV: up to four paired controllers can be fully mapped
    - Analog mouse control: control the mouse using the analog stick with adjustable sensitivity
    - Shader support: default "sharp_bilinear_simple" uses integer pre-scale for sharp, undistorted pixels with minimum blur, even if game is zoomed to fill the full screen
    - Custom autofire: any mapped Vita button can have autofire with adjustable rate
    - Savestate with hard-file support: state can be saved even when hard-files are used
    - Additional emulator settings: sprite-sprite collisions can be enabled, blitter settings can be changed
    - Adjustable stereo separation
    - A button can be mapped to "slow mouse" in custom controls. When custom controls are on and that button is held down, the mouse pointer speed is greatly reduced. This is useful for precisely positioning the cursor.
    - Sticky virtual keyboard modifiers: allows keyboard combos like CTRL-C to be entered easily
    - Touchpad style pointer controls using the touchscreen
    - Parallel port joystick adapter support for multiplayer games with up to 4 joysticks.
    - Additional savestate slot called auto, for automatic savestate loading

    Vita-exclusive Features
    ======
    - Bluetooth keyboard and mouse support
    - Supports loading files from ux0: or uma0: partition
    - Rear touch panel can be enabled for mouse pointer control

    Switch-exclusive Features
    ======
    - Split Joycon support

    Notes
    ======
    - *Bios:* Please put kickstart files in `ux0:/data/uae4all/kickstarts` on Vita and in `/switch/uae4all2/kickstarts` directory on Switch. Files must be named as kick13.rom, kick20.rom, kick31.rom
    - *Speed:* Most games run full speed. Some slow Amiga 1200 and WHDLoad games actually run faster if the CPU speed is reduced from 14 MHz to 7 MHz, because they rely more on custom chips than CPU. Some graphics glitches in Lionheart WHDLoad inside the caves are fixed by this.
    - *Config File:* If you have problems with settings not saving etc, please delete or rename your config file in the folder `ux0:/data/uae4all` (Vita) or `/switch/uae4all2/conf/` and restart the emu. I heard this can fix many problems when you are replacing an older version of this emulator with a newer version. Lots of things are changing in the config file between releases.
    - *Display:* The sharp_bilinear_simple shader, on by default, creates a sharp pixel image with minimal blurring. It applies a maximum integer pre-scale first. Then it scales only the small remainder using the builtin bilinear filter, keeping the aspect ratio intact.
    Many Amiga games fit the Vita and Switch screens very nicely. For example, take Chaos Engine with a screen setting of 320*200 and sharp_bilinear_simple shader enabled. The picture can be zoomed using R+Start+Dpad left/right (R+Plus+Dpad left/right on Switch), and moved vertically using R+Start+Dpad up/down (R+Plus+Dpad up/down on Switch) to center it on the screen. Once this is done, the picture fills almost the whole screen and looks amazing with no artifacts or blurriness. The game runs smooth with zero frameskip.
    Selecting a 'Preset Width' of 320, 352 or 384 (max overscan) results in lo-res screen emulation, good for most games, while 640, 704, or 768 results in hi-res screen emulation, good for use with Workbench or some text-based games.
    - *Blitter:* The blitter settings can help with graphics glitches in some games. Since it seems to work best, "immediate" is the default. But some games require setting blitter to "normal" and re-booting to remove graphics glitches, for example PP Hammer, Spindizzy Worlds, and Shufflepuck Cafe.
    - *WHDLoad:* If you have problems with a WHDLoad .hdf game, maybe try an .adf version of the same game. Rock'n Roll is one of a few games that work on UAE4All2 only using .adf files. It has graphics glitches and runs too fast in WHDLoad with .hdf. To make it work correctly, I loaded the "Rock'n Roll.adf" from Gamebase Amiga, chose the preset A500 config, and changed the Blitter setting to Normal.
    - *Sprite Collisions:* Some games require sprite-to-sprite collisions. Sprite collisions can be turned on in the "more options" menu. The only game I know of that requires this is SpaceTaxi 3.
    - *Savestates:* Four regular savestates can be saved per game. There's also a slot for an automatic savestate, labeled "auto". If it exists, this will be loaded immediately when the .adf is inserted. To prevent this, delete the auto savestate by selecting it and choosing "delete savestate".
    - *Multiplayer:* Up to four controllers on Vita TV and Switch are supported and can be fully mapped. The mouse can be switched off because it interferes with the other joystick that controls player 2 in most games. If you pair new controllers on Vita TV and they do not seem to work, scan for them in the "custom controls" menu by pressing L. At the bottom it will say how many controllers have been found. This scanning is not neccessary on Switch. By default, parallel port Amiga joysticks 3 and 4 are controlled by VitaTV/Switch gamepads 3 and 4. They can also be mapped to other inputs using the custom controls screen.
    - *Sound:* For use with headphones, a stereo separation setting of 50 sounds better than the default setting of 100. The original Amiga had completely disjoint left/right channels. This can sound quite jarring on headphones. Concerning sound frequency, on the Vita, the default of 44.1 kHz gives by far the best results. On the Switch, the best sound is obtained with 48 kHz, which is the only frequency supported on Switch.

    Compiling
    ======
    * Dependencies: SDL2, SDL2_image, libpng, libjpeg, zlib
    * Clone repo into a folder somewhere
    * Vita:
    * Install VitaSDK toolchain and all vdpm packages: http://vitasdk.org
    * Compile and package:
    ```
    mkdir build
    cd build
    ccmake "your uae4all2 repo folder" -DBUILD_PSP2=ON -DCMAKE_BUILD_TYPE=Release
    make uae4all2.vpk
    ```
    * Note: The Vita source depends on FrangarCJ's Vita2d fbo branch with shader support here: https://github.com/Cpasjuste/vita2dlib/tree/fbo
    and FrangarCJ's vita-shader-collection gtu branch: https://github.com/frangarcj/vita-shader-collection/tree/gtu
    Those are both included as binaries and linked automatically.

    * Switch:
    * Install DevkitPro: https://devkitpro.org/wiki/devkitPro_pacman#Using_Pacman
    * Install required libs:
    ```
    sudo (dkp-)pacman -S switch-dev
    sudo -E dkp-pacman -S switch-sdl2
    sudo -E dkp-pacman -S switch-sdl2_image
    sudo -E dkp-pacman -S switch-glm
    sudo -E dkp-pacman -S switch-glad
    sudo -E dkp-pacman -S switch-mesa
    sudo -E dkp-pacman -S switch-libpng
    sudo -E dkp-pacman -S switch-zlib
    sudo -E dkp-pacman -S switch-libjpeg-turbo
    sudo -E dkp-pacman -S switch-libdrm-nouveau
    ```
    * Patch SDL2 library to include SL/SR button support, otherwise SL/SR will not function in UAE4All2
    ```
    git clone https://github.com/rsn8887/pacman-packages/tree/SwitchSDL2ButtonFix
    cd pacman-packages/pacman-packages/switch/SDL2
    dkp-makepkg
    cd pkg/switch-sdl2/opt/devkitpro/portlibs/switch/lib
    cp *.a $DEVKITPRO/portlibs/switch/lib/
    cp *.la $DEVKITPRO/portlibs/switch/lib/
    ```
    * Compile and package:
    ```
    mkdir build
    cd build
    ccmake "your uae4all2 repo folder" -DBUILD_NX=ON -DCMAKE_BUILD_TYPE=Release
    make uae4all2_switch.zip
    ```
    * Unzip and copy all all files to Switch so you have `/switch/uae4all2/uae4all2.nro` and `/switch/uae4all2/data/` etc. on your SD card
    * Launch using your favorite homebrew launcher

    FAQ
    =====
    * Kickstart rom files not found on startup?

    First, please ensure you are using the correct files. They should be "kick13.rom" (size: 262,144 bytes), "kick20.rom" (size: 524,288) and "kick31.rom" (size: 524,288). They should be placed in "ux0:/data/uae4all/kickstarts" on Vita and "/switch/uae4all2/kickstarts" on Switch. Second, on Vita, please make sure your ux0:/data folder does NOT have the FAT attributes "hidden" or "system" set.

    * Black screen on Switch, or crash on startup?

    In my testing (only with exFAT), I found that exFAT corruption can cause all files in the uae4all2 folder to become corrupted (among others). This includes kick13.rom and other kickstart files, which causes a black screen when leaving the menu. Game .adf files can become corrupted, causing the game to stop booting. Even the executable uae4all2.nro and/or config files in the conf folder can become corrupted quite easily, causing black screen crash on startup. Either don't use exFAT, or make a good backup of the folder and restore it via FTP if there are problems. Once I switched to FAT32, all these problems with file corruption went away.

    Controls
    =====

    Switch:
    -----
    The default OK button in menu and on-screen keyboard is B. This can be changed to A in "more options."

    ZR button = slow-mouse (if custom controls are off)
    ZL button = slow-mouse (if custom controls are off)

    Otherwise Switch uses exactly the same controls as the Vita (see below), with the following meaning:
    Square = Y
    Triangle = X
    Cross = B
    Circle = A
    Start = Plus
    Select = Minus
    L = L/SL
    R = R/SR

    - *Split Joycon Mode:* Split Joycon mode can be enabled/disabled in "more options." Upto four single Joycons are supported. Buttons can still be remapped. SL for player 1 is hardcoded to bring up the keyboard.
    - *Split Joycon Controls:*
    Minus/Plus = Menu (player 1 only)
    SL = on-screen keyboard (player 1 only)
    Pressing stick while moving it = change keyboard transparency/position, control mouse pointer (player 1 only)
    SR + SL + Stick directions = hotkey to quick-zoom image and center image vertically (player 1 only)

    General
    -----
    Select = Toggle menu
    Start = Toggle virtual keyboard
    R+Start+Dpad up/down = Move screen up/down
    R+Start+Dpad left/right = Change screenmode (to zoom in on games with borders)
    Right analog stick = Analog mouse (can switch this to left stick in menu)
    Left analog stick = Amiga joystick directions
    Dpad = Amiga joystick directions

    When custom controls are off
    -----
    L shoulder button = right mouse click
    R shoulder button = left mouse click
    (Shown below are control presets 1 (default) / 2 / 3 / 4)
    Square = Autofire (default) / Fire / Autofire / Fire
    Cross = Fire (default) / Autofire / Up (Jump) / Up (Jump)
    Triangle = Space (default) / Space / Fire / Autofire
    Circle = Secondary Fire (used only in a few games)
    R+Square = Ctrl
    R+Circle = Left Alt
    R+Cross = Help
    L+Square = Left mouse
    L+Circle = Right mouse
    R+Dpad = Arrow keys

    When custom controls are on
    -----
    L+Start = Toggle between custom control set number 1, 2, and 3

    In this mode, Vita buttons can be mapped to any Amiga side keyboard key or joystick action. There's also a mapping option called "slow mouse." It will slow down the mouse pointer by a factor ten if that mapped button is held down. Up to four Vita controllers can be mapped (for multiplayer on VitaTV). Four Amiga-side joysticks are supported. Joystick 3 and 4 are on the emulated parallel port joystick adapter.

    Virtual keyboard controls
    -----
    Start = Toggle virtual keyboard
    Right analog stick up/down = Move virtual keyboard up and down
    Right analog stick left/right = Change virtual keyboard transparency
    Cross = Press selected key (on Switch, this can be changed from B to A)
    Square = Backspace
    Triangle = Toggle shift
    Circle = Turn off all sticky keys (ctrl, alt, amiga, and shift) (on Switch, this can be changed from A to B)

    Touch controls
    -----
    Note: for multi-touch gestures, the fingers have to be far enough apart from each other, so that the Vita will not erroneously recognize them as a single finger. Otherwise the pointer will jump around.

    Single short tap = left mouse click
    Single short tap while holding a second finger down = right mouse click
    Single finger drag = move the mouse pointer, how far the pointer moves in response to finger motion depends on the Mouse Speed setting
    Dual finger drag = drag'n'drop (left mouse button is held down)
    Three finger drag = drag'n'drop (right mouse button is held down)

    Bluetooth Keyboard / Mouse controls
    -----
    Mouse + keyboard tested working with the "Jelly Comb Mini Bluetooth Keyboard With Mouse Touchpad, ASIN:B06Y56BBYP," and with the "Jelly Comb Bluetooth Wireless Mouse ASIN:B075HBDWCF." The Amiga keys are mapped to Windows (GUI) keys as well as Page Up/Down. The Vita doesn't pair with all Bluetooth keyboards and mice. As a rule, if the keyboard works to highlight bubbles with cursor keys, it should also work in UAE4All.

    CHANGELOG
    =====
    1.77

    - increase max files per dir from 3072 to 10240
    - on Switch, in split JoyCon mode, make SL/SR act as L/R also in menu
    - on Switch, in split JoyCon mode, disable L/R/ZL/ZR in menu

    1.76

    - fixed lag when navigating the savestate menu
    - on Switch, added split Joycon option for tabletop multiplayer with up to four single Joycons
    - on Switch, allow menu navigation with analog stick

    1.75

    - fixed crash when booting a floppy with floppy speed >1x
    - fixed inconsistencies in menu navigation
    - enabled long filename display in file browser (hold Triangle or X to show it)
    - fixed an issue where HD Dir could not be selected unless Boot HD was set to OFF
    - removed legacy code and data files that were not needed

    1.74 (Switch only)

    - Allow remapping of ZR/ZL on Switch
    - Map ZR/ZL to "slow-down mouse" on Switch if custom controls are off
    - Add option to misc menu to choose either A or B as OK button on Switch
    - Add sharp-bilinear-simple scaling routine, and make it the new default
    - Add point filtering scaling routine

    1.73 (Switch only)

    - Fix savestates on Switch

    1.72switch

    - Added Switch release

    1.72

    - Savestate location can now be changed in the menu

    - Savestates can now be deleted from the menu

    - Implemented an automatic savestate. There's a new savestate slot called auto. If it exists, this savestate will be loaded immediately when inserting a floppy.

    1.71

    - Fix hd settings not saving, and displayline settings not loading in certain situations

    1.70

    - Improve pointer response to diagonal stick directions

    1.69

    - Improve pointer response to slow finger motion

    1.68

    - Parallel port joystick adapter support. By default, Amiga joysticks 3 and 4 are controlled by VitaTV gamepads 3 and 4. They can also be mapped to other inputs using the custom controls screen.

    1.67

    - Improve pointer controls with bluetooth mouse by re-compiling with latest SDL-Vita

    1.66

    - Prevent accidental clicks when moving pointer using touch


    (...)
     
    Last edited by rsn8887, Nov 16, 2018 at 2:05 AM
  2. DocBo

    DocBo GBAtemp Regular

    Member
    2
    Apr 11, 2018
    Germany
    What?! AMAZING!! :grog:
     
    rsn8887 likes this.
  3. hippy dave

    hippy dave BBMB

    Member
    12
    Apr 30, 2012
    United Kingdom
    Incredible, thanks!
     
    rsn8887 likes this.
  4. hippy dave

    hippy dave BBMB

    Member
    12
    Apr 30, 2012
    United Kingdom
    Looking good! I initially had the kickstart roms named incorrectly by mistake, and when I loaded the emulator it gave a "not found" error and said press any button to exit, but when I did the Switch crashed with "An error has occurred" - I didn't notice if there was an error number, sorry. If you want me to I can do it again, and look for an error number and/or an atmosphere crashlog.

    Got the kickstarts renamed and have just loaded up Rock'n'Roll :)
     
    rsn8887 likes this.
  5. snoofly

    snoofly GBAtemp Advanced Fan

    Member
    6
    Aug 18, 2015
    United States
    OMG! My dreams come true. This was the last main system I wanted on my Switch.
    Sir, I’m forever in your debt.
     
  6. hippy dave

    hippy dave BBMB

    Member
    12
    Apr 30, 2012
    United Kingdom
    Making a save state seems to freeze the emulator (tho not crash the console)? Or does it just take a REALLY long time (I've given it a few minutes)?
    Game is running great tho :)
     
    rsn8887 likes this.
  7. mattytrog

    mattytrog Up yours...

    Member
    8
    Apr 27, 2018
    United Kingdom
    Brilliant... Jesus on E`s here I come!

    I wonder if a keyboard / mouse in the dock is or will be supported?
     
    hippy dave likes this.
  8. peteruk

    peteruk GBAtemp Addict

    Member
    11
    Jun 26, 2015
    @subcon959 will be a happy man

    great job on the port, would've preferred an Atari ST one myself though :P
     
    rsn8887, subcon959 and gizmomelb like this.
  9. mattytrog

    mattytrog Up yours...

    Member
    8
    Apr 27, 2018
    United Kingdom
    Atari ST? That's swearing! ;)
     
    rsn8887, Moko and peteruk like this.
  10. peteruk

    peteruk GBAtemp Addict

    Member
    11
    Jun 26, 2015
    I was poor lol, I did get an Amiga well a couple of them later on but my heart was always with Atari - that and my bluebox program :D
     
    rsn8887 likes this.
  11. mattytrog

    mattytrog Up yours...

    Member
    8
    Apr 27, 2018
    United Kingdom
    I was poor too. Sold my Amstrad 464, game mum and dad the money, they put rest to it and got a 600 for xmas.

    Oh...Protracker / Amos professional how I miss thee...
     
    rsn8887, klear, Reecey and 1 other person like this.
  12. sid6581

    sid6581 Member

    Newcomer
    2
    Apr 11, 2007
    Gambia, The
    Nothing beat an Amiga for home computer gaming (and certainly not an Atari ST :lol:) so this is hugely appreciated! Gonna try it later.
     
    DocBo and rsn8887 like this.
  13. hippy dave

    hippy dave BBMB

    Member
    12
    Apr 30, 2012
    United Kingdom
    I don't want to seem like I just keep coming in here complaining, but, yay bug reports, right? :)
    Common homebrew problem - after the console has been asleep for a bit, waking up back to the emulator gives slight slowdown & appropriately mangled sound.

    Time limit of Rock'n Roll level 4 seems a bit stingey...
     
    Lineacero and rsn8887 like this.
  14. Reecey

    Reecey Mario 64 (favorite game of all time)

    Member
    9
    Mar 7, 2010
    At Home :)
    That’s nothing I used to have a Spectrum 48k I still have in the loft and then I up graded to the spectrum 128 I’ve still got all the tape games! The graphics were terrible I used to play the Dizzy games a lot, it drove me mad! When the games were being loaded it used to make a horrible screeching noise.
     
    Last edited by Reecey, Nov 5, 2018
    Lineacero and rsn8887 like this.
  15. mattytrog

    mattytrog Up yours...

    Member
    8
    Apr 27, 2018
    United Kingdom
    Come on boys... Lets beat up the ST lover! At playtime, you are history peter...
     
    rsn8887, peteruk and hippy dave like this.
  16. snoofly

    snoofly GBAtemp Advanced Fan

    Member
    6
    Aug 18, 2015
    United States
    Works a treat.
    This is so great to relive all my old memories of this awesome machine on the Switch.
    I recommend everyone to grab the Ultimate Amiga by Ransom v2 set to grab the hdfs to go along with this.
     
    rsn8887 likes this.
  17. hippy dave

    hippy dave BBMB

    Member
    12
    Apr 30, 2012
    United Kingdom
    Anyone else tried save states? Don't know if it's just my particular game/config that doesn't work.
     
    rsn8887 likes this.
  18. KHEOPS

    KHEOPS GBAtemp Fan

    Member
    2
    Aug 29, 2018
    France
    I still have an amiga 500 (+ memory extension to 1mo)
    impressive 1 mo ....
    do not criticize my super atari 1040stf, my atari is very good, and the higher audio has my amiga ...:angry:...:rofl2:
    check my signature, my machines are listed

    question to op
    how can you have a fluid vsynchro without jerk?( zero frameskip) while amiga games are at 98% pal 50hz,( 2%60hz ntsc), and the switch screen is a lcd ips 60hz refresh rate? i have uae4arm on android gpdxd, the runoff is never smooth, and never will be ....
    I do not see anything about it
    Anyway thank you very much

    so many fantastic games on the amiga
     
    Last edited by KHEOPS, Nov 5, 2018
    rsn8887 likes this.
  19. petarku

    petarku Member

    Newcomer
    1
    Mar 5, 2017
    well done @rsn8887 !!!
    I saw you were asking for help on eab on amiga specifics and on the end you solved it on your own.
    As i promised I am ready to give you donation for your hard work.
    Is there possibility to donate you without patreon account ? Can you specify how ?
    I will post this thread to the other related thread where people were asking about amiga emulator . Let's donate to this guy.
     
    rsn8887 likes this.
  20. Robmead23

    Robmead23 GBAtemp Regular

    Member
    3
    GBAtemp Patron
    Robmead23 is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    Nov 6, 2015
    Amazing work. Will we go try this. I used to adore my Amiga
     
    rsn8887 likes this.
Loading...