Skip to content

Commit

Permalink
[SWITCH] fix savestates
Browse files Browse the repository at this point in the history
  • Loading branch information
rsn8887 committed Nov 6, 2018
1 parent 94e4c68 commit 30984e1
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.0)
set(CMAKE_VERBOSE_MAKEFILE OFF)

set(VERSION_MAJOR 1)
set(VERSION_MINOR 72)
set(VERSION_MINOR 73)

if(BUILD_PSP2)
if (NOT DEFINED CMAKE_TOOLCHAIN_FILE)
Expand Down
24 changes: 16 additions & 8 deletions README.MD
Expand Up @@ -21,7 +21,7 @@ Installation
* 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 folders `/switch/uae4all2/data/` with the keyboard icons and other data files on your SDCard.
* 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

Expand All @@ -33,32 +33,36 @@ Vita/Switch-exclusive Features
- 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 Vita 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.
- Bluetooth keyboard and mouse support
- Sticky virtual keyboard modifiers: allows keyboard combos like CTRL-C to be entered easily
- Touchpad style pointer controls using the front touch panel and (optional) the rear touch panel
- Supports loading files from ux0: or uma0: partition
- 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
======
- 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 Vita screen
- 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 Vita screen.
- 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
======
- On the Switch, there's no shader support yet. But the Switch resolution is high enough for perfect integer scaling with factor 3x if displayed lines is not larger than 240 and width is not larger than 426. Filtering can be set to "Bilinear" or "None". When "Bilinear" is selected, the screen is scaled to fill the Vita display, keeping aspect ratio. No black bars on top and bottom appear. The image can be quickly zoomed using "R+Start+left/right" and vertically adjusted using "R+Start+up/down" to center it. When "None" is selected, only a perfect integer scaling is applied. Depending on the chosen Amiga screenmode, the integer scaling will be a 1x, 2x, 3x, or in principle even 4x, depending on whether the scaled Amiga screen fits. In most cases, this results in black bars on top and bottom as well as left and right.

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 on Vita:* On the Vita, 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 screen 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, and moved vertically using R+Start+Dpad up/down to center it on the Vita 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.
- *Display on Switch:* On Switch, there is no shader support yet. But the 720p resolution on Switch allows 3* integer scaling as long as the displayed lines are <=240 and width is <426. This can be selected in the display menu under `shader`. There are two settings: `None (perfect integer scaling)` with black bars on top and bottom, or `bilinear (a little blurry)`, without black bars on top and bottom.
- *Screen settings:* Many Amiga games fit the screen very nicely. For example, take Chaos Engine with a screen setting of 320*200 and sharp_bilinear_simple shader enabled (or bilinear on Switch). The picture can be zoomed using R+Start+Dpad left/right, and moved vertically using R+Start+Dpad up/down to center it on the screen. Once this is done, the picture fills almost the whole screen and looks amazing with no artifacts and, on Vita, almost no 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.
- *Display on Switch:* On Switch, there is no shader support yet. But the 720p resolution on Switch allows 3* integer scaling in many cases, which can be selected in the display menu under `shader`. There are two settings: `None (perfect integer scaling)` or `bilinear (quite blurry)`.
- *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.
Expand Down Expand Up @@ -189,6 +193,10 @@ Mouse + keyboard tested working with the "Jelly Comb Mini Bluetooth Keyboard Wit

CHANGELOG
=====
1.73 (Switch only)

- Fix savestates on Switch

1.72switch

- Added Switch release
Expand Down
8 changes: 7 additions & 1 deletion src/sound_sdl_new.cpp
Expand Up @@ -156,7 +156,7 @@ static int gp2x_start_sound(int rate, int bits, int stereo)

if( audioOpened ) {
// __android_log_print(ANDROID_LOG_INFO, "UAE4ALL2", "UAE tries to open SDL sound device 2 times, ignoring that.");
#if defined(__PSP2__) || defined(__SWITCH__)
#if defined(__PSP2__)
//this allows the user to change sound settings on the fly
//without having to save config and restart
//safely stop sound
Expand Down Expand Up @@ -323,7 +323,10 @@ void pause_sound (void)
dbg("sound.c : pause_sound");
#endif

#ifndef __SWITCH__
// not pausing/unpausing audio fixes savestates on Switch
SDL_PauseAudio (1);
#endif
/* nothing to do */

#ifdef DEBUG_SOUND
Expand All @@ -337,7 +340,10 @@ void resume_sound (void)
dbg("sound.c : resume_sound");
#endif

#ifndef __SWITCH__
// not pausing/unpausing audio fixes savestates on Switch
SDL_PauseAudio (0);
#endif
/* nothing to do */

#ifdef DEBUG_SOUND
Expand Down
13 changes: 0 additions & 13 deletions src/switch/sdl2_to_sdl1.cpp
Expand Up @@ -30,11 +30,6 @@ SDL_Surface *SDL_SetVideoMode(int w, int h, int bpp, int flags) {
display_height = DM.h;
}
SDL_Surface *surface = SDL_CreateRGBSurfaceWithFormat(0, w, h, 16, SDL_PIXELFORMAT_RGB565);
//if (texture) {
// SDL_DestroyTexture(texture);
// texture = NULL;
//}
//texture = SDL_CreateTexture(renderer, SDL_PIXELFORMAT_RGBA8888, SDL_TEXTUREACCESS_STREAMING, w, h);
return surface;
}

Expand Down Expand Up @@ -78,14 +73,6 @@ void SDL_SetVideoModeSync(int value) {

void SDL_Flip(SDL_Surface *surface) {
if (surface && renderer && window) {
//SDL_UpdateTexture(texture, NULL, surface->pixels, surface->pitch);
Uint32 *texture_pixels = NULL;
int texture_pitch;
Uint32 texture_format;
//SDL_QueryTexture(texture, &texture_format, NULL, NULL, NULL);
//SDL_LockTexture(texture, NULL, (void **) texture_pixels, &texture_pitch);
//SDL_ConvertPixels(surface->w, surface->h, surface->format->format, surface->pixels, surface->pitch, texture_format, texture_pixels, texture_pitch);
//SDL_UnlockTexture(texture);
if (texture) {
SDL_DestroyTexture(texture);
texture = NULL;
Expand Down

0 comments on commit 30984e1

Please sign in to comment.