4695 Commits
Author SHA1 Message Date
scribam 3d5fd61285 macos: fix size for image icons 2022-04-09 12:06:17 +02:00
scribam 069b501ca3 android: update android gradle plugin to version 7.1.3 2022-04-09 12:05:22 +02:00
flyinghead d035af7ff0 xbox: low resolution (640x480) with recent firmware
Device ids for xbox series s/x returned from
GetGamingDeviceModelInformation() have changed
2022-04-09 12:04:51 +02:00
scribam 20302cd378 cmake: add XCODE_ATTRIBUTE_PRODUCT_BUNDLE_IDENTIFIER 2022-04-07 23:09:08 +02:00
scribam 959685e260 ci: use xcode for macos 2022-04-06 14:54:28 +02:00
Flyinghead e46d819c46 aws needs bash shell 2022-04-04 11:41:28 +02:00
scribam 274f2fe10d ci: add ninja, update actions and ccache support 2022-04-03 15:38:49 +02:00
flyinghead 2c96d49cf2 dx9, dx11: support for forced point/linear tex sampling and anisotropy 2022-04-02 11:18:48 +02:00
Hugo Locurcio a9cabdc342 Add texture filter override setting, expose anisotropic filtering
The new texture filter option can be set to:

- Default (keeps the game's intended filter mode).
- Force Nearest-Neighbor (crisper appearance).
- Force Linear (smoother appearance).

Additionally, mipmapping can now be enabled on nearest neighbor-filtered
textures (which is used if nearest-neighbor filtering is enabled, including
with anisotropic filtering).

Anisotropic filtering was already implemented in both OpenGL and Vulkan,
but it was not exposed in the GUI.
2022-04-01 16:00:41 +02:00
Hugo Locurcio 90a95b4688 Add 6×, 7×, 8× and 9× options for internal resolution
This can be used to get a smoother image (supersampling) on
1440p and 4K displays. The 9× setting is also suited for native
resolution rendering on 8K displays.
2022-04-01 16:00:28 +02:00
scribam 0c46ea13c7 ci: use windows-latest 2022-03-27 18:14:38 +02:00
Flyinghead 1e01dbb151 wrong line padding value when copying RTT to vram due to previous commit 2022-03-26 20:51:07 +01:00
Flyinghead be270259ee crash with RTT and copy to VRAM if width > linestride
RTT texture width must not exceed FB_W_LINESTRIDE
fixes Flag to flag crash
2022-03-25 15:41:16 +01:00
Nikos Chantziaras 03f9955f8b libretro: present frames before audio upload
retro_audio_sample_batch_t can block for a long time if the frontend
performs audio sync. This unnecessarily delays frame presentation.
2022-03-23 21:30:03 +01:00
Flyinghead 514eedbc63 maple: do not raise maple_dma interrupt for light gun
Issue #474 (Virtua Cop 2 momentarily freezes when shot fired)
2022-03-07 19:16:49 +01:00
Flyinghead 1f61f80c92 input: fix naomi rotary encoders
Games with multiple JVS input boards poll inputs more than once,
ignoring some relative mouse movements.

Issue #557
2022-03-06 17:57:16 +01:00
scribam 830ffd0559 deps/picotcp: pico_ipv6_source_dev_find requires PICO_SUPPORT_IPV6
Backport https://github.com/virtualsquare/picotcp/commit/529074aab4f53a87426673548d6793ced666b6ed
2022-02-28 07:24:50 +01:00
scribam ed066df469 deps: update miniupnpc 2022-02-28 07:24:36 +01:00
scribam e6676c7d09 android: update gradle 2022-02-27 08:33:44 +01:00
scribam 33115a39a3 android: use latest cmake from android studio 2022-02-27 08:33:44 +01:00
Flyinghead 6538360fe1 switch: use devkita64:20220128 instead of latest
fixes peformance issue
2022-02-26 08:14:10 +01:00
Flyinghead ed0e5b8c5a remaining references to windows-latest -> windows-2019 2022-02-25 17:47:47 +01:00
Flyinghead c75d94bd90 use windows-2019 for windows builds 2022-02-25 17:36:13 +01:00
Depal1 a8d6374d76 Add installation on MacOS via Homebrew 2022-02-25 17:18:35 +01:00
cmitu 4b10402c5b Disable stencil usage on low end VC4 devices (Pi3)
Make the libretro core boot again when using the legacy VC4 GLES drivers.
Based on https://github.com/libretro/flycast/commit/ee9cd16f

Fixes: https://github.com/flyinghead/flycast/issues/539
2022-02-24 07:17:48 +01:00
Flyinghead 20571c5aa1 chd: MIL-CD support
Issue #529
2022-02-15 11:34:11 +01:00
Flyinghead 3872a6b475 libretro: support VMU and lightgun crosshair with dx11 OIT renderer
OIT support was missing
Issue #525
2022-02-15 11:06:51 +01:00
Flyinghead 083a1c85a8 gl: shader compile error on shield tablet
Don't use GL_NV_shader_noperspective_interpolation since it's not really
needed (and wasn't enabled)

Issue #510
2022-02-14 18:54:27 +01:00
Flyinghead 943e0285ac libretro: support VMU and lightgun crosshair with dx11 renderer
Issue #525
2022-02-14 18:47:23 +01:00
Flyinghead d7abfc688c dx11: oit depth pass needs the palette for PT polygons
Punch-through polys may use a palette, which is needed for alpha testing
Issue #467
2022-02-14 18:41:38 +01:00
Flyinghead 8f01ef90cf gl,dx9,dx11: only render frame when Renderer::present() has been called
Issue #511
2022-02-14 18:38:58 +01:00
github-actions[bot] 3929fe64a3 Fetch translations & Recreate libretro_core_options_intl.h 2022-02-11 22:20:12 +00:00
Flyinghead 4fe8e40569 libretro: fix texupscale and max upscaled texture size settings value 2022-02-06 20:42:41 +01:00
Flyinghead b91b3d5da6 libretro: use correct #ifdef for omp support
enables xBRZ upscaling
2022-02-06 17:52:30 +01:00
github-actions[bot] 92f81fa054 Fetch translations & Recreate libretro_core_options_intl.h 2022-02-04 22:19:01 +00:00
Flyinghead 4e21391f8c ggpo: memory leak in free_buffer 2022-01-29 16:58:28 +01:00
github-actions[bot] 9ab4bb963f Fetch translations & Recreate libretro_core_options_intl.h 2022-01-28 22:20:29 +00:00
Flyinghead 58f05f74cf jvs: set received jvs message trail to zero
fixes sh4 crash during naomi boot
2022-01-28 11:31:30 +01:00
DisasterMo a4b0a69c45 Enable Indonesian, Swedish and Ukrainian localisations 2022-01-22 19:18:41 +01:00
github-actions[bot] 2a364910c0 Fetch translations & Recreate libretro_core_options_intl.h 2022-01-21 22:20:49 +00:00
Flyinghead 45ba648622 dx11: VersionHelpers.h -> versionhelpers.h
the mingw version is all lowercase
2022-01-19 14:37:49 +01:00
Flyinghead dcd48f4264 ios: on-screen keyboard support 2022-01-19 13:48:16 +01:00
Edward Li 8ee9f1b1d9 Cleanup macOS screen DPI calculation (included in SDL 2.0.20 now) 2022-01-18 11:58:57 +01:00
Edward Li f2c39e4004 Update SDL to 2.0.20 2022-01-18 11:58:57 +01:00
Flyinghead 62ec3546d6 dx11: uwp doesn't need texture conversions 2022-01-16 10:37:55 +01:00
Flyinghead 8bb0bd05f9 ui: limit scaling further on small low-resolution screens (retroid) 2022-01-16 09:58:33 +01:00
Flyinghead e538242962 dx11: convert 16-bit textures to 32 bits on windows7
1555, 4444 and 565 aren't supported on win7
Issue: https://github.com/libretro/flycast/issues/1123
2022-01-16 09:54:39 +01:00
github-actions[bot] d70d2ad405 Fetch translations & Recreate libretro_core_options_intl.h 2022-01-14 22:21:28 +00:00
Julien Reichardt 4f638f6d77 Use service button instead of coin
The service button can also be used to add coins.
2022-01-11 14:09:54 +01:00
Julien Reichardt 80d78705b0 Add default coin mapping 2022-01-10 12:13:14 +01:00
github-actions[bot] 140cec7c59 Fetch translations & Recreate libretro_core_options_intl.h 2022-01-07 22:20:58 +00:00
scribam 746b3c5a54 sdl: fix joystick rumble 2022-01-06 08:59:39 +01:00
Flyinghead a4788b5b24 zero-init sh4 context when no vmem is available
Issue #439
2022-01-03 18:44:47 +01:00
cmitu 8dcf0f58b5 postprocess: fix GLES2-only build
Added a missing `ifndef` guard for `glBindVertexArray`, useful for GLES2-only builds.
2022-01-02 10:51:03 +01:00
Julien Reichardt a8080c5db3 Fix missing libSDL2.a static library on Linux 2022-01-01 18:29:46 +01:00
github-actions[bot] a52977d1cf Fetch translations & Recreate libretro_core_options_intl.h 2021-12-31 22:20:45 +00:00
Edward Li 0bb6fed822 Remove junk folder when packaging macOS app 2021-12-26 23:20:58 +01:00
Flyinghead d86305a7c3 android: on-screen gamepad not editable in Open GL
Swap wasn't called during editing
Issue #464
2021-12-26 16:03:19 +01:00
Edward Li 5aeef17d09 macOS: Enable "New Instance" in File and Dock menu for SDL 2021-12-25 21:46:19 +01:00
Flyinghead 2d41d993e3 macOS: patch SDL to compile in metal and vulkan
https://github.com/libsdl-org/SDL/issues/5010
2021-12-25 21:45:13 +01:00
github-actions[bot] 503cc7ea97 Fetch translations & Recreate libretro_core_options_intl.h 2021-12-24 22:21:05 +00:00
Flyinghead 7f41847c5c android: bigger on-screen gamepad analog handle. Update project README 2021-12-24 19:46:09 +01:00
scribam fde683a82e ci: cmake install for switch builds 2021-12-23 22:31:39 +01:00
scribam 4feff7d917 ci: add ccache for switch builds 2021-12-23 22:31:39 +01:00
asdf288 e61951a319 Fix typo in GLES2 library name 2021-12-23 22:31:25 +01:00
Flyinghead da81274eb9 lr: gl stencil param isn't obsolete but required
Issue #454
2021-12-23 22:30:44 +01:00
flyinghead 8740141a93 Merge pull request #451 from flyinghead/net-rollback
Merge net-rollback branch
2021-12-23 11:21:29 +01:00
Flyinghead 9223a2b530 readme: link to gamr13's xbox page 2021-12-22 21:41:01 +01:00
Flyinghead 300c74e3fc Merge remote-tracking branch 'origin/master' into net-rollback
# Conflicts:
#	CMakeLists.txt
#	shell/libretro/libretro.cpp
#	shell/libretro/libretro_core_options.h
2021-12-22 21:31:17 +01:00
Flyinghead 3f82c7fb6f iOS: use play and record audio session only when necessary
Change audio session to play and record when a microphone is connected.
Use a play only session otherwise. Issue #360

Hide VSync-related gui option.
2021-12-21 21:36:12 +01:00
Flyinghead 2cb7a1d96c android CI: upload to S3 after dumping symbols 2021-12-21 21:26:31 +01:00
Flyinghead 00562455e0 android CI: choose the openssl flavor of curl 2021-12-20 16:11:54 +01:00
Flyinghead bb88dcfe66 android CI: install libcurl for breakpad. Disable breakpad on macOS 2021-12-20 16:08:22 +01:00
Flyinghead 970e594009 Build with breakpad submodule. Use gcc 11 on windows. 2021-12-20 15:45:46 +01:00
Flyinghead cd5a784277 add breakpad as submodule 2021-12-20 15:23:28 +01:00
Flyinghead 771f653174 delete breakpad 2021-12-20 15:20:26 +01:00
scribam 109cb81ab7 ci: add cmake install and refactor artifact generation 2021-12-20 14:36:48 +01:00
Flyinghead bf87f7ba84 Compilation error on armv7 with gcc 9 2021-12-20 14:27:19 +01:00
scribam 92b8eae2dc ci: cleanup cmake build type 2021-12-19 15:02:05 +01:00
scribam 776f86c7f2 README.md: add badge for Windows UWP CI 2021-12-19 13:29:41 +01:00
cmitu c10c3a1cfe cmake: amend 2b827e43, fix the typo for GLES3_LIBRARIES 2021-12-19 13:28:47 +01:00
scribam 94fccc5112 ci: fix ccache cache key 2021-12-19 11:18:32 +01:00
scribam 73fa0e3efc cmake/deps: update sdl to version 2.0.18 2021-12-19 11:18:24 +01:00
cmitu 2b827e43d7 cmake: add more GLES3 library names
Some systems provide the GLES3 implementation in the same GLESv2 library file, most notably Mesa.
Added the alternative library name when GLES3 is requested.

This makes the build work on the Pi4 - I've only tested it with the libretro core and the GLES 3.1 context is succesfully used.
2021-12-19 10:56:32 +01:00
cmitu e706368225 cmake: add support for legacy RPI GLES2 libs
Raspberry Pi 3 can use the legacy Broadcom GLES2 libraries from /opt/vc/lib.
They are the default GLESv2 libraries on Raspberry PI OS 10 (Buster) and older.
2021-12-19 10:56:32 +01:00
flyinghead 2f5271ab83 yabf4 2021-12-18 13:33:42 +01:00
flyinghead 4e448b23a8 yabf3 2021-12-18 13:25:41 +01:00
flyinghead 38002d4907 yabf2 2021-12-18 13:14:04 +01:00
flyinghead fd81f9b1b4 yabf 2021-12-18 13:11:17 +01:00
flyinghead 77900f5745 ci: env var not replaced 2021-12-18 12:25:02 +01:00
flyinghead 8684aac4f2 yaml parse error 2021-12-18 12:19:09 +01:00
flyinghead b1e0bc90ba uwp: remove angle, upload to S3. windows: don't build SDL 2021-12-18 11:50:03 +01:00
scribam 8e305bfd0f android/vmem: use constant ASHMEM_NAME_DEF 2021-12-18 11:46:04 +01:00
scribam 32716e1480 android: update com.android.tools.build:gradle to version 7.0.4 2021-12-18 11:46:04 +01:00
jdgleaver 833eccb6c4 (libretro) Sanitise core options 2021-12-18 10:16:37 +01:00
github-actions[bot] f64b3618f2 Fetch translations & Recreate libretro_core_options_intl.h 2021-12-17 22:20:56 +00:00
Flyinghead 325cd9a066 DSP crash on apple M1
Issue #415
2021-12-17 13:43:45 +01:00
Flyinghead 544c711fd7 savestate: compatibility between nvmem and !nvmem savestates 2021-12-17 13:41:46 +01:00
Flyinghead e02afb34d1 dx11: wrong shadow scale factor. vk: object leak. Code duplication
dx11: shadow scale factor inverted in per-pixel
vulkan: clear deleted overlay images when terminating
Use color struct for FOG_COL_VERT, FOG_COL_RAM, FOG_CLAMP_MIN,
FOG_CLAMP_MAX and VO_BORDER_COL. Avoid code duplication in renderers.
2021-12-17 13:40:42 +01:00
Flyinghead dc5acd24b2 Merge remote-tracking branch 'origin/master' into net-rollback 2021-12-17 12:40:37 +01:00
Flyinghead 7555263e38 wrungpo had wrong decryption key
Issue https://github.com/libretro/flycast/issues/1108
2021-12-17 11:55:17 +01:00
Flyinghead 71d016722e vulkan: fix various validation errors
oit: skip to new frame even if previous frame was never presented
libretro: quad pipeline used for overlay must use subpass 2 in per-pixel
overlay: delay destruction of VMUs images
libretro: WaitIdle on queue instead of wait_sync_index
2021-12-16 21:26:55 +01:00
jdgleaver 96560e4914 (libretro) Move audio batch callback onto main thread + improve audio sample pacing 2021-12-16 18:21:08 +01:00
Flyinghead 04be40767b android: fallback to /dev/ashmem if ASharedMemory fails. More logs
Issue #439
2021-12-15 23:09:59 +01:00
Flyinghead 5a6197cfc6 libretro: never request a GLES3 context
RA doesn't give us the opportunity to retry if GLES3 isn't supported.
Issue #405
2021-12-15 21:23:35 +01:00
flyinghead 5fca12af49 msvc compilation warnings 2021-12-15 17:58:58 +01:00
flyinghead 853830a446 log errno when failing to open a disk or folder. Better win32 errors
Log errno when failing to open a disk or folder (game scanner)
Better win32 error codes with GetLastError() for opendir, stat, access
2021-12-15 17:55:42 +01:00
flyinghead 2f47f72957 dx11: recreate texture if dimensions or format change. Clear rtt depth
Fixes a crash when switching Copy to VRam on as the RTT texture is no
longer upscaled when updated.
Clear RTT depth/stencil before render.
2021-12-15 11:32:04 +01:00
flyinghead de35cf9840 dx11: fix fullscreen toggling
Prevent DXGI from monitoring Alt+Enter and let SDL handle it
2021-12-15 10:37:52 +01:00
flyinghead 18d8107992 dx11: no color interpolation for flat shading
Fixes Evolution WoSD
refactor setFirstProvokingVertex (dx9, dx11, vk)
Set .1 depth scale for V-Rallye to fix missing background image in menus
(dx11, dx9)
2021-12-15 09:37:58 +01:00
flyinghead 2478b72a3e lr dx11: fix exit crash. Save shader cache where vk cache is 2021-12-14 16:48:23 +01:00
flyinghead 4d60150345 libretro: dx11 crash in single-threaded. Use compiler and feature level
libretro: Null first frame erroneously set as valid causing a crash with dx11 (single-threaded rendering)
libretro: pass dx11 compiler pointer to shaders
dx11: use feature level to check if per-pixel is supported
2021-12-14 10:41:04 +01:00
flyinghead 6a3a8d5578 libretro: dx11 support. dx11 shader cache. dx9 clipping planes
dx11: use 32-bit float depth texture to avoid loss of precision (SA2 into logo)
dx11: cache shader blobs to disk if not provided by OS
dx11: swap interval depends on screen refresh rate (1 for 60 Hz, 2 for 120 Hz, ...)
dx9: use clipping planes to avoid interpolation errors in rasterizer (daytona, mermaid lake)
directsound: use comptr
gui: fix navigation issue with OptionArrowButtons due to missing id
2021-12-13 21:02:44 +01:00
scribam 08828991e7 dx11: msvc x86 build fix 2021-12-12 18:43:36 +01:00
flyinghead 4c14a96888 vk, gl4: out of bound array index when sorting pixels 2021-12-12 18:42:50 +01:00
flyinghead 0478ec9696 dx11: per-pixel renderer 2021-12-11 18:53:35 +01:00
flyinghead 46044c068b cheats: don't rely on cheat count on load. Fix compile warnings 2021-12-11 18:33:28 +01:00
github-actions[bot] c6fe6b83ac Fetch translations & Recreate libretro_core_options_intl.h 2021-12-10 22:20:46 +00:00
flyinghead cc39d4dd7d vmem: close shared mem file descriptor when terminating
Tentative fix for Issue #439
2021-12-10 14:04:45 +01:00
flyinghead b79c049bd4 dx11: wrong shader hash calculation 2021-12-09 09:26:36 +01:00
flyinghead 4cbf19c97e libretro: nvmem not saved when rom path mixes slash and backslash
Issue https://github.com/libretro/flycast/issues/1114
2021-12-07 17:15:35 +01:00
flyinghead 27041cbf59 dx11: better clipping algo. modvol cull mode. win: exception code
dx11: use faster clipping algorithm for modifier volumes
dx11: modifier volumes need cull mode. Fixes Daytona shadows.
win: the fault handler was treating some software exceptions as fatal (msvc)
uwp: remove async hacks and disable MS task wait exception. Fixes error reporting when loading a game.
2021-12-06 17:43:22 +01:00
IlDucci 8e2c72ed1b [Core options text] Typo fixes and minor style changes
- Changes the main category sublabels to match RetroArch's style.
 - Adds a missing period, as reported in Crowdin.
 - Adds an extra minor description to the Language setting.
2021-12-05 12:23:35 +01:00
flyinghead 7820c9bc44 dx9/11: fix rtt2vram crash. dx11: modvol fix and more
dx11: clip modvol triangles before sending them to the gpu
dx9,11: wrong source pointer for rtt to vram
dx11: handle source RowPitch when copy rtt to vram
dx11: crash at reinit
dx11: wrong scissor with direct fb rendering
dx11: blend ops are different for the alpha channel

Fix mingw CI build
2021-12-04 19:16:11 +01:00
github-actions[bot] 92fff9acf5 Fetch translations & Recreate libretro_core_options_intl.h 2021-12-03 22:21:13 +00:00
flyinghead 91da49dc52 mingw: downgrade cmake 2021-12-03 23:08:59 +01:00
flyinghead b5a45417d9 mingw: downgrade gcc to 10.3 2021-12-03 22:29:41 +01:00
Edward Li 3db4993077 Xcode project file (debug friendly) generator with predefined LLDB Init File to bypass SIGBUS error 2021-12-03 15:49:47 +01:00
Edward Li bc1a5fdd8d Make LLDB ignore EXC_BAD_ACCESS for debugging 2021-12-03 15:49:47 +01:00
flyinghead 191f1c38df dx11: scissoring fix. 4K UI scaling
Clearing of side columns in 4:3 uses the quad drawer so it needs to be
called early. Border color was wrong. Fixes GTA2.
Scale UI x2 in 4K mode.
2021-12-03 15:48:42 +01:00
flyinghead adb61259c1 mingw ci: enable dump_syms ouput 2021-12-02 17:20:56 +01:00
DisasterMo ddc2e84e45 Add automatic Crowdin synchronization 2021-12-01 21:28:51 +01:00
flyinghead a050a61f2e ci: install dx9 sdk for mingw 2021-12-01 21:28:21 +01:00
flyinghead 99195c3f4c dx11: set clip planes on X and Y. rend: Force palette update at init
dx11: Set clip planes at X -1/1 and Y -1/1 to avoid rasterizer errors.
Fixes Daytona Mermaid lake depth issues
dx11: fix texture wrap around at UV 1 with nearest filtering
dx9: inside clipping
all renderers: force full palette update at init
2021-12-01 14:54:03 +01:00
flyinghead 280c159078 uwp: fix dirent. Implement access() and stat()
Use UWP version of FindFirstFileEx
Implement basic access() and stat()
Add home dir to list of drives
Allow external storage folders to be added and scanned for games
2021-12-01 14:40:17 +01:00
flyinghead 6a8f1b941e dx11: overlay support. inside clipping. 4K support on xbox. log fix
dx11: support for vmu and lightgun crosshair overlays
dx11: implement inside clipping (fixes 18 wheeler rear view mirror)
dx11: tentative 4K support on xbox
iOS,uwp: save log file in home (iOS)/data(uwp) directory
uwp: don't sign app on pull requests
2021-11-29 18:22:25 +01:00
scribam 8a6ce19e1e input: cleanup virtual function specifier 2021-11-29 18:19:22 +01:00
flyinghead d071adea9a dx11: fix modifier volumes, rotation. sdl: on-screen keyboard support
dx11: Back face stencil ops need to be set
dx11: Rotate CCW instead of CW
dx11: Present with NO_WAIT when fast forwarding
sdl: support for on-screen keyboard. Delay keys up by one frame to allow quick key presses.
ui: better fix to wait for future on UWP
2021-11-28 16:19:03 +01:00
flyinghead 3d7455316f linux build fix 2021-11-27 14:39:28 +01:00
scribam 3f50baa318 picotcp: fix alloca on freebsd 2021-11-27 14:32:04 +01:00
scribam 8164c96379 deps: update libchdr and remove patch 2021-11-27 14:31:22 +01:00
flyinghead 4ab3f01867 uwp: external storage support. enable picotcp 2021-11-27 14:30:36 +01:00
flyinghead dbb277f749 Potential crash when starting game with non-default renderer
Renderer is switched to default and back to the selected one during
reset on the emu thread. The render thread may pick up this change.
2021-11-27 14:13:24 +01:00
flyinghead 0579f2ede6 7z: use fopen on all platforms 2021-11-27 14:08:07 +01:00
orbea ef3af9aad3 cmake: Add an install target (#421)
Don't install glslang or xbyak
2021-11-27 10:42:09 +01:00
flyinghead d5694036fa libretro: don't crash if frontend doesn't implement
RETRO_ENVIRONMENT_GET_CLEAR_ALL_THREAD_WAITS_CB

Issue #418
2021-11-27 10:41:11 +01:00
flyinghead f91847dad0 DX11 renderer WIP 2021-11-26 18:08:41 +01:00
flyinghead c4eaa973f0 picotcp: use strcasecmp 2021-11-24 14:17:00 +01:00
flyinghead 42fa77c81f uwp: the back button (B) shouldn't close the app 2021-11-24 13:42:25 +01:00
flyinghead e4bfeb9e44 picotcp: MSVC support 2021-11-24 13:41:04 +01:00
cglmrfreeman 67f2162fb3 Fix linux breakpad issues when glibc-2.34 is installed
As outlined by [Samuli Piippo in the qtwebengine chromium patch](https://codereview.qt-project.org/c/yocto/meta-qt6/+/378728/2/recipes-qt/qt6/qtwebengine/chromium/0004-breakpad-fix-build-with-glibc-2.34.patch), SIGSTCKZ is no longer being compile time constant in glibc-2.34. The proposed fix compiles on my end and I have not tested on a linux distro with an earlier version of glibc.
2021-11-23 20:23:28 +01:00
flyinghead 465499f6c3 libretro: don't set preferred GLES version when initializing context
Issue #405
2021-11-22 15:28:18 +01:00
flyinghead ea75311a34 uwp: yml typo 2021-11-21 15:34:01 +01:00
flyinghead 33fd8a9ec7 uwp: sign appx package 2021-11-21 15:18:55 +01:00
BornPosthumous 417ffc09f8 Allows override of flycast.lua file (#411) 2021-11-21 15:16:11 +01:00
flyinghead 1057f50f86 uwp CI fix 2021-11-20 19:13:55 +01:00
flyinghead 5b933cde61 uwp: use ccache for CI. gui_util.h typo 2021-11-20 18:24:21 +01:00
flyinghead 47442d1bc9 fix libchdr patch 2021-11-20 17:32:12 +01:00
flyinghead f25c83e006 uwp CI fix 2021-11-20 16:21:27 +01:00
flyinghead bc34024e32 uwp: fix crash when opening menu/canceling load. CI job 2021-11-20 16:18:27 +01:00
flyinghead 628bef9094 libretro: don't set minimum GLES version when initializing context
Issue #405
2021-11-20 14:14:19 +01:00
flyinghead 63598019e1 naomi: rename deathcox to deathcoxj, new deathcox parent rom
MAMESET 0.227 changes
Issue #409
2021-11-20 14:06:19 +01:00
flyinghead 501244ed25 x64 rec: incorrect stack alignment of memory handlers on windows 2021-11-20 12:29:07 +01:00
flyinghead e12912450c missing changes 2021-11-19 23:29:35 +01:00
flyinghead 8262c9ece7 UWP support - WIP 2021-11-19 23:18:45 +01:00
Flyinghead cc208ce451 libretro: arm32 android build must use arm mode, not thumb
Issue #405
2021-11-16 16:46:28 +01:00
scribam c6374a899c win32: build fix when sdl2 is not enabled 2021-11-14 22:56:43 +01:00
Flyinghead 8f80bcb159 New serialize framework. Delay maple dma xfer
New serialize framework. Refactor serialization into modules.
Maple dma xfer must not be executed immediately. Delay until interrupt
is raised.
Fixes Geist Force freeze at start.
2021-11-13 15:56:42 +01:00
Flyinghead e56ecfec40 vk,dx9: black screen/crash in single-threaded on direct fb access
When rendering happens after the render timeout (initial sega copyright
screen and more), the frame is never swapped and never displayed. Causes
a crash in vk since the acquired swapchain image is never
presented/released.
2021-11-11 11:17:39 +01:00
Flyinghead 80cf422a5e dynarec: fix CLRS and SETS ops
Destination reg was missing
Fix crash in OpenTyrian/SDL_DREAMHAL
Issue #403
2021-11-11 10:44:22 +01:00
Flyinghead d788c310ee apple build fix 2021-11-10 21:21:25 +01:00
Flyinghead 7583db3bef vk: option to duplicate frames to simulate swap interval > 1
Issue #293
2021-11-10 20:55:22 +01:00
Flyinghead ac5abd96bb ui: imgui driver, GraphicsContext interface, dx9 swap interval
Refactor imgui backend code into imgui drivers for gl, vk, dx9
Generic GraphicsContext interface for gl/vk/dx9 contexts
Simplify graphics api switching code
dx9, gl(sdl): set swap interval based on monitor refresh rate.
2021-11-10 20:35:30 +01:00
Flyinghead aa944ac5e8 vk: fix vmu transparency in lr core 2021-11-10 18:42:11 +01:00
Flyinghead 35e1fb9ae5 cmake: change default libretro target 2021-11-10 10:17:40 +01:00
twinaphex a15863ae35 (Libretro) CI integration - and necessary fix for compiling Windows
core cross-compiled on Linux
2021-11-09 18:48:55 +01:00
Flyinghead a04fd06e38 gl: iOS doesn't like smooth. More precision needed for vertex colors 2021-11-09 10:38:41 +01:00
scribam f6cc2c7b91 ci: use msys2 only for mingw builds 2021-11-09 10:37:43 +01:00
Flyinghead 99ee526ac5 gles3 doesn't support noperspective. vk needs higher prec for color/uv/z
noperspective not supported in gles 3. Use smooth instead
Vulkan now needs higher precision for colors, UV and z (adreno 630)
2021-11-08 16:53:47 +01:00
scribam d100067e02 cmake: use AltKit default include directory for AltKit-Swift.h 2021-11-08 11:58:42 +01:00
scribam f777c62a66 android: update com.android.tools.build:gradle to version 7.0.3 2021-11-08 11:58:42 +01:00
Flyinghead 06ef0e5fdc vk,gl: use w=1 in shaders. Fix translucent modvols
Use w=1 to avoid multiply/divide of xy as in dx9
Disable rendering when video output disabled
Use original w value in pixel struct to avoid precision loss (samsptk)
vk oit: missing memory barrier was producing Tr modvol glitches (JSR)
gl oit: Tr modvol needs full vertex shader
2021-11-07 18:21:44 +01:00
Flyinghead 5209623064 cue: ignore unrecognized REM entries. parse one line at a time 2021-11-05 19:14:08 +01:00
Flyinghead 7c53413bc5 vk oit: fix depth-only Tr pass
Cosmic smash
2021-11-05 18:36:09 +01:00
Flyinghead 42f92b8dc1 ggpo lib: compile warnings, remove legacy chat 2021-11-05 18:34:23 +01:00
Flyinghead 986baccf83 lr build fix 2021-11-04 13:11:18 +01:00
Flyinghead 32d31e7644 vk: implement TranslucentPolygonDepthMask
Fixes Cosmic Smash
vma: instance is needed at init
Partial vk support for iOS
2021-11-04 09:13:47 +01:00
Flyinghead 03161446b9 can't launch BIOS after playing a game 2021-11-04 08:57:15 +01:00
Flyinghead 17bbb7f145 vk: disable small tex optimization on macOS. Fix libMoltenVK embedding
small textures linear optimization leads to texture corruption with
moltenvk.
Copy libMoltenVk to correct runtime output dir.
2021-11-02 09:44:24 +01:00
Flyinghead 71c4ec34d5 iOS build fix 2021-11-01 13:30:36 +01:00
Flyinghead da3ed74c4e vulkan: moltenvk support on macOS - WIP
sdl: save/restore window position in config
2021-11-01 13:05:22 +01:00
Flyinghead 46ae8f92cc input: per game input mapping 2021-11-01 12:39:50 +01:00
Flyinghead 9b3dec5f70 imgui: fix crash when closing chat with gamepad DPad button down
backport https://github.com/ocornut/imgui/commit/25679a411ee33272d4d047192b30af03e3a384fc
2021-10-27 12:28:31 +02:00
Flyinghead 146bfb28d1 ggpo: always use P1 input in netplay even if playing as P2
fix imgui assert
2021-10-27 12:26:17 +02:00
Flyinghead 46fb331275 look for BIOS files in Content Path folders if not found in data folder 2021-10-27 12:24:30 +02:00
Flyinghead ff39b8b252 macOS: use ~/Library/Application Support/Flycast as home directory
still use ~/.flycast or ~/.reicast if found for backward-compatibility
Issue #336
2021-10-27 12:22:24 +02:00
LaercioMBR 004250ed23 InputDescriptors for radirgyn and mamonoro 2021-10-24 14:07:40 +02:00
Flyinghead 037339f3be ggpo: savestate md5 wasn't computed 2021-10-21 12:03:04 +02:00
Flyinghead e0437ab447 msvc fix 2021-10-20 15:28:34 +02:00
Flyinghead 808a161d39 ggpo: make chat thread-safe. Deadlock on early rollback
Make ggpo_send_message() thread-safe
Deadlock UI/emu threads if rollback happens before first render
Disable rollback wait in single-thread mode
2021-10-20 14:41:18 +02:00
LaercioMBR 6d8e1794a0 Fix Metal Slug 6 inputs (#393) 2021-10-20 14:36:02 +02:00
Flyinghead 89338c0b4b win32 build fix 2021-10-19 17:24:17 +02:00
Flyinghead 7f7cbd5666 missing change 2021-10-19 17:05:00 +02:00
LaercioMBR 846ed76808 InputDescriptors for Dolphin Blue, Demolish Fist and ggx15 2021-10-19 17:02:01 +02:00
Flyinghead ab45b5ec8a ggpo: keyboard/mouse games support. Fix chat when keyboard disabled
ggpo: support for arcade games using keyboard (totd, luptype) and
mouse/rotary encoders (waiwai drive)
Chat and UI now usable when the keyboard is not set to a maple port.
2021-10-19 16:56:46 +02:00
Flyinghead db93a4c4a7 ggpo: in-game chat
use menu key to open/close chat window
disable keyboard/mouse controllers when using chat
disabled controllers can now use emu keys (menu, escape, ff)
2021-10-18 16:40:17 +02:00
Flyinghead 59566eb363 ggpo: support application messages 2021-10-18 16:26:24 +02:00
LaercioMBR 7fb85e5b25 Standardizing InputDescriptors names, added kov7sprt_inputs (#389) 2021-10-18 11:24:38 +02:00
Flyinghead c061912574 android: fix hang when mount returns too much data
Issue #387
2021-10-16 18:16:17 +02:00
Flyinghead 3eeb7e7cae build fix 2021-10-16 18:15:11 +02:00
Flyinghead cf653640b3 ggpo: verify md5 of bios, game and savestate
Verify md5 of flash, eeprom, vmus if no savestate used
Use chd header SHA1 as digest
Load .state.net state file at start

Force real BIOS for some games
2021-10-16 17:56:21 +02:00
Flyinghead 5cfd897298 android: more activity init logs 2021-10-15 13:14:42 +02:00
Flyinghead 7ecb6a6d96 ggpo: Fix udp packet size. Fix verif mismatch due to uninit'ed var 2021-10-15 13:07:21 +02:00
Flyinghead c08f177d3b libretro build fix 2021-10-14 11:51:39 +02:00
Flyinghead 1c6e722961 android: add app external & internal files dir. Race condition at start
Fix crash at startup due to race condition with game scanner
Don't allow selection of non-writable folder during onboarding
Add private internal and external Files folders to list of storage
locations to choose from
Assign first external android gamepad to port A instead of B

ui: Fix layout of controller mapping dialog when port=All
2021-10-14 11:39:27 +02:00
Flyinghead 0d49817f00 fix crash when [config]pvr.rend is invalid for the current platform 2021-10-14 10:52:35 +02:00
Flyinghead 85c21df5e7 Use allocAligned/freeAligned for all aligned allocs 2021-10-14 10:46:44 +02:00
Flyinghead f9d5b8eb74 ui: limit max scaling on small low-res screens (<= 640x480) 2021-10-12 17:34:42 +02:00
Flyinghead bcc3337c58 cheats: support for bit-level RA codes
log start of address space, RAM, VRAM, audio RAM at boot
fix add cheat dialog layout
don't crash on wrong gdrom unlock code
2021-10-12 17:28:01 +02:00
Flyinghead 163888f329 GameShark cheat codes support 2021-10-10 17:24:17 +02:00
Flyinghead 8b986dfab3 vmu beep support 2021-10-10 16:33:37 +02:00
Flyinghead 19bd6d0bca test automation clean up
less #ifdef
force mute audio
don't force vsync
2021-10-10 16:26:36 +02:00
Flyinghead c2caef4ad5 ui: use SDL clipboard functions for imgui
allow cut & paste on linux
2021-10-07 19:14:29 +02:00
Flyinghead 1d9ac4918c pvr: fix SPG_VBLANK_INT reset value 2021-10-07 16:24:00 +02:00
Flyinghead bc3be1029c fix sh4 scheduler. use common cycle counter in sh4 context
scheduler reset and unregister
schedule requests during reset(), not init()
preserve cntx.sh4_sched_next on sh4 reset
Use cntx.cycle_counter in dynarecs and interpreter
Fixes Confidential Mission hang at boot with HLE
2021-10-07 16:18:32 +02:00
Flyinghead bc238de5ce switch: open 4 controllers. android: java7 compatibility 2021-10-06 18:55:04 +02:00
Flyinghead 1072235b1a lua: ui bindings 2021-10-04 19:42:45 +02:00
Flyinghead 3c2c7b379d ggpo: pair with first received sync request if remote IP not specified 2021-10-04 19:38:33 +02:00
Flyinghead 4af194035c win: fix binary s3 upload 2021-10-04 19:21:18 +02:00
Flyinghead 3171cfd381 win: fix binary s3 upload 2021-10-03 21:46:37 +02:00
Flyinghead 8183bf7f95 linux build fix 2021-10-03 20:42:25 +02:00
flyinghead 82bec1e324 lua: build fix for linux and win. dx9: crash on exit 2021-10-03 20:22:52 +02:00
Flyinghead 897cc01f93 some lua bindings 2021-10-03 18:34:27 +02:00
Flyinghead 5bcfa35737 Better background game loader
Pass LoadProgress object to report load progress and cancel
Better UI
Cancel with exception
Fix issues when stopping/exiting in !threaded
dx9: call gui_term on shutdown
2021-10-02 11:30:40 +02:00
Flyinghead c1bcf91dd6 pvr: render timeout when using ggpo or !threaded
will cause ggpo desyncs with previous versions
2021-10-01 16:48:01 +02:00
Flyinghead 621e4d196e crash when enabling bba per-game 2021-10-01 16:14:27 +02:00
Flyinghead 45ebc2239f ggpo: exchange verification data during sync 2021-10-01 16:07:32 +02:00
Flyinghead a6248905a0 ggpo: report UDP bind error. Better error reporting for net init
fix ggpo lib warnings
2021-09-30 17:24:51 +02:00
Flyinghead 699dcdaf5b Merge remote-tracking branch 'origin/master' into net-rollback
# Conflicts:
#	core/hw/maple/maple_if.cpp
#	core/rend/mainui.cpp
#	shell/libretro/libretro.cpp
2021-09-30 15:03:29 +02:00
Flyinghead 23d1f6b507 imgui: bug when drag scrolling in a combo's popup 2021-09-30 14:36:29 +02:00
Flyinghead f72f4c49fb macos: fix freeze in !threaded. input: fix crash when saving mapping
audiostream: delete legacy [audio]disable option
2021-09-30 14:31:51 +02:00
Flyinghead 2803ee8274 imgread.ImagePath clean up. ggpo: poll input late if !thread 2021-09-30 14:24:17 +02:00
Flyinghead 0d2e6f5e98 remove safe mode/div matching option
mismatched delete/free() in TexCache.cpp
2021-09-29 11:57:51 +02:00
Flyinghead 99bf7f77c4 single-threaded mode. refactoring.
single-threaded mode similar to libretro core
stateful Emulator object
disable memory watcher when !gppo
ggpo: poll input as late as possible in !threaded
2021-09-29 10:22:58 +02:00
Flyinghead 7fe2ab720f refactor screen_width/height 2021-09-27 20:29:23 +02:00
Flyinghead 18cecc8d38 gl,vk: use VO_BORDER_COL for clear color 2021-09-27 13:39:08 +02:00
scribam 5d068fc2d4 Update .gitignore 2021-09-27 11:52:18 +02:00
scribam 84d98763f1 README.md: add Nintendo Switch CI badge 2021-09-27 11:52:18 +02:00
scribam 86356c737c Update man page 2021-09-27 11:52:18 +02:00
scribam 1fa233aae7 Remove makefiles and xcode project files 2021-09-27 11:52:18 +02:00
Flyinghead 1dc01314a1 input: don't poll input on emu thread
fixes device reset errors with dx9 on Alt+Enter and other renderer
crashes
2021-09-27 11:51:39 +02:00
Flyinghead fb40bb22df vk: CommandPool size must be 2. Fix lightgun xhair validation error 2021-09-27 11:19:50 +02:00
Flyinghead 1dc22ec76c sdl: null init sdl_controller 2021-09-26 22:02:21 +02:00
Flyinghead 41ac140076 ggpo: lightgun support for arcade games
ui: display button names in arcade mode only
2021-09-26 21:28:31 +02:00
scribam 4e019cc233 Update issue templates 2021-09-25 16:04:23 +02:00
scribam 36007ceb68 android: update com.android.tools.build:gradle to version 7.0.2 2021-09-25 16:04:15 +02:00
scribam 25fdeac697 cmake: iOS minor fixes 2021-09-25 16:04:05 +02:00
Cameron Bates 07d27edb76 Add more keys, gui hotkey 2021-09-22 20:16:11 +02:00
Flyinghead 39fabf39ae naomi: free play eeprom for many games
inputs for ggx, doa2, toyfight, ausfache
don't label common buttons (coin, test, service, start)
2021-09-22 14:26:13 +02:00
Flyinghead 945a483e9b ggpo: less log 2021-09-22 14:20:55 +02:00
Flyinghead 1725dbfa98 input: fix arcade mode for on-screen gamepads.
Use same layout as gamepad arcade for on-screen gamepads (ABXYRL)
map RT and LT to buttons 5 and 6 in arcade
android: Fix non-working fast-forward button
Use maple port in lastAxisValue state
naomi: use default alienfnt buttons: 1-4
2021-09-21 15:56:01 +02:00
Cameron Bates 67790abf0e [iOS] Update AltKit (#366) 2021-09-21 10:12:19 +02:00
scribam 3ec08f6ae1 ci: simplify C/C++ CI workflow 2021-09-21 10:11:56 +02:00
Flyinghead c419654a11 input: don't register multiple button presses when holding axis
keyboard: map left stick and coin button by default
2021-09-20 14:07:42 +02:00
flyinghead 51ad6094e8 input: fix axis bound to emu buttons 2021-09-20 10:05:13 +02:00
flyinghead 5b7d189058 sdl: fix hat button names 2021-09-19 22:35:23 +02:00
Flyinghead 7d57d55414 iOS build fix 2021-09-19 18:55:09 +02:00
Flyinghead 65956dbc8d input: merge buttons and axes
Default mappings for arcade and console
Default mappings for arcade stick/hitbox
Proper handling of inverted axes
ggpo: automatic analog setting for arcade games
2021-09-19 18:27:21 +02:00
Flyinghead d75072362a vk oit: work around adreno 600 driver regression
Android 11 adreno 600 driver v502: PixelBuffer.pixels.length() is
returning 0 in some cases.

Issue #361
2021-09-18 18:08:52 +02:00
Joshua L 22947af854 Sdl gamecontrollerdb.txt fix (#356)
sdl: load gamecontrollerdb.txt before calling SDL_InitSubSystem
2021-09-18 18:07:07 +02:00
Flyinghead 50a67dbd3e build fix 2021-09-16 20:27:57 +02:00
Flyinghead 7fd954e10d rend: apply vscalefactor to scissor in 240p/480p
fixes SF3 3rd strike half-screen in 240p mode
2021-09-16 19:27:59 +02:00
Flyinghead 4c53fcecfa ggpo: detect input size mismatch and abort gracefully 2021-09-16 19:24:49 +02:00
bslenul 17348dae8a [Libretro] Middle mouse fix 2021-09-15 17:26:01 +02:00
Flyinghead 05d495b282 dx9: Fix RenderLastFrame
Fixes black blackground when opening the menu during a game
2021-09-15 17:24:55 +02:00
Flyinghead 3b7a940e9b android: use list of axes for default mapping and axis handling
Issue #338
2021-09-15 14:44:56 +02:00
Cameron Bates 501c6f260a Remove mouse invert option and invert gcmouse by default 2021-09-14 23:43:16 +02:00
Cameron Bates e1fa2b9831 [iOS] GCMouse support (#353) 2021-09-14 11:51:44 +02:00
Edward Li 043175ae4d Rumble using MacBook's Taptic Engine 2021-09-14 11:44:37 +02:00
Flyinghead 8b266b1327 ggpo: force aica.nobatch 2021-09-13 13:01:52 +02:00
flyinghead f7abe3bb34 Merge pull request #351 from flyinghead/libretro
Merge Libretro branch
2021-09-13 10:03:53 +02:00
Flyinghead 480e85f615 ggpo: UI for analog axes settings. Display stats option 2021-09-12 17:42:58 +02:00
Cameron Bates 0182d1ca09 Add dummy value for ALTDeviceID 2021-09-12 15:59:25 +02:00
Flyinghead 99a0dce8cd arm build fix 2021-09-11 19:17:36 +02:00
Flyinghead badcace987 ggpo: analog axes support. Fix right trigger. use miniupnp.
Analog stick X/Y support
Right trigger was ignored
Forward UDP port 19713 with miniupnp before starting ggpo session
Use recursive_mutex for ggpo
2021-09-11 18:50:11 +02:00
Flyinghead e8b73e22b7 Merge remote-tracking branch 'origin/libretro' into net-rollback 2021-09-11 18:11:36 +02:00
Cameron Bates 45f68d59ff iOS Keyboard Support (#347)
PR adds in support for iOS keyboards using GCKeyboard
2021-09-11 13:08:35 +02:00
Flyinghead 1762987aae reios: reset gdrom state at reset
Fixes "Reboot to BIOS" exception when loading another game
2021-09-11 11:22:58 +02:00
Flyinghead ad2e142b01 ui: Show mouse cursor when emu throws an exception. lr: fix vulkan init 2021-09-10 15:32:13 +02:00
Flyinghead 88fa5d5c41 arm64 dsp: don't JitWriteProtect twice. ios: Hide VSync. pvr: fix mutex 2021-09-10 15:26:18 +02:00
Flyinghead e45ec4324f Merge remote-tracking branch 'origin/master' into libretro 2021-09-10 12:19:29 +02:00
Flyinghead d9a8e29a94 missing change 2021-09-09 18:31:08 +02:00
Flyinghead 3ced57a263 network: use interface for startup. avoid deadlock on exit
Use common interface for naomi and ggpo
Simpler ggpo interface
Fix deadlocks on exit with ggpo
2021-09-09 18:17:05 +02:00
Flyinghead 458868a634 ggpo: always save delta ram. Disable ff,cheats,savestates when online
ggpo: always save delta ram on save_game_state as frames may be rerun
and resaved
Global network online status (ggpo, naomi, modem, bba)
Disable fast forward, cheats and savestates when online.
2021-09-08 17:18:01 +02:00
Flyinghead 7ecc0543f4 ggpo: fix common assert() sync.cpp:238 2021-09-08 16:21:54 +02:00
Flyinghead 6d6f3d38d4 libretro build fix 2021-09-07 17:18:56 +02:00
Flyinghead a4e715fa71 serialize modem, aw coin, pvr direct fb state, TA cur context 2021-09-07 16:43:50 +02:00
Flyinghead 8594d11693 maple: refactor usage of rt/lt. zero out joystick values if ggpo active
Fix mouse cursor being invisible when emu throws an exception
2021-09-07 16:30:56 +02:00
Flyinghead a4c14ebef7 Merge remote-tracking branch 'origin/libretro' into net-rollback 2021-09-07 15:02:39 +02:00
Flyinghead 599874c9c1 dx9: VSync option support 2021-09-07 14:16:05 +02:00
Flyinghead 5121b0df93 maple: mutually exclusive btns per controller. better D2A axes
Handle mutually exclusive buttons (U/D, L/R) in each controller.
Track digital X/Y axes state to allow for proper handling of U+D and
L+R. Issue #334
SDL: Ignore key repeat events
2021-09-07 10:54:00 +02:00
Flyinghead e3a2f1cfbe ggpo: transmit RT and LT as digital inputs 2021-09-06 17:16:41 +02:00
Flyinghead 414fb9dba2 ramwatch: protect all ram, not just the bottom half 2021-09-06 16:14:38 +02:00
Flyinghead a402c69c55 ggpo: detect frame rate and use it to pause when ahead 2021-09-05 20:47:37 +02:00
Flyinghead c007165a0f input: naomi btns 5/6 and 7/8 shouldn't be mutually exclusive 2021-09-05 20:12:40 +02:00
Flyinghead a3d50fc197 Merge remote-tracking branch 'origin/libretro' into net-rollback 2021-09-05 20:07:37 +02:00
flyinghead baa0ac44ca paypalme link 2021-09-05 17:30:26 +02:00
Flyinghead 6768901446 allow semicolon in content paths 2021-09-05 10:30:19 +02:00
Flyinghead 35e77976a6 ui: use input from all keyboards
Issue #339
2021-09-05 10:29:12 +02:00
Enrique Santos dba805e8c4 ggpo: static rtc when ggpo is enabled 2021-09-04 18:47:34 +02:00
Enrique Santos e3aca85efd ggpo: add frame delay to settings (#343) 2021-09-04 18:47:21 +02:00
Flyinghead f35a18bb63 ggpo: use bargraphs for net stats 2021-09-04 12:03:29 +02:00
flyinghead a6ad0208db uTip link 2021-09-03 23:54:40 +02:00
Flyinghead e02ccbf32a gl: update fog and texture palette in Process() 2021-09-03 11:12:47 +02:00
Flyinghead b362a55c04 ggpo: rollback glitches. win32 init. switch build. stats
Block net rollbacks until the current frame has been processed to avoid
glitched textures.
Call WSAStartup at init on windows
Display net stats when in game
Switch build fix
2021-09-03 11:11:46 +02:00
Flyinghead 69d0801121 net rollback with ggpo 2021-09-02 17:51:23 +02:00
flyinghead f85bca06d7 dsp: rec crash on windows 2021-09-02 12:34:38 +02:00
scribam 3589e94121 android: update com.android.tools.build:gradle to version 7.0.1 2021-08-31 17:52:51 +02:00
Flyinghead 2baf2cfed6 ci: always install dx2010 2021-08-30 12:13:52 +02:00
Flyinghead 4d5c93adfa ios: add entitlements and sign IPA with ldid 2021-08-29 11:58:05 +02:00
Flyinghead 93eff7fac6 sh4: fix TMU regression
introduced by 05d51cc35c
fixes SA2 running too fast
2021-08-29 11:55:42 +02:00
scribam ce68a9c708 ci: update switch workflow
Checkout submodules non-recursively
Add ninja to speed up compilation
Simplify some steps
2021-08-29 10:45:47 +02:00
scribam 280dad1c07 ci: update android workflow
Checkout submodules non-recursively
Add ccache to speed up compilation
Use ninja and specify target to build only dump_syms
Use official aws-actions/configure-aws-credentials action and awscli to upload artifacts to s3 bucket
2021-08-29 10:45:47 +02:00
Flyinghead c3d954263b gdrom: fix soft reset. ignore slave requests. Unknown ATA cmds handling
Retain currently inserted disk during soft reset
Correct DriveSelect value. Ignore slave drive commands and return 0
status.
Properly handle unknown ATA commands.
Fixes DreamShell boot and CDI boot from BIOS
2021-08-27 18:29:41 +02:00
Flyinghead e058ba5d3b sh4: always perform hard-reset of sh4 and its registers
Fixes infinite loop after reboot
2021-08-27 18:20:40 +02:00
Flyinghead 05d51cc35c sh4: timer underflow lost if TCOR is 0 or very small
Fixes DreamShell boot
2021-08-27 17:55:50 +02:00
vkedwardli a51f310e96 Add volume slider in audio settings (#329)
Use logarithmic volume scale
2021-08-26 13:30:23 +02:00
Flyinghead 89ccdf2814 rend: better fix to force even width rendering 2021-08-26 13:28:13 +02:00
Flyinghead 52af352fcd input: never load mapping file for !remappable controllers
Fixes android on-screen gamepad not working when a (wrong) mapping file
exists for it.

Issue #325
Issue #330
2021-08-26 13:25:18 +02:00
Flyinghead 088287227e x64 msvc build fix 2021-08-26 11:01:44 +02:00
Flyinghead ad1f9527c1 x86 msvc build fix 2021-08-26 10:34:01 +02:00
Flyinghead ca17717af7 dsp: map TEMP/MEMS/MIXS regs to sh4 and aica address space. Clean up 2021-08-26 10:16:07 +02:00
Flyinghead 2a849ccba5 ui: hide dirs on iOS. Fix home on android. force even width rendering
Hide content and home dirs on iOS
Show home dir and allow change on android
Force even width for rendering resolution
2021-08-26 10:08:50 +02:00
Flyinghead 4bf20846bc iOS: output audio to speakers, not the receiver 2021-08-26 10:02:38 +02:00
Flyinghead ad80184e7f missing cmake change 2021-08-24 20:54:17 +02:00
Flyinghead e5ca63db20 aica: arm32 dsp dynarec. Correct dsp level when dsp disabled 2021-08-24 20:49:53 +02:00
vkedwardli 7a33ae35e0 [macOS] Fix DelayFrameSwapping and optimise Vsync logic (#307)
* Support macOS 10.15 and 11
* Enable VSync option on macOS. Use "swapOnVSync" logic from other wsi
* Limit `mainui_rend_frame()` to 5 iterations max: 4 renders and the final swap
2021-08-24 11:43:19 +02:00
Flyinghead ce58ba3472 pvr: detect swap on FB_R_SOF2 too. Force render res. to even width
Fixes Soul Calibur FPS /2 drop with Delay Frame Swapping on
2021-08-24 11:40:53 +02:00
Flyinghead 43ae2ea5f5 macOS: upgrade SDL to 2.0.16
fixes Xbox series X controller support
2021-08-23 17:56:40 +02:00
Flyinghead 2f03922b43 build fix 2021-08-23 14:25:27 +02:00
Flyinghead 5db2856270 missing changes from previous commit 2021-08-23 14:16:52 +02:00
Flyinghead e3e3229612 iOS: multiple controller/rumble support. GL: fix black screen after RTT
iOS:
* multiple controllers support. Rumble support.
* fix audio recording
* declare CHD/GDI/CUE/CDI content types
* start game when opening file URL
* Use safe area for UI and virtual gamepad
* Better icons
2021-08-23 14:02:12 +02:00
Flyinghead 8b2ed736a6 libretro: fix random shutdown when saving/loading state
Issue #326
2021-08-23 11:29:17 +02:00
Flyinghead 27da5f84c4 cmake: fix miniupnpc name warning
Issue #302
2021-08-23 10:23:04 +02:00
Flyinghead 98d04702ae sdl: set vsync swap interval to 2 for 120 Hz displays
Issue #293
2021-08-23 10:11:04 +02:00
Flyinghead a0664a49d2 ci: install awscli 2021-08-22 21:21:32 +02:00
Flyinghead 55fb0a6efb ci: fix switch s3 upload 2021-08-22 21:00:58 +02:00
Flyinghead 7fb83f4f77 libretro: fix content closing when loading or saving state 2021-08-22 20:41:02 +02:00
scribam 3006cd4f60 .cirrus.yml: update to freebsd-13-0 2021-08-22 11:44:34 +02:00
Flyinghead 970f8c6dcd upload iOS and switch builds to S3 2021-08-20 19:57:20 +02:00
Flyinghead c99de2370f build fix 2021-08-20 08:39:37 +02:00
Flyinghead 8c9ff4a66f iOS: DSP fix 2021-08-20 08:32:29 +02:00
Flyinghead 42eeddcbfb iOS: on-screen gamepad layout fix 2021-08-17 10:13:30 +02:00
Flyinghead 8b0f17fb25 iOS: bundle_version must not be null. Add Document Browser support 2021-08-16 13:09:53 +02:00
Flyinghead a3900495d5 iOS: map menu button to Options, start to Menu. Analog triggers 2021-08-16 11:46:45 +02:00
Flyinghead d7bc1f0f77 apple: disable delay frame swapping, libretro: set base_width/height to 640x480, use gl 3.2 on macOS 2021-08-15 10:50:53 +02:00
scribam 281a04837f switch: simplify standalone build 2021-08-13 08:31:32 +02:00
Flyinghead 3ea688be69 iOS: pause/resume based on focus. autosave state on background. VGamepad fix
Get rid of swipe gesture (fixes touch not being delivered)
Use UP+DOWN or LEFT+RIGHT to open menu.
Arcade shortcuts (RT + A/B/X)
Disable system gestures
Monitor network and restart AltKit as needed.
2021-08-12 11:22:22 +02:00
Flyinghead c27180fb32 android: fix navbar background. Add shortcuts for Coin/Service/Test
Fix black navigation bar background.
Shortcuts for virtual gamepad:
RT + A -> D (Coint)
RT + B -> C (Service)
RT + X -> Z (Test)
Issue #137

Don't deliver mouse clicks if analog triggers or stick are used
2021-08-11 12:58:57 +02:00
Flyinghead 1bea7853ef iOS: CI job, JIT status, touch fixes 2021-08-10 17:04:36 +02:00
Flyinghead 104521517c Build fix 2021-08-10 12:00:05 +02:00
Flyinghead bb217e5c49 iOS: AltKit source 2021-08-10 11:34:11 +02:00
Flyinghead 12f302d356 iOS: uv need high precision in fragment shader. cmake build. virtual joystick. AltKit integration 2021-08-10 11:32:22 +02:00
Edward Li 6f233462c1 Add missing JITWriteProtect to DSP 2021-08-09 09:02:59 +02:00
Flyinghead 77e7c25e9c iOS support. Work in progress 2021-08-06 10:30:30 +02:00
Flyinghead b027a6b9a1 android: add missing oboe lib links 2021-08-05 22:06:32 +02:00
Flyinghead 6bb4575c95 Merge remote-tracking branch 'origin/master' into libretro 2021-08-05 18:17:30 +02:00
Flyinghead 37eace9db4 osx: lockup when emulator aborts. Race condition when starting emu 2021-08-05 17:43:26 +02:00
Flyinghead 0414406471 win32 build fix. disable breakpad on BSD 2021-08-03 11:59:19 +02:00
Flyinghead 8c000f327e missing include 2021-08-03 10:08:13 +02:00
Flyinghead 951e70328f Use exception when load content fails. ui: graceful stop on fatal error
libretro: catch/detect fatal errors and shutdown
2021-08-03 10:05:09 +02:00
Flyinghead 2dd7717128 glGetString(GL_EXTENSIONS) may return null in core contexts
xcode project missing update
2021-08-03 09:49:20 +02:00
Flyinghead 9d6c548730 naomi: close cart on reset. sh4: replace some verify by throw
Close naomi/aw cart on reset. Reset input mapping/button names
Get rid of ngen_GetFeatures()
throw exception instead of failing verify if not internal error
catch sh4 exceptions in dynarecs and throw fatal error
2021-08-03 09:47:13 +02:00
Flyinghead 8a46853dfd lr: deadlock on exit with custom textures (win32)
less log
2021-08-02 12:07:40 +02:00
Flyinghead 789fd21bb7 bsd build fix 2021-08-02 12:05:24 +02:00
Flyinghead 3fa97b5ce7 bsd build fix 2021-08-02 10:20:45 +02:00
Flyinghead c8ebbc657a x86 win32 build fix 2021-08-02 10:09:19 +02:00
Flyinghead b59585437c arm32 dynarec: windows ce support 2021-08-01 17:25:48 +02:00
Flyinghead 6f4e1365b1 x86: stack unwind fixes 2021-08-01 17:07:17 +02:00
scribam fcef404f50 android: update gradle and dependencies 2021-07-30 19:35:07 +02:00
Flyinghead aabb492d01 x86 stack unwinding support (android) 2021-07-30 19:13:52 +02:00
Flyinghead cfa21934bb x64: fix stack unwinding issue. don't save xmm regs on stack 2021-07-30 19:10:34 +02:00
Flyinghead 7561ce753a unwind info for arm64. use static c++ lib for android
include oboe static libs
get rid of old regalloc
2021-07-29 17:46:46 +02:00
Flyinghead 5ac0e58886 android: mouse move events missing when btn down. Mouse wheel support
Issue #304
2021-07-27 10:32:22 +02:00
vkedwardli a14fc35e47 Support Fast Forward in macOS (#303) 2021-07-26 20:36:14 +02:00
Flyinghead 5fd00e3063 specify RelWithDebInfo output dir 2021-07-26 00:13:05 +02:00
Flyinghead a46a012c3c tentative fix against .NET stupidity 2021-07-25 22:42:05 +02:00
Flyinghead 3072105efe github: don't upload symbols for linux 2021-07-25 22:27:17 +02:00
Flyinghead 8f09ac2611 github: don't parameterize shell 2021-07-25 22:22:08 +02:00
Flyinghead e12be7cf29 add breakpad support for android, linux and windown 2021-07-25 21:55:29 +02:00
flyinghead 588d79641a msvc x64 build fix 2021-07-25 11:47:14 +02:00
Flyinghead daac6de533 macos build fix 2021-07-24 23:30:12 +02:00
flyinghead c6d7307efe x86 build fix 2021-07-24 23:17:27 +02:00
Flyinghead 710f379bd3 unwind info for x64 dynarecs
delegate to previous signal handler, proper abort for win32
arm32: use builtin gcc __clear_cache
dyna/driver.cpp: no need for a code buffer in win32, cleanup
2021-07-24 22:24:37 +02:00
vkedwardli e4d9be86b4 Fix cmake macOS ARM not building (#301)
set `CMAKE_OSX_ARCHITECTURES` as Cache Entry
2021-07-24 15:52:56 +02:00
vkedwardli 3c483c61e7 Support Apple Silicon (macOS ARM Universal Binary) (#253)
* Add audio arm64 cpp into Xcode project

* Build universal binary for SDL2 also

* Add vixl aarch64 dependency + build arm64 in cmake

* hardcode pagesize for M1 CPU

* Use `MAP_JIT` and toggle between RX and RW

* add pthread.h for cmake

* Disable audio dynarec temporary

* Enable aica arm dynarec

* Supports `br` with condition

* Dynamic linker flag for libSDL2.a since Homebrew path is different on arm (for xcodeproj)

* Fallback path for Intel

* de-dup for arm64, allow cross compilation on both Intel and Apple Silicon Mac

* Rename WriteProtect() to JITWriteProtect(), Move JITWriteProtect from arm7_rec to arm7_rec_arm64

* Remove CodeCache memset

* Remove keyboard_device.cpp from xcodeproj

* Use hard tab

* Update libchdr to support compiling on M1 (thanks @scribam)
2021-07-23 22:34:12 +02:00
Flyinghead c453d14352 libretro: better error handling. fix reset issue with rotated games
compilation warnings, clean up
2021-07-21 16:19:57 +02:00
Flyinghead de060d66ab don't save flash if no game started. libretro: fix notifications
compilation warnings, non-functional changes
2021-07-20 19:21:11 +02:00
Flyinghead c458a8f5e7 os_[Un]InstallFaultHandler. Uninstall fault handler at shutdown 2021-07-20 13:06:08 +02:00
Flyinghead 4a77f847b4 libretro: fix arcade flash files path. ui: stop spamming dc_stop 2021-07-20 10:06:44 +02:00
Flyinghead edc6474f27 save nvmem/flash files when stopping emu 2021-07-19 18:20:58 +02:00
Flyinghead 117f47e3a2 rend: shader builder utility 2021-07-19 12:49:47 +02:00
Flyinghead 4f11ff76a5 input: don't toggle fastforward when game isn't running
it resets the vulkan swapchain and causes random crashes
2021-07-19 12:10:14 +02:00
Flyinghead 10e97b63be jvs: no default mapping if button is remapped to P1 or P2
fixes jambo down-lever pausing the game
2021-07-19 10:15:24 +02:00
Flyinghead af76a09e03 gl: repeat % operator for printf. remove Switch special case 2021-07-18 18:15:35 +02:00
scribam 147bd8341d android: update compileSdkVersion/targetSdkVersion to version 29 2021-07-17 19:35:14 +02:00
scribam 5c0dd67094 android: cleanup jni files 2021-07-17 19:35:14 +02:00
scribam 49688d6523 android: migrate to androidx 2021-07-17 19:35:14 +02:00
scribam 850f23be82 android: update project files 2021-07-17 19:35:14 +02:00
Flyinghead 9e5769912b gl: workaround nouveau bug (oit). Use float palette coords for switch
Don't switch render type before terminating current one.
2021-07-17 15:53:47 +02:00
Flyinghead ab50bc9936 libretro: VGA cable option shown twice. fix arcade/dc option visibility 2021-07-16 17:41:40 +02:00
Flyinghead a604a3904f win: make sure not to call VirtualAlloc with null during jit alloc 2021-07-16 17:35:29 +02:00
Flyinghead e112f2d8af gl: GLES2 build compatibility 2021-07-15 19:24:56 +02:00
Flyinghead 376d2e1433 libretro: fix keyboard input 2021-07-15 18:44:57 +02:00
Flyinghead ed0caa119a Merge remote-tracking branch 'origin/master' into libretro
# Conflicts:
#	CMakeLists.txt
2021-07-15 18:43:29 +02:00
Flyinghead f768146d8e switch: unneeded init functions. needed exit one 2021-07-15 16:50:54 +02:00
Flyinghead 412083d9ea libretro: blank vmus at unload/reset 2021-07-15 15:43:10 +02:00
Flyinghead 07cdb42ff7 switch: set UI scaling factor depending on docking mode 2021-07-15 14:44:39 +02:00
Flyinghead 1e37e8f333 switch: dsp dynarec fix 2021-07-15 12:24:42 +02:00
Flyinghead 4fa89c4a45 switch: build with miniupnp. set correct window size
organize header
remove unneeded switch-specific code
2021-07-15 12:19:11 +02:00
Flyinghead 0d7a2128b6 libretro: fix 32-bit arm build. delete useless #def in pvr2 filter 2021-07-15 12:06:04 +02:00
scribam 9aa3d8b987 android: do not filter abi, allow x86_64 build 2021-07-15 09:54:41 +02:00
scribam eaf44bc18c android: generate release apk with debug keystore, update ci and gradle 2021-07-15 09:54:41 +02:00
Flyinghead ae33c8de18 sdl: increase audio buffer size. libretro: set PIC option 2021-07-15 00:26:00 +02:00
Flyinghead b12e82c344 libretro: add switch lib as artifact 2021-07-14 22:00:05 +02:00
Flyinghead 8dee648d01 arm64 rec: put ngen_FailedToFindBlock at a fixed address
transitioning to MMU will fail it this function's address changes
happens if vmem is disabled (switch)
2021-07-14 21:03:02 +02:00
Flyinghead 8e6dc54b16 switch: add .. entry to folder chooser. start at / 2021-07-14 20:55:22 +02:00
Flyinghead db9c48b085 switch: typo 2021-07-14 17:48:41 +02:00
Flyinghead c0171f5fd1 switch: open sdl joysticks 0 & 1 at init 2021-07-14 17:22:17 +02:00
Flyinghead 9a5a55d074 switch: use /flycast as config folder 2021-07-14 16:38:12 +02:00
Flyinghead 855836d9aa switch: arm rec EntryPoints need rx. fix arm & dsp cache flush 2021-07-14 14:57:43 +02:00
Flyinghead 8a0a0bcdfc switch: use 256x256 jpeg as app icon 2021-07-14 13:57:40 +02:00
Flyinghead 43c00568c6 switch: standalone build 2021-07-14 13:02:57 +02:00
Flyinghead 31be731de0 input: fix atomiswave keyboard bindings 2021-07-14 09:42:13 +02:00
Flyinghead 113ef66e26 libretro: use HAVE_LIBNX in libretro-common 2021-07-13 21:06:03 +02:00
Flyinghead 4d38e69f63 lr switch: enable aica arm and dsp dynarecs. handle rw/rx offset 2021-07-13 20:51:17 +02:00
Flyinghead 8c02345dfd lr switch: use toolchain ar. really disable lto 2021-07-13 19:18:36 +02:00
Flyinghead a2efde1103 libretro: more switch fixes
combine all static libraries into one
save/restore gl state in !threaded mode
patch libchdr
build fixes
2021-07-13 18:51:40 +02:00
Flyinghead eb81583d9f sh4 dyna: support for !vmem 2021-07-13 17:09:26 +02:00
Flyinghead 44213bf830 lr: fix res change for rotated games. display version. vmem: simplify 2021-07-13 13:45:01 +02:00
scribam f187f77e3d Add basic GitHub Actions for Libretro Nintendo Switch 2021-07-12 22:22:07 +02:00
Flyinghead 63a3f02368 libretro: better switch support 2021-07-12 20:14:21 +02:00
Flyinghead 994e6826b4 libretro: option changes (resolution, widescreen, rotation)
Use RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO or
RETRO_ENVIRONMENT_SET_GEOMETRY to report resolution/aspect ratio
changes.
Handle rotation without restarting.
2021-07-12 09:57:58 +02:00
Flyinghead 97991fd8fc gl: delete libretro vmu and crosshair textures when terminating 2021-07-11 20:43:04 +02:00
Flyinghead 1fdda98d8d libretro: return max savestate size. unprotect ram and vram on reset
fixes random crash when saving state
2021-07-11 17:42:30 +02:00
Flyinghead a73ca94124 savestate: push vmu lcd image when loading 2021-07-11 12:37:21 +02:00
Flyinghead 82d2aa8a47 savestate: fix test 2021-07-10 19:30:13 +02:00
Flyinghead 75af07331a savestate: save gdrom read buffer. other fixes
Issue #294
2021-07-10 19:16:19 +02:00
Flyinghead 4be4ad07f3 libretro: m3u playlists 2021-07-10 18:00:21 +02:00
Flyinghead 57874a9bcb libretro: savestate compatibility. B1/D1 vmus now visible 2021-07-10 17:39:16 +02:00
Flyinghead ec7968b2f4 libretro: Reset. Reso not applied (vk). xhair always displayed (vk).
Fix Content Reset crash
Render resolution not set at startup with vulkan !threaded
vk: Crosshair always displayed (white) even when off
Better handling of multiple render (rend_single_frame returns false)
2021-07-09 18:17:14 +02:00
Flyinghead 81546fe727 libretro: handle ThreadedRendering transition. Fix hang in !threaded 2021-07-09 16:28:28 +02:00
Flyinghead 7948bac6ba libretro: fix per-game VMU A1 option 2021-07-09 16:23:46 +02:00
Flyinghead eceb5ba982 naomi: keyboard needs player number 2021-07-09 14:34:11 +02:00
Flyinghead 345dab9633 libretro: fix nvidia palette issue. request 3.2 to get a core gl ctx 2021-07-09 13:10:30 +02:00
Flyinghead 5c952021b7 libretro: vmu and crosshair display. lightgun fixes 2021-07-08 20:09:09 +02:00
Flyinghead 80a5b44fe9 enable vulkan in lr ci builds 2021-07-08 12:52:00 +02:00
Flyinghead b66e6560ca libretro: vulkan support 2021-07-08 12:47:00 +02:00
Flyinghead 673c2988d6 libretro: backport libnx support. Fix log source paths 2021-07-07 19:01:37 +02:00
Flyinghead 042f2e0224 custom textures: saturate colors when dumping RGBA4444 and RGBA5551 2021-07-07 17:19:13 +02:00
Flyinghead b300bb9f7a libretro: non-threaded rendering 2021-07-07 13:12:16 +02:00
Flyinghead 205f2690d6 gl4: delete fog & palette textures when terminating
fixes fullscreen toggle screen corruption
2021-07-07 10:54:10 +02:00
scribam aeea301ee3 Minor include header changes 2021-07-07 10:37:11 +02:00
Flyinghead 8e6bbed74f libretro: aw coin fix. screen rotation. disable loading notifications 2021-07-07 09:48:10 +02:00
flyinghead ef506d49aa libretro: pvr2 postprocessing filter 2021-07-06 21:37:47 +02:00
flyinghead c205a888a9 options: anisotropic filtering, oit pixel buffer size, fast gdrom load 2021-07-06 16:19:12 +02:00
flyinghead a3b66aec1f libretro: win32 support. build fix. 2021-07-06 13:22:54 +02:00
Flyinghead 68f4c50bd3 missing change 2021-07-05 19:48:49 +02:00
Flyinghead 7dbd79750c WIP libretro core update 2021-07-05 19:44:08 +02:00
Flyinghead fd301186c7 android: avoid duplicates in controllers list 2021-07-05 19:26:57 +02:00
Flyinghead b40328e621 input: don't change mapper if file not found. sdl: fix default bindings 2021-07-05 09:59:46 +02:00
flyinghead 7cd832e914 input: use default mapping if no mapping file is found 2021-07-04 23:27:29 +02:00
flyinghead 44feea4c01 Merge pull request #288 from flyinghead/fh/directx
DirectX9 renderer
2021-07-04 18:35:19 +02:00
flyinghead c5ce475359 Merge remote-tracking branch 'origin/master' into fh/directx
# Conflicts:
#	core/input/gamepad_device.cpp
2021-07-04 17:53:49 +02:00
flyinghead 894a0540b9 sdl: convert keyboard mapping from keycodes to scancode on first load 2021-07-04 17:45:45 +02:00
flyinghead 967f4570ed rawinput: simplify USB device names 2021-07-04 15:51:33 +02:00
Flyinghead 14360beaf7 gdrom: reset registers and state on reset
Issue #281
2021-06-27 12:53:54 +02:00
Enrique Santos 46e3258629 Controller Mapping: System Profiles & Unmap Button (#269)
* add unmap button
* separate controller profiles for dc & arcade games
* loads current system mapping on menu exit
* simplify, use default filename for dc controls
* create blank mapping file for sdl controllers if not found
2021-06-27 12:49:47 +02:00
Flyinghead b3ad0a62c1 gl: fix multiple rendering with GLES 2
fixes split-screen multiplayer for SW1 Racer, Q3, Re-volt
2021-06-19 10:48:32 +02:00
scribam a5edd9c7ff deps: remove crypto folder (unused) 2021-06-19 10:46:22 +02:00
Flyinghead 7f49accc22 Merge remote-tracking branch 'origin/master' into fh/directx 2021-06-07 20:53:31 +02:00
Flyinghead b8c2a695b8 ui: allow drag scrolling anywhere. change some ui elements
allow scrolling by dragging (almost) anywhere
move physical devices before dreamcast ones
hide insets when displaying full screen window
reduce scroll bar size on android
fix controller mapping column sizes
2021-06-07 12:18:05 +02:00
Flyinghead c73bbc85bd savestate: rzip size must be 64-bit on all platforms 2021-06-06 11:18:42 +02:00
scribam d6545b253b Misc cleanup 2021-06-06 11:15:06 +02:00
Flyinghead 293761bdf5 gui: separate auto-load and auto-save options. Fix tool tips on android 2021-06-04 11:11:23 +02:00
scribam d862453956 github actions: authorize aws actions on main repository only 2021-06-04 11:08:30 +02:00
Flyinghead 58974c9305 savestate slots 2021-06-03 13:50:40 +02:00
keita yoshimoto cddb6609f1 Multiple save states (#248) 2021-06-03 13:22:40 +02:00
scribam 4a9c51a6c8 github actions: remove flac installation from macos 2021-05-31 23:24:43 +02:00
scribam 329ae11d2f Remove snap configuration file 2021-05-31 23:24:33 +02:00
Flyinghead c3bc5cfc3b vk oit: use a 2nd depth attachment for subpass 1
subpass 1 needs writable depth buffer (see
9f60c5e854)
2021-05-30 18:20:04 +02:00
scribam 24f9003cd3 cirrus ci: add ccache support 2021-05-29 14:32:06 +02:00
scribam 4c2bf59c46 github actions: extend cache for Android build 2021-05-29 14:32:06 +02:00
scribam 642a89733b ci: remove flac package 2021-05-29 14:13:05 +02:00
scribam 2b3d9427e1 .cirrus.yml: use CIRRUS_CLONE_SUBMODULES to checkout submodules 2021-05-29 14:12:51 +02:00
scribam 6368241b77 cmake: fix compilation on FreeBSD 2021-05-29 14:12:51 +02:00
scribam 57ae9022dd Update Windows resource and version.h.in files 2021-05-28 14:56:04 +02:00
Flyinghead d6e15544bc maple: better vmu I/O error handling 2021-05-28 10:35:44 +02:00
Edward Li 3eeab5b74a Force cmake to add rpath to support macOS without Swift 5 Runtime Library (prior to 10.14.4) 2021-05-28 10:35:17 +02:00
flyinghead 7ed68952ba Merge remote-tracking branch 'origin/master' into fh/directx
# Conflicts:
#	core/deps/patches/SDL.patch
#	core/hw/maple/maple_devs.cpp
#	core/rend/gl4/gles.cpp
#	core/rend/gles/gles.cpp
#	core/rend/gui.cpp
#	core/rend/gui.h
#	shell/apple/emulator-osx/reicast-osx.xcodeproj/project.pbxproj
2021-05-26 22:38:48 +02:00
flyinghead 4696733eb4 dx9: linear filtering for fog texture. swap only when frame rendered 2021-05-26 21:40:43 +02:00
Flyinghead 86d014c3e4 gl: crash when rtt copy to vram due to wrong pbo size
fixes Baldr Force crash
2021-05-26 09:53:29 +02:00
Flyinghead 35d3a0362d some sh4 tests 2021-05-26 09:51:41 +02:00
Flyinghead 9f60c5e854 rend: PT alpha must be set before shading
Fixes Langrisser Millennium intro fmv and title/main screen. Issue #249
vk oit: use depth buffer like gl oit
2021-05-25 14:15:37 +02:00
Flyinghead 9564a947e8 ci: don't init aws creds for pull requests 2021-05-25 13:45:09 +02:00
Edward Li 878fbedcbe Use capitalized file name for GitHub CI also 2021-05-25 13:44:02 +02:00
vkedwardli 2b62f8c607 Fix macOS cmake & Xcode project (#255)
* Update zlib reference for Xcode project

* Add CoreHaptics.framework for Xcode project

* Capitalize app bundle

* Use local FindSDL2.cmake script for macOS

* Use `macOS` instead of the old `OSX`
2021-05-25 10:11:58 +02:00
scribam fa217e4cd0 ioctl: replace SCSIDEFS.h with Windows headers 2021-05-25 10:10:50 +02:00
flyinghead 6d32ad2ac8 Use github actions for all ci jobs. Only build with cmake (#251)
* osx: bundle id change com.reicast -> com.flyinghead
* use gh actions for all ci jobs
* cmake: strip executable
2021-05-24 11:03:15 +02:00
Flyinghead d29d43e5d6 fix appveyor build 2021-05-22 18:50:55 +02:00
Flyinghead 6cd99da6df init git submodules 2021-05-22 18:47:47 +02:00
Flyinghead 54c492cac6 Use libchdr as git submodule. bump to latest version 2021-05-22 17:52:17 +02:00
Flyinghead 628b7b7dd9 reios: fix wince cdi loading. implement bios misc 0 call. 2021-05-22 17:26:01 +02:00
flyinghead c44493cd8a Merge pull request #246 from scribam/xbyak
deps: update xbyak
2021-05-22 15:11:32 +02:00
flyinghead d36960bb03 Merge pull request #245 from scribam/cmake-sdl-ninja
cmake: fix sdl compilation with Ninja + MSVC
2021-05-22 15:11:21 +02:00
scribam 20b838b968 deps: update xbyak 2021-05-22 10:45:50 +02:00
scribam 741b21f508 cmake: fix sdl compilation with Ninja + MSVC 2021-05-21 21:46:11 +02:00
Flyinghead c68f3bcc42 network: hide miniupnpc behind a #def. use static buffer for udp data 2021-05-21 12:51:29 +02:00
Flyinghead 4cced8ffa0 android: add content path ui too wide when inset present 2021-05-20 10:45:12 +02:00
Flyinghead 8644f7777b gdrom: remove PatchRegion support. minor log changes 2021-05-20 10:21:47 +02:00
flyinghead 5f5d31730c sdl: hide mouse in fullscreen. fix & refactor mouse devices
support rawinput mouse wheel
simplify mapping load
2021-05-19 18:13:52 +02:00
Flyinghead 9d4711a95d mouse fix
fixes Silent Scope, Dreamkey, etc.
2021-05-19 11:32:38 +02:00
Flyinghead 041e29d1ae gh action: fix macos build 2021-05-19 11:29:38 +02:00
Flyinghead 3a1ae0db00 mmu: fix macos crash. only flush user mem in address lut
force rtt2vram for JSR (custom graffiti)
clean up vmem32 remains
missing host_context.h change
gh action: build sdl from source on macos
2021-05-18 12:53:14 +02:00
Flyinghead a56f45af98 macos: build sdl from source to avoid high sierra crash 2021-05-17 19:08:37 +02:00
flyinghead 7eabf0d43c Merge pull request #240 from vkedwardli/fix-macos-crash
Fix macos crash
2021-05-17 14:03:47 +02:00
Edward Li eb5a3bfd01 spacing 2021-05-17 19:56:28 +08:00
Edward Li 2d2ab0b99a Fix macOS crash 2021-05-17 19:56:09 +08:00
Flyinghead f616fe25bb fix macos project 2021-05-17 12:08:56 +02:00
Flyinghead f6114f4c93 missing change 2021-05-17 12:05:59 +02:00
Flyinghead 373dffc65a wince: ditch vmem32. use address LUT in dynarec. finer grained flush 2021-05-17 11:59:34 +02:00
Flyinghead 00a74d81c2 aica arm dynarec: conditional LDR with write back issue 2021-05-16 20:21:09 +02:00
Flyinghead da40297810 fix msvc build 2021-05-16 20:18:49 +02:00
Flyinghead 0966a092af gdrom: disable bios region patching
Issue #239
https://github.com/libretro/flycast/issues/888
2021-05-16 20:17:54 +02:00
Flyinghead 025b447a9c arm32: replace old arm emitter with vixl 2021-05-15 11:41:00 +02:00
Flyinghead 92abf760de unneeded address/value masking. clean up 2021-05-14 21:47:47 +02:00
Flyinghead 2e0c15bae7 sdl: fix audio recording 2021-05-14 19:04:54 +02:00
Flyinghead 1464c02903 mmu: add address cache to mem slow path. better fastmmu hashtable.
mmu: add address cache to Read/WriteMemNoEx
fastmmu: ignore 1k pages. optimize hashtable
get rid of NO_MMU
2021-05-14 19:03:57 +02:00
flyinghead 23f483cd01 Merge pull request #237 from vkedwardli/fix-macos-multiple-instance
Fix macOS multiple instance
2021-05-12 17:32:50 +02:00
flyinghead 65fe71341a Merge pull request #234 from vkedwardli/fix-macos-imac5k
Get the largest size even if kDisplayModeNativeFlag is not present
2021-05-12 17:32:39 +02:00
Edward Li aae3ae988f change to com.flyinghead for Xcode project 2021-05-12 03:52:33 +08:00
Edward Li 36576713af Using the correct identifier for instance count 2021-05-12 03:51:50 +08:00
Flyinghead d7ec3bec1d android: upgrade ifaddrs.c 2021-05-11 16:49:18 +02:00
Flyinghead 5769d7e64f vk: typo in previous commit height -> width 2021-05-11 16:47:54 +02:00
Flyinghead 0df6a686d9 oboe: limit min buffer size. keep default for medium/high latency 2021-05-11 16:47:05 +02:00
Flyinghead 095c6d2adc flatpak: prefer non-default gpu. Update app summary 2021-05-11 10:39:46 +02:00
Flyinghead 408c65fcbf gl4: pack/unpack pixel colors. pack poly params. share GLSL with vk 2021-05-11 10:38:17 +02:00
Flyinghead b27fa63aea stack overflow with xdp browser on android 2021-05-10 23:28:58 +02:00
Flyinghead fb38b224f4 rend: get rid of RenderToTextureUpscale option. Use RenderResolution 2021-05-10 20:07:23 +02:00
Flyinghead a4019dd205 new VSync option 2021-05-10 18:02:06 +02:00
Flyinghead e07977eea9 mac,x11: propagate win/sdl mouse/keyboard changes 2021-05-10 13:48:12 +02:00
Edward Li b56c5b1c51 Get the largest size even if kDisplayModeNativeFlag is not present 2021-05-06 06:57:21 +08:00
Flyinghead d7fd6658f6 egl: request 8 bits RGB channels 2021-05-05 13:31:52 +02:00
flyinghead 71fb024061 rawinput: proper conversion of abs coordinates
Issue #138
get rid of libPvr_GetRenderTarget() -> getNativeHwnd()
2021-05-04 12:03:09 +02:00
Flyinghead d0659521eb android: remove old java gl activity and unused code 2021-05-03 10:05:17 +02:00
Flyinghead affc9f262c gl: update palette on context [re]init
backport from fh/directx
fixes black textures in SoulCalibur when switching back to app (android)
2021-05-03 09:57:45 +02:00
Flyinghead f2b74de9dd Revert 1ddb82f334
Issue #209
2021-05-02 15:14:26 +02:00
Flyinghead d20fc971c9 android: display cutouts support. render last frame when editing vjoy
render in display cutouts
gl/vk: render last frame when editing virtual gamepad
gl: Fix background handling
gui: reset vmus when stopping game
2021-05-02 11:31:44 +02:00
Flyinghead 1ddb82f334 pvr: deadlock in QueueRender/dc_stop 2021-05-02 11:23:51 +02:00
Flyinghead 5dd15e2942 android: oboe driver error handling. Set buffer size to burst size
oboe: handle lost of audio and recording streams and attempt reopen.
When using aaudio, set the oboe buffer size to the burst size.
gui: really ignore AutomaticLatency for oboe driver

Issue #182
2021-05-01 12:19:04 +02:00
Flyinghead 6dfa9f7786 android: oboe audio driver. get rid of build variants
Issue #182
2021-04-30 19:57:11 +02:00
Flyinghead acd8620139 android: add zh_HK locale 2021-04-30 18:26:35 +02:00
flyinghead 54cfc6e09b build fix for non-windows 2021-04-29 19:15:34 +02:00
Flyinghead 150cfa29e7 Merge remote-tracking branch 'origin/master' into fh/directx 2021-04-29 19:06:38 +02:00
flyinghead b90cdf9588 RawInput driver. Multiple keyboards support
Merge Keyboard and KbGamepad
Always use system mouse for UI
Issue #138

Fix DX9 when not using SDL
2021-04-29 18:58:04 +02:00
flyinghead 6316479930 get rid of unneeded pixel unpacker and use better name 2021-04-29 18:38:58 +02:00
Flyinghead 92ccd6eb26 android: load Asian glyphs depending on locale
Issue #225
2021-04-22 11:12:51 +02:00
Flyinghead 805dac3039 Resize renderer after [re]init
Fixes crash on Android when app is brought back to the foreground
Issue #228
2021-04-22 10:59:40 +02:00
flyinghead 5f665fb82a Merge pull request #227 from vkedwardli/fix-content-path-warning
Re-enable the content path warning dialog
2021-04-21 20:43:09 +02:00
Edward Li 2bd77ba9c4 missing a space 2021-04-22 02:21:04 +08:00
Edward Li ba955f6659 Re-enable the content path warning dialog 2021-04-22 02:17:18 +08:00
Edward Li 01898d5f41 Fix scanner cannot be stopped 2021-04-22 02:16:18 +08:00
Flyinghead a9e22c2e20 Can't pass an intent URL to app in android < 6
Issue #226
2021-04-20 16:58:43 +02:00
Flyinghead 3dd3595a79 disable emulator Exit on android
Issue #222
2021-04-20 16:32:49 +02:00
Flyinghead c0b5721920 Super widescreen option
Issue #209
2021-04-20 16:06:03 +02:00
Flyinghead 44fd67ffd2 In command line mode, exit the emulator when pressing Exit
Issue #222
2021-04-20 15:57:30 +02:00
Flyinghead 3474901e58 wsi: swap immediately when fast forwarding 2021-04-20 10:56:49 +02:00
Flyinghead d55a26c242 flatpak: better screenshots. Indicate where to put BIOS files. 2021-04-19 19:12:00 +02:00
flyinghead e04516f7b3 Merge pull request #224 from j8r/improve-readme
Improve Readme
2021-04-19 15:44:51 +02:00
Julien Reichardt 1ec154ec77 Add Flatpak installation guide 2021-04-19 11:28:56 +02:00
Julien Reichardt c90073572b Add CI badges 2021-04-19 11:26:24 +02:00
Julien Reichardt 5eba9f72fb Enhance markdown sections 2021-04-19 11:26:08 +02:00
flyinghead 8909368033 dsound: dedicated audio thread. configurable latency
Use dedicated thread to fill the audio buffer, fill with silence when
underrun, wait for notification events instead of busy loop.
Configurable ring buffer size / latency.
2021-04-19 11:13:27 +02:00
flyinghead 4ffb9e8089 sdl audio: potential race condition with event. include in win32 build 2021-04-19 11:09:16 +02:00
flyinghead 098be9c69e sdl: swap at vsync interval for open gl 2021-04-19 09:51:13 +02:00
flyinghead f9603dc11a vk: use texture pointers instead of u64 2021-04-17 19:04:00 +02:00
flyinghead 5359e9a09d allow gpu-handled palette textures to be replaced by custom version
Issue #219
Fix incorrect texture size calculation for VQ textures.
Reorder BaseTextureCacheData fields to have hottest on top
2021-04-17 18:40:58 +02:00
flyinghead d11055cef2 Merge pull request #221 from j8r/add-appstream-metadata-file
Add Appstream metadata file
2021-04-17 15:20:00 +02:00
flyinghead 28d2c6db73 dx9: rotate 90deg 2021-04-16 21:58:37 +02:00
flyinghead abc8b18b78 dx9: mipmaps. load/dump textures. vmu/crosshair display.
upload all texture mipmaps to gpu
dump textures. load custom textures
vmu and lightgun xhair display
fix dx9 half-pixel offset
fix 565_32 unpacker bug
2021-04-16 18:30:47 +02:00
Julien Reichardt 68111e2932 Add Appstream metadata file
Required for Flatpak.
Relates to https://github.com/flyinghead/flycast/issues/218.
2021-04-15 22:44:40 +02:00
flyinghead c889bfa6d4 dx9: copy to vram. clipping. fix depth/stencil size. better reset
Coordinate device reset with dxcontext. Keep compiled shaders.
Don't use automatic depth/stencil on backbuffer. Manually handle it.
Implement scissoring/clipping
multipass translucent depth
Render-to-texture copy to vram
2021-04-15 15:17:32 +02:00
flyinghead f2a0098fed build fix 2 2021-04-13 12:22:01 +02:00
flyinghead b549c56b23 build fix. default Delay Frame Swapping to true 2021-04-13 11:20:11 +02:00
flyinghead f107d380b9 WIP directx9 renderer 2021-04-12 22:49:04 +02:00
Flyinghead 4a8ce39bfd vk: use a single command buffer for all texture updates 2021-04-08 10:38:26 +02:00
Flyinghead 499d06ea83 bba: crash when loading a savestate with bba disabled 2021-04-08 10:33:47 +02:00
Flyinghead 24d172bd51 gl: use async PBO to copy texture back to vram 2021-04-08 10:33:14 +02:00
Flyinghead 72968290bf cheats: support for .CHT cheat files
Issue #167
gui: no need to save background in opengl, use RenderLastFrame instead
disable cheats when online
2021-04-06 11:41:41 +02:00
flyinghead 2fa3cfea8d Merge pull request #216 from scribam/windows-icon
windows: add missing icon in top-left corner of the windows when sdl is not used
2021-04-05 17:06:07 +02:00
flyinghead 6438747649 Merge pull request #215 from scribam/submodule-sdl
deps: use official SDL url for submodule
2021-04-05 17:05:57 +02:00
scribam 90de080eba windows: add missing icon in top-left corner of the windows when sdl is not used 2021-04-05 11:01:38 +02:00
scribam e6a49ca4ec deps: use official SDL url for submodule 2021-04-04 15:38:37 +02:00
Flyinghead 87f6bf2d77 reicast -> flycast 2021-04-04 13:35:11 +02:00
Flyinghead b3de6a166d area 7 access to sh4 mm registers only through mmu translation
on-chip ram area isn't translated in both user and supervisor modes
vmem: return 0 for non-mapped region reads
Fixes dolphin blue crash/freeze. Issue #62
Fixes Resident Evil - Code Veronica X (Chris) floor 1F crash
2021-04-01 13:30:37 +02:00
Flyinghead 4d815570d0 sh4: define SCI module registers 2021-03-31 19:01:31 +02:00
Flyinghead 3ff457f4e8 always log notice/warn/error messages 2021-03-31 18:47:18 +02:00
Flyinghead 6af509159e optimize area0 mem handlers
use flash_size for both sram (aw, naomi) and flash (dc)
bios and flash not mirrored to 02000000
2021-03-31 18:45:46 +02:00
flyinghead a8929170f3 up sh4 context pad to 64k to keep windows happy 2021-03-29 21:12:43 +02:00
Flyinghead a5eecf59b3 x64 rec: wrong arg0 reg for windows. need to handle 512mb addr space 2021-03-29 17:30:56 +02:00
Flyinghead a7d8d31566 double-free when opening corrupted chd. Better error message
Avoid vk/gl/vk quick switching
2021-03-29 16:26:18 +02:00
Flyinghead 904bed862e arm32: store queue dynarec optim. ditch Unstable Optimizations
shrink Sh4Context.pad size except on arm32
reset sh4 before mem to unlock ram
2021-03-29 14:26:55 +02:00
Flyinghead 65290a70f3 x64/x86: store queue dynarec optimization 2021-03-29 14:26:55 +02:00
Flyinghead e2f309b5cc arm64: store queue write dynarec optimization 2021-03-29 14:26:55 +02:00
Flyinghead ed25d45adb arm32 rec: wrong operand size for immediate mem write
Issue #208
2021-03-29 14:20:42 +02:00
Flyinghead f1b4b78e4c savestate: edge case leading to i/o error on load 2021-03-28 20:09:59 +02:00
Flyinghead 9e9aa5b4d9 gl: proper vao use. define palette uniforms only when needed 2021-03-28 20:08:02 +02:00
Flyinghead dc0c5baece move vram to pvr 2021-03-28 20:08:02 +02:00
Flyinghead 569c23ca95 pvr: use pvr_read32p/pvr_write32p to access 32b vram 2021-03-28 20:08:02 +02:00
flyinghead 61d1a836a2 Merge pull request #213 from scribam/misc
Minor misc changes
2021-03-28 12:14:47 +02:00
scribam 767a1b6a8d gui: fix wrong index CrosshairColor 2021-03-28 11:38:43 +02:00
scribam 9c8082fb16 delete unnecessary null pointer check 2021-03-28 11:10:46 +02:00
scribam 3cdff93e26 archive: use int as second parameter for LookToRead2_CreateVTable 2021-03-28 11:06:26 +02:00
scribam e4a084b290 winmain: replace deprecated call to GetWindowLong by GetWindowLongPtr 2021-03-28 10:51:14 +02:00
flyinghead 3c2445fb82 Merge pull request #212 from scribam/io-boards-mem-leak
maple: fix potential mem leaks if vector reallocation fails
2021-03-28 10:46:52 +02:00
flyinghead f7d8557030 Merge pull request #211 from scribam/gl-cache-textures
glcache: call glDeleteTextures if texture cache size > 0 during reset
2021-03-28 10:46:44 +02:00
scribam 754c0e234b maple: fix potential mem leaks if vector reallocation fails 2021-03-27 20:59:54 +01:00
scribam d0c2c269b0 glcache: call glDeleteTextures if texture cache size > 0 during reset 2021-03-27 19:56:11 +01:00
Flyinghead 2b41d9684f pvr: static init UB
Issue # #148
2021-03-26 18:39:19 +01:00
Flyinghead 972f945058 lupin3 the shooting widescreen cheat
courtesy of Esppiral
2021-03-25 20:58:35 +01:00
Flyinghead 7205068809 sdl audio: use configured audio buffer size 2021-03-23 16:32:09 +01:00
Flyinghead 73a969b1a4 alsa: set period size before buffer size. make it match SAMPLE_COUNT
simplify WriteSample
2021-03-23 16:27:57 +01:00
Flyinghead a4120ef075 linux: more data dirs can be set with FLYCAST_BIOS_PATH env var 2021-03-23 16:12:27 +01:00
Flyinghead 6b11674949 use aligned struct for sqbuffers and sh4 context
serialize YUV_index
remove bogus arm32 TAWriteSQ implementation
2021-03-23 16:07:53 +01:00
Flyinghead 0f6dda9cb1 gdb server agent
allow stepping and soft breakpoints
clean up interpreter opcodes
2021-03-23 14:49:19 +01:00
Flyinghead 630d31ba20 arm32: better sh4 dynarec infiniloop fix
make sure next_pc is saved to ram
Issue #208
2021-03-22 10:06:43 +01:00
Flyinghead 1e6874c5eb SDL2/SDL.h -> SDL.h 2021-03-21 20:07:53 +01:00
Flyinghead d8a25e73f2 cmake fixes. makefile clean up. load gles3 driver with sdl
add FindSDL2.cmake and don't provide wrong hint
cmake: option to disable vulkan
don't use/link with egl if using sdl
remove ARM_HARDFP and use standard __ARM_PCS_VFP #def
hide texture upscaling options if no openmp
2021-03-21 18:03:22 +01:00
Flyinghead 06be0d927b screen stretching always in final horiz direction. lightgun coords fix
gl: strech direct fb texture based on stretching and rotation
Fix lighgun coords when stretching and/or rotating
Dimension render size based on stretching and rotation
vk: lightgun crosshair disappears near 0-edge -> scissoring x and y must
be >= 0
always stretch horizontally even when rotating
2021-03-21 18:03:22 +01:00
Flyinghead 685dcd1c8a Variable length arrays not supported by msvc. Fix MacOS project 2021-03-21 18:03:22 +01:00
Flyinghead 7af667cdf8 missing change from previous commit 2021-03-21 18:03:22 +01:00
Flyinghead 1abfa19636 set rendering resolution in discrete steps instead of scaling 2021-03-21 18:03:22 +01:00
Flyinghead 0b6420d90a arm32: sh4 dynarec infiniloop on reset. aica rec: fix icache flush
Fixes hang when exiting awave service menu

Issue #208
2021-03-20 15:06:16 +01:00
Flyinghead 9bc832c4c6 cmake, sdl: fix for some SBCs
sdl: don't request alpha channel for gl context
sdl: start fullscreen if not desktop
cmake: make openmp, host libzip optional. gles needs libEGL
fix crash when falling back to gl after vk init fails
2021-03-19 15:51:09 +01:00
Flyinghead ee109d0fec save state: fix rzip compression error 2021-03-16 10:16:29 +01:00
Flyinghead 58c936fa6c android: expose sound latency setting. default to auto
Issue #182
remove video Clipping option
remove audio LimitFPS option
2021-03-16 10:15:23 +01:00
flyinghead bceed97817 Merge pull request #205 from scribam/clang-tidy
clang-tidy: fix more checks
2021-03-15 20:17:56 +01:00
scribam cd47633810 clang-tidy: run readability-avoid-const-params-in-decls 2021-03-15 19:52:54 +01:00
scribam 8542675488 clang-tidy: run bugprone-incorrect-roundings 2021-03-15 19:52:54 +01:00
scribam 67435c71e8 clang-tidy: run readability-non-const-parameter 2021-03-15 19:52:54 +01:00
scribam 092ee6d8a5 clang-tidy: run readability-container-size-empty 2021-03-15 19:52:54 +01:00
scribam f1c8679df7 clang-tidy: run readability-delete-null-pointer 2021-03-15 19:52:54 +01:00
scribam 913fbef952 clang-tidy: run readability-inconsistent-declaration-parameter-name and improve parameter names 2021-03-15 19:52:54 +01:00
flyinghead 901e58573e limit mouse coordinates in relative mode
Issue #138
2021-03-15 17:55:44 +01:00
scribam ee7684abfc clang-tidy: run readability-redundant-string-init 2021-03-14 21:52:42 +01:00
scribam de363f176f clang-tidy: run readability-redundant-string-cstr 2021-03-14 21:52:42 +01:00
scribam 26ebcdf9f5 clang-tidy: run modernize-use-equals-default 2021-03-14 21:52:42 +01:00
Flyinghead 5e619a70d4 arm64: fix crash with HLE bios. Set nav bar to tranparent (android 10)
arm64 dynarec main loop and handlers were generated twice
Fix nav bar background leftover on android 10
2021-03-14 17:54:57 +01:00
flyinghead a60ed281a1 Merge pull request #202 from scribam/clang-tidy
clang-tidy: fix some checks
2021-03-14 08:39:00 +01:00
flyinghead ee5b1d3264 Merge pull request #203 from MaddTheSane/maddsXcodeUpdates
Madd's Xcode Updates
2021-03-14 08:38:36 +01:00
C.W. Betts 06879c65bc Update the iOS Xcode project. 2021-03-13 14:21:41 -07:00
C.W. Betts 90c1cd0d5c Minor pokes. 2021-03-13 13:58:48 -07:00
C.W. Betts 24fe77e4f0 Better include paths in Xcode.
Include emulator-osx-Bridging-Header.h in osx-main.mm, with added extern "C" around the header.
2021-03-13 13:58:47 -07:00
C.W. Betts 004b238fb7 Remove the printf to darw_printf define.
Quiets a warning about unknown printf-format type 'darw_printf'.
2021-03-13 13:58:47 -07:00
C.W. Betts de8382b4d0 Update Xcode projects.
Add arm64 source code to the macOS Project.
2021-03-13 13:58:42 -07:00
C.W. Betts d20ba556a9 iOS: migrate to Xcode assets.
Fix the PadViewController xib: it was basing the image names with the file extensions.
2021-03-13 13:57:27 -07:00
C.W. Betts 6ac1e1df0e Initial poke. 2021-03-13 13:57:27 -07:00
scribam fe17d79e8d clang-tidy: run performance-unnecessary-value-param 2021-03-13 17:28:33 +01:00
scribam af0c267d96 clang-tidy: run modernize-use-emplace 2021-03-13 17:28:32 +01:00
scribam d1239dea89 clang-tidy: run modernize-redundant-void-arg 2021-03-13 17:28:32 +01:00
scribam ae47ff9875 clang-tidy: run modernize-deprecated-headers 2021-03-13 17:28:32 +01:00
scribam 28d7227ba5 clang-tidy: run modernize-use-bool-literals 2021-03-13 17:28:32 +01:00
scribam d715836c40 clang-tidy: run modernize-use-override 2021-03-13 17:28:32 +01:00
flyinghead e76a73f871 Merge pull request #200 from scribam/remove-host-os
Remove HOST_OS references
2021-03-13 17:02:07 +01:00
scribam 1cc3490f51 Remove HOST_OS references 2021-03-13 11:38:34 +01:00
Flyinghead c61a66257f macos: no fast-math. fix xbyak "offset too big" 2021-03-13 10:34:13 +01:00
Flyinghead 5227259048 No more fast-math on x86/x64. Yet another FTRC fix
Don't compile with -ffast-math
Fix FTRC to return 0x80000000 for NaN
-> fixes Arcade Racing Legend sound problems and disappearing cars
Remove unsupported GCW0 platform
Remove unused android makefiles
2021-03-11 12:27:00 +01:00
Flyinghead 77bb6eade5 armrec: ignore invalid op ('SEGA')
fixes megadrive cdi crash
2021-03-11 12:15:57 +01:00
Flyinghead cb52d0b6ec x64: andn() needs BMI1 cpu feature
Issue #198
2021-03-09 14:38:27 +01:00
flyinghead 99e37500e9 vk: renderer wasn't always resized when window is
Issue #199
2021-03-08 21:04:51 +01:00
flyinghead 3314e9f3d7 naomi: toukon4 needs JP region 2021-03-08 21:03:36 +01:00
Flyinghead 478b9a9f68 linux: vmem conflict with malloc. Ignore savestate with future version 2021-03-07 17:05:34 +01:00
Flyinghead 31e0b3ab51 x64/x86 dynarecs: fast-math fcmp/eq implementation
Fixes Shin Nihon Pro Wrestling - Toukon Retsuden 4
Fixes Project Justice (Issue #38)
2021-03-07 16:59:17 +01:00
flyinghead 0e20d5976b vram texture locks race condition 2021-03-05 18:22:42 +01:00
flyinghead ee9e64a253 gui: prevent crash when starting a game while game scanner is running 2021-03-05 18:20:55 +01:00
flyinghead 45fcd811ec pvr: nullify TA context at shudown 2021-03-05 18:20:09 +01:00
flyinghead 3d5e648b96 cmake: built SDL2 lib isn't used during link 2021-03-05 18:18:14 +01:00
flyinghead 80386d45b9 rzip memory leak 2021-03-05 18:16:51 +01:00
Flyinghead ca107953fe Vulkan renderer setting was reset to off when starting a game 2021-03-03 09:40:52 +01:00
flyinghead 60ae4bcfc1 Merge pull request #195 from MaddTheSane/patch-3
Add Apple Silicon capability to context_segfault
2021-03-03 09:29:45 +01:00
C.W. Betts 4d5c6e1551 Fix an oversight. 2021-03-03 01:00:08 -07:00
C.W. Betts 3c8a2f2372 Don't compile rec_arm64 on non ARM64 machines.
Include header in posix_vmem that makes calls to sys_cache_control compile on Mac ARM64.

Replaces flyinghead#184
2021-03-03 00:57:53 -07:00
C.W. Betts af650c7c31 Add Apple Silicon capability to context_segfault
Based off of 15971d0ab5 and updated to work.
2021-03-02 18:18:19 -07:00
Flyinghead 641da3a771 build fix 2021-03-02 20:36:19 +01:00
Flyinghead 424736961b arm64: get rid of inline assembler 2021-03-02 20:35:59 +01:00
Flyinghead c99b34e60c msvc build fix 2021-03-02 20:10:25 +01:00
Flyinghead 0c8815549c Merge branch 'fh/x64-arm-jit'
# Conflicts:
#	core/hw/aica/aica.cpp
#	core/nullDC.cpp
2021-03-02 19:42:15 +01:00
flyinghead 77961d2c33 windows: international keyboard support
sdl: pass through USB scancodes
windows: detect host keyboard layout and emulate corresponding DC
keyboard
update modifier keys state even if no key pressed (Typing of the Dead:
Shift key tutorial)
2021-03-02 18:45:18 +01:00
flyinghead 8259b8ba02 x86 msvc build fix. Build 32bit SDL. Force renderer type at startup 2021-03-01 12:49:41 +01:00
flyinghead 72a61786f4 win32: crash when opening texture pack
Issue #187
2021-03-01 12:44:38 +01:00
Flyinghead c3a95594f9 New option system
Fix per-game settings (Issue #115)
Automatic load/save state (Issue #173)
Reload Naomi/AW BIOS after per-game settings are loaded to allow
per-game BIOS region. (Issue #96)
Restrict Soul Reaver widescreen cheat to the EU version (Issue #188)
Disable UI elements for overridden settings
Clean up/simplify legacy Naomi ROM loading
2021-03-01 10:13:40 +01:00
flyinghead 51b2e30af8 Merge pull request #193 from scribam/ga-win32
GitHub Actions: Enable i686-pc-windows-msvc build
2021-03-01 09:40:02 +01:00
scribam f7e391dd2f GitHub Actions: Enable i686-pc-windows-msvc build 2021-02-28 22:12:33 +01:00
flyinghead 8845f4eb3d Merge pull request #192 from scribam/zlibstatic-location
cmake/deps: Remove hardcoded path to zlibstatic library
2021-02-28 11:03:37 +01:00
scribam 91aae459d3 cmake/deps: Remove hardcoded path to zlibstatic library 2021-02-28 10:13:50 +01:00
flyinghead ae260370d6 Merge pull request #190 from wn2000/chd_align
Incorporate lr-flycast@e3b8bc9: Fix CHD alignment issues
2021-02-27 08:04:07 +01:00
walknight 987b83def6 Fix missing ssize_t in MSVC build 2021-02-27 00:43:52 -06:00
walknight af1b2e2e69 Incorporate lr-flycast@e3b8bc9: Fix CHD alignment issues 2021-02-26 23:39:34 -06:00
Flyinghead bbcfc8354a arm64: dynarec crash with wince games using temp blocks
Issue #185
2021-02-25 10:50:31 +01:00
Flyinghead c6389de3b3 macos: detect shift/ctrl/alt key presses as individual keys
Issue #176

Add "Open Menu" menu entry
2021-02-24 17:28:58 +01:00
Flyinghead 859a8dc8fb vulkan: wrong viewport with widescreen and SSAA x2
Issue #172
2021-02-21 08:33:31 +01:00
flyinghead 17e46a1d8f Merge pull request #181 from vkedwardli/feat/HiDPI
HiDPI mode for Windows and proper scaling on macOS
2021-02-18 09:48:23 +01:00
Edward Li 25e66d6972 Keeping the original scaling calculation for other OSes 2021-02-18 07:24:05 +08:00
Edward Li 21ab1111ad Enable HiDPI for Windows 2021-02-18 06:03:37 +08:00
Edward Li 50ece2a831 Handling scaling properly on macOS 2021-02-18 06:03:14 +08:00
Flyinghead 521d69f5e0 aicaarm: get rid of inline and source assembler 2021-02-15 18:47:09 +01:00
flyinghead db910b379f Merge pull request #178 from scribam/github-workflows
GitHub Actions update
2021-02-15 12:31:18 +01:00
scribam eb5ebbc0aa GitHub Actions: Remove git fetch since it is not necessary anymore 2021-02-14 20:55:17 +01:00
scribam c504cb50dc GitHub Actions: Bump actions/cache to v2 2021-02-14 20:55:01 +01:00
flyinghead e78b4decae Merge pull request #177 from scribam/cirrus
Fix compilation on FreeBSD
2021-02-14 19:50:39 +01:00
Flyinghead c4cb055e3f fix tests and macOS build 2021-02-14 19:34:26 +01:00
Flyinghead a920ae5901 aica: fix race conditions between sh4/arm
Fix sound issue in Test Drive Le Mans and Looney Tunes
2021-02-14 19:19:57 +01:00
Flyinghead 2d8bc6d6ee dynarec: skip single branch targets 2021-02-14 18:49:40 +01:00
scribam 89274248ed Fix compilation on FreeBSD 2021-02-14 17:06:03 +01:00
Flyinghead 07d9a7ec4b More widescreen cheats
Sonic Adventure (US)
Sonic Shuffle (US)
Evolution 2 (US, EU)
Super Magnetic Neo (US, EU)
Fix ECCO the Dolphin code

courtesy of F-Man
2021-02-14 12:07:49 +01:00
Flyinghead 485ce40d33 pvr: crash when rendering with no TA data 2021-02-11 16:31:52 +01:00
Flyinghead 30278a5511 7z: close the file in case of error and when reusing 2021-02-11 16:31:04 +01:00
Flyinghead 594a66efa4 widescreen cheats for Spawn
courtesy of Йоджимбо
2021-02-11 16:29:11 +01:00
flyinghead 556bf3f970 Merge pull request #175 from vkedwardli/rpi4
Add Raspberry Pi 4 to Makefile
2021-02-10 19:11:27 +01:00
Edward Li 605c4a4056 Add Raspberry Pi 4 to Makefile 2021-02-10 20:42:20 +08:00
Flyinghead 263c968ad0 fix Berserk (JP) widescreen cheat
Thanks to Йоджимбо
2021-02-07 14:58:12 +01:00
flyinghead 30b54694aa Merge pull request #165 from vkedwardli/feat-macos-unicode
macOS unicode handling + Updated Chinese common characters list
2021-02-01 18:18:09 +01:00
Edward Li 78aaf39792 Edit comment 2021-02-01 22:56:12 +08:00
Edward Li 4bbf4e3b65 Precompose characters for game scanner also 2021-02-01 20:01:56 +08:00
Edward Li eda6603808 Use preferredLanguages to detect system language 2021-02-01 19:57:28 +08:00
Edward Li 94caf86d4d Precompose unicode characters before displaying since HFS+ and APFS is using decomposed form 2021-02-01 19:42:18 +08:00
Edward Li 98c4343410 Font loading for macOS 2021-02-01 19:40:12 +08:00
Edward Li 7d73920ac2 Using the official common character list from the governments 2021-02-01 19:38:29 +08:00
Flyinghead 1a8b25cc34 vk: bump sampler pool size. use swap chain size 3. no mailbox on AMD
Increase descriptor set pool size for combined image sampler to
accomodate for games using a stupidly large number of textures.
Don't use mailbox mode on AMD as it needs 5(!) swap chain images on
linux.
Return to a swap chain size of 3 since it's the min for AMD.
2021-02-01 12:04:55 +01:00
Flyinghead 3f4993979f Merge remote-tracking branch 'origin/master' into fh/x64-arm-jit 2021-01-31 22:45:35 +01:00
Flyinghead d98462b192 x86 rec: compile fix 2021-01-31 18:05:47 +01:00
Flyinghead 3dfe4f96fa x64 rec: mul_s64 fix
GTA2 hang on start
2021-01-31 17:31:47 +01:00
Flyinghead a71c897d56 vk oit: crash when rendering to texture 2021-01-31 17:30:34 +01:00
flyinghead 6105365065 win32: load Asian glyphs from system fonts based on current code page 2021-01-31 16:08:10 +01:00
flyinghead 3892fb6825 win: can't save emu.cfg if exe path contains non-ascii chars
compile warnings
2021-01-31 12:31:18 +01:00
Flyinghead 89fe36b881 arm7 rec: lr wasn't updated in conditional bl
missing changes for previous arm64rec commit
more aica arm tests
wince vmem handler now uses direct ram access
2021-01-31 12:02:20 +01:00
Flyinghead e773880e6f x64 rec: save one op in CheckBlock 2021-01-31 11:56:07 +01:00
Flyinghead 8e22116a17 arm64 rec: get rid of setjmp() 2021-01-31 11:55:22 +01:00
Flyinghead 80782475da x64 rec: get rid of setjmp. standardize ngen_Rewrite/HandleException
move rewrite code from exception handlers to x86/x64 dynarecs
use same host context info on linux/win
x64: stack alignment issue in mem handlers
2021-01-30 16:14:44 +01:00
Flyinghead 594241ffa3 x64 rec: generate main loop. use mem stubs. fast mem access for !mmu
enable fast mem path for both !mmu and mmu
simplify rewrite
get rid of .asm file and inline assembler code
2021-01-29 11:46:05 +01:00
Flyinghead 3bd34e1d9b fix aica arm test 2021-01-29 11:40:18 +01:00
Flyinghead 75f7b92342 aicaarm namespace 2021-01-29 11:39:00 +01:00
Flyinghead 1b47ef0ab1 Merge remote-tracking branch 'origin/master' into fh/x64-arm-jit 2021-01-29 11:36:18 +01:00
flyinghead 0fe0c6c653 gl: crosshair not displaying without fps cpunter or vmu 2021-01-28 18:57:04 +01:00
flyinghead 958775ffbe x86 rec: add fast mem access and rewrite
x86: fix dynamic block end and directly use FPCB
fix code pointer for dsp dynarecs
reios entry point overwritten because of same address proc
2021-01-28 16:29:21 +01:00
Flyinghead 4c262deff6 aica arm: msvc asm file for x64 rec. build fixes 2021-01-27 11:08:47 +01:00
Flyinghead 882e14f13f aica: x64 jit for arm
aica arm x86: use pc-relative addressing to access arm registers

OSX project fix

arm7: add simple ldm/stm handling. optimize arm32 and x64 recs

update CMakeLists.txt and Makefile. finish rebase
2021-01-26 21:32:43 +01:00
flyinghead 93ceb92c12 x86 dsp dynarec 2021-01-26 18:48:17 +01:00
flyinghead 562660134e vulkan: fix resize crash with overlay 2021-01-26 18:12:37 +01:00
flyinghead 4215f7090f android: use ASharedMemory_create instead of /dev/ashmem if available 2021-01-26 14:02:14 +01:00
flyinghead c344903a23 new x86 dynarec. Enable for android
refactor common code between x64 and x86 dynarecs.
x86 rewrite based on the x64 one
some discarded dyna blocks weren't fully unlinked
2021-01-26 13:16:48 +01:00
flyinghead 7697d37ec6 lightgun crosshair support 2021-01-23 15:59:57 +01:00
flyinghead 4a81430da7 aw: analog and lightgun inputs not responsive after load state
save maple player num in state
save aw maple devs register
serialize more spg state. don't call CalculateSync on load
move savestate logic to spg and naomi
make tests work on windows
2021-01-22 15:11:04 +01:00
flyinghead d217f5232a win32 and macOS fixes 2021-01-21 22:44:51 +01:00
flyinghead 6894fb0245 win32 build fix 2021-01-21 21:34:18 +01:00
flyinghead c44302a477 macOS build fix 2021-01-21 21:32:49 +01:00
flyinghead ed7bd06f96 win32: multiple mice support. Patch and build SDL 2021-01-21 21:00:46 +01:00
flyinghead 9ce66231a1 macOS build fix 2021-01-20 17:11:58 +01:00
flyinghead 119948cfdb more event use cases 2021-01-19 23:52:28 +01:00
flyinghead 00413a6ad2 sdl: allow capture mouse and relative mode
toggle with L-ALT + L-CTRL
Issue #157

simple event system
2021-01-19 21:31:48 +01:00
flyinghead 71e9b94a84 missing change 2021-01-19 18:34:45 +01:00
flyinghead a23c895668 sh4: restore rounding/denormal mode after pausing the game
fixes Sword of the Berserk glitch when pausing/restarting
2021-01-19 18:28:21 +01:00
flyinghead 3d570f8008 delete deps/coreio 2021-01-19 17:50:03 +01:00
flyinghead 87e9fdd0ac allow subfolders in custom texture folders
make file iterator to be used by custom tex and game scanner
added some missing nowide::getenv
2021-01-19 16:58:26 +01:00
flyinghead b47e2abb7c restore zlib/zconf.h 2021-01-19 16:39:37 +01:00
flyinghead 16dec49e08 windows: use utf8 internally. Support latin2, cyrillic, etc. pathnames
upgrade libzip to 1.7
imgui: use all glyphs from font including latin2, cyrillic, greek, etc.
2021-01-19 11:11:01 +01:00
flyinghead 0c62231b54 tentative fix for rockchip support
makefile clean up
upgrade egl headers to latest version
2021-01-16 19:31:06 +01:00
flyinghead 417b470cbb sdl: fall back to open gl if vulkan init fails 2021-01-16 19:09:22 +01:00
flyinghead 49627eaf53 vk: first framebuffer wasn't cleared 2021-01-16 18:50:54 +01:00
flyinghead 87812a7f82 std::future_error on win32 when cancelling rom load 2021-01-15 10:25:21 +01:00
flyinghead 287836803d interp: don't touch the sh4 cache in normal mode 2021-01-15 10:21:05 +01:00
flyinghead 3dc3f7b7c2 naomi: wrong path when looking for gdrom in parent rom folder 2021-01-15 10:18:15 +01:00
flyinghead f3b86f6c14 gl: TextureCache -> GlTextureCache 2021-01-15 10:14:24 +01:00
Flyinghead 1727413247 vulkan: fix crash on minimize and resize. clear framebuffer on resize
many vulkan fixes related to init/term/reset
2021-01-09 18:16:39 +01:00
Flyinghead 4a103a1de3 process input when no frame is rendered 2021-01-08 21:47:33 +01:00
Flyinghead 36451614d2 rec-x64: don't use vfmadd to avoid intel/amd variations 2021-01-08 21:40:13 +01:00
flyinghead e5b3c5268b wince: attempt immediate read/write when address isn't translated 2021-01-07 19:18:53 +01:00
Flyinghead 0b5c19f634 appveyor: upgrade to gcc8 2021-01-05 18:59:38 +01:00
Flyinghead ed6e544e11 naomi: fix crash when loading wwfroyal game test menu 2021-01-05 18:58:06 +01:00
Flyinghead baa36925e2 naomi: more rom list to cpp. remap pjustice buttons. add more inputs 2021-01-05 18:39:00 +01:00
Flyinghead 46b48dcc68 cmake: link mingw statically 2021-01-05 15:00:49 +01:00
Flyinghead d97d1048fb msvc: don't set CMAKE_SYSTEM_NAME if we want CMAKE_SYSTEM_PROCESSOR 2021-01-05 11:16:25 +01:00
Flyinghead 5e4194b719 msvc: force sdk version 2021-01-05 10:31:01 +01:00
Flyinghead 65563942cd naomi: add dybb99, dybbnao, ringout and sstrkfgt inputs
Issue #154
2021-01-05 10:30:01 +01:00
Flyinghead 8d5708e255 disable 32b win build 2021-01-04 22:10:23 +01:00
Flyinghead f906d08376 more 32b windows fix 2021-01-04 22:00:15 +01:00
Flyinghead a576c43ed5 use deps/zlib on windows 2021-01-04 21:42:39 +01:00
Flyinghead ac7bd2a6a0 free()/delete[] mismatch 2021-01-04 21:21:35 +01:00
Flyinghead 99bd8b4972 get rid of USE_MODEM/ENABLE_MODEM 2021-01-04 20:58:29 +01:00
Flyinghead eeca82b4e2 32b win build fix 2021-01-04 20:44:15 +01:00
Flyinghead 2c8b5aa7f8 vs2019 build tentative fix 2021-01-04 18:56:15 +01:00
Flyinghead d7fcd3d47c jvs: allow more than 1 player with analog axes
add wsbb and smlg99 input mappings. Issue #152
2021-01-04 10:43:45 +01:00
Flyinghead 0fd9912f02 gui: get rid of content winodw border 2021-01-03 21:26:56 +01:00
Flyinghead 767445e05c more webtv disc ids 2021-01-03 21:26:23 +01:00
Flyinghead de260b89af net: launch miniupnp async. filter loopbacked broabcast pkts. dhcp reset
ftspeed network support
delete all dhcp negos when destroying dhcp server
filter broadcasted udp packets coming from self
launch miniupnp async since it takes time to complete (2-4s)
fix unit test
2021-01-03 21:25:27 +01:00
Flyinghead 889fc8256d broadband adapter support 2021-01-02 21:19:50 +01:00
Flyinghead 6d96981dc4 picotcp: add dhcp server and icmp from upstream 2021-01-02 18:51:09 +01:00
Flyinghead 62a1e29670 modem: do not reject VJ option for Web TV 2020-12-29 18:02:06 +01:00
Flyinghead bbedcaa37b macOS: ignore -psn arg on first launch. LoadSpecialSettings() clean up 2020-12-29 17:56:35 +01:00
Flyinghead 467e7954a5 log to ~/flycast.log if ./flycast.log isn't valid 2020-12-29 13:12:00 +01:00
Flyinghead cc7a292591 macOS: link sdl statically, hide vulkan. naomi: use miniupnp for server port
macOS doesn't need volk or glslang
link sdl statically
add GameController.framework (Xcode)
2020-12-29 11:53:00 +01:00
Flyinghead 227195e87b macOS cmake: fix icon, sdl.h path 2020-12-28 23:33:53 +01:00
Flyinghead 3244d980e4 macOS cmake: missing xib and assets 2020-12-28 22:55:16 +01:00
Flyinghead 78dee58811 still trying: win32 build fix 2020-12-28 21:37:51 +01:00
Flyinghead b8d89da8ab yet another win32 build fix. disable openMP on macOS 2020-12-28 16:56:23 +01:00
Flyinghead a1984a026f again: win32 build fix. macOS cmake: set min os to 10.9 2020-12-28 16:13:06 +01:00
Flyinghead c522d7386d win32 build fix. macOS cmake: set min os to 10.9 2020-12-28 14:23:25 +01:00
Flyinghead ed28cc36a9 fix win32 build 2020-12-28 13:49:36 +01:00
Flyinghead 9c43a55c42 miniupnpc: fix include dir 2020-12-28 13:15:06 +01:00
Flyinghead 6e1bba851b miniupnpc proper commit 2020-12-28 12:35:58 +01:00
Flyinghead e7ae03ded9 modem: use miniupnp to open router ports 2020-12-28 11:31:26 +01:00
Flyinghead a859effa04 build fix 2020-12-27 09:10:19 +01:00
Flyinghead 6f27b9b6b7 force wercker on ubuntu 18.04. Minor change 2020-12-27 09:05:55 +01:00
Flyinghead 1b2de1a4c9 macOS: mouse coordinates must be converted to backing store resolution 2020-12-27 09:01:30 +01:00
Flyinghead a0b099df7c gl: when loading custom textures, don't delete regular textures until after the current frame
regular textures might be referenced by the current frame and deleting them cause gl errors
Issue #144
2020-12-27 08:58:48 +01:00
Flyinghead 7a889803fd renderer: mipmapped textures render as black when dumping textures
Issue #144
2020-12-26 22:59:20 +01:00
Flyinghead 060650e0d8 support for compressed save-states 2020-12-26 09:58:53 +01:00
Flyinghead 544c55d848 macOS: set cmake deployment target to 10.9 2020-12-26 09:51:09 +01:00
Flyinghead a00aad5fa7 pvr: auto frame skip to replace current and previous synchronous rendering
Restore previous synchronous rendering behaviour (normal auto frame skip)
No frame skipping when disabled
better cpu speed measure over 4 vblanks
2020-12-25 12:08:44 +01:00
Flyinghead b9d7c11936 macos: fix cmake build 2020-12-24 10:25:46 +01:00
Flyinghead ee157db078 macos: microphone support. Audio latency setting 2020-12-24 08:58:46 +01:00
Flyinghead 46bb7d3b88 win: add [input] DisableXInput option to disable XInput and force DInput 2020-12-24 08:54:06 +01:00
Flyinghead 1a59f8bade vk: reset lastFrameView to nil when switching renderer
fix crash when switching per-tri/per-pix
2020-12-21 20:09:23 +01:00
Flyinghead 5905b8c148 dsp: don't clear EFREG
pass AICA0203 diag test
2020-12-20 23:19:24 +01:00
Flyinghead 632731bede vmem: map area 4 access to vram
pass DDT0101 diag test
fix vmem handler bug with >= 8 handlers
ch2-DMA: use SB_LMMODE1 for upper mirror
dmac: update SAR and DAR according to CHCR.SM and CHCR.DM
use function templates for vram 32b handlers
clean up
2020-12-20 17:25:28 +01:00
Flyinghead d0d9712545 gdrom: allow 0-len transfer
fixes Pro Pinball Trilogy hang during intro
2020-12-18 19:27:19 +01:00
Flyinghead 0d81c9fb0b sh4: clean dmac module, correct address/len mask, add missing mirror
fix infinite loop
2020-12-18 13:58:36 +01:00
Flyinghead 4ca0b56106 flash: zero initialize 2020-12-18 13:44:40 +01:00
Flyinghead e94e757743 naomi: align SB_GDSTAR on 32-byte boundary
Fixes vtennis (Issue #92)
2020-12-18 13:43:42 +01:00
Flyinghead a7a70f9900 gl: don't present a frame if no previous render 2020-12-16 17:25:33 +01:00
Flyinghead 34d86500fa compile warnings. debug log. minor changes 2020-12-16 15:12:32 +01:00
Flyinghead 650c3ff8ae pvr: serialize maple_int_pending. don't rend_reset in rend_term 2020-12-16 14:44:45 +01:00
Flyinghead 3f1326a3ac rend: read framebuffer as non-interlaced when possible 2020-12-16 14:40:11 +01:00
Flyinghead 190ab6690a vk: create staging buffer for texture if null
Fixes SF3 double impact crash
better texture cache cleanup
2020-12-16 14:37:28 +01:00
Flyinghead bb5b5d4512 only switch vulkan/opengl when needed 2020-12-15 20:16:35 +01:00
Flyinghead 04cd7db2cd pvr: serialize TA render passes
use enum for renderer type
2020-12-15 16:27:34 +01:00
Flyinghead c03cf8eb45 rend: multi-render, delay swap, refactor main ui loop
move ui loop out of hw/pvr
vk: implement multi-rendering, delay swap. Load fb before render pass
fps counter now counts frames, not renders
vk: force ignoreTexAlpha for 565 texture in case the supporting texture
has an alpha channel (RTT). Fixes Alone in the Dark cinematic scenes.
pvr: better detection of frame swapping (FB_R_SOF/FB_W_SOF)
pvr: synchronous rendering now always waits for render in progress
(speed measurement not reliable, render skipped when multi-rendering)
vk: limit swap chain size to 2
2020-12-15 15:09:42 +01:00
Flyinghead 93523df804 pvr: implement tile array region clipping. always draw background
fixes Quake 3 split-screen multiplayer
2020-12-15 14:17:58 +01:00
Flyinghead 9191795b4c pvr: increase PT max poly count
fixes Revolt overrun
2020-12-15 14:15:02 +01:00
Flyinghead d960f8e9f5 lightgun: handle screen stretching, rotation and tall aspect ratio
Issue #139

move jvs stuff into maple_jvs.cpp
2020-12-09 13:48:58 +01:00
Flyinghead a0b73a5919 sdl: set window icon (linux) 2020-12-08 18:35:46 +01:00
Flyinghead 897141833a windows: create data directory on startup 2020-12-08 17:55:36 +01:00
Flyinghead fd244eb8b9 android: create data directory if needed at startup and onboarding 2020-12-08 17:15:51 +01:00
Flyinghead b147f71ffa fix crash with vulkan an android
compiler bug?
2020-12-08 15:45:39 +01:00
Flyinghead cfed5e7a29 macos build fix 2020-12-07 22:25:33 +01:00
Flyinghead d1fbbac0ae sdl: use gamecontroller api for initial btn/axis binding 2020-12-07 22:18:23 +01:00
Flyinghead a39199d379 clean up 2020-12-07 22:16:51 +01:00
Flyinghead d7c49c6522 naomi: memory leak with decrypted carts 2020-12-07 22:12:16 +01:00
Flyinghead 14393ea6b1 improved microphone emulation. support for linux and windows 2020-12-05 18:47:09 +01:00
Flyinghead 08e191d7cc extra depth scale for Samurai Shodown 6 dc port
Issue #136

disable vmem for PBA bowling and WebTV
2020-12-05 18:29:09 +01:00
Flyinghead 579db85b3b modem: fix various picotcp tcp issues (re-xmit timers, segment split)
modem: delay receiving initial ppp handshake until after sending data
(WinCE)
reduce char receive delay to 143 us
make sure picosocket buffer is empty before shutting down socket
use 536-byte segment for tcp sockets
increase linger delay to 10 sec (avoid sending RST when waiting for FIN)
picotcp: disable window scaling option
dupe ack reception in full window mode should enter dupack mode
pick the correct segment to re-xmit in recover mode
both partial frames should be enqueued when splitting segment
fix wrong size when splitting segment and crash if splitting first one
make sure re-xmit timer is correct in tcp output
2020-12-04 11:23:15 +01:00
Flyinghead 6154cc08db serial: fix maxspeed hang at boot reading from console 2020-12-02 14:44:16 +01:00
Flyinghead adeacd89f4 input: implement reload. remap some naomi games input
implement lightgun reload (dc, naomi)
kcode[] set to 32 bits
revamped mapping for naomi keys
remapped btns for some naomi games
display game button/axes names in UI
2020-12-02 14:40:50 +01:00
Flyinghead 9a61407125 android: use dlsym() first to load gles routines
fix attempt for android <= 4.3
Issue #135
2020-12-02 09:52:52 +01:00
Flyinghead 8905410aa4 clean up 2020-11-30 21:59:13 +01:00
Flyinghead ef16842074 awave: fix lightgun trigger and position
fix aw lightgun trigger virtual key with new lightgun map
delay maple dma int when maple bus occupy is set for a lightgun.
raise maple int at vblank in if off screen
nudge reported position to avoid registering as off screen
2020-11-30 21:31:50 +01:00
Flyinghead c6f5a406a7 picoppp: use char instead of u8 2020-11-30 13:05:13 +01:00
Flyinghead 1d17dbd121 modem: avoid spurious retransmit. limit ppp buffer size.
set actual modem receive speed to 48K
picotcp: avoid spurious retransmit after window full. set min RTO to 1
sec.
buffer incoming data until pico socket can accept it.
limit tcp payload to 512 bytes.

Issue #114
2020-11-30 12:52:46 +01:00
Flyinghead 8f77a5482a config/data folders improvements
linux: look for legacy ~/.reicast and ~/.reicast/data
else look for ~/.config/flycast and ~/.local/share/flycast
and ~/.config/reicast and ~/.local/share/reicast
(defaults to flycast)

look for bios files in home folder and data folders (android, windows
,macos), then in game folder.
on linux, search in /usr/share/flycast and /usr/local/share/flycast and
legacy locations
2020-11-26 16:45:57 +01:00
Flyinghead d485da19b7 picotcp: close connecting sockets when notified 2020-11-26 14:08:37 +01:00
Flyinghead 93dc87f17f rend: fix race condition when clearing texture cache 2020-11-25 23:22:45 +01:00
Flyinghead fad94ca759 upgrade imgui to 1.8. Allow scrolling settings by dragging empty space 2020-11-25 13:54:27 +01:00
Flyinghead 289ff59008 gui: fix content path incorrect popup. fix potential race condition 2020-11-25 10:20:03 +01:00
Flyinghead 276b59b24e fix compile warnings. non-functional changes 2020-11-25 10:17:08 +01:00
Flyinghead cffb272abd sh4: non-functional changes 2020-11-24 21:29:04 +01:00
Flyinghead 305ab38ac8 naomi: search parent rom path for gdrom 2020-11-24 20:50:50 +01:00
Flyinghead 4dd05ca23f aica: saturate EG when aeg reaches 3bf. non-functional changes 2020-11-24 20:07:10 +01:00
Flyinghead 7744e1a262 vk: use-after-free if inFlight texture is deleted or cache cleared 2020-11-24 18:01:09 +01:00
Flyinghead 370c470bd9 fix lr savestate compatibility for aw 2020-11-24 17:59:51 +01:00
Flyinghead 2a5b303b70 delete nixprof 2020-11-22 17:37:27 +01:00
Flyinghead fd16c7f28f house cleaning 2020-11-21 22:42:12 +01:00
Flyinghead a7979d4695 reicast -> flycast 2020-11-21 21:51:27 +01:00
Flyinghead eb2c762214 rec: avoid div32 crash when dividing by 0
Fixes Sakura Taisen 2 floating point exception crash
2020-11-21 20:46:40 +01:00
Flyinghead 99b01536bc reios: fix crash when loading a HLE savestate in a non-HLE session
flashrom pointer wasn't initialized in this case
2020-11-21 20:09:06 +01:00
Flyinghead 525c2dc88c sh4: promote opcode 0 as regular NOP 2020-11-21 20:06:59 +01:00
Flyinghead b0f8d947ad update some READMEs 2020-11-21 17:59:52 +01:00
Flyinghead 4cb361bf9f input: allow binding controller buttons/axes to more than 1 player
Issue #68
2020-11-21 17:57:23 +01:00
Flyinghead 30b8c0d4d4 macos compile fix 2020-11-20 22:15:01 +01:00
Flyinghead 3e3fa08430 input: use btn/axes names in ui. fix mouse btn mapping
Use button and axis names in mapping UI
Mouse button remapping was impossible
x11: use same config names for window size as sdl/win
2020-11-20 22:10:14 +01:00
Flyinghead ee66afb7f6 vk: recreate swap chain if presentation failed. retry creation if fails 2020-11-20 21:13:18 +01:00
Flyinghead 47f262a2c6 vk: use normal pipeline for raw fb display
raw fb also needs to be rotated/scaled
oit: draw opaque polys on first frame
2020-11-19 22:29:06 +01:00
Flyinghead 953200b87b gl: Use 32x32 palette texture to avoid precision issues
fixes kofxi graphics corruption on Mali-400/450

fix macos github action
2020-11-19 11:56:10 +01:00
Flyinghead 03e5988397 Merge branch 'master' of https://github.com/flyinghead/flycast 2020-11-17 17:53:55 +01:00
Flyinghead 6280ed1507 use top/bottom black bars when screen is narrower than 4:3
Issue #127
2020-11-17 17:53:26 +01:00
flyinghead 643961f9e6 Merge pull request #125 from vkedwardli/fix-macos-audio-stuttering
macOS: Fixed audio clicking on external speakers
2020-11-09 17:05:33 +01:00
Edward Li ed888076c6 macOS: Fixed audio clicking on external speakers
From: https://github.com/reicast/reicast-emulator/pull/1880
2020-11-07 03:33:07 +08:00
flyinghead f2893b7c17 Merge pull request #124 from vkedwardli/search-contentlocation-warning
Display warning to user when it takes too long to find a game
2020-11-04 11:40:30 +01:00
flyinghead 58bc744ec3 Merge pull request #123 from vkedwardli/fix-xcode12-and-fastmath
Fix Xcode 12 build error and align fast math
2020-11-04 11:40:20 +01:00
Edward Li 11336a3e1f use unsigned int instead of uint 2020-11-04 06:34:25 +08:00
Edward Li 4516f9790a Restore the problematic Content Path if user clicks cancel 2020-11-04 05:59:25 +08:00
Edward Li fe1c77b9ae Display relevant game files in the select_directory_popup 2020-11-04 05:45:52 +08:00
Edward Li 4bd50b9182 Display warning when it takes too long to find a game 2020-11-04 05:45:38 +08:00
Edward Li 2bb5a5de9b Enable -ffast-math flag in macOS build also to align with all platforms 2020-11-04 00:38:29 +08:00
Edward Li 1f97d59325 Fix Xcode 12 build error 2020-11-04 00:36:26 +08:00
Flyinghead 621083c035 bitrise: tentative build fix 2020-10-24 15:35:54 +02:00
Flyinghead 99bfbeb3bc naomi: JVS IO response CRC byte, JVS Self Test command/response
Adds JVS IO response CRC byte, Add JVS Self Test command/response
backport https://github.com/libretro/flycast/pull/972
2020-10-24 15:10:55 +02:00
Flyinghead 170ae3477c gl4: reset scissor test before rendering a-buffers
Issue #116
2020-10-10 19:07:40 +02:00
Flyinghead 063c7f7d18 arm32: support for 64b immediate memory reads
fixes Mazan
2020-10-10 17:23:00 +02:00
flyinghead a9f1a896c5 Merge pull request #112 from vkedwardli/fix-macos-cmake
Fixes Github macOS build
2020-09-07 22:27:22 +02:00
Edward Li 32dc99032e disable pkg-config in macOS 2020-09-08 00:44:19 +08:00
Flyinghead 734514c1fe android: delay intent handling until storage perm is granted 2020-09-01 22:03:12 +02:00
Flyinghead d7b1ad61f3 aica: make sure lpf cutoff value is > 0
Issue #108
2020-08-31 21:53:33 +02:00
Flyinghead 493a833f56 android: compile with -O3 in debug. don't use host packages 2020-08-29 13:49:31 +02:00
Flyinghead 3bc508deea gdrom: fix D2 disk switching
Issue #107
2020-08-17 09:23:22 +02:00
flyinghead a53fe5eba0 Merge pull request #106 from vkedwardli/master
[Xcode] Handle EXC_BAD_ACCESS & SIGBUS automatically during debug
2020-08-16 11:01:22 +02:00
flyinghead 0942032f3c Merge pull request #105 from scribam/cmake-android
Use CMake for Android build and add GitHub CI
2020-08-16 11:00:15 +02:00
Edward Li 5f76370121 [Xcode] Ignore EXC_BAD_ACCESS in debug mode. Bypass SIGBUS signal in lldb using Breakpoint Action 2020-08-10 02:02:07 +08:00
scribam dfda9c764b Use CMake for Android build and add GitHub CI 2020-08-01 12:30:53 +02:00
Flyinghead 125c1ff37d gles: use int for palette_index uniform to avoid precision issues
Issue #104
2020-07-31 12:16:10 +02:00
flyinghead dd102c806c Fix macos and msvc x86 cmake builds 2020-07-23 19:01:38 +02:00
flyinghead 700994340b cmake: add sdl to vstudio build. Fix WinCE crash 2020-07-23 18:50:55 +02:00
Flyinghead 860425b3cc naomi: zombie revenge analog axes. add puyofevp. fix pokasuka 2020-07-20 12:03:20 +02:00
Flyinghead df392b8376 lupin the shooting uses ligthgun as analog 2020-07-16 11:16:02 +02:00
Flyinghead f39d11ef7e input: round dead zone when saving 2020-07-16 11:14:29 +02:00
Flyinghead 75bb7483df fix mingw build 2020-07-13 21:10:32 +02:00
Flyinghead 4ecf43a08d vulkan: revert to using 3 swap images. fix crash when switching gl/vk
Fix Hello Kitty crash with empty first TR polygon
Fix Test Drive Le Mans crash on invalid textures
Fix wldkickspw crash with invalid TA data
2020-07-11 17:38:41 +02:00
Flyinghead 1713124711 vulkan: linear tiling for small texs. don't track in-flight texs
Linear tiling is faster for small, frequently updated textures
When lots of textures are updated each frame, a skipped frame will
destroy/recreate all textures, causing another skipped frame, etc. So
in-flight texture tracking is disabled, except for RTT textures
Limit swap chain to 2 images
Refactor base and oit renderers to avoid code dup
2020-07-10 18:50:53 +02:00
Flyinghead a1dd76818e macOS build fix 2020-07-08 18:27:42 +02:00
Flyinghead 7449230af8 handle some palette textures on the GPU
get rid of PixerPacker templates
no need for GLSL precision qualifier in GL4
2020-07-08 18:17:15 +02:00
flyinghead fbe9cc3936 Merge pull request #101 from adamgp/master
Moving hardcoded dead zone into cfg file per controller mapping.
2020-07-08 14:58:05 +02:00
Adam Pooley a1f0053be6 Converting dead_zone from float to int storage in cfg file with min/max range of 0-100. 2020-07-08 12:55:37 +01:00
Adam Pooley bd35dfbce3 DeadZone float saving/loading to input mapping cfg files. 2020-07-08 12:55:23 +01:00
Flyinghead adf5a7e8e4 fix tests. sdl init iisue on rpi3 2020-07-06 17:29:53 +02:00
Flyinghead fee28194fb savestate: save sq_remap, save aw cart state, fix lr aw format
save AW cart state
save sq_remap used for mini-mmu with store queues
allow loading lr aw savestate. upgrade to v11
aica: saturate EG register
savestate: save current TA data
texcache: fix race condition when deleting a texture
handle 1x1 YUV tex as 565
2020-07-06 16:28:53 +02:00
Flyinghead 42cb880538 macos: add null audio driver 2020-06-29 21:31:37 +02:00
Flyinghead cc2bb61b86 build fix. add widescreen cheats 2020-06-25 15:06:18 +02:00
Flyinghead a446199312 g2 dma: use templates. SB_G2APRO support. maple: fix SB_MDAPRO support 2020-06-25 14:49:53 +02:00
Flyinghead 89842c6d30 modem: better handling of reset register 2020-06-24 15:48:05 +02:00
Flyinghead 3694e8e87a flash: select mode. fix sector protection. implement reset 2020-06-24 15:41:12 +02:00
Flyinghead 74aae115ee sh4: implement C and WT MMU bits in cache. Use mem handlers everywhere
o/icache use C and WT bits from mmu to override cache and copy back
settings (fixes Windows CE)
move mem handlers setup out of mmu into sh4_mem. Call in dc_resume and
detect transitions interp -> dynarec to flush caches.
fix ssa tlb miss exception wih slow mmu
2020-06-24 15:23:47 +02:00
Flyinghead 6402c8e7ed maple: check SB_MDAPRO magic number 2020-06-23 19:20:55 +02:00
Flyinghead 8b44ebbdab maple: don't overrun device strings 2020-06-23 18:10:22 +02:00
Flyinghead 959b6344b3 gdrom: fix cd_read2, req_error, req_stat and more 2020-06-17 22:58:26 +02:00
Flyinghead 15a99aeebe aica: internal dma implementation 2020-06-15 21:42:47 +02:00
Flyinghead 8192eea387 maple: msb selection, implement/fake reset, kill and allreq commands
overrun and illegal address ints in strict mode
2020-06-15 17:04:04 +02:00
Flyinghead 5cfed1e482 div32: get rid of edge cases. simplify 2020-06-15 16:56:09 +02:00
Flyinghead 22dcb1ec99 sh4 ocache implementation. IC and OC address/data read/write in P4
ignore SR.RB in user mode instead of forcing it 0
add STRICT_MODE to enable ocache in interpreter
don't flush mmu table when enabling it
fix fixNan64()
2020-06-12 17:35:14 +02:00
Flyinghead d29797988e cmake: fix macos build 2020-06-09 12:16:41 +02:00
Flyinghead 333df13fce sh4 icache implementation. move aica out of sh4/interp.
revert to original div1 impl
serialize rtc clock value
cmake fixes: asan and logging options, -no-pie on x64/linux
2020-06-09 12:02:01 +02:00
Flyinghead 18790901b1 arm: use canonical div32p2 2020-06-06 22:37:28 +02:00
Flyinghead 8740f22c0a fix all known div32 issues
support libretro naomi and aw savestates
2020-06-06 18:53:47 +02:00
Flyinghead 0fd51fb52a android: ignore audio latency. skip less frames in synchronous mode
android: use minimum size for audio buffer
alsa: use period size of 1024 instead of 512
hide audio latency option for android, win32 and mac
relax frame skipping formula
2020-06-05 21:16:48 +02:00
Flyinghead 002a05f866 dsp: proper MIXS input shift 2020-05-30 19:57:58 +02:00
Flyinghead 1301103245 maple: fix vmu reset in BIOS. naomi: support P2 buttons mapped to P1 2020-05-29 14:45:12 +02:00
Flyinghead 5de78a4687 osx: avoid hang when quitting emu during gameplay 2020-05-23 13:03:59 +02:00
Flyinghead df97c42e4e add some naomi/aw widescreen cheats 2020-05-15 20:33:00 +02:00
Flyinghead 2e9238d719 omx: fix buffer overflow. evdev: better default gamepad mapping 2020-05-11 16:11:31 +02:00
Flyinghead fec79624df gl/gl4: simplify clipping. share code with vulkan 2020-05-11 16:11:31 +02:00
flyinghead 9df8e83ef0 Merge pull request #90 from scribam/github-actions-ccache
github-actions: add ccache support
2020-05-09 18:21:08 +02:00
Flyinghead 5b1d093778 fix GLES2+SDL build 2020-05-09 18:20:56 +02:00
Flyinghead b907aa2d98 fix GLES2 build 2020-05-09 12:07:49 +02:00
Flyinghead 34575d577c fix sdl+egl build. get rid of USES_HOMEDIR. thread deadlock at exit
fix odroid xu3 build
sdl: use left or right alt+enter to maximize window
deadlock at exit if dc_exit called from emu thread
2020-05-08 18:41:36 +02:00
scribam e30bf5205e github-actions: add ccache support 2020-05-08 14:21:16 +02:00
flyinghead 02f38267a8 Merge pull request #88 from scribam/cmake
CMake refactoring
2020-05-07 12:06:30 +02:00
scribam 68fe119344 Add Cirrus CI (FreeBSD only) and GitHub Actions to build with CMake 2020-05-05 21:56:15 +02:00
scribam 2ee8ca37c0 CMake refactoring 2020-05-05 21:13:12 +02:00
scribam cb889ad36e Use predefined macros to define HOST_CPU and HOST_OS 2020-05-05 19:01:07 +02:00
flyinghead 1e14e12015 Merge pull request #87 from scribam/c++11
Use C++11 without GNU extensions
2020-05-02 18:24:33 +02:00
Flyinghead 8a6dbef775 naomi: don't die if eeprom cannot be updated (network), log instead 2020-05-02 18:24:13 +02:00
scribam 10bd4dd9b4 Use C++11 without GNU extensions 2020-05-02 10:57:08 +02:00
flyinghead 9552b10d32 Merge pull request #85 from scribam/android-ndk-21
Android compatibility NDK >= 21
2020-05-01 13:06:19 +02:00
Flyinghead e8a655d99b fix race condition in cResetEvent::Wait(u32) 2020-05-01 13:06:07 +02:00
Flyinghead d75d4400f0 win32: fix path separator issue 2020-04-30 12:49:56 +02:00
scribam 7c739d5a7f gitignore: Update android-related files and folders 2020-04-30 11:26:17 +02:00
scribam dd32e76dc6 Remove unused .lgtm.yml file 2020-04-30 11:04:05 +02:00
scribam 700d14be2f android: Update Android Gradle plugin 2020-04-30 11:04:05 +02:00
scribam 433f23dd04 android/travis: Replace configure-on-demand by parallel for gradlew 2020-04-30 10:17:56 +02:00
scribam b5fcea7135 android/travis: Use preferred ndk for android-28 2020-04-30 10:17:56 +02:00
scribam c797bd6f72 android: Add static-openmp only if ndk >= 21 2020-04-30 10:17:56 +02:00
flyinghead 836780d8a7 Merge pull request #84 from scribam/glslang
deps: Update glslang to version 8.13.3743
2020-04-28 18:51:42 +02:00
flyinghead 28ccab67fa Merge pull request #82 from scribam/apple
Replace OS_DARWIN by __APPLE__
2020-04-28 18:51:30 +02:00
scribam 0ddcce4854 deps: Update glslang to version 8.13.3743 2020-04-28 14:19:33 +02:00
scribam 6ee4b6de85 Replace OS_DARWIN by __APPLE__ 2020-04-26 14:19:21 +02:00
flyinghead a04b7f88fa Merge pull request #81 from vkedwardli/feat/macOS-multiple-instance
[macOS] Enable "New Instance" in File and Dock menu
2020-04-26 11:32:36 +02:00
Flyinghead aac8b30bce naomi: fake wrungp drive board. marine fishing inputs
set jvs board for dog walking and touch de uno
force region to japan for the same
2020-04-26 11:32:15 +02:00
Flyinghead c9d8222889 input: don't exit when mapping the exit key 2020-04-26 11:27:45 +02:00
Edward Li e1bd8a4ea7 [macOS] Enable "New Instance" in File and Dock menu 2020-04-26 12:23:54 +08:00
flyinghead edda259adc Merge pull request #80 from scribam/7zArchive-algorithm
Enable 7zArchive for MSVC
2020-04-25 19:42:06 +02:00
flyinghead 01682fc966 network: win32 fix 2020-04-25 19:41:46 +02:00
scribam 2d9390df9f Enable 7zArchive for MSVC 2020-04-25 12:45:31 +02:00
Flyinghead 2c54dfd132 arm64: check CpuRunning at end of each timeslice. clean up
fixes hang when exiting service menu in kofnw
2020-04-24 19:56:38 +02:00
Flyinghead 482b7427f0 ui: get rid of 100% notif message. avoid logging garbage when canceled 2020-04-24 19:46:23 +02:00
flyinghead cd63ab8be4 Merge pull request #79 from scribam/msvc-cleanup-fix
MSVC Fix/Cleanup
2020-04-23 16:52:30 +02:00
scribam 0b1d739673 MSVC Cleanup 2020-04-23 14:10:49 +02:00
scribam 0b9ecd35c6 Remove Visual Studio solution/project files 2020-04-23 14:10:49 +02:00
scribam 429957f830 Compilation fix for MSVC 2020-04-23 13:37:07 +02:00
Flyinghead adfe30cf4c osx: allow exit with button. clean exit
terminate network in dc_term to avoid static init order issues
osx: call dc_term before exit
osx: exit app when exit button is pressed (dc_exit)
osx: ignore -NSDoc... app args
2020-04-23 11:46:34 +02:00
Flyinghead 1d1cd347ef win32 build fix 2020-04-22 19:20:03 +02:00
Flyinghead bec7a9f452 network: start network before starting game to configure eeprom/flash
do second net sync when comm board is reset
close menu/cancel loading when pressing menu button
2020-04-22 19:11:49 +02:00
Flyinghead 65f156817c win32: reserve vmem with MEM_TOP_DOWN. Use 1MB increment for prepare_jit 2020-04-22 10:06:25 +02:00
flyinghead 8b7fcc4084 Merge pull request #77 from scribam/msvc-fixes
Compilation fixes for MSVC
2020-04-21 10:23:16 +02:00
scribam 58abddfd27 Compilation fixes for MSVC 2020-04-20 22:17:32 +02:00
Flyinghead 64249eb68e gdrom: shrink gdrom buffer to decent size 2020-04-20 18:53:08 +02:00
Flyinghead 17a2c3644f ui: add loading screen with cancel button. don't freeze ui on load 2020-04-20 18:52:02 +02:00
Flyinghead 06313dd540 naomi: auto configure eeprom and bbsram for network 2020-04-19 21:45:15 +02:00
Flyinghead 98b2a32eae naomi: auto-rotate screen, no widescreen when rot, lightgun as analog
rotate screen for naomi games that need it
disable widescreen when rotating screen
detect lightgun games and enable proper settings
disable model 3 comm board for atomiswave
2020-04-17 22:11:11 +02:00
Flyinghead 3660cf49f4 naomi net: don't xmit the packet number 2020-04-17 18:09:56 +02:00
Flyinghead 7058ffeb61 dsp: fix output shift
fix wrungp ear rape
2020-04-17 18:04:58 +02:00
Flyinghead c364d6379b input: per controller instance mapping file. Hide DPad U/D/L/R
Try to load a per-controller instance mapping file first, then fallback
to the per device type file.
Hide DPad U/D/L/R and DPad2 U/D/L/R in analog axes mapping to avoid
confusion.
2020-04-17 17:55:43 +02:00
flyinghead ed1a9fabd0 Merge pull request #73 from scribam/thread-rework
Rework cThread to use std::thread
2020-04-17 10:05:29 +02:00
Flyinghead a9fc78b88e SDL: don't use guid as unique id as it's not unique to a device instance
Issue #74
2020-04-16 16:17:30 +02:00
scribam 62afe5714a Rework cThread to use std::thread 2020-04-15 20:20:30 +02:00
Flyinghead 2d1c3fa307 win32: play sound even in background 2020-04-15 19:09:16 +02:00
Flyinghead be1f2138e7 naomi: add inputs for wrungp. network error handling/reporting 2020-04-15 19:07:04 +02:00
flyinghead 3495a0b53e Merge pull request #72 from inada-s/garkun/skip-recvfrom-with-invalid-sock
[MODEM] avoid WSAEINVAL error
2020-04-15 10:43:23 +02:00
flyinghead 477bbe935f Merge pull request #71 from inada-s/garkun/modem-recv-tune
[MODEM] recv tune. set small callback_cycles to recv fllowing data quickly
2020-04-15 10:43:13 +02:00
flyinghead 0d762b9307 Merge pull request #70 from scribam/zlib
deps: Update zlib to version 1.2.11
2020-04-15 10:42:57 +02:00
Shingo INADA 645c771af2 [MODEM] mark as invalid-socket if failed to bind udp sockets to avoid WSAEINVAL error 2020-04-15 11:44:01 +09:00
Shingo INADA 2d67334cb4 [MODEM] recv tune. set small callback_cycles to recv fllowing data quickly. 2020-04-15 11:27:59 +09:00
scribam cb8308387a deps: Update zlib to version 1.2.11 2020-04-14 20:47:54 +02:00
Flyinghead 17c7e0b3ed win32 build fix. fix crash when 2 or more slaves 2020-04-14 20:23:17 +02:00
Flyinghead c86fd8498f log: add network category 2020-04-14 17:54:54 +02:00
Flyinghead c4f0dbab09 naomi m3: missing changes. SDL: get gamepad events if focus lost 2020-04-14 17:44:27 +02:00
Flyinghead a41a81f5dd naomi: network code for model 3 comm board 2020-04-14 17:43:11 +02:00
Flyinghead 6215623640 naomi: add tokyo bus guide 2020-04-13 18:32:58 +02:00
Flyinghead 381f0f0f95 ui: scan games in a background thread. hide unknown zips and naomi chds 2020-04-09 11:44:19 +02:00
Flyinghead 786c8e7744 get rid of libpng and use stb_image_write instead. OSX: static link SDL 2020-04-08 15:34:21 +02:00
flyinghead 55b26fa28f Merge pull request #67 from scribam/custom-textures-stb_image
Load custom textures with stb_image exclusively and remove loadPNGData function
2020-04-07 21:09:11 +02:00
scribam 5b60e3e47b Load custom textures with stb_image exclusively and remove loadPNGData function 2020-04-07 19:17:16 +02:00
flyinghead 2711912bcf Merge pull request #66 from tokuio/axis_buttons
Add ability to map analogue triggers to digital buttons
2020-04-07 17:23:51 +02:00
Flyinghead b2af81cdb0 custom textures: use strtoll since long is 32-bit on windows 2020-04-07 16:32:38 +02:00
Flyinghead f03de11521 missing change 2020-04-07 14:36:54 +02:00
Flyinghead cc2ddad53b custom textures: support JPEG format 2020-04-07 14:32:09 +02:00
tokuio f5887d64c2 Add ability to map analogue triggers to digital buttons 2020-04-07 01:33:05 +01:00
flyinghead b393a35325 Update README.md 2020-04-06 12:04:54 +02:00
flyinghead f05121b52f Merge pull request #60 from scribam/android-update
Android build update
2020-04-06 11:30:30 +02:00
Flyinghead d001b40430 modem: fix isp settings in flash. dc_flash.bin no longer used
fix crash in World Series Baseball when connecting
fix Jet Grind Radio web site access
2020-04-05 19:58:50 +02:00
Flyinghead df7bb18e2c picotcp: keep track of ppp timer and cancel it on destroy 2020-04-05 12:44:39 +02:00
scribam 71c1bb0670 Android build update 2020-04-04 22:05:26 +02:00
Flyinghead 553447ed76 allow buttons to be mapped to left analog stick
Issue #55
2020-04-04 18:18:36 +02:00
flyinghead 8482b9130c Merge pull request #59 from scribam/deposterize
Remove unused deposterize code
2020-04-03 20:42:59 +02:00
flyinghead d4cb599b36 Merge pull request #56 from scribam/cResetEvent-rework
Rewrite cResetEvent to use std::condition_variable
2020-04-03 20:42:50 +02:00
scribam 63ffb2efe0 Rewrite cResetEvent to use std::condition_variable 2020-04-03 19:00:02 +02:00
scribam 1ce40ff0ec Compilation fix for MSVC 2020-04-03 18:55:10 +02:00
scribam 0077bbe295 Remove unused deposterize code 2020-04-03 18:55:02 +02:00
Flyinghead d1b29a59d2 vulkan: re-enable vulkan 1.1 on Android. Fix TEST_AUTOMATION
disable vmem32 for Heroes of Might and Magic III
support no vmem in _vmem.cpp
2020-04-03 16:32:53 +02:00
Flyinghead 3f29bac591 pvr: textured background plane
fix for Who Wants to Be a Millionaire
2020-04-03 16:26:00 +02:00
Flyinghead 37d3625bf3 gui: Add log to file option. don't create log file if disabled 2020-04-02 12:20:03 +02:00
Flyinghead 578071e8f9 win32: avoid deadlock if waiting for current thread. La Keyboard input 2020-04-02 11:51:39 +02:00
Flyinghead ca3c2a2387 rend: use original palette data to compute palette hash 2020-04-01 17:12:55 +02:00
Flyinghead 320d0a5ce7 fix crash when TR polys count is 0 2020-03-31 21:09:42 +02:00
flyinghead 188558d302 Merge pull request #54 from scribam/misc-changes
Misc changes
2020-03-31 12:17:20 +02:00
scribam 769770ab81 Replace cMutex by std::mutex 2020-03-30 23:00:43 +02:00
scribam a155282fd0 Cleanup compiler warnings (mostly sign-compare) 2020-03-30 23:00:43 +02:00
scribam 3198cf65d9 Remove old "types.h" for x86_emitter 2020-03-30 23:00:43 +02:00
scribam e99aac3575 Remove "using namespace std;" 2020-03-30 23:00:43 +02:00
scribam c1b37b56bc Remove "sh4_if.h" and "stdclass.h" from "types.h" 2020-03-30 23:00:43 +02:00
scribam 9a420b0093 Remove macros EMUERROR 2020-03-30 22:18:44 +02:00
Flyinghead b3e466afed sort triangles even with 1 poly
fixes missing Naomi boot logo and vtennis2 black frame during replay
2020-03-30 18:48:06 +02:00
flyinghead 403d5d77d5 Merge pull request #51 from scribam/headers-include
Cleanup include headers
2020-03-29 16:07:18 +02:00
scribam 0038dc3ae8 deps/xbrz: backport change from 1.7 to fix android debug build 2020-03-29 14:45:05 +02:00
scribam 4bf6802855 Cleanup include headers 2020-03-29 14:26:21 +02:00
flyinghead 21ef50b589 Merge pull request #52 from scribam/deps
Update some deps
2020-03-29 14:23:30 +02:00
Flyinghead efd0856ef0 bitrise: set PR as the first trigger 2020-03-29 13:48:15 +02:00
scribam 65590e8c49 deps/xbrz: backport change from 1.7 to fix android build 2020-03-29 13:47:20 +02:00
scribam 427b428718 deps: Update xxHash to version 0.7.3 2020-03-29 13:47:20 +02:00
scribam fef96c125a deps: Update xbyak to version 5.891 2020-03-29 13:47:20 +02:00
scribam 484a7cdd10 deps: Update volk to commit ec2d513 2020-03-29 13:28:06 +02:00
scribam c731cbcaf8 deps/vulkan: Update vk_mem_alloc.h to version 2.3 2020-03-29 13:28:06 +02:00
scribam 5a9ad280a5 deps: Update glslang to version 8.13.3559 2020-03-29 13:28:05 +02:00
scribam 472053df42 deps: Update glm to version 0.9.9.7 2020-03-29 13:28:05 +02:00
Flyinghead f8ca801877 holly: don't die if read/write-only reg is written/read. log instead 2020-03-29 12:55:16 +02:00
Flyinghead 9ba34aefa1 bitrise: fix PR building. don't deploy PR build artifacts 2020-03-29 12:53:54 +02:00
Flyinghead 9ce25a4e72 gl: crash when deleting null shader 2020-03-29 12:30:22 +02:00
flyinghead 40854fbf31 Merge pull request #53 from scribam/ndebug
Replace RELEASE by NDEBUG
2020-03-29 12:26:25 +02:00
scribam 0035871422 Replace RELEASE by NDEBUG 2020-03-29 10:12:32 +02:00
Flyinghead 6a447cb0b5 support multi-session cue/bin 2020-03-28 12:19:36 +01:00
Flyinghead c5a42a57bc limit maple schedule time, allow vram 8-bit reads, minor changes 2020-03-28 12:19:36 +01:00
Flyinghead ed1c9c9091 fix command-line help text 2020-03-28 12:19:36 +01:00
Flyinghead 96c8353364 pvr: don't discard RTT frames 2020-03-28 12:19:36 +01:00
flyinghead adbd69c8b6 Merge pull request #50 from tokuio/update_logging
let windows terminals use Nix ConsoleListener, fix windows timestamp
2020-03-27 20:31:03 +01:00
tokuio 255d19d40f let windows terminals use Nix ConsoleListener, fix windows timestamp 2020-03-27 19:05:24 +00:00
Flyinghead 8ada1d5320 pvr: defer index building and strip merging, filter out infinite verts
don't reset tileclip_val on each frame (Irides - master of blocks)
spg clean up
2020-03-27 13:03:49 +01:00
flyinghead f7823f206a Merge pull request #49 from scribam/android-zip-include
android: remove relative path to include zip.h
2020-03-25 22:34:20 +01:00
scribam 4fa187035c android: remove relative path to include zip.h 2020-03-25 22:05:58 +01:00
flyinghead c4fc93768f Merge pull request #48 from scribam/libpng-public-api
libpng: use the public api to retrieve io_ptr
2020-03-25 18:26:17 +01:00
scribam 3ccd8c624f libpng: use the public api to retrieve io_ptr 2020-03-25 18:15:32 +01:00
flyinghead f4aefe4fd1 Merge pull request #47 from tokuio/rom_descriptions
Add game description to roms in file list
2020-03-25 16:09:17 +01:00
tokuio 7e4a31c786 Add game description to roms in file list 2020-03-25 12:49:58 +00:00
Flyinghead 5894992f70 android: don't use storage for default buttons.png 2020-03-24 23:31:34 +01:00
Flyinghead c098790f3b naomi: connect C1 VMU fvor P2 2020-03-24 23:22:57 +01:00
Flyinghead 09c439bbe8 naom: VMU support (vonot, sf3zu). Fix otrigger inputs. 2020-03-23 17:48:43 +01:00
Flyinghead c5b56b874c Merge remote-tracking branch 'origin/fh/win32-sdl' 2020-03-23 14:52:25 +01:00
Flyinghead 39d81923c9 keyboard support for totd and luptype 2020-03-23 14:09:50 +01:00
Flyinghead f99d7fa262 naomi: add default eeproms 2020-03-22 16:46:16 +01:00
flyinghead 8db02cf503 sdl: Support hats. Save/restore window state and size. Fullscreen mode 2020-03-22 14:10:07 +01:00
flyinghead 6831258a57 win: include SDL2 in deps 2020-03-21 17:10:01 +01:00
flyinghead 4544674784 win32 build fix 2020-03-21 16:00:00 +01:00
flyinghead e3b4ca705d install sdl on appveyor 2020-03-21 15:43:42 +01:00
flyinghead 8f92315207 Use sdl on windows 2020-03-21 15:25:02 +01:00
Flyinghead 5a1b7374e5 change icons. display error message when game fails to load. 2020-03-21 15:05:38 +01:00
Flyinghead 0c2e95185c support for right analog stick. Fix gunsur2 inputs 2020-03-20 16:57:50 +01:00
Flyinghead bccea0e991 win32: link pthread statically. Alien Front naomi needs safe mode 2020-03-20 12:42:13 +01:00
Flyinghead 6b2e815b49 naomi: fix monkey ball inputs 2020-03-19 23:38:01 +01:00
Flyinghead e44ed4a8e8 gdrom: don't resume cdda if not playing. stop if cur > end 2020-03-19 17:04:47 +01:00
Flyinghead 34ac18479f osx build fix 2020-03-18 19:09:25 +01:00
Flyinghead 54261b69c9 renderer: handle mipmap D-adjust param (convert to lod bias) 2020-03-18 18:51:34 +01:00
Flyinghead 268b0cdcfd vulkan: mipmap levels must be 4-byte aligned 2020-03-17 19:24:00 +01:00
Flyinghead ef223bb20d vulkan: disable vulkan 1.1 on android for now
Issue #30
2020-03-17 16:34:14 +01:00
Flyinghead bb345bf291 android: force static openmp linking
Issue #30
2020-03-17 14:16:23 +01:00
flyinghead d5cd4e5834 Merge pull request #42 from scribam/msvc-nominmax
Add NOMINMAX for MSVC and use <algorithm>
2020-03-17 11:10:34 +01:00
scribam 6dd35cc811 Add NOMINMAX for MSVC and use <algorithm> 2020-03-16 23:44:06 +01:00
flyinghead 39af255335 Merge pull request #41 from scribam/ao-compilation-fix
Compilation fix for ao audio backend
2020-03-16 18:31:17 +01:00
scribam 1afc102910 Compilation fix for ao audio backend 2020-03-16 18:17:51 +01:00
Flyinghead 1abfdaf64e audio: pulse async driver, null driver, latency setting
Pulse: use async API instead of simple API
Null driver: no audio driver with accurate timing
Add latency setting to alsa, pulse and android drivers
android: start and stop AudioTrack on audiobackend init/term
Simplify audiostream. Get rid of "none" option
2020-03-14 22:46:40 +01:00
Flyinghead ad3dce1102 fix alignment issues reported by ubsan on x64
Fix chd lzma and zlib buffers alignment
Fix ChannelEx struct alignment
2020-03-14 22:23:13 +01:00
Flyinghead e3313d27b2 custom texture: stop loader thread before loading state 2020-03-13 18:01:33 +01:00
Flyinghead 4e73af0f94 Mem leaks in input mapping/jvs/x11. Fix crash when latin-1 char is input
Fix warnings
2020-03-12 16:09:05 +01:00
Flyinghead aff2b9e1af fix simple texture bleeding case when upscaling. Clean up 2020-03-11 17:55:13 +01:00
Flyinghead 8567c42b30 gl4: Use GL_LINEAR_MIPMAP_LINEAR for mipmapped textures
improve custom texture packs rendering quality
2020-03-10 17:55:44 +01:00
Flyinghead a5171a1d09 gl,gl4: don't use GL_NEAREST_MIPMAP_LINEAR if tex isn't mipmapped
fixes black grass in Virtua Striker 2
2020-03-10 15:32:17 +01:00
Flyinghead 0b6b6339ed nvmem: generate console ID at startup. rec-x64: Call stack alignment
Generate console ID in dc_nvmem.bin if blank. Used by chuchu rocket
login.
Align stack to 16-byte
2020-03-10 14:47:45 +01:00
Flyinghead 5b644cf1ca gl: switch to GL_NEAREST_MIPMAP_LINEAR for mipmapped textures 2020-03-09 23:29:02 +01:00
Flyinghead 03f096384b generate mipmaps for custom textures when needed 2020-03-09 22:49:05 +01:00
Flyinghead 015dcf117d naomi: enable lightgun if one is connected 2020-03-09 21:03:54 +01:00
Flyinghead 797dabe11f Add more buttons for arcade games. Show arcade mapping in UI.
Issue #40
2020-03-09 19:44:16 +01:00
flyinghead 93bedb91f1 Merge pull request #39 from scribam/alignas
Replace DECL_ALIGN macros by alignas
2020-02-29 12:19:26 +01:00
scribam 53bde38035 Replace DECL_ALIGN macros by alignas 2020-02-27 22:17:33 +01:00
Flyinghead 21f1517a5f dsp x64: use returned code buffer ptr on windows cuz it's reallocated
fixes dsp crash on windows
2020-02-27 11:52:00 +01:00
Flyinghead 99f04ec753 nuke softrend 2020-02-26 23:41:05 +01:00
Flyinghead 1b8c2a63c2 stop being permissive 2020-02-26 23:00:29 +01:00
Flyinghead f7e811e463 x64 dsp: OSX fix 2020-02-26 19:46:46 +01:00
Flyinghead 091c14c78a X64 dsp jit compiler
fix clamping in arm64 dsp
2020-02-26 18:38:05 +01:00
Flyinghead 6bfde76514 vk: avoid calling List::head() in loops 2020-02-25 16:34:49 +01:00
Flyinghead 0ef54aa16b vram32 small optim 2020-02-25 12:55:26 +01:00
Flyinghead dd29a62811 remove buggy LimitFPSAuto option 2020-02-25 12:52:21 +01:00
Flyinghead 0ff22ed0a6 custom tex: disable mipmapping when dumping textures 2020-02-21 16:16:54 +01:00
Flyinghead 75bfd25224 custom tex: support v1 (content+pal) and v3 (...+format) hashes only 2020-02-19 18:48:56 +01:00
Flyinghead e2b3ef147d custom tex: recreate gl/vk texture when loading custom tex. vk crash 2020-02-19 14:31:35 +01:00
Flyinghead 1cf4c36ede disable div matching for Donald Duck Goin' Quackers 2020-02-17 18:26:14 +01:00
Flyinghead 9f565f2d41 vulkan: corrupted textures with mipmap and xBRZ 2020-02-17 18:26:14 +01:00
Flyinghead 3ddce6dd45 fix crash when enabling xBRZ filtering 2020-02-17 18:26:14 +01:00
Flyinghead 8a9400ca29 GD: Implement ATA_IDENTIFY as per qemu 2020-02-11 21:25:01 +01:00
Flyinghead 84ba8afe0f Ignore tex address and stride in texture hash 2020-02-09 23:08:11 +01:00
Flyinghead c126880e57 osx build fix 2020-02-08 13:40:17 +01:00
flyinghead 38c81dd212 Merge pull request #37 from scribam/zip
zip: use the public api to get a file from crc
2020-02-08 11:36:23 +01:00
scribam 29f2391230 zip: use the public api to get a file from crc 2020-02-07 22:47:18 +01:00
Flyinghead 3f7ea1fda9 fix crash for 1x1 TW textures 2020-02-07 20:41:59 +01:00
Flyinghead 391cbdc044 restore previous twiddle table for non-square tex 2020-02-07 19:13:23 +01:00
Flyinghead dd80114bf7 osx build fix 2020-02-07 17:01:42 +01:00
Flyinghead 9826afa063 upload all texture mipmap levels to gpu
implemented for gl/gl4/vulkan/oit
don't auto-generate mipmaps in vulkan
simpler/smaller detwiddle table
use std::lock_guard with cMutex
2020-02-07 16:55:32 +01:00
Flyinghead 49c6a55f24 vulkan oit: pass native blend function values to shader, not vulkan ones
Fixes missing texture in Plasma Sword start screen
2020-02-06 11:39:05 +01:00
Flyinghead 333b21fac4 Fix .elf support. Init aica irq mask/level during HLE boot
BSC PCTRA is 32-bit wide
2020-02-05 18:02:44 +01:00
Flyinghead 5f604d3bcb switch to TV composite if RGB not supported 2020-02-04 11:49:17 +01:00
Flyinghead dcf5444acc stop cdda when reading sector 2020-02-02 21:15:53 +01:00
Flyinghead f9d8733604 reios: fix regression due to non-zero GDROM sense codes at startup 2020-02-02 11:07:32 +01:00
Flyinghead b79c074444 axe wchar 2020-01-31 23:51:12 +01:00
Flyinghead d476b7901a axe snat 2020-01-31 23:23:26 +01:00
Flyinghead 80a0f467d7 fix crash when screen scaling is custom. fix rpi3 build
DiscSwap and InitDrive are now the same
2020-01-31 18:33:16 +01:00
Flyinghead 2510964047 Force use of real BIOS when booting BIOS 2020-01-31 11:59:19 +01:00
Flyinghead 276a77ec26 android: get rid of deprecated boot and disk swap funcs 2020-01-31 11:36:40 +01:00
Flyinghead 79fef77099 Open CDI/GDI/CHE/CUE with their corresponding driver only
don't crash or leak memory when opening an invalid or empty GDI or CUE
file.
Better error reporting
2020-01-31 10:35:10 +01:00
Flyinghead e017fba9c1 vulkan: fix scissoring when SSAA > x1 in widescreen mode 2020-01-30 20:08:30 +01:00
flyinghead d6fe3526a4 Merge pull request #35 from vkedwardli/enable-upscaling
Enable upscaling for up to 8x SSAA
2020-01-30 19:03:15 +01:00
Flyinghead aaaf093af7 Allow ejecting and changing the disk while in-game 2020-01-30 19:01:47 +01:00
Edward Li 1d72f66de9 Enable upscaling for up to 8x SSAA 2020-01-30 03:31:42 +08:00
flyinghead a45bd364ba Merge pull request #34 from scribam/msvc-fixes
msvc build fixes
2020-01-28 22:43:06 +01:00
scribam 4161ca9b07 msvc build fixes 2020-01-28 19:08:22 +01:00
Flyinghead aac665e617 better joystick handling for wldkicks. fix blockpong controls
limit magnitude of joystick for wldkicks
fix blockpong controls (reverse x axis)
2020-01-27 22:08:39 +01:00
Flyinghead 76d7e8b653 naomi: wldkicks inputs 2020-01-26 23:23:59 +01:00
flyinghead 476f6245b1 Merge pull request #33 from vkedwardli/fix-mbp16-retina-rendering
Handle Retina / DPI correctly
2020-01-26 23:23:20 +01:00
Edward Li 0ba07d98e7 Handle Retina / DPI correctly 2020-01-27 06:10:24 +08:00
Flyinghead 0d9214df40 replace Array with std::array 2020-01-25 11:00:34 +01:00
Flyinghead 12193f9510 fix serialize crash 2020-01-25 09:56:26 +01:00
Flyinghead 5c33ae47b3 osx build fix 2020-01-25 00:11:19 +01:00
Flyinghead 81c9312fb4 naomi: use crc to find roms 2020-01-24 23:55:54 +01:00
Flyinghead 7d33816d25 naomi: fix reboot. clean up
fix reboot (and exiting service menu) by disabling legacy dimm board
emulation
clean up. typo in var name
2020-01-24 23:30:16 +01:00
Flyinghead 48efdac9b4 naomi: open by crc for zip and 7z. add mvsc2u crc rom info 2020-01-24 21:55:12 +01:00
Flyinghead 573a298bba naomi: emulate mazan inputs 2020-01-24 15:43:19 +01:00
flyinghead 2181508eed Merge pull request #32 from scribam/appveyor
appveyor: speed up compilation time
2020-01-23 23:49:56 +01:00
scribam 9266457c62 appveyor: speed up compilation time 2020-01-23 18:46:36 +01:00
Flyinghead ff69efff48 ignore trilinear filtering if texture isn't mipmapped
fixes shenmue snowflakes color
2020-01-21 19:52:09 +01:00
Flyinghead ef3512a2f3 gl4: fix blending issue when autosort=0
Fixes Sturmwind menu
2020-01-20 22:37:24 +01:00
Flyinghead 31651c2ac6 more build fixes 2020-01-20 13:49:29 +01:00
Flyinghead 81c7c37707 build fix 2020-01-20 13:27:04 +01:00
Flyinghead 3e6bef3cc0 option to pipe the dc serial port to a pty on linux
allow the use of dcload-serial
2020-01-20 13:22:36 +01:00
Flyinghead 3b83a4e4d5 minor changes 2020-01-16 22:19:07 +01:00
Flyinghead cbf81e772f disable div matching for more games 2020-01-16 21:49:53 +01:00
Flyinghead 2b389a2142 no div matching for Aqua GT. Set correct input board for mazan
non functional changes
2020-01-15 22:50:07 +01:00
Flyinghead 7f30c7078d pvr: better saturation of colors when converting tex to higher precision 2020-01-15 10:55:25 +01:00
Flyinghead 8cadf0a775 arm32: fix xtrct dynarec implementation
Fixes Speed Devils issues
2020-01-09 13:25:31 +01:00
Flyinghead ed1bea6a35 Get rid of the pregap for .CUE audio tracks
Fixes Bangai-O CDDA delay
2020-01-09 13:25:31 +01:00
Flyinghead 4fa18dbaea arm64: fix xtrct dynarec implementation
Fixes Speed Devils issues
2020-01-09 13:25:31 +01:00
flyinghead ad67f9bbb9 win32: fix savestate file path with mixed / and \ 2020-01-08 19:00:56 +01:00
flyinghead 4973c5a27d Merge pull request #31 from flyinghead/fh/vulkan
Merge Vulkan branch into master
2020-01-08 12:53:03 +01:00
Flyinghead 678fc54934 cue: Set proper CTRL value
Fixes WinCE games hanging at startup
2020-01-08 11:30:46 +01:00
Flyinghead d8cef3f6a9 Merge branch 'fh/vulkan' of https://github.com/flyinghead/flycast into fh/vulkan 2020-01-08 11:00:31 +01:00
flyinghead 36a7c00507 win32: fix crash when switching to vulkan
fix recursive call to VulkanContext::Init
still crashing when starting with vk and switching to GL
2020-01-08 10:58:24 +01:00
Flyinghead 17501e880e vmem: unmap all reserved vmem at exit 2020-01-07 20:45:44 +01:00
Flyinghead efdc92479a fix SerializeTest.SizeTest 2020-01-07 20:26:26 +01:00
Flyinghead 1b49bdd31e reduce save states size by ~20mb 2020-01-07 20:13:33 +01:00
Flyinghead 2f3b4fae53 awave: use light guns for Ranger Mission and Extreme Hunting 2020-01-07 20:10:59 +01:00
Flyinghead 43d924ceae vulkan: reset physical device at init
don't use PhysicalDeviceProperties2KHR with vulkan 1.0
tentative fix for issue #30
2020-01-06 21:33:31 +01:00
Flyinghead 73d34a9ab5 aica: generate samples when arm is disabled (dynarec)
Restores sound in Twinkle Star Sprites when dsp is enabled
Fix armwrestler MOV and LDR dynarec errors
Better cycle counting
2020-01-06 20:53:49 +01:00
Flyinghead a6839f57e7 vulkan: only use per-pixel sorting when needed 2020-01-05 23:03:44 +01:00
Flyinghead f7655091b0 gl4: only use per-pixel sorting when needed
if not using autosort, there's no need to use per-pixel sorting
fixes issues with Psyvariar2 and HeadHunter
2020-01-05 20:44:39 +01:00
Flyinghead cdeba9b03e android: screen resizing ignored with gl 2020-01-04 16:41:45 +01:00
Flyinghead 214a15073e android: add debug keystore to avoid upgrading errors 2020-01-04 10:41:09 +01:00
Flyinghead 76b7970589 osx: xcode 11 / swift 5 2019-12-26 21:41:44 +01:00
Flyinghead d49373b0f9 vulkan: VMU display
Reset pipeline when switching per-triangle/per-strip
Adreno workaround test typo
clean up
2019-12-25 13:09:54 +01:00
Flyinghead be50fca2d6 gl: (oit) Far plane is 0 in final depth test. minor gl cache reset fix
other misc changes
2019-12-25 13:05:42 +01:00
Flyinghead b975f5d4bd chd: use after free 2019-12-23 18:29:14 +01:00
Flyinghead 13de6b9a1e pvr: avoid TA data buffer overflow and raise Object List overflow int
fixes Ooga Booga crash/hang in offline and online multiplayer
2019-12-23 12:25:45 +01:00
flyinghead 3415ce5577 win32: detect platform. SDL support 2019-12-22 23:49:52 +01:00
flyinghead 424a02cdf3 vulkan: workaround for intel driver bug when depth write is disabled
backport adreno driver translucent modvol workaround
2019-12-22 17:48:24 +01:00
Flyinghead a5a71bec0b Arm7: Fix reads from PC
When using dynamic shift, PC is offset by 4 due to pipeline effects
merge from upstream
2019-12-18 19:22:42 +01:00
Flyinghead 3294b36961 limit dc analog axes magnitude 2019-12-17 23:41:32 +01:00
Flyinghead 12b9b7254a reduce precision of FIPR and FTRV sh4 ops on x86 platforms 2019-12-17 20:23:58 +01:00
Flyinghead 7ab275d4b5 naomi: faster gdrom loading 2019-12-15 21:22:51 +01:00
Flyinghead 29fd406dd8 vulkan: crash on windows when switching from gl to vulkan
Destroy and recreate window when switching from gl to vulkan
VkGetPhysicalDeviceProperties2 crash with old nvidia driver (376)
2019-12-14 17:53:01 +01:00
Flyinghead 553343e698 suport latest lr core savestate format 2019-12-13 12:59:35 +01:00
Flyinghead 530cdaa23f use doubles to emulate FIPR on x86. avoid crash with per-game config
Don't store the renderer type in per-game config as this crashes.
Fixes Sonic Adventure falling off track
Other non-functional changes
2019-12-13 12:27:43 +01:00
Flyinghead c683e0ded8 vulkan: push constants when starting render pass to avoid crash (mali) 2019-12-11 22:31:35 +01:00
Flyinghead 78987074a6 renderer: add 32bpp conversion routines for bump map textures 2019-12-10 16:15:14 +01:00
Flyinghead 5ac104fb0e Disable startx/starty crt shifts for now. vk: fix OIT buffer size issue 2019-12-10 15:19:41 +01:00
Flyinghead 066093553f vulkan: copy provoking vertex. crash when rtt2vram. rtt vram stride
setImageLayout was missing TransferSrcOptimal as source layout
Vulkan needs the first vertex to be the provoking vertex so copy 3rd on
1st when flat shading.
VRAM stride was incorrect (RTT to VRAM)
2019-12-10 12:51:10 +01:00
Flyinghead 637ad3b214 vulkan: delay destroying in-flight images. Fix inside clipping.
Keep in-use imave and image views when the texture is updated.
Fix inside clipping (18 wheeler rear mirror)
Wait until the graphics queue is idle before changing shared buffers and
attachments.
Refactoring
2019-12-09 19:37:14 +01:00
Flyinghead 3b86c57d0e texture corruptions with some wince games
vram wasn't protected in some cases
Worms World Party, Tomb Raider - Final Revelation, Hundred Swords
2019-12-09 13:17:58 +01:00
Flyinghead a1981c48b6 vulkan: transition oit depth attachment after init. Avoid empty buffer 2019-12-08 22:39:30 +01:00
Flyinghead 6439e01087 pvr: force background plane not textured 2019-12-08 22:31:08 +01:00
Flyinghead 369624b28f vulkan: check if api 1.1 is available. fix screenshot R&B swap 2019-12-08 22:22:40 +01:00
Flyinghead a331c7bd84 vulkan: missing BeginFrame call 2019-12-07 22:13:22 +01:00
Flyinghead 9acbfae25d vulkan: don't allocate more than allowed 2019-12-07 22:12:14 +01:00
Flyinghead e14115683e vulkan: don't use anisotropic filtering with nearest. Set max to 4
fixes issues with adreno
2019-12-06 17:16:59 +01:00
Flyinghead 4730da31d5 vulkan: fix modvols. fix depth-write disabled poly. optimizations
stencil must be reset to zero if poly isn't shadowed -> fixes jet set
radio "see-through" shadows
take culling into account for modvols
oit: reduce per-pixel and per-poly mem usage
oit: framebuffers weren't resized when needed
oit: poly with depth write disabled weren't drawn (Soul calibur missing
water surface)
Fix glsl error when two-volume mode needs fog attachment
2019-12-05 18:48:54 +01:00
Flyinghead 21b2eb3e5d vulkan: fix clipping (alpilot black screen) 2019-12-04 19:06:14 +01:00
Flyinghead cd49b32473 vulkan: allocate oit buffers in device-local mem. NVidia fixes
BufferData was always allocated in host visible mem, regardless of the
mem property argument.
NVidia gpus don't support blitting to 565 and 5551, which is needed for
mipmaps, so convert to 8888 instead.
Use optimal tiling for oit pointers image (linear not supported by
nvidia and probably slower anyway)
oit screen drawer uses multiple final attachments
Set non-oit depth attachment as transient and lazily allocate mem
2019-12-04 15:51:26 +01:00
Flyinghead 8f80b427df vulkan: move oit renderer to own directory 2019-12-04 09:41:27 +01:00
Flyinghead 5f265d03fe vulkan: use a chain of final color attachments
glcache: clear tex param cache
2019-12-03 21:29:37 +01:00
Flyinghead 6865d74a85 vulkan: use last rendered frame as background for ui 2019-11-30 12:14:36 +01:00
Flyinghead cf7aa4f310 vulkan: disable debug 2019-11-29 19:54:43 +01:00
Flyinghead 0280fcc9d4 vulkan: render to temp fbo then to screen
renderers render to image which is blitted to the screen by the context
batch texture updates command buffers and submit once
fix screen scaling
2019-11-29 19:28:22 +01:00
Flyinghead dae0908735 vulkan oit: fix imgui overlay
re-init imgui with the oit render pass when running game. use regular
render pass otherwise.
2019-11-26 18:28:48 +01:00
Flyinghead ed538f7dce vulkan: osx and arm32 build fix 2019-11-26 12:12:43 +01:00
Flyinghead 554d8005fa gl: #version must be on first line or Mali compiler complains 2019-11-26 11:08:35 +01:00
Flyinghead a944cd08c6 vulkan: use amd mem allocator 2019-11-26 10:42:44 +01:00
Flyinghead 2c26d379df renderer: fix scissoring with hscale, pixel_double, vscale...
Fixes Wacky Races, ECW Hardcore and Cho - Hatsumei Boy Kanipan cropped
screen
2019-11-18 15:57:18 +01:00
Flyinghead a4053715af vulkan: skip TR & final pass on first frame before clearing buffers 2019-11-15 11:24:00 +01:00
Flyinghead 01af8e5f5e vulkan: fix texture LoD, enable anisotropic filtering
fixes textures being grainy when seen from a distance
2019-11-15 11:17:01 +01:00
Flyinghead 78eb1829d8 gles2: calculate fog depth in vertex shader in case highp not supported
Mali-400/450 don't support highp floats in the fragment shader. This
causes overflows when computing fog density in some game scenes. To work
around that, calculate fog density in vertex shader and use
interpolation.
vulkan,gl: Get rid of extra_depth_scale in fragment shader by
integrating it in fog density
2019-11-14 22:10:40 +01:00
Flyinghead 09f5d25133 vulkan: automation screenshot. less code duplication
fix assert on exit due to not released vmem
fix crash when resizing window
2019-11-13 20:08:14 +01:00
Flyinghead 9928af2506 vulkan: terminate shader compiler only once if inited
fixes assert/crash when switching rendering api
2019-11-13 12:56:40 +01:00
Flyinghead 72c2ee1008 vulkan oit: RTT support
Fix Tr modifier volumes mem barrier
Simplify desc sets
2019-11-12 19:39:58 +01:00
Flyinghead 7b8840a330 Merge remote-tracking branch 'origin/master' into fh/vulkan 2019-11-10 21:01:29 +01:00
Flyinghead 8f86be37f0 fix travis ci deploy to S3 2019-11-10 20:48:09 +01:00
Flyinghead 25fb888d26 vulkan oit: get rid of depth2 attachment 2019-11-10 17:59:21 +01:00
Flyinghead c10f075266 vulkan: OIT renderer WIP 2019-11-10 11:27:19 +01:00
Flyinghead b8c1d6657d vulkan: quad buffer, extract shader compiler
fetch color format, storage buffer alignment and stores/atomics support
at init
support for framebuffers used as input attachments
use Allocator instead of VulkanAllocator
return handles instead of unique handles
2019-11-10 10:16:18 +01:00
Flyinghead c3b958c521 first attempt at a unit test 2019-11-04 21:37:16 +01:00
Flyinghead 56dfeb6722 mmu: missing template instances in the slow mmu 2019-11-03 21:27:06 +01:00
Flyinghead f0538eac20 flash: don't abort on invalid access size 2019-11-03 21:25:18 +01:00
Flyinghead 84bdcd9a10 G2: Add Dev Device DMA
backport from upstream
2019-11-03 21:24:28 +01:00
Flyinghead 0e12da4395 DMAC: Add LMMODE1 for ch2-dma, add basic DMAC based dma support
backport from upstream
clean up
2019-11-03 21:22:46 +01:00
Flyinghead 27fd0d4262 aica: LFORE is not cleared automatically 2019-11-03 18:23:25 +01:00
Flyinghead a7926a2357 serial: backport from upstream. Clean-up 2019-11-03 18:12:16 +01:00
Flyinghead b7dd8f16d4 vmu: avoid flashram buffer overflow 2019-11-03 17:08:34 +01:00
Flyinghead 4cc199b2b7 minimize writes to config file 2019-10-29 14:34:29 +01:00
flyinghead b9970fc3da Merge pull request #26 from vkedwardli/fix-naomi-customtextures
Custom Textures / Dump Textures supports NAOMI also
2019-10-27 12:12:07 +01:00
Flyinghead 5d6ac0acbb gl: const everything 2019-10-25 22:47:20 +02:00
Flyinghead ba51c873d0 vulkan: fix missing geometry in multipass 2019-10-25 22:30:34 +02:00
Vai Kong Edward Li 5772e2a679 Custom Textures / Dump Textures supports NAOMI also 2019-10-26 03:56:59 +08:00
Flyinghead 920e2bf039 vulkan: return Device instead of UniqueDevice from context 2019-10-25 19:20:15 +02:00
Flyinghead 4ca5d4f577 osx: fix the fucking project file for the billionth time + 1 2019-10-23 19:50:08 +02:00
Flyinghead 5e4dacfa67 Fix renderer selection issue in gui. Use raw strings for shader source 2019-10-23 19:23:19 +02:00
Flyinghead 07958f08ae refactor xform matrix out of gles. use xform matrix in vulkan 2019-10-23 18:13:28 +02:00
Flyinghead 2f363a7355 Merge remote-tracking branch 'origin/fh/gl-scale-mat' into fh/vulkan
# Conflicts:
#	core/rend/TexCache.h
#	core/rend/gl4/gles.cpp
#	core/rend/gles/gles.cpp
#	core/rend/gles/gles.h
#	shell/apple/emulator-osx/reicast-osx.xcodeproj/project.pbxproj
2019-10-21 19:49:53 +02:00
Flyinghead 0dc4b07538 pvr: use a switch instead of 100 ifs 2019-10-21 19:13:29 +02:00
Flyinghead d27142f565 maple: don't write past the vmu capacity 2019-10-21 19:09:01 +02:00
Flyinghead 86818389ac move texture cache to a template class. vulkan: OSD on android
store texture in the cache map instead of the heap
make related functions member of the class (CollectCleanup, killtex ->
Clear)
refactor common OSD stuff into rend/osd
vulkan support for OSD
2019-10-21 16:39:16 +02:00
Flyinghead 2a89874812 decouple imgui from gles renderer 2019-10-19 18:34:24 +02:00
flyinghead ca4753cf7c win32 build fix 2019-10-18 21:03:00 +02:00
Flyinghead 664bfe6fa3 sdl: only compile when using sdl 2019-10-18 22:23:29 +02:00
Flyinghead fe1f2dc93a OS X build fix 2019-10-18 22:21:12 +02:00
Flyinghead 6611e9bf5e gl: refactor wsi into their own class.Allow dynamic vk<->gl switch 2019-10-18 21:57:08 +02:00
Flyinghead ac310114fe Disable total frame count for CHD to allow patched/homebrew 2019-10-16 16:08:32 +02:00
flyinghead dffaed7dd9 vulkan: prefer optimal depth format. use same format for rtt
Try to find an optimal depth format then fall back to linear
Use same depth format for rtt depth attachments
Allow RenderToTextureBuffer setting to be changed at runtime
Enable vulkan on windows
2019-10-16 10:40:06 +02:00
Flyinghead 589cd5c52f OSX build fix 2019-10-15 22:01:47 +02:00
flyinghead c3cbfbdfb0 vulkan: android build fix 2019-10-15 21:50:42 +02:00
flyinghead a6c56ba748 vulkan: windows support 2019-10-15 21:25:24 +02:00
Flyinghead 43d87877be vulkan: some ui 2019-10-15 16:52:02 +02:00
Flyinghead d28a7f45c5 vulkan: android support
align uniform buffers according to physical device requirements
destroy old swap chain before creating new one
some drivers don't support some 16-bit texture formats for optimal
tiling
2019-10-15 16:49:20 +02:00
Flyinghead e3a997b642 vulkan: direct framebuffer writes support
alternate between 2 texture drawers
Fix scissor scale when pixel_double is on
Ingore Present() when nothing has been rendered
2019-10-14 17:41:49 +02:00
Flyinghead fb52b38ac3 texture upscaling was missing some paletted alpha channel formats
Fixes dark pixels on edges when using xbrz upscaling (Capcom vs SNK 2)
2019-10-14 15:15:20 +02:00
Flyinghead f8d4b08618 vulkan: increase some descriptor pool sizes. Use 3 swap chain images 2019-10-13 22:40:11 +02:00
Flyinghead 4c29a9bad7 vulkan: better tile clipping 2019-10-13 22:01:20 +02:00
Flyinghead af0b0eac42 vulkan: mipmap support 2019-10-13 18:42:28 +02:00
Flyinghead 06e1456d4f vulkan: memory allocator 2019-10-12 13:48:41 +02:00
Flyinghead 6304b1e9c1 Fix verify() and die() macros 2019-10-12 13:48:41 +02:00
Flyinghead 459a2b973e vulkan: make staging buffer visible to host for rtt2vram. Minor changes 2019-10-12 13:48:41 +02:00
Flyinghead 2bac2afe98 gles: fix depth issue when drawing quads on gles2
Fix Gunlord black screen on GLES 2
2019-10-12 13:48:41 +02:00
Flyinghead abf8dd42c3 OSX add files to project 2019-10-09 23:05:23 +02:00
Flyinghead e9ecda2b31 vulkan: fix regression on color blending state 2019-10-09 22:59:01 +02:00
Flyinghead 970d959772 gles: build fix 2019-10-09 22:49:29 +02:00
Flyinghead becdd213fe android: build vulkan renderer 2019-10-09 22:44:06 +02:00
Flyinghead 6406523720 vulkan: RTT support 2019-10-09 21:18:06 +02:00
Flyinghead 38f50c1b5a gles: refactor rtt vram writeback out of gles 2019-10-09 21:14:31 +02:00
Flyinghead e09e895f22 vulkan: better image update. Don't kill in-flight command buffers
Transition images back to transfer and update them instead of
deleting/recreating.
Keep track of in-flight texture command buffers and free them when idle.
2019-10-07 17:45:11 +02:00
Flyinghead b790a336e9 vulkan: modifier volumes 2019-10-07 12:30:56 +02:00
Flyinghead 8d520fa5e4 vulkan: per-triangle sorting 2019-10-06 21:21:31 +02:00
Flyinghead b82a97853f vulkan: fog support 2019-10-06 17:02:17 +02:00
Flyinghead 8f8f270cfc vulkan: use separate command buffer to upload tex. Limit desc set size. 2019-10-06 14:31:39 +02:00
Flyinghead 751f30003d rend: fix stride regression introduced in 24b973f7
Fix YUV textures corruption
2019-10-06 14:16:12 +02:00
Flyinghead ebec2966d7 vulkan: create SamplerManager. Use staging buffer for textures
Samplers shouldn't be tied to a texture
Using a staging buffer fixes most texture glitches
2019-10-06 12:24:07 +02:00
flyinghead d1b69d4cd6 Merge pull request #21 from scribam/std-string
gui: Replace "std:string" by "std::string"
2019-10-06 11:16:04 +02:00
scribam 1e54de93fa gui: Replace "std:string" by "std::string" 2019-10-06 10:58:44 +02:00
Flyinghead 5b35b52fda vulkan: fix uniforms alignment. Use push constants for per-poly params
Fix clipping, trilinear alpha
Imgui FPS counter
2019-10-05 23:29:39 +02:00
Flyinghead 929976c147 android build fix 2019-10-05 18:45:42 +02:00
Flyinghead fc752e6efb proper OSX build fix 2019-10-05 19:44:25 +03:00
Flyinghead bbab62810a OSX build fix 2019-10-05 19:29:23 +03:00
Flyinghead d23b7bff7b vulkan: recreate swap chain on resize. flush samplers when updating tex 2019-10-05 16:09:28 +02:00
Flyinghead 27e9acaac6 rend: refactor ReadFramebuffer() out of gles 2019-10-05 16:06:07 +02:00
Flyinghead 355ed998e5 vulkan renderer - WIP 2019-10-05 11:50:14 +02:00
Flyinghead b1defae3f7 vulkan renderer - WIP 2019-10-05 11:50:14 +02:00
flyinghead edd2e738cb Merge pull request #20 from scribam/msvc-sln
msvc: Fix Visual Studio solution
2019-10-05 09:31:32 +02:00
scribam 45b3ba6581 msvc: Fix Visual Studio solution 2019-10-04 19:33:41 +02:00
Flyinghead 8202ac420b pvr,rend: more refactoring out of gles. Change texture id to 64b 2019-10-04 13:33:08 +02:00
Flyinghead 24b973f763 rend: refactor texture cache and poly/triangle sorters out of gles 2019-10-04 12:22:18 +02:00
Flyinghead 8eac844825 OSX build fix 2019-09-30 20:14:46 +03:00
Flyinghead dde8bf3b42 arm32: support 64b immediate mem writes 2019-09-30 16:53:08 +02:00
Flyinghead bad10bae20 dyna: only protect ram when needed. Use const ref to avoid copies
avoid extra op in x64 rec
2019-09-30 15:47:05 +02:00
Flyinghead 87023c722d Hide unsafe optimizations on all but arm32 platform
Non-functional changes
2019-09-30 15:36:39 +02:00
Flyinghead 834082519d ini: use reference to avoid copies. simplify 2019-09-30 15:33:19 +02:00
Flyinghead 6ab8b185c8 Protect vram pages only when needed. Use lambda for xbrz paralleliz.
Each vram page is now protected only once.
Get rid of std:function and std::bind and use lambda expressions.
2019-09-30 15:31:06 +02:00
Flyinghead 0595bae85b dyna: use xxhash instead of sha1 to hash code blocks 2019-09-29 23:14:38 +02:00
Flyinghead 9d3ee3b57f dyna: get rid of SmcCheckLevel options. Fix rec-cpp
Block check is now full or off depending on block protection
rec-cpp: Add missing opcode call classes and allow for immediate args
2019-09-29 18:18:46 +02:00
Flyinghead 84e0f9f118 aica: get rid of old sync dma timing 2019-09-28 22:34:36 +02:00
Flyinghead 3dac86d8f4 outdated stuff 2019-09-28 20:00:20 +02:00
Flyinghead c07c32eea0 Remove esinfo, WorkDir 2019-09-28 19:38:03 +02:00
Flyinghead dc228d0710 Fix memory leak in chdr lib 2019-09-28 19:29:29 +02:00
Flyinghead f0dfc61975 naomi: gd cart memory leak 2019-09-28 18:56:58 +02:00
Flyinghead 106dfc3f71 Add Discord link. non-functional changes 2019-09-27 22:00:52 +02:00
Flyinghead 88a5acd9e6 aica arm: mask pc using max aica ram, not actual, in entry points
Fix crash in Sturmwind, Volgarr and Gunloard
2019-09-27 15:57:39 +02:00
Flyinghead 920bb44c30 More widescreen cheats 2019-09-27 14:41:59 +02:00
Flyinghead 419785b929 arm64: support for 64b immediate memory reads 2019-09-27 14:40:47 +02:00
Flyinghead ae4f378747 Add fast-forward mode
Fix buttons.png not being created if not first run
2019-09-27 14:15:29 +02:00
Flyinghead 219a001631 pvr: eliminate empty polygons and render passes
initialize sprite face base & offset colors to white
never join TR poly strips
re-enable depth after mod vols
2019-09-25 23:28:53 +02:00
Flyinghead bb89cb5c22 pvr: calculate emu speed over the last 2 frames in sync render
Games that do multiple renders per frame may hit a condition where one
of the renders is systematically dropped in synchronous render mode.
2019-09-25 21:08:39 +02:00
Flyinghead 90dbaa5edd gui: disable stencil test 2019-09-25 20:25:01 +02:00
Flyinghead 334211f3a0 gl: build fix 2019-09-25 15:44:21 +02:00
Flyinghead 3fd3e097ac gl: fix modvol issue introduced by 8792c06 2019-09-25 13:54:38 +02:00
Flyinghead 64a463997c osx: add files to project 2019-09-25 01:16:16 +03:00
Flyinghead 9b063644c4 Per-game widescreen cheats
New option to make games render in 16/9 anamorphic format and stretch
screen to correct aspect ration.
2019-09-24 23:59:36 +02:00
Flyinghead 943a50b9bc gl4: translucent modifier volumes need inverted depth too 2019-09-23 19:37:01 +02:00
Flyinghead f599891e08 pvr: face color and offset color should not be reset if not set
it's expected that polygons can reuse previous values for these colors
even for not immediately following polygons.
2019-09-22 20:00:09 +02:00
Flyinghead 55880b0dd4 537c2a4 broke rtt rendering 2019-09-22 18:20:43 +02:00
Flyinghead e85b724085 vmem: mprotect P2 vram space
Used by NHL 2K2 yuv textures
Fixes FMV not being updated
2019-09-22 10:29:53 +02:00
Flyinghead 537c2a4ed6 pvr: reset face and offset colors when not set in poly param
Fixes black ice in NHL 2K2 and black players in NHL 2K
Clean up
Don't build soft renderer
2019-09-21 22:53:09 +02:00
Flyinghead 69041912e3 x11: clear window at startup. Set icon and class 2019-09-20 19:02:54 +02:00
Flyinghead c408867ead pvr: reset tileclip value when resetting TA parser
fixes black players in NHL 2K with hle bios
2019-09-20 15:36:49 +02:00
Flyinghead b693d1c054 aw: set rom key in game list (mameset 0.213)
backport lr changes
2019-09-19 16:15:18 +02:00
Flyinghead e7a33e6de1 reios: allow hle savestates to be loaded in non-hle mode
Always initialize reios hooks during startup so hle savestates always work.
Fix bios loading logic for naomi/aw
2019-09-19 11:49:19 +02:00
Flyinghead 38c9eea50a reios: implement PLAY_SECTOR
fixes Sega Rally 2 missing bgm music in hle mode
2019-09-19 11:36:59 +02:00
Flyinghead 8792c06adc gl4: use same depth direction as gles. Round scale_y value. 2019-09-17 13:35:23 +02:00
Raph 732e685ea7 gl4: unbind the depth tex from the fbo before reading from it
fixes diagonal pixel line issue with AMD gpu
should help issue #16
2019-09-15 18:30:44 +02:00
flyinghead 24d663b40d Merge pull request #17 from scribam/msvc-cvt_f2i_t
msvc/sh4: Compilation fix for cvt_f2i_t
2019-09-15 17:03:49 +02:00
scribam 4dd6ccea8d msvc/sh4: Compilation fix for cvt_f2i_t 2019-09-15 13:37:11 +02:00
Flyinghead 8194254fa1 pvr: restore TA ctx after rendering framebuffer
fixes Sakura Taisen 4 hang when starting game
2019-09-13 12:31:10 +02:00
Flyinghead ed90bcebee partially revert 1a019b79b0
move the punch-through alpha test back to where it was (before shading)
fixes SF Rush missing chars on copyright screen
2019-09-12 18:54:14 +02:00
Flyinghead 2bcc3c574b pvr: ignore data sent to TA if no prior list init
fixes Vigilante 8 freeze during FMV sequence
2019-09-12 15:07:57 +02:00
Flyinghead 1174bce64a dynarec: set correct sign on result if float conv returns indefinite
canonical implementation, x86/x64 only
2019-09-12 15:06:21 +02:00
Flyinghead 25a2c52960 pvr: crash when CurrentPP is null 2019-09-11 23:21:14 +02:00
Flyinghead 2bdfdf96c1 gl4: fix invisible framebuffer direct writes with hle bios
Fixes hidden & dangerous black screens in hle bios mode
2019-09-11 21:10:02 +02:00
Flyinghead 8b949e1dca Get rid of time_sync timer. Clean-up 2019-09-11 15:09:23 +02:00
Flyinghead a19c73de7b Fix some sh4 regs hard reset 2019-09-11 15:00:08 +02:00
Flyinghead b2ee35f82e aica: initialize regs with half-words 2019-09-11 14:54:24 +02:00
Flyinghead e1368f9713 reios: First polygon wasn't displayed in some cases 2019-09-11 14:08:54 +02:00
Flyinghead 11c95c41d3 Hide legacy Naomi roms (.bin, .dat. lst) by default 2019-09-10 21:56:58 +02:00
Flyinghead 08d7cc68fd aica: use log scale for attack phase
Change AEG starting envelope value from 3ff to 280
Use log scale instead of linear during attack phase
2019-09-10 16:21:51 +02:00
Flyinghead 0bd95cbba8 Delay Frame Swapping option to enable FB_R_SOF == FB_W_SOF detection 2019-09-09 14:58:53 +02:00
Flyinghead fbdbd2491d aica: implement pitch LFO and LPF envelope
simplify channel serialization
optimize aica channel reg write callbacks
2019-09-09 11:32:03 +02:00
flyinghead afc8398628 Merge pull request #14 from scribam/cleanup
Cleanup
2019-09-08 17:49:36 +02:00
scribam 49b7e0682b Cleanup 2019-09-07 20:36:13 +02:00
flyinghead c4ecfe3d9c win32: _create_locale not available on win7 2019-09-07 20:22:23 +02:00
Flyinghead 704f90d78e x64: set correct sign on result if float conv returns indefinite 2019-09-07 12:08:08 +02:00
flyinghead 1776fce6bb Merge pull request #12 from scribam/xxhash
deps: Update xxhash
2019-09-06 22:01:32 +02:00
scribam e0fb50488d deps: Update xxhash integration 2019-09-06 21:05:19 +02:00
scribam c746a8be53 deps: Update xxhash to version 0.7.1 2019-09-06 20:45:17 +02:00
Flyinghead d1c3d31259 aica: save quantization and last sample when entering loop for normal adpcm 2019-09-06 13:53:01 +02:00
Flyinghead 7287b3816b aica: don't reset the adpcm decoder when looping
also don't decode past LEA, use LSA instead
2019-09-05 18:17:53 +02:00
Flyinghead a50ed2cc7d dsp: fix SHIFTER and ACC shift values. Simplify 2019-09-05 15:45:14 +02:00
Flyinghead 713705a6fe dsp: fix errors in PACK and UNPACK functions 2019-09-05 15:45:14 +02:00
flyinghead 92dbc89fa3 Merge pull request #11 from scribam/libpng-zlib
Simplify libpng/zlib integration
2019-09-04 20:21:00 +02:00
scribam bdf2029e99 Simplify libpng/zlib integration 2019-09-04 19:59:51 +02:00
flyinghead 4ffe508061 Merge pull request #10 from scribam/integration-fixes
Small integration fixes/improvements
2019-09-04 09:15:21 +02:00
scribam 9bdae4e8b3 deps: Simplify flac integration
It works because the path to the flac include dirs are defined in the
makefile/vs/xcode project.
This way, it would be also easier to rely on system packages instead of
compiling the bundled version.
2019-09-03 22:58:57 +02:00
scribam 2057277d7b deps/msvc: Fix wrong path to the "dirent" include directory 2019-09-03 22:12:06 +02:00
Flyinghead 5b9892425f naomi: game detection fails on windows when mixing / and \ 2019-09-03 19:18:11 +02:00
Flyinghead b4d33a6c70 Merge remote-tracking branch 'origin/master' into fh/hle-bios 2019-09-03 19:14:39 +02:00
flyinghead 99c81d5920 Merge pull request #9 from scribam/dirent
deps/windows: Update dirent integration
2019-09-02 23:08:59 +02:00
scribam 21fa8ecfba deps/windows: Update dirent integration
Source: https://github.com/tronkko/dirent/blob/1.23.2/include/dirent.h
2019-09-02 22:57:53 +02:00
Flyinghead ee1ee56824 proper hard reset of sh4 mm registers
more clean up
2019-09-01 23:10:04 +02:00
Flyinghead aadc9c3bfc Detect game region/vga support and set options accordingly
Better IP.BIN parsing (wince, vga)
Use wince flag and boot filename for wince detection
Switch to TV composite if vga unsupported
Switch to supported BIOS region if current is unsupported or default
2019-09-01 16:35:12 +02:00
flyinghead dfe1e00004 Merge pull request #8 from scribam/cmake-prep
Misc platform changes
2019-09-01 16:30:00 +02:00
scribam 314f25ea38 linux: Use header <sys/personality.h> only on linux platforms 2019-09-01 14:15:29 +02:00
Flyinghead 61f4cd4ecd Merge remote-tracking branch 'origin/master' into fh/hle-bios 2019-08-31 22:10:09 +02:00
Flyinghead dd8903484e reios: less log 2019-08-31 21:56:47 +02:00
Flyinghead 5ca6cacf25 reios: fix wince exception due to unaligned pio xfer 2019-08-31 20:53:42 +02:00
Flyinghead 2e77e049a8 reios: check disk syscall 2019-08-31 18:55:54 +02:00
Flyinghead 936cd6781b clean up 2019-08-31 17:36:34 +02:00
scribam 0fbee12dc0 msvc: Fix condition for "naked" defintion 2019-08-31 14:46:30 +02:00
scribam d826d8123a msvc: Fix DYNACALL/__fastcall usage 2019-08-31 14:46:30 +02:00
scribam 69e9d9767a windows: Add fallback for _BitScanForward64 on 32-bits system 2019-08-31 14:46:30 +02:00
flyinghead a1e35d1d69 Merge pull request #7 from scribam/msvc-fixes
msvc fixes
2019-08-31 11:48:16 +02:00
scribam df37077bb6 msvc: Do not include "7zArchive.h" header
This header is not required as the code related to it, in the same file, is not included when "_MSC_VER" is defined.
2019-08-31 11:10:03 +02:00
scribam bb24a5ee54 msvc: Replace "bm_GetCode2" by "bm_GetCodeByVAddr" in msvc.asm
This function was renamed in commit dece3fc13e
2019-08-31 11:09:47 +02:00
Flyinghead e07879e43c maple: std controller input mask was applied to all gamepad devices 2019-08-30 23:37:43 +02:00
Flyinghead 2015d9a696 rename and clean up 2019-08-30 23:35:10 +02:00
flyinghead 721cceb1e7 Merge pull request #6 from scribam/drop-emscripten
Remove Emscripten support entirely
2019-08-30 22:59:15 +02:00
scribam 79f801d314 Remove Emscripten support entirely
Makefile for Emscripten build has been dropped in commit 1333d6f776
2019-08-30 20:01:14 +02:00
Flyinghead 79231d8961 missing change 2019-08-30 14:39:33 +02:00
Flyinghead bae43c236e dynarec: use paddr to check for bios blocks + more 2019-08-30 14:11:15 +02:00
Flyinghead cc6190f261 flash: use rewritten blocks when allocating a new one 2019-08-30 13:59:15 +02:00
flyinghead 8935772f5e Merge pull request #5 from scribam/platform-defines
Platform defines
2019-08-29 07:23:44 +02:00
Flyinghead e173b83574 New option to force WinCE mode 2019-08-28 20:47:47 +02:00
scribam 269297be18 Use _WIN32 to handle Windows specific code 2019-08-28 20:37:53 +02:00
scribam 1b002ae0da Use __GNUC__ to handle GCC specific code 2019-08-28 20:37:53 +02:00
scribam 51d181a46c Use _MSC_VER to handle specific Visual Studio code 2019-08-28 20:37:53 +02:00
scribam 61382316c9 Use __ANDROID__ to handle specific Android code 2019-08-28 20:37:53 +02:00
flyinghead 02b450ff19 Fix vram and code block protection in 32-bit mode 2019-08-28 14:08:13 +02:00
flyinghead d768481a41 Merge pull request #4 from scribam/misc
Misc changes
2019-08-22 22:31:40 +03:00
scribam 71f03cceae linux/x11: Remove x11_gl_context_destroy function
This function is never called and the logic already exists in the x11_window_destroy function
2019-08-22 20:25:22 +02:00
scribam 065fb8ce5f .gitignore: Add rules for JetBrains IDES 2019-08-22 20:23:53 +02:00
scribam 148033625c wince: Add missing preprocessor TRACE_WINCE_SYSCALLS
unresolved_ascii_string and unresolved_unicode_string only exist if
TRACE_WINCE_SYSCALLS is defined
2019-08-22 20:22:56 +02:00
scribam 7cd4b7b10b pulseaudio: Remove WARN_LOG second argument
First argument is "LogTypes::LOG_TYPE" and second argument must be "const char*"
2019-08-22 20:19:12 +02:00
flyinghead 262af15336 Merge pull request #3 from scribam/pulseaudio
pulseaudio: Add missing return value to the "push" function
2019-08-22 19:32:27 +03:00
scribam 80770b4eb9 pulseaudio: Add missing return value to the "push" function 2019-08-22 18:26:22 +02:00
Flyinghead cc8bab249f reios: serialize hle bios state. Fix save state compat with upstream and libretro 2019-08-19 18:19:27 +03:00
Flyinghead 7c8ce6267a use lroundf(x) instead of x + 0.5f 2019-08-17 18:19:33 +03:00
Flyinghead b2475c49a1 osx: no need to fully initialize SDL 2019-08-15 23:19:44 +02:00
Flyinghead 629d262578 reios: swap iso733 bytes 2019-08-15 23:17:18 +02:00
Flyinghead 174c68294d Merge remote-tracking branch 'origin/master' into fh/hle-bios 2019-08-15 23:15:22 +02:00
flyinghead e6acf3563f win32 build fix 2019-08-15 11:44:17 +02:00
flyinghead 115dd1ab00 win32: link statically to avoid any dll dep 2019-08-15 11:30:56 +02:00
flyinghead ea544f8ad7 Merge branch 'master' into fh/hle-bios 2019-08-15 11:02:04 +02:00
flyinghead 5600120b54 win32: fix crash at boot. remove log command lines options
restore .lst compatibility
2019-08-15 10:48:39 +02:00
Flyinghead eaedf7d017 sdl: osx polishing 2019-08-14 22:48:34 +02:00
Flyinghead ed858c029a reios: test automation needs to account for lack of boot swirl 2019-08-14 22:35:07 +02:00
Flyinghead aaf950d470 Add default ISP information to flashrom 2019-08-14 20:05:42 +02:00
Flyinghead 7d15e751d6 bitrise.yml fix 2019-08-14 09:22:49 +02:00
Flyinghead 74a96897cc OSX: use SLD2 for gamepads 2019-08-14 09:20:24 +02:00
Flyinghead e34df4fed1 Support for Internet Game Pack game 2019-08-14 09:17:07 +02:00
Flyinghead 3e1956b949 reios: hle bios option now forces hle use
fallback to hle bios happens if no bios file found regardless of option
2019-08-13 17:12:29 +02:00
Flyinghead cf22e942cb android build fix 2019-08-12 21:16:32 +02:00
Flyinghead 93e009bf1a gl: use matrices for ndc and viewport calculations
Support VO_STARTX and VO_STARTY for shifting displayed frame
Add glm to deps
Calculate NDC, scissoring and viewport matrices once
Reduce code duplication
2019-08-12 19:56:44 +02:00
Flyinghead 1a019b79b0 GL: blending support for punch-through polys
Disable trilinear filtering for PTs
PT alpha test should be done after color+tex shading according to documentation
2019-08-09 12:05:56 +02:00
Flyinghead 7ff225bfa0 PVR: detect direct FB writes in non-interlace. Fix packed 888 FB format 2019-08-09 12:03:09 +02:00
Flyinghead 55b4e3364d OSX: use NSLog for logging 2019-08-09 12:00:48 +02:00
Flyinghead b38affe87c Build fix 2019-08-08 08:30:38 +02:00
Flyinghead c7f27c84bf reios: add timing to DMA reads. Fix some param values. 2019-08-08 08:24:13 +02:00
Flyinghead 69f2b343b1 OSX: command line args support. test automation
allow test automation on other platforms (win32, OSX, ...)
2019-08-08 08:22:33 +02:00
Flyinghead 8bd2450608 comments/logs clean up 2019-08-08 08:20:15 +02:00
Flyinghead ce301289ca reios: fix some constants 2019-08-04 19:46:46 +02:00
Flyinghead 00e57db13f reios: support multi READ command
fixes many 2K sport games, floigan bros, ooga booga
report paused instead of standby (cannonspike US)
2019-08-04 19:09:02 +02:00
Flyinghead 271aa85892 reios: wince games support 2019-08-03 19:20:30 +02:00
Flyinghead d3173931f1 reios: handle gdrom hle state properly
better documentation, clean up
parallelize gradle builds + tv banner
2019-08-01 12:31:08 +02:00
Flyinghead e162f3ac83 reios: cdda support 2019-07-31 22:08:56 +02:00
Flyinghead 55f76d02c0 reios: fix flashrom write
Fixed language selection that was being ignored (also w/ bios)
2019-07-31 17:59:53 +02:00
Flyinghead 5913a8f11e reios: font support 2019-07-31 13:01:12 +02:00
Flyinghead 7eaf89a7f2 Travis fix 2019-07-30 19:31:35 +02:00
Flyinghead 6059831ec7 reios fixes 2019-07-30 19:04:51 +02:00
flyinghead f23a3d3756 Merge pull request #2 from flyinghead/fh/wince-dynarec
Merge wince branch into master
2019-07-30 13:03:39 +02:00
Flyinghead 91a753f224 Fix naked functions for GCC 2019-07-30 12:40:34 +02:00
Flyinghead 1fffbad9fc Fix build warnings. config.h for flac 2019-07-28 18:49:59 +02:00
Flyinghead 9791ebebce wince: fix wince page lookup 2019-07-28 18:28:22 +02:00
Flyinghead 1333d6f776 Remove TARGET_BOUNDED_EXECUTION. Build warnings and clean up 2019-07-28 17:37:04 +02:00
Flyinghead a9dbbccf93 Unprotect VRAM before switching system. Fix texture cache clean 2019-07-28 17:06:12 +02:00
Flyinghead 591ebf0ba6 Merge branch 'fh/wince-dynarec' of https://github.com/flyinghead/flycast into fh/wince-dynarec 2019-07-28 13:04:05 +02:00
Flyinghead d27ab0361c arm build fix 2019-07-25 21:51:48 +02:00
Flyinghead 4dfa83079a aica and arm7 clean up 2019-07-25 21:34:43 +02:00
Flyinghead 2529b5048e get rid of useless macro 2019-07-24 19:09:54 +02:00
Flyinghead 32055c3bf9 Better error messages when BIOS files missing 2019-07-24 18:53:09 +02:00
Flyinghead 9932d9bf43 OSX: fix bios files path (now in /data/) 2019-07-24 18:24:58 +02:00
Flyinghead 1375536534 fix android intent-filter. fix spurious maple warning 2019-07-13 15:30:10 +02:00
Flyinghead 326bc580ec Merge branch 'fh/unified' into fh/wince-dynarec 2019-07-13 12:50:19 +02:00
Flyinghead bbc11a30aa Naomi rename vars and clean up. Logging changes. 2019-07-13 12:44:10 +02:00
Flyinghead a13633560d remove naomi config from CI files 2019-07-13 11:08:11 +02:00
Flyinghead e63d7d717e Fix Restart crash. Clear texture cache during reset 2019-07-13 10:59:20 +02:00
Flyinghead 68acf48d64 Support for Twin Stick and Ascii FT Stick 2019-07-12 19:18:39 +02:00
Flyinghead 14ddd01e39 compilation warnings 2019-07-12 17:53:17 +02:00
Flyinghead 4f8e18215b Fixed savestates: restore compatibility with lr and master
Add new maple devices from lr
Clean up shil.cpp
2019-07-12 17:20:43 +02:00
Flyinghead 60ec054b59 support for VQ compressed paletted textures 2019-07-12 15:34:10 +02:00
Flyinghead 4884dbc400 get rid of DC_PLATFORM and build flavors 2019-07-11 19:55:03 +02:00
Flyinghead eb38564922 use exceptions for startup errors 2019-07-11 19:23:21 +02:00
Flyinghead cb35c80ee7 gl4: still need to update the depth buffer for TRs 2019-07-10 22:23:26 +02:00
Flyinghead 5285911133 Mirror writable aica ram to 8mb in 512mb vmem mode
Fixes switching from dc to naomi on windows
Should help games reading past end of aica ram (HeadHunter and others)
2019-07-10 20:17:59 +02:00
Flyinghead ad98e583c8 win32: fix vmem reset 2019-07-10 18:58:55 +02:00
Flyinghead 58cb50f587 fix reset hang on naomi 2019-07-10 17:25:11 +02:00
Flyinghead 449d150eba android: build fix
clean up files comitted by mistake
2019-07-10 09:57:08 +02:00
Flyinghead f3a91de1af Unify dreamcast, naomi and atomiswave builds WIP 2019-07-09 23:52:19 +02:00
Flyinghead 632aa95c2d gl4: depth test issue in non-autosort mode
Depth testing is done in the fragment shader so it shouldn't be done
in the a-buffer shader for the first pixel, or until the depth is updated.
Fixes flashlight and lightstorm effects in Alone in the Dark
2019-07-09 15:25:15 +02:00
Flyinghead d5e24d8aed Cleaner init. Get rid of LastImage 2019-07-08 18:10:43 +02:00
Flyinghead 329230bf8d Fix Naomi reset. Add some per-game settings
Re-Volt needs 100 extra deptch scale for perfect menus
Tom Clancy's Rainbow Six needs RTT to vram for correct loading screens
2019-07-08 16:31:50 +02:00
Flyinghead 478b1c719c gl4: do a depth-only TR pass in non-autosort mode
fixes HeadHunter map/radar issue
2019-07-08 16:30:07 +02:00
Flyinghead 10e6b296c5 fix cue issue. better logging 2019-07-08 00:03:44 +02:00
Flyinghead 75cdd93001 remove webui, libwebsocket 2019-07-07 23:40:13 +02:00
Flyinghead dbbc1819e8 remove NACL 2019-07-07 22:56:23 +02:00
Flyinghead 9eef02a1e8 pvr: ignore Z Write Disable for punch-through polys?
tentative fix for Worms World Party
2019-07-07 22:13:43 +02:00
Flyinghead c3a42b0b22 wince: online support
Use default asyncmap for LCP control packets
Delay reading from picotcp ppp stream when connecting
Accept [PSH,SYN] as valid tcp connect packet

Add PBA Tour Bowling 2001 as wince game
Disable vmem32 for StarLancer and Maximum Pool (req'd for online support)
2019-07-07 20:31:36 +02:00
Flyinghead 18bcb81682 naomi: minimal emulation of 840-0001E comm board
makes gunsur2 and gunsur2j boot
various minor naomi changes
2019-07-04 17:33:26 +02:00
flyinghead b540b437ee win32: unprotect ram regions individually in blockmanager
fixes abort when starting game in windows
2019-07-04 09:36:22 +02:00
flyinghead a4eb9c22b2 Update README.md 2019-07-02 12:17:03 +02:00
Flyinghead 5f6f90b66b win32 build fix 2019-07-01 22:45:11 +02:00
Flyinghead 3863d9d2fb android: use new logging 2019-07-01 18:36:52 +02:00
Flyinghead be5aca66e1 cfg,dynarecs,reios: use new logging 2019-07-01 18:23:10 +02:00
Flyinghead 2c8094f987 renderer,sdl: use new logging 2019-07-01 17:41:15 +02:00
Flyinghead ad4218d617 audio: use new logging
other logging changes
2019-07-01 17:17:08 +02:00
Flyinghead b388fa4377 imgread: use new logging 2019-07-01 16:10:28 +02:00
Flyinghead 35cd1fcf14 sh4: use new logging 2019-07-01 15:22:04 +02:00
Flyinghead feb1b79353 sh4/dyna: use new logging 2019-07-01 12:17:51 +02:00
Flyinghead cd0849a8f5 pvr: use new logging 2019-07-01 11:42:00 +02:00
Flyinghead 74186d2518 naomi: use new logging 2019-07-01 11:14:18 +02:00
Flyinghead c60e2d29e8 modem: add termination function to stop pico thread
use new logging
log: set max verbosity to warning for release builds
2019-07-01 10:28:31 +02:00
Flyinghead a31f573c69 maple: use new logging 2019-06-30 23:38:58 +02:00
Flyinghead fcc6fd784c holly: use new logging 2019-06-30 23:02:26 +02:00
Flyinghead 58e1c68eb8 flashrom, gdrom: use new logging 2019-06-30 22:41:55 +02:00
Flyinghead cf6887a5d0 aica: use new logging 2019-06-30 22:09:32 +02:00
Flyinghead 5881791817 win32: yabf 2019-06-30 21:54:37 +02:00
Flyinghead 20bff396c3 win32: more build fix 2019-06-30 21:46:33 +02:00
Flyinghead 40c841a057 win32: build fix 2019-06-30 21:39:38 +02:00
Flyinghead 7bcd985276 win32: logging fixes 2019-06-30 21:28:30 +02:00
Flyinghead 0c9e3bbd7d OSX: add log files to project 2019-06-30 21:22:37 +02:00
Flyinghead 8404c6322c New logging framework stolen from dolphin 2019-06-30 21:06:46 +02:00
Flyinghead ec0d21148d L.O.L and Miss Moonlight need RTT to vram option 2019-06-30 13:33:15 +02:00
Flyinghead 838cbe59e3 gl4: get rid of scaling params and use normalized coords in abuffer
add Eternal Arcadia and Yu Suzuki Game Works to render rtt to vram game list
2019-06-30 11:40:42 +02:00
Flyinghead a14bf29f5f gl4: scaling and coords must be different with rtt vs screen 2019-06-28 18:26:36 +02:00
Flyinghead 5f5f300604 gl4: fix issue with RTT regarding buffer dimension
fixes shadow in THPS 1 & 2
2019-06-28 17:37:06 +02:00
Flyinghead 0a95a60ac6 less verbose logs. unbuffered stdout when test automation 2019-06-28 11:42:35 +02:00
Flyinghead 99778a7715 per-pixel renderer: RTT might need bigger buffers than screen 2019-06-27 22:41:16 +02:00
Flyinghead e6b8c46557 atomiswave: fix coin error 2019-06-27 09:03:49 +02:00
Flyinghead 871260cfcf naomi: better error handling when loading a gdrom
x64 and arm64 dynarecs: Support 64-bit immediate readm (ninjaslt)
2019-06-26 19:06:30 +02:00
Flyinghead 927298f353 naomi: fix coin chute (compiler bug?). Disable verify in TA parsing
Fix F1 World Grand Prix for Dreamcast
2019-06-25 19:10:20 +02:00
Flyinghead fd7cf9a0f5 linux-x64: make a non position independent exec 2019-06-24 23:18:04 +02:00
Flyinghead 7dab84fd80 vmem handlers: last block wasn't mapped 2019-06-24 22:56:07 +02:00
Flyinghead c27975fb37 ssa: don't propagate const over interpreter fallback, sync_sr and sync_fpscr
rec-x64: support immediate args for xtract
Set write rtt to vram for Super Speed Racing (a.k.a Flag to Flag)
2019-06-24 18:56:09 +02:00
Flyinghead f862903a74 Don't unprotect vram when a texture is updated
Adjacent textures in other pages still need vram protection
Fixes texture corruption in many games since ad5ab6240b
2019-06-23 21:30:46 +02:00
Flyinghead 91717d706a wince: disable vmem32 for Marionette Company 1 & 2 and Rune Jade 2019-06-23 17:06:59 +02:00
Flyinghead 112e272075 renderer: support non-integer v-scaling factor
Fixes missing half-screen in Wacky Races (PAL), Buzz Lightyear of Star Command (PAL),
Tom Clancy's Rainbow Six - Rogue Spear + Mission Pack - Urban Operations (PAL), Sega Worldwide Soccer 2000 (PAL)

Input record and replay support for test automation
2019-06-23 12:17:24 +02:00
Flyinghead 862d892e89 texture corruption resulting from misaligned page unprotection 2019-06-21 23:31:45 +02:00
Flyinghead 49b49c5207 don't write-protect BIOS and IP.BIN blocks
Fixes Grandia II crash at start on arm.
Fix bug in bm_GetBlock()
2019-06-21 16:18:34 +02:00
Flyinghead b226544d03 Merge remote-tracking branch 'origin/master' into fh/wince-dynarec 2019-06-21 14:37:32 +02:00
Flyinghead aa36a65d13 log tag name change 2019-06-21 14:29:22 +02:00
Flyinghead d1550357ce fix verify failed when switching to overview (app list) on android 2019-06-21 14:10:04 +02:00
Flyinghead 5b2ad02fa2 this wasn't supposed to be committed 2019-06-21 13:33:55 +02:00
Flyinghead 3e8cdc76f3 wince: fix load state hanging 2019-06-21 13:17:34 +02:00
Flyinghead f29569cf5d more name change 2019-06-20 23:46:20 +02:00
Flyinghead e0537926cf OS X name changes 2019-06-20 23:24:37 +02:00
flyinghead a49fbc797f more name change 2019-06-20 22:57:32 +02:00
Flyinghead 9f66847469 name change 2019-06-20 21:50:19 +02:00
Flyinghead af2ba55bac rec-arm: fix immediate writem bug. clean up
get rid of unused and unstable opts
div32p2 implementation (untested)
Fixed canonical test mode
2019-06-20 19:31:43 +02:00
Flyinghead 70ea7c4d76 ssa: use canonical implementations to compute const ops 2019-06-20 19:27:21 +02:00
Flyinghead 6ed098a929 wince: enable code block protection 2019-06-19 22:55:47 +02:00
Flyinghead cb338ae106 enable NoBatch when FullMMU is on for WinCE games 2019-06-19 22:52:19 +02:00
Flyinghead becb0a5efe renderer: when a RTT frame is rendered, swap any pending frame first
Fixes Tony Hawks 1 & 2 black screen issue
2019-06-19 15:10:28 +02:00
Flyinghead ad5ab6240b refactor vram lock/unlock code into new vmem.cpp functions 2019-06-19 14:49:14 +02:00
Flyinghead 13a2f8bc61 win32: build fix 2019-06-19 11:14:12 +02:00
Flyinghead 318852e261 dynarec: use mprotect to protect code areas
All ram pages containing code are write protected. In that case, no need
for block checks. Memory reads in the same block(s) can also be executed
at compile time and the results propagated as constants.
When a write is detected in a protected area, the corresponding blocks
are discarded and recompiled using traditional (slow) block checks.

Backported the blkmap code finding change from upstream.
Use smart pointers for block management to avoid reference issues.
Added WriteAfterWrite ssa pass
Fixed crash in ssa ConstProp pass when op list is modified
2019-06-19 11:01:33 +02:00
Flyinghead 0b8a312fea rec-arm64: simplify read/write mem rewrite logic
pass exception pc in x2 reg for both slow/fast paths
infer the op type and size from the armv8 op encoding
rewrite doesn't need access to the block anymore
add support for some imm args
2019-06-18 15:07:32 +02:00
Flyinghead 8d8e694e23 swap setpeq args in ssa if first is imm 2019-06-18 13:25:43 +02:00
Flyinghead 3d8b0df789 rec-x64: setpeq native impl. Fix imm mem write for byte and short
Optimize fneg, fabs and sub
Fix cvt_f2i
Fix fsca with imm arg
2019-06-18 13:16:42 +02:00
Flyinghead 419370084e rec-x86: ssa support 2019-06-14 23:34:18 +02:00
Flyinghead 8506355447 wrap aica ram to 8MB instead of only 2MB (dc)
fix crash with GuruGuru Onsen 2 and HeadHunter
2019-06-13 21:58:09 +02:00
Flyinghead 7120512205 wince: use exceptions in dyna/decoder.cpp and catch them in driver.cpp 2019-06-13 18:36:08 +02:00
Flyinghead e0949fb9aa Fix div matching: support 64-bit div and correct handling of negative
Some games do 64-bit / 32-bit division (Pro Pinball Trilogy)
DIV0s/1 use and output 1's complement numbers
The final reminder fixup wasn't correct for negative dividend
2019-06-13 18:27:21 +02:00
Flyinghead de86aae73e rec-arm: XTRCT implementation 2019-06-12 17:46:53 +02:00
Flyinghead c49694599c rec-arm: use ssa regalloc
add `subc a,a` expression to simplify
2019-06-12 17:31:37 +02:00
Flyinghead e537d92bcc ssa: don't simplify FPU ops because of Inf of NaN 2019-06-12 08:52:42 +02:00
Flyinghead ff745ee4fe fix xtrct canonical implementation 2019-06-10 19:17:24 +02:00
Flyinghead a4453c0a81 Fix vmem in 512MB mode 2019-06-10 19:01:56 +02:00
Flyinghead 2c3b516341 x64: use eax instead of ecx for mem reads return value 2019-06-10 14:48:54 +02:00
Flyinghead f81ff3fe21 Merge remote-tracking branch 'origin/fh/wince-dynarec' into fh/wince-dynarec 2019-06-10 14:47:22 +02:00
Flyinghead 8819c9d536 arm64: handle pref with imm arg. some refactoring 2019-06-10 14:35:27 +02:00
Flyinghead 62e14f6b4c osx: add files to project 2019-06-10 14:07:58 +02:00
Flyinghead 3dd16e80d2 arm64 and x64 recs use ssa regalloc 2019-06-10 13:57:10 +02:00
Flyinghead 623d70d710 ssa register allocator and more ssa stuff 2019-06-09 19:41:42 +02:00
Flyinghead bd30752b86 Use auto& to avoid copy when iterating. Inline mmu_Read/WriteMemNoEx 2019-06-08 13:04:35 +02:00
Flyinghead 0890150dda dynarec: ssa missing changes 2019-06-04 21:27:45 +02:00
Flyinghead 681c423e66 Merge remote-tracking branch 'origin/master' into fh/wince-dynarec 2019-06-04 21:21:04 +02:00
Flyinghead 692556ca5d dynarec: ssa initial commit 2019-06-04 21:20:34 +02:00
flyinghead b75a96592e Update build page url 2019-06-04 19:57:47 +02:00
flyinghead d25653e9cc Name change 2019-06-04 19:55:56 +02:00
Flyinghead a46f1bd0aa Merge branch 'master' into fh/wince-dynarec
# Conflicts:
#	appveyor.yml
2019-05-30 21:44:44 +02:00
Flyinghead 97eab1be59 wercker: added naomi build 2019-05-30 20:09:25 +02:00
Flyinghead 94fd42db6f wercker: missing slash 2019-05-30 20:00:36 +02:00
Flyinghead aa94d7dfe2 wercker: fix S3 path 2019-05-30 19:54:24 +02:00
Flyinghead b5a9d0d258 wercker: deploy to S3 2019-05-30 19:46:23 +02:00
flyinghead 5b5bc13588 Add link to builds page on README.md 2019-05-30 19:02:41 +02:00
Flyinghead cbe8df51cf osx: bigger window. travis: public_read for S3 2019-05-30 11:56:28 +02:00
Flyinghead 34f1a65ff0 appveyor: add naomi build 2019-05-30 11:03:01 +02:00
Flyinghead 117b23a588 appveyor: fix S3 key 2019-05-30 10:42:20 +02:00
Flyinghead bad0f38ff5 appveyor: set S3 region 2019-05-29 21:49:00 +02:00
Flyinghead a7b123ffb6 appveyor and bitrise fixes 2019-05-29 21:37:03 +02:00
Flyinghead d2591c1022 appveyor: fix indentation 2019-05-29 21:16:09 +02:00
Flyinghead c28bb7d780 appveyor: deploy to S3
bitrise: fix git hash in path
2019-05-29 21:14:34 +02:00
Flyinghead 447061c686 bitrise: fix s3 path 2019-05-29 21:00:01 +02:00
Flyinghead 36c821da49 bitrise: fix env vars 2019-05-29 20:07:47 +02:00
Flyinghead fdd9370eb1 bitrise: more annoyance 2019-05-29 20:05:12 +02:00
Flyinghead 10e3357e20 bitrise: tentative fix 2019-05-29 20:01:43 +02:00
Flyinghead 5279a00b56 bitrise: more tab to space 2019-05-29 19:50:31 +02:00
Flyinghead 167be1f830 bitrise: tab to space 2019-05-29 19:49:33 +02:00
Flyinghead 0ec1584806 bitrise: deploy to S3 2019-05-29 19:41:42 +02:00
Flyinghead 4f9a22cb26 travis: deploy to S3 2019-05-29 19:04:53 +02:00
Flyinghead b8a00b9c7d rec-arm64/x64: only do regalloc on rewrite when needed 2019-05-28 20:03:08 +02:00
Flyinghead 714de0303e rec-x64: don't save fp regs when calling mem access handlers 2019-05-28 19:43:56 +02:00
Flyinghead cafd1c3c49 rec-arm64: do a full regalloc when rewriting mem access in mmu mode 2019-05-28 19:43:17 +02:00
Flyinghead 4540acc22e mmu: optimize mmu_full_SQ() 2019-05-28 19:41:21 +02:00
Flyinghead 8cb86de026 Make SMCCheck=Fast work on arm64
The issue is that flushing the dynarec cache makes rewriting fail for
the currently executing block. So this avoids flushing the cache too
often but the problem remains.
2019-05-28 19:40:30 +02:00
Flyinghead 51cf6cf271 regalloc: handle mem ops differently in wince mode
Flush all current writeback spans before the op
Flush instead of killing spans in case the mem access throws an
exception
Some optimizations
2019-05-28 19:37:24 +02:00
Flyinghead c6e92028f2 regalloc: cleanup. no functional change 2019-05-27 22:44:51 +02:00
flyinghead b5ff01baf4 Update README.md 2019-05-26 21:13:23 +02:00
flyinghead 693bd4e929 Making things clear 2019-05-26 21:10:27 +02:00
Flyinghead 5b2cef3fdd dynarec: add negc and xtrct op codes
native implementation of negc and xtrct for x64 and arm64
rec-arm64: pass exception pc in w27 instead of sh4 context
inline mmu_intruction_translation() and clean up
2019-05-26 13:30:05 +02:00
Flyinghead 506756ea37 android: use common rend_thread() instead of a specific one
fixes the swap pending issue (double swap) on android
2019-05-25 18:48:00 +02:00
Flyinghead 2c91ca96fc rec-arm64: fix transitions to/from mmu
exit mainloop() before regenerating it
make sure dynarec cache is cleared between runs
when deserializing, clear dynarec cache after setting mmu state
2019-05-25 18:03:18 +02:00
Flyinghead e7e387b443 wince: enable/disable vmem32 based on mmu state 2019-05-24 18:19:33 +02:00
Flyinghead cc4b59f5fa rec-arm64: generate main loop dynamically
different code for mmu vs. !mmu
Switching mmu state not yet supported
2019-05-24 18:18:32 +02:00
Flyinghead fa10b9ed2f Wrong offset in VramLockedWrite 2019-05-24 17:44:54 +02:00
Flyinghead 61a867e1ad FPCB was only partially mprotected 2019-05-24 17:40:10 +02:00
Flyinghead e3d95f2258 wince: unify _vmem and vmem32. Use 4GB virtual space on 64-bit arch
On 64-bit architectures, _vmem first tries to allocate 4GB then falls
back to 512 MB.
The same virtual space is now used by _vmem and vmem32 (mmu)
2019-05-23 11:40:33 +02:00
Flyinghead bc42f8a785 wince: revert prior serialize changes 2019-05-22 16:44:45 +02:00
Flyinghead 5b7d07315b wince: clean up unused stuff 2019-05-22 15:15:53 +02:00
Flyinghead 94e03b2cfd win32: fix build. disable appveyor msvc build 2019-05-22 14:28:11 +02:00
Flyinghead c2c0215e1b Merge remote-tracking branch 'origin/master' into fh/wince-dynarec 2019-05-22 14:13:00 +02:00
Flyinghead fb76efb08d Standard functions for virtual mem alloc/protect/map/... 2019-05-22 11:41:12 +02:00
Flyinghead 248f274e24 wince: fix ci builds 2019-05-21 19:33:01 +02:00
Flyinghead 86cabf8553 wince: delete bogus half-life game id 2019-05-21 19:28:54 +02:00
Flyinghead d55d803c16 gles2 build fix 2019-05-21 19:11:47 +02:00
Flyinghead 2e5eaa6e2b Log error when writing to flash ram 2019-05-21 18:27:43 +02:00
Flyinghead 37f379fe6b Better HBlank implementation 2019-05-21 18:27:15 +02:00
Flyinghead 582c9f358c rec-cpp: crash when running rom 2019-05-21 18:18:47 +02:00
Flyinghead 6055c13e77 appveyor: no deploy 2019-05-21 17:21:52 +02:00
Flyinghead 484f0a616e travis: only build debug build 2019-05-21 17:16:38 +02:00
Flyinghead 036b9b015a fix travis build 2019-05-21 16:50:55 +02:00
Flyinghead 3d67d39187 fix warning 2019-05-21 16:50:38 +02:00
Flyinghead 1b132a82ee travis: no release build, no deployment 2019-05-21 16:12:33 +02:00
Flyinghead e2a5895ea5 OSX: use bitrise.yml in repo 2019-05-21 15:44:41 +02:00
Flyinghead a8f4b7a46e OSX: add naomi xcconfig and scheme 2019-05-21 15:04:03 +02:00
Flyinghead 115f7dc930 OSX: Fix bitrise.yml 2019-05-21 12:38:53 +02:00
Flyinghead 49604be620 OSX: fix schemes 2019-05-21 12:19:44 +02:00
Flyinghead c0d71c7bcf OSX: fix project file and schemes 2019-05-21 12:14:05 +02:00
Flyinghead 3bf32f5adf Merge remote-tracking branch 'origin/fh/limitfps-option' 2019-05-21 11:42:07 +02:00
Flyinghead a17b8355e5 gdrom: use memset to reset read_buff 2019-05-21 11:34:51 +02:00
Flyinghead 74e7a95484 simplify test 2019-05-21 11:34:15 +02:00
Flyinghead 121e6b200b Reset gdrom params when changing disk 2019-05-21 11:29:44 +02:00
Flyinghead a5ae8eeef0 Reset flashrom on reset 2019-05-21 11:29:25 +02:00
Flyinghead 25a7fede2e save states: don't serialize gamepad state 2019-05-21 11:29:10 +02:00
Flyinghead 05f461c3c5 Use FB_R_SOF2 only to detect direct FB writes
Fixes flashing video in Virtua Fighter 3tb
2019-05-21 11:26:48 +02:00
Flyinghead 74844c8940 disable per-pixel renderer on OSX 2019-05-21 11:26:18 +02:00
Flyinghead 433590b610 rend: Add per-strip TR sort option 2019-05-21 11:24:03 +02:00
Flyinghead d38e094ba0 Merge remote-tracking branch 'origin/upstream-master' 2019-05-21 11:17:14 +02:00
Flyinghead 4cfcf2ea83 alsa: don't spam console if underrun 2019-05-20 19:13:08 +02:00
Flyinghead 07b3f83343 audio: new option for automatic limitFPS
LimitFPS now can be enabled, disabled or automatic. The latter option
doesn't wait for audio if the emulator is running slow (over the last 2
secs)
Renamed `Audio Backend` to `Audio Driver` in the UI.
2019-05-20 19:12:28 +02:00
Flyinghead ac43a8c54e don't swap gl buffer until FB_R_SOF is set to the rendered framebuffer
Fixes flashing screens in South Park: Chef's Luv Shack, NFL Quarterback
Club 2000
Glitchy videos: The Next Tetris, Nightmare Creatures II, Rune Jade
Flashing rear-view mirror in Metropolis Street Racer
2019-05-17 17:13:48 +02:00
Flyinghead 8d078a923b wince: force aica.NoBatch (missing change) 2019-05-17 17:01:20 +02:00
flyinghead a6b773a23e Merge pull request #1603 from reicast/fh/gles-dynload
Fix build errors on GL ES 2.0 platforms (RPi...)
2019-05-17 12:15:07 +02:00
flyinghead 9d6c09fd46 Merge pull request #1608 from reicast/dd/appveyor-msvc
Add cmake msvc build to appveyor.yml
2019-05-17 12:14:54 +02:00
drhilarius 69dc87d23d Add cmake msvc build to appveyor.yml 2019-05-17 02:36:43 -07:00
flyinghead 37d95e9fea Merge pull request #1606 from reicast/dd/cmake-msvc-fixes
Fixes for cmake + msvc
2019-05-16 18:40:08 +02:00
davediff e44f98cf8b Merge pull request #1607 from hissingshark/master
Fix typo induced build error
2019-05-16 08:57:41 -07:00
hissingshark b0b63d4894 Fix typo induced build error 2019-05-16 16:05:47 +01:00
flyinghead 3ef363733d wince: fix setjmp/longjmp on windows 2019-05-16 16:57:35 +02:00
drhilarius c92a997f11 Fixes for cmake + msvc
Also now builds .asm file for dynarec jit with msvc
2019-05-16 03:05:16 -07:00
flyinghead 66cbc0acf6 wince: dynarec boost 1.2 -> 1.5 2019-05-15 15:26:08 +02:00
Flyinghead f0ebd2b818 wince: force aica.NoBatch 2019-05-15 14:00:36 +02:00
Flyinghead 6053a465f7 fix win32 build 2019-05-15 13:07:52 +02:00
Flyinghead d9f2f9ae1d rend: define GLES2 and GLES3
GLES2 will only use GL ES 2.0 API functions, compile-time linked
GLES3 loads functions dynamically and supports both GL ES 2.0 and 3.0
2019-05-15 12:54:03 +02:00
Flyinghead 0dd555c5c8 Merge branch 'master' into fh/gles-dynload 2019-05-15 11:49:57 +02:00
David G. F 83a6c0ee71 Merge pull request #1601 from davidgfnet/morevmem
vmem API consolidation and implementation of NO_RWX
2019-05-15 01:28:59 +02:00
Flyinghead 2434d0183e wince: better sh4 instr cycle counting. Don't hash blocks if mmu on
Use actual instr latency cycles, including fp instr
Decrease the WinCE boost ratio to 1.2
Don't hash blocks when mmu on
2019-05-14 12:38:56 +02:00
David Guillen Fandos 3463872fdf Fix small clang build issue. 2019-05-13 01:35:40 +02:00
David Guillen Fandos 65e2218792 Fix ARM64 rewrites with NO_RWX_PAGES
Tested on nvidia jetson and Android, so far works great.
2019-05-13 00:23:18 +02:00
David Guillen Fandos aa4fc8dd60 Move cache invalidation to vmem_platform and implement NO_RWX on arm64
Still not functional yet, this commit breaks arm64 on android for instance.
Rewrites are not yet figured out, will push them in the next commit.
2019-05-12 23:25:43 +02:00
David Guillen Fandos 3b760f9869 Add FEAT_NO_RWX_PAGES and implement it for x64 CPU (Win and Linux)
Tested: Both with and without the feature, works only for x64 CPUs for
now, but supported in both windows and linux (see vmem implementation
for it, using mem-mapped files).
2019-05-12 22:02:57 +02:00
David Guillen Fandos 1a2b1c8672 Remove traces of memory manager from Jit driver.
Still stuff to be removed in the Naomi file handler and the ARM
AREC, which need to get ported to the new vmem interface.
2019-05-12 19:47:11 +02:00
David G. F ee9646ab43 Merge pull request #1600 from davidgfnet/mingwfixes
Fix small issues for mingw builds on Linux
2019-05-12 18:16:51 +02:00
David Guillen Fandos cbc2af29ad Fix small issues for mingw builds on Linux
Doenst like the paths, big surprise. I tipically build it like:

  make platform=win32 CXX=x86_64-w64-mingw32-g++ \
       WINDRES=x86_64-w64-mingw32-windres \
       CC=x86_64-w64-mingw32-gcc
2019-05-12 17:44:19 +02:00
Flyinghead 15ce3ab5fa OSX build fixes 2019-05-12 16:53:30 +02:00
David G. F a0c725be4a Merge pull request #1598 from davidgfnet/vmemstuff2
Implement a separate API for nvmem
2019-05-12 16:34:55 +02:00
David Guillen Fandos 55e7c17030 Fix minor build issue with madvise flags. 2019-05-12 13:40:18 +02:00
David Guillen Fandos 6cba98b70a Allocate missing SH4CB and make lock more forgiving. 2019-05-12 00:02:24 +02:00
David Guillen Fandos 1a4323c1ce Fix runtime issue in Windows target, was not mapping pages correctly. 2019-05-11 23:13:58 +02:00
David Guillen Fandos 4e5053be20 Adding win_vmem.cpp to VC project files. 2019-05-11 22:38:57 +02:00
David Guillen Fandos 4458dac49a Fixing some missing imports and a bug in pointer tracking. 2019-05-11 22:35:17 +02:00
David Guillen Fandos 555b39b7e5 Merge remote-tracking branch 'origin/master' into vmemstuff2 2019-05-11 22:11:24 +02:00
David Guillen Fandos b74db6ef53 Moving vmem to separate files with a proper interface.
Works so far for Linux and Android, need to do some testing on Windows.
2019-05-11 22:09:52 +02:00
flyinghead ec9706876c Merge pull request #1596 from davidgfnet/x86fix
Hack-fix the x86 JIT so that it builds.
2019-05-11 14:27:41 +02:00
David Guillen Fandos 08285cf49c Hack-fix the x86 JIT so that it builds. I guess that's why Win32 fails too 2019-05-11 13:37:13 +02:00
flyinghead 95a13d79b7 Merge pull request #1593 from reicast/fh/gl3-fallback
x11: fix fallback to gl 3.0. fix crash when switching renderer.
2019-05-11 00:38:44 +02:00
flyinghead 7f2fcfde6f wince: don't use setjmp/longjmp on windows 2019-05-10 22:31:59 +02:00
flyinghead e6794743ad wince: rec-x64 fix for win32
fix GDI on windows
2019-05-10 21:21:30 +02:00
David G. F 3e57c80944 Merge pull request #1595 from davidgfnet/modemregression
Fix Modem & serialization regression
2019-05-10 20:35:40 +02:00
David Guillen Fandos c0f21b7551 Re-enable modem in Apple builds too. 2019-05-10 19:41:36 +02:00
David Guillen Fandos 2389903a30 Add dummy serialization for non-modem builds (right now only Win) 2019-05-10 19:38:45 +02:00
David Guillen Fandos 45b0e79f15 Enable modem support in Android builds, regresion of PR #1571
This affects bug #1591
2019-05-10 19:20:19 +02:00
David Guillen Fandos be1ecbaa8b Fix TARGET_NO_NVMEM and deprecate TARGET_NO_EXCEPTIONS
Linked them both toghether since you can't really define one and
not the other (plus Linux honors one windows the other in some
cases).
More refactoring on this area to follow.
2019-05-10 18:57:28 +02:00
Flyinghead c5a74ccfb7 Fix Sort-DMA 2019-05-10 16:10:07 +02:00
Flyinghead eb725f9e66 x11: fix fallback to gl 3.0. fix crash when switching renderer.
Fallback to GL 3.1 when GL 4.3 isn't available was broken.
Fallback to GL 3.0 instead of 3.1.
Fix crash when switching renderer (per-pixel, per-triangle)
2019-05-10 11:15:44 +02:00
David G. F afcd7a08a3 Merge pull request #1571 from davidgfnet/modemfix
Add ENABLE_MODEM and rework makefiles to support it.
2019-05-10 01:09:35 +02:00
Flyinghead 77c1389921 wince: disable vmem32 for games that abuse it 2019-05-09 21:47:01 +02:00
David G. F 1b89fcd5ba Merge pull request #1587 from davidgfnet/master
Minor improvements for ARMv8
2019-05-09 18:45:30 +02:00
Flyinghead 05577b64f7 wince: return actual vmu system area in GetMediaInfo
revert previous default vmu change
2019-05-09 11:25:17 +02:00
David GF 5ba56627a9 Optimize rec-ARM64 by emitting less instructions on loads.
Fast load uses 3 or 4 insts, whereas slow load takes 2+.
On A57 measured ~3% perf, which is expected for an OOO CPU, hopefully
perf will be much better on A53 and other in-order CPUs.
2019-05-09 00:10:01 +02:00
David GF 0eb874ba1c Adding ARM64 Linux target in Makefile 2019-05-08 22:33:14 +02:00
Flyinghead dc7f608461 wince: fix vmu issues 2019-05-08 22:31:59 +02:00
David G. F 15c7e982ca Merge pull request #1585 from davidgfnet/sdl2audio
Add SDL2 audio backend.
2019-05-08 22:20:49 +02:00
Flyinghead 3cd9736fca Ignore vscalefactor if < 1
fix black screen on some intel platforms
2019-05-08 21:33:49 +02:00
David Guillen Fandos ed8bcd7329 Add SDL2 audio backend.
The backend supports 44.1KHz and 48KHz (with resamping). The resampler
is not great, has some noise but no idea where it comes from.
This enables the switch port, since using SDL2 is the quickest way
to get audio working.
TODO: Add support in the cmake, once cmake is fixed at master/HEAD.
2019-05-08 21:04:11 +02:00
David Miller e7c44df627 Merge pull request #1583 from reicast/fh/rend-vscaler
fix scissor test and vertical scaling when using the Y scaler
2019-05-06 10:33:46 -04:00
Flyinghead c330cdd88e fix scissor test and vertical scaling when using the Y scaler
Fixes missing bottom half-screen in Mr Driller (PAL, 60 Hz), Kaen Seibo,
Mahjong Taikai II Special, Pon'n'Music 1 and 2 when in TV Composite and
RGB.
Fixes stretched screen in Cho - Hatsumei Boy Kanipan.
2019-05-06 15:23:54 +02:00
David Miller c631534ee1 Merge pull request #1554 from farmerbb/master
Android: remove duplicate intent filters
2019-05-03 12:40:41 -04:00
Flyinghead f2696a4b47 osx: add new files to project 2019-05-03 11:53:14 +02:00
skmp 3f8328da25 Merge pull request #1568 from reicast/baka/audio_options
AUDIO: Allow backend specific settings
2019-05-03 03:57:17 +03:00
skmp 397302b379 Merge pull request #1579 from reicast/ghz/speedlimit
audio wait only if fullspeed (improvements over #1577)
2019-05-03 03:53:43 +03:00
Christoph "baka0815" Schwerdtfeger 99033e297c AUDIO: Implement integer and checkbox options
I remove "text" as a possibility for the moment as we're currently not having **any** text option.
2019-05-02 20:24:49 +02:00
Christoph "baka0815" Schwerdtfeger 139ef22408 AUDIO: compile fixes for coreaudio, dsound and libao 2019-05-02 19:02:34 +02:00
Christoph "baka0815" Schwerdtfeger dc709c604f ALSA: prefix output with "ALSA:" 2019-05-02 18:49:44 +02:00
Christoph "baka0815" Schwerdtfeger 5678556cb6 ALSA: Rework initialization of pcm device
As we can now configure the alsa device in the GUI, it's no longer necessary to write the first working device back to the configuration.
Also there is now the "auto" device to automatically try to initialize the alsa device.
2019-05-02 18:48:09 +02:00
Christoph "baka0815" Schwerdtfeger 684ba26ec0 AUDIO: Reorganize settings
Move DSP and FPS above the slug selection so that all slug specific settings are after the slug selection.
2019-05-02 18:41:45 +02:00
David Quintana f307f9d5ad Simplify. Smoothing adds no value there. 2019-05-02 03:36:10 +02:00
David Quintana ac9e6d147d Change speed-dependant limiting to rely on time dilation instead of frame rate. 2019-05-02 03:21:22 +02:00
David Miller 446723b147 Merge pull request #1578 from reicast/z/win32-fullscreen
Win32 fullscreen via alt-enter
2019-05-01 19:57:54 -04:00
david miller c681dc77dc Win32 fullscreen via alt-enter 2019-05-01 19:11:35 -04:00
David Miller d6f682a329 audiostream only wait if at speed 2019-05-01 12:01:45 -04:00
flyinghead 0d19da2b4b wince: disable vmem32 on windows 2019-04-30 17:43:21 +02:00
Flyinghead f0fab09d7c yet more win32 fix 2019-04-29 18:49:31 +02:00
Flyinghead 920a93b19c more win32 fix 2019-04-29 18:38:28 +02:00
Flyinghead 4f4d99872b win32 build fix 2019-04-29 18:33:14 +02:00
Flyinghead 810b8a59da wince: 32-bit virtual mem space
use fast mem read/write for x64 and arm64 dynarecs
2019-04-29 18:23:00 +02:00
Flyinghead 693a6c97f3 vmem: revert aica ram mapping change. Fix ptr diff overflow in 64-bit
Aica ram mapping conflicts with P4 store queues in arm dynarecs
2019-04-28 20:46:18 +02:00
Flyinghead 6b78e1f879 fix dynarec regression 2019-04-28 20:41:39 +02:00
David Miller 1e04de06bc Merge pull request #1572 from davidgfnet/thfix
Improve stdclass.h/cpp support for non-Linux non-Windows platforms
2019-04-28 13:52:03 -04:00
David Guillen Fandos 3692ea7ae6 Improve stdclass.h/cpp support for non-Linux non-Windows platforms
Simplifies having implementation on platform separated files, which is a
pain for platforms which are not Windows but not Linux either (and yet
support pthreads).
Some minor cleanup here and there while we are at it.
2019-04-27 14:34:10 +02:00
David Guillen Fandos 7b50d5df8c Add ENABLE_MODEM and rework makefiles to support it. 2019-04-27 12:05:13 +02:00
Christoph "baka0815" Schwerdtfeger 0a3c361da2 AUDIO: Allow backend specific settings 2019-04-24 21:41:38 +02:00
Flyinghead 011849ea74 wince: arm64 dynarec fixes 2019-04-19 17:20:55 +02:00
Flyinghead 553f6054ce NO_MMU build fixes 2019-04-19 11:56:11 +02:00
Flyinghead 9920880987 dynarec: reserve code cache space for frequently changing blocks
detect frequent SMC check failures and use a specific code cache area
for these blocks.
flush the temp area when full but keep the main code cache area
2019-04-19 11:45:05 +02:00
Flyinghead 76348b13ce wince: use cpu ratio of 2 in dynarec 2019-04-19 09:58:25 +02:00
Flyinghead d82e5e2017 don't use mmu for dma 2019-04-18 22:48:37 +02:00
Flyinghead 0f34d776f6 wince: delete sr.FD hack, restore FD block check in x64 rec
use longjmp for interpreter fallback exceptions
2019-04-18 14:15:01 +02:00
Flyinghead d68da6bdd4 wince: let fp disable exception run before compiling a block 2019-04-18 13:55:10 +02:00
Braden Farmer aa8a922b62 Android: remove duplicate intent filters
The latest reicast builds displayed a redundant second launcher icon in the app drawer, due to a change in #1548.  This fixes the issue by removing the duplicate intent filters causing the redundant icon to display.
2019-04-16 23:38:33 -06:00
Flyinghead cf1a924f53 Merge remote-tracking branch 'upstream/fh/mymaster' 2019-04-15 22:14:49 +02:00
Flyinghead a25918839b save fpu regs when sr.FD is set, and restore them when unset 2019-04-15 19:02:10 +02:00
Flyinghead 5d6e96463c x64 and win32 build fixes 2019-04-15 18:31:15 +02:00
Flyinghead dece3fc13e wince: use setjmp/longjmp instead of try/catch for dynarecs
WinCE fast mmu implementation
WIP arm64 dynarec
2019-04-15 18:02:34 +02:00
David Miller ce90d43c34 Merge pull request #1553 from reicast/z/cmake-merge
Z/cmake merge
2019-04-12 19:43:35 -04:00
david miller a1df35d13d cmake cleanup 2019-04-12 19:42:14 -04:00
david miller 3157520dee mingw64 fixes 2019-04-12 19:15:31 -04:00
david miller 6539b8c247 _mkdir guard 2019-04-12 18:24:11 -04:00
david miller 803cad95f9 gcc flags & misc 2019-04-12 18:13:09 -04:00
david miller 68ee192ad4 compiler def. fixes 2019-04-12 18:08:36 -04:00
david miller b6c234b71b revert to using strcasecmp for other platforms 2019-04-12 17:19:40 -04:00
david miller cc9d5ec55b CMake/Master working, tested on windows with Clang && MSC (x86,x64) 2019-04-12 16:59:39 -04:00
David Miller 3d1b82854e Merge branch 'master' into fh/win32-winresize 2019-04-12 13:03:30 -04:00
flyinghead 8cdbb9c2fd Merge pull request #1548 from reicast/fh/float-vmu
Float VMU option. Android renderer native thread. 90° screen rotation option. AW fixes.
2019-04-10 21:53:41 +02:00
Flyinghead 13341ecd59 maple: process_kcode -> transform_kcode 2019-04-10 11:31:08 +02:00
Flyinghead 0445542ec2 gl: 90deg screen rotation option. Fix scissor/clip wrt scale/stretch
90deg CC screen rotation option for some arcade games
Fix scissoring and clipping when screen scaling/stretching/rotating
Clear shader cache when screen rotation changes
Properly delete all gl programs and shaders when needed
2019-04-09 15:18:48 +02:00
Flyinghead 251b4d381d android: add activity alias for intents backward-compatibility 2019-04-09 13:09:45 +02:00
Flyinghead 1fa052987b android: run renderer in a separate native thread
fixes simultaneous gamepad button presses not being registered on some
platforms
2019-04-09 10:39:29 +02:00
Flyinghead 37a533740b win32: close thread handle when finished 2019-04-09 10:37:49 +02:00
Flyinghead 1b04ef4cb1 Get rid of RTC in settings 2019-04-08 22:09:22 +02:00
Flyinghead 0a6f503efc Don't use screen stretching parameter for RTT 2019-04-08 21:51:59 +02:00
Flyinghead b87a1cc31a atomiswave: setup maple controls depending on game
more lightgun fixes but still not working
2019-04-08 19:14:55 +02:00
baka0815 56374377dd Merge pull request #1543 from reicast/baka/select_audio
AUDIO: Make backend configurable
2019-04-08 18:33:53 +02:00
Flyinghead cf7434a9e6 atomiswave: fix coin input. Subclass sega controller instead of #def 2019-04-08 17:09:10 +02:00
Flyinghead f5a60ee5f1 New option to display VMUs in game 2019-04-08 15:54:37 +02:00
flyinghead 3741b954ab Merge pull request #1544 from reicast/fh/naomi-input
Improve Naomi/AW input system. Fix custom texture loading race conditions
2019-04-08 15:52:08 +02:00
Flyinghead d78fc62055 android: fix Send Logs crash 2019-04-08 10:11:28 +02:00
Flyinghead 47bb509f02 Add horizontal screen stretching option
fix scissor test when scaling/stretching
fix infiniloop when starting a game fails
2019-04-08 00:21:06 +02:00
Flyinghead 408d16b299 imgui: clear color buffer before drawing background tex
fixes blinking edges on nvidia shield and other glitches
2019-04-07 23:33:24 +02:00
Flyinghead 4b7e4f4677 custom textures: fix race conditions 2019-04-06 19:38:00 +02:00
Flyinghead e8205e568b naomi/aw: fix atomiswave and naomi inputs
atomiswave analog axes support
map atomiswave and naomi driving games inputs
2019-04-06 19:36:57 +02:00
Christoph "baka0815" Schwerdtfeger 16f9200bfa AUDIO: Allow selection of backend 2019-04-05 22:22:46 +02:00
Christoph "baka0815" Schwerdtfeger b8ae61bc5c AUDIO: Sort audio plugins by name 2019-04-05 21:14:42 +02:00
Christoph "baka0815" Schwerdtfeger b443fe9b25 AUDIO: make the plugins self-registering
No need anymore for the RegisterAllBackends() function and all plugins in one place.
Use a static boolean to register every plugin by itself.
2019-04-05 21:05:18 +02:00
flyinghead 7e11e7aff6 Merge pull request #1541 from reicast/fh/dpad-fix
Avoid opposite dpad buttons being both down. Ignore android key repeats
2019-04-05 15:42:34 +02:00
flyinghead 09d9f737ca Merge pull request #1540 from reicast/fh/rend-perf
GL renderer optimizations for low-end devices
2019-04-05 14:52:39 +02:00
Flyinghead 0b7024f6a0 Avoid opposite dpad buttons being both down. Ignore android key repeats 2019-04-05 14:48:59 +02:00
Flyinghead d524e3381d only update the fog texture if fog is enabled 2019-04-04 22:54:36 +02:00
Flyinghead 05df2f06e2 imgui: use glcache, don't save/restore state
gl4: backport shader map changes from gl renderer
2019-04-04 22:26:21 +02:00
Flyinghead 3a73938240 UI for fog disable option 2019-04-04 20:05:13 +02:00
Flyinghead ec95c95b89 add option to disable fog effects 2019-04-04 19:26:15 +02:00
Flyinghead 994d52e012 gl: put shaders in a map and set uniforms once for all before each frame 2019-04-04 19:08:21 +02:00
Flyinghead 382279b12e imgui: use glcache 2019-04-04 19:07:09 +02:00
Flyinghead f83a06d9c0 glcache was always disabled 2019-04-04 19:06:46 +02:00
Flyinghead 125cccaa5a gles: only use GLES3 functions on android 2019-04-04 08:10:32 +00:00
skmp 5009cab191 Merge pull request #1538 from reicast/fh/threaded-haptic
android: run the vibrator in a separate thread
2019-04-04 02:00:39 +02:00
Flyinghead eadf3047c0 gles: no runtime load of libGLESv2 on non-android platforms 2019-04-03 20:24:28 +00:00
Flyinghead cc26e255e0 android: vibrate out of the synchronized section 2019-04-03 18:49:40 +02:00
Flyinghead 2d03662a9a android: run the vibrator in a separate thread
avoid lag when spamming the touchscreen controls
2019-04-03 18:39:57 +02:00
skmp 4dca8a21f9 Merge pull request #1534 from reicast/fh/win32-winresize2
win32: resize/maximize window v2.0
2019-04-01 15:49:01 +02:00
flyinghead 9b48874e87 appveyor: archive stripped exe to save space 2019-04-01 11:35:07 +02:00
flyinghead d7fcc80be4 win32: don't save window size if minimized 2019-04-01 11:32:49 +02:00
flyinghead d945b2b8de win32: allow window to be resized/maximized. Save size and max state. 2019-04-01 11:32:25 +02:00
flyinghead 8992549e47 appveyor: archive stripped exe to save space 2019-03-30 19:44:38 +01:00
flyinghead 7f0489ff28 visual studio compatibility
no modem support
no zip or 7z support so no naomi for now
hacked a .asm file as vs doesn't support inline assembly -> code dup
2019-03-30 19:26:05 +01:00
Flyinghead 3c3165999b linux and android build fix 2019-03-30 13:40:36 +01:00
flyinghead 26f02e22da Merge pull request #1531 from reicast/fh/smc-option
dynarec: add option to control smc code checks: faster, fast, full
2019-03-30 13:27:45 +01:00
flyinghead c02a6969df win32: add app icon and version resource 2019-03-30 12:32:37 +01:00
flyinghead 4b0e77a2b3 win32: don't save window size if minimized 2019-03-30 11:27:14 +01:00
flyinghead 0e198fac58 win32: allow window to be resized/maximized. Save size and max state. 2019-03-30 11:22:51 +01:00
Flyinghead 505c5b6c4d dynarec: FullCheck was being ignored and FastCheck used instead
Fix crash on arm32
Fix infinite loop on x64
2019-03-30 10:06:19 +01:00
Stefanos Kornilios Mitsis Poiitidis af6993a819 dynarec: Refactor smc-option a bit 2019-03-30 07:16:44 +01:00
skmp 66580b16c6 Merge pull request #1530 from reicast/fh/saveport-vmu
Save maple port of connected gamepads between runs. Display VMU LCD on pause
2019-03-30 05:48:24 +01:00
Flyinghead 8e9b1306e1 dynarec: make FullCheck the default SMC option 2019-03-29 20:28:49 +01:00
Flyinghead 7f44bb9956 vmu: pass bus id and port to callback 2019-03-29 19:54:59 +01:00
Flyinghead 6438a402df dynarec: add option to control smc code checks: none, fast, full 2019-03-29 19:23:37 +01:00
Flyinghead 09ea5eba78 missing changes for previous commit 2019-03-29 17:47:17 +01:00
Flyinghead 8fb1d80751 gui: display VMUs on pause 2019-03-29 17:35:00 +01:00
Flyinghead 80626b1f4e win: compile fix 2019-03-29 17:34:16 +01:00
Flyinghead daf4980fc8 input: save assigned maple port of each gamepad 2019-03-29 17:19:18 +01:00
skmp 95f4c8e9ac Merge pull request #1528 from reicast/fh/android-wipeout
Removing most of the java code and various bug fixes
2019-03-29 14:43:10 +01:00
Flyinghead 36acae9a00 gdi: treat slash as path separator on windows 2019-03-29 14:19:41 +01:00
Flyinghead eb017f6cb0 evdev: resurrect udev - fix hot swapping 2019-03-29 11:28:54 +01:00
Flyinghead 8751e55213 input: wait for 200ms before detecting button/axis input when remapping 2019-03-28 18:28:29 +01:00
Flyinghead 47201b9e48 input: analog axis as DPad should now work 2019-03-28 17:56:59 +01:00
Flyinghead eb7be51f67 gdrom: stop playing cdda when changing/ejecting disk 2019-03-28 14:53:41 +01:00
Flyinghead 5242af5879 rec-arm64: better pref fix 2019-03-28 14:26:04 +01:00
Flyinghead 20b09cf1b7 arm64: disable partially implemented 0x1337 pref optimization hack 2019-03-28 13:02:08 +01:00
Flyinghead ca750ae454 arm: aica RAM overflow crash with arm32 and arm64 recs
Move target platform #def's to build.h
Fix Sturmwind and Volgarr crashes
2019-03-28 11:41:48 +01:00
Flyinghead 0a301a4758 android: use a single activity with simple layout
remove most of the android ui remains
NativeGLActivity is the unique activity
handle window focus in/out events
refresh folder list when access to external storage is granted
record audio permission request must not overlap with external storage
perm req
2019-03-27 21:09:53 +01:00
skmp 7335b357d9 Merge pull request #1527 from reicast/fh/master-merge
snapcraft build fix
2019-03-27 17:25:27 +01:00
Flyinghead 4660479909 snapcraft build fix 2019-03-27 17:22:40 +01:00
skmp eefeda65d8 Merge pull request #1526 from reicast/fh/master-merge
build fix: Publish Dreamcast flavor
2019-03-27 12:07:30 +01:00
Flyinghead 76db5bc74f build fix: Publish Dreamcast flavor 2019-03-27 12:02:51 +01:00
skmp 2cf59b42bb Merge pull request #1523 from reicast/fh/master-merge
Tons of fixes, much improved naomi support, atomiswave support, imgui UI, arm64 dynarec, improved x64 dynarec, dsp interpreter + arm64 + x64, others
2019-03-27 11:21:51 +01:00
Flyinghead 1ef8caff88 include TCW in HD texture hash
Soul Calibur has textures sharing the same data but with different
formats
2019-03-26 21:14:39 +01:00
Flyinghead ca0816042e fix warning 2019-03-26 18:23:16 +01:00
Flyinghead a3f9764936 Add Boot Dreamcast BIOS option
Reload roms/flash when starting a new game
Better naomi reset (still have issues)
Fix error reporting with Naomi
2019-03-26 17:20:44 +01:00
Flyinghead f5c896121e Aica: fix adpcm decoding
Fix click at the end of some samples (Sonic Adventure menu sound)
2019-03-26 12:45:02 +01:00
Flyinghead cce5028ed3 AW: fix flash sector size. Implement SB_SFRES soft reset
Fixes Atomiswave freezing when exiting the service menu and problems
when saving to flash.
2019-03-26 11:54:03 +01:00
Flyinghead d6fd3e0781 android: do not request audio perms more than once 2019-03-25 23:29:33 +01:00
Flyinghead 815616369e naomi build fix 2019-03-25 21:58:54 +01:00
Flyinghead 22b08bea74 maple: disconnect/reconnect maple devices when config changes
Wait 100ms between disconnect and reconnect to let game detect it
2019-03-25 18:46:57 +01:00
Flyinghead c809c6c56f Merge branch 'fh/mymaster' into fh/master-merge 2019-03-25 16:47:47 +01:00
Flyinghead ba00da2420 dynarec: don't throw exceptions if NO_MMU 2019-03-25 13:53:49 +01:00
Flyinghead cb6acab40f missing file from previous commit 2019-03-25 11:56:41 +01:00
Flyinghead ef43883fb5 dynarec: WinCE support WIP
Only for the x64 dynarec atm
Bugs remaining
2019-03-25 11:53:13 +01:00
Flyinghead cae22b9fbb Re-init the aica sgc on reset 2019-03-25 09:41:28 +01:00
David Guillen Fandos 69ab16ad9c Use CPUID to detect MMX/SSE support
Make it so that it works with all compilers and OSes.
Tested in VS, gcc and clang (built for Android x86)
2019-03-25 00:11:32 +01:00
David Guillen Fandos cb278e367b Minor fixes/tweaks to make it easier for switch port
Unused x86-specific header unnecessarily included :/
Move config ini stuff into its own namespace, believe it
or not but conflicts with some random switch header.

Tested: built for Android, Linux x64 w/ & w/o rec-cpp.
2019-03-23 21:04:17 +01:00
baka0815 46a6a72a3e Merge pull request #1516 from reicast/baka/gdi_ctrl
gdi: set correct CTRL value in TOC
2019-03-20 18:13:23 +01:00
Flyinghead f454c79f08 TA: ISP_BACKGND_D has only 28 bits of precision
Calculate background depth accordingly
add extradepthscaling of 0.1 to wince games so the last four bits of
depth are significant
2019-03-20 16:31:12 +01:00
Flyinghead c3b93cfd8d gdi: set correct CTRL value in TOC 2019-03-20 14:33:55 +01:00
Flyinghead 8564f497d4 sh4 interp: add IsFloatingPoint() to op desc. Add delay slot 0 hack
Add UsesFPU flag to floating point ops. Use flag instead of specific
test cases in op handlers.
Adjust thrown exception in delay slot (slot illegal exception and slot
fpu disable)
Re-add delay slot 0 hack (Looney Tunes Space Race)
2019-03-20 13:45:35 +01:00
Flyinghead d0f65b19d3 mmu: templatize mmu_full_lookup 2019-03-20 10:58:59 +01:00
Flyinghead a21eedc88a implement fpu disable exception and other interp and mmu fixes
implement sh4 fpu disable exception
implement assistance/PTEA MMU registers
fix some sh4 ops with side effect in interpreter
account for delay slot op cycles
avoid any side effect when using wince tracer
extract SH4_TIMESLICE to single header file (still not used by arm and
x86 recs)
2019-03-19 21:35:55 +01:00
Flyinghead fe30fe1e8e OIT: reset scaling before drawing final quad
Fixes Wacky Races and Nomad Soul
2019-03-18 22:21:21 +01:00
Flyinghead 9e2938dff4 mmu: state change wasn't detected. WinCE syscalls tracing 2019-03-17 23:46:39 +01:00
Flyinghead 73d50486d5 mmu: dynamic switching with read/write mem function pointers 2019-03-17 22:59:18 +01:00
Flyinghead 34f46fb482 gdi: set correct CTRL value in TOC 2019-03-16 12:06:29 +01:00
Flyinghead bdc729e780 android: vjoystick haptic feedback setting wasn't being saved 2019-03-15 19:55:01 +01:00
Flyinghead e11570e71b android: hide virtual joystick if no screen touch for 10 secs 2019-03-15 19:43:48 +01:00
Flyinghead eb73c2fcf1 missing #include 2019-03-14 21:37:36 +01:00
Flyinghead e5b18cd8a0 wince: implement pref SQ to YUV converter and 32bit vram
implement incremental YUV conversion with pref SQ
implement access to 32bit VRAM with pref SQ
init YUV converter when TA_YUV_TEX_CTRL is set
set FIFO available space to 256 through SB_TFREM reg
fake FIFO status through SB_FFST reg
2019-03-14 21:35:33 +01:00
Flyinghead 4fb1cad6ba android: go back to home screen on back button.refactoring
go back to home screen when back button is pressed in content browwser
fix GL2JNIActivity
refactor GL2JNIActivity and NativeGL2Activity into common base class
2019-03-13 22:20:03 +01:00
Flyinghead 69484e4ae8 start game passed as command line argument 2019-03-13 21:54:04 +01:00
Flyinghead 89c2fd54a9 fix function name typo 2019-03-13 20:04:14 +01:00
Flyinghead 7369e81af5 naomi: close cart and free resources properly 2019-03-13 19:59:59 +01:00
Flyinghead f4568ace3c backport disassembler missing piece from nulldc 2019-03-13 17:48:21 +01:00
Flyinghead 3edf24386d maple: set SB_MDST to 1 to start dma in maple_vblank 2019-03-13 17:27:50 +01:00
Flyinghead f05af652cf crash when reading a write-only register 2019-03-13 17:24:27 +01:00
Flyinghead e6d67baf02 sh4 sched: avoid error when jitter is high and delta becomes negative 2019-03-13 17:21:52 +01:00
Flyinghead 6305df9dab ignore fldi0/fldi1 in double precision instead of dying 2019-03-13 17:19:41 +01:00
Flyinghead 6d6492ddc1 mmu: flush tables when MMUCR.TI is written 2019-03-13 17:17:08 +01:00
Flyinghead 9001de7842 android: only handle analog axis if axis value has changed
tentative fix for xbox 360 dpad
2019-03-10 23:35:14 +01:00
Flyinghead 54e9dc8338 Do not scale clipping values with rtt-upscale if rendering to vram
Enable RTT-to-vram for Flag to Flag (rear view mirrors)
2019-03-08 20:06:17 +01:00
Flyinghead c2916e6f21 Wait between two frames when gui is open 2019-03-08 20:02:53 +01:00
Flyinghead f1cea640e2 naomi: crash on exit when M4 cart fails to load
avoid loading AW cart on Naomi and the other way around
2019-03-08 20:01:54 +01:00
Flyinghead 9178206c95 add 10% dead zone to analog sticks 2019-03-08 19:56:17 +01:00
Flyinghead 0d0fd212ff Implement Ch2 DMA to 32-bit VRAM
Fixes Giana's Return
2019-03-08 13:23:51 +01:00
Flyinghead 106409a2c0 android: no sound with android < 6.0 2019-03-07 13:07:44 +01:00
Flyinghead f48c03220a android: extract VJoy handling into delegate class 2019-03-06 14:22:49 +01:00
baka0815 ad61f95dd6 Merge pull request #1504 from reicast/baka/win-build
CI/Windows: Build Release only
2019-03-06 12:43:00 +01:00
Flyinghead 45ed8cbc02 android: install buttons.png and reload it. Record audio permission.
install buttons.png when saving settings (home dir may have changed)
reload buttons.png if previous load failed when rendering
hide surface view when microphone is enabled to ask for permission
2019-03-05 23:50:52 +01:00
Flyinghead 91c7417c22 android: replace /mnt/media_rw by /storage for portable storage 2019-03-05 16:56:19 +01:00
Flyinghead 11416990de Show home directory in settings and allow to change it (android only) 2019-03-05 12:45:11 +01:00
baka0815.de be91b61986 CI/Windows: Only Release Builds 2019-03-05 10:38:56 +01:00
Flyinghead a93c340f8c android: delay rendering start by 500 ms to avoid blackscreen at startup
helps for some devices
2019-03-05 04:47:31 +01:00
Flyinghead ee0161e9c4 build fix 2019-03-05 03:15:11 +01:00
Flyinghead 2722d9d760 wercker: install git 2019-03-05 00:58:00 +01:00
Flyinghead ca58c323cd Moved most android settings into the new gui
virtual gamepad editing and settings
home directory setup during onboarding
start content browser at app startup after getting permission
Use imgui osd to display error messages (msgboxf)
Added About tab in settings with version, git hash and Send logcat
button (android)
2019-03-05 00:54:01 +01:00
Flyinghead 71ea60cc36 android: use pseudo-root folder to list storage locations
still missing changes in java and android.cpp
2019-03-04 21:49:36 +01:00
Flyinghead 17b495e7e4 NoSound setting wasn't saved
Fix profiler handler ids
2019-03-04 00:32:15 +01:00
Flyinghead f37f4f174e Generate version.cpp at build time with version, git hash and build date 2019-03-04 00:26:11 +01:00
Flyinghead e0de4210ac VJoy: decouple from emulator rendering. Use same code for gl and gl4 2019-03-02 14:20:05 +01:00
baka0815.de 608fbe58f3 CI/Windows: Build Release and Debug 2019-02-28 13:15:15 +01:00
Flyinghead 41e4c805de OSX: support new input system. Use existing emulator thread.
Added new OSD notification feature, combined with FPS counter, moved to
GUI
OSX: don't create and manage a new emulator thread but use existing one
OSX: keyboard and mouse use new input system
2019-02-27 23:02:25 +01:00
baka0815 2b3a052ac3 Merge pull request #1495 from reicast/baka/full-screen-shadow
Android: fix full-screen shadow on some platforms
2019-02-26 13:04:44 +01:00
Flyinghead a0e7231340 naomi: reload PG settings and reset jvs controller when switching game 2019-02-25 23:31:05 +01:00
flyinghead b1bb89909e win32 fixes
use imgui id to allow multiple contents with same name
2019-02-25 19:15:59 +01:00
Flyinghead 492e771272 Content browser (WIP)
Get rid of the renderer thread. It is now the main/UI thread on all
platforms. The emulator runs in a separate thread.
Content browser displayed at startup.
2019-02-25 17:52:53 +01:00
baka0815.de 1d51ff565d Java/GLES: Initialize the view with a stencil buffer of 8 (instead of 0) 2019-02-25 15:43:57 +01:00
Flyinghead 56c0358eaf win32 fix 2019-02-24 13:51:26 +01:00
Flyinghead 96dddca245 win32: mouse wheel, relative mouse position and text input support 2019-02-24 13:41:24 +01:00
Flyinghead ac6cc612c5 sdl: mouse wheel, relative mouse position and text input support 2019-02-24 13:19:50 +01:00
Flyinghead c6baa4827b x11: support mouse wheel. ascii text keyboard input 2019-02-24 12:53:49 +01:00
Flyinghead 0f5a3ab884 sdl: rumble support 2019-02-23 01:06:10 +01:00
Flyinghead 98271bb3b1 Merge branch 'fh/mymaster' of https://github.com/reicast/reicast-emulator into fh/mymaster 2019-02-23 00:18:15 +01:00
Flyinghead c37dbae4e4 android: simple rumble support 2019-02-23 00:17:59 +01:00
flyinghead 56be9f462b xinput: fix rumble 2019-02-22 19:53:26 +01:00
Flyinghead a39503dd56 rumble support for xinput and evdev 2019-02-22 19:23:03 +01:00
Flyinghead 91e7c45a5c x11: keyboard and mouse use new input system 2019-02-22 12:56:21 +01:00
Flyinghead 1eaf443c22 appveyor: copy dep dlls to artifacts. Fix SDL build 2019-02-22 11:55:15 +01:00
Flyinghead 3561b3479d win32: invert Y axes of sticks
implement inverted axis in base gamepad device
2019-02-22 11:35:41 +01:00
Flyinghead 1ddf2682d0 appveyor.yml: fix MinGW path 2019-02-22 11:04:24 +01:00
Flyinghead 654c2fc99a appveyor.yml fix 2019-02-22 11:01:27 +01:00
Flyinghead 60ebf6ad61 appveyor build with mingw 2019-02-22 10:49:13 +01:00
flyinghead a1e400b43c win32: stop audio when emu is paused to avoid looping sound 2019-02-21 22:55:50 +01:00
flyinghead d392923d86 win32: added mouse and keyboard virtual gamepads 2019-02-21 22:39:26 +01:00
flyinghead 94f346a1e0 win32: use new input system 2019-02-21 17:57:51 +01:00
Flyinghead 4ae11053ce use smart pointers to avoid crash when a gamepad is disconnected 2019-02-21 14:49:27 +01:00
Flyinghead ecc22b8213 wercker.yml: add libudev-dev dependency 2019-02-21 14:38:57 +01:00
Flyinghead 4425587389 missing file from previous commit 2019-02-21 12:46:56 +01:00
Flyinghead 8e4e2c67f2 evdev: use new input system. detect hot-plugged devices with udev 2019-02-21 12:46:00 +01:00
Flyinghead 26e43ed9bd Fix scissor test when screen scaling is on
Use full screen for gui settings
2019-02-20 23:22:58 +01:00
Flyinghead 0f1630a1b7 Use proper VAOs for the per-pixel renderer 2019-02-20 19:22:24 +01:00
Flyinghead c98b685872 android: old GLSurfaceView view/activity working again
EmuThread now a top-level class shared by both views
2019-02-20 16:59:50 +01:00
Flyinghead f4da389665 android: use gl3w loader and EGL 2019-02-20 00:09:34 +01:00
Flyinghead 3a847bf4da use GL_UNSIGNED_BYTE instead of GL_UNSIGNED_INT_8_8_8_8 2019-02-19 23:15:34 +01:00
flyinghead 9ac43772fd win32 build fixes 2019-02-19 22:35:29 +01:00
Flyinghead 054b4662fd getting rid of #ifdef GLES to use the same code for all envs
Added latest GL 4.6 header files
2019-02-19 21:40:21 +01:00
baka0815 41907bc992 Merge pull request #1460 from mar753/mar753/render-to-texture-with-options
Multipass render to texture with options - implemented
2019-02-19 19:15:21 +01:00
Flyinghead 7e9a545a05 Android: fix full-screen shadow on some platforms 2019-02-19 19:11:17 +01:00
Flyinghead 1276a58d87 move imgui renderer into rend/gles. Fix gl4 term function 2019-02-19 17:43:25 +01:00
Flyinghead a808a8f36f dynamically bind GLES functions
Compile with GLES 3.2 headers but no library
split gl_term into generic and platform-/loader-specific stuff
allow full desktop GL context creation with EGL
2019-02-19 17:21:50 +01:00
Flyinghead 9526fada5e Added RenderLastFrame() to Renderer interface
implement screen scaling for per-pixel renderer
fix output FBO not being freed/recreated when GL context is reset
refactor DrawQuad on per-pixel renderer
2019-02-19 11:36:59 +01:00
Flyinghead 810182c4fe Scale down native resolution setting 2019-02-19 00:49:24 +01:00
Flyinghead e2c839dde3 GLES: detect gl extensions and use packed depth/stencil buffer for RTT 2019-02-18 17:42:07 +01:00
Flyinghead 737dd83855 android: stop the emulator thread ASAP, don't wait for activity finish
Disable VJoy editor button when touched, to avoid launching it twice
2019-02-18 16:16:54 +01:00
Flyinghead e426bc8058 android: call eglMakeCurrent() before rendering or deleting context
Flush texture cache and terminate gui before releasing the EGL context
2019-02-18 13:14:12 +01:00
Flyinghead 666205d2a1 Define gl_term for all platforms. Delete all textures on context close. 2019-02-18 09:35:27 +01:00
Flyinghead 5701227e55 build fix 2019-02-18 00:38:11 +01:00
Flyinghead 4c1acfeab1 android: native egl surface
fps counter using imgui
restart emulator with new game in same process
2019-02-18 00:25:06 +01:00
Flyinghead b15b8de12b android: disconnect the mouse gamepad by default. Don't swallow all
keydowns events
2019-02-17 18:34:22 +01:00
Flyinghead 460a6828cf android: missing change 2019-02-16 16:59:27 +01:00
Flyinghead a0fbc91be3 Android: remove generic settings, PGC and external gamepads input config 2019-02-16 16:42:18 +01:00
Flyinghead dcbdf3a59d set glClearStencil to 0 before clearing, just in case
fix printf format string
2019-02-16 14:30:08 +01:00
Flyinghead 5e65d2a19d Per-game configuration: create/delete from gui
Removed unused settings
Per-game setting can override any setting
Built-in per-game settings can be overriden
2019-02-16 14:25:54 +01:00
Flyinghead 35bb81b195 fix some printf format strings 2019-02-16 14:16:50 +01:00
Flyinghead 914e362873 Android: bind joysticks to different maple ports 2019-02-16 13:52:38 +01:00
Flyinghead c1374980f8 android: naomi build fix 2019-02-15 21:16:39 +01:00
Flyinghead 2602d855ee android: refactor initialization
Report dc_init errors properly with a popup
Disable reios use
Use builtin per-game settings
2019-02-15 20:48:30 +01:00
Flyinghead c33df148c7 android: save/load maple controllers config. enable microphone.
Fix calling msgboxf from emu thread
2019-02-14 19:49:54 +01:00
Flyinghead 9c4085ee1e Android: fix full-screen shadow on some platforms 2019-02-14 13:52:48 +01:00
Flyinghead edba937b6f Save last rendered frame if gl driver doesn't preserve the swap buffers
Fixes flashing screen with nvidia shield when no frame is rendered
2019-02-14 12:40:17 +01:00
Flyinghead fca65dd2f9 android: virtual gamepad asn't responsive 2019-02-14 00:55:02 +01:00
Flyinghead 3320669bd4 android: use new input system
support for gamepads and mice on android
2019-02-13 20:29:49 +01:00
Flyinghead 49c432f041 arm64: fix DSP dynarec crash on some platforms 2019-02-13 14:23:47 +01:00
Flyinghead e82b9c9b18 android: remove deprecated GL2GLINative activity 2019-02-12 17:57:11 +01:00
Flyinghead 3bab26b079 OSX: build fix 2019-02-12 16:23:04 +01:00
Flyinghead 85b428c2e1 SDL: gamepad hot-plugging 2019-02-12 15:56:44 +01:00
Flyinghead 8b5c2a3fac New input handling/mapping system, SDL only for now. Gui wip 2019-02-12 11:30:24 +01:00
Marcel Szewczyk d370fd6709 PR requested changes; Adreno 506 generalized to Adreno 2019-02-11 19:02:52 +01:00
Marcel 3b951c0232 Vertical scale factor support added - typo fix 2019-02-11 11:15:01 +01:00
Marcel Szewczyk 8d4188159e Vertical scale factor support added - fixes Crazy Taxi pause menu background positioning 2019-02-10 11:51:14 +01:00
Marcel Szewczyk 7869a84f88 Additional fixes/cleanup 2019-02-10 01:10:51 +01:00
Marcel Szewczyk 7ffbd4d296 Merge branch 'master' of https://github.com/reicast/reicast-emulator into mar753/render-to-texture-with-options 2019-02-09 23:51:43 +01:00
Flyinghead 66dc13b376 gui: help tooltips 2019-02-09 22:15:08 +01:00
Flyinghead ee1caeb6c2 gui: improve layout and touch device ux 2019-02-09 21:20:03 +01:00
Flyinghead 5ef0f74620 win32: keyboard support 2019-02-09 16:22:09 +01:00
Flyinghead 1fcfb6b10a Better fix for ImGui not showing on OSX
Enable vixl debug to track dsp crash
2019-02-09 15:12:35 +01:00
David Miller 6e7bb35bdc Merge pull request #1493 from mar753/boot-fix
Fix: Instead of booting a game, reicast opens bios menu
2019-02-08 15:47:16 -10:00
Marcel Szewczyk 07449239c2 Fix: Instead of booting a game, reicast opens bios menu 2019-02-09 01:23:23 +01:00
Marcel Szewczyk 8893f97435 Handle odd screen resolution (POCOPHONE fix) 2019-02-08 22:20:02 +01:00
Marcel Szewczyk a65436cc6c Handle dynamic resolution change during emulation (LRR mode) 2019-02-08 22:15:45 +01:00
Flyinghead b2f21dfbb2 OSX: keyboard support 2019-02-08 14:58:23 +01:00
Flyinghead b70b5db8b3 OSX: mouse support 2019-02-08 11:43:17 +01:00
Flyinghead 7e4a271ce7 Fix ImGui on OSX 2019-02-08 10:22:53 +01:00
Flyinghead d95ec975c7 SDL: mouse, keyboard and gui support 2019-02-07 23:44:30 +01:00
Flyinghead 6b5f1bf005 Add .cc files rules 2019-02-07 20:08:17 +01:00
flyinghead 4685bc1fad win32: hook up mouse 2019-02-07 20:04:17 +01:00
flyinghead 3cdd39170d win32: call os_DoEvents on the emu/main thread and other fixes 2019-02-07 19:20:10 +01:00
Flyinghead 82f156f143 Gamepad support to GUI. Wire evdev, SDL and windows
Allow dc_stop() to work even when the emu is paused
2019-02-07 16:59:24 +01:00
Flyinghead 87aacd50d2 Pad dsp_t to keep savestates compatibility
Remove some unused DSP regs to avoid changing the size of dsp_t, which
breaks serialization compatibility.
2019-02-07 10:37:33 +01:00
Flyinghead eb3bbb7dc0 Android: more UI settings (video) 2019-02-07 09:42:51 +01:00
Flyinghead c02bb919c1 Android: templatize settings accessors 2019-02-06 23:34:04 +01:00
Flyinghead 7d4fa31e6e build fix 2019-02-06 22:37:08 +01:00
Flyinghead 598ea65c16 Android: use boolean prefs when possible. OSX build fix
Use jboolean instead of jint
Fix crash when navigating UI with popup keyboard's next button
Remove unused UI (PVR rendering)
OSX fixes
2019-02-06 22:28:04 +01:00
Flyinghead 1802c022fd UI with ImGui 2019-02-06 19:57:13 +01:00
Flyinghead 78fd92f95a No custom textures if no threads 2019-02-06 18:50:56 +01:00
Flyinghead a9b62164c5 No network if no threads 2019-02-06 18:42:45 +01:00
Marcel Szewczyk b26b12054b Merge branch 'master' of https://github.com/reicast/reicast-emulator into mar753/render-to-texture-with-options 2019-02-06 17:39:12 +01:00
Flyinghead a7a5618442 evdev: too much logging 2019-02-06 15:00:40 +01:00
baka0815 3c8e1110c8 Merge pull request #1480 from mar753/lowering_rendering_resolution_option
Lowering rendering resolution option
2019-02-04 19:36:11 +01:00
Flyinghead 13daefca41 Fix Naomi/Atomiswave builds 2019-02-04 11:23:26 +01:00
Flyinghead 91fb92264d x64 dynarec: do not use RSQRTSS as it lacks precision
RSQRTSS error is:
|Relative Error| <= 1.5 ∗ 2^-12
whereas SH4's FSRRA abs error is <= 2^-21

Fixes loop issues is Sonic Adventure 1 and 2
Issue #1489
2019-02-04 10:48:22 +01:00
Flyinghead 51c77b248b Enable RTT to vram for Skies of Arcadia 2019-02-03 18:11:04 +01:00
Flyinghead 4b78e24753 allocate mem based on state file size instead of current state size 2019-02-03 17:56:43 +01:00
Flyinghead 1a2eeef849 Load libretro savestates (dreamcast only) 2019-02-03 17:54:11 +01:00
Flyinghead 2ff6d1b819 Fix render to texture buffer alpha channel for 1555
Saturate alpha when strictly greater than threshold, not >=
Don't put rendered texture in cache if rendering to texture buffer
(VRAM)
Fixes Skies of Arcadia start menu

Restore VRAM lock if null
2019-02-03 17:53:02 +01:00
Flyinghead 19bddc942a android: add cue files to string res 2019-02-03 14:04:54 +01:00
Flyinghead d567ae67f7 redump.org cuesheet support 2019-02-03 13:48:55 +01:00
Marcel Szewczyk d558f5182a German translation added 2019-01-31 21:13:49 +01:00
Flyinghead 63c4a16459 preliminary support for CUE files 2019-01-30 18:28:49 +01:00
Marcel Szewczyk 377fb6ace0 rend.ResolutionPercentage acceptable values are now from 1 to 100; naming fix 2019-01-25 16:43:46 +01:00
Flyinghead 90ad16317f arm64 dsp: fix stack order 2019-01-25 15:38:55 +01:00
Flyinghead fca6f3cecb dsp arm64: fix crash when VIXL_DEBUG is off 2019-01-24 21:47:55 +01:00
Flyinghead 08473d765a android build fix 2019-01-24 09:58:13 +01:00
Flyinghead 91cfd4b2f7 Reserve and allocate maximum RAM/VRAM/ARAM in all cases
Reserve enough virtual memory space for DC and Naomi
Allocate dynarec entry point tables for max possible ram
Free mem and release vmem on exit
2019-01-24 09:48:58 +01:00
Flyinghead 0cce6cc5a5 Clean up and comments. No functional change 2019-01-24 09:40:14 +01:00
Flyinghead 1501e2273d Don't enable the dsp interpreter if using the dynarec 2019-01-23 22:59:00 +01:00
Flyinghead 8c7f9105a1 dsp dynarec: missing commit 2019-01-23 22:46:05 +01:00
Flyinghead 3a064cd068 DSP dynarec for arm64 2019-01-23 21:14:51 +01:00
Flyinghead 91b76f0c16 arm64 dynarec: missing edits 2019-01-22 18:40:36 +01:00
Flyinghead 75a04d6d28 arm64 dynarec: implement tail calling and block linking 2019-01-22 18:37:04 +01:00
Flyinghead eb37dacadb x64: disable the use of AVX instructions because of rounding issues 2019-01-22 16:17:25 +01:00
Flyinghead 9f3f13eef1 aica arm dynarec for arm64 2019-01-21 13:08:53 +01:00
Flyinghead a3682e7b22 arm64 dynarec: revert to non-explode spans and minor optimizations
Added some profiling
2019-01-21 12:54:29 +01:00
Marcel Szewczyk aa3475738a Revert "LRR: Support for OpenGL 2 added"
This reverts commit c33c0cade8.
2019-01-20 11:05:53 +01:00
Marcel Szewczyk 88b9debc89 Revert "RTT: Support for OpenGL 2 added"
This reverts commit 86339c337d.
2019-01-20 11:03:30 +01:00
Flyinghead ac4fb796ca android: enable DSP option 2019-01-19 17:15:18 +01:00
Flyinghead da07d88b03 No need to save the RTC value anymore 2019-01-19 16:49:00 +01:00
Marcel Szewczyk 86339c337d RTT: Support for OpenGL 2 added 2019-01-18 19:46:46 +01:00
baka0815 55a2261002 Merge pull request #1485 from reicast/baka/alsa_cfg
ALSA: configurable output device
2019-01-18 18:46:08 +01:00
baka0815 229f729c79 Merge pull request #1486 from reicast/baka/sdl
SDL: rumble support
2019-01-18 18:45:47 +01:00
Marcel Szewczyk c33c0cade8 LRR: Support for OpenGL 2 added 2019-01-18 18:42:46 +01:00
Marcel Szewczyk f0c4fe6fdc Additional improvements/fixes 2019-01-18 18:39:48 +01:00
Flyinghead cd4e4cbdc9 x64 dynarec: check if extension is supported by cpu. seh on win32
Check if FMA/AVX/SSE3 is supported before using it
fully naked main loop in win32 with proper seh directives
win32: more xmm regs to allocate and no need to save them when calling
out
2019-01-18 17:02:50 +01:00
Flyinghead 573f285f3b arm64 dynarec: save x29 and x30 in ngen_mainloop prologue 2019-01-18 00:06:33 +01:00
Christoph "baka0815" Schwerdtfeger 108e840324 SDL: rumble support
This adds support for rumble to the SDL backend.
It does not however attach a purupuru/rumble pack
2019-01-16 20:48:32 +01:00
Christoph "baka0815" Schwerdtfeger 1b8f45c751 ALSA: remove unused variables
loops and size are unused, so just remove them while we're here.
2019-01-16 19:14:37 +01:00
Christoph "baka0815" Schwerdtfeger 347fcf5c6c ALSA: make device configurable
Trying to load the device from the emu.cfg and if not set (should be the default for everyone currently) use the existing procedure to try to determine the device (default > plughw:0,0,0 > plughw:0,0).
2019-01-16 19:04:32 +01:00
flyinghead ed3f866835 win32 build fix 2019-01-16 17:42:36 +01:00
Flyinghead f852480b88 OSX: build fix 2019-01-16 14:44:40 +01:00
Flyinghead 05d7cf2c72 x64 dynarec: implement immediate address ram read. OSX fix 2019-01-16 13:39:52 +01:00
Flyinghead cb8e81d473 arm64: direct memory access and jit rewrite
generates direct vmem read & write accesses
trap sigsegv and rewrite using slow path
add w29 to allocatable registers
get rid of literals and use pc-rel branching
minor optimizations and cleanup
2019-01-16 13:04:16 +01:00
Flyinghead c2a048e8d8 arm64: use explode_spans to allocate regs for V2 and F64 params 2019-01-15 08:47:07 +01:00
Flyinghead e241613b8f x64 dynarec: implemented swaplb, fipr, ftrv, frswap and other fixes
native implementations for swaplb, fipr, ftrv and frswap
use explode_spans to map 2V and F64 to registers
save xmm registers when calling subroutine
2019-01-14 21:15:36 +01:00
Marcel Szewczyk 77d997401b RTT: Performance improved for DC RGB565 and ARGB4444 textures - glReadPixels() removed 2019-01-14 20:42:48 +01:00
Marcel Szewczyk 6499a82513 RTT: Additional small fixes 2019-01-14 19:32:56 +01:00
Flyinghead b465f744ba dynarec: flush fpu regs before FTRV
fixes issue with tokyo xtreme racer (x64)
might need to flush before other ops
2019-01-13 23:21:58 +01:00
Marcel Szewczyk a9affb8ac2 RTT: Stencil support for full OpenGL >= 3.0 added 2019-01-13 19:04:33 +01:00
Marcel Szewczyk a60286cc0f Single render scale factor seekbar 2019-01-13 18:22:16 +01:00
Marcel Szewczyk 82bbe690b1 Stencil support for OpenGL added - requires OpenGL >= 3 2019-01-13 17:33:23 +01:00
Flyinghead 31163b8d7e x64 dynarec: various fixes and optimizations
implemented fsca
fixed fsetgt and cvtf2i
2019-01-13 12:27:02 +01:00
Flyinghead 523b110412 arm64: dynarec fixes 2019-01-13 11:32:28 +01:00
Flyinghead a2cd9d7af1 x64 dynarec: use register alloc spans, implement native opcodes 2019-01-12 23:48:48 +01:00
Marcel Szewczyk 27360a1c41 Lgtm warnings fixed 2019-01-12 13:17:43 +01:00
Flyinghead fc05727538 dynarecs clean-up
move GetRegPtr and ngen_FailedToFindBlock to sh4/dyna
2019-01-11 23:52:20 +01:00
Marcel Szewczyk 10d6f2526a Merge branch 'master' into mar753/render-to-texture-with-options 2019-01-11 21:16:35 +01:00
Flyinghead e5ee48efa9 arm64: implement swaplb and pref. Various optimizations 2019-01-11 15:58:48 +01:00
Flyinghead ec7787c56a vixl: enable debug log on android 2019-01-11 15:57:37 +01:00
Flyinghead 0f026552c9 fix comments 2019-01-11 15:54:03 +01:00
Flyinghead ce98e78eae android: dynarec.safemode setting was ignored and always off 2019-01-11 13:18:06 +01:00
Flyinghead 1c80207879 arm64: implement ftrv and frswap 2019-01-10 21:22:53 +01:00
Flyinghead 18a16f83ac arm64: more native opcodes implemented 2019-01-10 18:58:29 +01:00
David Miller 3c57177d38 Merge pull request #1481 from mar753/clipping_switch_added
Clipping switch in settings added - Android (multiplayer/split screen fixed)
2019-01-10 07:05:48 -10:00
Marcel Szewczyk cf82be3bc8 Clipping switch in settings added - Android 2019-01-09 20:58:09 +01:00
Marcel Szewczyk 2327c1b83e nullDC.cpp updated to support other OSes 2019-01-09 17:33:41 +01:00
Flyinghead a9a2aad8f6 arm64: use register spans allocation. Implement some opcodes natively 2019-01-09 16:35:23 +01:00
Marcel Szewczyk 7e900a4e86 Merge branch 'master' of https://github.com/reicast/reicast-emulator into lowering_rendering_resolution_option 2019-01-09 00:01:03 +01:00
Marcel Szewczyk e285d7f9ba Additional improvements to lowering rendering resolution feature 2019-01-08 23:35:48 +01:00
Flyinghead 3d8b01c515 arm64: Use x28 as sh4 regs base pointer. Reg cache to avoid fetches.
Block check optimization
2019-01-08 13:29:08 +01:00
Marcel Szewczyk 8571be39fd Rendering resolution lowering (horizontal and vertical) is possible from the configuration menu 2019-01-07 23:55:43 +01:00
Flyinghead 67a4eb8f1f arm64 dynarec using vixl 2019-01-07 21:50:46 +01:00
Marcel Szewczyk 2aadb3cdd4 RTT: Stencil support added (extension required) 2019-01-07 21:37:16 +01:00
Marcel Szewczyk 7e26a172f4 Changing screen resolution: Rendering quad created 2019-01-06 22:16:21 +01:00
David Miller 6936bc2ec5 Merge pull request #1477 from reicast/baka/cdi_leak
CDI: coreio file handle leak in cdi image reader
2019-01-03 06:33:16 -10:00
baka0815 9410e37eb0 Merge pull request #1476 from reicast/baka/cdi_version
Check CDI version to avoid loading any crap as a CDI image and crashing
2019-01-02 20:17:07 +01:00
Flyinghead f20e4d8f7f coreio file handle leak in cdi image reader 2019-01-02 18:29:13 +01:00
Flyinghead 0eccf5775b Check CDI version to avoid loading any crap as a CDI image and crashing
Less console spam, better error reporting
2019-01-02 18:06:06 +01:00
Flyinghead bed7a83b77 Check CDI version to avoid loading any crap as a CDI image and crashing
Less console spam, better error reporting
2019-01-02 16:43:36 +01:00
Flyinghead 15fa475f8a Move DumpTexture() to CustomTexture and other fixes 2019-01-02 09:33:19 +01:00
Flyinghead 8532d1a032 Android: add Load Custom Textures option 2018-12-31 08:52:50 +01:00
Flyinghead ecb689051f Custom textures fixes 2018-12-30 22:23:23 +01:00
Flyinghead 9a3dd1c2d1 build fix 2018-12-30 19:44:18 +01:00
Flyinghead 3f98c2ba3c Don't delete a texture when async load is pending 2018-12-30 19:19:27 +01:00
Flyinghead e7fee139e4 build fix 2018-12-30 18:50:24 +01:00
Flyinghead dd280ee24d Custom textures loading and dumping 2018-12-30 18:42:55 +01:00
Marcel Szewczyk 302bfcd582 Merge branch 'master' into mar753/render-to-texture-with-options 2018-12-30 18:26:31 +01:00
Marcel Szewczyk 7450c247d3 Minor formatting fixes 2018-12-30 12:17:39 +01:00
Marcel Szewczyk 127072ec8d RTT: Fixed slow rendering of RGBA5551 framebuffer format on Adreno 506 2018-12-30 12:16:34 +01:00
Marcel Szewczyk 2a7f4613f3 RTT: Synchronous rendering notice dialog added 2018-12-30 12:14:05 +01:00
Marcel Szewczyk 0761ee713e RTT: glReadPixels() functions are now compatible with OpenGL ES 2.0 2018-12-30 12:13:45 +01:00
Marcel Szewczyk e981dd14f8 Render to texture full multipass support added; RTT stride textures support added 2018-12-30 12:08:51 +01:00
Flyinghead 031a40ec81 OSX: Fix crash when exiting. Add missing files to project 2018-12-29 17:42:08 +01:00
Flyinghead 2ecc54b4c9 Set DC date and time automatically, DC language setting 2018-12-23 12:59:16 +01:00
Flyinghead bcc8fd57e2 gdrom: Notify the game that the lid is closed when swapping disc 2018-12-21 15:31:04 +01:00
Flyinghead 655d36a719 Convert vertex indices to u16 wih GLES2
GLES2 doesn't support 32-bit indexes so convert them to u16 when needed
2018-12-13 22:26:25 +01:00
Flyinghead 05177b2231 Naomi: got rid of in-lst input mapping 2018-12-13 16:08:59 +01:00
Flyinghead a6881a46ac Use naomi.zip BIOS for sl2007 2018-12-13 13:08:24 +01:00
Flyinghead d41e405a50 Naomi: non-encrypted M4 carts fix (sl2007) 2018-12-13 13:06:01 +01:00
Flyinghead 35d7d24b6b Naomi: use naomi BIOS for alpilot 2018-12-13 12:11:15 +01:00
Flyinghead 5664bfb9b6 pvr: use u32 for vertex indices to avoid overflow
Fixes alpilot glitches
2018-12-13 10:57:51 +01:00
Flyinghead fea5f05b20 dispframe: initialize color clamping, for and palettes after loading 2018-12-13 09:37:11 +01:00
Flyinghead a3cba92665 Android: load/save jvs eeprom 2018-12-12 23:30:54 +01:00
Flyinghead 10d9761a65 minor fix 2018-12-12 13:49:53 +01:00
Flyinghead 5763da184c Fix bug in WriteMemBlock_nommu_ptr when size is not word-aligned
Bump max opaque polygon to 8192 (alpilot)
Minor lr backport and clean up

Fix corruption in doa2[m] and alpilot
Fix missing sound in Jambo Safari
2018-12-12 12:40:04 +01:00
Flyinghead 9c556007fb Naomi: lr backport 2018-12-11 23:20:30 +01:00
Flyinghead 5ac99d3ad5 pvr: gouraud affects drawing. don't die if render queue not empty after
waiting.
2018-12-11 23:14:14 +01:00
Flyinghead 864939da42 minor lr backport 2018-12-11 23:11:21 +01:00
Flyinghead 2b16edd71f Android: enable DSP, Add dynarec safemode/disable div matching 2018-12-07 12:58:07 +01:00
Flyinghead 9fe13e20e8 Clip high z vertices
Fixes Soul Calibur intro bogus triangles
2018-12-06 20:46:23 +01:00
Flyinghead 064531df95 Add some ExtraDepthScaling for NHL 2K2
Fixes tiny pause menu in-game
2018-12-03 15:14:00 +01:00
baka0815 bbc54e4125 Merge pull request #1462 from reicast/baka/snap_md_fix
README/Snap: Fix URL to snap/README.md
2018-12-01 19:49:18 +01:00
Flyinghead 93436c5ec1 Partially revert previous commit as it causes problems with RTT 2018-11-30 18:15:47 +01:00
Flyinghead 284dcf35a7 Add StrideSel to texture cache key as well 2018-11-30 18:06:32 +01:00
Flyinghead 63337d5178 Add ScanOrder to texture cache key
Fixes corrupted title screen in Grandia II
2018-11-30 17:56:57 +01:00
Flyinghead 7dc5fef352 Use xxhash for palette hashing
15 us -> 6 us
2018-11-30 15:24:04 +01:00
Flyinghead e444acbc09 Android: set NoBatch to 1 to enable the DSP 2018-11-30 12:40:43 +01:00
Flyinghead ba9a23d917 AtomisWave build target 2018-11-30 12:38:13 +01:00
Flyinghead 87a8fcb6f6 ARM dynarec: do a block check on the entire block
The check was on the first 4 bytes only.
Fixes Grandia II freezing on Now Loading... screen
2018-11-29 17:01:31 +01:00
Christoph "baka0815" Schwerdtfeger ae5003df8f Snap: Fix URL to snap/README.md 2018-11-28 21:43:47 +01:00
David Miller 3ab2eefb50 Update Android *SdkVersion to 26 2018-11-28 15:04:00 -05:00
David Miller f03219473c Merge pull request #1400 from reicast/baka/chdv5_2
Support reading CHDv5
2018-11-28 14:14:02 -05:00
Flyinghead 34fafb4442 Android: add 7z file type 2018-11-23 23:33:54 +01:00
Flyinghead e07dba5847 Android: fix FPS counter 2018-11-23 23:32:59 +01:00
Flyinghead 2ef90152c9 GL: add #if in shader for trilinear filtering 2018-11-23 22:33:51 +01:00
Flyinghead 24e7837eaa Naomi: backport force region setting 2018-11-23 20:51:26 +01:00
Flyinghead cfc215233f Naomi: 7z archives - Split/parent roms 2018-11-23 18:46:21 +01:00
Flyinghead d438f6d9c9 x64 dynarec: don't reset the cycle counter but add a time slice
This is how the interpreter and other dynarecs work. Better scheduling
precison.
Fixes Gundam Side Story freeze at boot.
2018-11-22 18:57:07 +01:00
Flyinghead 0d720ae0d6 Naomi: fix hotd2 and alpilot controls 2018-11-20 12:43:10 +01:00
Flyinghead 894991a44d Naomi: use default eeprom from mame rom
More I/O boards
2018-11-19 16:43:41 +01:00
Flyinghead a1aea570c5 Ignore bogus maple dma xfer
Workaround for csmash game test menu crash
2018-11-19 16:15:05 +01:00
Flyinghead eef297706c Bogus triangles due to huge negative z
Per-pixel only
Fixes vathlete
2018-11-19 15:38:44 +01:00
Flyinghead 4ec078441e Naomi: fix GD-rom games id 2018-11-17 19:27:09 +01:00
Flyinghead 4be52b7b69 missing changes... 2018-11-17 12:29:59 +01:00
Flyinghead 6274e4c3d3 Build fix 2018-11-17 12:21:48 +01:00
Flyinghead ed912ecb94 Naomi: All gd-roms defs. Build fix for OSX and Android 2018-11-17 12:09:05 +01:00
Flyinghead 62a3380bfa Naomi: GD-ROM support 2018-11-16 22:27:35 +01:00
Flyinghead 40f2d64b6c Android: Add zip files to naomi manifest. Load per-game std settings. 2018-11-16 18:35:17 +01:00
Flyinghead 5210c315dd Naomi: wrong M2 game id if char is unsigned 2018-11-16 18:33:10 +01:00
Flyinghead 52a2d3dbdc dsp: mask aica ram addr to avoid overflow
fixes ninja assault crash when starting a game
2018-11-15 21:58:04 +01:00
Flyinghead 1055c8366f Naomi: JVS boards refactoring, support for Ninja Assault 2018-11-15 18:30:54 +01:00
Flyinghead d716dfd74c Naomi: fix alpilot and world kicks series rom def 2018-11-15 18:29:19 +01:00
Flyinghead cb410438a2 Naomi: fix game id for some M2 carts 2018-11-15 18:25:23 +01:00
Flyinghead 074026842e Naomi: fix M2 carts 4MB addressing mode 2018-11-14 20:50:22 +01:00
Flyinghead b5e6d7e54a Naomi/AW: input descriptors. Load bios from naomi.zip for .bin/.dat 2018-11-14 14:13:42 +01:00
baka0815 5447375a44 Merge pull request #1458 from reicast/baka/sdl_controller
SDL: Create the first controller with two VMUs
2018-11-13 21:20:32 +01:00
baka0815.de 3b38afd1dd SDL: Rename SDK to SDL in output 2018-11-13 10:32:00 +01:00
baka0815.de 453fccb835 SDL: Only create controller when evdev is not available
If evdev is available the controller is most likely already created using evdev.
2018-11-13 10:30:54 +01:00
Flyinghead 6f3b492175 Naomi/AW: Allow bios region selection
Per-game flash and bbram save files
naomi_boot.bin now optional
2018-11-12 17:54:38 +01:00
Flyinghead 895b3a5af1 Naomi/AW: Backport rom list from lr. Skip ram test at aw startup 2018-11-12 14:53:15 +01:00
Flyinghead 9ccf0efdea switch between interpreter and dynarec at runtime 2018-11-11 23:49:41 +01:00
Marcel Szewczyk 4d39c10c91 Build fixes 2018-11-11 23:22:17 +01:00
Marcel Szewczyk 5f19eb7ae8 Rtt menu options are now handled by GLES 2018-11-11 22:01:18 +01:00
Marcel Szewczyk 4fd9de54ce Added rtt menu options 2018-11-11 17:55:18 +01:00
Flyinghead fb92d8d8c5 less log 2018-11-09 13:23:47 +01:00
Flyinghead 4c334f09ea AW: various fixes, more roms 2018-11-09 13:22:27 +01:00
Flyinghead 3e8033cc70 Don't die on Maple DMA abort 2018-11-08 10:41:40 +01:00
baka0815.de ab49ef89d0 SDL: Create the first controller with two VMUs 2018-11-08 09:02:25 +01:00
Flyinghead 0702682693 AtomisWave support
Better AtomisWave platform support
Refreshed flashrom implementaion
AtomisWave carts
Merged rom+bios romsets
2018-11-07 23:27:32 +01:00
Flyinghead e93260634d Naomi: save cart state into save state 2018-11-06 17:54:54 +01:00
skmp 19ca0edc2f Merge pull request #1442 from ccawley2011/libdl
Only link to libdl when necessary
2018-11-06 16:35:04 +01:00
Flyinghead eff998dc53 Naomi: Decrypt M4 roms header to get game id. Refactoring and clean up 2018-11-06 14:30:34 +01:00
Flyinghead 22558d190a Naomi: add dual I/O boards config for Ring Out 4x4 2018-11-06 14:01:54 +01:00
Flyinghead 592630ae5f clean up 2018-11-06 13:04:27 +01:00
Flyinghead 7fde9fe35c Naomi: finalize M4 carts support 2018-11-06 12:40:15 +01:00
Flyinghead a3f898b7d0 Naomi: implement undocumented SH4 registers to make version h bios happy 2018-11-06 10:54:13 +01:00
Flyinghead c95d13fdf1 Naomi: M1/M2/M4 missing files 2018-11-05 22:54:35 +01:00
Flyinghead 4e56432a2b Naomi: M1/M2 mame roms support. M4 carts still WIP 2018-11-05 22:53:38 +01:00
David Miller 6589f4ddbd Update Beta from merge, no real change 2018-11-04 23:49:17 +00:00
baka0815 8ab66a44b7 Merge pull request #1448 from reicast/fh/wacky-races
Enable log2 depth at runtime when supported (GL, GLES 3)
2018-11-03 22:01:22 +01:00
baka0815 441dd29a42 Merge pull request #1449 from reicast/fh/fog-table
Texture-based fog table
2018-11-03 21:46:18 +01:00
baka0815 69371070f2 Merge pull request #1452 from luserx0/snap_fixes
Snap Additions
2018-11-03 20:25:14 +01:00
Christoph "baka0815" Schwerdtfeger 001a767ab7 CHD: swap bytes of CHDv5+ audio tracks
Thanks @flyinghead
See https://github.com/libretro/reicast-emulator/pull/370
2018-11-03 19:29:55 +01:00
Christoph "baka0815" Schwerdtfeger 161e84598d Respect the offset of the padding
The StartHunk logic was flawed and while working with CHD files before v5 didn't work for v5 (and above).
The extraframes logic did work in some cases (read 3 track CHDv5) but didn't work in all cases and was merely a hack in retrospective.

Thanks to the comment of @flyinghead (see also https://github.com/libretro/reicast-emulator/commit/b6c2508922084c294bd57f275ef644f2ca6ddb28#diff-cb507bb17d74342aa45b6e4d10d607af) the logic is now correct and works for v4 and v5 files.
2018-11-03 19:24:53 +01:00
Flyinghead 2aee0324da win32: make appveyor use VS 2017, deploy release builds 2018-11-02 12:18:04 +01:00
Flyinghead 9680149457 OSX: CHD v5 support 2018-11-02 11:23:32 +01:00
flyinghead b190c37959 win32: CHD v5 support 2018-11-02 10:48:19 +01:00
Flyinghead 2003fc88d7 CHD v5 support 2018-11-02 10:14:25 +01:00
baka0815 bf3d1b2186 Merge pull request #1453 from luserx0/master
Documentation additions
2018-11-02 10:13:25 +01:00
Harry Pantazis 9e37f10720 Update DreamCast_Specs.md 2018-11-01 18:09:11 +02:00
Harry Pantazis 997bdef772 Update README.md 2018-11-01 11:33:23 +02:00
baka0815andluserx0 f3da2e7031 Update docs/CONTRIBUTING.md
Co-Authored-By: luserx0 <[email protected]>
2018-11-01 11:23:26 +02:00
baka0815andluserx0 d1455f4dd5 Update docs/DreamCast_Specs.md
Co-Authored-By: luserx0 <[email protected]>
2018-11-01 11:22:34 +02:00
baka0815andluserx0 c4c8d51b41 Update docs/Naomi_Overview.md
Co-Authored-By: luserx0 <[email protected]>
2018-11-01 11:22:13 +02:00
Christoph "baka0815" Schwerdtfeger 3a76b30188 Merge branch 'baka/chdv5_2' of https://github.com/reicast/reicast-emulator into baka/chdv5_2 2018-10-30 21:28:17 +01:00
Christoph "baka0815" Schwerdtfeger 6f358ebf8f CHD: Only pad when version >= 5 2018-10-30 21:27:25 +01:00
Christoph "baka0815" Schwerdtfeger 98c1e7253c CHD: Use the hunk caching
We didn't remember the last hunk and always read again.
2018-10-30 21:27:25 +01:00
Christoph "baka0815" Schwerdtfeger 4bb9507695 CHD: Reworked the extra frame handling
This way Sonic 2, F355, Crazy Taxi, Rayman 2 and Daytona USA work.
2018-10-30 21:27:25 +01:00
Christoph "baka0815" Schwerdtfeger eca88de501 CHD: If uncompressed we don't need to check compression 2018-10-30 21:27:25 +01:00
Christoph 'baka0815' Schwerdtfeger c5f21ab9a3 CHD: Enable FLAC on Windows 2018-10-30 21:27:25 +01:00
Christoph "baka0815" Schwerdtfeger 68d2641672 Trying to break-fix Windows using __inline instead of inline 2018-10-30 21:27:25 +01:00
Christoph "baka0815" Schwerdtfeger 2862926f2c CHD/FLAC: Use local deps for FLAC and enable on Android
Using locally installed FLAC libs, so no more need for libflac-dev.
2018-10-30 21:27:25 +01:00
Christoph "baka0815" Schwerdtfeger fd0d7aedeb CHD: Fixed the build for Android
CFLAGS were set in the wrong place and the name of the DEF was wrong too -_-°
2018-10-30 21:27:25 +01:00
Christoph 'baka0815' Schwerdtfeger a008a736d8 CHD/FLAC: surround flac.c with #ifdef 2018-10-30 21:27:25 +01:00
Christoph "baka0815" Schwerdtfeger 5e16412629 Fix includes 2018-10-30 21:27:25 +01:00
Christoph "baka0815" Schwerdtfeger 0fa4900af4 CHD: Enable FLAC via library (on Linux builds) 2018-10-30 21:27:25 +01:00
Christoph "baka0815" Schwerdtfeger 50bcc8cd46 CHD: Enable support for LZMA (CDLZ) compression 2018-10-30 21:27:25 +01:00
Christoph "baka0815" Schwerdtfeger 4691418689 CHD: Check for extra frames
If the frame count is not dividable by 4, there are extra frames added to keep a padding.
This is true for F355 (450 frames -> 2 extra frames) and others.

Also move CD_TRACK_PADDING to chd.cpp to work around problems with including from C and C++.
2018-10-30 21:27:25 +01:00
Christoph "baka0815" Schwerdtfeger d24b68f592 CHD: read additional track types
Also don't print "Unable to find metadata" as it's mostly not true (we reach this part after the last track)
2018-10-30 21:27:25 +01:00
Christoph "baka0815" Schwerdtfeger 2de15899f2 CHD: Wrap FLAC and LZMA with defines
Make CHDv5 generally work without FLAC and LZMA decoding possibilities so there is currently no need for extra deps.
2018-10-30 21:27:25 +01:00
Christoph "baka0815" Schwerdtfeger 401d931b96 CHD: Imported https://github.com/rtissera/libchdr/commit/96a2ce8a5bf59a900e4e786a9f7e42b910f7c6e0 2018-10-30 21:27:25 +01:00
Christoph "baka0815" Schwerdtfeger 46986f3caa CHD: Only pad when version >= 5 2018-10-30 20:38:19 +01:00
Flyinghead 4bce2bbbbf OSX wants GLSL 1.4 or later 2018-10-30 11:48:44 +01:00
Flyinghead 5e59901e70 OSX build fixes 2018-10-30 11:29:30 +01:00
Flyinghead 2b25244c95 cResetEvent: needs absolute timeout value. Fixes Android FPS drop. 2018-10-30 10:56:25 +01:00
Iam Bot 0d69050b63 Documentation additions 2018-10-30 03:26:55 +02:00
Iam Bot cd3cd65cc8 Snap: Added README for snap, played around with snapcraft.yaml and updated root README with snapcraft status 2018-10-30 02:41:34 +02:00
flyinghead 0d965fe3a3 mingw32 build fix 2018-10-29 22:59:46 +01:00
Flyinghead a1745801f0 cResetEvent: convert to ns instead of us 2018-10-29 21:41:57 +01:00
Flyinghead d6e2dc0317 Android: account for skipped frames in FPS counter 2018-10-29 21:14:41 +01:00
Flyinghead dd7d0a1ac2 Android: deadlock due to cResetEvent.Wait() bug 2018-10-29 20:56:45 +01:00
Flyinghead dc9780eb46 Android: fix black screen at boot on some devices 2018-10-29 20:03:47 +01:00
Flyinghead 3e9d8d8a07 Free TA contexts on exit 2018-10-29 20:02:12 +01:00
Flyinghead 6177a5b33a Clear texture cache on exit 2018-10-29 18:02:47 +01:00
Flyinghead 415e0ab356 Fix x86 builds 2018-10-29 16:53:26 +01:00
Flyinghead bffccac5a6 coreio file handle leak in cdi image reader 2018-10-29 16:45:49 +01:00
Flyinghead 7bb00a339f Free maple devices on exit. Avoid mem leaks on startup. 2018-10-29 16:31:44 +01:00
Flyinghead 47be33d388 Free dynarec code blocks on exit 2018-10-29 16:10:39 +01:00
Flyinghead 8a56710841 New save state format 2018-10-29 15:11:34 +01:00
Flyinghead 3c375b84bb android: change git log branch 2018-10-29 14:35:15 +01:00
Flyinghead ffb72cd0b6 Texture-based fog table 2018-10-29 00:31:24 +01:00
Flyinghead 96157de639 Enable log2 depth at runtime when supported (GL, GLES 3)
Fix issues with pixel scaling and scissoring.
Wacky Races should not be playable.
2018-10-28 22:09:36 +01:00
Marcel Szewczyk f309a59fac Render to texture single pass implemented 2018-10-28 20:16:45 +01:00
David Miller 75d319ea3c removed pragma once from arm-new.h, inline file 2018-10-28 15:10:53 -04:00
David Miller c9abcf6cbb Merge branch 'master' of https://github.com/reicast/reicast-emulator 2018-10-28 11:46:55 -04:00
David Miller a8c09197a3 os_MakeExecutable() using sizeof(sz) 2018-10-28 11:45:35 -04:00
David Miller b907e3ff4d Merge pull request #1441 from ccawley2011/no-evdev
Fix compilation on systems without evdev
2018-10-28 11:40:40 -04:00
Flyinghead cdb5cf662b Initialize PVR function pointer to non-null 2018-10-28 11:33:35 -04:00
Flyinghead a88bed1690 Fix mismatched new/delete operators (master) 2018-10-28 15:42:26 +01:00
Flyinghead 0cfd8f5494 Sprites face culling is reversed.
Fixes South Park Rally and Wacky Races invisible menus.
2018-10-28 09:43:48 -04:00
David Miller 45bf5e51b1 Merge pull request #1443 from janisozaur/patch-1
Fix mismatched new/delete operators
2018-10-28 09:17:01 -04:00
David Miller 904bb19def Merge pull request #1444 from janisozaur/include-guards
Add missing include guards
2018-10-28 09:16:35 -04:00
Michał Janiszewski a69bd937c3 Add missing include guards 2018-10-28 13:45:46 +01:00
Michał Janiszewski 2cae875fa2 Fix mismatched new/delete operators 2018-10-28 13:18:25 +01:00
Flyinghead e4055f3192 Naomi: return ones when reading past the actual rom size. dc_reset()
Special JVS setting for Outtrigger (rotary encoders)
Return FF when reading past the actual roms area
Extract dc_reset() function for future use
2018-10-28 12:35:19 +01:00
Flyinghead 22b18d97a0 Don't flush the dynarec cache when the sh4 instruction cache is flushed
Fixes Shikigami No Shiro II slowness
2018-10-28 01:29:44 +02:00
Flyinghead 15372f4187 Modem: close connecting sockets on exit 2018-10-26 19:38:59 +02:00
Flyinghead cfbd261c75 Initialize PVR function pointer to non-null 2018-10-26 18:17:30 +02:00
Flyinghead aab0a4e36d Modem: Fix VC 2K game sport games series 2018-10-26 18:14:34 +02:00
Cameron Cawley 2632c5b830 Only link to libdl when necessary 2018-10-24 22:59:43 +01:00
Flyinghead d5076c5038 travis: only ouput dc apk 2018-10-24 23:09:51 +02:00
Flyinghead e87a701898 travis: update output apk path/name 2018-10-24 22:44:54 +02:00
Cameron Cawley 7a5a3301ae Fix compilation on systems without evdev 2018-10-24 20:27:12 +01:00
flyinghead ea993d92e9 DSP: access violation on win32 x86 due to missing exec perm 2018-10-24 18:37:11 +02:00
Flyinghead 4fcfabf55a Aica-arm: fix x86 dynarec with gcc 2018-10-24 18:02:27 +02:00
null void 5496b52cdf removed nullptr, after the previous rollback was remerged (partially?) it seems to be causing trouble for builds with old compilers, where c++ std isn't set to at least 11, etc. 2018-10-24 11:37:31 -04:00
flyinghead ebca83e56e Naomi: fix raw BIN/DAT files loading on win32 2018-10-24 10:34:50 +02:00
Flyinghead 976d647e1c android: naomi app flavor 2018-10-22 17:45:19 +02:00
Flyinghead 6a16262b62 rec-ARM: increase significant bits in addresses for 8MB ARAM/16MB VRAM 2018-10-22 17:43:30 +02:00
Flyinghead 282534d7bc cdi, chd: better error messages 2018-10-22 17:39:02 +02:00
Flyinghead efcb95b4ee Naomi: proper read/write handlers for memory area 0x600000 2018-10-22 17:35:08 +02:00
Flyinghead af1b2da0bf maple: minor fix 2018-10-22 17:33:38 +02:00
Flyinghead b1bd3e251e Naomi: get rid of .lst files 2018-10-21 22:16:28 +02:00
Flyinghead c07cbbe9bf JVS: fix substract coin 2018-10-21 03:25:49 +02:00
flyinghead e7fd2919bd win32: ignore lst size when mapping Naomi rom files 2018-10-21 02:55:07 +02:00
flyinghead 27b79edf6f win32: Naomi test/service/coin keyboard bindings 2018-10-21 02:51:20 +02:00
flyinghead e8a6835972 Naomi: force eeprom save. Ignore JVS node id if outside range 2018-10-21 02:50:08 +02:00
flyinghead 275c9c1516 Naomi: Cosmic Smash per-game setting 2018-10-21 02:48:24 +02:00
flyinghead 0d1a892515 JVS: fix buffer overflow (win32 crash)
Fix MSVC build.
2018-10-20 20:08:51 +02:00
Flyinghead fb84df6665 Better logging 2018-10-20 19:38:21 +02:00
Flyinghead 9d327f3592 Aica-rec: revert to original ops order (load arm flags first) 2018-10-20 16:21:22 +02:00
Flyinghead e31a1ddf71 Aica: fix ARM and x86 dynarecs for unaligned branch op
Fixes sound issue in Spikers Battle
Tentative implementation of x86 rec asm functions on linux
clean up
2018-10-20 13:59:12 +02:00
flyinghead 84ab237b09 Comment for unaligned branch in arm7 2018-10-20 13:51:13 +02:00
Flyinghead 431b3e4324 Naomi: buffer overflow 2018-10-19 19:23:43 +02:00
Flyinghead 921228c7a9 Naomi: rec-arm do_sqw_nommu_area_3 fix
Fixes black screen on boot with many Naomi games on arm:
Alien Front
Virtual Tennis 2
Virtua NBA
Gun Survivor 2 code: Veronica
Jambo Safari
2018-10-18 16:15:09 +00:00
Flyinghead d27d4f9b00 Naomi: fix for ARM 2018-10-18 09:55:17 +00:00
Flyinghead 24f46f9813 Raspberry Pi build fix 2018-10-17 14:04:39 +00:00
Flyinghead 613e42a014 Naomi: better id of games, per-game jvs setup and settings
Better lst parsing with error handling
2018-10-17 13:18:24 +02:00
Flyinghead 18c6031bc8 JVS: Fix controls of Crazy Taxi, Power Stone and Zombie Revenge 2018-10-16 17:51:04 +02:00
Flyinghead 4b38b9b788 less log 2018-10-16 15:35:28 +02:00
Flyinghead 2214af734f JVS: Fix multiple i/o board problems
Rotary encoders support for Virtua Golf and Shootout Pool
2018-10-16 15:34:45 +02:00
Flyinghead 7156a165e3 JVS: multiple I/O boards support and bug fixes 2018-10-15 00:59:52 +02:00
Flyinghead 2e367ed3c2 JVS: Fix length of various 86 commands 2018-10-12 17:19:59 +02:00
Flyinghead cab0bdbe42 Fix light gun y position in VGA mode 2018-10-12 17:19:03 +02:00
Flyinghead f24edb4df5 Don't die on ObjectList PVR list type
NAOMI Virtual On Oratorio
2018-10-12 17:18:21 +02:00
Flyinghead 2c4e68ff9f JVS: refactoring to be closer to actual hardware
Returns multiple JVS messages at once
Multiple I/O boards correctly handled
Jambo Safari playable
Virtua Golf boots
2018-10-11 21:17:55 +02:00
Flyinghead 82e0fc7f60 Don't crash on invalid ram write size. Report and ignore 2018-10-11 21:15:00 +02:00
Flyinghead ff01e3521b Better NAOMI JVS emulation 2018-10-11 10:09:28 +02:00
Christoph "baka0815" Schwerdtfeger 0f1c63b447 CHD: Use the hunk caching
We didn't remember the last hunk and always read again.
2018-10-09 22:13:35 +02:00
Christoph "baka0815" Schwerdtfeger e72bd9161e CHD: Reworked the extra frame handling
This way Sonic 2, F355, Crazy Taxi, Rayman 2 and Daytona USA work.
2018-10-09 22:12:47 +02:00
Flyinghead 77fae1ef09 Backport changes from libretro 2018-10-05 15:07:30 +02:00
Stefanos Kornilios Mitsis Poiitidis 4ceac65b0d Merge pull request #1412 from reicast/fh/aica-int-timing
AICA/DMA: Make the transfers take some time, add fallback option. Fixes sfa3 and bomberman online
2018-10-05 14:29:00 +02:00
Stefanos Kornilios Mitsis Poiitidis 09f8a50bf2 AICA: Make async dma an option, default on 2018-10-05 14:24:56 +02:00
Flyinghead 124f920170 Backport GL 2.0 support from libretro core 2018-10-04 22:37:35 +02:00
Flyinghead dfd0f2901b minor clean up 2018-10-04 21:30:22 +02:00
Flyinghead 27b710e589 ifdef's around renderer types 2018-10-04 20:01:14 +02:00
Flyinghead b47be37b32 Dynamic switching between GL3 - GL4 renderers 2018-10-04 19:44:52 +02:00
Flyinghead 038654b28b win32: include path 2018-10-04 16:25:54 +02:00
Flyinghead 267c4daa27 win32: Add GL4 renderer files to msvc project 2018-10-04 16:19:37 +02:00
Flyinghead 8116072f7e Refactor shader selection/compilation. Avoid using glcache for texture
in GL4 renderer.
2018-10-04 15:55:41 +02:00
Flyinghead 7203681202 Less code dup 2018-10-04 14:49:20 +02:00
Flyinghead 3a929aeeb1 Terminate A-buffers cleanly. Call renderer Term() at shutdown.
Less code dup.
2018-10-04 14:04:15 +02:00
Flyinghead b8ae998252 If GL4 renderer is not supported, fall back to default. Fix SDL GL init. 2018-10-04 13:37:45 +02:00
Flyinghead 0260b00c00 Less code dup 2018-10-04 12:32:26 +02:00
Flyinghead 1dfc9902b7 Share scale_x and scale_y between GL and GL4 renderers. Don't use
ShaderUniforms in OSD.
2018-10-04 12:03:00 +02:00
flyinghead ef5e8593fa GL4: Initialize atomic buffer correctly. Limit size of pixel buffer.
SetupMainVBO should be static
2018-10-04 10:58:33 +02:00
flyinghead ce65be2f63 dsound: always wait on push 2018-10-04 10:56:07 +02:00
Flyinghead 3f791d6f04 Merge OIT renderer into master 2018-10-04 10:29:23 +02:00
Abandoned Cart d9f8187d6d Merge pull request #1429 from reicast/ac/ui_cleanup
Android/UI: UI cleanup (themes, views, scaling, etc)
2018-10-03 14:29:17 -04:00
Ender's Games caf78e9cd7 Revert context due to lack of improvement 2018-10-03 08:30:49 -04:00
Ender's Games 46299825ae Add Resolution Mode w/ forced 640x480 emu view 2018-10-03 01:12:40 -04:00
Ender's Games 8d52045265 Stop reading values that are "malformed" on Android 2018-10-03 00:12:57 -04:00
Ender's Games 851c126129 Make blue theme summery, Version spacing 2018-10-02 23:43:17 -04:00
Abandoned Cart d436c30f3b Merge pull request #1425 from reicast/ac/dropbox
Update Dropbox API from 1.6 to 3.0
2018-10-02 23:21:55 -04:00
Ender's Games 2a6ef7221f Fix theme applying to generic game list 2018-10-02 23:05:47 -04:00
Ender's Games 843aafebbc Follow the pre-existing naming conventions 2018-10-02 22:07:24 -04:00
Ender's Games 386104d20e Link Dropbox API to new v2 compatible project 2018-10-02 21:32:31 -04:00
Stefanos Kornilios Mitsis Poiitidis 84bf6ab913 Merge pull request #1428 from reicast/fh/ftrc-op-fix
sh4: Fix FTRC (ipr, canonical, x86) by using correct positive cutoff value
2018-10-02 23:12:28 +02:00
Ender's Games 1decfdcccc Provide meaningful toast, dismiss dialog on error 2018-10-02 16:38:06 -04:00
Ender's Games b16d2e637e Proguard: Keep all reicast classes and members 2018-10-02 16:15:23 -04:00
Flyinghead ba8e9dcab0 link error with dispframe 2018-10-02 12:29:29 -04:00
Flyinghead 0627530e33 GL: avoid white lines on the screen sides due to rounding 2018-10-02 12:28:42 -04:00
Ender's Games a096cac24e Gracefully error when client is not initialized 2018-10-02 12:25:32 -04:00
Ender's Games 10b623545e Add proguard config to debug for Travis 2018-10-02 10:49:53 -04:00
Abandoned Cart 0bd19e5800 Merge pull request #1424 from reicast/ac/cleanup
Null checks, Prettier user-end appearance, etc
2018-10-02 10:41:31 -04:00
Abandoned Cart 9bc22e7ecc Merge pull request #1427 from reicast/fh/implied-listinit
Some games send TA data without calling ListInit first. Don't crash in that case
2018-10-02 09:59:11 -04:00
Abandoned Cart de5a04a503 Merge pull request #1426 from reicast/fh/unaligned-vram-access
Do not crash on unaligned VRAM read access. Just return 0.
2018-10-02 09:58:35 -04:00
Ender's Games 94e9c81bf2 Revert scope of Emulator class reference 2018-10-02 09:55:32 -04:00
Ender's Games f03ac5e4d0 Provide Toast messages with app context 2018-10-02 09:52:28 -04:00
Flyinghead f419786584 Fix sh4 FTRC op to use correct positive cutoff value.
Fix for interpreter, common dynarec and x86 rec.

Fixes wrong car color in Tokyo Xtreme Racer car selection screen.
2018-10-02 12:38:49 +02:00
Ender's Games ef7e04ff24 Implement a proguard file to keep things clean
Dropbox runs wild with 20,000 methods otherwise
2018-10-02 05:03:43 -04:00
Flyinghead 41899230fb Some games send TA data without calling ListInit first. Don't crash in that case.
Fixes crashes in Looney Tunes Space Race, Test Drive Le Mans and others.
2018-10-02 10:25:15 +02:00
Ender's Games 69d2f1cc60 Address a missing reference to OkHttp3
https://github.com/dropbox/dropbox-sdk-java/issues/126
2018-10-02 04:17:48 -04:00
Flyinghead 19b37b9957 Do not crash on unaligned VRAM read access. Just return 0.
Fixes House of the Dead 2
2018-10-02 10:07:11 +02:00
Ender's Games ae7bc65591 Attempt to update Dropbox API from 1.6 to 3.0 2018-10-02 04:04:18 -04:00
Ender's Games edc8617d69 Move VGA check to Compat and add Safemode
This is the first step in creating a fully-features class for generating default values for known game settings.
By implementing the PGC and providing the ability to backup and restore the configuration, personal findings can always replace these values. Instead, this will serve as a suggestion when configuring a new game without forcing the user to update in order to change them.
2018-10-02 01:21:09 -04:00
Ender's Games 57449e91e0 Fill in missing values, Return emu default for -1 2018-10-02 00:55:08 -04:00
Ender's Games b29b9fb6bb Use generic spinner builder, Remove TV default 2018-10-01 21:36:42 -04:00
Ender's Games b0d26f1117 Move untested games to default category
While it is safe to assume they will have similar results, they are untested and should error on the side of caution
2018-10-01 17:16:44 -04:00
Ender's Games 3b31877c25 Set PGC cable default based on compatibility 2018-10-01 17:16:44 -04:00
Ender's Games 2c38ac9f26 Remove all special characters from IDs
This also serves as a checkpoint for referencing the original (unmodified) ID values.
2018-10-01 17:16:44 -04:00
Ender's Games 7089c8a81f Verify game IDs against RF Generation 2018-10-01 17:16:44 -04:00
Ender's Games ed5008c064 Complete the list of EU / NA title defaults
Complete the list of TV-only titles for EU / NA

Complete the list of patchable titles for EU / NA

Complete the list of untested titles for EU / NA

Complete the list of unlicensed titles for EU / NA

Complete the list of supported titles for EU / NA

Needs to be verified, as there are duplicate entries
2018-10-01 17:16:43 -04:00
Ender's Games 0bf40c0239 Begin establishing default VGA settings
Courtesy of the tireless testing by Zorlon at https://www.epforums.org/showthread.php?56169-Dreamcast-VGA-Compatability-list-amp-Guide

Add available VGA return values and notes
2018-10-01 17:16:43 -04:00
Ender's Games f19a482aa4 Clean up preferences to avoid visual workarounds
The user should not need to see that the values are non-standard because all they need is the text. Also, preferences should not be used in hardcoded form.
2018-10-01 17:16:43 -04:00
Ender's Games f255553ce8 Android: Verify the string content before indexing 2018-10-01 17:16:43 -04:00
Flyinghead 601fafa1ad Light gun support 2018-10-01 20:34:35 +02:00
Flyinghead f4d14ec4aa android: fix cable,region,broadcast settings 2018-10-01 12:14:09 +02:00
Flyinghead 19c0e3aea5 arm: Link error when compiling for arm with TARGET_NO_AREC 2018-10-01 09:35:02 +02:00
Flyinghead 7b596bd388 Avoid heap corruption on android
No idea why this happens. Avoiding malloc/free during compile seems to
help.
2018-09-30 20:42:18 +02:00
Abandoned Cart 4b24d22385 Merge pull request #1422 from reicast/ac/file-uri
Avoid duplicate URI references, Verify and verify again
2018-09-30 11:43:22 -04:00
Flyinghead 5d8d1bd107 GL: Partial redraws. OSD fixes
EGL: Request the surface to be preserved between two rendering
Clear the sides of the screen when not rendering widescreen.
Do not re-create GL resources multiple times (android)
2018-09-30 12:39:47 +02:00
Ender's Games c1494b9363 Skip sending info on missing ID, Use id on blank name 2018-09-30 05:52:56 -04:00
Ender's Games dc5a3df78f Add Android settings for PGC cable, regio, broadcast 2018-09-30 05:52:47 -04:00
Abandoned Cart bca0f296eb Merge pull request #1423 from reicast/fh/pgc-cable-region
Add cable/region/broadcast to per-game configuration.
2018-09-30 05:28:33 -04:00
Ender's Games e1706885ad Skip Android configurations that have no id/name 2018-09-30 05:06:33 -04:00
Flyinghead 5ba9916b22 Add cable/region/broadcast to per-game configuration.
Do not save per-game settings if the game name or id is unknown (NAOMI).
2018-09-30 10:54:09 +02:00
Ender's Games 4a3bec95f8 Avoid duplicate URI references, Favor overly permissive 2018-09-30 04:48:44 -04:00
Abandoned Cart 6db2f3999f Merge pull request #1420 from reicast/ac/android
Cleanup and fixes for permissions, themes, etc.
2018-09-30 00:33:40 -04:00
Ender's Games e392d4702c Prevent changing to a theme if it's already set
This may resolve issues with some devices reloading when attempting to enter settings.
2018-09-30 00:09:11 -04:00
Ender's Games 24504bc22e Fix a typo. Always check your copy/paste twice. 2018-09-29 22:08:35 -04:00
Ender's Games b909c4247b Add a popup for when permissions are not accepted
Despite it being obvious that to play games from the sdcard, you need to access the sdcard, mistakes can happen.
2018-09-29 21:23:57 -04:00
Flyinghead 9de8379434 GL: clear gl framebuffer before drawing a direct FB write 2018-09-29 18:10:43 +02:00
Flyinghead ac4a98ec85 Serialize broadcast, cable and region. Signal EOR after loading a state.
broadcast, cable and region must be restored when loading a state of a
crash is likely to happen.
After loading a state, the emulator may hang waiting for an end of
render interrupt. This happens if a render was done right before saving
the state but before the EOR interrupt is raised. So we signal an EOR
after loading a state just in case.
2018-09-29 16:34:58 +02:00
Flyinghead d81a3cd720 save states: fully restore the maple devices when loading a state 2018-09-29 16:13:07 +02:00
Flyinghead 407a579bfc GL: take pixel scaling into account for OSD buttons and text coords
Fixes OSD with Wacky Races and JoJo's Bizarre Adventure
2018-09-29 14:48:18 +02:00
Abandoned Cart 03f935c298 Merge pull request #1419 from reicast/ac/android
Theme improvements and updates
2018-09-28 15:06:26 -04:00
Ender's Games a2eed6bb06 Remove a stray tag to disable tinting 2018-09-28 10:12:27 -04:00
Flyinghead c49e6c17d0 gl: isinf() issues with GLES3. Use it with GL only
Fixes black screen in PSO and Sonic Adventure 2 on Android
2018-09-27 21:45:03 +02:00
Ender's Games f14d670b5b Match the original texture hue and add PSD 2018-09-27 15:44:55 -04:00
Ender's Games ba9351dac4 Minimize the "bubble" pattern of dark texture 2018-09-27 15:39:31 -04:00
Abandoned Cart ddacfd4e7a Merge pull request #1418 from reicast/ac/android
Convert to compat tints instead of style definitions
2018-09-27 13:22:04 -04:00
Ender's Games 57dacb4bd8 Convert to compat tints instead of style definitions 2018-09-27 12:55:14 -04:00
Abandoned Cart ab4566de4f Merge pull request #1416 from reicast/ac/android
Remove GL2JNINative (deprecated Xperia Play compat)
2018-09-27 03:27:17 -04:00
Ender's Games 81c98768e5 Remove GL2JNINative (deprecated Xperia Play compat)
Saying it only works with a very small set of hardware is no different than saying "please try this with everything and tell me when it doesn't work"
2018-09-27 02:52:26 -04:00
Abandoned Cart cc217e944f Merge pull request #1415 from reicast/ac/theme-a-palooza
[DO NOT MERGE] Continuation of (I don't know the numbers)
2018-09-26 23:27:07 -04:00
Ender's Games 437fbd6c52 Add a version item to the navigation view footer 2018-09-26 22:41:03 -04:00
Ender's Games 9e35b50592 Explicitely listing the http is an archaic concept
and it makes the words stretch into the artwork
2018-09-26 22:24:15 -04:00
Ender's Games 8c25d4e5d7 Rebuild icons and fix missing disk borders 2018-09-26 22:22:12 -04:00
Stefanos Kornilios Mitsis Poiitidis 4386233f94 Merge pull request #1413 from reicast/ac/theme-a-palooza
Only default to a storage list when not searching
2018-09-27 03:55:01 +02:00
Ender's Games 6e1b12eec2 Only default to a storage list when not searching
More scenarios need to be investigated before deciding to not display a file list when displaying games altogether.
2018-09-26 20:29:06 -04:00
MrPsyMan e62a766d92 Merge pull request #1407 from reicast/ac/theme-a-palooza
Theme-a-palooza. (Adding themes - for the more serious)
2018-09-27 03:13:52 +03:00
Ender's Games 4ca0252734 Remove view background caching, Add a search clear 2018-09-26 19:29:27 -04:00
MrPsyMan 2e7d5efaf9 Update Notable game bugs.md 2018-09-27 00:31:44 +03:00
Flyinghead 5fe41e5f1f keyboard: reset released key 2018-09-26 22:58:15 +02:00
Flyinghead af5931c214 House of the Dead 2 does unaligned vram access 2018-09-26 22:53:43 +02:00
Flyinghead a522bf114b maple: Fix mouse FD 2018-09-26 22:37:51 +02:00
Flyinghead 10c7650690 Schedule the interrupt signaling the end of an Aica DMA transfer instead
of raising it immediately.

Fixes Street Fighter Alpha 3 and Bomberman Online
2018-09-26 22:01:48 +02:00
Ender's Games 2c8446c3d1 Make dark theme darker, Add a soft blue theme 2018-09-26 12:36:50 -04:00
Ender's Games 6dd2df0bd5 Add a proprietary BIOS icon, Optimize banner size 2018-09-26 10:45:17 -04:00
Abandoned Cart a4494dbc9f Merge pull request #1394 from reicast/ac/android
[OnHold] Revert "Interrupt Hack setting w/ less stigma"
2018-09-26 09:36:31 -04:00
Ender's Games ee3a474ee4 Revert "Interrupt Hack setting w/ less stigma"
This reverts commits e5c0f0e, eebf3fc, 14fc7d9
2018-09-26 09:06:07 -04:00
Ender's Games bf71799798 Move themes to settings, Fix reloading after clear 2018-09-26 09:04:05 -04:00
Christoph 6077857190 Merge pull request #1408 from reicast/fh/ta-overrun-fix
Detect TA overruns and cancel the rendering. Increase TA data size
2018-09-26 10:11:58 +02:00
Flyinghead 752d254982 X11: keyboard auto-repeat detection 2018-09-26 10:08:49 +02:00
Flyinghead e3bb0a09ab Detect TA overruns and cancel the rendering. Increase vertices, indices
and translucent polygons max count.

Fixes crashes in D2 and Triggerheart Exelica.
2018-09-26 09:42:43 +02:00
Abandoned Cart e45eaed321 Merge pull request #1406 from reicast/baka/appveyor_v140
AppVeyor: Enable v140 toolset
2018-09-26 00:37:38 -04:00
Ender's Games 4b0d1092c1 Android: Adjust theme prefs for future selections 2018-09-26 00:12:08 -04:00
Ender's Games 93319c6c6c Android: Add DC theme and redesign default 2018-09-25 23:50:32 -04:00
Flyinghead 4547973561 Better mouse handling on X11 2018-09-26 02:00:50 +02:00
Flyinghead 3ff14dd2b3 Modem: shutdown local socket when remote is shutdown
Fixes issues with http requests: web browsers, Monaco Grand Prix Online
2018-09-26 00:04:57 +02:00
Christoph "baka0815" Schwerdtfeger 6a8eafbc5c CHD: If uncompressed we don't need to check compression 2018-09-25 21:46:25 +02:00
Christoph "baka0815" Schwerdtfeger 1ed69ade64 AppVeyor: Enable v140 toolset
We already set os to VisualStudio 2015, but the toolset was still set to v120 (VS 2013).
2018-09-25 19:27:07 +02:00
flyinghead c135ab0e90 Win32: fix msvc build. removed tick thread 2018-09-25 14:09:07 +02:00
Flyinghead 1320ce5949 Modem: Close pico socket when native one returns an error.
Linux build fix.
2018-09-25 12:39:37 +02:00
flyinghead be8bae0547 Modem: port to win32/winsock 2018-09-25 12:29:51 +02:00
flyinghead 21f47c03ec Fix dynarec x64 crash with mingw64.
Get rid of CDI warning pop up dialog
2018-09-25 12:27:37 +02:00
Flyinghead c850093b0a OSX: bind -> ::bind for UDP too 2018-09-24 21:37:07 +02:00
Flyinghead 36e13a9468 Proper way to close sockets 2018-09-24 21:19:43 +02:00
Flyinghead b7730d943e Merge branch 'fh/mymaster' of https://github.com/reicast/reicast-emulator into fh/mymaster 2018-09-24 20:53:45 +02:00
Flyinghead 84e7ca03ad Don't connect a DC keyboard by default.
Not supported on most platforms.
Alien Front Online doesn't show the on-screen keyboard if a DC keyboard
is connected.
2018-09-24 20:53:21 +02:00
Flyinghead 6ca68feff9 OSX: Fix project file 2018-09-24 19:11:50 +02:00
Flyinghead 2c343fddf2 modem: Transparent IP proxy. Removes the need for a TAP/TUN device 2018-09-24 19:06:14 +02:00
Flyinghead dc5ce8fa8b Create maple devices on Linux. Default to 2 VMUs per controller 2018-09-24 18:56:24 +02:00
Ender's Games b6843d6726 Android: Add style resources for theme support 2018-09-23 12:09:39 -04:00
Christoph 'baka0815' Schwerdtfeger a5e01e4d79 CHD: Enable FLAC on Windows 2018-09-23 17:00:27 +02:00
Christoph "baka0815" Schwerdtfeger 6da63b249a Trying to break-fix Windows using __inline instead of inline 2018-09-23 16:48:36 +02:00
Stefanos Kornilios Mitsis Poiitidis 91ffb109a9 Merge pull request #1401 from reicast/skmp/import-old-docs
Docs: Import old skmp's docs
2018-09-23 16:36:02 +02:00
Christoph "baka0815" Schwerdtfeger 30caadc42f CHD/FLAC: Use local deps for FLAC and enable on Android
Using locally installed FLAC libs, so no more need for libflac-dev.
2018-09-23 16:27:53 +02:00
Flyinghead 411baa6b8e OSX: Save states support. Build fixes. 2018-09-23 16:18:35 +02:00
Christoph "baka0815" Schwerdtfeger 659430e9cc CHD: Fixed the build for Android
CFLAGS were set in the wrong place and the name of the DEF was wrong too -_-°
2018-09-23 15:43:40 +02:00
Christoph 'baka0815' Schwerdtfeger 9bb7d96962 CHD/FLAC: surround flac.c with #ifdef 2018-09-23 15:27:57 +02:00
Stefanos Kornilios Mitsis Poiitidis 5a6c944228 Rename Notable game bugs to Notable game bugs.md 2018-09-23 12:44:17 +02:00
Stefanos Kornilios Mitsis Poiitidis c5cb6fec86 Docs: Import notable game bugs from skmp's blog
Source: https://web.archive.org/web/20110809053548/http://drk.emudev.org/blog/?page_id=4
2018-09-23 12:42:29 +02:00
Stefanos Kornilios Mitsis Poiitidis 12e38001e4 Docs: Import Dynarec Architecture from skmp's blog
Source: https://web.archive.org/web/20110812025705/http://drk.emudev.org:80/blog/?page_id=18
2018-09-23 12:38:52 +02:00
Stefanos Kornilios Mitsis Poiitidis 3800ea17f6 Merge pull request #1393 from reicast/skmp/docs-release-schedule
Docs: Add new release schedule and structure
2018-09-23 12:34:27 +02:00
Flyinghead 98da3a28dc rec-x86: Load PC from sh4 context in ngen_mainloop
Fixes load state freeze and problems when pausing the emu thread
2018-09-23 12:04:07 +02:00
Christoph "baka0815" Schwerdtfeger f78dc64bfa Fix includes 2018-09-22 17:34:14 +02:00
Christoph "baka0815" Schwerdtfeger b1be3af1a1 CHD: Enable FLAC via library (on Linux builds) 2018-09-22 17:27:55 +02:00
Christoph "baka0815" Schwerdtfeger b4155b0c23 CHD: Enable support for LZMA (CDLZ) compression 2018-09-22 16:40:11 +02:00
Christoph "baka0815" Schwerdtfeger 1d7ecda2af CHD: Check for extra frames
If the frame count is not dividable by 4, there are extra frames added to keep a padding.
This is true for F355 (450 frames -> 2 extra frames) and others.

Also move CD_TRACK_PADDING to chd.cpp to work around problems with including from C and C++.
2018-09-22 15:42:26 +02:00
Christoph "baka0815" Schwerdtfeger 14260594ea CHD: read additional track types
Also don't print "Unable to find metadata" as it's mostly not true (we reach this part after the last track)
2018-09-22 15:19:57 +02:00
Christoph "baka0815" Schwerdtfeger 7cb77a4c21 CHD: Wrap FLAC and LZMA with defines
Make CHDv5 generally work without FLAC and LZMA decoding possibilities so there is currently no need for extra deps.
2018-09-22 15:18:10 +02:00
Christoph "baka0815" Schwerdtfeger 2026931f2e CHD: Imported https://github.com/rtissera/libchdr/commit/96a2ce8a5bf59a900e4e786a9f7e42b910f7c6e0 2018-09-22 14:53:56 +02:00
Flyinghead 3c60d4745c G2-EXT2 DMA channel 2018-09-21 18:27:45 +02:00
Flyinghead 6e017fd3ef Tentative fix for Maken X hang 2018-09-21 17:56:29 +02:00
Flyinghead 0c575a51b3 Do not save per-game settings if the game name is unknown (NAOMI).
Add cable/region/broadcast to per-game settings.
2018-09-21 17:47:21 +02:00
David Miller 6ad13268fd Merge pull request #1396 from reicast/z_revision
Desktop arg fixes / Auto versioning for VS
2018-09-21 08:41:29 -04:00
Flyinghead 06a4f9f25d Dynarec.safemode -> safe-mode in custom settings 2018-09-21 10:19:57 +02:00
Flyinghead 62eeca5882 Merge remote-tracking branch 'origin/master' into fh/mymaster 2018-09-21 00:37:34 +02:00
Ender's Games e498e79bba Appveyor: Get artifact for build configuration 2018-09-20 18:02:10 -04:00
Ender's Games 0adc6b2bce Compatibility getch() for VS 2008/2013 2018-09-20 17:49:04 -04:00
Ender's Games 88f97ae431 Specify OS and Toolset, Debug-120 config 2018-09-20 17:49:04 -04:00
David Miller 9c11eae1b9 VS Solution configurations
multi targetting and appveyor build tests
2018-09-20 17:49:03 -04:00
David Miller 1722a9abe4 getchar for non win32, so curses isn't req to be setup 2018-09-20 17:48:27 -04:00
David Miller 2e23ee4628 use enum for cli arg exit and android build ndef 2018-09-20 17:48:27 -04:00
David Miller 3dc16faa73 Android build fix 2018-09-20 17:48:27 -04:00
David Miller b58e866b6b Desktop command args support fixes and auto git versioning for VS and make 2018-09-20 17:48:27 -04:00
Flyinghead 6a5ae18179 Prepend game name to state file 2018-09-20 22:41:10 +02:00
Flyinghead cebc7486f8 Change cycle_counter to an int instead of u32 in the x86 dynarec 2018-09-20 22:23:38 +02:00
Flyinghead 48225e7516 Don't serialize uneeded stuff. Fix windows build. 2018-09-20 22:00:03 +02:00
Flyinghead a742b53369 Fix linux x86 startup crash 2018-09-20 21:59:19 +02:00
Flyinghead f355dda6a4 savestates: build fixes 2018-09-20 20:06:54 +02:00
Flyinghead de147549c3 Save states implementation 2018-09-20 19:48:46 +02:00
Christoph 4000b88771 Merge pull request #1395 from reicast/baka/evdev_crash2
evdev: If there was an error initializing a controller, don't proceed
2018-09-20 18:46:12 +02:00
Christoph "baka0815" Schwerdtfeger 5b8749fbaa evdev: If there was an error initializing a controller, don't proceed
If the controller was not correctly initialized, the fd and/or the mapping might not be set, which could then result in access violations or other errors.
2018-09-20 17:43:24 +02:00
Flyinghead 7ce4fccb37 Merge remote-tracking branch 'origin/master' into fh/mymaster 2018-09-20 17:28:41 +02:00
Flyinghead 37d014f002 Disable div matching for Surf Rocket Racers 2018-09-20 13:42:48 +02:00
Stefanos Kornilios Mitsis Poiitidis c9ff2b334b Docs: Add new release schedule and structure
See #1381 for the initial proposal
2018-09-20 04:11:41 +02:00
Abandoned Cart edaf00df79 Merge pull request #1377 from reicast/ac/android
Android/Shell: File Uri and NDK changes for N+
2018-09-19 13:47:45 -04:00
Ender's Games 793e4f1a78 Secondary storage URI, Unwrap for native code 2018-09-19 13:24:55 -04:00
Ender's Games dba5c767bb Android NDK: APP_STL stlport_static is no longer supported 2018-09-19 12:49:19 -04:00
Ender's Games 4614f57b1e Adding zero is irrelevant, unless it alters the calculation 2018-09-19 10:08:45 -04:00
Flyinghead c5efc3531b ppp: Fix FCS calc, better LCP negotiation, pppdump
Fix an error in FCS calculation of sent packet when header compression
is not being used. Fixes PSO connection issue.
Added support for Async Char Map and Magic number LCP options.
Added pppdump-compatible dump file for easier debugging.
2018-09-19 10:56:10 +02:00
Flyinghead 21b685c812 Spurious character in OS X code path 2018-09-18 19:22:58 +02:00
Flyinghead df61073c39 Clip textures that extend past the end of VRAM.
Only load the valid portion of it.
Fixes Shenmue Space Harrier mini-arcade game.

Disable verify on non-square twiddled textures for Quake 3.
2018-09-18 12:01:16 +02:00
Flyinghead 8a2684ff55 Dreamcast mouse emulation 2018-09-18 09:27:16 +02:00
Flyinghead 2081a0c21b Modem doc fix 2018-09-17 21:32:28 +02:00
Flyinghead 63a8d0cca9 Modem config documentation 2018-09-17 21:28:50 +02:00
Flyinghead b9d0a4f688 msvc fix 2018-09-17 19:43:05 +02:00
Flyinghead 4a42cd6bae msvc fix 2018-09-17 18:45:11 +02:00
Flyinghead eb62b79791 OSX: Build fix 2018-09-17 18:41:44 +02:00
Flyinghead b256141b0d No picotcp for msvc 2018-09-17 18:14:48 +02:00
Flyinghead fc96593e80 Fix android build 2018-09-17 17:52:29 +02:00
Flyinghead 1314a1551d picotcp: add msvc-specific arch include. Win: never stop net stack 2018-09-17 15:29:20 +02:00
Flyinghead 843c912d86 win vs: more compile fix 2018-09-17 14:48:43 +02:00
Flyinghead ae829405b5 picotcp msvc fix: __inline, usleep 2018-09-17 14:31:27 +02:00
Flyinghead bc7fed4919 picotcp: wrong ifdef value 2018-09-17 14:10:53 +02:00
Flyinghead 92a39a1fc4 Static picotcp config for msvc. Fix warnings in modem.cpp. 2018-09-17 14:05:03 +02:00
Flyinghead bfc944a138 win vs: one more time 2018-09-17 13:53:35 +02:00
Flyinghead 385364ec6e win vs: now with correct paths 2018-09-17 13:36:54 +02:00
Flyinghead 59fe373a3a Tentative fix for win VS build. Fix Makefile clean 2018-09-17 13:33:50 +02:00
Flyinghead 663b77cee6 Fix OpenGL compile error with VMWare WS14 driver 2018-09-17 13:02:07 +02:00
Flyinghead bc6a8f451a Fix picotcp on Windows
Automatically configure tap IP address, route and proxy arp using iphlpapi.
Partial port to MINGW.
2018-09-17 12:59:52 +02:00
Flyinghead 6699a8a294 Use picotcp for ppp protocol processing. Now all is needed is a tap or
tun interface.
2018-09-15 21:41:54 +02:00
Flyinghead ce3d8f2baa picotcp initial commit - missing files 2018-09-15 21:34:50 +02:00
Flyinghead aad38f965b picotcp initial commit as of 4caf65005045f0d34592274a5edd20c0d40d83f7 2018-09-15 21:28:13 +02:00
Ender's Games fd12871378 Android: FLAG_GRANT_READ_URI_PERMISSION 2018-09-14 06:38:47 -04:00
Ender's Games b84bd0e39c Android: New requirements for Uri access 2018-09-14 06:30:59 -04:00
Flyinghead 54308a0949 Incorrect modem status bit was causing all received data to be ignored.
All games connect to Dreamcast Live lobby.
Tested Quake III in-game.
2018-09-14 11:18:10 +02:00
Flyinghead 5ae95e951b Add modem files to osx project 2018-09-13 21:15:43 +02:00
Abandoned Cart eacbae5b30 Merge pull request #1376 from reicast/ac/android
Android: Complete conversion to API 26 standards (Cont.)
2018-09-12 23:54:55 -04:00
Ender's Games 2ea2414699 Android: Restore forced exit for unhandled ANR 2018-09-12 22:17:08 -04:00
Ender's Games 88b81a6652 Android: Improve stability of gamepad detection 2018-09-12 22:16:54 -04:00
Ender's Games a1b6711402 Android: Let Android Studio perform simplify 2018-09-12 21:28:00 -04:00
Ender's Games ba134c8c4e Android: Simplify and optimize emu UI classes 2018-09-12 12:07:32 -04:00
Flyinghead 2a8591798f Only clamp color if tsp.ColorClamp is set. Thanks p1pkin 2018-09-12 17:50:42 +02:00
Flyinghead fe4c310306 more build fixing 2018-09-12 15:18:12 +02:00
Stefanos Kornilios Mitsis Poiitidis 93affdd747 Merge pull request #1374 from reicast/ac/android
Android: Complete conversion to API 26 standards
2018-09-12 16:05:13 +03:00
Flyinghead baa60bb097 Fix non linux builds 2018-09-12 14:52:45 +02:00
Flyinghead f04f7fae48 Add modem files to win vs project 2018-09-12 14:24:49 +02:00
Flyinghead e3d99541d6 Modem support and pipe out to ppp.
Allow Ooga Booga and NFL 2K2 to connect to network lobbby at https://www.dreamcastlive.net.
Sadly all other tested games still fail the ppp handshake. Work in progress...
2018-09-12 13:20:20 +02:00
Stefanos Kornilios Mitsis Poiitidis 1a09ccb587 CI/Travis: Fix tagged builds 2018-09-12 13:43:26 +03:00
Flyinghead 0e939b5f68 Keyboard: Better keycode mapping, added CTRL. Maple cleanup. 2018-09-08 14:35:46 +02:00
Ender's Games 5ef7b60134 Android: Simplify and optimize InputModFragment 2018-09-07 12:47:55 -04:00
Ender's Games 2a45346099 Android: Simplify and optimize OptionsFragment 2018-09-07 12:42:49 -04:00
Ender's Games 86e3379a65 Android: Simplify and optimize InputFragment 2018-09-07 12:42:47 -04:00
Ender's Games c8d2517d95 Android: Simplify and optimize FileBrowser 2018-09-07 12:20:57 -04:00
Ender's Games 8f981e648c Android: Remove some unnecessary conditions 2018-09-07 11:51:17 -04:00
Flyinghead 5b9cbb2909 log macro 2018-09-07 12:58:04 +02:00
Flyinghead 562d64bed5 Cleanly stop the web UI thread on exit 2018-09-07 12:57:26 +02:00
Flyinghead 50010418ce Fix size of framebuffer to watch for direct writes 2018-09-07 12:55:42 +02:00
Flyinghead 30f016e6a0 Use vram_mask on framebuffer watch start and end addresses 2018-09-06 22:20:17 +02:00
Flyinghead 54d0bdc5e2 Dreamcast keyboard emulation (X11 only for now) 2018-09-06 20:17:28 +02:00
Flyinghead e54ac36544 Texture cache optimization for frequent palette updates
Some old 2D games change palettes very frequently, which causes the
texture to be updated for each render.
This change uses a hash of the palette to detect changes, and include
the palette type in the cache key to distinguish textures of different
depth.
2018-09-06 12:11:55 +02:00
Flyinghead a167b43361 add game product id 2018-09-05 15:32:25 +02:00
Flyinghead 4a08856775 Render-to-texture upscaling must be accounted for when clipping 2018-09-05 15:07:30 +02:00
Flyinghead c43446f355 Initialize ExtraDepthScale for Android 2018-09-04 23:38:00 +02:00
Christoph 00ecf2f1ce Merge pull request #1370 from reicast/baka/sdl
SDL: Fix keyboard usage
2018-09-04 22:25:03 +02:00
Christoph b402a56885 Merge pull request #1365 from reicast/baka/evdev_rework
Remove evdev specific code from main.cpp
2018-09-04 22:24:43 +02:00
David Miller af8aab1337 Merge pull request #1373 from reicast/baka/x11soft
Add error message for softrend w.o X11
2018-09-04 15:42:19 -04:00
Christoph "baka0815" Schwerdtfeger d3de815a0a Softrend: clean up if/else 2018-09-04 21:01:03 +02:00
Christoph "baka0815" Schwerdtfeger f96e0f1e5d Softrend: Error if no softrenderer backend found 2018-09-04 20:41:25 +02:00
Christoph "baka0815" Schwerdtfeger 981eb1b5ef Softrend: works only with X11
If X11 support is not there, reicast doesn't compile because the softrenderer needs it.
Use #ifdef to do X11 only if SUPPORT_X11 is set.
2018-09-04 19:08:39 +02:00
Flyinghead c1317cbad7 No web UI if no threads 2018-09-04 18:47:12 +02:00
Flyinghead f202b3b143 Add new ExtraDepthScale setting to scale huge Z values.
Use 1e26 for Samurai Shodown 6 (NAOMI)
2018-09-04 18:37:59 +02:00
Christoph 1c880fc37c Merge pull request #1369 from reicast/fh/ta-context-1mb
Round TA context to 1MB at ListInit time so it is found when rendering
2018-09-04 18:23:20 +02:00
Christoph 61748632de Merge pull request #1368 from reicast/fh/32b-vram-mapping
Fix 32-bit vram bank mapping
2018-09-04 18:23:06 +02:00
Christoph "baka0815" Schwerdtfeger 69c4f163b8 SDL: Fix keyboard usage
Use kcode[port] directly (see evdev.cpp), because unsetting the keys didn't unset kcode and pressing the key another time didn't work.
2018-09-03 19:23:22 +02:00
Flyinghead 239e178226 Simplify framebuffer drawing and fix OSD 2018-09-03 15:05:37 +02:00
Flyinghead ea9bc5ff1c Round TA context to 1MB at ListInit time so it can be found at render time
Fixes black screen in NFL 2K2, NBA 2K2, Oooga Booga, Floigan Bros. and probably more Visual Concepts games.
2018-09-03 14:32:00 +02:00
Flyinghead 614ec7e9b1 Fix 32-bit vram bank mapping
Fixes texture corruption and other problems in many games
2018-09-03 12:39:52 +02:00
Flyinghead 395bfd5dbb Fix 32-bit vram bank mapping
Fixes graphical glitches in Naomi games: Melty Blood Act Cadenza, 18
Wheeler, Spawn and probably others
2018-09-03 12:26:16 +02:00
Flyinghead 228b40136f Only do color clamp when fog is on 2018-09-02 22:57:59 +02:00
Sven daae7c8e68 add save states 2018-09-02 09:49:23 -04:00
Flyinghead 96e9bce0e0 (Fog) Color clamping support 2018-09-01 12:56:37 +02:00
Christoph "baka0815" Schwerdtfeger 555e140216 evdev: Remove unnecessary exports in header
``input_evdev_init(EvdevController* controller, const char* device, const char* mapping_fname)`` and ``input_evdev_button_duplicate_button(EvdevControllerMapping* mapping1, EvdevControllerMapping* mapping2)`` are no longer used outside evdev.cpp
Needed to move ``input_evdev_init()`` around a bit.
2018-08-31 16:59:37 +02:00
Christoph "baka0815" Schwerdtfeger 8cbc342b06 Maple specific header no longer necessary 2018-08-31 16:52:08 +02:00
Christoph "baka0815" Schwerdtfeger a9a67fdaa5 Move the evdev specific code out of main.cpp 2018-08-31 16:47:55 +02:00
Flyinghead 1546e4fa8a Revert a change in the previous commit which breaks sprite stripping.
Fixes sparks glitch in Sonic Adventure 2
2018-08-31 10:26:08 +02:00
Abandoned Cart a8711e2cf2 Merge pull request #1362 from reicast/lk/abandoned
Android: Fix OSD editor and standardize launch
2018-08-29 16:12:02 -04:00
Ender's Games ddffa3b8de Android: Fix OSD editor and standardize launch 2018-08-29 15:34:45 -04:00
Abandoned Cart 205affbf2b Merge pull request #1359 from reicast/lk/abandoned
Delete an unused variable left from testing
2018-08-29 00:29:37 -04:00
Ender's Games 36d094949d Circumvent some false Google assumptions
Not all urls are links. Not all links require a web browser.
2018-08-28 23:49:49 -04:00
Ender's Games 3ca9a153e5 Delete an unused variable left from testing 2018-08-28 22:07:31 -04:00
Abandoned Cart b59b09d3b0 Merge pull request #1356 from reicast/lk/disk-swap
Android: Support disk swapping / boot disk
2018-08-28 22:03:29 -04:00
Ender's Games 3eba9ae6ad Android: Improved null checking, Optimize 2018-08-28 15:11:02 -04:00
Ender's Games e19212ee9e Android: Support per-game boot disk 2018-08-28 14:08:36 -04:00
Ender's Games 2ceae8b42e Android: Parameter to swap dynamic disk 2018-08-28 14:08:36 -04:00
Ender's Games f51f04ba9a Android: Close keyboard when editing complete 2018-08-28 14:08:36 -04:00
Ender's Games 72f11223f7 Android: Remove unstable TextWatcher 2018-08-28 14:08:36 -04:00
Ender's Games 62c76475eb Android: Implement trial disk swapping code 2018-08-28 14:08:36 -04:00
Ender's Games 925daa2bfd Android: Begin implementing disk swap options 2018-08-28 14:08:36 -04:00
Abandoned Cart 775f23221d Merge pull request #1357 from reicast/revert-1352-pold500/fix-openfile-dialog
Revert "Fix to windows OpenFile dialog #1238"
2018-08-28 13:54:42 -04:00
Abandoned Cart 4ed65fca3d Revert "Fix to windows OpenFile dialog #1238" 2018-08-28 13:38:11 -04:00
Abandoned Cart a1996f0fe9 Merge pull request #1352 from reicast/pold500/fix-openfile-dialog
Fix to windows OpenFile dialog #1238
2018-08-28 08:12:42 -04:00
Abandoned Cart 95c06b942b Fix formatting to force restart wercker 2018-08-28 07:50:30 -04:00
Abandoned Cart 7e8f558c19 Merge pull request #1354 from reicast/lk/abandoned
Android: 99 problems and a BIOS ain't one.
2018-08-28 01:47:11 -04:00
Ender's Games de64716ad9 Android: 99 problems and a BIOS ain't one.
It's always something, Isn't it? If there is one possible broken way to do something...
2018-08-28 01:34:09 -04:00
Abandoned Cart 81056d37d2 Merge pull request #1353 from reicast/lk/abandoned
Android: Fix loading game list on browse
2018-08-28 00:33:52 -04:00
Ender's Games aab523286b Android: Fix loading game list on browse 2018-08-28 00:15:25 -04:00
Abandoned Cart 8c93ba0022 Merge pull request #1351 from reicast/lk/abandoned
Android: Google Play is directory-aware
2018-08-27 23:26:36 -04:00
Pavel Dmytriiev (Github) 88c104580c Revert C++11 changes 2018-08-27 23:22:07 -04:00
Pavel Dmytriiev (Github) 3677e23e1d Fixed magic digits sense codes with some meaningful values 2018-08-27 23:22:07 -04:00
Pavel Dmytriiev (Github) a4e6dbadb5 Fix to windows OpenFile dialog
Now it actually says something about what exactly it tries to open, also on "cancel" it exits gracefully.

Proposal: instead of checking one thousand return codes, which are easily ignored, I suggest using an exceptions (this part of emulator doesn't require execution speed, so exceptions here would be just fine).
2018-08-27 23:20:39 -04:00
Ender's Games f5ca188972 Android: Google Play is directory-aware
Despite the numerous malware policies and extreme objection to decompiling release applications, Google Play does precisely this and will reject applications based on folder structure.
2018-08-27 22:54:50 -04:00
Abandoned Cart 7bd871490c Merge pull request #1341 from reicast/baka/cdi_warning
CDI: Only warn if CDI image was really loaded
2018-08-27 22:52:38 -04:00
Abandoned Cart f9b7274a9f Merge pull request #1350 from reicast/lk/abandoned
Google Play: "The app crashed, so we violated some policies"
2018-08-27 22:28:40 -04:00
Ender's Games 068a798fc8 Android: Disable links on Android TV
Because Google claims the Android TV does not have a browser and fears that users may feel insecure about their inability to release a compatible version of Chrome.
2018-08-27 22:03:44 -04:00
Ender's Games aceda2e0b8 Android: Stop supressing a hard crash
This allows Google Play and friends to retrieve it properly
2018-08-27 21:39:04 -04:00
Ender's Games 8715ed6e2e Android: Update available SDKs, API 26 2018-08-27 21:38:56 -04:00
Ender's Games 352a319086 Android: Remove an otherwise unused parameter 2018-08-27 21:38:49 -04:00
Abandoned Cart dfcb3334e8 Merge pull request #1349 from reicast/lk/abandoned
Android: Explicitly set debuggable configuration
2018-08-27 19:06:41 -04:00
Ender's Games 6578b1b7c4 Android: Explicitly set debuggable flag 2018-08-27 11:43:25 -04:00
Abandoned Cart 52788ea9fa Merge pull request #1346 from reicast/lk/abandoned
Android: Update XMLParser for API 26 standards
2018-08-27 11:15:32 -04:00
Ender's Games 124273e48e Android: Null check views, remove redundant 2018-08-27 10:48:33 -04:00
Ender's Games 227d27f34a Android: Update XMLParser for API 26 standards 2018-08-27 10:41:17 -04:00
Abandoned Cart 6289c72a37 Merge pull request #1344 from reicast/baka/emptyvmu
Maple: Corrected creation of empty VMU
2018-08-27 09:11:24 -04:00
Christoph "baka0815" Schwerdtfeger bc873cb228 Maple: Corrected creation of empty VMU
The VMU which was written to disk was never initialized and therefore consisted only of zeroes.
After saving for the first time the VMU was corrupted.

Changes:
* Not only initialize the VMU in memory but also write the correct contents to disk
* If an existing VMU consists only of zeroes overwrite it with the initial empty VMU
2018-08-27 13:50:59 +02:00
Abandoned Cart 2703c6574e Merge pull request #1342 from reicast/lk/abandoned
Android: Avoiding faulty references to "things"
2018-08-27 06:37:29 -04:00
Ender's Games 25919cce78 PGC: Settings that should be per-game exclusive 2018-08-27 06:10:35 -04:00
Ender's Games cbe7238986 PGC: Avoid an issue with extended IDs
Pro Pinball Trilogy is 9 characters, including spaces, which should not be truncated for accuracy.
2018-08-27 05:42:35 -04:00
Ender's Games ecffc4f5b8 Android: Drop implied state prefixes to labels 2018-08-27 05:19:16 -04:00
Ender's Games 0564603933 Android: Don't attempt to store PGC for BIOS
There is no real need for a full configuration file for launching the BIOS individually.
2018-08-27 04:52:19 -04:00
Ender's Games 1408129f0e Android: Use getDataDir for API 24+ (N) 2018-08-27 04:45:15 -04:00
Christoph "baka0815" Schwerdtfeger 81faa0935c CDI: Only warn if CDI image was really loaded
If no image was loaded (or using ioctl) the CDI warning was always printed.
2018-08-27 10:40:08 +02:00
Christoph 14e1e4ded4 Merge pull request #1339 from reicast/baka/evdev_symlink
evdev: Search for libevdev.so.2 first
2018-08-27 10:25:40 +02:00
Christoph 6b7a299a55 Merge pull request #1340 from reicast/baka/memcards1335
evdev: Fix off by one error
2018-08-27 10:25:13 +02:00
Christoph "baka0815" Schwerdtfeger 0f228690ad evdev: Fix off by one error
The port for player1 is 0, not 1 (we're zero based here).
2018-08-27 10:01:08 +02:00
Christoph "baka0815" Schwerdtfeger 1d66d1e2da evdev: Search for libevdev.so.2 first
Many Linux distributions provide livevdev.so.2 only so check that first.
2018-08-27 09:53:54 +02:00
Abandoned Cart fb4b5de863 Merge pull request #1338 from reicast/lk/abandoned
Core: Fix formatting of configuration options
2018-08-27 01:01:14 -04:00
Ender's Games 5bdc362da3 Remove QueueRender option (non-functional)
Reverts:
2c517896b2
e81f43ff20
9ed9f460e9
2018-08-27 00:42:21 -04:00
Ender's Games bd6b0c003d Core: Fix formatting of configuration options
Fix formatting using web editor to ensure accuracy
2018-08-27 00:12:16 -04:00
Abandoned Cart e138241bce Merge pull request #1337 from reicast/lk/abandoned
Android: Optimization, Cleanup, and Release Prep
2018-08-26 23:27:04 -04:00
Ender's Games 14fc7d910a Convert Interrupt Hack to name w/ less stigma 2018-08-26 23:13:25 -04:00
Ender's Games 7e9d1697c2 Android: fullscreen and reios BIOS support 2018-08-26 22:46:54 -04:00
Abandoned Cart 38f9c58804 Merge pull request #1334 from reicast/lk/abandoned
Extend per-game configuration options
2018-08-26 14:31:29 -04:00
Ender's Games dd88d7a8e9 Android: Add options to import / export PGC 2018-08-26 14:08:15 -04:00
Ender's Games 75ae974f68 Android: Align game name with other settings 2018-08-26 12:02:54 -04:00
Ender's Games 41cf6e957e Android: Add option to clear per-game config 2018-08-26 11:22:10 -04:00
Ender's Games ff81632578 Android: Support per-game joystick as Dpad
This resolves and issue with Psychic Force 2012 where the joystick is not supported, but should not force toggling this setting for a single game.

Currently only supports player 1

Android: Realign new options with existing
2018-08-26 11:05:54 -04:00
Flyinghead e59d7eaf3d Direct framebuffer writes support 2018-08-26 16:58:10 +02:00
Ender's Games 96d06cb4a2 Android: Improve game detail view, Fix leaks 2018-08-26 10:35:50 -04:00
Flyinghead bb3753dc86 Use already defined constant TA_CURRENT_CTX 2018-08-26 16:31:41 +02:00
Ender's Games 2c66bf3b3a Core / Android: Add dynarec to per-game config 2018-08-26 07:56:36 -04:00
Ender's Games 31fb575165 Core: Support retrieving disk info before full init 2018-08-26 07:56:28 -04:00
Abandoned Cart 757d1f7559 Merge pull request #1333 from reicast/lk/abandoned
Android: Restore processor count, Cleanup
2018-08-26 00:17:10 -04:00
Ender's Games 95fa701ac0 Android: Restore processor count, Cleanup 2018-08-25 17:16:56 -04:00
Stefanos Kornilios Mitsis Poiitidis 213f34e993 Merge pull request #1331 from reicast/lk/abandoned
README: Add a link for iOS build information
2018-08-25 21:58:32 +03:00
Abandoned Cart e19ec5a531 README: Add a link for iOS build information 2018-08-25 14:50:20 -04:00
Stefanos Kornilios Mitsis Poiitidis ba8b9014a2 Merge pull request #1326 from reicast/EvdevControllerMapping_string2
evdev: Mapping name as string
2018-08-25 21:25:32 +03:00
Stefanos Kornilios Mitsis Poiitidis d4f12fae64 Merge pull request #1327 from gameblabla/voidlinuxmusl
WIP: Fixes for Musl
2018-08-25 21:25:02 +03:00
Stefanos Kornilios Mitsis Poiitidis 11f76f5fbe Merge pull request #1321 from gameblabla/libaosound
Add support for libao
2018-08-25 21:24:29 +03:00
gameblabla a40d8bc74b add libao support 2018-08-25 21:24:30 +02:00
Abandoned Cart 05b700b227 Merge pull request #1329 from reicast/lk/abandoned
Mac: Reference "official" preprocessor directives
2018-08-25 14:13:47 -04:00
Ender's Games 14b1e66ed4 Mac: Reference / implement preprocessor directives 2018-08-25 13:03:29 -04:00
Abandoned Cart 5702ade82f Merge pull request #1328 from reicast/lk/vs-2015
vs: Upgrade vcxproj to visual studio 2015
2018-08-25 10:51:34 -04:00
Ender's Games cb5c0327eb vs: Upgrade vcxproj to visual studio 2015
See https://github.com/reicast/reicast-emulator/commit/3579c9aabf673c241253ce184f394a5ec293d848
2018-08-25 10:26:44 -04:00
Abandoned Cart 0a92ad3be2 Merge pull request #1325 from reicast/lk/abandoned
Android: Separate key events to avoid overrides
2018-08-25 08:25:51 -04:00
Christoph "baka0815" Schwerdtfeger 8593c209d9 Fixed type of formatting argument 2018-08-25 10:55:52 +02:00
Christoph 6fa2716cb9 Merge pull request #1320 from gameblabla/evdevfixes
Fixes compiling if evdev is disabled
2018-08-25 10:47:51 +02:00
Christoph "baka0815" Schwerdtfeger 80af04421a evdev: Mapping name as string
That way we don't need to reserve memory and the output (on the command line) is correct.
2018-08-25 10:17:10 +02:00
Ender's Games e3a57223af Android: Separate key events to avoid overrides 2018-08-25 02:28:14 -04:00
Abandoned Cart c926f264c3 Merge pull request #1324 from reicast/lk/abandoned
Android: Reimplement TheGamesDB w/ legacy API
2018-08-25 02:19:03 -04:00
Ender's Games 1c85799876 Android: Reimplement TheGamesDB w/ legacy API 2018-08-25 01:54:08 -04:00
gameblabla 55645a6fb7 Fixes for Musl 2018-08-24 23:34:03 +02:00
gameblabla 5f964de1fe Fixes compiling if evdev is disabled 2018-08-24 23:13:41 +02:00
Abandoned Cart 40624ad77d Merge pull request #1319 from reicast/lk/abandoned
Android: Input modification enhancements (analog)
2018-08-24 12:51:12 -04:00
Ender's Games eb9d455338 Android: Optimization and layout improvements
Android: Add missing spacing to input mod layout

Android: Account for awkward select button icon
2018-08-24 10:18:52 -04:00
Ender's Games dae71628a5 Android: Support no right stick function, Fix L / R 2018-08-24 09:42:03 -04:00
Ender's Games e4f934c581 Android: Add OUYA support to joystick config 2018-08-23 23:08:12 -04:00
Ender's Games 15615693c5 Android: Support configuring x and y axis sources 2018-08-23 19:51:07 -04:00
Ender's Games 0a0c5643a3 Travis: Only build required module components 2018-08-23 13:42:03 -04:00
Ender's Games 1bd546c708 Android: Clean input mod, Begin joystick settings 2018-08-23 09:33:29 -04:00
Abandoned Cart 31852cde96 Merge pull request #1318 from reicast/lk/abandoned
Android: Optimize per-game config workflow
2018-08-23 08:28:53 -04:00
Ender's Games 3e7dea537a Android: Optimize per-game config workflow 2018-08-23 07:36:33 -04:00
Abandoned Cart df2d4fadee Merge pull request #1317 from reicast/lk/fix-ports
Android: Pass microphone setup through controller
2018-08-22 22:47:32 -04:00
Abandoned Cart d98f674ac5 Merge pull request #1315 from reicast/lk/abandoned
Porting libretro features back to mainstream reicast
2018-08-22 22:44:16 -04:00
Ender's Games 31738f462a Android: Pass microphone setup through controller 2018-08-22 22:34:40 -04:00
Ender's Games 69bf54ac15 Android: Retrieve disk info ASAP, not after boot 2018-08-22 21:14:59 -04:00
Ender's Games 9ed9f460e9 Invert QueueRender to allow better explanation
Have the setting porform the action rather than having a value that, when disabled, did what the name implies it enables.
2018-08-22 21:14:49 -04:00
Ender's Games d8226c7b5d Fix: "Functions should be declared at file scope" 2018-08-22 21:14:42 -04:00
Ender's Games e81f43ff20 Android: UI configuration for QueueRender setting 2018-08-22 21:14:34 -04:00
Ender's Games eebf3fc57c Android: UI configuration for InterruptHack setting 2018-08-22 21:14:27 -04:00
Ender's Games 2c517896b2 PVR: Add a QueueRender flag to force usage
Originally implemented with libretro-reicast commit:
38186045d9aebc8ff2b6118de70f4c2596914914
Modified for use w/ reicast per-game configuration
2018-08-22 21:14:19 -04:00
Ender's Games f76df2da62 GDROM: Increase dma buffer cache sectors
https://github.com/inolen/redream/commit/4e956d9ef80109bc5f55987431756be673c2a1b6
2018-08-22 21:14:11 -04:00
Ender's Games e5c0f0ee71 https://code.google.com/p/nulldc/source/detail?r=108
Originally ported from nullDC to libretro in commits:
2fa562db1b46c52b663b3dd4bb33a64907357458
f8eb58ac16a9e5adf662b99be5d00729264808e0
Modified for use w/ reicast per-game configuration
2018-08-22 21:14:02 -04:00
Abandoned Cart 97c5b9e490 Merge pull request #1282 from reicast/baka/evdev_warnnotconfigured
evdev: Print a warning if a key is not configured
2018-08-22 18:14:18 -04:00
Abandoned Cart fda672d66b Merge pull request #1316 from reicast/lk/semen
Android: Configure peripherals independently
2018-08-22 18:02:55 -04:00
Ender's Games fa3c3cd94d Android: Force first mic to always be port A-2 2018-08-22 17:25:49 -04:00
Ender's Games c922d5b6a6 Android: Configure peripherals independently 2018-08-22 16:31:48 -04:00
Ender's Games b1afd40d34 Travis: Increase number of processors for build
The build is absurdly slow for what is actually processed
2018-08-22 12:29:58 -04:00
Abandoned Cart 91dda19c49 Merge pull request #1314 from reicast/lk/abandoned
Android: General updates and improvements
2018-08-22 08:04:18 -04:00
Ender's Games 1a352d4933 Travis: Set depth to a reasonable changeset max 2018-08-22 07:24:25 -04:00
Ender's Games b56d0f09c9 Android: Discard TheGamesDB, Fix disk images 2018-08-22 06:51:58 -04:00
Ender's Games 5b66f1de42 Android: More accurate labels for app-side options
Some of the labels may be giving the impression that they perform magical tasks on the native side, but only help to configure the GLView.
2018-08-21 23:15:44 -04:00
Abandoned Cart d7b5533210 Merge pull request #1304 from gameblabla/glesfix
Fixes compiling with GLES and X11
2018-08-21 14:02:06 -04:00
Abandoned Cart 6447127390 Merge pull request #1312 from reicast/lk/android-vmu
Android: Add support for dynamic peripherals
2018-08-21 13:33:03 -04:00
Ender's Games fc8e36ff9f Android: Simplify the way peripheral views are set 2018-08-21 13:13:09 -04:00
Ender's Games 16f6b2beb4 Android: Fix formatting corruption in the JNI 2018-08-21 12:34:09 -04:00
Abandoned Cart 2d0cee0020 Merge pull request #1285 from reicast/lk/not-shit-travis
Travis: increase depth over fetching full repo
2018-08-21 12:23:49 -04:00
Ender's Games 1619d85663 Android: Add dynamic per-player peripheral support
Android: Add a UI shell for implementing peripherals

Android: Replace hardcoded mic assignment with dynamic

Android: Convert mic option to general recording option

Android: Hardcoded VMUs for controller 1

Android: Fix preferences and config for microphone

Android: Add defaults, documentation, and wiring
2018-08-21 12:18:44 -04:00
Abandoned Cart 3905d6e9fb Merge pull request #1310 from reicast/lk/lgtm
Core: Address some obvious lgtm issues
2018-08-21 10:08:32 -04:00
Ender's Games eb11d19687 Include header guards to prevent multiple inclusions 2018-08-21 09:28:54 -04:00
Ender's Games 75215ec0d1 Core: Address some obvious lgtm issues 2018-08-21 02:52:03 -04:00
Abandoned Cart b5dc68dbac Merge pull request #1308 from reicast/pr-1288
Allow configuration of maple devices #1288
2018-08-21 00:45:29 -04:00
Christoph "baka0815" Schwerdtfeger ad20b55d2c Fix lgtm-warning 2018-08-21 00:33:18 -04:00
Christoph "baka0815" Schwerdtfeger c8baaac632 evdev/MapleType: Controller in port 1 defaults to VMU for Maple device, all other to None
Also allow 0 for "None"
2018-08-21 00:33:18 -04:00
Christoph "baka0815" Schwerdtfeger a07c3dc9f2 Fix OSX (?) 2018-08-21 00:33:18 -04:00
Christoph "baka0815" Schwerdtfeger 816fb493a6 Fix iOS 2018-08-21 00:33:18 -04:00
Christoph "baka0815" Schwerdtfeger 11b01633d0 Fix Windows 2018-08-21 00:33:18 -04:00
Christoph "baka0815" Schwerdtfeger bb72c1ce4c Fix Android 2018-08-21 00:33:18 -04:00
Christoph "baka0815" Schwerdtfeger 638a97d1ae Maple: Reworked the way controllers are created
A new function was introduced to abstract the setup of input devices for each os: os_SetupInput().
I hope I implemented this everywhere correctly and the behaviour is identical to before.

The new function mcfg_CreateNAOMIJamma() creates the NAOMI Jamma interface and is hidden behind a compile flag (same as before).
The previous function mcfg_CreateDevices() was renamed to mcfg_CreateDevicesFromConfig() because it creates the devices based on the configuration (``nb`` setting).
2018-08-21 00:33:18 -04:00
Christoph "baka0815" Schwerdtfeger 8212be4850 MapleDeviceType: Add MDT_None 2018-08-21 00:32:05 -04:00
Christoph "baka0815" Schwerdtfeger 7ef105822a evdev: Move creation of controllers
Don't expose mcfg_Create() directly, but use a proxy method mcfg_CreateController() to create the complete controller.
Using evdev the ``nb``-setting in the ``emu.cfg`` is no longer necessary (see #970) as the devices get created while initializing the controllers.

Moved the ``switch`` to it's own function.
2018-08-21 00:32:05 -04:00
Christoph "baka0815" Schwerdtfeger f75ba32fa9 evdev/maple: Set devices via config 2018-08-21 00:32:05 -04:00
Christoph "baka0815" Schwerdtfeger 17d9159b82 evdev: Add maple devices 1 and 2 to mapping & cfg 2018-08-21 00:32:05 -04:00
Abandoned Cart 62837f4db0 Merge pull request #1235 from reicast/fh/alpha-pt-rounding-fix
Float math in alpha calculation causes some punch-through textures to…
2018-08-21 00:09:06 -04:00
Abandoned Cart c5a9577265 Merge pull request #1303 from reicast/msgbox
Re-applying patches with Android workaround
2018-08-21 00:06:51 -04:00
Abandoned Cart 83c069ec3d Merge pull request #1306 from reicast/lk/menu_layout
Android: Remove redundancy, Eliminate hash file
2018-08-20 23:54:31 -04:00
Ender's Games 8f82e926b8 Android: Improve msgbox, printf cdi workaround
This partially reverts commit 405909bf91304db275dde4d163befa8fc654874f.
2018-08-20 23:50:47 -04:00
David Miller 1a4f597bd8 ngen_mainloop for x86 updated to use PC value from context, CDI warning
and removed redundant header causing build failure on libwebsockets (VS)
2018-08-20 23:49:15 -04:00
Ender's Games e755446c5f Android: Remove redundancy, Eliminate hash file 2018-08-20 23:29:27 -04:00
Abandoned Cart 7ff9d0ec02 Merge pull request #1298 from reicast/lk/game-config
Support per-game configuration files
2018-08-20 22:28:08 -04:00
Ender's Games ef6242d2f7 Android: Create a per-game configuration view
Android: Pass game configuration options to emu

TODO: Fix inability to reload fragment w/ new settings

Android: Limit preference scope, Avoid static crutch

Android: Obligatory button to commit PGC settings

Android pressures the use of async preferences, but does not properly block threads. This causes the settings from one view to bleed into the next when swapping back and forth. This can be overcome by explicitely writing to the specific pref object.

Android: Add PGC documentation to window
2018-08-20 22:02:59 -04:00
Ender's Games 4e050bb753 Android: Initial structure for per-game settings
Android: write internal configuration for new games
2018-08-20 22:02:54 -04:00
Ender's Games 9e57068192 Config: Only load modified game settings, don't save
There is no reason to build a configuration file of duplicate settings. The user can acquire the defaults from the config section and only inject the changes into the game section.
2018-08-20 14:29:13 -04:00
Ender's Games 2311253aa5 Config: log a software name to the configuration file
This value is printed to the config file alongside individual settings and cannot be modified. It will be replaced each time the configuration is read, preventing any risk of user error.
2018-08-20 13:23:50 -04:00
Ender's Games 78977387ac Reios: perform initial configuration, as needed 2018-08-20 12:28:58 -04:00
Flyinghead ba78184461 Fix per-polygon sort option 2018-08-20 15:51:55 +02:00
gameblabla 8a53efec62 Fixes compiling with GLES and X11 2018-08-20 13:17:01 +02:00
Ender's Games 4424d84960 Port libretro reios params with less intrusive query 2018-08-19 05:41:00 -04:00
Ender's Games f2b9b2fcf7 Unimplemented method for per-game configuration
This is a general outline of how per-game configuration would be read to replace the existing "default" values without restricting the settings to defined values. Each game could support it's own proprietary configuration that could be changed and updated, as needed. This separates per-game config from the emulator version.
2018-08-19 05:41:00 -04:00
Abandoned Cart 223cd74824 Merge pull request #1299 from reicast/lk/aswide
Reconfigure GLView to match emu dimensions
2018-08-19 05:39:38 -04:00
Christoph b3ba22d4a4 Merge pull request #1286 from reicast/baka/man
man: add information about the named evdev config files
2018-08-19 11:31:39 +02:00
Christoph "baka0815" Schwerdtfeger b0069ae134 man: add information about the named evdev config files 2018-08-19 11:15:20 +02:00
Ender's Games e64367a0ad Android: A very simple method to set 4:3 resolution 2018-08-19 02:03:10 -04:00
Ender's Games 8d9d40dffc Core: Changes provided by Android NDK compiler 2018-08-19 01:54:15 -04:00
Ender's Games bde9f2768b gitignore: Ignore local gradle configuration files 2018-08-19 01:54:06 -04:00
Ender's Games cd22816c1b Android: prevent auxilliary from overriding hardware 2018-08-19 01:53:58 -04:00
Ender's Games a2a3a11412 Android: Stop hiding git behind "luxury" handle 2018-08-19 01:53:50 -04:00
Abandoned Cart a41293567a Merge pull request #1296 from reicast/lk/safe-dynarec
Port the dynarec safe flag from nullDC (See #84)
2018-08-18 08:01:32 -04:00
Ender's Games c604ae167f Android: handle position -1 as generic motion 2018-08-18 07:40:36 -04:00
Ender's Games 17788f68b9 Android: push every joystick event, simplify return 2018-08-18 06:39:05 -04:00
Ender's Games 7dfc5b20c6 Android: strip exceptions handled by Google 2018-08-17 23:40:51 -04:00
Flyinghead 6ffe4c0280 Sprites face culling is reversed.
Fixes South Park Rally and Wacky Races invisible menus.
2018-08-17 19:13:59 +02:00
Flyinghead ffb25a470d Fix Wacky Races missing half screen 2018-08-17 18:33:24 +02:00
Flyinghead 2fb9927688 Less console spamming 2018-08-17 18:30:54 +02:00
Ender's Games 2733b46bd7 Android: Verify device type before processing 2018-08-17 02:26:47 -04:00
Ender's Games ee00aeb4f0 Android: Only assign OUYA values to an OUYA 2018-08-17 01:14:35 -04:00
Ender's Games def787b829 Android: Look at all the conditionals you'll save 2018-08-17 00:27:22 -04:00
Ender's Games 632a5eb065 Android: Strip out broken Moga implementation 2018-08-17 00:18:59 -04:00
Ender's Games b1f81bd54f Android: Do not process history index as player 2018-08-16 23:40:24 -04:00
Ender's Games e66b10ce30 Android: Remove forced compatibility mode 2018-08-16 22:46:43 -04:00
Ender's Games a01016d4ad Android: Only prompt for bios if NOT using reios 2018-08-16 22:09:31 -04:00
Ender's Games a3f585ea1c Port the dynarec safe flag from nullDC (See #84) 2018-08-16 20:00:10 -04:00
Abandoned Cart 1bcffb54b6 Merge pull request #1295 from reicast/lk/triggered
Android: process entire joystick event history
2018-08-16 17:49:17 -04:00
Ender's Games c612393cf3 Android: process entire joystick event history 2018-08-15 23:56:06 -04:00
Flyinghead a7cfa1f737 Disable Div matching for Record of Lodoss War 2018-08-14 09:17:22 +02:00
Abandoned Cart b2e07d0c96 Merge pull request #1289 from reicast/baka/evdev_checkdup2
evdev/dupcheck: Don't check unassigned buttons
2018-08-13 18:59:52 -04:00
Flyinghead 11738c9b1f DSP: interpreter optimization 2018-08-14 00:59:34 +02:00
Abandoned Cart d65bbf8cef Merge pull request #1290 from reicast/baka/DisableJoystickAPI
Linux/Makefile: Disable legacy joystick support
2018-08-13 18:08:17 -04:00
Abandoned Cart 9379fe18bd Merge pull request #1291 from reicast/fh/rec-cpp-blockchecks
Block checks for rec-cpp
2018-08-13 18:07:16 -04:00
Flyinghead c430a7906c Block checks for rec-cpp 2018-08-13 21:37:59 +02:00
Flyinghead 90b1595101 Input mapping hack for naomi: put mapping in lst file 2018-08-13 20:32:07 +02:00
Flyinghead f3bbb06d8c GL: Missing float precision qualifier in Bump Map calc 2018-08-13 18:21:52 +02:00
Flyinghead e10b46dbca Aica: missing dsp_term() for x86 dynarec 2018-08-13 18:05:56 +02:00
Flyinghead 04b84b90e3 Merge master into fh/mymaster 2018-08-13 18:01:24 +02:00
Flyinghead 32a56136ef Compile x86 arec when enabled 2018-08-13 16:38:38 +02:00
Flyinghead 94c995510e aica: Terminate the dsp at shutdown 2018-08-13 16:34:29 +02:00
Christoph "baka0815" Schwerdtfeger 7a178735d1 Linux/Makefile: Disable legacy joystick support
Fixes #773.
2018-08-13 13:46:29 +02:00
Christoph "baka0815" Schwerdtfeger 7029af98a3 evdev/dupcheck: Don't check unassigned buttons
Also removes the trailing whitespaces.
2018-08-13 13:10:59 +02:00
Christoph 989c0fa776 Merge pull request #1283 from reicast/baka/X11_keyboardsiable
X11: Values <= 0 disable keyboard
2018-08-12 17:54:11 +02:00
Ender's Games 660713a934 Travis: increase depth over fetching full repo 2018-08-12 09:21:49 -04:00
Christoph "baka0815" Schwerdtfeger 21ea713032 X11: Values >= 1 enable keyboard 2018-08-12 15:17:56 +02:00
Christoph "baka0815" Schwerdtfeger 369ecf2db2 evdev: Print a warning if a key is not configured 2018-08-12 09:50:14 +02:00
Abandoned Cart d6ae37ed2a Merge pull request #1281 from reicast/lk/bootdisk
Android: Disable the boot disk option until valid
2018-08-11 23:57:28 -04:00
Ender's Games cd7edc5e52 Android: Also disable the boot disk on v14 2018-08-11 23:30:36 -04:00
Ender's Games 4fc7c55d4d Android: Disable the boot disk option until valid
This option saves a path for an unimplemented feature. Rather than continue to field questions about how to use it because it is not connected to anything, it is better to disable it for now.
2018-08-11 21:53:08 -04:00
Stefanos Kornilios Mitsis Poiitidis 5cd64625fb Merge pull request #1277 from reicast/baka/evdev_checkdup
evdev: Check for duplicate key assignment
2018-08-11 16:16:59 +03:00
Abandoned Cart 3da8b2e9b9 Merge pull request #1280 from reicast/lk/pullrequest
Android: Add right stick switch to controller update
2018-08-11 07:53:35 -04:00
Ender's Games 391c847b27 Android: Add right stick switch to controller update
Android: Right stick defaults to true when used
2018-08-11 07:30:53 -04:00
Christoph "baka0815" Schwerdtfeger 891666d9ce evdev: Check for duplicate key assignment 2018-08-11 09:56:13 +02:00
Abandoned Cart 610cec177c Merge pull request #1273 from reicast/baka/evdev_multiple
evdev: Allow two controls with the same event
2018-08-10 21:26:36 -04:00
Abandoned Cart ca277b9568 Merge pull request #1275 from reicast/lk/pullrequest
Travis: Move build commands to script
2018-08-10 17:18:39 -04:00
Ender's Games 3f39090f7d Travis: update script permission and verify 2018-08-10 13:28:11 -04:00
Ender's Games cc035a3c22 Travis: Move build commands to proprietary script
Prevents an implied attempt to sign builds without a signing key when submitting to a PR.
2018-08-10 11:59:30 -04:00
Christoph "baka0815" Schwerdtfeger e2d186f7be evdev: Testing shows: You *can* assign the same device to multiple ports. 2018-08-10 10:16:29 +02:00
Abandoned Cart 90c0d42103 Merge pull request #1271 from reicast/lk/pullrequest
Android: Fix the misleading "default disk" setting
2018-08-09 15:24:55 -04:00
Ender's Games ba0f93b5e3 Android: Fix the misleading "default disk" setting
It is a boot disk, which would be the "default" disk. Labeling it default is misleading, though. It will also prevent confusion to have examples of common boot disks.
2018-08-09 14:19:47 -04:00
Abandoned Cart ce4d4d1963 Merge pull request #1269 from reicast/lk/android-studio
Android: Add a function to remove all settings
2018-08-08 18:27:16 -04:00
Ender's Games 0c2619e5c8 Android: Crashing isn't close, Fix modvol settings 2018-08-08 18:03:49 -04:00
Ender's Games 4c8b8f2df2 Android: Close via clearing the fragment
Once again, background support requires special consideration. Closing the application does not remove it from the background stack (thus not clearing view)
2018-08-08 17:00:17 -04:00
Ender's Games 79e4e261c4 Android: Close application after settings reset 2018-08-08 16:12:08 -04:00
Ender's Games dcb959d544 Android: Add a UI button to reset w/ warning 2018-08-08 13:45:43 -04:00
Ender's Games df1aee121f Android: Add a function to remove all settings
This will remove all emulator settings, but will retain the folder configuration (BIOS / games) and any controller or OSD settings beyond the button theme.
2018-08-08 13:16:06 -04:00
Out of Office ce7ebdc730 Merge pull request #1268 from reicast/lk/android-studio
Android: restore hard exiting thread (w/ notes)
2018-08-08 12:19:16 -04:00
Ender's Games 2b77320460 Android: restore hard exiting thread (w/ notes)
This is not yet avoidable, but can at least be explained.
2018-08-08 11:54:54 -04:00
Out of Office 14bf4b5b1c Merge pull request #1267 from reicast/lk/android-studio
Cleanup and improvements to Android Studio
2018-08-08 11:49:59 -04:00
Ender's Games 553ce3d352 Android: align calls with lifecycle, add core pause
This fixes the JNI naming structure to match the Android lifecycle stages and adds the ability to save things like the time when the app goes into the background without actually halting the emulator.
2018-08-08 11:22:47 -04:00
Ender's Games 8e932abf64 Android: Let's not hard exit the emulator anymore 2018-08-08 10:45:19 -04:00
Ender's Games 1a892a5a6b Android: remove comment blocks that only moved 2018-08-08 10:14:36 -04:00
Ender's Games 319588868f Enable compatibility by default in Nougat + (native) 2018-08-08 10:14:36 -04:00
Ender's Games 4b1c4ae446 Android: remove unused EGL14 config option
This will require an entire proprietary view, as the packaged helper classes are strictly EGL10.
2018-08-08 09:53:10 -04:00
Ender's Games a9ea64f36a Android: Forcing run via service is unnecessary
and should be avoided, if it is not required. This would be forcing the app to override the expected lifecycle. If the desired results can be achieved within the regular lifecycle, then it is better not to waste resources.
2018-08-08 09:38:19 -04:00
Out of Office bcf18208f1 Merge pull request #1265 from reicast/lk/bitrise
iOS: Bitrise CI integration and README tag
2018-08-08 01:04:32 -04:00
Ender's Games c13ae67dff iOS: Bitrise CI integration and README tag 2018-08-08 00:27:15 -04:00
Out of Office 7bd43ceafb Merge pull request #1133 from reicast/lk/libpng
Update libpng to 1.6.34
2018-08-07 23:57:34 -04:00
Ender's Games f40826614a libpng: address a non-compliant define 2018-08-07 23:36:20 -04:00
Ender's Games 38edff3dae libpng: expose NEON w/out enabling 2018-08-07 23:18:05 -04:00
TwistedUmbrella 1f688173b8 libpng: restore original configuration 2018-08-07 23:02:56 -04:00
TwistedUmbrella ce71108efa libpng: update zlib references 2018-08-07 23:02:56 -04:00
TwistedUmbrella ae8c41077f libpng 1.6.34 [September 29, 2017] 2018-08-07 23:02:56 -04:00
TwistedUmbrella 66c3cb8a33 libpng 1.6.32 [August 24, 2017]
Courtesy of @mrfixit3000 ( https://github.com/reicast/reicast-emulator/issues/1121#issuecomment-383257219 )
2018-08-07 23:02:56 -04:00
Out of Office 85d271a7b1 Merge pull request #1213 from reicast/lk/template
Issues: Fix formatting and remove default image
2018-08-07 22:49:15 -04:00
TwistedUmbrella 90d4a9af1b Issues: Fix formatting and remove default image 2018-08-07 12:36:01 -04:00
Abandoned Cart f43c03f178 Merge pull request #1263 from reicast/lk/travisty
Restore the "last known good build configuration" w/ cleanup
2018-08-07 12:30:16 -04:00
Ender's Games 7bcef34e17 Update .gitignore and remove cached files 2018-08-07 12:04:46 -04:00
Stefanos Kornilios Mitsis Poiitidis aa46d36dd2 Android: Add debug icons 2018-08-07 11:51:47 -04:00
Ender's Games 00dbcfcd30 Update .gitignore and remove cached files 2018-08-07 11:49:19 -04:00
Ender's Games 13d3aed93a Revert "Merge pull request #1251 from reicast/skmp/dev-names"
Revert "Yet more gradle fixes"

This reverts commit 7160aaecee.

Revert "More fixes"

This reverts commit ba568b4dec.

Revert "Android: Better use of gradle for suffixes"

This reverts commit f35c93e1ac.

Revert "Undo hotfix"

This reverts commit a243ac0ee0.

Revert "HOTFIX: Fix travis gradle config?"

This reverts commit f2e8ba63e3.

Revert "Merge pull request #1251 from reicast/skmp/dev-names"

This reverts commit 2f681248df, reversing
changes made to e352fb9e9d.
2018-08-07 11:41:54 -04:00
Ender's Games acbfc2c5fd Android: disable EGL14 option, begin restructure 2018-08-07 11:37:35 -04:00
Stefanos Kornilios Mitsis Poiitidis b121fd1ba2 Revert "ngen_mainloop for x86 updated to use PC value from context, CDI warning"
This reverts commit 38539a9c2f.
Reason: Breakage reported by beta testers

See #1260
2018-08-07 14:30:42 +02:00
Flyinghead 958447f12d Android: Specify RGBX_8888 pixel format 2018-08-07 11:55:32 +02:00
Flyinghead 6190c5e341 Android: Simplify GL config chooser 2018-08-07 11:19:21 +02:00
Flyinghead 65a759b3fe Merge branch 'fh/mymaster' of https://github.com/reicast/reicast-emulator into fh/mymaster 2018-08-07 09:45:10 +02:00
Flyinghead c0c06ed8ff Renderer: select shader at runtime based on the GL context version
The GL renderer now detects the version of the current GL context and
compiles the shaders accordingly. Supports GLES2, GLES3 and desktop GL.
Android: use 8,8,8 framebuffer instead of 5,6,5. Requests a 8-bit
stencil buffer (modifier volumes)
2018-08-07 09:44:52 +02:00
Ender's Games ce447e220c Android: Proper home detection during initial startup 2018-08-06 22:01:41 -04:00
David Miller 38539a9c2f ngen_mainloop for x86 updated to use PC value from context, CDI warning
and removed redundant header causing build failure on libwebsockets (VS)
2018-08-06 15:01:15 -04:00
Abandoned Cart 94c7e79c26 Merge pull request #1257 from reicast/lk/android-studio
Cleanup and forward-thinking integration
2018-08-05 10:23:31 -04:00
Ender's Games 1de9930cf4 Android: limit forced depth test to experimental 2018-08-05 09:36:19 -04:00
Ender's Games 1c1ebc2bfb Android: Create a Christmas theme via auto-indent 2018-08-05 09:32:00 -04:00
Flyinghead 5cc4531f79 OSX: fix app icon, name, menu 2018-08-05 07:59:30 +02:00
Ender's Games ff073d491f Android: Enable depth testing (disabled by default) 2018-08-05 01:19:26 -04:00
Ender's Games 8384a1f574 Android: Add proprietary Nvidia EGL parameters
https://www.khronos.org/registry/EGL/extensions/NV/EGL_NV_depth_nonlinear.txt
2018-08-05 01:11:59 -04:00
Flyinghead cbb52eee75 OSX: fix data/system directory initialization. Add the Resources bundle directory as system data path. 2018-08-04 19:12:36 +02:00
Flyinghead 7ff93f9256 OSX: disable OpenMP as it's not available. Time to deprecate Apple... 2018-08-04 19:10:53 +02:00
Flyinghead 8157a5dbc5 OSX: specify the NSOpenGLPFABackingStore option to force pixel buffer copy on flush.
Without this option, back and front buffers may be exchanged instead of copied which can cause ghost frames now that the framebuffer is not cleared before rendering (MSR)
2018-08-04 19:07:39 +02:00
Stefanos Kornilios Mitsis Poiitidis 3d5945677a Merge pull request #1256 from reicast/lk/android-studio
Android: add setting for modifier volumes to shell
2018-08-04 17:23:53 +02:00
Ender's Games 2f38468671 Android: add setting for modifier volumes to shell 2018-08-04 09:41:00 -04:00
Abandoned Cart 51a0c5727f Merge pull request #1254 from reicast/lk/android-studio
Android: Windows build compatibility (Rev. 2)
2018-08-03 11:23:17 -04:00
Ender's Games 0c78e49cfc Android: Windows build compatibility (Rev. 2) 2018-08-03 11:01:39 -04:00
Flyinghead 2cc55dfce4 rec-cpp: optimize small block checks 2018-08-03 15:49:20 +02:00
Abandoned Cart 8d4f8597ef Merge pull request #1252 from reicast/lk/android-studio
Android: Fix buttons being transparent
2018-08-03 08:56:05 -04:00
Flyinghead 2489a72588 rec-cpp block checks naive implementation 2018-08-03 14:45:25 +02:00
Ender's Games f0f1190ddc Android: retry writing buttons if file is empty 2018-08-03 08:29:36 -04:00
Ender's Games a5fffb9e6c Android: dump async to avoid lost write process 2018-08-03 08:23:18 -04:00
Ender's Games e38513a17e Android: TODO: gain access to stop conservatively 2018-08-03 08:23:17 -04:00
Ender's Games 869cc5649a Android: always touch the file (appropriately) 2018-08-03 08:23:17 -04:00
Ender's Games 21b1b21aa5 Android: Android: reimplement stop as an actual "stop" 2018-08-03 08:23:16 -04:00
Flyinghead fddf56c5a2 Fix TA overrun detection. Bump up verts to 2 MB, idx to 120K and TR
polys to 8K
2018-08-03 09:55:53 +02:00
Stefanos Kornilios Mitsis Poiitidis 7160aaecee Yet more gradle fixes 2018-08-03 05:38:23 +02:00
Stefanos Kornilios Mitsis Poiitidis ba568b4dec More fixes 2018-08-03 05:26:13 +02:00
Stefanos Kornilios Mitsis Poiitidis f35c93e1ac Android: Better use of gradle for suffixes 2018-08-03 05:05:02 +02:00
Stefanos Kornilios Mitsis Poiitidis a243ac0ee0 Undo hotfix 2018-08-03 05:05:00 +02:00
Stefanos Kornilios Mitsis Poiitidis f2e8ba63e3 HOTFIX: Fix travis gradle config? 2018-08-03 04:50:17 +02:00
Stefanos Kornilios Mitsis Poiitidis 2f681248df Merge pull request #1251 from reicast/skmp/dev-names
Android: Use unique name,package* bw icons for CI/DBG builds
2018-08-03 04:09:44 +02:00
Stefanos Kornilios Mitsis Poiitidis 5728fbeeb1 Android: Add debug icons 2018-08-03 04:01:10 +02:00
Stefanos Kornilios Mitsis Poiitidis cd32a04563 Android: DEV -> CI builds 2018-08-03 03:25:02 +02:00
Stefanos Kornilios Mitsis Poiitidis c4f41c8e07 AppId: Use .dbg for local, .dev-* for CI 2018-08-03 03:22:07 +02:00
Stefanos Kornilios Mitsis Poiitidis 72e9de3333 Android: Use unique name & package for debug builds 2018-08-03 01:41:20 +02:00
Stefanos Kornilios Mitsis Poiitidis e352fb9e9d Merge pull request #1250 from reicast/skmp/git-tags
Android: Use tags in `git describe`
2018-08-03 00:43:19 +02:00
Stefanos Kornilios Mitsis Poiitidis b628be0936 Android: Use tags in git describe 2018-08-03 00:25:02 +02:00
Flyinghead 580408dc4c Android: build with -fopenmp option 2018-08-02 19:05:21 +02:00
Abandoned Cart 405fffedaa Merge pull request #1237 from reicast/lk/android-studio
Android: Background service (Part 1)
2018-08-02 12:49:52 -04:00
Flyinghead feaca43b25 Build fixes 2018-08-02 18:44:51 +02:00
Abandoned Cart feb8d7a321 Android: Disable service until pause is supported 2018-08-02 12:25:02 -04:00
Flyinghead 1e661a4d45 AICA DMA: raise end of transfer interrupt immediately for small
transfers.

Fixes Bangai-O startup freeze
2018-08-02 18:25:02 +02:00
Abandoned Cart 9beb87ef64 Merge pull request #1236 from reicast/clean-exit-light
Exit cleanly in desktop platforms
2018-08-02 12:20:03 -04:00
Stefanos Kornilios Mitsis Poiitidis 5fa1f342d1 Merge pull request #1247 from reicast/fh/aeg-update
Update AEG params when FNS or OCT registers are updated
2018-08-02 18:07:39 +02:00
Flyinghead 85781e96ec Use OpenMP instead of ctpl for multithreading 2018-08-02 17:31:38 +02:00
Flyinghead 3a7a08f3fb Do not clear the framebuffer before rendering. Fix scissoring coords.
The framebuffer is cleared by the background plane using global clipping
coordinates. This allows multiple rendering to different locations on
the framebuffer.
Fixes flashing menus in Vanishing Point, loading screens in Test Drive
Le Mans and Vigilante 8.
Better rear view mirror in Metropolis Street Racer.
2018-08-02 17:20:18 +02:00
Flyinghead 97faaaa5b0 Android: Use GNU STL for thread support 2018-08-01 21:23:15 +02:00
Flyinghead ec2ac75839 Merge master 2018-08-01 20:23:16 +02:00
Flyinghead 22c05832b8 Android: use C++11 2018-08-01 20:19:59 +02:00
Flyinghead 3c38e824cd OSX, IOS: Add xbrz to project 2018-08-01 20:13:26 +02:00
Flyinghead 49b7a82535 Add xbrz.cpp to windows project 2018-08-01 20:05:11 +02:00
Flyinghead 73ef45bffd MSVC build fix 2018-08-01 19:55:29 +02:00
Flyinghead 31d8c1f091 Backport texture upscaling with xBRZ 2018-08-01 19:43:01 +02:00
Flyinghead 46c0d545ec OSX: Fix previous merge 2018-08-01 18:31:20 +02:00
Flyinghead 9942bfc86e Merge branch clean-exit-light 2018-08-01 18:02:50 +02:00
Flyinghead a11dd3f159 Get rid of EGHack 2018-08-01 17:20:41 +02:00
Flyinghead 1e67f9be0b Schedule Aica DMA interrupt instead of raising it immediately.
Fixes Street Fighters Alpha 3 freeze.
2018-08-01 16:55:50 +02:00
Flyinghead 1ac497ba30 Update AEG params when FNS or OCT registers are updated
Fixes Bomberman Online FMV intro freeze, Jet Grind Radio and Psyvariar 2 intro music fade out and probably more.
2018-08-01 16:30:43 +02:00
Flyinghead c632fc6619 OSX: Avoid hanging the UI thread when waiting for rendering. Use cursor keys for keyboard.
IOS: Add dip interpreter to build.
2018-08-01 16:16:27 +02:00
Flyinghead 298bf08fc0 Add dsp interpreter to Mac build. Core audio buffering. 2018-08-01 15:02:45 +02:00
Stefanos Kornilios Mitsis Poiitidis 25ec591e2e Merge pull request #1243 from reicast/skmp/doa2le-ta-workaround
TA: Alloc 8mb for fifo storage, workaround for doa2le
2018-07-31 01:10:04 +02:00
Stefanos Kornilios Mitsis Poiitidis 7da4f09c01 TA: Alloc 8mb for fifo storage, workaround for doa2le 2018-07-31 00:56:26 +02:00
Flyinghead 1533091151 Clipping: do pixel scaling only when not rendering to a texture 2018-07-30 18:57:32 +02:00
Flyinghead b468ad2717 More win64 fix 2018-07-29 22:07:44 +02:00
Flyinghead 02bbdb3ebe Fix build on win x64 2018-07-29 21:57:57 +02:00
Flyinghead 8c3247d1b2 Generic interpreted DSP 2018-07-29 21:47:30 +02:00
Flyinghead 63a70e0f62 isinf not available in GLES 2 2018-07-29 19:24:14 +02:00
Flyinghead 92c06a7249 Update AEG params when FNS or OCT are updated.
Fixes Bomberman Online FMV intro freeze, Jet Grind Radio and Psyvariar 2 intro music fade out.
2018-07-29 18:23:53 +02:00
Flyinghead 0e881254ef Fix clipping when pixel_double is on.
Fixes 4 Wheel Thunder split screen issue.
2018-07-29 17:31:14 +02:00
Ender's Games 7c3e7fb161 Android: overcome Windows build limitations
LOCAL_SHORT_COMMANDS applies to a single module and will resolve error 87, while APP_SHORT_COMMANDS := true can be added to the Application.mk in its place to apply to all modules. Both have a performance cost, so it is recommended to limit the scope sparingly.
2018-07-28 21:30:39 -04:00
Ender's Games 6e86fcdf6e Android: relabel additional instances of stop 2018-07-25 10:14:33 -04:00
Ender's Games 5e377e039a Android: rename stop, since it actually terminates 2018-07-25 08:25:33 -04:00
Ender's Games 92d410791e Android: do not attempt useless rendering 2018-07-24 23:09:52 -04:00
Ender's Games e104fdc9e7 Android: improve log commands and verify tags 2018-07-24 23:09:52 -04:00
Ender's Games 7bc764be9b Android: move stop to destroy to avoid early term 2018-07-24 23:09:52 -04:00
Ender's Games ac73de0dea Travis: update for renamed internal package 2018-07-24 23:09:51 -04:00
Ender's Games 77b8b8fd8a Android: simple start and stop for service via JNIActivity 2018-07-24 23:09:51 -04:00
Ender's Games 5e9ed25c01 Android: establish a service with foreground notification 2018-07-24 23:09:32 -04:00
Flyinghead 5960450e76 Linux x86 fix. Wait for renderer thread to end. 2018-07-24 17:24:56 +02:00
Flyinghead b1686a8f6a Do not allow inf z value in the vertex shader. Clamp w to a very small value.
Fixes ground triangles clipping in Soulcalibur intro sequence.
2018-07-24 16:55:48 +02:00
Flyinghead 20de593a88 Clean exit on OS X. Minor changes. 2018-07-24 14:27:58 +02:00
Flyinghead b28e1505c5 Fix dynarec on OSX/x64. Clean exit when window closed. 2018-07-24 13:26:31 +02:00
Flyinghead 07a36ee256 avoid named struct initializers 2018-07-24 11:22:56 +02:00
Flyinghead 2e08d7a6c9 round() not available in GLES2. Using floor() instead 2018-07-23 20:55:53 +02:00
Flyinghead 45d4abb64d "for" should be a "while" 2018-07-23 20:44:35 +02:00
Flyinghead 8dab514b2a yet another tentative asm fix 2018-07-23 20:38:31 +02:00
Flyinghead 3d2de4a0dc tentative fix for rec x86/win 2018-07-23 20:26:12 +02:00
Flyinghead 960904c401 Exit cleanly in desktop platforms
Lighter and cleaner version of the previous PR
2018-07-23 19:52:50 +02:00
Flyinghead 86235bb4a3 Float math in alpha calculation causes some punch-through textures to have alpha noise. 2018-07-23 15:15:05 +02:00
Stefanos Kornilios Mitsis Poiitidis 055c3599b6 Merge pull request #1234 from reicast/fh/log2-depth-scaling (GL3/log2)
GL3: Use log2 depth scaling in fragment shader
2018-07-23 15:01:45 +02:00
Flyinghead 4b5e863aa7 Use log2 depth scaling in fragment shader when available.
Currently a compile time option (!GLES). Fixes many depth issues (Dynamite Cop, Cannon Spike, etc.)
2018-07-23 10:25:55 +02:00
Flyinghead ba49228fc0 Unterminated string constant 2018-07-22 23:13:32 +02:00
Stefanos Kornilios Mitsis Poiitidis 95ce251639 Merge pull request #1079 from myfreeweb/master
Build on FreeBSD
2018-07-22 00:37:34 +02:00
Ender's Games f451c5e26f Android: friendly internal project name, gradle update 2018-07-20 15:05:43 -04:00
Flyinghead 71d7f90858 Merge upstream 2018-07-19 12:19:51 +02:00
Flyinghead 09eab8cb03 Saturate alpha channel for YUV textures 2018-07-18 22:35:55 +02:00
Flyinghead 7d6c72211a Automatic #include dependency management 2018-07-18 21:52:35 +02:00
Stefanos Kornilios Mitsis Poiitidis a5cf5406cb Merge pull request #1181 from baka0815/X11
X11: Refactored and fixed buttons
2018-07-18 20:59:02 +02:00
Flyinghead ff08d93019 npos undefined. Use -1 instead 2018-07-18 19:32:51 +02:00
Christoph "baka0815" Schwerdtfeger 2a167e343b X11: use x11_keymap[] for the shoulder trigger
Use DC_AXIS_LT and DC_AXIS_RT for the sliders. They are not real axes on a keyboard, but it fits.
Also hide the printf() behind a define.
2018-07-18 19:31:35 +02:00
Flyinghead e637dcf8f9 reinstate line deleted by previous commit 2018-07-18 16:07:17 +02:00
Flyinghead cc8569fcf8 Fix 8888 high-quality textures on GLES/arm
GLES doesn't support uint 8888 so bytes must be swapped on little endian
architecture.
2018-07-18 16:01:40 +02:00
Stefanos Kornilios Mitsis Poiitidis a4cf716f99 Merge pull request #1222 from t0pu/master
Fix controller support for Linux when building with GCC8
2018-07-18 13:29:35 +02:00
Stefanos Kornilios Mitsis Poiitidis 4359459538 Merge pull request #1196 from baka0815/joyconf
reicast-joyconf: cosmetic changes
2018-07-18 13:20:41 +02:00
Stefanos Kornilios Mitsis Poiitidis 2619351d39 Merge pull request #1212 from reicast/lk/readme
README: Bug reporting and Discord link
2018-07-18 13:19:07 +02:00
Stefanos Kornilios Mitsis Poiitidis 8875657f6a Merge pull request #1221 from brand175/master
TouchScreen Triggers added and MFI Controller Update (Stuff)
2018-07-18 13:18:16 +02:00
Flyinghead 4fced53e25 Dangling pointer in evdev code (electric fence) 2018-07-18 11:19:53 +02:00
Flyinghead 673841d1df Dump frame when F10 pressed 2018-07-16 17:31:52 +02:00
Flyinghead a17a0bae3b Utility to display a single frame 2018-07-16 17:19:45 +02:00
Flyinghead dc835dd64d Dump shaders source if compile fails 2018-07-16 16:52:11 +02:00
Flyinghead 0284d635d2 Upscale rendered-to textures
Increase the size of RTT textures by a given integer factor. Defaults to
1.
This gives much better quality textures, particularly visible when used
fullscreen for transition or pause screens.
2018-07-16 16:28:48 +02:00
topu 90304f0c67 Fix controller support when building with GCC8 2018-07-15 13:59:37 +02:00
Stefanos Kornilios Mitsis Poiitidis 1ada311513 Continuous delivery to play store beta from travis
Merge pull request #1210 from reicast/skmp/reicast-beta-cd

Should build and deploy from master only

*crosses fingers*
2018-07-14 19:42:31 +02:00
Stefanos Kornilios Mitsis Poiitidis 0554b56b0c Travis: try to use right build #, take 2 2018-07-14 19:29:16 +02:00
Stefanos Kornilios Mitsis Poiitidis 7e8bb6cec3 Travis: try to use right build #, deploy only on master 2018-07-14 19:11:03 +02:00
Stefanos Kornilios Mitsis Poiitidis b943fc106a Nudge travis the right way? 2018-07-14 18:25:59 +02:00
Stefanos Kornilios Mitsis Poiitidis 5127a989d1 Encrypted files, take 3 2018-07-14 17:50:26 +02:00
Stefanos Kornilios Mitsis Poiitidis 4981e92d55 Update debug.keystore, hope it works 2018-07-14 17:41:01 +02:00
Stefanos Kornilios Mitsis Poiitidis ee4d71f8eb Use git for verison code & text 2018-07-14 17:40:17 +02:00
Flyinghead bb2d860902 Use red channel for fog table in GL but continue using alpha channel in
GLES. Alpha channel is supported only in GL compat mode, not core.
2018-07-14 10:48:16 +02:00
Flyinghead 2d3fd59e04 Revert f13b366e8d: the fixNaN function is
completely bogus and the correct one doesn't have any effect.
2018-07-14 09:13:56 +02:00
brand175 fa20222af5 MFI Controller fixes (Stuff) 2018-07-13 21:11:48 -07:00
brand175 eb34ac8581 Touchscreen Triggers added 2018-07-13 20:51:54 -07:00
Flyinghead 4fd233aca0 Disable div32 matching for Star Wars I - Racer. Fixes the invisible
suns.
2018-07-13 23:24:47 +02:00
Flyinghead f13b366e8d Set the value for NaN according to the SH4 specs
The SH4 sets the signaling bit to 0 for qNaN: 7fbfffff instead of the
usual 7fffffff. Same games seem to rely on this.
Fixes Fur Fighters freeze and missing geometry in game.
2018-07-13 18:57:51 +02:00
Flyinghead ea35eeb728 Fix FTRC op in both interpreter and dynarec with respect to Inf and NaN
The -ffast-math gcc option implies the -ffinite-math-only option, which
produces wrong results with Inf and NaN. Use integer math to detect the
sign of float numbers in FTRC to avoid these issues.
Also the upper cut off value for conversion was apparently wrong.
Also fixed the x86 dynarec but not tested.
Fixes wrong car color in Tokyo Xtreme Racer car selection screen.
2018-07-13 12:02:32 +02:00
Flyinghead df35e95e57 Eldorado Gate Vol.1 needs EGHack 2018-07-12 19:48:39 +02:00
Flyinghead 8a9313270f Demolition Racer needs DisableDivMatching 2018-07-12 19:41:02 +02:00
Flyinghead e18eaf666d Support for 2448-byte sectors
Pier Solar and the Great Architects CDI uses an unknown type 4 sector of
2448 bytes. This hack allows the CDI to be read. Not sure about the
correctness.
2018-07-12 11:10:11 +02:00
Stefanos Kornilios Mitsis Poiitidis f205e99f9b Merge pull request #1218 from barbudreadmon/patch-3
(Naomi) Fix for "The Rumble Fish 2"
2018-07-12 01:10:16 +02:00
Flyinghead 87f8c5194f Better fix for texture cache key needing StrideSel
StrideSel and ScanOrder are no longer part of the texture cache key
since that breaks RTT texture matching. But they are updated at lookup
time so they will be used if the tex is updated later.
Fixes RTT-based xfade screens in Skies of Arcadia.
2018-07-11 22:08:10 +02:00
Flyinghead d5d711cf32 Clipping scissor fix: x offset must only be added once 2018-07-11 20:06:43 +02:00
barbudreadmon 8e7b6b72e1 (Naomi) Fix for "The Rumble Fish 2"
As confirmed by MettalliC, the correct value is 32KB
2018-07-11 18:14:12 +02:00
Flyinghead 527628d366 weird character again 2018-07-10 18:08:27 +02:00
Flyinghead 648988e622 don't log div32 matching and some GDRom ops 2018-07-10 14:36:28 +02:00
Flyinghead 92e16d436e PVR DMA: VRAM->System RAM transfer was handled the other way around 2018-07-10 12:07:35 +02:00
Flyinghead 1be4203ffe Far plane is at depth 0 in classic renderer. 2018-07-09 23:25:18 +02:00
Flyinghead c035635341 Clipping scissor Y coordinates must be inverted when rendering to screen
Fixes top of screen missing in San Francisco Rush 2049
2018-07-09 23:22:13 +02:00
Flyinghead 889f722e73 Fix PAL4 textures 2018-07-09 19:20:33 +02:00
TwistedUmbrella 6014202f0e README: Bug reporting and Discord link 2018-07-09 11:04:36 -04:00
Flyinghead 6df46b1d83 Enable Naomi eeprom reading and writing 2018-07-09 16:24:37 +02:00
Flyinghead 18b2d8273f Improve paletted and YUV texture quality.
Paletted textures using a 32-bit palette and YUV textures are now
converted to 8888 format, which results in a lossless conversion.
Fixes background texture quality in Alone in the Dark.
2018-07-09 14:59:53 +02:00
Stefanos Kornilios Mitsis Poiitidis 02901d689b Fix keys 2018-07-09 10:16:53 +02:00
Stefanos Kornilios Mitsis Poiitidis 5525d5dde2 core: Android studio fixes
- Clang edge cases for shifts
- Avoid generating relocs by not using global symbols in ngen_arm.S (fixes #1109)
2018-07-09 09:31:45 +02:00
Stefanos Kornilios Mitsis Poiitidis 70afc60d75 travis: Add release building and auto beta release 2018-07-09 00:19:40 +02:00
Greg V 967de4501f Install pkgconf on wercker 2018-07-08 15:48:05 +03:00
Greg V 5d69e19ed1 Build on FreeBSD (and potentially other BSD) 2018-07-08 15:43:10 +03:00
Stefanos Kornilios Mitsis Poiitidis 14939067bf snap: Hopefully fix launch command line 2018-07-08 11:22:55 +02:00
Stefanos Kornilios Mitsis Poiitidis 03170fc0ef Merge pull request #1163 from reicast/lk/android-studio
Android Studio Conversion
2018-07-08 11:12:16 +02:00
Stefanos Kornilios Mitsis Poiitidis edaec54f9c Merge pull request #1205 from reicast/issue-form-fix
Update issue submission form disclaimers
2018-07-08 11:08:20 +02:00
Flyinghead efa145f50e Avoid the use of SSE instructions (R)SQRTSS for sqrtf and 1/sqrtf.
When using the -ffast-math option, GCC uses SSE instructions SQRTSS for
sqrtf and RSQRTSS for 1/sqrtf. This results in a loss of precision
according to the GCC documentation: "the precision of the sequence can
be decreased by up to 2 ulp (i.e. the inverse of 1.0 equals
0.99999994)".
This loss of precision affects some games.
Fixes the broken AI in Soldiers of Fortune.
2018-07-08 10:16:27 +02:00
TwistedUmbrella 1ae90e2d1b Unify disclaimers, clarify that ignore means skip 2018-07-08 03:12:09 -04:00
TwistedUmbrella a3a93b6d54 Update issue submission form disclaimers
Differentiate what is required versus optional info.
Document possibility of closing issue when blank.
2018-07-08 03:08:32 -04:00
Stefanos Kornilios Mitsis Poiitidis ae2b5e33b5 core.mk: Revert -O0 -g to -O3 2018-07-08 02:22:32 +02:00
Stefanos Kornilios Mitsis Poiitidis af5adc808f Merge pull request #1204 from reicast/skmp/fix-snap
Update snapcraft.yml for alsa and pulse audio
2018-07-08 02:06:05 +02:00
Stefanos Kornilios Mitsis Poiitidis 5bba5036b6 Merge pull request #1203 from reicast/skmp/default-lincpp
linux/make: Default to lincpp if platform detection fails
2018-07-08 02:05:05 +02:00
Stefanos Kornilios Mitsis Poiitidis 5b8fc02f45 linux/make: Default to lincpp if platform detection fails 2018-07-08 02:03:12 +02:00
Stefanos Kornilios Mitsis Poiitidis 3e618810a4 Update snapcraft.yml 2018-07-08 02:00:27 +02:00
Flyinghead a89ff1e432 Ignore depth func for autosort TR polys.
This was a remain of the previous Always depth hack.
2018-07-07 08:46:29 +02:00
Flyinghead 3cac9134ce Don't use the window title for debug info as it delays frames 2018-07-06 22:38:48 +02:00
Flyinghead e067534f26 When sorting translucent triangle, keep the third vertex in place.
In flat shading mode, the third vertex of a triangle defines its color
so we must maintain its index.
Fixes the remaining color polygons seen in Evolution - The World of
Sacred Device.
2018-07-06 20:02:43 +02:00
Flyinghead 0df91770d2 Increase dynarec code cache size to 10 MB
Fixes frequent code cache invalidation due to lack of space, which kills
performance (Extreme Sports)
2018-07-06 17:19:37 +02:00
Flyinghead 315205caa9 Add setting to disable div32 matching (Pro Pinball Trilogy)
div32 matching doesn't handle division by zero and edge cases, which
causes crashes with some games.
Setting enabled by default for Pro Pinball Trilogy.
2018-07-06 09:49:39 +02:00
Flyinghead 517c225c39 Better hack for TA data sent before ListInit.
Instead of ignoring TA data if ListInit hasn't been called, call
ListInit then accept the data. The data will still be probably ignored
but end of list interrupts are sent so game won't hang.
Fixes hang in King of Fighters New Wave (Naomi).
2018-07-05 19:57:30 +02:00
Flyinghead a1997637bb Trilinear filtering limited implementation.
Fixes lighter field areas in NFL 2K2
2018-07-03 20:36:13 +02:00
Christoph "baka0815" Schwerdtfeger 1a729a1586 Linux/joyconfig: Display the preferred filename for the configuration 2018-07-03 18:57:54 +02:00
Christoph "baka0815" Schwerdtfeger f063856f8b Linux/joyconfig: Add information for Debian based distros 2018-07-03 18:56:43 +02:00
Flyinghead 3c4913a35a Merge remote-tracking branch 'upstream/master' 2018-07-03 15:46:25 +02:00
Flyinghead cbaaaaf970 Do not crash if data is sent to TA before calling ListInit, just ignore
it.

Fixes Conflict Zone - Modern War Strategy.
2018-07-03 15:24:48 +02:00
TwistedUmbrella 64656a6eb3 rec_x64: Avoid recipe for target failed error 2018-07-03 09:09:30 -04:00
TwistedUmbrella 295570a9f3 Android: resolve posix_memalign NDK inconsistency 2018-07-03 08:45:39 -04:00
Flyinghead e7d1688ae5 Round TA_ISP_BASE to 1 MB.
Some games do not align TA_ISP_BASE on 1 MB boundary so the rendering
context is not found at render time. Fixes black screen in NFL 2K2, NBA
2K2, Oooga Booga, Floigan Bros. and probably more Visual Concepts games.
Sadly Ooga Booga still crashes.
2018-07-03 14:22:44 +02:00
TwistedUmbrella 2d7dac38b6 Android: OptionsFragment scope / null checks 2018-07-03 08:06:11 -04:00
TwistedUmbrella 7616ea07a7 Update dependencies to match current target API 2018-07-03 08:06:03 -04:00
Flyinghead 69263eddc0 Bump mapping support 2018-07-02 15:23:47 +02:00
Flyinghead 99af84d7fb Background plane should be fogged as well. Fixes purple sky in Dragon's
Blood/Draconus.
2018-07-02 10:22:26 +02:00
Flyinghead 295395c680 Flat shading support 2018-07-01 20:25:06 +02:00
Stefanos Kornilios Mitsis Poiitidis 73f3378f5f Merge pull request #1194 from reicast/skmp/add-x64-checkblocks
Implement CheckBlocks for x64
2018-07-01 13:27:05 +02:00
Stefanos Kornilios Mitsis Poiitidis f45f888d0b Use platform specific first argument register 2018-07-01 12:15:59 +02:00
Flyinghead 18c59c1166 Fix read_frame/dump_frame for now missing autosort param 2018-06-30 13:51:03 +02:00
Flyinghead 3ddcc272bf Fix autosort/presort mode selection. Per render pass sort mode.
The previous algorithm to determine the sort mode for TR polys was
faulty. And the sort mode can vary between passes for multipass
rendering. This also removes the need for the hack to support Always
depth mode with autosorted TR polys. Should fix the Resident Evil 3 menu
problem.
2018-06-30 12:33:11 +02:00
Flyinghead 7ecd384612 StrideSel is now part of the texture cache and must be set by RTT 2018-06-29 19:03:43 +02:00
Flyinghead d980f505ad Fully revert https://github.com/reicast/reicast-emulator/commit/f571d6c594fc9efd11d439c3a38afd401031e9d0
Fixes NAOMI bios flickering
2018-06-29 17:16:39 +02:00
Flyinghead a52654e2de Added some game ids to per-game settings 2018-06-29 17:10:35 +02:00
Flyinghead 17a34c079c Backported EG hack. Courtesy of libretro.
See https://github.com/libretro/reicast-emulator/commit/13dacb0021e5d0b8e914d1531217040ecbafb14e
2018-06-29 17:04:07 +02:00
Stefanos Kornilios Mitsis Poiitidis ad05c35a7e Implement CheckBlock for x64 2018-06-29 15:19:49 +02:00
Stefanos Kornilios Mitsis Poiitidis c52165adbd Update XBYAK to 71b75f653f3858403eb33d48f6346eef34b837fe 2018-06-29 15:18:57 +02:00
Flyinghead f18aa63a67 Add stride and scan order to texture cache key as they are used to update the texture
Fixes glitchy FMV title screen in Bomberman Online
2018-06-29 11:59:48 +02:00
Flyinghead a94f01ee78 Force autosort TR triangles using depth func Always to be drawn on top of others
When autosorting triangles, ignore the depth of triangles using the depth func Always and force
them to be on top. Seems to help Psyvariar 2.
2018-06-28 13:21:40 +02:00
Flyinghead 6871061ca0 Modifier Volumes: summing up with triangles is faster than using a quad. 2018-06-26 15:38:55 +02:00
Flyinghead 7c93727b5e Improve modifier volume parsing and drawing logic.
Parse modifier volumes similarily to other polys (first, count, params).
Draw all triangles in one shot and use quad to sum up instead of
redrawing entire strip. Use OR operation for open volumes/quads
(Soulcalibur).
2018-06-26 14:45:58 +02:00
TwistedUmbrella e30f868c57 Android: refactor broken v6 config for EGL14
This is still far from functional, but can better serve as a test for implementing EGL14 over attempting to be a broken attempt to force newer APIs
2018-06-25 12:04:26 -04:00
TwistedUmbrella bf62cb8bd1 Prevent overriding Android setting w/ config.ini 2018-06-25 12:04:26 -04:00
TwistedUmbrella 7f96b0218c Android: Support interchangeable BIOS files
The previous code supported replacing the BIOS with a regional counterpart, but destructively replaced the existing image with the new one. This should allow swapping to a new region without removing that region as a future option, so it can be switched between multiple regions with multiple files. It will still fall back to the previous method simply to prevent the removal of a useable BIOS.
2018-06-25 12:04:25 -04:00
TwistedUmbrella c39e1e7d2b Android: Use minSdkVersion for APP_PLATFORM
This value should reflect the minimum supported SDK level of the library when it differs from the minSdkVersion of the base application, as per https://developer.android.com/ndk/guides/application_mk
2018-06-25 12:04:25 -04:00
TwistedUmbrella 291d02933c Android: Add missing module declaration 2018-06-25 12:04:25 -04:00
TwistedUmbrella 9bb71fe23d Travis: repositories.cfg could not be loaded 2018-06-25 12:04:25 -04:00
TwistedUmbrella f9775dad1b Android: Add missing imports from class merge 2018-06-25 12:04:25 -04:00
TwistedUmbrella de4ea7fabc Android: prepare for debug server expiration
This server is being closed down, as it was piggybacked on the server for another project that has moved to static pages.
2018-06-25 12:04:25 -04:00
TwistedUmbrella 9a9de2c9db Add Samsung exFat filesystem support
The isolated source, taken from the Note 8 kernel, can be found at https://github.com/pjm0616/sdfat
2018-06-25 12:04:24 -04:00
TwistedUmbrella b4762106ef Increase minSDK according to NDK minimum (16)
Remove proprietary Xperia Play support (API 9 - 14)
2018-06-25 12:04:24 -04:00
TwistedUmbrella 3183b3185a Remove unused imports, variables, declarations 2018-06-25 12:04:24 -04:00
TwistedUmbrella 8cd6953f7c Shell: Changes provided by Android NDK compiler 2018-06-25 12:04:24 -04:00
TwistedUmbrella 4636d41394 Import TargetAPI annotations for Honeycomb 2018-06-25 12:04:23 -04:00
TwistedUmbrella c84000a3c6 Avoid leaking context in FileBrowser
While this is a bit of an excessive conversion, it is worthwhile for a long-running task to avoid leaking context and memory.
2018-06-25 12:04:23 -04:00
TwistedUmbrella 98dbcf0aff android: better error checking for external drives 2018-06-25 12:04:23 -04:00
TwistedUmbrella 3876a3e3ad http: read strings as strings, rather than bytes 2018-06-25 12:04:23 -04:00
TwistedUmbrella f71f2ca91f Eliminate static variables and hacky workarounds
Avoid retrieving preferences from static function

Unify numerous calls to the same fragment

Not entirely sure why I added more when this is much cleaner

Avoid a redundant call to SharedPreferences

Cleanup, Fix regressions, Finalize design changes

This fixes a few minor issues, including the missing title when options is opened from file browser, the release build product being named debug, and the possibility that JNIdc.config is not set when opening the BIOS without a game selected.
2018-06-25 12:04:23 -04:00
TwistedUmbrella 919c6d6288 Simplify log notification messages
Nobody actually understood where the "Files Dir" path was located and this led to more confusion than useful information. It also prevents the message from being overlapped.

Remove unused / ignored Snackbar parameters
2018-06-25 12:04:23 -04:00
TwistedUmbrella 60b501b747 Fix for unreliable createNewFile function
At one point, this was necessary(?). It appears to be problematic and the root cause of an unnecessary FileNotFoundException. Apache's FileUtils will create the directory and file, if necessary, when using version 1.3+ of the io library. This avoids maintaining workarounds.
2018-06-25 12:04:22 -04:00
TwistedUmbrella f88cb7f0e4 Move file list navigation to background (multi-threaded)
An xml view will never not exist, but it may be empty. Check the appropriate condition to avoid a crash.

Fix some error checking for file list clearing
2018-06-25 12:04:22 -04:00
TwistedUmbrella 1d3964588c Add basic shell for game search functionaliy
Implement search using current file handling
2018-06-25 12:04:22 -04:00
TwistedUmbrella f88561614e Convert global Toast to per-activity Snackbar
Assign activity menu icon to activity Snackbar

Unify appearance of Snackbar, Fix overlap in log sender

See https://stackoverflow.com/a/49583210/461982 for the StackOverflow submission on modifying Snackbar location.
2018-06-25 12:04:22 -04:00
TwistedUmbrella c684629128 Remove site label, Fix displaying site in navbar
Fix heading layout for removal of fake title bar

Make instances of reicast url clickable links
2018-06-25 12:04:21 -04:00
TwistedUmbrella 55fa2e6577 Use vectors in API 23+ (https://stackoverflow.com/a/41408100) 2018-06-25 12:04:21 -04:00
Apostolis Papadimitriou 831e7e3f9f Various changes in colors and styles 2018-06-25 12:04:21 -04:00
TwistedUmbrella 858d617673 Asynchronus preferences, where appropriate
Most UI settings should be saved asynchronously with immediate results few from runtime memory, but storing the keys for cloud saves should probably remain direct to disk with error checking.
2018-06-25 12:04:20 -04:00
TwistedUmbrella 81d2389c42 Remove secondary title and default to updating main 2018-06-25 12:04:20 -04:00
Apostolis Papadimitriou 1da3a95d42 Update navigation according to material design 2018-06-25 12:04:20 -04:00
TwistedUmbrella 03834ad48b Extend application for global functionality
Rather than attempt to locate each vector reference, it was best to extend the application for global support. This created a good place to handle native options that are separate from UI config

Clean up formatting and remove whitespace

Android Sudio does not verify global variables well

Conflicts:
	shell/android-studio/app/src/main/java/com/reicast/emulator/GL2JNINative.java
2018-06-25 12:04:20 -04:00
Apostolis Papadimitriou 7ab6e9f0c4 file browser colors and styles redesign 2018-06-25 12:04:19 -04:00
TwistedUmbrella 29ce6bd71a Realign with cherry-pick and fix formatting 2018-06-25 12:04:19 -04:00
TwistedUmbrella c9be03bc5e Calls to app_dummy are no longer necessary. 2018-06-25 12:04:19 -04:00
Apostolis Papadimitriou 0b52fcf2e5 A first view of browser file browser redesign
Transition to updated file browser resources
2018-06-25 12:04:19 -04:00
TwistedUmbrella 0265c635fe Fix per-case return, Disable rateme when hidden 2018-06-25 12:04:18 -04:00
TwistedUmbrella 4f8ae7f822 Avoid installing flash if BIOS has not been installed 2018-06-25 12:04:18 -04:00
TwistedUmbrella 068eedc325 Move button install to background thread and fix
Fix a crash related to file creation access unavailable

Move button install to background thread and fix
2018-06-25 12:04:18 -04:00
TwistedUmbrella f0e2b7831c Add bluetooth permission for controller support 2018-06-25 12:04:18 -04:00
TwistedUmbrella 159e9fe0ad Update Apache dependency to non-legacy
Apache-compliant log upload functionality (non-legacy)

Apache-compliant xml parsing functionality (non-legacy)

Apache-compliant image url functionality (non-legacy)

Apache-compliant changelog functionality (non-legacy)

Remove apache legacy library dependency (deprecated)
2018-06-25 12:04:18 -04:00
TwistedUmbrella 0f45296ea4 Cleanup comments, Permission compliance
The permission request is not necessary on rooted devices and the emulator may not run on non-root devices. This permissions simply circumvents a crash so the user can be notified of incompatibility through means other than a crash.
2018-06-25 12:04:18 -04:00
TwistedUmbrella d34590c158 Conversion to AppCompat drawable resource calls
Add compatibility prefix to layouts (app:srcCompat)
2018-06-25 12:04:17 -04:00
TwistedUmbrella ca4e77a334 Add icons compatible with NavigationView tint overlay 2018-06-25 12:04:17 -04:00
TwistedUmbrella 337d928d73 Convert drawer to new AppCompat design
Remove ratings menu before it appears to the user
2018-06-25 12:04:17 -04:00
TwistedUmbrella 274033baed Enable compatibility by default in Nougat + 2018-06-25 12:04:16 -04:00
TwistedUmbrella b46eeb6474 Migration to Android plugin for gradle 3.0
travis has already updated, requiring local changes according to https://developer.android.com/studio/build/gradle-plugin-3-0-0-migration.html

No need to "iterate" through a single item

Remove unused manifest parameter for Apache legacy
2018-06-25 12:04:16 -04:00
Apostolis Papadimitriou b58aaac5c0 Move version name and version code from Manifest to build.gradle 2018-06-25 12:04:16 -04:00
TwistedUmbrella d79748cb3e Update travis build tools and use compile SDK
travis: install the ndk bundle through the sdkmanager
2018-06-25 12:04:16 -04:00
TwistedUmbrella 10de7c8897 Ignore compile build identifier in commits
git rm --cached assets/build
2018-06-25 12:04:16 -04:00
TwistedUmbrella ee9843de66 Fix compile, automate compile w/ hash information
Restore existing compiled archive naming structure

Specify apache versions, Logging is redundant

Rename build product for release artifact
2018-06-25 12:04:15 -04:00
TwistedUmbrella 4f57f69472 Perform automated Android Studio optimize imports
Let's not confuse this for actual code changes.
2018-06-25 12:04:15 -04:00
TwistedUmbrella dfe0670cee Update .gitignore, Replace libs with hosted repositories 2018-06-25 12:04:15 -04:00
TwistedUmbrella 571b68d468 Fix building Windows alongside Android Studio
Windows: resolve missing reference to _SC_OPEN_MAX

https://lists.gnu.org/archive/html/bug-gnulib/2014-08/msg00023.html
https://libwebsockets.org/lws-api-doc-master/html/libwebsockets_8h_source.html

Windows: comment duplicate x86_ptr_imm definition

Replaced by more explicit type definitions. Fixes x64 compile

Restore secondary x86_ptr_imm for non-Windows

This appears to be a necessary duplicate for other platforms.
2018-06-25 12:04:14 -04:00
Stefanos Kornilios Mitsis Poiitidis 91d1a5ae69 Re-enable x86 support 2018-06-25 12:04:14 -04:00
Stefanos Kornilios Mitsis Poiitidis 563052a2e8 Really force -fPIC everywhere 2018-06-25 12:04:14 -04:00
Stefanos Kornilios Mitsis Poiitidis 85dd3b2f5c Add mising "return 0;". The compiler gets confused and generates bad code without it 2018-06-25 12:04:14 -04:00
Stefanos Kornilios Mitsis Poiitidis 301c7567d9 app.iml should not be in source control 2018-06-25 12:04:13 -04:00
Stefanos Kornilios Mitsis Poiitidis 86593d82e7 Add fpic option, remove ndk build stuff 2018-06-25 12:04:13 -04:00
TwistedUmbrella 7b806d6d82 Remove Eclipse source in favor of Android Studio 2018-06-25 12:04:12 -04:00
Stefanos Kornilios Mitsis Poiitidis 1933aff8a2 First steps for android studio builds 2018-06-25 12:04:07 -04:00
Flyinghead 846d02d9d2 Optimize RTT to VRAM. Add US version of THPS2 to per-game settings. 2018-06-25 16:55:22 +02:00
TwistedUmbrella e6afd22f98 Merge pull request #1191 from baka0815/gdi_skipws
GDI: Reset skipws-flag
2018-06-25 10:33:34 -04:00
Flyinghead 3256e02813 Workaround for Virtua Tennis ball color problem.
There's a texture corruption of the tennis ball and other textures,
notably the players' bags in the first intro sequence. The corruption is
due to render to texture squashing existing textures. Not sure what's
going on but this avoids the texture corruption. The original problem
remains.
2018-06-25 15:53:28 +02:00
[email protected] 915734fc32 Test GDIs: Include a testcase for #1006
In this testcase the first track contains spaces and special characters "(", ")" and ",".
This was a problem previously because the "skipws"-flag was never reset after reading a quoted filename.
2018-06-25 09:18:40 +02:00
[email protected] 852d644a5f GDI: Explicitly set skipws-flag
It's not neccesarry to set it every iteration, so just set it before and reset it afterwards.
2018-06-25 09:14:51 +02:00
Christoph "baka0815" Schwerdtfeger 41ee5707a8 GDI: Reset skipws-flag 2018-06-24 14:30:46 +02:00
Stefanos Kornilios Mitsis Poiitidis 3910045384 Merge pull request #1189 from barbudreadmon/patch-3
Allow loading of lst files (Naomi support #1188)
2018-06-22 12:34:51 +02:00
barbudreadmon 2e8a87cbdf Allow loading of lst files (Naomi support #1188) 2018-06-21 19:24:05 +02:00
Stefanos Kornilios Mitsis Poiitidis 1f088f211d Merge pull request #1183 from reicast/skmp/revert-to-irc
README: Revert to irc from slack
2018-06-21 03:26:40 +02:00
TwistedUmbrella 75189f0a78 Merge pull request #1180 from baka0815/unused_code
Removed unused code in core/linux-dist/main.cpp
2018-06-14 15:52:23 -04:00
Stefanos Kornilios Mitsis Poiitidis 68ee2828bb Merge pull request #1182 from baka0815/custom_cfg
evdev: Allow for custom <device>.cfg files in the /mappings/ directory.
2018-06-14 20:48:04 +02:00
Stefanos Kornilios Mitsis Poiitidis 69c5f65dd3 README: Revert to irc from slack
We should set up a slack <-> irc bridge, too.
2018-06-14 20:29:45 +02:00
Stefanos Kornilios Mitsis Poiitidis f34d4e9917 Typofix in README.md 2018-06-14 20:27:27 +02:00
Christoph "baka0815" Schwerdtfeger 3d43505504 Allow for custom <device>.cfg files in the /mappings/ directory.
Check if a configuration file named exactly like the device exists in the /mappings/ directory.
If it does, use this instead of the generic one.

Expose file_exists() from stdclass.
2018-06-13 19:33:51 +02:00
Christoph "baka0815" Schwerdtfeger 2e4cf087bd Refactored and fixed X11 buttons.
Replaced magic number with X11 constants.
Added keys for left and right shoulder buttons.
Added key for (missing) Y button.
Moved the debug printf() where it belongs.
2018-06-13 19:24:48 +02:00
Christoph "baka0815" Schwerdtfeger 8309eb7d6a Added most important X11-keys as constants. 2018-06-13 19:23:20 +02:00
Christoph "baka0815" Schwerdtfeger e6854ef87d Removed unused code in core/linux-dist/main.cpp
This is a leftover from #964
2018-06-13 19:17:20 +02:00
Stefanos Kornilios Mitsis Poiitidis 8912449106 Merge pull request #1179 from reicast/skmp/update-donation-readme
Update donation section in readme
2018-06-13 18:53:12 +02:00
Stefanos Kornilios Mitsis Poiitidis b2a3f21520 Typofixes 2018-06-13 14:16:53 +02:00
Stefanos Kornilios Mitsis Poiitidis 6171ae5dae Update donation section in readme 2018-06-13 14:16:13 +02:00
TwistedUmbrella ca11fd60f6 Merge pull request #1176 from reicast/issues_extended
Issues: Add a device section / Clarify "buildbot"
2018-06-11 23:42:53 -04:00
TwistedUmbrella 77e17abe0a Issues: Initially request just the platform
Device can be requested if (it appears that) is is a device-related issue
Issues related to the OS tend to be universal to the OS, or at least the OS version
2018-06-11 22:52:40 -04:00
TwistedUmbrella 5f57a82d46 Issues: Add a device section / Clarify "buildbot" 2018-06-11 22:47:17 -04:00
TwistedUmbrella 8c69dc8f88 Merge pull request #1174 from reicast/issue_template
Add a not-so simple template for issues
2018-06-11 12:38:53 -04:00
TwistedUmbrella 4e8316a05d Minor fix to issue template "preamble" 2018-06-11 12:26:52 -04:00
TwistedUmbrella b8fdfdc167 A not so simple template for issues
Rather than go through an arduous process of trying to provide just enough info that the template gets the desired results and everyone is happy with the formatting, here is a complex template that is simple to fill out and provides detailed info.
2018-06-11 09:51:55 -04:00
TwistedUmbrella d5ab0a597b Add a very simple template for issues 2018-06-11 07:46:00 -04:00
Stefanos Kornilios Mitsis Poiitidis f46f2740a7 Merge pull request #1151 from flyinghead/fh/clipping
Implement clipping
2018-06-09 20:02:10 +02:00
Flyinghead 08b8d30589 Implement clipping. Enabled by default. 2018-06-09 18:11:47 +02:00
Stefanos Kornilios Mitsis Poiitidis d0cd5a5f64 Merge pull request #1152 from flyinghead/fh/modvols
Enable modifier volumes. Fix for exclusion volumes.
2018-06-09 17:52:51 +02:00
Flyinghead 7640a35720 Draw modifier volumes only if enabled in settings (defaults to true) 2018-06-09 17:22:01 +02:00
Stefanos Kornilios Mitsis Poiitidis 3081afbe4a Merge pull request #1165 from flyinghead/fh/yuvtexbase <3
Fix video choppiness
2018-06-08 13:02:45 +02:00
Flyinghead 1f95eb243c Fix video choppiness 2018-06-07 19:06:16 +02:00
Flyinghead 2fdcf0d821 Use float constants in GLSL 2018-06-07 18:26:02 +02:00
Flyinghead e1a86b4e0a Fix SW1-JPB random texture corruption problem and video choppiness. 2018-06-07 17:19:49 +02:00
Flyinghead b9fe9332cf GLES 2 fix for fog table: use float only for vars and consts 2018-06-05 13:36:49 +02:00
Flyinghead 49e172b169 Push more silence on audio underrun to catch up 2018-06-05 12:18:42 +02:00
Flyinghead 828990b926 Texture based fog table 2018-06-05 12:18:09 +02:00
Flyinghead a345fcc4c7 Draw modifier volumes after punch-through so they can be shadowed as
well.
2018-05-23 14:31:11 +02:00
Flyinghead 2f9dcfabd8 Use FPU_SHAD_SCALE.scale_factor for shadow intensity instead of
hardcoded value.
2018-05-23 12:26:24 +02:00
Flyinghead 488b9ab831 Add TA_GLOB_TILE_CLIP struct. Fix typo. 2018-05-23 12:05:58 +02:00
Flyinghead bccfb5b70c Faster implementation for translucent polys depth pass. Disabled by
default. Auto-enabled for Cosmic Smash.
2018-05-22 15:47:02 +02:00
Flyinghead 23a2af0a28 Add setting for THPS2. Move RenderToTextureBuffer option to rend
section.
2018-05-22 15:34:33 +02:00
Flyinghead 0f6249fdcf Backport libretro per-game-settings logic 2018-05-22 15:20:37 +02:00
Flyinghead c8034807bb dump_frame/read_frame: save/load pvr registers 2018-05-22 13:23:07 +02:00
Flyinghead 4c7ffeb520 Per-pixel fog shading. Shaders cleanup. 2018-05-22 13:04:21 +02:00
Flyinghead 8d01bbe145 Increase Z scaling factor to 100k (fixes background menu in VR2). Set
depth mask before clearing buffers.
2018-05-21 16:44:18 +02:00
Flyinghead 9098fd5a22 Autosort poly: Write to the depth buffer in a second pass, and only if
multipass rendering.
2018-05-20 21:41:31 +02:00
Flyinghead 2d904372a9 Multipass issues: depth mask must be enabled for autosorted tr poly.
Depth buffer must NOT be cleared b/w passes, same for stencil I guess.
2018-05-20 14:16:43 +02:00
Flyinghead 9e994fecaa Avoid array overflow if more than 10 render passes 2018-05-19 18:57:16 +02:00
Flyinghead c35aa4262c Fix OpenGL errors with modvols and multipass 2018-05-19 18:51:30 +02:00
Flyinghead c427997269 Enable modifier volumes. Fix for exclusion volumes. Prevent overflow of modifier triangles (JGR). 2018-05-19 10:13:00 +02:00
Flyinghead 6e64fe90fc Reverting c3a90a63a1 as well as the
autosort hack, which was certainly a consequence. Fixes texture
corruptions.
2018-05-18 21:35:51 +02:00
Flyinghead d596f988c8 Revert 99bc20220e 2018-05-17 11:17:51 +02:00
Flyinghead 99bc20220e Simplify clipping 2018-05-17 10:32:52 +02:00
Flyinghead 80c193b3de Cache texture parameters. Fixed exclusion volume modifiers. 2018-05-16 19:34:45 +02:00
Flyinghead e73d11d0ab glHint nicest->fastest, and just once 2018-05-15 22:37:40 +02:00
Flyinghead b469f05b9d Fix wrong fog calculation issue 2018-05-15 21:19:58 +02:00
Flyinghead d8165376be GL cache fix 2018-05-15 16:09:50 +02:00
Flyinghead de046c4620 Use OpenGL state cache. Allocate texture ids in bulk. Avoid modifier
volumes entirely when not needed.
2018-05-15 15:22:26 +02:00
Flyinghead 0ccd8ed5ca glViewport not needed 2018-05-15 11:56:59 +02:00
Flyinghead 1cb0daff4c Revert glCheck 2018-05-15 11:56:01 +02:00
Flyinghead 2d834c7396 Revert glChecks 2018-05-15 11:54:14 +02:00
Flyinghead 833a616122 Merge OSX fixes 2018-05-15 11:41:44 +02:00
Flyinghead 46b40ad043 OSX: enable exceptions for vmem 2018-05-15 11:14:48 +02:00
Flyinghead 0a8348b6df Use CSYM() in assembler code 2018-05-15 11:13:42 +02:00
Flyinghead 71df770758 No stencil buffer by default on OSX 2018-05-15 11:11:29 +02:00
Flyinghead 34eae365f7 bad character? 2018-05-14 23:16:11 +02:00
Flyinghead c36e2731d7 read_frame fix 2018-05-14 22:38:22 +02:00
Flyinghead 4aee2eb5fe Increase gdrom dma buffer size to 8192 sectors 2018-05-14 19:37:33 +02:00
Flyinghead 2564c57cd2 Merge branch 'master' of https://github.com/flyinghead/reicast-emulator 2018-05-14 16:14:35 +02:00
Flyinghead b30f715796 Fix paletted textures mismatch in texture cache 2018-05-14 16:14:15 +02:00
Flyinghead 699c2986a5 WIP 2018-05-14 12:48:22 +02:00
Flyinghead ae49c19cea osx: cpu x86. glViewport now doing in RenderFrame 2018-05-14 09:31:03 +02:00
Flyinghead 20ebe9b984 OS X project file reference fix 2018-05-14 09:28:21 +02:00
Flyinghead 46f28cfb27 Fog fix 2018-05-13 23:07:35 +02:00
Flyinghead 95120690ef Use log2 depth scaling when opengl 3 is available 2018-05-13 20:19:36 +02:00
Flyinghead 688ba5c37d Fix autosort translucent poly bug (rayman). probably still not right... 2018-05-13 16:48:09 +02:00
Flyinghead b68f0a16a8 Increase FPS font size 2018-05-13 16:45:20 +02:00
Flyinghead c30548eb6a Added on-screen FPS counter. Fix clear screen issue when widescreen
enabled but not currently on.
2018-05-13 16:01:08 +02:00
Flyinghead 50a2e7e842 Revert dd9f77b4ab: no gl_FragDepth in GLES 2 :( 2018-05-12 14:39:06 +02:00
Flyinghead dd9f77b4ab Changed z normalization to log scale 2018-05-12 13:26:50 +02:00
Flyinghead 717ee0b3ce Make rendering to texture buffer optional 2018-05-11 19:33:17 +02:00
Flyinghead b02eccd5c7 Fix performance problem with RTT waiting 2018-05-11 19:08:54 +02:00
Flyinghead 43c125c208 Better texture cache: avoid duplicate. Attempt to put the RTT texture in
the cache to avoid copy to/from vram.
2018-05-11 15:29:24 +02:00
Flyinghead 683cbbba3e Multipass rendering 2018-05-10 21:28:20 +02:00
Flyinghead 0f92189585 Fix translucent triangles not being autosorted(?) 2018-05-10 13:02:57 +02:00
Flyinghead b77843b927 Handle RTT texture stride (VT) 2018-05-09 15:08:13 +02:00
Flyinghead 136c3d6825 When rendering to texture, wait until after the frame is rendered to
unlock.
2018-05-09 14:46:06 +02:00
Flyinghead c13a42611b Implemented other RTT format conversions. 2018-05-09 13:04:48 +02:00
Flyinghead 5710aa08ed Remove all vram locks before reading back RTT buffer. Use RGBA/ubyte
format when RGB/565 is not available.
2018-05-09 12:28:38 +02:00
Flyinghead 2e4ec3a1ed Added RTT support 2018-05-08 18:47:00 +02:00
Flyinghead 9f13ded502 Enable Modifier Volumes. Fix modtrig buffer overflow and stencil reset. 2018-05-04 18:18:04 +02:00
Flyinghead cc88561d4a Implemented clipping (Daytona USA menus) 2018-05-02 15:41:42 +02:00
Flyinghead db0534d5dd Fix PunchThrough texturing on JGR with nvidia 2018-05-02 12:29:47 +02:00
Flyinghead fe71519d1b Write some silence on audio underruns 2018-05-01 17:25:42 +00:00
Flyinghead 5320c3adee Fixed previous screw up 2018-05-01 11:20:25 +02:00
Flyinghead a953a0baa7 Use ring buffer for samples and detect buffer underruns 2018-04-29 17:56:01 +02:00
Flyinghead 39e0f378cb OSX: add x64 target. Use JIT compiler. Clean exit. Use semaphore in core audio driver. Use layout-independent key codes to support int'l keyboards. Fixed GL window scaling. 2018-04-29 16:07:54 +02:00
Flyinghead 64a8ac1dd5 Add clean exit patch for x11 and 64-bit architecture 2018-04-27 16:54:15 +02:00
Flyinghead 35d3bd98d4 Disable fog table logging. Small optimization 2018-04-27 10:58:10 +00:00
Flyinghead b8f3d37df2 Disabled some logging (Mr.Driller) 2018-04-27 10:50:21 +00:00
Flyinghead 94aa7c9e83 Fix alsa backend clicking noise on underrun. Set the buffer size to match the [omx] audio_latency setting 2018-04-27 10:49:23 +00:00
Flyinghead 087cb1561f GCC5.x cross compile fix 2018-04-27 10:43:57 +00:00
Flyinghead 10bdf7f449 Clean exit when exit key is pressed 2018-04-27 10:37:56 +00:00
Stefanos Kornilios Mitsis Poiitidis a50861b249 Merge pull request #1135 from reicast/skmp/snapcraft-add-desktop
Snapcraft: Add .desktop path
2018-04-22 00:17:01 +02:00
Stefanos Kornilios Mitsis Poiitidis 35ef2337fa Snapcraft: Add .desktop path 2018-04-21 23:58:36 +02:00
rrrh bcdf38da0a Merge pull request #1130 from reicast/rrrh/osx-high-sierra
Rrrh/osx high sierra
2018-04-21 19:26:27 +02:00
TwistedUmbrella 2c9a162540 Fix whitespace from bad example
https://github.com/reicast/reicast-emulator/pull/1130#issuecomment-383255871 attempted to set box width with whitespace. It is ignored by markdown parsing, which allows the table to be formatted for readability in unparsed form.
2018-04-21 19:01:24 +02:00
Hugo Hackenstein b785abd4a6 Fix layout typo 2018-04-21 19:01:24 +02:00
Hugo Hackenstein d8a3d7308e Merge Ios and MacOS build description to one chapter 2018-04-21 19:01:24 +02:00
Hugo Hackenstein d653d4e009 Remove unneeded stdlib include 2018-04-21 19:01:24 +02:00
Hugo Hackenstein a93c0b91f4 Added info about Macos build steps 2018-04-21 19:01:08 +02:00
Hugo Hackenstein 4fcb95a0d1 Mac compile on OSX - Remove deprecated malloc.h include and switch to stdlib.h instead 2018-04-21 19:00:36 +02:00
Stefanos Kornilios Mitsis Poiitidis 80d054940c snapcraft: Add joyconfig 2018-04-20 00:32:55 +02:00
Stefanos Kornilios Mitsis Poiitidis ea652b679e snapcraft: use git for versioning 2018-04-20 00:14:13 +02:00
Stefanos Kornilios Mitsis Poiitidis c000f2e9a9 Merge pull request #1124 from reicast/skmp/snapcraft
Basic snapcraft configuration
2018-04-19 23:59:40 +02:00
Stefanos Kornilios Mitsis Poiitidis c97a000ee0 Update snapcraft file 2018-04-19 23:47:46 +02:00
Stefanos Kornilios Mitsis Poiitidis dc4d807846 Basic snapcraft.yaml 2018-04-19 23:05:52 +02:00
Stefanos Kornilios Mitsis Poiitidis 34b495baa7 Merge pull request #1098 from reicast/pr/1092
fix gdi track parsing in unix #1092
2018-04-19 20:51:13 +02:00
Stefanos Kornilios Mitsis Poiitidis 90e901f4a3 gdi: Normalize paths, add test gdi files 2018-04-18 22:28:05 +02:00
Stefanos Kornilios Mitsis Poiitidis 407fe4427f Readme: Typofix
Me engrish speak much
2018-04-17 16:15:21 +02:00
Stefanos Kornilios Mitsis Poiitidis 697fcccd95 Merge pull request #1116 from sjvs/add-lgtm.yml-for-lgtm.com-C-analysis
Add .lgtm.yml file to set up lgtm.com C analysis for reicast-emulator
2018-04-17 16:01:24 +02:00
Stefanos Kornilios Mitsis Poiitidis ba11e6359d Merge pull request #1114 from reicast/skmp/readme-contrib-section
Add contrib section to readme
2018-04-17 15:32:49 +02:00
Stefanos Kornilios Mitsis Poiitidis 71b8501e28 Merge pull request #1115 from reicast/skmp/fix-travis-100th-time
travis: Fix PR building
2018-04-17 15:27:59 +02:00
Bas van Schaik a24d41482e Add .lgtm.yml file to set up lgtm.com C analysis for reicast-emulator 2018-04-17 14:20:06 +01:00
Stefanos Kornilios Mitsis Poiitidis 81631814c9 travis: Fix PR building 2018-04-17 14:16:06 +02:00
Stefanos Kornilios Mitsis Poiitidis e5fb8aec79 README.md: Improve contrib formating 2018-04-17 14:06:17 +02:00
Stefanos Kornilios Mitsis Poiitidis 36f71ce6ea Merge pull request #1111 from gizmo98/rpi-stuff
rpi stuff from OrN: omx audio backend, and dispmanx window
2018-04-17 12:44:28 +02:00
Stefanos Kornilios Mitsis Poiitidis b6fa87d5c9 Update README.md 2018-04-17 12:42:26 +02:00
gizmo98 e70848647e rpi: add platform rpi3 2018-04-12 21:10:22 +02:00
Stefanos Kornilios Mitsis Poiitidis dfc58ece9f Merge pull request #1106 from reicast/skmp/fix-wercker
Fix travis PR builds
2018-04-11 23:48:49 +02:00
Stefanos Kornilios Mitsis Poiitidis e03e44bbae travis: Do not decrypt debug cert for PR builds 2018-04-11 23:36:06 +02:00
gizmo98 4a7d0b9e7e rpi: add option to use mesa or new vendor gl libs 2018-04-11 21:42:57 +02:00
gizmo98 b09356f3f7 Fix GCC6 "Bool" issue 2018-04-11 21:37:31 +02:00
Stefan 8c967b0591 Merge pull request #1 from OrN/rpi2-stuff
omx audio backend, and dispmanx window
2018-04-11 21:33:45 +02:00
Stefanos Kornilios Mitsis Poiitidis 76b09876f8 Merge pull request #1104 from reicast/skmp/really-fix-ta-allocs
tactx: Actually use aligned alloc functions
2018-04-11 12:17:13 +02:00
Stefanos Kornilios Mitsis Poiitidis 2cd19a3104 Merge pull request #1037 from sl1pkn07/master
[cmake] add EVDEV and JOYSTICK options
2018-04-11 12:06:25 +02:00
Stefanos Kornilios Mitsis Poiitidis 4300951b51 gdi: Cleanup path code, use C++ strings 2018-04-11 11:40:15 +02:00
Stefanos Kornilios Mitsis Poiitidis fe30e58504 tactx: Actually use aligned alloc functions 2018-04-11 11:06:46 +02:00
Stefanos Kornilios Mitsis Poiitidis fb9ef78f85 Merge branch 'hissingshark-vero4k' 2018-04-09 21:36:10 +02:00
Stefanos Kornilios Mitsis Poiitidis 894e9f1414 Cleanup changes for merge with master 2018-04-09 21:11:06 +02:00
hissingshark d1bac19a0a Fixed blunder and changed OS test. 2018-04-05 16:58:23 +01:00
hissingshark dec5c7bdd2 Added helper functions for aligned memory (de)allocation 2018-04-05 12:13:49 +01:00
hissingshark 3ab9c22516 Fix issue from PR #1023 2018-04-03 17:38:30 +01:00
TwistedUmbrella fb418d568c Don't skip whitespace when reading filename
https://stackoverflow.com/a/6774866
2018-04-02 03:51:38 -04:00
TwistedUmbrella 052c5c1cb3 Fix for Windows missing definition of ssize_t 2018-04-02 02:54:30 -04:00
Stefanos Kornilios Mitsis Poiitidis c832df6d62 Merge pull request #1078 from nadenislamarre/nae_get_entry
cfg/get_entry: Validate that virtual section has virtual key before using it
2018-03-27 23:01:26 +02:00
i30817 3fdd7f50ea fix gdi track parsing in unixx
Same problem as https://github.com/libretro/reicast-emulator/pull/24

in unix that iteration would not work if the path of the original .gdi file (where we are finding the 'parent directory') was:

1. not existent, ie a gdi on the same directory as the current. It was iterating until the index 3 and stop there. Disaster strikes later ofc, if the first characters weren't C:\ or other thing like that.
2. in a relative subdirectory that is 'small enough' ie: a/crazy-taxi.gdi. In this case the last '/' wouldn't be found, the derived string would be 'crazy-taxi.gdi' and the file not found ofc.

Anyway, this can be solved simply by searching the whole string and using a signed integer. It will go up to -1, stop iteration and increase to 0 on the len++.

Dunno if using relative subdirectories for the tracks on *other* platforms works because of the path separator being different from what's inside the gdi but with this code fixed it works on linux with / at least.
2018-03-25 18:53:18 +01:00
Stefanos Kornilios Mitsis Poiitidis 9adadd5d7a Merge pull request #1086 from reicast/skmp/fix-travis
Travis CI fix: install ant
2018-03-22 16:16:39 +01:00
Stefanos Kornilios Mitsis Poiitidis 901001da9a Travis CI fix: install ant 2018-03-22 16:06:11 +01:00
Apostolis Papadimitriou bf03828a24 Update README.md
Add one more device in devices tested list
2018-03-22 12:33:38 +02:00
TwistedUmbrella b4631f6715 Merge pull request #884 from williansti/master
update PT-BR brazilian translation
2018-03-09 12:40:47 -05:00
TwistedUmbrella 045ab285ca Merge pull request #1068 from promi/fix-evdev_mapping
Fix #1051
2018-03-09 12:35:06 -05:00
TwistedUmbrella a29fbc62c9 Merge pull request #1080 from nhoudelot/master
some typo fix
2018-03-09 12:31:03 -05:00
Nicolas HOUDELOT bf9ff3c0ed GNU Public License -> GNU General Public License 2018-03-05 01:57:40 +01:00
Nicolas HOUDELOT 5c343a219c fix typo 2018-03-05 01:57:00 +01:00
Nicolas Adenis-Lamarre 8ba58a3d9d configuration parsing: get_entry must not look into virtual sections only
in emu.cfg, when i set rend.WideScreen = 1, its not read.
has_entry and get_entry doesn't use the same check,
thus while has_entry can return true, get_entry can not return the entry.

Signed-off-by: Nicolas Adenis-Lamarre <[email protected]>
2018-02-13 23:20:23 +01:00
Stefanos Kornilios Mitsis Poiitidis d9e65bfbe4 Merge pull request #1074 from hissingshark/vero4k
Added detection for Vero4K
2018-01-17 12:57:32 +01:00
hissingshark 2034aca3f5 Added detection for Vero4K 2018-01-16 13:38:00 +00:00
Stefanos Kornilios Mitsis Poiitidis ad0ec384cf Merge pull request #1071 from zerojay/master
Fix hardware detection for Odroid-XU4 against newer kernels
2017-12-25 12:33:01 +01:00
zerojay c3e6dc7bd7 Fix hardware detection for Odroid-XU4 against newer kernels
On older kernels, the Odroid-XU4 would be identified as "ODROID-XU3". On newer kernels, such as the latest Ubuntu kernel for ODroid, the XU4 is now being identifed as "ODROID-XU4" which would cause the hardware detection to fail and have it build a generic ARM build instead of our desired "platform = odroidxu3".
2017-12-21 17:59:56 -05:00
Promi 5615694ea0 Fix #1051 2017-12-09 15:51:57 +01:00
Stefanos Kornilios Mitsis Poiitidis 7ab3357675 Merge pull request #1060 from reicast/skmp/update-readme
Readme: Add slack link
2017-11-13 14:17:03 +01:00
Stefanos Kornilios Mitsis Poiitidis 990ac46acc Readme: Add slack link 2017-11-13 14:12:48 +01:00
sL1pKn07 18570281f9 [cmake] add EVDEV and JOYSTICK options 2017-07-07 00:16:43 +02:00
TwistedUmbrella 8a680202a4 Merge pull request #808 from reicast/loungekatt
iOS rebuild to support file list and controllers
2017-06-17 13:07:42 -04:00
TwistedUmbrella 3df7e0a093 Remove deprecated third-party configuration 2017-06-17 09:18:32 -04:00
TwistedUmbrella c80dbb1629 Create Xcode external build system for zlib 2017-06-17 09:18:27 -04:00
TwistedUmbrella c16d3195b5 iOS: Add button tag as secondary identification 2017-06-04 13:38:56 -04:00
TwistedUmbrella 2d43e958cc Switch to local gitignore for proprietary items 2017-06-04 13:38:56 -04:00
TwistedUmbrella 158eef7883 Remove fp.h leftovers after limping update 2017-06-04 13:38:56 -04:00
TwistedUmbrella 656a230d06 Centralized key handling in EmulatorView 2017-06-04 13:38:56 -04:00
TwistedUmbrella e6fe7df468 Fix overlay by restoring independent xib view
This resolves an issue with the GLKView stealing z-order with every
frame and allows disabling the view, not just hiding it.
2017-06-04 13:38:55 -04:00
TwistedUmbrella 2e41057e7f Connect on-screen controls to an IBAction method 2017-06-04 13:38:55 -04:00
TwistedUmbrella c073e5632f Add default disk image, Disable touch on GLKView 2017-06-04 13:38:55 -04:00
TwistedUmbrella 52015ced17 Support loading disk / BIOS from selection 2017-06-04 13:38:55 -04:00
TwistedUmbrella 4b5d116812 Covert to assets library to support iPhone 6 2017-06-04 13:38:55 -04:00
TwistedUmbrella 3b44f3dc04 Attach controller view to hardware config, Fix cells 2017-06-04 13:38:55 -04:00
TwistedUmbrella 9766627918 Integrate controller into storyboard emulator view 2017-06-04 13:38:55 -04:00
TwistedUmbrella c8c455483f Convert to navigation controller to push view 2017-06-04 13:38:54 -04:00
TwistedUmbrella c4b6ee3333 Move controller to storyboard, Add file parameters 2017-06-04 13:38:54 -04:00
TwistedUmbrella d106f541e6 Fix table crash, Use modal EmulatorView
The current layout does not yet support the sliding view. The requires
and update and / or replacement of the backend library.
2017-06-04 13:38:54 -04:00
TwistedUmbrella 458492f611 Add custom cells to support disk image 2017-06-04 13:38:54 -04:00
TwistedUmbrella df707aa60e Create compound predicate for various file types 2017-06-04 13:38:54 -04:00
TwistedUmbrella 5f0d58dc65 Preliminary file list and controller overlay support 2017-06-04 13:38:54 -04:00
TwistedUmbrella 4fd15e515d Add a basic hardware control scheme for iOS 2017-06-04 13:38:54 -04:00
Stefanos Kornilios Mitsis Poiitidis 3c802cde5a Merge pull request #1030 from reicast/skmp/vs-2015
vs: Upgrade sln to visual studio 2015
2017-06-04 19:00:10 +02:00
Stefanos Kornilios Mitsis Poiitidis 3579c9aabf vs: Upgrade sln to visual studio 2015 2017-06-04 18:41:03 +02:00
TwistedUmbrella 49ada26a69 Merge pull request #1019 from reicast/lk/cleanup
Updates for newer APIs / remove outdated code
2017-06-04 12:37:21 -04:00
TwistedUmbrella 09c7213b32 Remove deprecated dependancy
Enough devices have updated that a few stray Checkbox “victims” are
worth removing this severely outdated compatibility library
2017-05-24 13:02:35 -04:00
TwistedUmbrella 1dd951540a sdcard0 is now sdcard on most current hardware
This was an attempt to circumvent read permission, but that can be
handled by the user simply choosing the directory correct.
2017-05-24 13:02:35 -04:00
TwistedUmbrella defd2d1941 Add a "better" label to native mode
It is less about general hardware performance and more about
proprietary hardware requiring native support
2017-05-24 13:02:35 -04:00
TwistedUmbrella 7a1b22b3b8 Cleanup for Nougat compatibility
This will also stop preventing a build when a translation is missing.
2017-05-24 13:02:35 -04:00
TwistedUmbrella b7d33ee013 Remove direct use of library in favor of Manifest 2017-05-24 13:02:35 -04:00
TwistedUmbrella bced0a81ea Add legacy HTTP support library for Android 23+ 2017-05-24 13:02:35 -04:00
TwistedUmbrella f4a1082f75 Update some really outdated UI display code 2017-05-24 13:02:34 -04:00
Stefanos Kornilios Mitsis Poiitidis 6eb48808aa Merge pull request #1023 from reicast/skmp/optimize-ta-handling
Cleanup/optimize ta_thd_data32_i
2017-05-18 12:29:55 +02:00
Stefanos Kornilios Mitsis Poiitidis 6ae93b31d1 ta: use 256-bit struct 2017-05-16 13:33:37 +02:00
Stefanos Kornilios Mitsis Poiitidis 8e3b9b434c Cleanup/optimize ta_thd_data32_i
- Use 128-byte copies
- read pcw from memory
2017-05-16 12:38:00 +02:00
TwistedUmbrella 90395f099e Merge pull request #1022 from reicast/skmp/fix-appveyor-deploy
Appveyor: Set region to 'eu-west-1'
2017-05-14 22:17:16 -04:00
Stefanos Kornilios Mitsis Poiitidis 151f3f2452 Appveyor: Set region to 'eu-west-1' 2017-05-13 13:10:48 +02:00
Stefanos Kornilios Mitsis Poiitidis ca837e19b8 Merge pull request #986 from verybadsoldier/init_sub_unit_dir
alsa-backend: initialize variable "sub unit dir"
2016-12-31 13:47:02 +02:00
Stefanos Kornilios Mitsis Poiitidis 6aba7ffe5e Merge pull request #996 from reicast/skmp/osx-fixes
osx: update swift code
2016-12-31 13:44:30 +02:00
Stefanos Kornilios Mitsis Poiitidis fd4d600d3f osx: update swift code 2016-12-30 16:35:08 +02:00
TwistedUmbrella aca9cb6919 Android debug domain hosting update 2016-11-21 01:39:58 -05:00
verybadsoldier 7d49b2212d alsa-backend: initialize variable "sub unit dir". This variable is passed into alsa as a pointer. Alsa will write to it but also read (!) from it. So the read will give undesired behavior when variable is not initialized. Depending on current alsa-config/hardware it leads to an error "Invalid argument" when submitting the parameters by invoking "snd_pcm_hw_params" a few lines later.
Initializing the variable to -1 fixes it and means "set to exact value or less" (http://alsa.opensrc.org/HowTo_Asynchronous_Playback)
2016-10-18 22:31:31 +02:00
TwistedUmbrella d8a7212d69 Merge pull request #975 from reicast/lk/cleanup
Restore switch compatibility for legacy Android
2016-09-25 15:30:33 -04:00
TwistedUmbrella 696a786b72 Restore switch compatibility for legacy Android 2016-09-23 23:54:01 -04:00
Jan Holthuis 2cac29f3c1 Merge pull request #972 from reicast/holzhaus/fix-evdev-compile
linux-dist/evdev: Use std::Map.find() instead of operator[]
2016-09-23 13:09:44 +02:00
Jan Holthuis b7fa676546 linux-dist/evdev: Use std::Map.find() instead of operator[]
Since EvdevControllerMapping does not have a default constructor,
we can't use the operator[];

    data_type& operator[](const key_type& k) - Returns a reference to
    the object that is associated with a particular key. If the map
    does not already contain such an object, operator[] inserts the
    default object data_type().

Instead, we use the std::map.find() function.

This should resolve #971.
2016-09-23 12:54:27 +02:00
Preston Smith 6f1fa1ab08 omx audio backend, and dispmanx window 2016-09-21 17:21:13 -05:00
Stefanos Kornilios Mitsis Poiitidis e5d8851316 Merge pull request #964 from Holzhaus/linux-rumble-support
Linux rumble support
2016-09-20 13:49:13 +02:00
Stefanos Kornilios Mitsis Poiitidis 42e6a62fac Merge pull request #877 from KrossX/purupuru
X360 controller support for Windows + Rumble
2016-09-17 22:26:46 +02:00
TwistedUmbrella 7945372063 Merge pull request #965 from reicast/lk/cleanup
Clean formatting, Remove unnecessary variables
2016-09-14 16:13:07 -04:00
TwistedUmbrella f7d1a677a9 Restore dialog definition to file browser 2016-09-14 15:31:35 -04:00
TwistedUmbrella 0c86473e2d Clean formatting, Remove unnecessary variables 2016-09-14 15:24:02 -04:00
TwistedUmbrella 34d9471104 Merge pull request #953 from reicast/lk/cleanup
Cleanup and rework to start fixing issues ;)
2016-09-14 15:10:21 -04:00
Jan Holthuis fdc3de7870 Port right motor adjustment to linux version
This adapts KrossX' commit c37c5c42e4 so
that we can use it in the linux version, too.
2016-09-13 14:54:29 +02:00
Jan Holthuis 99a4ee3f0f Merge pull request #963 from reicast/holzhaus/joyconfig-enter-fix
linux/reicast-joyconfig: Fix keyboard support
2016-09-13 13:17:20 +02:00
Stefanos Kornilios Mitsis Poiitidis 88c6bb6293 Merge pull request #905 from reicast/holzhaus/buffer-overflows
Fix some buffer overflows
2016-09-12 22:23:24 +02:00
Stefanos Kornilios Mitsis Poiitidis 3ed70a26fb Merge pull request #914 from ghost/issue-883
Update softrend.cpp
2016-09-12 22:19:39 +02:00
Jan Holthuis 215c02e369 linux/reicast-joyconfig: Implement noecho terminal mode for keyboards 2016-09-12 17:51:50 +02:00
Jan Holthuis 8fd33291cf linux/reicast-joyconfig: Flush stdin via termios if possible
This might be necessary to get rid of input characters from mapping
keyboard buttons.
2016-09-12 14:15:55 +02:00
Jan Holthuis dc025c7502 linux/reicast-joyconfig: Discard ALL events in the clear_events() function
This should fix #962.
2016-09-12 14:15:39 +02:00
Stefanos Kornilios Mitsis Poiitidis 04137ca950 Merge pull request #961 from sl1pkn07/master
Fix build with pulseaudio. fix https://github.com/reicast/reicast-emulator/issues/934
2016-09-07 12:02:28 +02:00
Gustavo Alvarez b0fc4ed981 Fix build with pulseaudio. fix https://github.com/reicast/reicast-emulator/issues/934 2016-09-03 20:11:45 +02:00
TwistedUmbrella 1f493134ef Fix overzealous import removal, Toast references 2016-08-16 11:06:53 -04:00
TwistedUmbrella cf7e62fd5c Use hardware acceleration, if available 2016-08-15 03:52:38 -04:00
TwistedUmbrella a501d9288b Align toast usage with definition 2016-08-15 03:52:35 -04:00
TwistedUmbrella 41ae2261bb Add / update high resolution changelog icons 2016-08-04 17:35:41 -04:00
TwistedUmbrella dd9dba700f Remove extraneous libraries, git API scope 2016-08-03 16:49:31 -04:00
TwistedUmbrella b68c8ab3dc Organize imports, Clean up Github integration 2016-08-03 16:49:21 -04:00
Twinaphex 73e2691c61 Merge pull request #931 from rohit-n/linux-cmake
Fix Linux build under CMake.
2016-05-22 19:04:52 +02:00
Rohit Nirmal 3c9ed1b3c1 Fix Linux build under CMake. 2016-05-22 11:59:13 -05:00
Twinaphex a5b7011c57 Merge pull request #929 from Hyell/master
Multiplayers with configuration file
2016-05-15 14:48:40 +02:00
Twinaphex 3cb39268a9 Merge pull request #926 from reicast/ftrc-fix
ftrc fix - revert back to nulldc defaults
2016-05-14 04:44:24 +02:00
Stefanos Kornilios Mitsis Poiitidis 7c5e49a6d2 dyna: Fix f2i canonical + x86 to saturate 2016-05-14 04:15:16 +03:00
Stefanos Kornilios Mitsis Poiitidis 3d7d73e1e5 Merge pull request #927 from reicast/sprite-palette-fix
texcache: fix vram_lock to actually lock the entire texture
2016-05-13 20:16:21 +03:00
twinaphex b606593774 ftrc fix - revert back to nulldc defaults 2016-05-13 14:44:53 +02:00
twinaphex ccfb6b635a Delete spurious code - fixes sprite palette issue with games like
Street Fighter III 3rd Strike/Capcom Vs SNk 2, possibly others
2016-05-13 14:37:47 +02:00
Hyell 469dda0e57 Update maple_cfg.cpp
Add players.nb option in emu.cfg. You can add 1-4 SegaController.
2016-04-26 17:06:45 +02:00
Hyell 6c49f0a852 Update maple_cfg.cpp 2016-04-25 12:10:12 +02:00
pvezien e093f679a8 Update softrend.cpp 2016-04-13 09:20:33 +12:00
Stefanos Kornilios Mitsis Poiitidis 0a1689cb40 Fix broken ru xml 2016-03-17 01:30:22 +02:00
Jan Holthuis 52afec6f7d Merge pull request #832 from reicast/holzhaus/sdl-opengl
Move to SDL2 for OpenGL 3.1 and GLES support
2016-03-04 15:13:25 +01:00
Jan Holthuis ef1994549b webui/server.cpp: Fix buffer overflow in callback_http() 2016-02-22 18:55:34 +01:00
Jan Holthuis 1868f1e91f imgread/gdi.cpp: Fix buffer overflow in load_gdi() 2016-02-22 18:55:34 +01:00
Jan Holthuis b106efde5f imgread/common.cpp: Add buffer size checks in case buffer size are changed later 2016-02-22 18:55:33 +01:00
Jan Holthuis 1a809fc60e hw/naomi/naomi_cart.cpp: Fix 3 buffer overflows in naomi_cart_LoadRom() 2016-02-22 18:55:33 +01:00
Jan Holthuis 9e937957f7 hw/flashrom/flashrom.h: Fix buffer overflow in MemChip::Load() 2016-02-22 18:55:33 +01:00
Jan Holthuis 5638b872ac cfg/ini.cpp: Fix buffer overflow in ConfigFile::parse() 2016-02-22 18:55:33 +01:00
Jan Holthuis 2866c879ac cfg/cfg.cpp: Mark possible buffer overflow 2016-02-22 18:31:36 +01:00
Jan Holthuis 45deafc940 Merge pull request #902 from philenotfound/master
Fix the check for the enviroment variable
2016-01-30 18:45:50 +01:00
Phil Eichinger dde4647e55 Fix the check for the enviroment variable
I tried running reicast and it immediately died with:

terminate called after throwing an instance of 'std::logic_error'
  what():  basic_string::_S_construct null not valid
Aborted

I was missing the environment variable XDG_CONFIG_DIRS

Turns out find_system_config_dirs() checked for the existence of
XDG_DATA_DIRS but then tried to use XDG_CONFIG_DIRS (non-existent in my
case).

fixes #847
2016-01-30 10:29:36 +01:00
KrossX d4d782c71c Remove unused lines. 2016-01-22 15:08:29 -03:00
Jan Holthuis 6b1a02e971 Merge remote-tracking branch 'krossx/purupuru' into linux-rumble-support 2016-01-22 14:39:18 +01:00
Willians 43ef4c69bd update PT-BR brazilian translation
Translation made, revised and lined with original value eng
2015-12-18 11:28:50 -02:00
KrossX c37c5c42e4 Right motor adjustment 2015-12-17 22:10:55 -03:00
Jan Holthuis 0e4949e7bd Linux/Makefile: Fix spaces in path name
This resolves #883.
2015-12-18 00:14:57 +01:00
Jan Holthuis c7b1f60cb1 Linux: Fix Makefile Indentation
Spaces and Tabs actually have different meanings when used in makefiles
2015-12-16 19:58:05 +01:00
Jan Holthuis d8dabb713d Merge pull request #873 from gizmo98/patch-1
reicast-joyconfig.py: store btn_escape in the right section
2015-12-14 10:09:46 +01:00
Stefanos Kornilios Mitsis Poiitidis ad7e23d849 Merge pull request #846 from reicast/feat/ta-hash-logs
rend/if: Logging/verification of MD5(ta command list data)
2015-12-14 04:15:37 +01:00
Stefanos Kornilios Mitsis Poiitidis f868fc0655 Merge pull request #841 from reicast/wip/osx-ios-sound
apple: Add primitive core audio support
2015-12-14 04:06:01 +01:00
Stefanos Kornilios Mitsis Poiitidis 7a7cae9f14 Merge pull request #875 from reicast/skmp/linux-softrend
softrend: linux support
2015-12-14 03:50:49 +01:00
Stefanos Kornilios Mitsis Poiitidis 852521564e Merge pull request #869 from 6lackmag3/patch-2
[Android] Update values-ru/strings.xml
2015-12-14 03:45:07 +01:00
Stefanos Kornilios Mitsis Poiitidis 6c3c726019 softrend: Fix windows build 2015-12-14 03:11:40 +01:00
Stefanos Kornilios Mitsis Poiitidis af01baae75 linux/softrend: Optional via makefile, sse4.1 detection 2015-12-14 02:40:23 +01:00
Jan Holthuis cc5719e845 Linux/evdev: Add Force Feedback/Rumble support 2015-12-14 01:09:03 +01:00
Stefanos Kornilios Mitsis Poiitidis 43649b5b61 linux/softrend: Fix x86 makefile 2015-12-13 14:22:49 +01:00
Stefanos Kornilios Mitsis Poiitidis f3e4416bb4 linux/softrend: Cleanup accidental file changes 2015-12-13 14:08:16 +01:00
Stefanos Kornilios Mitsis Poiitidis 62018cf203 linux/softrend: Fix porting bugs, hackplement X11 drawing
- Fix RECT fields oder (initialized via {} on the code)
- Initialize shuffle_alpha (duh ...)
- X11 Image drawing (hacky, depends on internal X11 details)
- Untwidle code w/ optional flipping (X11 doesn't use inverted bitmaps)
- rgba shuffling (not needed yet, but left for documentation)
2015-12-13 14:00:25 +01:00
Stefanos Kornilios Mitsis Poiitidis 5e377399d3 linux/softrend: builds & runs, doesn't push to screen yet 2015-12-13 14:00:25 +01:00
KrossX c42986e63f Unplug PuruPuru Pack
Ooops.
2015-12-07 21:30:07 -03:00
KrossX 832eeeb419 Might help compilation in other platforms
I cannot verify it though.
2015-12-07 21:27:19 -03:00
KrossX b59ca13cfe Implemented PuruPuru device
Includes a simple XInput implementation for Windows.
2015-12-07 21:21:03 -03:00
KrossX c05cf846f3 Merge branch 'refs/heads/xinput_windows' into purupuru 2015-12-07 20:40:36 -03:00
KrossX b566092d28 Basic XInput support for Windows
Adds simple X360 controller support for Windows.
2015-12-07 20:09:15 -03:00
Stefan 3ed2985d51 reicast-joyconfig.py: store btn_escape in the right section 2015-11-29 13:04:23 +01:00
6lackmag3 7b8f3ea6fa Update strings.xml
added missing strings, reworked translation
2015-11-15 00:35:19 +03:00
Jan Holthuis f5f3332b09 Merge pull request #867 from reicast/fix/issue-848
reicast-joyconfig: Fix crash if button/axis is unnamed
2015-11-14 00:22:22 +01:00
Jan Holthuis 01c7920d1e Merge pull request #860 from philenotfound/master
README: update Linux build dependencies
2015-11-13 15:06:02 +01:00
Phil Eichinger 2e7732aec7 README: update Linux build dependencies
Tested on Debian Jessie
2015-11-13 08:37:41 +01:00
Jan Holthuis 5aed3dffc4 reicast-joyconfig: Fix crash if button/axis is unnamed
This resolves #848.
2015-11-01 14:32:55 +01:00
Jan Holthuis 20d43fb04e SDL: Remove some unused variables 2015-10-11 18:41:23 +02:00
Jan Holthuis 098e208a57 SDL: Drop SDL1.2 support and use SDL2 for GLES, too 2015-10-11 18:41:23 +02:00
Jan Holthuis b38813ca34 SDL: Add OpenGL3/SDL2 support 2015-10-11 18:41:23 +02:00
Jan Holthuis 73a585a135 Merge pull request #849 from sergiobenrocha2/master
Update linux manpages.
2015-10-09 12:19:08 +02:00
sergiobenrocha2 cb69ab4b94 Update linux manpages. 2015-10-08 00:48:11 -03:00
Stefanos Kornilios Mitsis Poiitidis 7d951b7697 rend/if: Logging/verification of MD5(ta command list data)
This allows for some very primitive auto-automated testing, by comparing known good frames.
As this happens on the TA level, it doesn't actually require rendering (and thus it's server friendly)

Two new config entries under the new [testing] namespace control behavior
- ta.HashLogFile, file where data should be logged, empty if not logging
- ta.HashCheckFile, past log to check against, empty if not checking

The emu will crash via verify if the logs don't match, and exit(1) if they do
2015-10-05 23:49:12 +02:00
Stefanos Kornilios Mitsis Poiitidis 915d6b26d6 Merge pull request #837 from reicast/wip/mmu-exceptions
sh4/mmu: C++ exception based sh4 exception support. Won't run wince yet.
2015-09-29 03:34:48 +02:00
Stefanos Kornilios Mitsis Poiitidis d85e4d8dff sh4/mmu: Don't use exceptions when disabled 2015-09-29 03:17:26 +02:00
Stefanos Kornilios Mitsis Poiitidis d99c803a0c sh4/mmu: Typo fixes, less log spam 2015-09-29 03:11:28 +02:00
Stefanos Kornilios Mitsis Poiitidis 4a060b5635 sh4/mmu: C++ exception based sh4 exception support. Won't run wince yet.
- Rewrite mem ops to only modify regs after exception path
- Throw & catch logic for interpreter that raises the exception
- Re-enabled some commented mmu code
2015-09-29 03:11:28 +02:00
Stefanos Kornilios Mitsis Poiitidis 4282395528 apple: Add primitive core audio support
Also made the project xcode 7 friendly
2015-09-29 03:10:19 +02:00
Jan Holthuis 72f51f4f0e Merge pull request #842 from reicast/holzhaus/fix-wercker
Update wercker.yml
2015-09-29 03:06:43 +02:00
Jan Holthuis d44ad7ee59 Update wercker.yml 2015-09-29 03:04:47 +02:00
Stefanos Kornilios Mitsis Poiitidis 543e355259 Merge pull request #826 from reicast/holzhaus/merge-sdl-into-linux-dist
SDL: Merge sdl/ code into linux-dist/ code
2015-09-23 11:42:46 +02:00
Jan Holthuis de29f0da76 Merge pull request #840 from reicast/holzhaus/reicast-joyconfig-error-handling
Linux/reicast-joyconfig: Fix error handling for Python < 3.0
2015-09-22 15:10:34 +02:00
Jan Holthuis d843e0a020 Linux/reicast-joyconfig: Fix error handling for Python < 3.0 2015-09-22 15:09:12 +02:00
Jan Holthuis aefa2e08df Merge pull request #839 from reicast/holzhaus/man-page-fix
Linux/man: Use gdi as example image file
2015-09-22 15:02:27 +02:00
Jan Holthuis e04776caad Linux/man: Add warning about CDI images 2015-09-22 15:01:29 +02:00
Jan Holthuis 175bb68af3 Linux/man: Use gdi as example image file 2015-09-22 14:55:36 +02:00
Stefanos Kornilios Mitsis Poiitidis 1dbc0d73df nixprof: Fix printf, PRI & friends don't exist on android 2015-09-17 01:06:47 +02:00
Jan Holthuis 76dfeae55c SDL: Remove redundant sdl/ code 2015-09-12 16:31:32 +02:00
Stefanos Kornilios Mitsis Poiitidis 56f8ffac0e Merge pull request #807 from randomstuff/nixprof
Nixprof: some enchancements
2015-09-04 19:55:19 +02:00
Gabriel Corona 2a469b1def nixprof: fix notation for Hz 2015-09-03 21:08:39 +02:00
Gabriel Corona 8fc2d5d069 nixprof: only save STT_FUNC 2015-09-03 21:08:35 +02:00
Gabriel Corona ceca8c72bf nixprof: make it work with ELF64 2015-09-03 21:08:29 +02:00
Gabriel Corona c87307162d nixprof: Use sh_type insteaf of sh_name for section identification and use SHT_SYMTAB 2015-09-03 21:08:24 +02:00
Gabriel Corona a34a4d6f38 libelf: get section link for ELF64 2015-09-03 21:08:20 +02:00
Gabriel Corona ad068dcff2 Bind profiling in X11 to F10 2015-09-03 21:08:13 +02:00
Jan Holthuis e9beb86069 Merge pull request #798 from reicast/holzhaus/linux-use-xdg-config-home
Introduce separate config/data dirs (user & system wide)
2015-09-02 16:14:50 +02:00
Jan Holthuis 4267d51f90 stdclass: Make path getter function names more verbose 2015-09-02 15:49:00 +02:00
Jan Holthuis 4bd5154c9f stdclass: Use access to check if file is readable 2015-09-02 15:49:00 +02:00
Jan Holthuis 5f6480e983 linux-dist: Also add /etc/reicast as system config dir 2015-09-02 15:48:59 +02:00
Jan Holthuis b6d0cddcaa stdclass: Add support for separate config/data dirs and system wide dirs
This adds support for separate config and data dirs.

On Linux, these will be compliant XDG Basedir Specification, i.e.
XDG_CONFIG_HOME and XDG_CONFIG_DIRS (or XDG_DATA_HOME and XDG_DATA_DIRS
respectively). On all other platforms, there currently just set to the
homedir path (so no previous behaviour has been changed).

If reicast wants to read and write a data file, it just calls
get_data_path("/samplefile.txt"). If it does not need to write to
that file, it just uses get_data_path("/samplefile.txt", false). That
way, we can also use system-wide dirs (like /usr/share/reicast on
linux), that the user usually doesn't have write access to.

The same applies for config file, where you use get_config_path(args)
respectively.
2015-09-02 15:48:53 +02:00
Stefanos Kornilios Mitsis Poiitidis 3e76175c7a Merge pull request #818 from reicast/feat/import-nulldc-mmu
sh4/mmu: Import the old mmu implementation from nullDC.
2015-09-02 04:46:31 +02:00
Stefanos Kornilios Mitsis Poiitidis 0a6f6f3bde Merge pull request #819 from sergiobenrocha2/master
Added Ubuntu PPA for development version.
2015-09-02 04:30:14 +02:00
Jan Holthuis c24a5faf5b Linux: Use $XDG_CONFIG_HOME if possible
This coommit makes reicast use $XDG_CONFIG_HOME from XDG Base Directory
Specification[1] if possible.

For backwards-compatability with older installations, it checks if the
old-style config directory at $HOME/.reicast exists. If so, it'll use
that instead.

All new installation should use $XDG_CONFIG_HOME/reicast (or if
that environment variable is not set: $HOME/.config/reicast).

[1] http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
2015-08-29 01:05:39 +02:00
Gabriel Corona 4ad6db345b nixprof: make private stuff static 2015-08-28 18:26:41 +02:00
sergiobenrocha2 c87b6fc558 Added Ubuntu PPA for development version. 2015-08-27 14:15:44 -03:00
Stefanos Kornilios Mitsis Poiitidis dcd77326cc sh4/mmu: Import the old mmu implementation from nullDC.
Reicast doesn't support exceptions yet, so this isn't of much use now,
and is intended mostly as documentation. nullDC used some call stack
hooking magic to handle exceptions, which was never generic and clean
enough to be worth the effort to port to Reicast.
2015-08-27 17:05:06 +02:00
Stefanos Kornilios Mitsis Poiitidis 1a751e3b5b xcode: Update projects for libpng 2015-08-27 15:40:12 +02:00
Stefanos Kornilios Mitsis Poiitidis 78f4890535 Merge pull request #791 from sergiobenrocha2/libpng16
Update libpng to 1.6.18.
2015-08-28 13:50:58 +02:00
Jan Holthuis 61a6975601 Merge pull request #822 from reicast/holzhaus/makefile-improvements
linux/Makefile: Fix regession caused by commit dc92124
2015-08-28 04:36:33 +02:00
Jan Holthuis a704b0b46a linux/Makefile: Fix regession caused by commit dc92124 2015-08-28 04:36:06 +02:00
Jan Holthuis 661b3d3538 Merge pull request #817 from reicast/holzhaus/makefile-improvements
Linux/Makefile: Add preliminary NAOMI support
2015-08-28 04:14:25 +02:00
Jan Holthuis dc921249cf Linux/Makefile: Use different folder for NAOMI object files 2015-08-28 04:13:42 +02:00
Jan Holthuis cbb8c11cf4 Merge pull request #821 from reicast/holzhaus/use-escape-to-exit-reicast-in-x11
linux/x11: Map X11 ESC key to exit emulator
2015-08-28 04:08:10 +02:00
Jan Holthuis def93ca4be linux/x11: Map X11 ESC key to exit emulator 2015-08-28 04:06:36 +02:00
Jan Holthuis 826853a0a4 Linux/Makefile: Fix 'uninstall' target 2015-08-27 14:59:46 +02:00
Jan Holthuis a4c475a26c Linux/Makefile: Add preliminary NAOMI support 2015-08-27 14:57:44 +02:00
Jan Holthuis 6ada8179be Merge pull request #816 from reicast/holzhaus/makefile-improvements
Linux/Makefile: Readd .elf file ext and remove it during 'install' target
2015-08-27 14:51:02 +02:00
Jan Holthuis 5ae82b7f4f Linux/Makefile: Readd .elf file ext and remove it during 'install'
target
2015-08-27 14:49:53 +02:00
Jan Holthuis 4fa0119f24 Merge pull request #815 from reicast/holzhaus/improve-man-pages
Improve man pages
2015-08-27 14:46:33 +02:00
Jan Holthuis 60d4ee19ea Linux/Makefile: Add missing commands to 'uninstall' target 2015-08-27 14:44:31 +02:00
Jan Holthuis 402e7eca70 Linux: Add man page for reicast-joyconfig 2015-08-27 14:42:07 +02:00
Stefanos Kornilios Mitsis Poiitidis 223bc3c185 Merge pull request #790 from sergiobenrocha2/master
makefiles: Add a generic linux 32-bit ARM rule.
2015-08-27 14:39:12 +02:00
Jan Holthuis bc4c1ab47c Linux/man page: Add documentation about evdev mappings 2015-08-27 14:15:40 +02:00
Stefanos Kornilios Mitsis Poiitidis 053ea61137 readme: Add link for windows builds 2015-08-27 10:55:07 +02:00
Jan Holthuis 021acb51af linux: Fix typo in Makefile 2015-08-27 00:45:10 +02:00
Jan Holthuis 2456bc9c82 Merge pull request #769 from reicast/holzhaus/evdev-mappings-from-file
Read evdev mappings from file
2015-08-26 20:13:42 +02:00
Stefanos Kornilios Mitsis Poiitidis 2ecb688e40 Merge pull request #811 from reicast/feat/rename-appveyor-artifacts
Appveyor: Deploy to S3
2015-08-26 11:08:19 +02:00
Stefanos Kornilios Mitsis Poiitidis 64942450fb Appveyor: Deploy to S3
- Add S3 credentials, bucket reicast-builds-windows
- Don't split platform with - (win_x86 and win_x64, makes for easier regex)
- Naming consistent with current android builds naming
2015-08-26 09:52:58 +02:00
Jan Holthuis 62029a40b1 linux-dist/joystick: Disable legacy joystick API by default 2015-08-26 01:34:49 +02:00
Jan Holthuis 67b4af8818 linux/Makefile: install mappings to /usr/share/reicast/mappings
Until we have some decent way to load system wide files, users can
easily copy the mappings folder from /usr/share/reicast into ~/.reicast
to get the pre-defined mappings.
2015-08-26 01:31:57 +02:00
Jan Holthuis 382d5db415 linux/Makefile: Add reicast-joyconfig to 'install' target 2015-08-26 01:31:10 +02:00
Jan Holthuis 9b5e997ddc linux-dist/evdev: Use default python version in joyconfig.py 2015-08-26 01:17:45 +02:00
Jan Holthuis 25b8bb5f29 linux-dist/evdev: Move *_inverted in mappings to compat section 2015-08-26 01:11:16 +02:00
Jan Holthuis 7eab958472 linux-dist/evdev: Print error msg if unable to open mapping file 2015-08-25 21:45:39 +02:00
Jan Holthuis c97727984d linux-dist/evdev: Add absolute mapping file path support 2015-08-25 21:45:39 +02:00
Jan Holthuis f46ae2567c linux/reicast-joyconfig: Fix crash if evdev module < v0.4.4 2015-08-25 21:45:39 +02:00
Jan Holthuis 76ce592aa7 linux/reicast-joyconfig: Add exitcodes 2015-08-25 21:45:38 +02:00
Jan Holthuis 760371e1d6 linux/reicast-joyconfig: Add python2 support 2015-08-25 21:45:38 +02:00
Jan Holthuis e3b796e812 linux-dist/evdev: Always show Keycode names if possible 2015-08-25 21:45:38 +02:00
Jan Holthuis cb3b001974 linux: Added python tool to create evdev mappings 2015-08-25 21:45:38 +02:00
Jan Holthuis b12f1fa199 linux-dist/evdev: Remove unecessary newlines 2015-08-25 21:45:38 +02:00
Jan Holthuis 785b819cb9 linux-dist/evdev: Introduce a more consistens button naming scheme 2015-08-25 21:45:38 +02:00
Jan Holthuis ceb2a11441 linux-dist/evdev: Clean up namespace a bit 2015-08-25 21:45:38 +02:00
Jan Holthuis 7018ca42c4 linux-dist/evdev: Make controller axes invertable 2015-08-25 21:45:37 +02:00
Jan Holthuis 72778bdf39 linux-dist/evdev: Replace evdev_keycodes.cpp/.h with dynamic libevdev call 2015-08-25 21:45:37 +02:00
Jan Holthuis e4e7e092c2 linux-dist/evdev: Add controller axis value autoconversion 2015-08-25 21:45:37 +02:00
Jan Holthuis b8716e3008 shell/linux: Add mappings for evdev 2015-08-25 21:45:37 +02:00
Jan Holthuis 528cd5a793 linux-dist: Drop hardcoded mappings in favor of mapping files 2015-08-25 21:45:32 +02:00
Jan Holthuis 5c01098cab linux-dist/evdev: Support custom mapping files 2015-08-25 21:38:18 +02:00
Stefanos Kornilios Mitsis Poiitidis 3eee909801 Merge pull request #767 from reicast/holzhaus/reimplement-cfg-ini-with-maps
cfg: Reimplement ConfigFile using C++ maps and strings
2015-08-25 20:12:12 +02:00
Stefanos Kornilios Mitsis Poiitidis 6b12ffc6b7 Merge pull request #783 from reicast/holzhaus/remove-unneeded-code
linux-dist: Remove unused code
2015-08-25 19:41:39 +02:00
Stefanos Kornilios Mitsis Poiitidis 5bee39a917 Merge pull request #810 from reicast/holzhaus/appveyor-artifacts
AppVeyor: Add build artifacts
2015-08-25 19:38:08 +02:00
Stefanos Kornilios Mitsis Poiitidis 0b19f810b3 appveyor: postfix executables/artifacts with -win- 2015-08-25 19:33:59 +02:00
Jan Holthuis 46e0123ad2 AppVeyor: Add slow modifier to build artifacts to indicate debug builds 2015-08-25 08:42:33 +02:00
Jan Holthuis b6ace44675 AppVeyor: Add build artifacts
We might want to budle the exe with some "Ask Toolbar" installer, since
Windows users might be confused if it's not.
2015-08-25 08:19:16 +02:00
Jan Holthuis 64748409ab linux/desktop-entry: Fix French translation 2015-08-24 18:35:36 +02:00
Jan Holthuis dd311d5380 Merge pull request #806 from reicast/holzhaus/linux-add-desktop-entry
linux/Makefile: Add .desktop entry
2015-08-24 16:45:52 +02:00
Jan Holthuis d3e2114b4c linux/Makefile: Add .desktop entry 2015-08-24 16:44:51 +02:00
Jan Holthuis 85a56bab44 Merge pull request #805 from reicast/holzhaus/improve-man-page
Linux: Improve man page
2015-08-24 16:02:11 +02:00
Jan Holthuis 59de3bbd60 linux/man: Add section about BIOS/Flash ROMs 2015-08-24 16:01:08 +02:00
Jan Holthuis 72af9d5818 linux/man: Improve reicast man page 2015-08-24 15:47:34 +02:00
Jan Holthuis ac37edecee Merge pull request #796 from reicast/holzhaus/linux-make-install
Linux: Add install target to Makefile
2015-08-24 15:19:19 +02:00
Jan Holthuis 1c57c3a1dd Linux: Add simple man page 2015-08-24 15:18:07 +02:00
Jan Holthuis d0c639eb7c cfg/cfg: Also call savecfgf() on cfgSaveInt 2015-08-24 14:48:01 +02:00
Jan Holthuis 42977f8284 cfg/cfg: Fix a nix (add brackets) 2015-08-24 14:46:45 +02:00
Jan Holthuis f56299209d cfg/cfg: Only save config file if has been read or newly created 2015-08-24 14:45:52 +02:00
Stefanos Kornilios Mitsis Poiitidis aa7aa18cab cfg: Create emu.cfg if missing 2015-08-24 14:05:51 +02:00
Stefanos Kornilios Mitsis Poiitidis 2e28e57be8 cfg/ini: Handle empty ini files 2015-08-24 14:04:23 +02:00
Stefanos Kornilios Mitsis Poiitidis 9058d48d51 Merge pull request #804 from reicast/fix/update-xbyak-4860
Fix/update xbyak 4860
2015-08-24 13:54:50 +02:00
Jan Holthuis 99d75220e7 cfg/cfg: Don't save the config immediately after opening. 2015-08-24 13:52:04 +02:00
Jan Holthuis 719850a349 cfg/ini: Use stricmp for get_bool() 2015-08-24 13:52:02 +02:00
Jan Holthuis 42f7919c48 cfg: Add virtual entry support 2015-08-24 13:52:01 +02:00
Jan Holthuis 89e4bf78cc cfg: Fix nit 2015-08-24 13:51:59 +02:00
Jan Holthuis 7a5c90ccca cfg: Reimplement ConfigFile using C++ maps and strings 2015-08-24 13:51:57 +02:00
Stefanos Kornilios Mitsis Poiitidis f065bc5289 Merge pull request #744 from reicast/feat/improved-speed-sync
sync: Also sync to video if too fast
2015-08-24 13:47:51 +02:00
Stefanos Kornilios Mitsis Poiitidis a4186381fb xbyak: Move to deps folder 2015-08-24 13:27:51 +02:00
Stefanos Kornilios Mitsis Poiitidis 4c19f347aa x64/xbyak: Update to 4.86
- Resolves call warnings for clang/gcc
- Overall minor improvements
- Also added copyright file
2015-08-24 13:22:30 +02:00
Stefanos Kornilios Mitsis Poiitidis e1ffc70b84 Merge pull request #803 from reicast/fix/msvc-sln-cfg
msvc: Enable build target for debug/x86
2015-08-24 13:18:42 +02:00
Stefanos Kornilios Mitsis Poiitidis 80c09343e0 msvc: Enable build target for debug/x86 2015-08-24 13:01:12 +02:00
Stefanos Kornilios Mitsis Poiitidis 3315fe7da4 Merge pull request #794 from sergiobenrocha2/zlib
Update zlib to 1.2.8.
2015-08-24 11:09:42 +02:00
Jan Holthuis e466cba3e9 linux-dist: Remove unneeded code 2015-08-23 03:18:27 +02:00
Stefanos Kornilios Mitsis Poiitidis 5fd66a1322 Merge pull request #765 from randomstuff/gdi
Handle .gdi files on the CLI (and other enhancements)
2015-08-22 17:35:08 +02:00
Stefanos Kornilios Mitsis Poiitidis c2ea3934cf Merge pull request #797 from reicast/holzhaus/remove-some-hardcoded-values
nulldc: Remove some hardcoded values
2015-08-22 17:34:18 +02:00
Jan Holthuis 7e854f6544 nulldc: Remove some hardcoded values 2015-08-22 17:24:29 +02:00
Jan Holthuis b6899c555d Linux: Add install target to Makefile 2015-08-22 16:59:17 +02:00
Stefanos Kornilios Mitsis Poiitidis 1611f98191 readme: Move downloads to column on CI table 2015-08-22 09:55:23 +02:00
Jan Holthuis 446f2a4da7 README: Make the build section a table 2015-08-22 04:37:10 +02:00
sergiobenrocha2 225b38dd19 Add optional NEON support in the generic ARMhf rule. 2015-08-21 23:23:16 -03:00
sergiobenrocha2 db19156144 Make ARM generic rule more generic :) 2015-08-21 23:13:50 -03:00
sergiobenrocha2 287a8e1134 Change arm to armv7h in Makefile. 2015-08-21 23:04:28 -03:00
sergiobenrocha2 f44df005c5 Delete zconf.in.h. 2015-08-21 23:01:12 -03:00
sergiobenrocha2 7e0f4fc871 Update zlib to 1.2.8. 2015-08-21 21:36:32 -03:00
Gabriel Corona 5782726346 Better handling of image file extensions in CLI argument processing
* Only match the end the file name
* Case insensitive
* Recognise .gdi files
2015-08-22 02:02:07 +02:00
sergiobenrocha2 da8a572535 Fix header in pngstruct.h 2015-08-21 20:36:28 -03:00
Stefanos Kornilios Mitsis Poiitidis b62a6b3b5a Merge pull request #789 from reicast/feat/appveyor-windows-ci
Appveyor ci, Update sln files to use "x86" instead of "win32"
2015-08-22 01:32:25 +02:00
sergiobenrocha2 b0214d89f6 Update libpng to 1.6.18. 2015-08-21 20:23:16 -03:00
sergiobenrocha2 16c67ddc44 Add a generic 32-bit ARM rule. 2015-08-21 19:57:57 -03:00
Jan Holthuis c0ede35263 Merge pull request #788 from reicast/holzhaus/evdev-raw-keycodes-in-mappings
linux-dist/evdev: Use raw button codes
2015-08-21 19:57:39 +02:00
Stefanos Kornilios Mitsis Poiitidis 4a0dbcdde4 windows/ci: Add appveyor.yml 2015-08-21 18:56:00 +02:00
Stefanos Kornilios Mitsis Poiitidis a604eafc50 Readme: Add more CI badges, improve wording 2015-08-21 18:53:40 +02:00
Stefanos Kornilios Mitsis Poiitidis 2a07c37011 msvc: Update sln files to use "x86" instead of "win32" for appveyor 2015-08-21 18:40:30 +02:00
Jan Holthuis 7b963c941a linux-dist/evdev: Use raw button codes 2015-08-21 15:03:08 +02:00
Jan Holthuis 997ced7900 Merge pull request #787 from reicast/holzhaus/evdev-buffer-overflow-fix
linux-dist/evdev: Fix evdev_config_key buffer overflow
2015-08-21 14:41:07 +02:00
Jan Holthuis e35518aca1 linux-dist/evdev: Fix evdev_config_key buffer overflow
Fixes #785.
2015-08-21 14:39:55 +02:00
Jan Holthuis c733f20325 Merge pull request #784 from reicast/holzhaus/remove-map-file-on-clean
Remove map file on clean
2015-08-21 03:09:56 +02:00
Jan Holthuis 16897f7014 Linux Makefile: Remove EXECUTABLE_STRIPPED file on clean 2015-08-21 03:09:10 +02:00
Jan Holthuis 1a5ef4e023 Linux Makefile: Remove .map file on clean 2015-08-21 03:06:44 +02:00
Jan Holthuis 94012ae192 Merge pull request #782 from reicast/holzhaus/wercker-tests
[Wercker] Add preliminary wercker.yml for Linux_x64 building
2015-08-21 02:40:20 +02:00
Jan Holthuis 2c4eb1847d Merge pull request #774 from reicast/holzhaus/x11-fullscreen-mode
Linux: Enable x11 fullscreen toggling and fix window resizes
2015-08-21 02:35:31 +02:00
Jan Holthuis 71021175df x11: Add some typecasting so that gcc is happy ;-) 2015-08-21 02:29:14 +02:00
Jan Holthuis e404a5201d x11: Get rid of one platform ifdef 2015-08-21 02:16:48 +02:00
Jan Holthuis ac18a59906 x11: Remove unused code 2015-08-21 02:10:31 +02:00
Jan Holthuis 4dee5652ee x11: Allow starting in fullscreen via config 2015-08-21 02:07:03 +02:00
Jan Holthuis f000accbb2 [Wercker] Add preliminary wecker.yml for Linux_x64 building 2015-08-21 01:51:20 +02:00
TwistedUmbrella 73714d16b6 Merge pull request #781 from reicast/xcode_fix
Workaround for missing fp.h header in Xcode
2015-08-20 17:32:31 -04:00
TwistedUmbrella e138cca4b9 Remove internal conditionals to use defined flag 2015-08-20 17:21:47 -04:00
TwistedUmbrella c17486a0ef Workaround for missing fp.h header in Xcode 2015-08-20 17:12:49 -04:00
Jan Holthuis dc6758d847 x11: Use the default x11 display (not always 0) 2015-08-20 17:15:06 +02:00
Stefanos Kornilios Mitsis Poiitidis 9af3618650 Update README.md 2015-08-20 15:56:21 +02:00
Stefanos Kornilios Mitsis Poiitidis f83130b84b Merge pull request #766 from reicast/fix/ios-and-osx
Fix ios and osx (projectfiles, nvmem)
2015-08-19 23:55:20 +02:00
TwistedUmbrella 58cf586012 Merge pull request #777 from reicast/nativeact
Add a missing check for native activity context
2015-08-19 16:42:52 -04:00
TwistedUmbrella 537e1172e0 Add a missing check for native activity context 2015-08-19 16:42:07 -04:00
TwistedUmbrella a4028154f9 Fix to prevent EXC_BAD_ACCESS on iPhone
This is inelegant and should only be temporary but resolves the issue
of CodeCache and ICache “getting lost” during initialization.
2015-08-19 15:33:18 -04:00
Jan Holthuis fc2d1edea9 linux-dist/x11: Enable fullscreen toggling via F11 button 2015-08-19 18:47:42 +02:00
Jan Holthuis 955c9b99a4 Merge pull request #764 from reicast/holzhaus/linux-dist-indentation-fix
linux-dist: indentation fix
2015-08-19 18:38:44 +02:00
Jan Holthuis 6bfa831e5a Merge pull request #752 from reicast/holzhaus/linux-input-overhaul
Linux Input overhaul (Better evdev input & multiplayer support)
2015-08-19 18:37:58 +02:00
Jan Holthuis b0e91185d2 linux-dist: Fix indentation 2015-08-19 12:02:47 +02:00
Jan Holthuis 1661c23680 linux-dist: Fix missing const members in keyboard mapping
On some compiler versions, this caused an error:
../../core/linux-dist/evdev_mappings.cpp:57:3: error: uninitialized
const member ‘s_evdev_controller_mapping::Axis_DPad_X’
../../core/linux-dist/evdev_mappings.cpp:57:3: error: uninitialized
const member ‘s_evdev_controller_mapping::Axis_DPad_Y’
../../core/linux-dist/evdev_mappings.cpp:57:3: error: uninitialized
const member ‘s_evdev_controller_mapping::Axis_DPad2_X’
../../core/linux-dist/evdev_mappings.cpp:57:3: error: uninitialized
const member ‘s_evdev_controller_mapping::Axis_DPad2_Y’
../../core/linux-dist/evdev_mappings.cpp:57:3: error: uninitialized
const member ‘s_evdev_controller_mapping::Axis_Analog_X’
../../core/linux-dist/evdev_mappings.cpp:57:3: error: uninitialized
const member ‘s_evdev_controller_mapping::Axis_Analog_Y’
../../core/linux-dist/evdev_mappings.cpp:57:3: error: uninitialized
const member ‘s_evdev_controller_mapping::Axis_Trigger_Left’
../../core/linux-dist/evdev_mappings.cpp:57:3: error: uninitialized
const member ‘s_evdev_controller_mapping::Axis_Trigger_Right’
2015-08-19 11:59:48 +02:00
Jan Holthuis 223b1284fe linux-dist: Separate xpad and xboxdrv controller mappings 2015-08-19 11:59:48 +02:00
Jan Holthuis 32c3cca681 linux-dist: Fix evdev mapping detection for xboxdrv 2015-08-19 11:59:48 +02:00
Jan Holthuis a408e27cda linux-dist: Don't print EV_MSC events (evdev) 2015-08-19 11:59:48 +02:00
Jan Holthuis 3b2472766d linux-dist: Add evdev keyboard support & option to disable x11 keyboard 2015-08-19 11:59:48 +02:00
Jan Holthuis a2b2b4fd5f linux-dist: Fixed variable reference in Pandora's clean_exit 2015-08-19 11:59:47 +02:00
Jan Holthuis 1843fc3fe4 linux-dist: Move most x11 related code into a separate file 2015-08-19 11:59:47 +02:00
Jan Holthuis 729ded83f6 linux-dist: Move evdev/joystick code into separate files 2015-08-19 11:59:47 +02:00
Jan Holthuis 14ea9e4196 linux-dist: Refactor the evdev input code 2015-08-19 11:59:47 +02:00
Jan Holthuis 452374afab linux-dist: Add evdev multiplayer support 2015-08-19 11:59:47 +02:00
Jan Holthuis 845f101bf0 linux-dist: Add DPad support for xpad kernel driver (XBox 360) 2015-08-19 11:59:47 +02:00
Jan Holthuis 5fe9803743 linux-dist: Improve XBox360 controller support for legacy joystick api 2015-08-19 11:59:47 +02:00
Jan Holthuis 14f77c92d9 linux-dist: Fix bug where trigger values zeroes all the time 2015-08-19 11:59:46 +02:00
Jan Holthuis 275cd3eb73 linux-dist: Add XBox360 controller support via evdev 2015-08-19 11:59:46 +02:00
Jan Holthuis e3fc2cd1b9 linux-dist: Add missing newline in printf calls 2015-08-19 11:59:46 +02:00
Jan Holthuis a49c83b21c linux-dist: Make input devices configurable 2015-08-19 11:59:46 +02:00
Jan Holthuis d76e605aeb linux-dist: Use a switch case in UpdateInputState 2015-08-19 11:59:46 +02:00
Jan Holthuis 73a9269fbd linux-dist: Remove redundant code in input_evdev_handle 2015-08-19 11:59:46 +02:00
Jan Holthuis 87b6a79199 linux-dist: Consolidate evdev/joystick code even further 2015-08-19 11:59:46 +02:00
Jan Holthuis 9dac10ae10 linux-dist: Replace platform ifdefs with USE_EVDEV and USE_JOYSTICK 2015-08-19 11:59:45 +02:00
Jan Holthuis 064b22f237 linux-dist: Harmonize input device fd names 2015-08-19 11:59:45 +02:00
Jan Holthuis 3dc9713262 linux-dist: Move evdev/joystick setup into their own functions 2015-08-19 11:59:45 +02:00
Stefanos Kornilios Mitsis Poiitidis 6137152f49 Merge pull request #771 from reicast/feat/naomi-on-reios
reios/naomi: First baby steps to support booting naomi roms
2015-08-19 01:48:02 +02:00
Stefanos Kornilios Mitsis Poiitidis 4f62b995b6 reios/naomi: First baby steps to support booting naomi roms
- Setups state, copies binary
- Binary locks up w/ a reboot loop

Naomi roms have a 512-byte header, executable length seems to be
at 368 or 3C0. The rom is copied from [0, len) to 0x0c020000.The
bios then hands over control at 0x0c021000
2015-08-19 01:29:46 +02:00
Stefanos Kornilios Mitsis Poiitidis c09cf0b1c6 Merge pull request #770 from reicast/fix/windows-vs-projects
Fix/windows vs projects
2015-08-19 01:21:35 +02:00
Stefanos Kornilios Mitsis Poiitidis c942b2bbcc VisualStudio: Enable Edit&Continue, fix interm. dir 2015-08-19 00:54:33 +02:00
Stefanos Kornilios Mitsis Poiitidis 4a4a304815 VisualStudio: Update project for cfg (#755)
- Add cfg/ini.cpp and cfg/ini.h to the project
2015-08-19 00:51:45 +02:00
Jan Holthuis fd913f0c3d Merge pull request #762 from reicast/holzhaus/makefiles
Makefile: Fix Linux_x86
2015-08-17 20:36:59 +02:00
Jan Holthuis e942feb338 Merge pull request #763 from reicast/holzhaus/update-readme
README: Update 'Building for Linux' section
2015-08-17 20:34:23 +02:00
Jan Holthuis 6500201a38 README: Update 'Building for Linux' section 2015-08-17 20:32:46 +02:00
Jan Holthuis bf84eb3ca8 ARM: Append CFLAGS to ASFLAGS (because gcc is used for AS) 2015-08-17 19:55:17 +02:00
Gabriel Corona 5eaafbc7f0 Fix Linux Makefile
as does not recognize -m32
2015-08-17 19:51:20 +02:00
Stefanos Kornilios Mitsis Poiitidis a90a2cf91c Merge pull request #755 from reicast/holzhaus/cfg-improvements
cfg: Make ConfigFile class reusable
2015-08-17 03:10:07 +02:00
Jan Holthuis e0f00e661b Merge pull request #756 from reicast/holzhaus/update-gitignore
gitignore: Update .map and *.elf paths
2015-08-16 23:46:56 +02:00
Jan Holthuis 6c5575f089 gitignore: Update .map and *.elf paths 2015-08-16 23:46:17 +02:00
Jan Holthuis 509ac93463 cfg: Move ConfigFile classes to ini.cpp/h 2015-08-16 23:35:13 +02:00
Jan Holthuis e4527bf531 cfg: Fix indentation 2015-08-16 23:00:05 +02:00
Jan Holthuis 8744516e52 cfg: Remove redundant code 2015-08-16 21:25:54 +02:00
Jan Holthuis 87f7ca0bb4 cfg: Allow LoadInt to parse hex strings 2015-08-16 21:25:54 +02:00
Jan Holthuis 60e094dbb9 cfg: Make ConfigFile reusable 2015-08-16 21:25:39 +02:00
Jan Holthuis 78091577ea cfg: Move more code into the ConfigFile class 2015-08-16 21:22:25 +02:00
Jan Holthuis f1ec705067 cfg: Move actual file parsing code into ParseFile method 2015-08-16 18:51:44 +02:00
Jan Holthuis 595af1a267 Merge pull request #753 from reicast/holzhaus/small-code-fixes
Fix some compiler warnings
2015-08-15 18:41:06 +02:00
Jan Holthuis 5ab3d7b59b core/hw/sh4/dyna/shil.cpp: Fix '&&' within '||' warning
Here's the original compiler warning:
../../core/hw/sh4/dyna/shil.cpp:700:24: warning: '&&' within '||'
      [-Wlogical-op-parentheses]
  ...if (op->rd.is_reg() && op->rd._reg==reg_sr_T ||  op->op==shop_ifb)
         ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ ~~
../../core/hw/sh4/dyna/shil.cpp:700:24: note: place parentheses around the '&&'
      expression to silence this warning
  ...if (op->rd.is_reg() && op->rd._reg==reg_sr_T ||  op->op==shop_ifb)
                         ^
         (                                       )
../../core/hw/sh4/dyna/shil.cpp:843:25: warning: '&&' within '||'
      [-Wlogical-op-parentheses]
                        if (op->rs1.is_reg() && op->rs1._reg==reg_sr_T
                            ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
../../core/hw/sh4/dyna/shil.cpp:843:25: note: place parentheses around the '&&'
      expression to silence this warning
                        if (op->rs1.is_reg() && op->rs1._reg==reg_sr_T
                                             ^
                            (                                         )
../../core/hw/sh4/dyna/shil.cpp:844:25: warning: '&&' within '||'
      [-Wlogical-op-parentheses]
                                || op->rs2.is_reg() &&
op->rs2._reg==reg_sr_T
                                ~~ ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
../../core/hw/sh4/dyna/shil.cpp:844:25: note: place parentheses around the '&&'
      expression to silence this warning
                                || op->rs2.is_reg() && op->rs2._reg==reg_sr_T
                                                    ^
                                   (                                         )
../../core/hw/sh4/dyna/shil.cpp:845:25: warning: '&&' within '||'
      [-Wlogical-op-parentheses]
                                || op->rs3.is_reg() && op->rs3._reg==reg_sr_T
                                ~~ ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
../../core/hw/sh4/dyna/shil.cpp:845:25: note: place parentheses around the '&&'
      expression to silence this warning
                                || op->rs3.is_reg() && op->rs3._reg==reg_sr_T
                                                    ^
                                   (                                         )
2015-08-15 18:15:50 +02:00
Jan Holthuis 1d0ef81a43 core/hw/sh5/dyna/decoder.cpp: place parentheses around && expression
This compiler warning has been fixed:
../../core/hw/sh4/dyna/decoder.cpp:1181:66: warning: '&&' within '||'
      [-Wlogical-op-parentheses]
  ...|| blk->BlockType==BET_Cond_1 && blk->BranchBlock<=blk->addr)
     ~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../core/hw/sh4/dyna/decoder.cpp:1181:66: note: place parentheses around the
      '&&' expression to silence this warning
  ...|| blk->BlockType==BET_Cond_1 && blk->BranchBlock<=blk->addr)
                                   ^
        (                                                        )
2015-08-15 18:15:50 +02:00
Jan Holthuis 604dcce531 core/hw/holly/sb_mem.cpp: Fix "expression >= 0 is always true" warning
This is the original warning message:
../../core/hw/holly/sb_mem.cpp:219:12: warning: comparison of unsigned
      expression >= 0 is always true [-Wtautological-compare]
        if ((base >=0x0000) && (base <=0x001F) /*&& (addr<=0x001FFFFF)*/...
             ~~~~ ^ ~~~~~~
2015-08-15 18:15:49 +02:00
Jan Holthuis 109a2cce93 rec_x64.cpp: Fix function calls
Resolves #719.
2015-08-15 18:15:49 +02:00
Jan Holthuis f6c167b20b Merge pull request #751 from reicast/holzhaus/fix-linux-dist-formatting
Fix linux-dist/main.cpp formatting
2015-08-15 17:55:55 +02:00
Jan Holthuis 77cac7b0f9 linux-dist: Fix code spacing and alignment 2015-08-15 17:12:48 +02:00
Jan Holthuis 154c92bd59 linux-dist: Remove unnecessary for-loop 2015-08-15 17:12:44 +02:00
TwistedUmbrella 282dde5819 Merge pull request #748 from reicast/loungekatt
Fix path structure and relationships in iOS project
2015-08-14 23:37:46 -04:00
TwistedUmbrella a4a7540055 Fix path structure and relationships in iOS project 2015-08-14 23:16:31 -04:00
TwistedUmbrella e92b04ef01 Merge pull request #747 from reicast/loungekatt
Improve the Github API plugin, Drawer updates
2015-08-14 00:01:29 -04:00
TwistedUmbrella 90b624b081 Proper debug icon, Tile background, Standardize font
Standardize listing text, Reduce Toast text size

The toast was nearly a full screen dialog for one line of text

Differentiate the headings from the list items

Increase transparency of tiled background image

Fix an issue with text size for switch compat
2015-08-13 17:44:28 -04:00
TwistedUmbrella c0f3241bcf Ignore Android warning about useless layouts
This layout keeps the menu from overwriting the first item
2015-08-13 14:58:40 -04:00
TwistedUmbrella 8c8b952434 Replace SlidingDrawer with compatibility DrawerLayout
Remove actionable references (requires v7 overhaul)

Darken background and remove unused views

Fix alignment of pseudo action bar to list
2015-08-13 14:52:17 -04:00
TwistedUmbrella 52b423f42b Add a separate drawer offset for large-screen devices 2015-08-12 10:46:36 -04:00
TwistedUmbrella ab45419ba7 Improve the Github API plugin accessibility 2015-08-12 10:23:08 -04:00
Stefanos Kornilios Mitsis Poiitidis 71c2cb4512 Merge pull request #743 from reicast/feat/nvmem-automatic-fallback
nvmem automatic fallback
2015-08-12 03:59:16 +02:00
Stefanos Kornilios Mitsis Poiitidis 67ecd6d9f9 vmem: Automatic fallback to slowpath if alloc fails
This consolidates some of the work done for TARGET_NO_NVMEM and
feat/no-direct-memmap. If nvmem is disabled at compile time or alloc
fails _nvmem_enabled() will return false. Various other fixes
and cleanups all around.
2015-08-12 03:09:44 +02:00
Stefanos Kornilios Mitsis Poiitidis eeeb2d6a62 texcache: Correctly compute size for STRIDE PLANAR textures 2015-08-12 03:09:44 +02:00
Stefanos Kornilios Mitsis Poiitidis 6724db4f8c shrec/arm: Fix 16M mode lookups. I hate hardcoded consts 2015-08-12 03:05:14 +02:00
TwistedUmbrella d497204d02 Disable turbo mode toggle when synchronous 2015-08-11 20:57:36 -04:00
TwistedUmbrella 9ec657949a Basic Android option to toggle Synchronous Rendering 2015-08-11 20:50:34 -04:00
Jan Holthuis ab33f473b3 linux-dist: Fix indentation and reformat code 2015-08-12 01:57:29 +02:00
Jan Holthuis 025dbd6458 Merge pull request #740 from reicast/fix/some-linux-main-fixes
linux-dist/main.cpp cleanups
2015-08-12 00:31:11 +02:00
Stefanos Kornilios Mitsis Poiitidis 3703b15c3a sync: Also sync to video if too fast
config:pvr.SynchronousRendering controls this feature

Not quite perfect, but should reduce the issues
with too fast hardware
2015-08-11 23:55:51 +02:00
TwistedUmbrella 04ddf64441 Merge pull request #742 from reicast/loungekatt
Remove deprecated log tag from debug
2015-08-11 16:29:03 -04:00
TwistedUmbrella 851acf8518 Remove deprecated log tag from debug
Conflicts:
	shell/android/src/com/reicast/emulator/debug/GenerateLogs.java
2015-08-11 16:15:35 -04:00
Jan Holthuis 5fbfc0fb8b linux-dist: Rely on USES_HOMEDIR for home dir detection
Neither Mac nor Emscripten define USES_HOMEDIR in their Makefiles, so checking
if HOST_OS != OS_DARWIN && !defined(TARGET_EMSCRIPTEN) is pointless.
2015-08-11 21:36:14 +02:00
Jan Holthuis 60c827cf0c linux-dist: Clean up home dir detection 2015-08-11 21:31:57 +02:00
Stefanos Kornilios Mitsis Poiitidis 75e3c441ed Merge pull request #731 from reicast/feat/rename-newdc-reicast
Rename newdc to reicast
2015-08-11 21:01:16 +02:00
Stefanos Kornilios Mitsis Poiitidis 24b721c359 Replace reidc with reicast on logs 2015-08-11 20:52:10 +02:00
TwistedUmbrella 2b027e9897 Update log tags and add new native identifier 2015-08-11 20:52:09 +02:00
Stefanos Kornilios Mitsis Poiitidis 1706027c10 Rename newdc to reicast 2015-08-11 20:52:09 +02:00
Stefanos Kornilios Mitsis Poiitidis 4077941dee Fix a DC_PLATFORM_NORMAL leftover 2015-08-11 20:43:14 +02:00
Jan Holthuis 6808bbba66 linux-dist: Add brackets to else expression 2015-08-11 20:27:51 +02:00
Jan Holthuis 64152635b5 linux-dist: Remove unnecessary if case 2015-08-11 20:20:12 +02:00
TwistedUmbrella a6aab55ebb Merge pull request #739 from reicast/loungekatt
Shorten toast (blocks thread), Remove unused strings
2015-08-11 13:48:00 -04:00
TwistedUmbrella 10ba5d336f Shorten toast (blocks thread), Remove unused strings 2015-08-11 13:37:49 -04:00
Stefanos Kornilios Mitsis Poiitidis 417dfc5d8f Merge pull request #732 from reicast/wip/naomi-support
Naomi support. Enjoy.

To build, edit core/build.h to DC_PLATFORM_NAOMI (or, -D TARGET_NAOMI at the makefile level)
2015-08-11 19:21:00 +02:00
Jan Holthuis 7ec1a12580 Merge pull request #720 from Holzhaus/add-odroid-support
Add ODROID-C1/C1+/X/X2/U2/U3/XU/XU3/XU4 support
2015-08-11 19:16:18 +02:00
Stefanos Kornilios Mitsis Poiitidis ca83428fa5 naomi: Fix linux builds 2015-08-11 19:13:12 +02:00
Stefanos Kornilios Mitsis Poiitidis 13b2c4d8aa naomi: Don't lock vram mirrors if vram isn't mirrored 2015-08-11 19:13:12 +02:00
Stefanos Kornilios Mitsis Poiitidis bfbb01d470 naomi: 32MB-aware block lookups from arm-jit 2015-08-11 19:13:12 +02:00
Stefanos Kornilios Mitsis Poiitidis 0c0008d17b naomi: Pass Dreamcast keycodes to get some kind of input 2015-08-11 19:13:12 +02:00
Stefanos Kornilios Mitsis Poiitidis 7d2cb5a7c0 vmem: Correctly map buffers > 16M
The previous implementation would generate pointers
with the offset doubly-added, pointing to +16M after
the correct address
2015-08-11 19:13:12 +02:00
Stefanos Kornilios Mitsis Poiitidis b77a549bf4 shrec/x86: Fix canonical for reg_ptr prms 2015-08-11 19:13:12 +02:00
Stefanos Kornilios Mitsis Poiitidis 89b9687628 shrec/x86: SIMPLELINK implementation for cross checking 2015-08-11 19:13:12 +02:00
Stefanos Kornilios Mitsis Poiitidis a0175c8011 naomi: Don't spam on DIMM board detection reads. It's disabled for now. 2015-08-11 19:13:12 +02:00
Stefanos Kornilios Mitsis Poiitidis f2d8ed06f5 arm7rec: Increase the emitter guarantee to 64 KB
I run into this with the x86-arm-arm7 backend because of per-block compile and largeish blocks
2015-08-11 19:13:11 +02:00
Stefanos Kornilios Mitsis Poiitidis b53b303c89 naomi: Portability fixes, add posix support
- Replaced BYTE, WORD, DWORD w/ u8, u16 & u32
- mmap/munmap/open

I should wrap the mmap fns in the oslib methinks...
2015-08-11 19:13:11 +02:00
Stefanos Kornilios Mitsis Poiitidis 7feeec0ceb naomi: Refactor cart logic to naomi_cart 2015-08-11 19:13:11 +02:00
Stefanos Kornilios Mitsis Poiitidis 7d0d2ba572 naomi: Initial support for TARGET_NAOMI, windows only
- Import naomi code from nullDC, modify and cleanup
- Only unprotected dimm-board support, custom lst files
- Still a compile option
- Boots naomi bios and some games, no input yet
2015-08-11 19:13:11 +02:00
Stefanos Kornilios Mitsis Poiitidis 9bc0a8ff0f shrec/bm: BM lookup table size follows RAM_SIZE 2015-08-11 19:13:11 +02:00
Stefanos Kornilios Mitsis Poiitidis 365accfde2 windows: fix TARGET_NO_NVMEM 2015-08-11 19:12:20 +02:00
Stefanos Kornilios Mitsis Poiitidis 924241c01a Merge pull request #738 from reicast/fix/android-gles-makefile
android: Fix makefile
2015-08-11 18:48:41 +02:00
Stefanos Kornilios Mitsis Poiitidis 1c7c684937 android: Fix makefile 2015-08-11 18:38:15 +02:00
Jan Holthuis 1ec91c30d8 Add support for ODROID-C1+/X/X2/U2/U3/XU/XU3/XU4 2015-08-11 18:23:39 +02:00
Jan Holthuis 8453016608 Add ODROID-C1 support to Makefile 2015-08-11 18:23:39 +02:00
Stefanos Kornilios Mitsis Poiitidis 6348057402 Merge pull request #705 from Holzhaus/unified-makefiles-all
Merge Makefiles for beagle/pandora/gcwz/rapi2/lincpp into Linux Makefile
2015-08-11 18:19:37 +02:00
Stefanos Kornilios Mitsis Poiitidis 990470e19a linux: Fix input for rpi2 & co 2015-08-11 18:08:06 +02:00
TwistedUmbrella 795e84f3b1 Remove an overlapping ifdef 2015-08-11 12:05:09 -04:00
TwistedUmbrella cf53f3ec22 Fix links to files for relative Xcode paths 2015-08-11 11:44:11 -04:00
Stefanos Kornilios Mitsis Poiitidis c3c2c68f21 Merge pull request #729 from reicast/wip/softrend
Basic and buggy software renderer
2015-08-11 17:43:47 +02:00
Jan Holthuis 961e1c057a Makefile: Only define USE_X11 for x86, x64, linCPP and pandora 2015-08-11 17:43:04 +02:00
Jan Holthuis dd837994af Merge LinCPP Makefile into Linux Makefile 2015-08-11 17:36:16 +02:00
Jan Holthuis 0b505e6857 Makefile: Rename i686 platform to x86 and AMD64 to x64 2015-08-11 17:36:16 +02:00
Jan Holthuis d295bad50b Makefile: Use separate obj directories for each platform 2015-08-11 17:36:16 +02:00
Jan Holthuis 4cb4feba61 core.mk: Replace ifndef DESKTOPGL with ifdef USE_GLES to match Makefile notation 2015-08-11 17:36:16 +02:00
Jan Holthuis 7653f790a0 Makefile: Add CFLAGS to AS calls (in case gcc is used instead of as) 2015-08-11 17:36:16 +02:00
Jan Holthuis 752c136910 Allow overriding compilers for specific platforms
The Raspberry Pi 2 seems to need `gcc` instead of `as` as ${AS}
2015-08-11 17:36:15 +02:00
Jan Holthuis f96ec5ff89 Remove FOR_ARM definition in Makefile 2015-08-11 17:36:15 +02:00
Jan Holthuis 91338761d6 Makefile: Fix Whitespace 2015-08-11 17:36:15 +02:00
Jan Holthuis a090eba78c Don't include CFLAGS/MFLAGS in CXXFLAGS 2015-08-11 17:36:15 +02:00
Jan Holthuis 93355dd533 Merge gcwz into Linux Makefile 2015-08-11 17:36:15 +02:00
Jan Holthuis fe48f04f78 Separate platform auto-detection code in Makefile 2015-08-11 17:36:15 +02:00
Jan Holthuis bb1bf000fd Merge beagle/pandora/rapi2 Makefiles into Linux Makefile 2015-08-11 17:36:14 +02:00
Stefanos Kornilios Mitsis Poiitidis 91039911ce softrend/gltex: Fix non-windows builds
_mm* are windows only, and so is softrend for now
2015-08-11 16:12:18 +02:00
TwistedUmbrella 12c1fb7a57 Merge pull request #734 from reicast/loungekatt
Cleanup leftovers from platform move
2015-08-11 08:22:02 -04:00
TwistedUmbrella 6358222a0b Cleanup leftovers from platform move 2015-08-11 08:20:47 -04:00
TwistedUmbrella 6487109507 Merge pull request #730 from reicast/wip/osx-support
OSX support
2015-08-11 08:16:46 -04:00
Stefanos Kornilios Mitsis Poiitidis 1908ade464 Update context.h 2015-08-11 08:05:09 -04:00
TwistedUmbrella cdec92d36c Rebuild iOS project paths for new location 2015-08-11 08:05:09 -04:00
Stefanos Kornilios Mitsis Poiitidis c60fca4973 sh4: Cleanup SetFloatStatusReg a bit 2015-08-11 07:57:23 -04:00
Stefanos Kornilios Mitsis Poiitidis cda7036ef1 apple: moving around xcode files 2015-08-11 07:57:23 -04:00
Stefanos Kornilios Mitsis Poiitidis 4f9ff3fc3f OSX: Fix release build 2015-08-11 07:57:22 -04:00
Stefanos Kornilios Mitsis Poiitidis 45f0a47eec OSX: Basic keyboard input 2015-08-11 07:57:22 -04:00
Stefanos Kornilios Mitsis Poiitidis 5d46b77387 OSX: How about initializing opengl before using it? 2015-08-11 07:57:22 -04:00
Stefanos Kornilios Mitsis Poiitidis 26cfcd79e9 OSX: Fiddling to get the rec-cpp/noexcept path running 2015-08-11 07:57:22 -04:00
Stefanos Kornilios Mitsis Poiitidis dfc341a5fe softrend: OpenMP support, fix present overflow during untiling
- Uses vertical slicing
- Efficiency wins are best for 2-3 rendering threads
2015-08-11 00:26:02 -04:00
Stefanos Kornilios Mitsis Poiitidis 19fa2f1678 softrend: Limits on #defines, scissor area as rect 2015-08-11 00:26:02 -04:00
Stefanos Kornilios Mitsis Poiitidis 3e9431b2b7 softrend: billinear filtering, perspective uv, alpha test, ARGB1555
- Texture pixels are predecoded and expanded to quads for filtering
- bilinear input ordering might be wrong
2015-08-11 00:26:02 -04:00
Stefanos Kornilios Mitsis Poiitidis e3845465f0 win64/jit: Generate unwind table for the jit code cache
This required moving the SH4_TCB outside the exe, as new tables that belong on the executable are ignored.
This isn't perfect, but there's a large area to scan for available address space so it shouldn't be a problem
2015-08-11 00:26:02 -04:00
Stefanos Kornilios Mitsis Poiitidis e6a9d3e661 softrend: Resembling a pixel pipeline, textures, sort, cull
- Basic pixel pipeline, a bit better triangle tests, specialized render handlers
- Textures w/ point filtering. Not very smart is it goes 32 -> 16 -> 32 bpp, but works.
- The texture cache is shared rather inelegantly w/ OpenGL one
- Culling
- PParam sorting (shared w/ GL)

The texturing and color blending paths are ugly and slow
2015-08-11 00:26:02 -04:00
Stefanos Kornilios Mitsis Poiitidis fcf273dd11 softrend: Add support for culling 2015-08-11 00:26:02 -04:00
Stefanos Kornilios Mitsis Poiitidis bedd2db7b6 softrend: WIP floating interpolation to handle big numbers
Still not 100% correct pixel fill
2015-08-11 00:26:02 -04:00
TwistedUmbrella b12055f7c0 Merge pull request #721 from reicast/loungekatt
Convert third-party source to library (avoid license conflict)
2015-08-11 00:23:55 -04:00
TwistedUmbrella 8a23dc4dec Merge pull request #733 from reicast/config-cleanup
Fix BIOS locator, improve search results
2015-08-11 00:22:17 -04:00
TwistedUmbrella 1d1bd5a92f Exploit file specifications to shorten results 2015-08-10 23:56:04 -04:00
TwistedUmbrella 291812ba72 Send updated folder to options after verification 2015-08-10 23:49:55 -04:00
TwistedUmbrella 37625778e5 Increase the search depth slightly
This will account for storing games in a second-tier folder, such as
putting bins in one directory and chd in another with each game having
it’s own folder for bin and cue.
The BIOS search should handle 4 levels to account for the use of
/Android/data/com.reicast.emulator/files but should also ignore
directories, such as cache and obb, where the file will never be.
2015-08-10 23:49:49 -04:00
TwistedUmbrella 0f4afb29c3 Resolve an Xcode whitespace tragedy 2015-08-10 22:41:28 -04:00
TwistedUmbrella 83d525d0f9 Verify "flist" is not null before sort / add 2015-08-10 22:25:45 -04:00
Stefanos Kornilios Mitsis Poiitidis ff1b466116 xcode: limit to armv7 2015-08-10 15:05:29 +02:00
Stefanos Kornilios Mitsis Poiitidis 7dd17a4175 xcode: move shared schemes on the workspace 2015-08-10 14:49:59 +02:00
Stefanos Kornilios Mitsis Poiitidis 8faef19c3f Apple: fix disabled nvmem blockmgr path, add printfs, clean xcode files 2015-08-10 03:02:59 +02:00
TwistedUmbrella bf75c95ae8 Update project for #755 and fix warnings 2015-08-17 07:59:39 -04:00
Stefanos Kornilios Mitsis Poiitidis 8de800497e windows: Don't call InitAudio from os_CreateWindow
Huh, why was this call even there?
2015-08-09 01:48:41 +02:00
TwistedUmbrella 95b39b885a Fix iPhone build and import GameController / iCade 2015-08-07 16:17:28 -04:00
TwistedUmbrella 7b30fe6109 Move third-party to top level, sync with originals 2015-08-07 16:08:59 -04:00
TwistedUmbrella 4d9b151322 Convert third-party source to library (avoid license conflict) 2015-08-07 16:08:59 -04:00
Stefanos Kornilios Mitsis Poiitidis b4b04ea75f pvr/softrend: Implement basic alpha blending 2015-08-05 08:19:50 +02:00
Stefanos Kornilios Mitsis Poiitidis c094da0880 Merge pull request #728 from reicast/feat/x64-all-blockends
Feat/x64 all blockends
2015-08-05 05:09:27 +02:00
Stefanos Kornilios Mitsis Poiitidis 6beec6824d msvc: Separate target names, better split imm directories
Now different builds don't delete or collide with each other
2015-08-05 05:01:08 +02:00
Stefanos Kornilios Mitsis Poiitidis 4aaff464b3 shrec/jitx64: Implement all block ends
This is still minimal and doesn't do any linking or other smart stuff
Also fixed a bug on shop_jdyn
2015-08-05 05:00:01 +02:00
Stefanos Kornilios Mitsis Poiitidis f2f9a041e1 Merge pull request #727 from reicast/wip/import-drkpvr-softrend
rend/soft: Import the experimental core from nulldc/drkpvr, modularize
2015-08-05 04:25:06 +02:00
Stefanos Kornilios Mitsis Poiitidis 8cce1a4976 rend/soft: Import the experimental core from nulldc/drkpvr, better renderer modularization
- Adapted for indexed, async rendering, shared ta decoder
- This blits via a quick-and-hacky GDI blitter for now
- SSE/MMX intrins based, so not very portable
- A rather not good "reference" implementation
- At least, it's not terribly slow though
- GetTexture moved to Renderer interface
2015-08-05 02:43:40 +02:00
Stefanos Kornilios Mitsis Poiitidis 0343feffa6 Merge pull request #714 from reicast/wip/nacl-and-emscripten
NaCL & Emscripten targets

- CPU_GENERIC
- TARGET_NO_THREADS
- TARGET_NO_NIXPROF
- TARGET_NO_EXCEPTIONS
- TARGET_NO_NVMEM
- TARGET_BOUNDED_EXECUTION
- TARGET_NO_COREIO_HTTP
2015-08-03 11:28:29 +02:00
Stefanos Kornilios Mitsis Poiitidis c10180b987 Merge pull request #722 from reicast/fix/disable-shil-asmfn
shil: Disable external assembly implementations
2015-08-03 11:17:02 +02:00
Stefanos Kornilios Mitsis Poiitidis 7e51e13efc build: Add FEAT_HAS_COREIO_HTTP, update nacl/emscripten makefiles 2015-08-03 11:14:27 +02:00
Stefanos Kornilios Mitsis Poiitidis 2beb23978b rec-cpp: Fix non-emscripten build 2015-08-03 11:12:24 +02:00
Stefanos Kornilios Mitsis Poiitidis 61394d7a44 shil: Disable external assembly implementations
Using external function pointers is broken after the rec-cpp structural changes,
and relatively low priority so disabled for now.

Fixes builds on arm, non-android (see #720)
2015-08-03 10:41:34 +02:00
Stefanos Kornilios Mitsis Poiitidis ac6bdddae3 Merge pull request #694 from randomstuff/cleanup
Minor Cleanup
2015-08-03 00:09:11 +02:00
Gabriel Corona 8c68f4a06b Fix a 'permissive' warning 2015-07-31 20:37:39 +02:00
Gabriel Corona 9ff72a731f Remove function declaration in the middle of a function 2015-07-31 20:32:11 +02:00
Gabriel Corona 221ba4c22d s/cfgSetVitual/cfgSetVirtual 2015-07-31 20:32:06 +02:00
Stefanos Kornilios Mitsis Poiitidis d8ccc9d2e7 emscripten: More rec-cpp progress
It almost builds now, except emscripten randomly gives up and crashes. No one likes my code these days...
2015-07-29 06:45:02 +02:00
Stefanos Kornilios Mitsis Poiitidis 0153145950 emscripten: Fix build 2015-07-29 06:22:59 +02:00
Stefanos Kornilios Mitsis Poiitidis 289aa393c0 nacl: fixing affected android build 2015-07-29 05:17:16 +02:00
Stefanos Kornilios Mitsis Poiitidis 17a4af378c nacl: Post-merge cleanups 2015-07-29 04:58:41 +02:00
Stefanos Kornilios Mitsis Poiitidis b6c8a1c3cc nacl: Log to console.log 2015-07-29 04:30:31 +02:00
Stefanos Kornilios Mitsis Poiitidis 373cb6e24e nacl: Working towards GLES2. Will init, shaders won't compile 2015-07-29 04:30:21 +02:00
Stefanos Kornilios Mitsis Poiitidis 057b1075b6 ta/mt: add rend_framePending? for better mt sync from clients 2015-07-29 04:28:27 +02:00
~skmp 0b29889b02 nacl: nacl_lin target, to simulate nacl build under linux. Debugger friendly 2015-07-29 04:28:13 +02:00
~skmp 2d9fbdda40 nacl: Fix sqw_nommu to work w/ non-linear nvmem allocation 2015-07-29 04:27:32 +02:00
Stefanos Kornilios Mitsis Poiitidis b9bbb5c0c8 nacl: Work towards rec-cpp 2015-07-29 04:26:50 +02:00
Stefanos Kornilios Mitsis Poiitidis c33773ee37 nacl: Update makefile 2015-07-29 04:22:42 +02:00
Stefanos Kornilios Mitsis Poiitidis 4f86496773 linux/common: Stub out LockRegion/UnLockRegion when TARGET_NO_EXCEPTIONS 2015-07-29 04:21:54 +02:00
Stefanos Kornilios Mitsis Poiitidis 255d1bdb42 nacl: Stub out LockRegion/UnLockRegion as no mprotect logic 2015-07-29 04:19:12 +02:00
Stefanos Kornilios Mitsis Poiitidis d0674b3cdd nacl: Use nacl_io, emulation on background thread, print speed stats 2015-07-29 04:18:36 +02:00
Stefanos Kornilios Mitsis Poiitidis 341475f778 nacl: Redirect printf/puts, basic html loader 2015-07-29 04:17:49 +02:00
Stefanos Kornilios Mitsis Poiitidis 2eb9d7908f A first hackthrough to get nacl compiling working 2015-07-29 04:17:31 +02:00
~skmp 718cace9a7 emscripten: Fix chrome & firefox OOM by enabling opts
Looks like the JITs get kind of crazy and eat up all ram otherwise
2015-07-29 04:08:08 +02:00
~skmp 376a36bf57 Emscripten: Hacky support, can boot bios
- Add TARGET_BOUNDED_EXECUTION, TARGET_EMSCRIPTEN
- Add emscripten makefile

Of course, there's no jit at this point
2015-07-29 04:08:08 +02:00
~skmp a2831d67a0 vmem/alloc: TARGET_NO_NVMEM to not use page tricks
This combined with various other configs avoid segfault/pagefaults usage
2015-07-29 04:08:07 +02:00
~skmp 59c6012db2 pvr/rend_if: TARGET_NO_THREADS support 2015-07-29 04:08:06 +02:00
Stefanos Kornilios Mitsis Poiitidis c8f982b8f5 linux-common: TARGET_NO_EXCEPTIONS, TARGET_NO_THREADS 2015-07-29 04:08:05 +02:00
~skmp 518c547fb5 nixprof: move to its own module, TARGET_NO_NIXPROF, NO_NIXPROF 2015-07-29 04:08:04 +02:00
~skmp b1a55aba3f ta_parser: use uniform function signatures for Append* callbacks
- Fixes emscripten build & makes more sense overall
2015-07-29 04:08:03 +02:00
Stefanos Kornilios Mitsis Poiitidis 4b94e2fe37 Merge pull request #713 from reicast/feat/small-cleanups
Feat/small cleanups
2015-07-29 04:07:46 +02:00
Stefanos Kornilios Mitsis Poiitidis 2347b95bf2 aica/sgc: fix update_rate warning 2015-07-29 03:26:58 +02:00
Stefanos Kornilios Mitsis Poiitidis a28209cae2 deps/sha256: memset is in string.h, not memory.h 2015-07-29 03:26:08 +02:00
Stefanos Kornilios Mitsis Poiitidis 6ebaa74ffe core.mk: Only android needs deps/libzip/ right now 2015-07-29 03:24:51 +02:00
Stefanos Kornilios Mitsis Poiitidis 30229f6724 cl: Fix const warning 2015-07-29 03:23:08 +02:00
Stefanos Kornilios Mitsis Poiitidis 75fd698695 Merge pull request #701 from reicast/feat/rec-cpp
Initial implementation of a "dynarec-structured" cached shop interpreter
2015-07-29 02:43:51 +02:00
Stefanos Kornilios Mitsis Poiitidis a82f9704d6 shrec: Limit max blocksize to 511 shops 2015-07-29 02:29:16 +02:00
~skmp f1a6f04dce rec-cpp: verify() that we have an executer w/ shop_count 2015-07-29 02:29:07 +02:00
Stefanos Kornilios Mitsis Poiitidis ec5bb09917 rec-cpp: Add sig aCaCcCdC for mul_u64, mul_s64 2015-07-29 02:28:52 +02:00
~skmp 5b67e3f090 rec-cpp: SH4_TCB doesn't need to be in .text if not executable 2015-07-29 02:28:39 +02:00
Stefanos Kornilios Mitsis Poiitidis 1e0224dd1b rec-cpp: Add sig aCaCcCdC for rocl, rocr 2015-07-29 02:28:29 +02:00
TwistedUmbrella a3f66be3ce Merge pull request #704 from AbandonedCart/loungekatt
XMLParser and GLES 3 cleanup
2015-07-28 20:20:53 -04:00
Stefanos Kornilios Mitsis Poiitidis 51ab5ab664 Merge pull request #695 from randomstuff/cmake
cmake build (currently Linux only)
2015-07-29 01:51:41 +02:00
Stefanos Kornilios Mitsis Poiitidis 7de36d56ec Merge pull request #712 from reicast/feat/imgread-readmiss-with-sector
imgread/common: On read error, print the sector that failed
2015-07-29 00:49:21 +02:00
~skmp 39e1439b93 imgread/common: On read error, print the sector that failed 2015-07-29 00:41:14 +02:00
Stefanos Kornilios Mitsis Poiitidis fb6d0a0166 Merge pull request #710 from reicast/feat/vmu-safer-creation
maple: Gracefully fail if vmu cannot be written
2015-07-29 00:03:00 +02:00
Stefanos Kornilios Mitsis Poiitidis 5010cf3f23 Merge pull request #709 from reicast/feat/audio-spams-nomore
Audiostream: Don't log on every push if audio is disabled
2015-07-29 00:02:30 +02:00
Stefanos Kornilios Mitsis Poiitidis 83d3abf266 maple: Gracefully fail if vmu cannot be written 2015-07-28 23:54:50 +02:00
Stefanos Kornilios Mitsis Poiitidis f62d532b78 Audiostream: Don't log on every push if audio is disabled
There is an initialization warning which is enough to warn users
2015-07-28 23:52:48 +02:00
Gabriel Corona 2fe5f8b22d Experimental cmake build (currently Linux only) 2015-07-28 23:38:40 +02:00
Stefanos Kornilios Mitsis Poiitidis d3c3feb523 Merge pull request #703 from Holzhaus/unified-makefiles
Unified Linux makefiles (x86/x64)
2015-07-27 23:56:56 +02:00
Stefanos Kornilios Mitsis Poiitidis 7d282d9861 Merge pull request #644 from Holzhaus/fix-gcc-warnings
Fix gcc warnings
2015-07-27 20:20:55 +02:00
Jan Holthuis 3faf51c6ce Removed mode variable in print_mem_addr()
This removes the mode variable in core/linux/common.cpp's
print_mem_addr(). It not neccessary and produces compiler warnings.
2015-07-27 19:12:28 +02:00
Jan Holthuis 9e00305c90 Fix anonymous struct/union linkage errors in gdromv3.cpp
Since read_params, packet_cmd, read_buff, pio_buff, ata_cmd, cdda and
ByteCount have not been declared static, they are visible in other
translation units. Since their structs are anonymous, their types have
internal linkage only. Thus, accessing them in other translations units
is impossible anyway.

By declaring them static, we're giving it internal linkage so that
neither the type nor the variable are visible in other translation
units.

Here are the errors:

../../core/hw/gdrom/gdromv3.cpp:50:3: warning: anonymous type with no
linkage used to declare variable '<anonymous struct> read_params' with
linkage
 } read_params;
   ^
../../core/hw/gdrom/gdromv3.cpp:83:3: warning: anonymous type with no
linkage used to declare variable '<anonymous struct> packet_cmd' with
linkage
 } packet_cmd;
   ^
../../core/hw/gdrom/gdromv3.cpp:91:3: warning: anonymous type with no
linkage used to declare variable '<anonymous struct> read_buff' with
linkage
 } read_buff;
   ^
../../core/hw/gdrom/gdromv3.cpp:100:3: warning: anonymous type with no
linkage used to declare variable '<anonymous struct> pio_buff' with
linkage
 } pio_buff;
   ^
../../core/hw/gdrom/gdromv3.cpp:106:3: warning: anonymous type with no
linkage used to declare variable '<anonymous struct> ata_cmd' with
linkage
 } ata_cmd;
   ^
../../core/hw/gdrom/gdromv3.cpp:122:3: warning: anonymous type with no
linkage used to declare variable '<anonymous struct> cdda' with linkage
 } cdda;
   ^
../../core/hw/gdrom/gdromv3.cpp:156:4: warning: anonymous type with no
linkage used to declare variable '<anonymous union> ByteCount' with
linkage
  } ByteCount;
    ^
2015-07-27 19:08:35 +02:00
Jan Holthuis c43333e502 [Linux] Make X11 optional 2015-07-27 18:24:59 +02:00
Jan Holthuis 23891b8dd7 Makefile: Print ARCH variable 2015-07-27 18:24:22 +02:00
Jan Holthuis 3a12a11cfc Makefile: dont use tab indent for non-commands 2015-07-27 18:24:22 +02:00
Jan Holthuis 7fc54fa214 Merge lin86/lin64 Makefiles to linux/Makefile 2015-07-27 18:23:48 +02:00
TwistedUmbrella 62ea812a08 Streamline populating the view with XML data 2015-07-26 22:41:57 -04:00
TwistedUmbrella 824b528e4f Clear images when disabled, Clean up XMLParser 2015-07-26 22:01:24 -04:00
TwistedUmbrella d50620bf3f Add support for TheGamesDB elastic search API 2015-07-26 22:01:15 -04:00
Jan Holthuis 57662482e0 Replace HOST_NO_AREC with TARGET_NO_AREC in Linux Makefiles 2015-07-26 16:52:59 +02:00
Jan Holthuis fdd8e4239a Harmonize Linux x86/x64 Makefiles 2015-07-26 16:12:16 +02:00
Stefanos Kornilios Mitsis Poiitidis 4b97f468b5 rec-cpp: Implement block ends and a few more decoders
- Full IL mode now works!
- Dispatch up to 270 mips on 2.2ghz i7, on a complex 3d scene
- Will run many games fullspeed on modern pc, thanks to idleskip
2015-07-25 20:38:48 +02:00
Stefanos Kornilios Mitsis Poiitidis fb55e7f6f8 sh4/canonical: Provide impls for sync_sr and sync_fpscr
This shouldn't be a requirement as directly using shil_cf_ext should work,
but for some reason if I don't msvc optimizes the functions out.
2015-07-25 20:36:06 +02:00
Stefanos Kornilios Mitsis Poiitidis cbda836a96 she/core: Less stupid register swap functions 2015-07-25 20:33:53 +02:00
TwistedUmbrella 14d29d9670 Add caching of image files for disk info 2015-07-25 13:14:59 -04:00
TwistedUmbrella 7bd709460a Properly test and set client version in EGL3 factory 2015-07-25 13:14:59 -04:00
Stefanos Kornilios Mitsis Poiitidis b1f7015a98 rec/cpp: Mostly fully direct specialized dispatchers
- Nest shil implementations to shilop_##name::form::impl for easier template matching
- Add more direct handlers
- Add prints if a direct handler isn't found
- Remove multiple indirect handlers, leave them for fallback
2015-07-25 14:36:04 +02:00
Stefanos Kornilios Mitsis Poiitidis 51a6ed2146 rec/all: optional mips counter on recs
Also de-unroll rec-cpp for debug builds
2015-07-25 14:31:46 +02:00
Stefanos Kornilios Mitsis Poiitidis 00dbd6222f rec-cpp: Massage for gcc compatibility 2015-07-25 14:25:51 +02:00
Stefanos Kornilios Mitsis Poiitidis 1710f76ab1 unroll the execution loop 2015-07-25 14:24:11 +02:00
Stefanos Kornilios Mitsis Poiitidis 7303a046be rec-cpp: Direct calls to shil_opcl_* handlers for many opcodes 2015-07-25 14:23:59 +02:00
Stefanos Kornilios Mitsis Poiitidis 39e369411c shil/canonical: Fix decls, comment 2015-07-25 14:23:45 +02:00
Stefanos Kornilios Mitsis Poiitidis e4138f9a60 rec-cpp: Wastefully generate more dispatchers for better BTB cache locality
The real solution is to have inlining between the (now static) dispatchers and the impls.
It's gonna be hard to convince the compiler on that.
2015-07-25 14:23:07 +02:00
Stefanos Kornilios Mitsis Poiitidis fc01428c30 rec-cpp: Force resets when running out of blocks 2015-07-25 14:22:28 +02:00
Stefanos Kornilios Mitsis Poiitidis bfef969626 rec-cpp: Implement stuff up to the corejit layer 2015-07-25 14:21:53 +02:00
Stefanos Kornilios Mitsis Poiitidis cd80850acb First idea for a fully portable "jit" 2015-07-25 14:20:54 +02:00
Stefanos Kornilios Mitsis Poiitidis 39ead6159b Merge pull request #699 from reicast/feat/build-defines-cleanup
(Imma merge this, as it's needed for rec-cpp work, but that doesn't mean the discussion is closed)
2015-07-25 14:03:35 +02:00
Stefanos Kornilios Mitsis Poiitidis 6dedc01a53 Merge pull request #700 from reicast/feat/better-windows-keymap
shell/windows: Move taskip, swap to F1,2,10 from '1', '2', '0'
2015-07-25 13:30:01 +02:00
Stefanos Kornilios Mitsis Poiitidis a4a427feea shell/windows: Move taskip, swap to F1,2,10 from '1', '2', '0' 2015-07-25 13:28:57 +02:00
Stefanos Kornilios Mitsis Poiitidis 58d4a55696 build: fix makefiles 2015-07-25 13:19:38 +02:00
Stefanos Kornilios Mitsis Poiitidis 9cf9bacd13 build: Refactor HOST_NO_REC everywhere 2015-07-25 13:19:26 +02:00
Stefanos Kornilios Mitsis Poiitidis a9c76351f6 build: Draft & cleanup, refactor rec* options 2015-07-25 13:17:42 +02:00
TwistedUmbrella edcfe505ec Merge pull request #697 from AbandonedCart/loungekatt
Fix a mismatched log tag
2015-07-24 11:31:54 -04:00
TwistedUmbrella 2f4dd06149 Fix a mismatched log tag 2015-07-24 11:30:41 -04:00
TwistedUmbrella 4cc561dc0c Merge pull request #690 from AbandonedCart/loungekatt
Improve Android UI and navigation
2015-07-23 23:32:09 -04:00
TwistedUmbrella 0fb51735da Update iOS project, Add support for iOS define 2015-07-23 23:30:35 -04:00
TwistedUmbrella e5c263d40a Fix a duplicate button declaration 2015-07-22 23:07:24 -04:00
TwistedUmbrella 7fecd6ba43 Check for null game info and catch all exceptions 2015-07-22 23:07:23 -04:00
TwistedUmbrella f21e9382d2 Update API-related code and reduce global vars 2015-07-22 23:07:23 -04:00
TwistedUmbrella 40c244a6ee Clean up game info option and move to long click 2015-07-22 23:07:23 -04:00
TwistedUmbrella 627d5eb301 Permission aware file browsing, Restore menu size
Since the BIOS cannot be stored on external storage, there is
absolutely no reason to begin a search from that folder.

It makes more sense to start from a user-defined folder than the
default simply because an external card exists. A check has been added
to see if the preference is a default.
2015-07-22 23:07:23 -04:00
TwistedUmbrella 70b93b4d86 Remove an extraneous log when loading lists 2015-07-22 23:07:23 -04:00
TwistedUmbrella 859a706295 Clear directory preferences when changing path
Also includes transition to the static reference keys.
2015-07-22 23:07:23 -04:00
TwistedUmbrella 19b8dbe218 Prevent exploring root paths, Improve UI visibility
Divide the heading and games listings to allow an easier identification
of what is a menu item and what is a menu heading.
2015-07-22 23:07:23 -04:00
TwistedUmbrella c8600bb6cf Flexible name check for game identification 2015-07-22 23:07:23 -04:00
TwistedUmbrella 40e8210a7e Set a popup background to allow onKey events 2015-07-22 23:07:23 -04:00
TwistedUmbrella 416c4273d3 Close all open popups from hardware key press 2015-07-22 23:07:23 -04:00
Stefanos Kornilios Mitsis Poiitidis 67a8ceabdd shil/param: add imm_value() 2015-07-23 02:08:25 +02:00
Stefanos Kornilios Mitsis Poiitidis 5b92793c42 Merge branch 'feat/jit-x64' 2015-07-21 16:10:11 +02:00
Stefanos Kornilios Mitsis Poiitidis e9d3ff8b41 Update .gitignore for lin64 2015-07-21 16:05:47 +02:00
Stefanos Kornilios Mitsis Poiitidis 19535cc34d vmem: Remove some useless/dead code 2015-07-21 16:04:22 +02:00
Stefanos Kornilios Mitsis Poiitidis 77befe9439 Linux/desktop: Cleanup makefiles 2015-07-21 16:03:46 +02:00
Stefanos Kornilios Mitsis Poiitidis e90b17c99a Merge pull request #693 from reicast/feat/jit-x64
Basic x64 corejit for sh4
2015-07-21 15:47:54 +02:00
Stefanos Kornilios Mitsis Poiitidis 1aa01dbc63 sigsegv: Change print handler to use %p for pointers 2015-07-21 15:42:48 +02:00
Stefanos Kornilios Mitsis Poiitidis 82ef7d0754 jitx64: 16KBs of emit space are guaranteed, not 64 2015-07-21 15:42:10 +02:00
Stefanos Kornilios Mitsis Poiitidis 0a3fcfe4ac jit-x64: typofix on shop_writem, WriteMem64 2015-07-21 14:48:37 +02:00
Stefanos Kornilios Mitsis Poiitidis b056cf6cef Implement jitcore opset for x64
Now mov64, readm, writem, in addition to jittiny ifb, jdyn, mov32
2015-07-14 20:17:45 +02:00
Stefanos Kornilios Mitsis Poiitidis 1125f25eae Fix win86 build 2015-07-14 17:47:54 +02:00
Stefanos Kornilios Mitsis Poiitidis f3c8e3623d Fix HOST_CPU for x64 windows 2015-07-14 17:31:48 +02:00
Stefanos Kornilios Mitsis Poiitidis 8cb6d6578c Count cycles correctly 2015-07-14 17:23:02 +02:00
Stefanos Kornilios Mitsis Poiitidis e50cfe3010 x64 tinyjit: linux support 2015-07-14 03:35:34 +02:00
Stefanos Kornilios Mitsis Poiitidis 3852cf9ac8 Minimal x64 jit: Desync'd, but runs 2015-07-13 23:56:42 +02:00
Stefanos Kornilios Mitsis Poiitidis b385575d6f Get x64 building 2015-07-13 21:13:51 +02:00
TwistedUmbrella 115ee47efc Prevent log overlap when loading button.png 2015-07-08 10:21:26 +02:00
Stefanos Kornilios Mitsis Poiitidis def91fdc84 Remove personality fix for android 2015-07-08 10:15:37 +02:00
Stefanos Kornilios Mitsis Poiitidis 043d9004a0 Merge rapi2 to master 2015-07-07 16:20:14 +02:00
Stefanos Kornilios Mitsis Poiitidis 3f36e98f90 Linux: Make sure personality isn't READ_IMPLIES_EXEC 2015-07-07 16:00:50 +02:00
Stefanos Kornilios Mitsis Poiitidis c5e5600eec Update LICENSE
Let's switch to 3-clause BSD, because meh
2015-07-06 08:54:11 +02:00
Stefanos Kornilios Mitsis Poiitidis 475b6bbc38 Merge pull request #686 from reicast/feat/merge-x86-recs
Merge windows and linux x86 recompiler paths
2015-07-05 23:40:05 -07:00
Stefanos Kornilios Mitsis Poiitidis ea26e2784a Merge windows and linux x86 recompiler paths 2015-07-06 08:15:45 +02:00
TwistedUmbrella 7db6966ef8 Merge pull request #671 from imirkin/master
linux: print memory map to stderr when fixed path not available
2015-07-05 19:37:21 -04:00
Stefanos Kornilios Mitsis Poiitidis 852672a2dc Merge pull request #667 from Holzhaus/fix-bug-660
sh4_opcodes: Fix printf arguments
2015-07-05 11:45:58 -07:00
TwistedUmbrella e229b44821 Merge pull request #673 from reicast/loungekatt
Fixes for building iOS / Android in parallel
2015-07-05 11:15:08 -04:00
Stefanos Kornilios Mitsis Poiitidis b5108993c9 Audio: Fix windows build 2015-07-05 14:53:43 +02:00
TwistedUmbrella 20193681f0 Support all available landscape orientations 2015-07-05 00:15:40 -04:00
TwistedUmbrella 6a3f691c23 Fix a typo to prevent VMU and FPS popup focus 2015-07-05 00:05:06 -04:00
TwistedUmbrella e3744446f5 Support return to external launcher, Prep for linux
This adds the ability to simply close the emulator when launched
externally and prevents changes designed for linux from generating
conflicting controller configurations on Android (and may be needed for
iOS as well).
2015-06-28 11:29:34 -04:00
TwistedUmbrella c85a190d02 Relocate os_DebugBreak definition to origin 2015-06-28 11:11:39 -04:00
TwistedUmbrella 28a6d1d9b6 Merge pull request #642 from Holzhaus/audio-system-cleanup
Audio backends cleanup
2015-06-27 18:31:31 -04:00
Jan Holthuis 6ae3c5d907 Introduce USE_ALSA and accomodate Makefiles
This introduces the USE_ALSA flag (replaces the somewhat hacky
"HOST_OS==OS_LINUX && !defined(TARGET_NACL32) && !defined(ANDROID)"
if case).

The Makefiles for beagle, gcwz, lin86 and pandora have been adapted to
reflect this change.
2015-06-27 20:45:42 +02:00
Jan Holthuis a9771c918d Added PulseAudio backend
This commit introduces PulseAudio support using PulseAudio's "Simple
API".

The PulseAudio backend will be included during compilation if
USE_PULSEAUDIO is defined.
2015-06-27 20:44:54 +02:00
Jan Holthuis c17c7502d8 Added newline to end of files and removed obsolete code 2015-06-27 20:44:53 +02:00
Jan Holthuis 1c1e779500 Added Android audio backend
This *should* add the Android audio backend. I do not have any idea how
to do this properly, but I figured that this might work for the moment.
There's probably a lot of testing required for this to work.
2015-06-27 20:44:53 +02:00
Jan Holthuis a65b752592 Added DirectSound audio backend
This commit adds the DirectSound audio backend, which is a modified
version of core/oslib/ds_audiostream.cpp.

Porting this was a bit tricky, since ds_audiostream.cpp defined 3
extern functions that the other backends didn't have:
* bool os_IsAudioBuffered();
* bool os_IsAudioBufferedLots();
* int os_getusedSamples();

I came to the conclusion that these methods are obsolete since they are
only used core/windows/winmain.cpp in the function void os_wait_cycl(u32
cycl) - which is used nowhere. Thus, I removed os_wait_cycl and the
headers of the three functions in core/oslib/oslib.h. I also removed the
functions themselves (except for int os_getusedSamples(), which is still
used inside the directsound backend, but can safely declared static for
that purpose).

The DirectSound backend will be included during compilation if HOST_OS
is OS_WINDOWS.
2015-06-27 20:44:53 +02:00
Jan Holthuis 167fba4c9f Added ALSA audio backend
This adds the OSS audio backend, which is basically a slightly modified
version of core/oslib/alsa_audiostream.cpp from the skmp/linux-x64
branch (as of commit cdf9f3dc971506c2efd979275c2869f064e1027c).

The ALSA backend will be included during compilation if HOST_OS is OS_LINUX
and neither TARGET_NACL32 nor ANDROID are defined. This should be
changed to a USE_ALSA flag in the future (for constistency and and
simplicity reasons), but i didn't want to put too much stuff into this
commit.
2015-06-27 20:44:53 +02:00
Jan Holthuis f6d2e3fa7e Added OSS audio backend
This adds the OSS audio backend and removes OSS code from
core/linux-dist/main.cpp and core/sdl/main.cpp.
The OSS backend will be included during compilation if the USE_OSS
flag is set.

Although OSS code in core/linux-dist/main.cpp depended on the
TARGET_PANDORA flag instead of USE_OSS, the latter should work too
since it is defined in the Pandora Makefile (lines 7 & 83).
2015-06-27 20:42:40 +02:00
Jan Holthuis e3f1784a0f Implement audio backend system
This makes it possible to have multiple audio backends compiled into
reicast (e.g. ALSA & OSS on Linux). These can then selected by the user
via a config option ("backend" iin the "audio" section). It *should*
also be possible to reduce the number of platform-specific ifdefs with this
approach.

Audio backends need to define a struct (audiobackend_t) that holds a
pointer to it's init, push and term function and also a slug and a name
as string. They then need to pass a pointer to this struct to
RegisterAudioBackend() before InitAudio() is called.

For now, I defined a function (RegisterAllAudioBackends) that get's
called exactly once (i.e. upon first call of InitAudio()), where
we can put ifdef'd RegisterAudioBackend() calls into for each backend
that reicast supports.

Please note that this commit just implements the basic audio backend
system - no backends have been ported to the new API yet. For the meantime,
reicast will run without any audio support accross all systems.
2015-06-27 20:41:49 +02:00
Jan Holthuis 35968c8291 Rename os_Push() to PushAudio() for consistency 2015-06-27 20:41:05 +02:00
Jan Holthuis 55c6667753 Rename audiostream_rif.h to audiostream.h
This makes the naming more consistent.
2015-06-27 20:40:19 +02:00
Jan Holthuis 4c5682ac89 Define audiostream.cpp's time_diff at global scope
There's no need to do this inside the InitAudio() function.
2015-06-27 20:39:28 +02:00
TwistedUmbrella 574e90d1fc Merge pull request #637 from reicast/loungekatt
Fix build on OSX, Debug updates, Controller support
2015-06-21 20:16:47 -04:00
TwistedUmbrella fc0a917d42 Make menus controller-compatible (Pt. 2)
Add a border to the selected / pressed view to notify the user when
touch is unavailable.
2015-06-21 20:02:38 -04:00
TwistedUmbrella 6c1e5d250e Make menus controller-compatible (Pt. 1)
This requires some form of visual highlighting, but enables selection
of items using a controller.
2015-06-21 19:17:45 -04:00
Ilia Mirkin 6d3269c91d linux: print memory map to stderr when fixed path not available 2015-06-19 19:00:29 -04:00
Jan Holthuis fb50c7570c sh4_opcodes: Fix printf arguments
This partly resolves #660 (needs to applied to linux-64 branch, too).
2015-06-13 16:55:12 +02:00
TwistedUmbrella 414a7205f2 Add focus for attempting controller support 2015-05-23 12:25:32 -04:00
TwistedUmbrella 3f2f400c59 Fix compile on OSX by defining os_DebugBreak
This is an equivalent of the same functionality as per
http://stackoverflow.com/a/5561015
2015-05-23 12:25:22 -04:00
TwistedUmbrella 97569a9f24 too many arguments to function 'void armv_end(void*)' 2015-05-23 12:25:14 -04:00
TwistedUmbrella 604a3a0f8a Begin implementing a BIOS selection dialog
This is a dedicated dialog for selecting the BIOS on first run
2015-05-21 16:06:33 -04:00
TwistedUmbrella d7d0f23a29 Add report option to error detection prompt 2015-05-21 16:06:33 -04:00
Stefanos Kornilios Mitsis Poiitidis a9fc0f5aa8 Merge pull request #655 from reicast/feat/segfault-context-consolidation
ios merge, segfault context consolidation, linux86, android x86 jit
2015-05-18 14:56:55 +02:00
Stefanos Kornilios Mitsis Poiitidis c3a90a63a1 Merge pull request #658 from reicast/fix/vram-bank-handling
pvr/vram: Bank bit seems to be fixed on 4M, even on 16M hardware
2015-05-18 14:55:54 +02:00
Stefanos Kornilios Mitsis Poiitidis f571d6c594 pvr/vram: Bank bit seems to be fixed on 4M, even on 16M hardware 2015-05-18 14:45:24 +02:00
~skmp 4ea7398d8a Linux: fix building 2015-05-16 11:23:31 +03:00
Stefanos Kornilios Mitsis Poiitidis 2d842b9257 Renderer_if: fix norend 2015-05-16 01:10:47 -07:00
Stefanos Kornilios Mitsis Poiitidis 9c2a4dc5a4 iOS fixes 2015-05-16 01:04:30 -07:00
Stefanos Kornilios Mitsis Poiitidis 6547d80095 Fixes for android, cleanup context.cpp 2015-05-16 08:18:46 +02:00
Stefanos Kornilios Mitsis Poiitidis 03914309e3 linux/context: Add updated context files 2015-05-16 07:16:46 +02:00
Stefanos Kornilios Mitsis Poiitidis 65ca1382d8 Merge remote-tracking branch 'remotes/origin/skmp/ios-wip' into feat/segfault-context-consolidation
Android/windows builds fine again. Android not tested yet, iOS/OSX not compiled yet
2015-05-16 07:12:19 +02:00
Stefanos Kornilios Mitsis Poiitidis 902c5e2949 linux/context.*: Add missing files 2015-05-16 03:10:39 +02:00
Stefanos Kornilios Mitsis Poiitidis 8c469e4b5c *nix: move context massaging to linux/context.cpp, ALIGN -> DECL_ALIGN
Yay some warnings gone from not conflicting with ALIGN anymore
2015-05-16 03:06:04 +02:00
Stefanos Kornilios Mitsis Poiitidis db284eb4b7 travis: Add sudo: false to use docker stack
Hopefully fixes ndk extraction issues, docker containers have more resources
2015-05-16 01:01:09 +02:00
Stefanos Kornilios Mitsis Poiitidis 341c421dd7 travis: Add sudo: false to use docker stack
Hopefully fixes ndk extraction issues, docker containers have more resources
2015-05-16 00:52:42 +02:00
Stefanos Kornilios Mitsis Poiitidis bdece20e3a VS project: Exclude rec-86 from all build configs 2015-05-16 00:37:02 +02:00
Stefanos Kornilios Mitsis Poiitidis a2ac4015d1 Android/Makefile: Fix build by avoiding var-leakage
Apparently include $(CLEAR_VARS) doesn't quite do what one expects
2015-05-16 00:31:25 +02:00
Stefanos Kornilios Mitsis Poiitidis 30709c948e Android makefile: C doesn't support -fvisibility-inlines-hidden 2015-05-15 23:35:25 +02:00
Stefanos Kornilios Mitsis Poiitidis cf473a14a4 x86 jit: fix android 2015-05-15 23:33:47 +02:00
Stefanos Kornilios Mitsis Poiitidis 5b609a6be4 linux: Sh4 dynarec works 2015-05-08 18:59:20 +02:00
Stefanos Kornilios Mitsis Poiitidis d33ad6edfb Updating from linux/x64 2015-05-08 17:49:23 +02:00
Stefanos Kornilios Mitsis Poiitidis 5ef9d661a6 Merge remote-tracking branch 'origin/master' into skmp/linux86 2015-05-08 17:29:14 +02:00
Stefanos Kornilios Mitsis Poiitidis 5d3c71bee7 Merge master 2015-05-08 17:29:06 +02:00
Stefanos Kornilios Mitsis Poiitidis 86004e6879 Merge pull request #646 from reicast/fix/tmu-undeflow-logic
tmu: Correctly schedule next interrupt in underflow, correctly differ…
2015-05-08 15:35:39 +02:00
Stefanos Kornilios Mitsis Poiitidis 3fe8f0eb94 tmu: Correctly schedule next interrupt in underflow, correctly differentiate between large values and underflows
- 32 bit code was "fudgy" on this, so simplified via 64bit counters for edge detection
- Maths to count cycles were wrong
- Let's not do 32 bit wrapped maths after beers without any kind of pen-and-paper design

Should fix #594, also see #645
2015-05-08 02:29:24 +02:00
Stefanos Kornilios Mitsis Poiitidis 7d75ee3839 gles: revert e5965e356d.
glCheck was already an option, and gcc sanely doesn't like if (do { ... } while(0))
2015-05-08 01:06:40 +02:00
Stefanos Kornilios Mitsis Poiitidis e5965e356d gles: Disable glChecks by default, glGetError can be painfully slow 2015-05-07 23:27:22 +02:00
Stefanos Kornilios Mitsis Poiitidis c25ce04b48 sh4_sched: Avoid scheduling to -1, because, magic values. 2015-05-07 22:10:00 +02:00
Stefanos Kornilios Mitsis Poiitidis 4b46de89bb sh4_sched: Handle disabled events correctly 2015-05-07 22:03:55 +02:00
Stefanos Kornilios Mitsis Poiitidis 20f7a41fe9 sched: Do not re-fire expired callbacks, use sh4_sched_remaing on sh4_sched_tick 2015-05-07 21:33:36 +02:00
Stefanos Kornilios Mitsis Poiitidis 0614680f8c WinThreading: DEBUG_THREADS for random sleep around sync primitives 2015-05-07 21:32:11 +02:00
Stefanos Kornilios Mitsis Poiitidis 330a60bcf4 Merge branch 'master' of github.com:reicast/reicast-emulator 2015-04-12 22:48:31 +02:00
Stefanos Kornilios Mitsis Poiitidis 64b2fcbb1c Disable glCheck by default, move to validate:OpenGlChecks config 2015-04-12 22:48:16 +02:00
Stefanos Kornilios Mitsis Poiitidis faedd233da Merge pull request #635 from williansti/master
update brazilian translation
2015-04-12 22:36:14 +02:00
Stefanos Kornilios Mitsis Poiitidis e98f69ebd9 Merge pull request #629 from Holzhaus/fix-typedef-default-args
Remove arm_dyna typedef default args
2015-04-12 22:35:09 +02:00
Willians 0f42cb0da7 update brazilian translation 2015-04-12 10:42:12 -03:00
Stefanos Kornilios Mitsis Poiitidis 37960df643 Merge pull request #617 from reicast/features/use-ndk-r10d
Update for ndk-10d, improved build options
2015-04-12 12:54:22 +02:00
Stefanos Kornilios Mitsis Poiitidis dcabd5a8e7 Merge branch 'master' into features/use-ndk-r10d 2015-04-12 11:56:53 +02:00
Stefanos Kornilios Mitsis Poiitidis fe43b05119 Fix missing ng> in values-de/strings.xml 2015-04-12 11:42:09 +02:00
Stefanos Kornilios Mitsis Poiitidis 3aa14fd630 Fix "Update strings.xml" (missing < in c23f08f9e9) 2015-04-12 11:30:45 +02:00
Stefanos Kornilios Mitsis Poiitidis 6f447e7e68 Fix "Update strings.xml" (missing < in c23f08f9e9) 2015-04-12 11:29:56 +02:00
Stefanos Kornilios Mitsis Poiitidis 6655a42d94 Upgrade build target to 21 2015-04-12 10:31:50 +02:00
Stefanos Kornilios Mitsis Poiitidis 3b3b232758 Update w/ master for travis changes 2015-04-12 10:03:19 +02:00
TwistedUmbrella f74e4619e6 Merge pull request #626 from reicast/loungekatt
Revert "Verify freezing is not a context / thread issue"
2015-04-11 12:47:09 -04:00
TwistedUmbrella 120283fc0f Merge pull request #633 from Holzhaus/fix-german-translations
Fix german translations
2015-04-10 19:30:02 -04:00
Jan Holthuis 265670cc60 Fix indentation in german translations 2015-04-10 13:05:40 +02:00
Jan Holthuis 5993c3bfe1 Add additional german translations
This translates all strings that are currently in
shell/android/res/values/strings.xml.
2015-04-10 13:04:28 +02:00
Jan Holthuis d9ea22b49d Fix german translations
This mainly fixes typos and other mistakes in the german translations - mostly
the so-called "Deppenleerzeichen" (wrongfully inserted spaces in
composed words).
Refer to http://de.wikipedia.org/wiki/Leerzeichen_in_Komposita for details.
2015-04-10 12:27:03 +02:00
TwistedUmbrella 0cf93f79fa Merge pull request #632 from kitrio/patch-3
Update strings.xml
2015-04-09 12:11:42 -04:00
kitrio c23f08f9e9 Update strings.xml
new tag update and  improve translation korean
2015-04-10 00:16:31 +09:00
Jan Holthuis b3faffacc9 Remove arm_dyna typedef default args
Using default arguments is only allowed in function declarations, not
in typedefs. This fixes the invalid code that caused compilation errors
on systems using GNU g++ 4.9.2, i.e.:

> ../../core/rec-ARM/arm_dyna.cpp: At global scope:
> ../../core/rec-ARM/arm_dyna.cpp:186:79: error: default arguments are only permitted for function parameters
>  typedef void FPBinOP        (eFSReg Sd, eFSReg Sn, eFSReg Sm, ConditionCode CC=CC_AL);
>                                                                                ^
> ../../core/rec-ARM/arm_dyna.cpp:187:79: error: default arguments are only permitted for function parameters
>  typedef void FPUnOP         (eFSReg Sd, eFSReg Sm,            ConditionCode CC=CC_AL);
>                                                                                ^
> ../../core/rec-ARM/arm_dyna.cpp:188:79: error: default arguments are only permitted for function parameters
>  typedef void BinaryOP       (eReg Rd, eReg Rn, eReg Rm,       ConditionCode CC=AL);
>                                                                                ^
> ../../core/rec-ARM/arm_dyna.cpp:189:79: error: default arguments are only permitted for function parameters
>  typedef void BinaryOPImm    (eReg Rd, eReg Rn, s32 sImm8,     ConditionCode CC=AL);
>                                                                                ^
> ../../core/rec-ARM/arm_dyna.cpp:771:10: warning: anonymous type with no linkage used to declare variable '<anonymous struct> op_table []' with linkage
>  op_table[]=
>           ^
> Makefile:89: recipe for target 'obj/rec-ARM/arm_dyna.build_obj' failed
> make: *** [obj/rec-ARM/arm_dyna.build_obj] Error 1
2015-04-04 19:04:23 +02:00
TwistedUmbrella 80af0d364e Revert "Verify freezing is not a context / thread issue"
This reverts commit 21fbad3ba5.
2015-04-01 10:19:46 -04:00
TwistedUmbrella 5579204c10 Merge pull request #624 from reicast/loungekatt
Debug: Add L preview, Lollipop, and future unlisted
2015-04-01 10:13:05 -04:00
TwistedUmbrella 0109effc6c Debug: Add L preview, Lollipop, and future unlisted 2015-03-31 09:58:54 -04:00
Stefanos Kornilios Mitsis Poiitidis ebabdee8b9 Merge pull request #620 from reicast/feat/android-tv-xml
Enable Android TV options
2015-03-31 05:02:20 +02:00
Stefanos Kornilios Mitsis Poiitidis 3615fe0eff Enable Android TV options
Travis builds with sdk-21 now, so all is fine
2015-03-31 04:49:05 +02:00
Stefanos Kornilios Mitsis Poiitidis 8b4c0d92db Merge pull request #619 from reicast/feat/travis-sdk-21
Feat/travis sdk 21
2015-03-31 04:45:26 +02:00
Stefanos Kornilios Mitsis Poiitidis 11286ac02d Also remove unneeded mv 2015-03-31 04:34:09 +02:00
Stefanos Kornilios Mitsis Poiitidis e25c429ce6 Do not download adt or set ANDROID_HOME 2015-03-31 04:27:39 +02:00
Stefanos Kornilios Mitsis Poiitidis 25d27a72a0 Use native travis-android support, sdk 21 2015-03-31 04:24:13 +02:00
Stefanos Kornilios Mitsis Poiitidis 7abd1541a0 The new ndk is a bit of a PITA 2015-03-29 06:17:53 +02:00
Stefanos Kornilios Mitsis Poiitidis f1f46d9702 Extract is too verbose, how about /dev/null? 2015-03-29 06:07:18 +02:00
Stefanos Kornilios Mitsis Poiitidis 014d739495 Update for ndk-10d, improved build options 2015-03-29 06:02:24 +02:00
Stefanos Kornilios Mitsis Poiitidis dfd37a2ec7 Merge pull request #613 from reicast/feat/reios-elf-boot
reios: Add support for elf booting
2015-03-23 18:48:38 +01:00
Stefanos Kornilios Mitsis Poiitidis 0c04adba67 reios: Add support for elf booting 2015-03-22 01:30:19 +01:00
Stefanos Kornilios Mitsis Poiitidis 3b1c38ad55 sh4/driver: don't log on div32 missmatch 2015-03-22 01:26:43 +01:00
TwistedUmbrella b1108d15d0 Merge pull request #596 from reicast/loungekatt
Add theme selection GUI, Flush incoming intent when handled
2015-03-14 12:11:29 -04:00
TwistedUmbrella 2ae8ede025 Android TV config (pending travis API 21 support) 2015-03-14 11:53:46 -04:00
TwistedUmbrella 6cf0d1acda Add a settings toggle to configure reios 2015-03-14 11:51:30 -04:00
Stefanos Kornilios Mitsis Poiitidis 1a79ce3d9c Merge pull request #609 from williansti/master
update brazilian translation
2015-03-05 05:50:45 -08:00
Willians 25c40685e9 update brazilian translation
Revised translation and add options that were missing,
2015-03-02 09:11:51 -03:00
TwistedUmbrella f440743a57 Remove unsupported flags, Add theme "clear" 2015-02-26 01:08:02 -05:00
TwistedUmbrella 2fe7062249 Add the manifest requirements for Android TV 2015-02-26 00:47:44 -05:00
TwistedUmbrella e15fcc38e9 Better handling of theme items for spinner 2015-02-26 00:46:29 -05:00
TwistedUmbrella 21fbad3ba5 Verify freezing is not a context / thread issue 2015-02-26 00:46:29 -05:00
TwistedUmbrella cb555bc06f Properly flush an intent after the data is handled
Add a missing bracket for the intent cancellation
2015-02-26 00:46:29 -05:00
TwistedUmbrella 30cfc0b15a Add a basic theme selection option to configuration 2015-02-26 00:46:29 -05:00
Stefanos Kornilios Mitsis Poiitidis e82d6a8c0e Merge pull request #581 from reicast/skmp/bios-hle
reios: HLE "bios"
2015-02-25 21:39:14 -08:00
~skmp 0285e2c5da reios: Fix unaligned reads (emscripten, arm), more logging, u32be for LBA/sizes 2015-02-26 05:09:52 +01:00
Stefanos Kornilios Mitsis Poiitidis cca8558d08 Add Serial Console option (debug.SerialConsoleEnable) for KOS, etc 2015-02-25 20:56:58 +01:00
Stefanos Kornilios Mitsis Poiitidis 13f67e2d17 reios: CD/descrambling support, reduced log spam, improved boot context, hle address aliasing, bios memset to catch accesses 2015-02-25 19:47:09 +01:00
Stefanos Kornilios Mitsis Poiitidis 578bb6dadc reios/gdrom_hle: Fix TOC, better CHECK_COMMAND handling, split logspam to debugf 2015-02-25 19:33:36 +01:00
Stefanos Kornilios Mitsis Poiitidis 9ed6945826 sh4/cpu_iNimp: Nicer error output 2015-02-25 19:31:33 +01:00
Stefanos Kornilios Mitsis Poiitidis ae8ce5ad23 sh4/rdv_CompilePC: Fix boot time automatic cache flushes
The bios boots from 0xA... addresses, not 0x8... so the flushes were never triggered
2015-02-25 19:30:08 +01:00
Stefanos Kornilios Mitsis Poiitidis 7c64d57b35 Merge branch 'master' into skmp/bios-hle 2015-02-25 15:21:59 +01:00
Stefanos Kornilios Mitsis Poiitidis 952b1ae6e9 reios/hleboot: support cdroms, descramble, slightly smarter bootfile search 2015-02-25 15:21:22 +01:00
TwistedUmbrella d24e15daa6 Merge pull request #590 from reicast/loungekatt
Borrow Moga Lollipop workaround, Add theme backend
2015-01-24 08:54:05 -05:00
TwistedUmbrella ab0e67edc7 Merge pull request #585 from reicast/skmp/improve-coreio
http support for cdi & gdi, updated based gdipsr
2015-01-24 08:53:53 -05:00
TwistedUmbrella 584fdae6f8 Add a basic backend for supporting button themes
The theme path will be store as the button_theme pref and verified
before loading. This will replace any existing buttons in the data
folder of the emulator home_directory at runtime and load as the
graphics for the button configuration. This requires button themes be
standardized.
2015-01-23 09:25:20 -05:00
Stefanos Kornilios Mitsis Poiitidis f2c07917c7 Partially working dyna for iOS. Very few games working atm.
This works, but is extremelly hacky. Must be started without attached debugger, lldb doesn't want to let go of EXC_BAD_ADDRESS, but reicast really depends on it getting delivered as SIGSEGV/SIGBUS. Also xcode has a really bad day upon seeing the jit code. Oh well.

There's some dynarec bug that causes color corruption on bios logo/boot triagles, TA crash on ikaruga and infinitive loop on crazy taxi. I'd guess some fp-memory-write thingy, abi, or smth. Too bad.

- Force code to compile in arm mode (arm jit -> thumb mem functions is complicated)
- SIGILL, SIGBUS. Works w/o Mach exceptions and EXC_BAD_ADDRESS
- Code buffers move to __TEXT, munmapped && memmapped to actually work
- Primitive input. Button + start, or left (works to get out of bios date screen)
- Fixup emitter for thumb2/interworking (didn't work though, reverted to arm cc)
- Block Manager: Disable mem saving / page fault alloc-on-demand logic
- Move cycle counter to r11, r9 is not clean on iOS. Remove r11 from reg alloc list
- Cache flushes for iOS
- log to log.txt
- load game.chd
2015-01-18 23:52:12 -08:00
TwistedUmbrella 9e2b28ae46 hack: Temp fix for crash in MOGA lib on Lollipop. 2015-01-16 23:20:20 -05:00
Stefanos Kornilios Mitsis Poiitidis 4a917a003e Merge branch 'master' of github.com:reicast/reicast-emulator 2015-01-16 21:38:09 +01:00
Stefanos Kornilios Mitsis Poiitidis 977dff25ab Basic support for recording frames 2015-01-16 21:37:30 +01:00
Stefanos Kornilios Mitsis Poiitidis d9d9b76d79 TA/VTX: Reset current list on vdec_init
Fixes some rare cases where it's invalid or left over to some list, without a CurrentList set, leading to crash.
2015-01-15 14:23:56 +01:00
~skmp 33556f3863 64 bit fixes 2015-01-10 21:15:15 +02:00
Stefanos Kornilios Mitsis Poiitidis 0f60e72eb0 Add #include <cctype>, that's what isalnum is defined 2015-01-09 16:07:11 +01:00
Stefanos Kornilios Mitsis Poiitidis 3ca3b1220d http support for cdi & gdi, updated based gdipsr
- Fix coreio fsize
- Fix coreio fopen to seek to 0
- Fix coreio/http to smart-escape urls
-  For urls that include \ or % in the filenames, you have to pass them
   escaped
- Update gdi parser to use (mostly) streamstream. That code is horrible
  and should be rewritten
- coreio core is hacky and horrible at places as well
- Update imgreader to use coreio
- Update cdi parser + driver to use coreio
2015-01-09 15:50:07 +01:00
TwistedUmbrella 29496acf07 Merge pull request #583 from reicast/loungekatt
Attempting to fix Moga and the preview loader
2015-01-06 23:35:38 -05:00
TwistedUmbrella 8e548811e1 Add a thorough check for the data folder dilemma 2015-01-06 23:34:59 -05:00
TwistedUmbrella 4c96052d32 Support modifying the Moga listener at runtime 2015-01-06 23:34:59 -05:00
TwistedUmbrella 96a274caaf Stop relying on a bug to maintain popup view width
The original view was held in place due to an Android bug that began
around ICS, which did not stretch views beyond a set amount when
displayed in modal dialogs.

Clean up the layout to better fit the popup items
2015-01-06 23:34:59 -05:00
TwistedUmbrella b3de233e55 Fallback to old network methods for compatibility 2015-01-06 23:34:59 -05:00
TwistedUmbrella f211a4fa68 Connect Moga controller to new input handlers 2015-01-06 23:34:59 -05:00
TwistedUmbrella 1e783165ae Remove unnecessary StackTrace from error output 2015-01-06 23:34:59 -05:00
TwistedUmbrella 51c82ddb18 Fallback to old network methods for compatibility 2015-01-06 23:34:59 -05:00
TwistedUmbrella 2d9767b3b1 Avoid thread pool when executing non-parallel task 2015-01-06 23:34:58 -05:00
Stefanos Kornilios Mitsis Poiitidis d055dbd7cb TMU: Also set the underflow flag. Fixes KOS. 2015-01-07 03:12:33 +02:00
Stefanos Kornilios Mitsis Poiitidis 6ad25b8f53 TMU: Improve interrupt handling 2015-01-06 21:50:00 +02:00
Stefanos Kornilios Mitsis Poiitidis 11e9ed167a Fix building for android 2015-01-06 16:07:18 +02:00
Stefanos Kornilios Mitsis Poiitidis 118e9bb1d2 Merge branch 'master' of github.com:reicast/reicast-emulator 2015-01-06 15:02:16 +02:00
Stefanos Kornilios Mitsis Poiitidis 605fa1c40a TMU: Hello interrupts
Let's pretend that the TMU unit actually exists, it makes games like
Gaunlet Legends happy ~
2015-01-06 15:00:39 +02:00
Stefanos Kornilios Mitsis Poiitidis c5cc2f1e50 Document sh4_shced, fix tmu a bit 2015-01-06 14:10:48 +02:00
~skmp 0783875b84 Linux GLX/3.1 support
My setup is only 2.1 right now, so this is totally untested
2014-12-30 13:21:05 +02:00
~skmp 0bf6272b9c Avoid use of C++11, still too many compilers without support for auto :< 2014-12-30 10:58:13 +02:00
~skmp 78e4b3c5db Use netinet/tcp.h, not linux/tcp.h 2014-12-30 10:29:49 +02:00
~skmp 83752b9761 Fix building for linux (-DGLES && eglCreateWindowSurface) 2014-12-30 10:00:20 +02:00
TwistedUmbrella 28d0e0a08b Change directions on the path to success 2014-12-29 22:12:25 -05:00
Stefanos Kornilios Mitsis Poiitidis 65d19d8b9d Fix reios makefile building 2014-12-30 02:05:01 +01:00
Stefanos Kornilios Mitsis Poiitidis 088bbfd5e7 More work on reios 2014-12-30 01:57:13 +01:00
Stefanos Kornilios Mitsis Poiitidis 25eee26ce5 First steps towards a HLE bios implementation
This is very simplistic, but can already boot and run many games

Known working so far
- Dead Or Alive 2 LE
- Head Hunter
- Marvel VS Capcom 2

Not working
- (Almost) all others
2014-12-29 22:05:35 +01:00
TwistedUmbrella 8e5f530f25 Merge pull request #580 from reicast/loungekatt
Simplify the network check to avoid false positive
2014-12-25 01:19:31 -05:00
TwistedUmbrella dee65d217c Simplify the network check to avoid false positive 2014-12-25 01:03:23 -05:00
Stefanos Kornilios Mitsis Poiitidis 2f584aa68d Merge branch 'master' of github.com:reicast/reicast-emulator 2014-12-22 16:48:27 +01:00
Stefanos Kornilios Mitsis Poiitidis 9d7cac160a PVR: Fix hscale, VO vs FB_W scissor
Fixes w320 games (bangai-o, kof99, etc), and Half-x clip (Ready2Rumble,
more)
2014-12-22 16:46:40 +01:00
Stefanos Kornilios Mitsis Poiitidis 5b9ac040a4 FB_R_SIZE_type should be 32 bits, not 42 2014-12-22 16:45:32 +01:00
TwistedUmbrella 069e96384b update build configuration for public repository 2014-12-19 15:05:01 -05:00
TwistedUmbrella dde74604d3 Merge pull request #577 from reicast/loungekatt
Blanket summary of test devices for the entire team
2014-12-19 13:52:49 -05:00
TwistedUmbrella f6e0004717 Blanket summary of test devices for the entire team
It isn’t really necessary to specify who owns what device until it
becomes relevant in a device-specific issue report.
2014-12-19 13:52:06 -05:00
TwistedUmbrella ab19db481b Merge pull request #575 from reicast/loungekatt
Record crash output to application log
2014-12-18 13:06:31 -05:00
TwistedUmbrella 1301d24c41 Remove unused CoverFlow library due to menu update 2014-12-17 15:07:07 -05:00
TwistedUmbrella 595a79b2c3 Hide the keyboard when entering file browser 2014-12-17 14:28:52 -05:00
TwistedUmbrella 7d3ba6f539 Change crash dialog to crash toast message
Some of the errors are easily bypassed, but a popup stops gameplay
simply to be dismissed.
2014-12-17 14:28:52 -05:00
TwistedUmbrella f4698fc3d7 Record crash output to application log 2014-12-17 14:28:52 -05:00
Stefanos Kornilios Mitsis Poiitidis 56ebda10a9 ios interpreter works, bios runs w/ 3d visulals
THIS IS A MESS. Sorry @angelXwind :p. We'll have to clean up and merge for r8, but most of the nasty work is there.

What works:
- full init, memalloc, mprotects, etc
- boot
- gles2

What doesn't:
- Exceptions for page faults
  - Breaks texture cache
  - Breaks dynarec because of fastpath
  - segfaults don't work, needs special mach exc_server magic that still eludes me after 5 hours
- Dynarecs. RWX issues, and broken buffer mappings. Also some minnor linking stuff (most of it is taken care of)
- Audio. I just killed it off.
- All of the ui. Was getting in the way of me not knowing how to edit story boards...
- Input

Also, merged branch 'skmp/mac86-hackport' into skmp/ios-wip

Have fun~
2014-12-17 10:19:44 -08:00
Stefanos Kornilios Mitsis Poiitidis 2978074fa6 Merge branch 'master' of https://github.com/reicast/reicast-emulator 2014-12-17 03:11:14 -08:00
Stefanos Kornilios Mitsis Poiitidis 86e2408ace wip to get ios compiling 2014-12-17 03:10:18 -08:00
Stefanos Kornilios Mitsis Poiitidis 160d6f0c48 Linux is case sensitive 2014-12-17 10:44:11 +01:00
Stefanos Kornilios Mitsis Poiitidis 09caf4a55e Lock the entire texture, not just the pixel array.
Fixes #49
2014-12-17 08:45:19 +01:00
Stefanos Kornilios Mitsis Poiitidis 29906d8416 Texkill, palette_update on correct place.
- Texkill needs to be done before texture allocation, which is now done during parsing (texture-sync update)
- palette_update needs to be called from the emu thread, before kicking off the render
2014-12-17 08:42:28 +01:00
Stefanos Kornilios Mitsis Poiitidis 9a5c3160a3 Documentation for dsp.cpp 2014-12-17 07:12:08 +01:00
Stefanos Kornilios Mitsis Poiitidis 819ed61ec8 Updated for visual studio community 2013
(yay, free tooling1)
2014-12-17 07:10:59 +01:00
Stefanos Kornilios Mitsis Poiitidis e43271e448 fix for msvc 2013 / C++14. Rend is now used by stdlib 2014-12-17 06:48:45 +01:00
Stefanos Kornilios Mitsis Poiitidis defc25e9c1 Remove READ_LOGS, see issue 571 2014-12-15 02:18:37 +01:00
Stefanos Kornilios Mitsis Poiitidis 279b957e94 Merge 2014-12-15 01:14:46 +01:00
TwistedUmbrella bf0490d06e No debug plugin means no need for a sharedId
May also resolve some issues with installing over an existing build
without uninstalling the build first.
2014-12-14 15:36:53 -05:00
Stefanos Kornilios Mitsis Poiitidis cbc4f8db2c Push version to r7 2014-12-14 18:05:59 +01:00
Stefanos Kornilios Mitsis Poiitidis b1f88f258b Merge branch 'master' of github.com:reicast/reicast-emulator 2014-12-11 14:02:43 +01:00
Stefanos Kornilios Mitsis Poiitidis 34bc42b7a4 Add x64 target, fix Sh4RCB pointer sizing, u32->unat in vmem 2014-12-11 14:02:10 +01:00
Stefanos Kornilios Mitsis Poiitidis acda30f034 Emitter: use main types.h 2014-12-11 14:01:13 +01:00
Stefanos Kornilios Mitsis Poiitidis c69934f839 Force all allocates > 32bits on x64 debug mode to find porting issues 2014-12-11 14:00:53 +01:00
Stefanos Kornilios Mitsis Poiitidis 2f171e3596 Support HOST_NO_REC for windows 2014-12-11 13:59:31 +01:00
Stefanos Kornilios Mitsis Poiitidis 22e95de2d1 Merge pull request #572 from reicast/skmp/pandora-merge
pandora merge
2014-12-11 03:26:13 +01:00
Stefanos Kornilios Mitsis Poiitidis d5ddad53d1 Use XMLParser from master 2014-12-11 03:17:17 +01:00
Stefanos Kornilios Mitsis Poiitidis 4500cfb1d3 Remove white-space changes 2014-12-11 02:57:23 +01:00
Stefanos Kornilios Mitsis Poiitidis 63485e7a72 SetFloatStatusReg: support gcc for x86 2014-12-09 22:15:44 +01:00
Stefanos Kornilios Mitsis Poiitidis 77390f861e DSP only if HOST_NO_REC is not enabled 2014-12-09 22:15:00 +01:00
Stefanos Kornilios Mitsis Poiitidis 000f432548 No rend: fix process 2014-12-09 22:10:16 +01:00
Stefanos Kornilios Mitsis Poiitidis a4b3e8dc05 Auto detect gcc/vc 2014-12-09 22:09:51 +01:00
TwistedUmbrella f13d12a0b3 Merge pull request #564 from reicast/loungekatt
Add resources for error dialog, Disable test
2014-11-21 17:07:47 -05:00
TwistedUmbrella e4025420af Fix indentation issues when transferring code 2014-11-21 15:03:22 -05:00
TwistedUmbrella 4aa0bee20e Add lazy-load image library, Add github resources 2014-11-21 12:24:59 -05:00
TwistedUmbrella 6ba58fd695 Import debug tool git viewer and deprecate plugin 2014-11-21 12:24:59 -05:00
TwistedUmbrella 2c1b46dfd9 Update a stray translation for troubleshooting 2014-11-21 12:24:58 -05:00
TwistedUmbrella 4b58c695fc Allow default navigation to default to user folder 2014-11-21 12:24:58 -05:00
TwistedUmbrella 159d554c7d Fully unlink joystick config from compat & custom 2014-11-21 12:24:58 -05:00
TwistedUmbrella 612928fedf Add resources for error dialog, Disable test 2014-11-21 12:24:58 -05:00
Stefanos Kornilios Mitsis Poiitidis 9b38bcf079 Merge pull request #566 from reicast/r7-rc
Commits from r7-rc
2014-11-21 13:44:30 +02:00
TwistedUmbrella 4bd74aeebe Merge pull request #563 from reicast/loungekatt
Fix the display of messages within emu thread
2014-11-12 21:43:46 -05:00
TwistedUmbrella d26d4d4cfa Fix the display of messages within emu thread 2014-11-12 21:42:52 -05:00
Stefanos Kornilios Mitsis Poiitidis c2d1fbfdc2 WIP to get an alert dialog show
- new String() fails, somewhere deep on the android run-time, with no exception or some kind of logged error on my N4. WHY?
- The android debugger is a huge PITA.
- Eclipse is best left unused
2014-11-10 13:34:59 +01:00
Stefanos Kornilios Mitsis Poiitidis d1aa96d3e1 Improve error handling
Add coreMessage, die to EmuThread, propagate msgboxf to coreMessage
2014-11-10 05:28:52 +01:00
Stefanos Kornilios Mitsis Poiitidis ff4f5c21a8 Merge pull request #561 from reicast/skmp/travis-debug-cert
Merge skmp/travis-debug-cert
2014-11-07 04:06:28 +02:00
~skmp dc3575a2ef Create .android, mv is also better 2014-11-07 03:46:32 +02:00
~skmp 67b29e4923 Static debug cert 2014-11-07 03:39:40 +02:00
TwistedUmbrella dbc6f5a43c Merge pull request #557 from reicast/loungekatt
Fancy toast, Forgiving BIOS directory selection
2014-10-30 22:43:57 -04:00
Stefanos Kornilios Mitsis Poiitidis 28e9b27ec1 Increase travis to 2cpus
1.5VCPUs available according to docs, so this will help with build times (and also keep memory under control)
2014-10-30 11:44:05 +01:00
Stefanos Kornilios Mitsis Poiitidis c8540e5be9 Force -j1 on travis to avoid running out of memory 2014-10-30 11:12:52 +01:00
Stefanos Kornilios Mitsis Poiitidis bedb8564f2 Update ant/custom-build.xml to use env processor count (works windows), default to -j4, and also from env NDKBUILDOPT 2014-10-30 11:08:00 +01:00
TwistedUmbrella 5abd36612d Add resources for notification size limitations 2014-10-28 12:08:34 -04:00
TwistedUmbrella 49a44b3cb0 Fancy toast, Forgiving BIOS directory selection 2014-10-24 22:44:32 -04:00
Stefanos Kornilios Mitsis Poiitidis 157c837ec0 Merge branch 'skmp/gl3.1' 2014-10-22 14:42:02 +02:00
Stefanos Kornilios Mitsis Poiitidis 2b1aaf061d Isolate GLES, add DESKTOPGL option to core.mk 2014-10-22 14:39:07 +02:00
Stefanos Kornilios Mitsis Poiitidis e4844a37c3 Merge branch 'skmp/label_list_fix' 2014-10-22 14:15:40 +02:00
Stefanos Kornilios Mitsis Poiitidis 468b0109c8 Fix label array system 2014-10-22 14:11:39 +02:00
TwistedUmbrella 361e67e0a4 Merge pull request #554 from reicast/loungekatt
Workaround for relative path access restrictions
2014-10-20 00:04:00 -04:00
TwistedUmbrella 211fa6e3b1 Temporary disable of icons for Android L
java.lang.NullPointerException: Attempt to invoke virtual method
'boolean android.graphics.drawable.Drawable.canApplyTheme()' on a null
object reference

public boolean canApplyTheme () Added in API level 21
2014-10-19 09:43:06 -04:00
TwistedUmbrella 7d87829171 Workaround for relative path access restrictions 2014-10-19 08:08:54 -04:00
TwistedUmbrella da1a800797 Merge pull request #552 from reicast/loungekatt
BIOS Locator and fixes for KitKat Samsung directories
2014-10-16 15:09:58 -04:00
TwistedUmbrella 22adcee052 Implement functional locator and path navigation 2014-10-16 14:59:20 -04:00
TwistedUmbrella 88beeb147d Add a check for extSdCard mounts (Samsung) 2014-10-15 12:06:41 -04:00
TwistedUmbrella f84d31d84a Merge pull request #545 from reicast/loungekatt
Basic automated BIOS locator
2014-10-08 23:31:24 -04:00
TwistedUmbrella 1aa50faadf Basic automated BIOS locator
Requires BIOS still be in a “data” subfolder
2014-10-08 23:13:27 -04:00
TwistedUmbrella b18350652a Merge pull request #543 from reicast/loungekatt
Conversion to predefined menus to prevent scale issues
2014-10-08 21:47:39 -04:00
TwistedUmbrella 58d3c1a037 Fix alignment when restoring VMU to menu 2014-10-08 21:22:52 -04:00
TwistedUmbrella da03a6bbce Add main menu popup from predefined layout 2014-10-08 20:18:28 -04:00
TwistedUmbrella 81707ea383 Convert popup submenus to scrollable layouts 2014-10-07 01:30:12 -04:00
TwistedUmbrella af7fbf47c0 Switch to XML popup layouts to prevent size issues
This also adds text labels to the buttons for easier identification of
functionality
2014-10-06 14:22:50 -04:00
TwistedUmbrella 2280e67c44 Merge pull request #542 from LoungeKatt/master
Make sure menu items are visible in layout
2014-10-05 17:13:33 -04:00
TwistedUmbrella 151c754281 Make sure menu items are visible in layout 2014-10-05 17:13:02 -04:00
TwistedUmbrella b1575350d1 Merge pull request #541 from LoungeKatt/master
Update images with high res base graphic
2014-10-05 17:02:24 -04:00
TwistedUmbrella 6409215a1a Update images with high res base graphic 2014-10-05 17:01:23 -04:00
TwistedUmbrella cf57f7abb4 Merge pull request #539 from LoungeKatt/master
Move right stick toggle to options, Remove "exit" buttons
2014-10-05 16:33:53 -04:00
Stefanos Kornilios Mitsis Poiitidis 286d6372b5 Merge pull request #540 from reicast/skmp/gdtool
hash support on gdtool
2014-10-05 23:28:55 +03:00
TwistedUmbrella 26b669cc8d Move right stick setting to input options 2014-10-05 16:19:50 -04:00
Stefanos Kornilios Mitsis Poiitidis 97c487b06d Merge pull request #537 from LoungeKatt/master
Onscreen menu fixes and reduction
2014-10-05 23:15:05 +03:00
TwistedUmbrella 5156d04b76 More icon updates for additional placements 2014-10-05 14:13:12 -04:00
TwistedUmbrella 9ccaf18304 Modernize graphics to match site revision
Temporary resizes from Photoshop. Will be converted to vector graphic
for lossless resizing
2014-10-01 14:14:51 -04:00
TwistedUmbrella 0dba81b99a Move onscreen joystick config to configuration 2014-10-01 13:51:29 -04:00
TwistedUmbrella 7b615ad37c Add icon to for disk swap onscreen option 2014-10-01 13:46:38 -04:00
TwistedUmbrella 25c334e067 Merge pull request #536 from LoungeKatt/master
Update Moga lib, Refresh home between windows
2014-10-01 13:20:09 -04:00
TwistedUmbrella 846edc61d3 Update Moga lib, Refresh home between windows 2014-10-01 10:16:05 -04:00
Stefanos Kornilios Mitsis Poiitids f14932c362 Building on osx w/o rec or rend 2014-09-30 12:00:46 +03:00
Stefanos Kornilios Mitsis Poiitidis aa33d230e5 Merge branch 'master' into skmp/r7-sprint 2014-09-14 14:12:46 +03:00
TwistedUmbrella 1623086a48 Merge pull request #530 from LoungeKatt/master
Fix joystick dpad emulation, Refresh onscreen controls
2014-09-11 14:36:54 -04:00
TwistedUmbrella 0b2494b568 Fix onscreen control layout on layout change
Addresses https://github.com/reicast/reicast-emulator/issues/531
2014-09-11 01:14:20 -04:00
TwistedUmbrella f3fde06548 Unlink custom from JS-Dpad, Rename appropriately
The preference name was a little misleading. The preference has the
same functionality, but was named to imply an inverse functionality. It
is now disabled by default, which may need to be reversed if the number
of games requiring the feature to split the two controls is outweighed
by the number for which the feature disables joystick functionality.
2014-09-11 01:14:15 -04:00
Stefanos Kornilios Mitsis Poiitidis 51946d606a Merge branch 'master' into skmp/r7-sprint 2014-09-05 13:21:56 +03:00
Stefanos Kornilios Mitsis Poiitidis a674e6d61a Merge branch 'master' into skmp/r7-sprint 2014-09-05 13:20:31 +03:00
TwistedUmbrella 223f818a33 Merge pull request #523 from LoungeKatt/master
Support basic debug plugin when app unavailable
2014-08-31 08:35:47 -04:00
Stefanos Kornilios Mitsis Poiitidis 0825ca5a4b hash support on gdtool 2014-08-26 00:53:14 +03:00
Stefanos Kornilios Mitsis Poiitidis 3f53172873 Merge pull request #519 from lutris/master
Update README with Linux build instructions
2014-08-24 01:25:33 +03:00
ptitSeb 763e0948c0 Merge branch 'pandora' of https://github.com/reicast/emulator into pandora 2014-08-18 23:03:05 +02:00
Karen Tsai 2c651298d5 Updated iOS front end, removed low quality UI images. Need to make better ones using the Android UI images. 2014-08-18 22:56:35 +02:00
Karen Tsai bbe745da49 Massive build fix for iOS, ngen_arm.S (ARM JIT core) now compiles! The next goal… fix OGLES2. Because that’s completely broken. Also, updated .gitignore to properly ignore iOS build artifacts. 2014-08-18 22:54:08 +02:00
ptitSeb 3d8183bb86 Small update to Makefile 2014-08-18 22:50:33 +02:00
ptitSeb 0a17c4333a PANDORA: Options and GUI 2014-08-18 22:50:32 +02:00
TwistedUmbrella 3da30ba555 Disable internet components when detail option disabled 2014-08-18 22:41:17 +02:00
Stefanos Kornilios Mitsis Poiitidis 4f3cee2d87 Improve async/mt rendering & sync logic.
Should fix texture staging issues for now, without degrading performance
Fixes #49 (mvsc2, sf3, etc sprites)
2014-08-18 22:39:21 +02:00
TwistedUmbrella 8ebe44ea85 Preload game details to allow setting icons, faster loading 2014-08-18 22:35:25 +02:00
TwistedUmbrella a5ff5c9473 Async XML loading, Move XML methods to parser class 2014-08-18 22:33:05 +02:00
TwistedUmbrella 8c69e6142e Add a proper info API, but retain the requirements for now 2014-08-18 22:29:35 +02:00
TwistedUmbrella c1537ca3c8 Add game details as webpage popup during launch process
Currently supports games with standard naming (i.e. Dead or Alive 2) or
brackets for details (i.e. Dead or Alive 2 [NTSC-J])
2014-08-18 22:26:00 +02:00
Stefanos Kornilios Mitsis Poiitidis b55fbef3a6 Stored TA command stream persists on TA_LIST_INIT, until first actual write.
Fixes #141, "Main menus on POD and Speed Devil show up black"

Seems like the TA doesn't touch any of the memory structures before first write (and probably later on, but we're not gonna support corrupted ta streams for now)

According to p1pkin

«At least in SpeedDevils, at title screen game do a bit weird thing
 - Init TA context
 - Send lists to TA
 - Init the same context again
 - Start Render

so, if you are clear stored poly/vertex data at "TA_LIST_INIT" pvr2 reg write - you'll get black screen instead game title»
2014-08-18 22:22:30 +02:00
Stefanos Kornilios Mitsis Poiitidis 1cf68c7b38 Webui for linux 2014-08-18 22:21:18 +02:00
Stefanos Kornilios Mitsis Poiitidis 5e35e7f746 Initial webui code (that does nothing useful)
I plan to port over the existing nulldc debugger stuff to a webui so we can do remote debugging on android and more
2014-08-18 22:18:03 +02:00
Stefanos Kornilios Mitsis Poiitidis 778efcdf19 add libwebsocket 2014-08-18 22:15:27 +02:00
ptitSeb a56538babc PANDORA: Options and GUI 2014-08-18 21:58:46 +02:00
ptitSeb c4715150cc PANDORA: played with ccache 2014-08-18 21:58:45 +02:00
ptitSeb 15708686b9 Added back manual frameskip due to forum request 2014-08-18 21:57:16 +02:00
ptitSeb 229fa41b30 compilations fixes for Pandora 2014-08-18 21:57:15 +02:00
ptitSeb b7afa6a498 some fixes for Pandora 2014-08-18 21:57:15 +02:00
ptitSeb 6a9cdd7633 added frameskip back, has asked in openpandora forum 2014-08-18 21:57:14 +02:00
Stefanos Kornilios Mitsis Poiitidis 85d806c355 First idea for a gdrom tool 2014-08-18 21:56:04 +02:00
Karen Tsai ae91ea63e7 Removed more low-quality and unused UI images, updated emulator view controller. 2014-08-18 21:56:03 +02:00
Karen Tsai b4cc42bd2e Updated iOS front end, removed low quality UI images. Need to make better ones using the Android UI images. 2014-08-18 21:56:03 +02:00
AndroidGX 7e3ee8ca26 French translation update 2014-08-18 21:56:02 +02:00
TwistedUmbrella d31f324212 Add explicit casting for iOS, Import iOS EGL headers
EGL headers imported from https://github.com/alco/EGL_mac_ios for use
in iOS specialty directory
2014-08-18 21:56:02 +02:00
Karen Tsai 269ac637d3 …And fixed a typo that was somehow made during the process of cutting-and-pasting. 2014-08-18 21:56:01 +02:00
Karen Tsai bce423e877 Massive build fix for iOS, ngen_arm.S (ARM JIT core) now compiles! The next goal… fix OGLES2. Because that’s completely broken. Also, updated .gitignore to properly ignore iOS build artifacts. 2014-08-18 21:56:01 +02:00
TwistedUmbrella 2da588b7bb Attempt to avoid some contextual issues with info display 2014-08-18 21:56:00 +02:00
Luca1991 35b7ce464c Removed some unused localization strings (maybe used for debug purposes in the past??) that caused some compilation warnings 2014-08-18 21:56:00 +02:00
TwistedUmbrella b326bc2843 Proper immersive view for the main menu layouts 2014-08-18 21:55:59 +02:00
ptitSeb 01c419c63a Small update to Makefile 2014-08-18 21:55:59 +02:00
ptitSeb b5dcc93766 PANDORA: No mic on Pandora for now 2014-08-18 21:55:58 +02:00
ptitSeb aa80f4a852 PANDORA: Options and GUI 2014-08-18 21:55:57 +02:00
ptitSeb 4d8d5f68fc Fixed Pandora Makefile 2014-08-18 21:55:56 +02:00
Luca1991 9d6adf8221 Added Italian Localization 2014-08-18 21:54:31 +02:00
TwistedUmbrella 4058ecc737 Disable info display by default until internet check works 2014-08-18 21:54:31 +02:00
Stefanos Kornilios Mitsis Poiitidis 734db8a743 Split CFLAGS/CXXFLAGS on core.mk, warning fixes 2014-08-18 21:54:30 +02:00
Stefanos Kornilios Mitsis Poiitidis 5de530d68e Echo state on websocket, hack abit the nacl makefile 2014-08-18 21:54:30 +02:00
Luca1991 a711b4e0e3 CloudVMU tool added 2014-08-18 21:54:29 +02:00
Claus Østergaard 1414176b08 Update strings.xml 2014-08-18 21:54:27 +02:00
Bryan Barnes 546c010517 i loves me some markdown 2014-08-18 21:54:27 +02:00
Bryan Barnes b5d2811de4 build badge! 2014-08-18 21:54:26 +02:00
Bryan Barnes f5bfa82fbd updated apk path in travis.yml, not we just need a working host for uploading the builds 2014-08-18 21:54:26 +02:00
Bryan Barnes d4b76ff9e1 updated travis.yml with recent build steps 2014-08-18 21:54:26 +02:00
TwistedUmbrella b787f590d3 Remove some test changes, Use drawable swap function 2014-08-18 21:54:25 +02:00
TwistedUmbrella c2c7af68bf Compatibility with compilers on non-Ubuntu platforms 2014-08-18 21:54:25 +02:00
TwistedUmbrella ea1686df08 Add the preliminary menu option to swap a utopia disk 2014-08-18 21:54:24 +02:00
TwistedUmbrella 78a8a70073 Initial testing of "coverflow" integration for XMB menus 2014-08-18 21:54:24 +02:00
TwistedUmbrella 261cfb13f3 Get filename when info disabled, Regex to avoid invalids 2014-08-18 21:54:23 +02:00
Stefanos Kornilios Mitsis Poiitidis 66d8b96ae3 Cleanup textures after they are dead for a while 2014-08-18 21:54:23 +02:00
MrPsyMan e22fd18ff8 Please do a sanity test before pushing your changes.
I should also start following the above advice. :p

t/y!
2014-08-18 21:54:22 +02:00
AndroidGX 44e80be303 French update about strings.xml
(lines and things to match latest english original strings.xml file).
2014-08-18 21:54:22 +02:00
TwistedUmbrella c4a32e73c4 Disable internet components when detail option disabled 2014-08-18 21:54:22 +02:00
Stefanos Kornilios Mitsis Poiitidis 9d438c3ff3 Improve async/mt rendering & sync logic.
Should fix texture staging issues for now, without degrading performance
Fixes #49 (mvsc2, sf3, etc sprites)
2014-08-18 21:54:21 +02:00
TwistedUmbrella c332985bd1 Separate joystick and dpad by default when not configured 2014-08-18 21:54:21 +02:00
TwistedUmbrella 3da4c2eab1 Permission for verifying network connectivity 2014-08-18 21:54:20 +02:00
TwistedUmbrella 6676a3456f Preload game details to allow setting icons, faster loading 2014-08-18 21:54:20 +02:00
TwistedUmbrella 4490934188 Async XML loading, Move XML methods to parser class 2014-08-18 21:54:19 +02:00
TwistedUmbrella 5022831093 Make displaying game details in launcher a preference 2014-08-18 21:54:19 +02:00
TwistedUmbrella 554c86522e Add a proper info API, but retain the requirements for now 2014-08-18 21:54:18 +02:00
TwistedUmbrella 4743d8d31f Add game details as webpage popup during launch process
Currently supports games with standard naming (i.e. Dead or Alive 2) or
brackets for details (i.e. Dead or Alive 2 [NTSC-J])
2014-08-18 21:54:18 +02:00
Stefanos Kornilios Mitsis Poiitidis 59fbb66a66 Stored TA command stream persists on TA_LIST_INIT, until first actual write.
Fixes #141, "Main menus on POD and Speed Devil show up black"

Seems like the TA doesn't touch any of the memory structures before first write (and probably later on, but we're not gonna support corrupted ta streams for now)

According to p1pkin

«At least in SpeedDevils, at title screen game do a bit weird thing
 - Init TA context
 - Send lists to TA
 - Init the same context again
 - Start Render

so, if you are clear stored poly/vertex data at "TA_LIST_INIT" pvr2 reg write - you'll get black screen instead game title»
2014-08-18 21:54:17 +02:00
Stefanos Kornilios Mitsis Poiitidis bcf299cfd4 Ignore group_en bit (via p1pkin, should fix "18 Wheeler - Minimap tiles / not confined to map boundaries") 2014-08-18 21:54:17 +02:00
Stefanos Kornilios Mitsis Poiitidis 7e1f639d6f Webui for linux 2014-08-18 21:54:16 +02:00
Stefanos Kornilios Mitsis Poiitidis 7d35000c18 WEBUI for android 2014-08-18 21:54:16 +02:00
Stefanos Kornilios Mitsis Poiitidis 528d0c6d7a Initial webui code (that does nothing useful)
I plan to port over the existing nulldc debugger stuff to a webui so we can do remote debugging on android and more
2014-08-18 21:54:16 +02:00
Stefanos Kornilios Mitsis Poiitidis eb3f1ca687 Add more missing files 2014-08-18 21:54:15 +02:00
Stefanos Kornilios Mitsis Poiitidis 1a063b8f0d Add missing file 2014-08-18 21:54:15 +02:00
Stefanos Kornilios Mitsis Poiitidis 5cccea4a71 add libwebsocket 2014-08-18 21:54:14 +02:00
TwistedUmbrella 7bc1d7cdac Fix the typo now that it is actually being referenced 2014-08-18 21:54:13 +02:00
TwistedUmbrella fec60d0546 Summary check for intent data to support specific action 2014-08-18 21:54:13 +02:00
TwistedUmbrella 7f7387cf18 Remove unnecessary exposed intents, Add toast handler 2014-08-18 21:54:13 +02:00
TwistedUmbrella 66c1047427 Check for alternate joystick handlers (GameKeyboard, etc.)
Remove unused imports from various activities
Verify if gamekeyboard is being used to replace hardware
Configure stock controller layout as default
2014-08-18 21:54:12 +02:00
TwistedUmbrella cd06c05bef NativeActivity and navigational stability improvements
Improve shutdown when errors occur to prevent inability to restart
Reduce the context for launching activities to local application
Error checking when launching the native touchpad interface
2014-08-18 21:54:12 +02:00
ptitSeb b66de11664 PANDORA: No mic on Pandora for now 2014-08-18 21:54:11 +02:00
ptitSeb b0c222bdd6 PANDORA: Options and GUI 2014-08-18 21:53:38 +02:00
ptitSeb c2b2c7146b Fixed Pandora Makefile 2014-08-18 21:52:14 +02:00
ptitSeb 5548a9b6f8 PANDORA: played with ccache 2014-08-18 21:51:13 +02:00
ptitSeb e512eca05b Pandora Makefile change 2014-08-18 21:46:52 +02:00
ptitSeb 891c0011bb Added back manual frameskip due to forum request 2014-08-18 21:44:10 +02:00
ptitSeb 387bf0a960 compilations fixes for Pandora 2014-08-18 21:44:09 +02:00
ptitSeb 99389db89c some fixes for Pandora 2014-08-18 21:44:09 +02:00
ptitSeb 607b9c41a0 added frameskip back, has asked in openpandora forum 2014-08-18 21:44:08 +02:00
Stefanos Kornilios Mitsis Poiitidis c74215f1e8 First idea for a gdrom tool 2014-08-18 21:40:59 +02:00
Karen Tsai 126f65ec7a Removed more low-quality and unused UI images, updated emulator view controller. 2014-08-18 21:40:59 +02:00
Karen Tsai 80ff2c600a Updated iOS front end, removed low quality UI images. Need to make better ones using the Android UI images. 2014-08-18 21:40:58 +02:00
AndroidGX 0f3c95df4c French translation update 2014-08-18 21:40:57 +02:00
TwistedUmbrella c398edf22c Add explicit casting for iOS, Import iOS EGL headers
EGL headers imported from https://github.com/alco/EGL_mac_ios for use
in iOS specialty directory
2014-08-18 21:40:57 +02:00
Karen Tsai 2f846e912c …And fixed a typo that was somehow made during the process of cutting-and-pasting. 2014-08-18 21:40:56 +02:00
Karen Tsai f468fb0405 Massive build fix for iOS, ngen_arm.S (ARM JIT core) now compiles! The next goal… fix OGLES2. Because that’s completely broken. Also, updated .gitignore to properly ignore iOS build artifacts. 2014-08-18 21:40:56 +02:00
TwistedUmbrella cd4447dd4b Attempt to avoid some contextual issues with info display 2014-08-18 21:40:55 +02:00
Luca1991 21d787bdd0 Removed some unused localization strings (maybe used for debug purposes in the past??) that caused some compilation warnings 2014-08-18 21:40:55 +02:00
TwistedUmbrella 9c7c2b8637 Proper immersive view for the main menu layouts 2014-08-18 21:40:55 +02:00
ptitSeb 7c29dcc9af Small update to Makefile 2014-08-18 21:40:54 +02:00
ptitSeb 8dd98be0ee PANDORA: No mic on Pandora for now 2014-08-18 21:40:53 +02:00
ptitSeb dd6e7fae46 PANDORA: Options and GUI 2014-08-18 21:40:52 +02:00
ptitSeb b9690ae0be Fixed Pandora Makefile 2014-08-18 21:40:51 +02:00
Luca1991 d9c8074026 Added Italian Localization 2014-08-18 21:35:40 +02:00
TwistedUmbrella e4f227f213 Disable info display by default until internet check works 2014-08-18 21:35:40 +02:00
Stefanos Kornilios Mitsis Poiitidis 925535141a Split CFLAGS/CXXFLAGS on core.mk, warning fixes 2014-08-18 21:35:39 +02:00
Stefanos Kornilios Mitsis Poiitidis 9aa3b4b468 Echo state on websocket, hack abit the nacl makefile 2014-08-18 21:35:38 +02:00
Luca1991 2e8bb02fed CloudVMU tool added 2014-08-18 21:35:38 +02:00
Claus Østergaard ec218b5d60 Update strings.xml 2014-08-18 21:35:36 +02:00
Bryan Barnes 54ba0a06bf i loves me some markdown 2014-08-18 21:35:36 +02:00
Bryan Barnes a38c13c0da build badge! 2014-08-18 21:35:35 +02:00
Bryan Barnes 9c1532d45a updated apk path in travis.yml, not we just need a working host for uploading the builds 2014-08-18 21:35:35 +02:00
Bryan Barnes 1e7e66aaeb updated travis.yml with recent build steps 2014-08-18 21:35:34 +02:00
TwistedUmbrella 09949d8dda Remove some test changes, Use drawable swap function 2014-08-18 21:35:34 +02:00
TwistedUmbrella e8b30fb3d9 Compatibility with compilers on non-Ubuntu platforms 2014-08-18 21:35:33 +02:00
TwistedUmbrella e1b8463f10 Add the preliminary menu option to swap a utopia disk 2014-08-18 21:35:33 +02:00
TwistedUmbrella 8e7904b94b Initial testing of "coverflow" integration for XMB menus 2014-08-18 21:35:32 +02:00
TwistedUmbrella 8cfa6f856c Get filename when info disabled, Regex to avoid invalids 2014-08-18 21:35:32 +02:00
Stefanos Kornilios Mitsis Poiitidis 8e77ebce53 Cleanup textures after they are dead for a while 2014-08-18 21:35:32 +02:00
MrPsyMan 31acabbc8d Please do a sanity test before pushing your changes.
I should also start following the above advice. :p

t/y!
2014-08-18 21:35:31 +02:00
AndroidGX c6f955b6a6 French update about strings.xml
(lines and things to match latest english original strings.xml file).
2014-08-18 21:35:31 +02:00
TwistedUmbrella 038a310e7e Disable internet components when detail option disabled 2014-08-18 21:35:30 +02:00
Stefanos Kornilios Mitsis Poiitidis 5a3d19d743 Improve async/mt rendering & sync logic.
Should fix texture staging issues for now, without degrading performance
Fixes #49 (mvsc2, sf3, etc sprites)
2014-08-18 21:35:30 +02:00
TwistedUmbrella 0a98cb590a Separate joystick and dpad by default when not configured 2014-08-18 21:35:29 +02:00
TwistedUmbrella a3261aaa70 Permission for verifying network connectivity 2014-08-18 21:35:28 +02:00
TwistedUmbrella 09a70971af Preload game details to allow setting icons, faster loading 2014-08-18 21:35:28 +02:00
TwistedUmbrella 26a35e4937 Async XML loading, Move XML methods to parser class 2014-08-18 21:35:27 +02:00
TwistedUmbrella 26b3ea0b1c Make displaying game details in launcher a preference 2014-08-18 21:35:27 +02:00
TwistedUmbrella 9ef206b90b Add a proper info API, but retain the requirements for now 2014-08-18 21:35:27 +02:00
TwistedUmbrella 8ce9b2397f Add game details as webpage popup during launch process
Currently supports games with standard naming (i.e. Dead or Alive 2) or
brackets for details (i.e. Dead or Alive 2 [NTSC-J])
2014-08-18 21:35:26 +02:00
Stefanos Kornilios Mitsis Poiitidis fc48044323 Stored TA command stream persists on TA_LIST_INIT, until first actual write.
Fixes #141, "Main menus on POD and Speed Devil show up black"

Seems like the TA doesn't touch any of the memory structures before first write (and probably later on, but we're not gonna support corrupted ta streams for now)

According to p1pkin

«At least in SpeedDevils, at title screen game do a bit weird thing
 - Init TA context
 - Send lists to TA
 - Init the same context again
 - Start Render

so, if you are clear stored poly/vertex data at "TA_LIST_INIT" pvr2 reg write - you'll get black screen instead game title»
2014-08-18 21:35:26 +02:00
Stefanos Kornilios Mitsis Poiitidis ee81dd881e Ignore group_en bit (via p1pkin, should fix "18 Wheeler - Minimap tiles / not confined to map boundaries") 2014-08-18 21:35:25 +02:00
Stefanos Kornilios Mitsis Poiitidis 903b7b0240 Webui for linux 2014-08-18 21:35:25 +02:00
Stefanos Kornilios Mitsis Poiitidis 09f1805a9c WEBUI for android 2014-08-18 21:35:24 +02:00
Stefanos Kornilios Mitsis Poiitidis 80e42e6c25 Initial webui code (that does nothing useful)
I plan to port over the existing nulldc debugger stuff to a webui so we can do remote debugging on android and more
2014-08-18 21:35:24 +02:00
Stefanos Kornilios Mitsis Poiitidis 58a27e21e0 Add more missing files 2014-08-18 21:35:23 +02:00
Stefanos Kornilios Mitsis Poiitidis 9e2a116bfd Add missing file 2014-08-18 21:35:23 +02:00
Stefanos Kornilios Mitsis Poiitidis f51a461234 add libwebsocket 2014-08-18 21:35:22 +02:00
TwistedUmbrella acaaf41ad5 Fix the typo now that it is actually being referenced 2014-08-18 21:35:22 +02:00
TwistedUmbrella e9142787b8 Summary check for intent data to support specific action 2014-08-18 21:35:21 +02:00
TwistedUmbrella 88b56b02a6 Remove unnecessary exposed intents, Add toast handler 2014-08-18 21:35:21 +02:00
TwistedUmbrella 03d4f59a02 Check for alternate joystick handlers (GameKeyboard, etc.)
Remove unused imports from various activities
Verify if gamekeyboard is being used to replace hardware
Configure stock controller layout as default
2014-08-18 21:35:20 +02:00
TwistedUmbrella 437da8cd77 NativeActivity and navigational stability improvements
Improve shutdown when errors occur to prevent inability to restart
Reduce the context for launching activities to local application
Error checking when launching the native touchpad interface
2014-08-18 21:35:20 +02:00
ptitSeb 40a085b841 PANDORA: No mic on Pandora for now 2014-08-18 21:35:19 +02:00
ptitSeb 93c56d803c PANDORA: Options and GUI 2014-08-18 21:33:16 +02:00
ptitSeb 08b34969aa Fixed Pandora Makefile 2014-08-18 21:29:49 +02:00
ptitSeb cfb74c4ebf PANDORA: played with ccache 2014-08-18 21:29:48 +02:00
ptitSeb 32c0aa4ac3 Added back manual frameskip due to forum request 2014-08-18 21:26:03 +02:00
ptitSeb 8388210b2b compilations fixes for Pandora 2014-08-18 21:17:20 +02:00
ptitSeb 8ebf06e0da Merge remote-tracking branch 'origin/master' into pandora 2014-08-18 21:15:11 +02:00
TwistedUmbrella 115504ed50 Support basic debug plugin when app unavailable 2014-08-16 13:35:31 -04:00
Mathieu Comandon 04eb34adc6 Add linux build files to gitignore 2014-08-08 21:38:35 +02:00
Mathieu Comandon fa1c8bdb1c Update README with Linux build instructions 2014-08-08 21:27:59 +02:00
TwistedUmbrella bc6870a9ca Merge pull request #514 from LoungeKatt/master
Revert filesystem changes [testing], RS sensitivity, merge r7-sprint
2014-08-02 12:47:16 -04:00
TwistedUmbrella dcc5c6dce6 Merge pull request #505 from kitrio/patch-2
Update strings.xml
2014-08-02 12:45:15 -04:00
Stefanos Kornilios Mitsis Poiitidis 8dfc8f45f8 Add diagonials 2014-08-02 12:44:41 -04:00
Stefanos Kornilios Mitsis Poiitidis 5e66c99233 Fix immersive mode & gl resize
- Pass raw width & height to internal C/C++ code, so that resizes propagate
- Fixes input button & image missalignment on 4.4+
2014-08-02 12:44:30 -04:00
TwistedUmbrella dada5fb520 Retain permissions, Lower RS sensitivity limit 2014-07-29 20:24:42 -04:00
TwistedUmbrella e7037fe638 Revert "Add permissions and directory changes for KitKat"
This reverts commit 334431e786ccc0b822a06a339f20dd358c3ee580.
2014-07-29 20:24:30 -04:00
TwistedUmbrella 2cbf70b7c6 Revert "Rough draft of file handler for KitKat restrictions"
This reverts commit 512def9f1995777bc2960996b0960a6500e41d00.
2014-07-29 20:24:17 -04:00
TwistedUmbrella 38fedcab5f Revert "Revert the user directory after copy procedure"
This reverts commit f8f30cee1649240aef2c29e51aaee6bac34cccdb.
2014-07-29 20:23:47 -04:00
Stefanos Kornilios Mitsis Poiitidis 3ba9170ec8 Add diagonials 2014-07-26 11:53:18 +03:00
Stefanos Kornilios Mitsis Poiitidis 08bed69c95 Fix detected branch name
My git-fu needs some practice...
2014-07-24 16:58:59 +03:00
Stefanos Kornilios Mitsis Poiitidis a05760260e Move debugbreak to os module 2014-07-24 16:54:04 +03:00
Stefanos Kornilios Mitsis Poiitidis 55cc9d28db travis: keep commit branch 2014-07-24 16:43:03 +03:00
Stefanos Kornilios Mitsis Poiitidis 7d2a1d9556 Fix immersive mode & gl resize
- Pass raw width & height to internal C/C++ code, so that resizes propagate
- Fixes input button & image missalignment on 4.4+
2014-07-24 13:32:15 +03:00
Stefanos Kornilios Mitsis Poiitidis a3728d146f Update gitignore 2014-07-24 11:31:09 +03:00
TwistedUmbrella e2dc6725bb Merge pull request #510 from seanstar12/master
Added adjustable vibration duration
2014-07-17 02:07:23 -04:00
Sean Starnes e0e25d0668 Added adjustable vibration duration 2014-07-15 21:38:14 -05:00
TwistedUmbrella 1095ffbcf1 Merge pull request #508 from LoungeKatt/master
Rough draft of file handler for KitKat restrictions
2014-07-11 23:02:42 -04:00
TwistedUmbrella 307344a3ec Revert the user directory after copy procedure 2014-07-10 14:01:43 -04:00
TwistedUmbrella e30f181628 Rough draft of file handler for KitKat restrictions 2014-07-10 13:58:22 -04:00
TwistedUmbrella 823cd76345 Merge pull request #507 from LoungeKatt/master
Handle trigger inputs regardless of R stick config
2014-07-07 11:40:48 -04:00
TwistedUmbrella 3fbc58cf0f Handle trigger inputs regardless of R stick config 2014-07-07 11:37:25 -04:00
hooby3dfx d405d8157f Merge pull request #506 from hooby3dfx/master
minor tweak to mic support
2014-07-05 22:43:47 -04:00
kitrio e4deef3da2 Update strings.xml
improve korean translatation
2014-07-05 20:58:55 +09:00
Stefanos Kornilios Mitsis Poiitidis 531863bca4 Fix rendering: GL3+ needs VAO, initialize screen_width/screen_height
*yay* it works now *dances*
2014-06-27 00:51:57 +03:00
Stefanos Kornilios Mitsis Poiitidis 6d6cf7d055 Call correct Texture/texture2d 2014-06-25 22:47:40 +03:00
Stefanos Kornilios Mitsis Poiitidis a1dfeb19e1 Partial port to opengl.
I forgot how much opengl sucked, so I figured I might try a port.

Nvidia doesn't draw (must be some fragment binding issue?, randomlulz returns GL_INVALID on glAttribPtr as well)
Intel doesn't compile the shader (and the error message makes no real sense. wut?)
Amd driver simply crashes (wheehaa)

All and all, doesn't look like much has changed in opengl the past 10 years, apart from even uglier initialization and more fragmented specs ~
2014-06-25 22:47:39 +03:00
Stefanos Kornilios Mitsis Poiitidis 43def486b3 Merge pull request #501 from reicast/skmp/gdtool
Fix coreio/fclose leak, -info-basename option for gdtool
2014-06-25 17:55:58 +03:00
Stefanos Kornilios Mitsis Poiitidis ac31cced87 Remove dead code 2014-06-23 01:31:17 +03:00
Stefanos Kornilios Mitsis Poiitidis 0ae8e0ebc8 fclose properly, 0 on coreio_open fail 2014-06-23 01:31:04 +03:00
Stefanos Kornilios Mitsis Poiitidis 4084fd1ced gdtoo: file basename on json with -info-basename 2014-06-20 11:19:42 +03:00
Stefanos Kornilios Mitsis Poiitidis 4c67940eb5 Merge pull request #499 from reicast/skmp/gdtool
skmp/gdtool
2014-06-19 01:19:15 +03:00
Stefanos Kornilios Mitsis Poiitidis 2079ba2558 Add builds.reicast.com 2014-06-19 01:17:57 +03:00
Stefanos Kornilios Mitsis Poiitidis 0d3172fd69 Fix gdtool build, fseek bugfix for coreio 2014-06-19 00:38:31 +03:00
Stefanos Kornilios Mitsis Poiitidis e938844387 Windows: 720p window 2014-06-17 22:38:07 +03:00
Stefanos Kornilios Mitsis Poiitidis fa09664ce5 Merge pull request #498 from LoungeKatt/master
Add permissions and directory changes for KitKat
2014-06-17 15:36:23 +03:00
TwistedUmbrella fed435b4fb Add permissions and directory changes for KitKat 2014-06-17 06:30:28 -04:00
Stefanos Kornilios Mitsis Poiitidis 314298a4d9 Merge pull request #496 from reicast/gdtool-refactor
gdtool: better command line, stdin lists, cleanup
2014-06-13 19:02:21 +03:00
Stefanos Kornilios Mitsis Poiitidis 0ea8f2290a Travis-ci: enable notifications to irc 2014-06-13 19:00:10 +03:00
Stefanos Kornilios Mitsis Poiitidis d59197f843 gdtool: better command line, stdin lists, cleanup
Also, imgread const filenames and such
2014-06-13 18:41:48 +03:00
Stefanos Kornilios Mitsis Poiitidis 16bee22105 Merge pull request #491 from reicast/http-chd
Http chd wip
2014-06-11 18:00:09 +03:00
Stefanos Kornilios Mitsis Poiitidis 4fbfb3bed9 S3 deploy for travis, listing at builds.reicast.com ~ 2014-06-11 17:40:44 +04:00
MrPsyMan 7916cd63f3 Removed commit ed8c25ef7c as it causes compatibility problems. 2014-06-05 04:34:25 +03:00
MrPsyMan bf9275f3d0 Merge branch 'r7-rc' of https://github.com/reicast/reicast-emulator into r7-rc 2014-06-05 04:29:29 +03:00
MrPsyMan 101952c38b Reverted commit ed8c25ef7c as it creates compatibility issues. 2014-06-05 04:24:32 +03:00
TwistedUmbrella d73d899898 Merge pull request #486 from LoungeKatt/master
Merge settings and paths for simpler menu system
2014-06-02 13:06:12 -04:00
TwistedUmbrella f1bdc306e6 Relabel native interface to warn users that it lacks OSD 2014-06-02 13:02:24 -04:00
TwistedUmbrella 2a8b099ac5 Clear the image from memory before resizing it 2014-06-02 12:59:15 -04:00
Stefanos Kornilios Mitsis Poiitidis 8194c1e24a Added missing coreio/* files... 2014-06-01 13:54:11 +03:00
Stefanos Kornilios Mitsis Poiitidis 248bea39a9 Refactor coreio, fix for linux, make it build 2014-06-01 13:38:48 +03:00
ptitSeb ae5fa8c0e1 some fixes for Pandora 2014-05-27 22:00:17 +02:00
ptitSeb 5d9757ffef Merge branch 'r7-rc' of https://github.com/reicast/emulator into pandora
Conflicts:
	core/hw/pvr/Renderer_if.cpp
2014-05-27 19:55:53 +02:00
ptitSeb 9de2393bc0 added frameskip back, has asked in openpandora forum 2014-05-27 19:47:12 +02:00
TwistedUmbrella 0b5c991f0e Add wifi status permission for network availability 2014-05-27 01:58:48 -04:00
TwistedUmbrella 74ca093da3 Reduce, reuse, recycle (Even when it's a function) 2014-05-27 01:58:43 -04:00
TwistedUmbrella 4759b4fafb Add support for swapping BIOS files in local data folder 2014-05-27 01:58:43 -04:00
TwistedUmbrella b6aa26f5c9 Merge settings and paths for simpler menu system 2014-05-27 01:58:43 -04:00
Stefanos Kornilios Mitsis Poiitidis 2bd1c4c976 First idea for a gdrom tool 2014-05-26 15:35:41 +03:00
Karen Tsai 8ffb16df2b Removed more low-quality and unused UI images, updated emulator view controller. 2014-05-23 20:40:32 -04:00
Karen Tsai c5549a6106 Updated iOS front end, removed low quality UI images. Need to make better ones using the Android UI images. 2014-05-23 20:33:05 -04:00
TwistedUmbrella 24e9658a53 Merge pull request #487 from AndroidGX/patch-2
French translation update
2014-05-21 17:25:43 -04:00
AndroidGX ff65c9679c French translation update 2014-05-21 22:01:49 +02:00
Stefanos Kornilios Mitsis Poiitidis c6f62c66bd chd over http support (EXPERIMENTAL AND SLOW) 2014-05-21 20:07:59 +03:00
Karen Tsai 50b5fedc5f Merge pull request #485 from LoungeKatt/master
Add explicit casting for iOS, Import iOS EGL headers
2014-05-20 23:48:03 -04:00
TwistedUmbrella c3b1e1087e Add explicit casting for iOS, Import iOS EGL headers
EGL headers imported from https://github.com/alco/EGL_mac_ios for use
in iOS specialty directory
2014-05-20 23:45:38 -04:00
Karen Tsai 88d4e73f03 …And fixed a typo that was somehow made during the process of cutting-and-pasting. 2014-05-20 19:00:54 -04:00
Karen Tsai 370fa02b5c Massive build fix for iOS, ngen_arm.S (ARM JIT core) now compiles! The next goal… fix OGLES2. Because that’s completely broken. Also, updated .gitignore to properly ignore iOS build artifacts. 2014-05-20 18:58:41 -04:00
TwistedUmbrella 9e76688a6c Merge pull request #482 from LoungeKatt/master
Proper immersive view for the main menu layouts
2014-05-20 12:26:05 -04:00
TwistedUmbrella 2113dc503f Merge pull request #483 from Luca1991/master
Removed some unused localization strings
2014-05-20 12:25:26 -04:00
TwistedUmbrella 1d3a0a633b Attempt to avoid some contextual issues with info display 2014-05-20 12:24:23 -04:00
Luca1991 f993a1aea7 Removed some unused localization strings (maybe used for debug purposes in the past??) that caused some compilation warnings 2014-05-20 00:05:20 +02:00
TwistedUmbrella 45a3cff0d5 Proper immersive view for the main menu layouts 2014-05-19 14:20:06 -04:00
TwistedUmbrella 07c8e60ad7 Merge pull request #481 from Luca1991/master
Added Italian Localization
2014-05-18 16:49:22 -04:00
ptitSeb 937e28e04d rebasing 2014-05-18 20:10:00 +02:00
ptitSeb 948a3afcf6 Small update to Makefile 2014-05-18 20:08:18 +02:00
ptitSeb 2530cd330e PANDORA: No mic on Pandora for now 2014-05-18 20:07:15 +02:00
ptitSeb 3445276c60 PANDORA: Options and GUI 2014-05-18 20:04:46 +02:00
ptitSeb 260d9f7f57 Fixed Pandora Makefile 2014-05-18 19:58:28 +02:00
Luca1991 911bade123 Added Italian Localization 2014-05-18 18:38:05 +02:00
Stefanos Kornilios Mitsis Poiitidis aba6278213 Merge pull request #479 from LoungeKatt/master
Fixing the game info display
2014-05-15 15:52:18 -07:00
TwistedUmbrella 724109d02f Disable info display by default until internet check works 2014-05-15 09:32:43 -04:00
TwistedUmbrella ebeef1ddaf Merge pull request #474 from Luca1991/master
CloudVMU tool added
2014-05-13 19:03:57 -04:00
Stefanos Kornilios Mitsis Poiitidis f0b7d92262 Merge pull request #470 from coestergaard/patch-3
Update strings.xml
2014-05-12 20:55:29 +03:00
Stefanos Kornilios Mitsis Poiitidis ee2a1b7d20 Split CFLAGS/CXXFLAGS on core.mk, warning fixes 2014-05-12 20:53:43 +03:00
Stefanos Kornilios Mitsis Poiitidis 5f72bb34df Echo state on websocket, hack abit the nacl makefile 2014-05-12 20:53:42 +03:00
Luca1991 99e4f8b47f CloudVMU tool added 2014-05-11 18:53:28 +02:00
Claus Østergaard edfe1600ce Update strings.xml 2014-05-10 09:25:59 +02:00
Bryan Barnes ded16cf484 i loves me some markdown 2014-05-09 22:32:42 -04:00
Bryan Barnes b099888f5d build badge! 2014-05-09 22:31:05 -04:00
Bryan Barnes 868d77bf14 updated apk path in travis.yml, not we just need a working host for uploading the builds 2014-05-09 22:28:28 -04:00
Bryan Barnes 6241300c8f updated travis.yml with recent build steps 2014-05-09 22:16:29 -04:00
MrPsyMan aaf23eae46 Merge pull request #468 from LoungeKatt/master
Remove some test changes, Use drawable swap function
2014-05-09 22:05:38 +03:00
TwistedUmbrella 6ad8c9ac11 Remove some test changes, Use drawable swap function 2014-05-09 14:33:54 -04:00
MrPsyMan c01fad3f61 Merge pull request #460 from LoungeKatt/master
Get filename when info disabled, Regex to avoid invalids
2014-05-09 17:47:08 +03:00
TwistedUmbrella 9639e47802 Compatibility with compilers on non-Ubuntu platforms 2014-05-08 00:18:48 -04:00
TwistedUmbrella 64e50d0dab Add the preliminary menu option to swap a utopia disk 2014-05-08 00:02:42 -04:00
TwistedUmbrella c5c57b77ec Initial testing of "coverflow" integration for XMB menus 2014-05-08 00:02:42 -04:00
TwistedUmbrella 42f4085ed1 Get filename when info disabled, Regex to avoid invalids 2014-05-08 00:02:42 -04:00
Stefanos Kornilios Mitsis Poiitidis f1ef4877b8 Cleanup textures after they are dead for a while 2014-05-08 04:29:14 +03:00
MrPsyMan 2d8f2dd6b0 Please do a sanity test before pushing your changes.
I should also start following the above advice. :p

t/y!
2014-05-08 02:22:31 +03:00
Stefanos Kornilios Mitsis Poiitidis fee9e5123a Merge pull request #462 from AndroidGX/patch-1
French update about strings.xml
2014-05-07 14:28:14 +03:00
AndroidGX 150a129818 French update about strings.xml
(lines and things to match latest english original strings.xml file).
2014-05-05 22:40:24 +02:00
TwistedUmbrella aca3da42ab Merge pull request #457 from LoungeKatt/master
Temporary fix for names not matching requirements
2014-05-04 17:05:40 -04:00
TwistedUmbrella 933a36b5c4 Disable internet components when detail option disabled 2014-05-04 17:03:09 -04:00
Stefanos Kornilios Mitsis Poiitidis 411aade5e2 Improve async/mt rendering & sync logic.
Should fix texture staging issues for now, without degrading performance
Fixes #49 (mvsc2, sf3, etc sprites)
2014-05-02 03:45:31 +03:00
TwistedUmbrella a937428115 Merge pull request #440 from LoungeKatt/master
Add game information to launch process
2014-05-01 11:11:53 -04:00
TwistedUmbrella 4e40430a13 Separate joystick and dpad by default when not configured 2014-04-30 01:53:56 -04:00
TwistedUmbrella 122f1bbcb7 Permission for verifying network connectivity 2014-04-29 20:47:53 -04:00
TwistedUmbrella 8b76e84654 Preload game details to allow setting icons, faster loading 2014-04-29 20:33:25 -04:00
TwistedUmbrella 809a1afa28 Async XML loading, Move XML methods to parser class 2014-04-29 20:32:36 -04:00
TwistedUmbrella 5b94408a63 Make displaying game details in launcher a preference 2014-04-29 20:32:36 -04:00
TwistedUmbrella 4c965b883c Add a proper info API, but retain the requirements for now 2014-04-29 20:32:36 -04:00
TwistedUmbrella 9de771f30e Add game details as webpage popup during launch process
Currently supports games with standard naming (i.e. Dead or Alive 2) or
brackets for details (i.e. Dead or Alive 2 [NTSC-J])
2014-04-29 20:32:36 -04:00
Stefanos Kornilios Mitsis Poiitidis 207a063fa1 Merge branch 'master' of https://github.com/reicast/reicast-emulator 2014-04-25 19:58:30 +03:00
Stefanos Kornilios Mitsis Poiitidis 4492654a52 Stored TA command stream persists on TA_LIST_INIT, until first actual write.
Fixes #141, "Main menus on POD and Speed Devil show up black"

Seems like the TA doesn't touch any of the memory structures before first write (and probably later on, but we're not gonna support corrupted ta streams for now)

According to p1pkin

«At least in SpeedDevils, at title screen game do a bit weird thing
 - Init TA context
 - Send lists to TA
 - Init the same context again
 - Start Render

so, if you are clear stored poly/vertex data at "TA_LIST_INIT" pvr2 reg write - you'll get black screen instead game title»
2014-04-25 19:57:34 +03:00
Stefanos Kornilios Mitsis Poiitidis 35e357ad66 Ignore group_en bit (via p1pkin, should fix "18 Wheeler - Minimap tiles / not confined to map boundaries") 2014-04-25 19:52:27 +03:00
Stefanos Kornilios Mitsis Poiitidis 3eb27fc109 Compiles and links for linux x86. No worky yet.
Woohoo, a new gcc bug!
The x86 linux dynarec just got a couple of months further away thanks to gcc being totally retarded as some things (namely, fastcalls). And yes, reicast depends on fastcalls for a lot of things, and no, i don't care if you don't like fastcalls.
2014-04-25 12:54:25 +03:00
Stefanos Kornilios Mitsis Poiitidis 8081a3d06a Webui for linux 2014-04-25 06:26:36 +03:00
Stefanos Kornilios Mitsis Poiitidis 5fee692c31 WEBUI for android 2014-04-25 05:59:53 +03:00
Stefanos Kornilios Mitsis Poiitidis 5e25bfd507 Initial webui code (that does nothing useful)
I plan to port over the existing nulldc debugger stuff to a webui so we can do remote debugging on android and more
2014-04-23 00:04:22 +03:00
Stefanos Kornilios Mitsis Poiitidis 8b683a77a6 Add more missing files 2014-04-22 16:30:12 +03:00
Stefanos Kornilios Mitsis Poiitidis 4596bcc11b Add missing file 2014-04-22 16:23:20 +03:00
Stefanos Kornilios Mitsis Poiitidis 2f5bec2304 add libwebsocket 2014-04-22 16:15:54 +03:00
TwistedUmbrella 62cc877d69 Fix the typo now that it is actually being referenced 2014-04-07 16:28:24 -04:00
TwistedUmbrella 91800aec5e Summary check for intent data to support specific action 2014-04-07 04:47:55 -04:00
TwistedUmbrella 1e80306577 Remove unnecessary exposed intents, Add toast handler 2014-04-06 23:03:44 -04:00
TwistedUmbrella dafc502274 Check for alternate joystick handlers (GameKeyboard, etc.)
Remove unused imports from various activities
Verify if gamekeyboard is being used to replace hardware
Configure stock controller layout as default
2014-04-06 00:00:49 -04:00
TwistedUmbrella ea80157d2e NativeActivity and navigational stability improvements
Improve shutdown when errors occur to prevent inability to restart
Reduce the context for launching activities to local application
Error checking when launching the native touchpad interface
2014-04-05 13:25:42 -04:00
ptitSeb 7f2bf9432d Merge branch 'master' into pandora
Conflicts:
	core/hw/aica/sgc_if.cpp
	core/hw/maple/maple_devs.cpp
	core/sdl/main.cpp
2014-04-04 22:33:54 +02:00
TwistedUmbrella 014daafa2a Fix return intent from games, Fix touchscreen in native mode 2014-04-04 01:12:30 -04:00
TwistedUmbrella 0ba8350c3a Make sure the additional destroy code is actually executed 2014-04-03 16:59:37 -04:00
TwistedUmbrella 04db66dc6e Fix some build issues, Add an initialization stability check 2014-04-03 03:42:49 -04:00
TwistedUmbrella 9594444129 French language updates - @AndroidGX 2014-04-03 03:23:26 -04:00
TwistedUmbrella 9162a927c4 Handle explicit intent internally for single generic public intent
This will fix apps like Nostalgia crashing because of a “bug” that is
created when the intent is not specifically provided
2014-04-03 02:33:46 -04:00
TwistedUmbrella 164b93be98 Move joystick option below custom and compat requirements 2014-03-27 11:51:11 -04:00
TwistedUmbrella a1a3d02d2c Steps to prevent accidentally leaving linked options enabled 2014-03-26 21:41:26 -04:00
TwistedUmbrella f8a18c3abe Enable hardware accelerated view if GPU rendering enabled 2014-03-26 21:41:15 -04:00
Stefanos Kornilios Mitsis Poiitidis 9fbf7c972b Merge pull request #422 from coestergaard/patch-1
Updated to match latest English file
2014-03-26 11:45:04 +02:00
Claus Østergaard 71b5e7ae93 Updated to match latest English file 2014-03-25 18:47:33 +01:00
Stefanos Kornilios Mitsis Poiitidis ad054f1b96 Working on linux x86 dyna 2014-03-25 00:12:30 +02:00
Stefanos Kornilios Mitsis Poiitidis 78f45da8da gles2 works w/ the correct packages 2014-03-24 23:20:21 +02:00
Stefanos Kornilios Mitsis Poiitidis 1d0a297a45 bugfix in libzip 2014-03-24 23:19:59 +02:00
Stefanos Kornilios Mitsis Poiitidis e356515198 compiles for lin86 (no rendering yet) 2014-03-20 17:13:53 +02:00
TwistedUmbrella a687285c81 Decide parameters based on activity rather than application 2014-03-18 16:09:18 -04:00
MrPsyMan ecbe828cfa Previous commit was one byte short. 2014-03-15 13:51:16 +02:00
MrPsyMan 6b4deb4b16 Implemented a very basic form of GD-ROM Sense. Only disc swap related Sense currently works. Added some very basic disc swap handling on x86/Windows (press "0">Cancel to remove disc, then "0" again and select the new disc).
Notes:
Disc swapping should work on .gdi files (probably .chd files too).
Swapping with .cdi files is not currently supported because we currently create inaccurate TOC for them.
Only x86/Windows has a disc swap handler right now (ie: you can't swap on Android).
2014-03-15 13:42:17 +02:00
Stefanos Kornilios Mitsis Poiitidis e6ac0e4918 Merge branch 'master' of https://github.com/reicast/reicast-emulator 2014-03-13 21:49:12 +02:00
Stefanos Kornilios Mitsis Poiitidis 5fd8eb8903 widescreen compitable bg clear (fixes widescreen mode) 2014-03-13 21:49:02 +02:00
TwistedUmbrella f2622f07bb Verify if compatibility mode requires the joystick - D-pad hack 2014-03-12 11:19:02 -04:00
Bryan Barnes fbf049cff1 tweaked mic for better voice input - need to test 2014-03-11 22:31:46 -04:00
Bryan Barnes b64dab5e01 added sdk note to readme 2014-03-11 22:30:14 -04:00
TwistedUmbrella 6097b6f5b0 Fix a preference typo and references for pre API 11 missing 2014-03-09 10:53:13 -04:00
Lioncash cc1fdb28db Fix a tiny typo in the missing BIOS message. 2014-03-08 18:32:38 -05:00
Lioncash d2524dea99 Merge pull request #401 from lioncash/fix-filebrowser
Fix case where the file list would cause a crash.
2014-03-08 17:17:39 -05:00
Lioncash 35cd0e1d38 Fix file list crash.
Fixes a stupid oversight that is entirely my fault.
2014-03-08 17:14:36 -05:00
TwistedUmbrella 27ee791d71 This should get the menus back to working properly again 2014-03-08 14:55:30 -05:00
TwistedUmbrella 2b9926d397 Remove unused functions, libs, imports, etc for externals 2014-03-06 06:08:51 -05:00
TwistedUmbrella 73c75b7a79 Pulling out all the resources being hosted privately 2014-03-06 05:13:32 -05:00
Lioncash acd0c58979 [Android] Remove unused imports. 2014-03-06 04:59:59 -05:00
Lioncash 3640293f40 [Android] Join a duplicate if statement in InputFragment's MOGAListener. 2014-03-06 04:54:55 -05:00
Lioncash c354e09676 [Android] Make MOGAInput's activity context private.
Also make the class final.
2014-03-06 04:41:32 -05:00
TwistedUmbrella 8dc18039be Merge pull request #400 from 0002647302/master
isEmpty() is an API 9 + call. Currently we still support 8+
2014-03-06 04:38:09 -05:00
TwistedUmbrella db1f4d24c5 isEmpty() is an API 9 + call. Currently we still support 8+ 2014-03-06 04:36:52 -05:00
TwistedUmbrella 03231f51f2 Merge pull request #399 from 0002647302/master
Remove the git display from the main interface, It is debug
2014-03-06 04:32:41 -05:00
TwistedUmbrella c29dd5d60b Remove the git display from the main interface, It is debug 2014-03-06 04:32:17 -05:00
Lioncash e9891118f7 [Android] Kill off unnecessary getString calls. 2014-03-06 04:28:47 -05:00
Lioncash 08d40fe44f [Android] Simplify display metrics retrieval in Config.java. 2014-03-06 04:11:29 -05:00
TwistedUmbrella 4b98fe2cb5 Merge pull request #398 from 0002647302/master
This is cleanup after recent changes
2014-03-06 04:08:43 -05:00
TwistedUmbrella 6da7b865d9 [Android] Clean up for things only being done halfway.
Changing from a collection to an array back to a collection was just
adding a lot of unnecessary overhead. This removes that pointless
process and adds the previous changes to the second activity for
handling controllers.
2014-03-06 04:05:29 -05:00
Lioncash d085678817 [Android] Tiny cleanup to InputFragment.java.
Mild side-cleanup to OptionsFragment.java. Purely minor.
2014-03-06 04:04:36 -05:00
Lioncash 1439200253 [Android] Clean up InputModFragment.java
Replace parentActivity calls to getResources with just a direct call.
Replace hardcoded strings.
Remove pointless String.valueOf calls.
Remove the parentActivity. Again, this is totally unnecessary.
2014-03-06 03:56:10 -05:00
Lioncash a6bfd58a00 [Android] Clean up ConfigureFragment.java.
Call getResources directly.
Kill off parentActivity class variable. Absolutely pointless if it's used only in one method.

Fix up the atrocious line breaks.
2014-03-06 03:43:09 -05:00
TwistedUmbrella f7a651f2a7 Update the listing for the buildbot now that it is all in-app 2014-03-06 03:35:44 -05:00
Lioncash d90243a2c9 [Android] Replace string .equals("") tests in conditionals with .isEmpty() 2014-03-06 03:28:15 -05:00
Lioncash 7924f11284 [Android] Turns out some other class variables were able to be made private too in FileBrowser.java.
Removed the privacy level specifiers in the interface OnItemSelectedListener. public is implicit for any interface method.
2014-03-06 03:17:48 -05:00
TwistedUmbrella 0e7fb27a8d Refactor in @hooby3dfx FPS color choice, Remove alpha 2014-03-06 03:15:25 -05:00
Lioncash 9937875d38 [Android] Make the DirSort class a private static final class in FileBrowser.java.
It's used nowhere else and leaving it as package local is just stupid.
2014-03-06 03:14:44 -05:00
Lioncash 2e3bb791ab [Android] Bump the Eclipse config for the android app to be compliant with 1.6
Sorta weird this wasn't already set to this, considering Android uses 1.6 (and a hacky/crappy syntax only version of 1.7 if you consider 4.4+)
2014-03-06 03:12:20 -05:00
Lioncash 19b23a411f [Android] Convert some for loops to foreach loops in FileBrowser.java.
Also make an anonymous class method parameter more readable. Anything is better than arg[x].
2014-03-06 03:04:42 -05:00
Lioncash 6e65e8d565 [Android] Use File's getPath() and not toString() to communicate intent in saveScreenshot().
Both do the exact same thing, but one is way more indicative of intent here.

Also removed an unnecessary flush. This happens upon calling .close.
2014-03-06 02:42:35 -05:00
Karen Tsai c2b4f6b799 Merge branch 'master' of https://github.com/reicast/reicast-emulator 2014-03-06 02:38:19 -05:00
Karen Tsai ccea066331 Fixed the About view. Again. 2014-03-06 02:38:06 -05:00
Lioncash 586c30b383 Remove a totally pointless null comparison in MainActivity.java.
Also kill off a case where null literally won't happen in FileBrowser.java.
2014-03-06 02:37:38 -05:00
Karen Tsai a7df171c0c Made the menu button actually functional, fixed one of the menu buttons which was somehow misplaced off to the right, Git information now appears in the Version UILabel, the About screen is now somewhat functional, cleaned up the Settings page, changed the Paths page so that we aren’t yelling at the poor user in all caps. 2014-03-06 02:30:54 -05:00
Lioncash 37eb9d26c8 Kill off some checking for Integer being null in GL2JNIActivity.java. These will never be null, since the functions return a primitive int. 2014-03-06 02:19:30 -05:00
Lioncash 6e3ab6d62c Fix tab/space mismatches in the Android project. 2014-03-06 02:09:57 -05:00
Lioncash 6c123ad04b Replace some Integer.valueOf calls with Integer.parseInt in ConfigureFragment.java. Boxing to an Integer isn't necessary here. 2014-03-06 01:58:05 -05:00
Karen Tsai 72c40fa61a Changed “Sound” to “Disable Sound” in the iOS UI for consistency with the Android UI. 2014-03-06 01:55:06 -05:00
Karen Tsai a147b1023d Added a bunch of placeholder-quality images to the iOS UI from the Android UI. I’ll fix them tomorrow. 2014-03-06 01:52:04 -05:00
Lioncash d19e258ba1 Externalize some strings from the Android MainActivity java file and put them in the XML.
Also changed the error title of the AlertDialog depending on whether the Flash ROM or BIOS are missing.
2014-03-06 01:41:42 -05:00
Karen Tsai 1c30ca0dbf Revised and updated the Japanese localisation. 2014-03-06 01:10:07 -05:00
Karen Tsai 20b9239602 Revised English localisation. 2014-03-06 01:08:51 -05:00
Karen Tsai c583c59073 Fixed the side drawer identifiers so now the buttons actually well, work. 2014-03-05 23:04:45 -05:00
Karen Tsai 0529078510 Added various images used by the frontend, added buttons. (The emulator view won’t be horizontal in the future). 2014-03-05 22:59:43 -05:00
Karen Tsai 48522a747f Changed iOS target to iOS 5.0, removed arm64 slice, modified README.md, added an initial iOS frontend, added empty subclasses, added debugging entitlements plist to fix lldb, recreated the entire xcodeproj (it was somewhat required), removed iPad storyboard, removed code-signing requirements, modified AppDelegate to fix view controller status bar tint colors for iOS 7 and 6. 2014-03-05 22:26:47 -05:00
Karen Tsai b7e9802e06 Added more filetypes to gitignore, mostly build artifacts that should never be checked into version control. 2014-03-05 19:32:42 -05:00
Karen Tsai ec08d462b5 Added iOS artifacts to .gitignore. 2014-03-05 19:29:34 -05:00
Stefanos Kornilios Mitsis Poiitidis ebe56d6778 Add mips support (woohoo makefiles are a mess nao) 2014-03-05 12:24:03 +02:00
Stefanos Kornilios Mitsis Poiitidis 7d32a66044 Fix win86 default 2014-03-05 12:22:26 +02:00
TwistedUmbrella f2961bd779 Merge pull request #385 from 0002647302/master
Invert the native activity preference until adjusted for x86
2014-03-05 04:56:13 -05:00
TwistedUmbrella 39a0417d5b Import Google Services, Clean up the debug tool for builds 2014-03-04 15:50:16 -05:00
TwistedUmbrella 256347d947 Submit a local test of the git-based build update downloads 2014-03-04 15:15:12 -05:00
TwistedUmbrella 3bb036741b Gather most of the basic preferences as referenced statics 2014-03-04 09:28:22 -05:00
TwistedUmbrella 8d8cf6da00 Incremental submission of the static pref reference transition 2014-03-04 09:01:09 -05:00
TwistedUmbrella 6a757bb43e Fix compiling the secondary library, Begin prefs integration 2014-03-04 08:48:41 -05:00
TwistedUmbrella 0567e8a117 Invert the native activity preference until adjusted for x86 2014-03-04 08:05:36 -05:00
TwistedUmbrella 31d6b7e3f1 Merge pull request #384 from reicast/native
Pulling more changes from the Native branch
2014-03-04 03:56:47 -05:00
TwistedUmbrella 0847b8b7e6 Restore the configuration loading to the original placement 2014-03-04 03:53:12 -05:00
TwistedUmbrella 0c012d4e8e Merge pull request #382 from reicast/native
Native
2014-03-04 03:43:17 -05:00
TwistedUmbrella 788e48bde3 Kinda defeats the purpose of visual differentiation with this
Can’t really tell a local build from a stock build if they both have
the same label. Be gone you!
2014-03-04 03:40:16 -05:00
TwistedUmbrella 3954d719f5 Streamline the build process to prevent possibility for errors 2014-03-04 03:32:12 -05:00
TwistedUmbrella ba9094747f Clean up the results of a blind copy-paste implementation 2014-03-03 20:30:34 -05:00
TwistedUmbrella a6407a52b4 Relocate the entire logging process to prevent any issues 2014-03-03 20:24:02 -05:00
TwistedUmbrella f3f172c64d Merge pull request #378 from reicast/native
Integrate an inline messaging system using Android GCM
2014-03-03 17:39:23 -05:00
TwistedUmbrella 97fb628797 This may help reduce the possibility for error in the Mogas 2014-03-03 17:38:17 -05:00
TwistedUmbrella 8a34119c5d Missed that secondary platform-dependent command call 2014-03-03 17:36:01 -05:00
TwistedUmbrella deba6cbcd1 Fix automated NDK build on windows, Add x86 to touchpad 2014-03-03 17:31:09 -05:00
TwistedUmbrella b14440970b Fix the server counterpart to be able to use JSON parsing 2014-03-03 16:40:29 -05:00
TwistedUmbrella 20291c57e8 Add the option to disable the debug message notifications 2014-03-03 15:08:37 -05:00
TwistedUmbrella 60df320f4c Add expanded message when clicking on an individual item 2014-03-03 11:58:29 -05:00
TwistedUmbrella ad4ecbab0e Integrate an inline messaging system using Android GCM 2014-03-03 11:40:49 -05:00
Stefanos Kornilios Mitsis Poiitidis 78ad0d6044 Merge branch 'master' of https://github.com/reicast/reicast-emulator 2014-03-03 14:18:13 +02:00
Stefanos Kornilios Mitsis Poiitidis ac2501549f Initial support for android-x86 (no idea if this actually works)
This is ugly, done via HOST_NO_REC, NOT_ARM. Only if I had merged the clean-makefiles work before rls... Oh well.
2014-03-03 14:06:00 +02:00
TwistedUmbrella 9d248886ba Merge pull request #376 from reicast/native
Fixes, Updates, Documentation, Etc
2014-03-03 02:53:47 -05:00
TwistedUmbrella 504bf1b299 Merge pull request #359 from ramersonw/patch-2
Added some missing strings
2014-03-03 02:53:28 -05:00
TwistedUmbrella d6369f9d04 Reverse the notation about commenting the NDK_VERSION 2014-03-02 23:54:16 -05:00
TwistedUmbrella 8047074982 Let them reboot if they ignore the warning. At least we tried 2014-03-02 23:44:31 -05:00
TwistedUmbrella ee88660820 Add the controller interface platform to the readme as well 2014-03-02 23:40:30 -05:00
TwistedUmbrella 843d667740 Clean up the Moga interface to begin diagnosing breakage 2014-03-02 23:36:52 -05:00
TwistedUmbrella 2f902ed5e2 Notify users of an unsupported kernel, Pending version ID 2014-03-02 23:26:50 -05:00
TwistedUmbrella 4c034740ea Reference strings over hardcoded text, More documentation 2014-03-02 22:49:31 -05:00
TwistedUmbrella a33eb1dc77 Notify about data folder being implied, Despite the summary 2014-03-02 05:42:23 -05:00
TwistedUmbrella d320b4a82e Merge pull request #361 from reicast/native
Native - This should start to resolve controller issues
2014-03-02 00:55:57 -05:00
TwistedUmbrella cf7ccb77d4 Integrate screenshot into the Native interface, Small cleanup 2014-03-01 23:47:01 -05:00
Bryan Barnes 65f967dc22 added menu option to take a screenshot 2014-03-01 23:46:52 -05:00
TwistedUmbrella 40c4570271 Add an override for the native interface to be user disabled 2014-03-01 21:14:30 -05:00
TwistedUmbrella 4b148a7055 Fix Jelly Bean black screen issues by falling back to default 2014-03-01 21:05:04 -05:00
TwistedUmbrella 34c9e6f6ea Integrate broadcast selection menu into the configuration 2014-03-01 21:02:51 -05:00
Stefanos Kornilios Mitsis Poiitidis 1698b21ac6 Fix windows building 2014-03-01 22:07:28 +02:00
TwistedUmbrella 5438e15bf4 Minimize the required modification for inverted audio prefs 2014-03-01 08:30:36 -05:00
TwistedUmbrella 2a150ef61c Refactor @ptitSeb PANDORA: Options and GUI - NoSound 2014-03-01 07:38:54 -05:00
ptitSeb 54e3a0e4e0 PANDORA: Options and GUI 2014-03-01 07:38:40 -05:00
TwistedUmbrella ca3de641e2 Add a shared uid package that enables and disables debug 2014-03-01 02:09:00 -05:00
ptitSeb 1c813524b4 PANDORA: No mic on Pandora for now 2014-02-28 23:46:08 +01:00
ptitSeb c806c30937 Merge branch 'master' into pandora 2014-02-28 22:47:42 +01:00
ptitSeb 4719756522 PANDORA: Options and GUI 2014-02-28 22:42:32 +01:00
ramersonw 93829978f2 Removed strings that don't need a translation 2014-02-28 12:01:22 -02:00
TwistedUmbrella 839ddd0c40 Refactor the Dpad Joystick toggle for purposely invalid input 2014-02-28 05:51:08 -05:00
TwistedUmbrella 1440b0ef6c Fall back to actual key values for key not being "emulated" 2014-02-28 01:17:50 -05:00
TwistedUmbrella 4903152e18 Prevent the loop of errors resulting in an ANR. Crash instead 2014-02-28 01:17:36 -05:00
TwistedUmbrella ba6cb99c2e Set the screen width and height using the scaled screen dpi 2014-02-28 01:16:11 -05:00
TwistedUmbrella 82de3d2249 Prevent the right stick from canceling out the normal triggers 2014-02-28 00:34:24 -05:00
TwistedUmbrella 386a28e79f The Moga interface doesn't really need to mirror the primary 2014-02-27 20:47:38 -05:00
TwistedUmbrella d45603c2e0 At this point, everyone should be pretty comfortable with it 2014-02-27 20:47:22 -05:00
TwistedUmbrella 4d3ccfe5bf Have non-translated strings prompt as errors to be removed 2014-02-27 20:46:09 -05:00
ramersonw 6701025187 Added some missing strings 2014-02-27 14:29:26 -02:00
TwistedUmbrella 35840a1eda Merge pull request #356 from ThePlayground/master
Create a new branch for working on NativeActivity
2014-02-26 22:55:21 -05:00
TwistedUmbrella 5eea059b09 Remove comments for resolved issues and added methods 2014-02-26 22:49:14 -05:00
TwistedUmbrella ebeb0d0551 Automate the inclusion of the secondary native library build 2014-02-26 22:44:20 -05:00
TwistedUmbrella a75307240d Begin merging in NativeActive and compatibility fallback - r7 2014-02-26 22:26:33 -05:00
TwistedUmbrella b95826d4d3 Merge pull request #353 from ThePlayground/master
All possible last minute changes and cleanup before release
2014-02-26 22:24:53 -05:00
TwistedUmbrella f670a39787 All possible last minute changes and cleanup before release 2014-02-26 22:24:34 -05:00
TwistedUmbrella 21a8a54f88 Merge pull request #351 from ThePlayground/master
This pull is any last minute changes and fixes
2014-02-26 22:03:00 -05:00
TwistedUmbrella bac4ee15ec Sort out double negatives, Add javadoc information
Sort out all the double negatives and get the menu running

Prevent frameskip from exceeding or going below bounds

Fix some inverted parameters, Enable javadoc variable lists
2014-02-26 21:19:06 -05:00
Claus Østergaard 4e92bfa5c1 Update strings.xml 2014-02-26 21:05:28 -05:00
Bryan Barnes 44cffbb4c4 faster popup animation, hide rate me menu item on ouya 2014-02-26 21:03:48 -05:00
TwistedUmbrella 8ce6a9e539 Cleanup and finalize the new "visibility optimized" menus
Add an option to open the menu with "Menu", Select compat

Don't prevent select mapping, Switch to local context, Anim

Import French Submission @AndroidGX

Fix a merge issue for settings not yet available to the user

faster popup animation, hide rate me menu item on ouya

Update strings.xml

Kill the application properly, Check for Rating, Popup anim

Add a small buffer to the VMU, Fix the configuration menu

This really was a good idea if I could quit inverting the logic

Sound config options are misleading due to inverted function

It is my own fault for wanting it to make sense in GL2JNIView at the cost of not making since anywhere else

Toggle sound independently, Implement Fastforward instead

Add generic boost menu option, Fix sound menu icon state

 Repurpose thread priority as boost option, Disable triggered

Account for when sound is fully disabled and cannot be set

It gets confusing when enabled is false and disabled is true
2014-02-26 20:58:23 -05:00
TwistedUmbrella 7ec35ef3c2 Merge pull request #330 from ThePlayground/master
makes r3 be start button, allows menu button to work
2014-02-25 02:03:58 -05:00
TwistedUmbrella ea329b064e makes r3 be start button, allows menu button to work 2014-02-25 02:03:17 -05:00
TwistedUmbrella da60601205 Merge pull request #328 from ThePlayground/master
Fix the mapping to avoid dealing with OUYA default configs
2014-02-25 01:58:45 -05:00
TwistedUmbrella 478f8586bb Make the menu look a little bit neater on entry / exit function 2014-02-25 01:58:20 -05:00
TwistedUmbrella ef2fe430ff Fix the mapping to avoid dealing with OUYA default configs 2014-02-24 23:57:18 -05:00
Bryan Barnes 8249d2dc28 toned the ouya fix down slightly 2014-02-24 23:51:58 -05:00
Bryan Barnes f1b384ac2e ouya again 2014-02-24 23:43:40 -05:00
TwistedUmbrella 3f4a97ecc1 Merge pull request #326 from ThePlayground/master
Revert "Let's let Moga start actually handling Moga events, Fix Rjoy"
2014-02-24 23:18:46 -05:00
TwistedUmbrella c013264a28 Tone down how much Moga handles on its own quite yet :/ 2014-02-24 23:18:27 -05:00
TwistedUmbrella 631c5bae5b Merge pull request #323 from ThePlayground/master
Let's let Moga start actually handling Moga events, Fix Rjoy
2014-02-24 23:07:34 -05:00
TwistedUmbrella 9927a8dae0 Fix a linked casting issue that requires Activity over Context 2014-02-24 23:01:24 -05:00
TwistedUmbrella 7158b640c9 Let the submission fail to avoid introducing possible issues 2014-02-24 22:45:40 -05:00
TwistedUmbrella fa2b229c95 Let's let Moga start actually handling Moga events, Fix Rjoy 2014-02-24 22:23:04 -05:00
TwistedUmbrella 326fcec485 Merge pull request #317 from ThePlayground/master
Right stick mapping options, Logging fixes, Menu notices
2014-02-24 20:54:42 -05:00
TwistedUmbrella 06c3ded68e Fix all the merge derps generated by https://github.com/reicast/reicast-emulator/pull/320 2014-02-24 20:48:50 -05:00
TwistedUmbrella 0b7a2cfd86 Handle emulated keycodes through standard handler's calls 2014-02-24 20:40:11 -05:00
TwistedUmbrella 0a95f966d5 Another instance of controller simplification, Not-static class 2014-02-24 20:40:11 -05:00
TwistedUmbrella 6d82495ed5 This will at least solve the Spanish issue until it is complete 2014-02-24 20:40:06 -05:00
TwistedUmbrella 5f9c75a414 Remove a check when motion is motion, recognized or not 2014-02-24 20:40:02 -05:00
TwistedUmbrella b1bcef83ea Support deprecated platforms, Bring Moga into Gamepads 2014-02-24 20:40:02 -05:00
TwistedUmbrella 3d7b8570b6 Support "Select" as menu, Mapping, "Menu" hardware key 2014-02-24 20:39:55 -05:00
TwistedUmbrella 88eea7f0e9 Fix an issue with importing unmerged changes from pull 2014-02-24 20:39:42 -05:00
TwistedUmbrella f536c67f26 Force the keys to be mapped, even if the system already is 2014-02-24 20:39:42 -05:00
TwistedUmbrella d53fb51d25 Update the label to prevent attempting to continue mapping 2014-02-24 20:39:42 -05:00
TwistedUmbrella a2b8aba035 Add a notice about the OUYA R3 being the onscreen menu 2014-02-24 20:39:42 -05:00
TwistedUmbrella 985297183a Remove the handler for the logging function as is unneeded 2014-02-24 20:39:35 -05:00
TwistedUmbrella 11cc6e6ccf Attempt to preserve EGL context when an activity is paused 2014-02-24 20:39:35 -05:00
TwistedUmbrella 5c0601dd2e Add support to use the right joystick as A / B, L1 / R2 trigger 2014-02-24 20:39:35 -05:00
hooby3dfx 339ed77516 Merge pull request #320 from hooby3dfx/master
merging this in to get the ouya stuff all together and i wanted to fix the strings build break.
also that toast is silly.
sorry that this will give you a conflict for automerge but youre a big boy :)
2014-02-24 20:19:56 -05:00
Bryan Barnes 02193e2441 ouya fixes, no more menu toast, got rid of spanish in polish 2014-02-24 20:13:28 -05:00
hooby3dfx 04617a9b0c Merge pull request #321 from Elwood89/patch-1
Update strings.xml (polish translation)
2014-02-24 20:09:42 -05:00
hooby3dfx 095841ff5b Merge pull request #322 from coestergaard/master
Danish translation added
2014-02-24 20:08:52 -05:00
Claus Østergaard a9dc01de57 Update strings.xml
Should probably not have been translated.
2014-02-25 00:10:00 +01:00
Claus Østergaard 51e5db0d50 Update strings.xml 2014-02-25 00:03:47 +01:00
Claus Østergaard 5e53dba12c Create danish translation 2014-02-24 23:12:41 +01:00
Elwood89 47d8e667e7 Update strings.xml
There are many special letters in PL, are these supported?
2014-02-24 16:08:47 +01:00
TwistedUmbrella c9a10451b7 Throw in some labels as an added bonus just in case 2014-02-22 18:40:23 -05:00
TwistedUmbrella eaac86808f LOGS HERE! GET YOUR LOGS HERE, PEOPLE! 2014-02-22 18:34:00 -05:00
hooby3dfx eddea4395c Merge pull request #315 from hooby3dfx/master
fixed editvjoy crash
2014-02-22 18:19:52 -05:00
Bryan Barnes 0a45f17839 fixed editvjoy crash 2014-02-22 18:19:17 -05:00
hooby3dfx cdb5d004d1 Merge pull request #308 from hooby3dfx/master
moved push of emu cfg settings to one location, fixed vmu lcd crashes, fixed first key not registered/drop to bios from game launch when no buttons are pressed.
2014-02-22 18:02:16 -05:00
Bryan Barnes 948118b8de initialize conroller codes so they work on first push and first game boot doesnt drop to bios! 2014-02-22 12:21:29 -05:00
Bryan Barnes 31bd0f5742 fixed the bios crash plague, it was a jni issue with the vmu lcd. the way we cache jnienv is messy/lucky. 2014-02-22 11:30:03 -05:00
Bryan Barnes 7ecf7d5727 moved push cgf to before init (was screwing up dynarec option), also changed depth back to 24 bit 2014-02-21 23:31:40 -05:00
Bryan Barnes be3ce5492d moved push of emu cfg settings to where it normally is in the init process; fixes rtc. minor cfg load/save cleanup. 2014-02-21 23:31:39 -05:00
TwistedUmbrella 85367467d6 Allow Ant to use the existing NDK path variable inline
“ndk.dir” has to be manually set in the local.properties file
“android update project” only covers auto-import of the sdk
2014-02-21 23:22:27 -05:00
TwistedUmbrella faa14cdfec Let's build everything with a single magical command 2014-02-21 23:12:23 -05:00
TwistedUmbrella a39eff8bd0 Prevent a possible break in controller layouts 2014-02-21 22:31:00 -05:00
TwistedUmbrella 93f2ea362d Remove unused functions, Use Xperia Play gamepad menu 2014-02-21 19:28:32 -05:00
TwistedUmbrella f68fbef987 Simplify and subclass the controller mapping 2014-02-21 19:24:55 -05:00
TwistedUmbrella 052fd88b32 Fix custom mapping for L and R triggers 2014-02-21 19:19:49 -05:00
TwistedUmbrella b82b965a96 Fix epoch calculation, verified by @ppsspp213 2014-02-20 16:40:58 -05:00
TwistedUmbrella 8655cae995 Removing the beta link to allow relocation [Part 2] 2014-02-19 01:48:46 -05:00
TwistedUmbrella da4b94f787 Removing the beta link to allow relocation [Part 1] 2014-02-19 01:48:11 -05:00
TwistedUmbrella 7ac2698f70 Merge pull request #306 from NoblesseOblige/master
Let the system display all stack trace indexes and sort itself
2014-02-18 18:48:24 -05:00
TwistedUmbrella 7f1f97c68f Let the system display all stack trace indexes and sort itself 2014-02-18 18:47:42 -05:00
TwistedUmbrella 0db807a17a Merge pull request #305 from Karaulov/patch-3
Update ru strings.xml #4
2014-02-18 16:55:44 -05:00
Karaulov 93bbffadb6 Update strings.xml 2014-02-19 00:03:41 +03:00
TwistedUmbrella 44b8937a4f Merge pull request #304 from NoblesseOblige/master
More logging stuff to ensure we get logs
2014-02-18 13:52:50 -05:00
TwistedUmbrella e5b9a879f5 Begin the process of documenting using the Eclipse dialogs 2014-02-18 13:51:47 -05:00
TwistedUmbrella ba6b83e824 Implement a hander to display toast messages on UI thread 2014-02-17 21:03:32 -05:00
TwistedUmbrella b92d826284 Check internet and notify user of log location if unavailable 2014-02-17 18:11:31 -05:00
TwistedUmbrella 818f58d07b Merge pull request #302 from winder/master
Fixed start button mapping for PS3 controller.
2014-02-17 15:19:18 -05:00
TwistedUmbrella 8b8e36edf9 Merge pull request #297 from NoblesseOblige/master
Stock-piling changes until they need to be merged
2014-02-17 15:18:57 -05:00
Will Winder 64108864a7 Fixed start button mapping for PS3 controller. 2014-02-17 15:12:11 -05:00
TwistedUmbrella f599fcf2f4 Xperia Play - Simplify button check but don't convert for GB
In Gingerbread, the difference between back and O was whether or not
the Alt key was pressed at the same time in code. Until GB is supported
for the Xperia Play, there is no real purpose in adding the custom key
quite yet.
2014-02-17 12:23:16 -05:00
TwistedUmbrella be1c4374fa Verify the FPS display reads as null to prevent misfired view 2014-02-17 12:12:40 -05:00
TwistedUmbrella ccd4157aff Add basic parameters from the emulator to the edit screen 2014-02-17 12:12:40 -05:00
TwistedUmbrella 65c1b947a4 Add render depth to available options to provide fps boost 2014-02-17 12:12:40 -05:00
TwistedUmbrella da7c82c02d Temporarily map start button for PS3 and Xbox360 [Testing] 2014-02-17 12:12:09 -05:00
TwistedUmbrella 88f0b8b6c2 Add low-level OUYA detection, Handle menu with R3 button 2014-02-17 12:12:09 -05:00
TwistedUmbrella aa9f842110 Add a text outline to allow visibility when view matches text 2014-02-17 12:12:09 -05:00
hooby3dfx 0f96a5a47b Merge pull request #295 from hooby3dfx/master
Fix galaxy tab crash on back button, keep transparent popup background.
2014-02-17 12:06:57 -05:00
Bryan Barnes c45eb4e8d0 fraps style fps 2014-02-16 16:43:29 -05:00
Bryan Barnes a3d1a2a16e fix for galaxy tab back button crash 2014-02-16 15:01:16 -05:00
Bryan Barnes f8e23a2b1c fixed gb crash, print out full stack trace, explicitly transparent backgrounds in popups 2014-02-16 15:01:16 -05:00
TwistedUmbrella ec13746af7 Merge pull request #294 from LoungeKatt/master
If this doesn't fix game loading, the bug was already there
2014-02-16 14:04:32 -05:00
TwistedUmbrella f5586ba47f This will allow error reporting before attempting to load GUI 2014-02-16 14:03:23 -05:00
TwistedUmbrella 17b1d51f4b Merge pull request #287 from LoungeKatt/master
@hooby3dfx This should get what you are looking for
2014-02-16 12:33:02 -05:00
TwistedUmbrella 7321808090 Because the Droid X can't live up to the Xperia Play for ctx 2014-02-16 12:07:54 -05:00
TwistedUmbrella e7a0e78803 Updated for JVM 1.6 as per discussion on StackOverflow
http://stackoverflow.com/questions/115008/how-can-we-print-line-numbers-
to-the-log-in-java
2014-02-16 11:52:21 -05:00
TwistedUmbrella 39ad0ac92d Yeah, the GPU has nothing to do with sound. Nice try, tho! 2014-02-16 01:48:55 -05:00
TwistedUmbrella ffdf036684 Update the logs to include the trace line number [hopefully] 2014-02-16 01:47:06 -05:00
TwistedUmbrella 540fd32089 Merge pull request #285 from LoungeKatt/master
Clean up the layouts and separate paths sections cleanly
2014-02-15 22:30:22 -05:00
TwistedUmbrella 10a8a15cd3 Clean up the layouts and separate paths sections cleanly
See ya when r6 hits Google Play ;)
2014-02-15 22:29:24 -05:00
TwistedUmbrella 1ded3dffdd Merge pull request #284 from LoungeKatt/master
Eclipse pretends it is fixing an unclosed layout with excess
2014-02-15 21:31:44 -05:00
TwistedUmbrella b5004bc5b5 Eclipse pretends it is fixing an unclosed layout with excess 2014-02-15 21:31:31 -05:00
TwistedUmbrella 3bdb4fafe9 Merge pull request #282 from LoungeKatt/master
Error reporting and handling updates
2014-02-15 16:16:04 -05:00
TwistedUmbrella 14b4ed6bdf Remove deprecated call to load unused configuration files 2014-02-15 16:07:26 -05:00
TwistedUmbrella e700972350 Fix a sneaky layout trying to avoid being part of the tables 2014-02-15 16:05:54 -05:00
TwistedUmbrella 6bc6328a25 I could have sworn there was a negative AND a positive... 2014-02-15 16:05:54 -05:00
TwistedUmbrella b546e7a75d Handle crashes more gracefully and allow opting out report 2014-02-15 16:05:54 -05:00
TwistedUmbrella 16702f9c38 Fix the formatting on the configuration page to reduce size 2014-02-15 16:05:54 -05:00
TwistedUmbrella d3d6c100dc Merge pull request #283 from hooby3dfx/master
idleskip should default to true
2014-02-15 16:03:46 -05:00
Bryan Barnes 90db7054a4 idleskip should default to true 2014-02-15 15:22:27 -05:00
TwistedUmbrella 65db3bedf2 Merge pull request #278 from LoungeKatt/master
Integrate a semi-accurate FPS display option into settings
2014-02-15 12:47:42 -05:00
TwistedUmbrella 5a741af03d Enable unstable optimization by default to prevent crackling 2014-02-15 11:46:47 -05:00
TwistedUmbrella e308c0b5c7 Update all language translations with new revision text item 2014-02-15 10:53:13 -05:00
TwistedUmbrella b31297e452 Update the about display to handle beta versions correctly 2014-02-15 10:46:50 -05:00
TwistedUmbrella c318eb8bda Update the region values to specify the game region codes
@ppsspp213 change adjusted to work with the way the application
displays and uses the array values.
2014-02-15 10:46:20 -05:00
TwistedUmbrella 8469baa39e Clean up the FPS view to support variable text size change 2014-02-14 21:30:04 -05:00
TwistedUmbrella 3ab88a71ab Updated Chinese - https://github.com/reicast/reicast-emulator/issues/275 2014-02-14 21:04:47 -05:00
TwistedUmbrella 8a48d95370 Integrate a semi-accurate FPS display option into settings 2014-02-14 20:54:04 -05:00
TwistedUmbrella 30f06e699c Merge pull request #276 from Karaulov/patch-2
Update RU strings.xml #3
2014-02-14 12:13:32 -05:00
Karaulov 875bd15750 Update RU strings.xml #3 2014-02-14 15:44:06 +03:00
TwistedUmbrella fad989a19a Merge pull request #274 from ppsspp213/patch-1
Update strings.xml
2014-02-14 01:54:42 -05:00
ppsspp213 98eec3e49f Update strings.xml
Typo's
2014-02-14 06:39:39 +00:00
TwistedUmbrella 10b9df33ea Merge pull request #272 from LoungeKatt/master
A very solid collaborative menu implementation
2014-02-14 01:13:04 -05:00
TwistedUmbrella 3595152cc4 Center the VMU display, Subclass the "other" popup menus 2014-02-14 01:11:38 -05:00
Bryan Barnes 208aa20c18 vmu lcd toggle working 2014-02-14 01:11:30 -05:00
TwistedUmbrella ecc122f0c4 This is as close as it'll get to toggling from the menu for now 2014-02-13 21:40:08 -05:00
TwistedUmbrella 6b5c041725 Add the option to "pop out" the VMU, Check popUp for null 2014-02-13 20:30:55 -05:00
TwistedUmbrella da9faf7efb Enable free-floating VMU to allow for bigger size parameters 2014-02-13 15:57:35 -05:00
TwistedUmbrella bf5f59833a Add a category for peripherals to support growing numbers 2014-02-13 05:56:03 -05:00
TwistedUmbrella 734f03bfcd Tag all the garbage collection with the relevant API direction 2014-02-13 05:55:52 -05:00
TwistedUmbrella df50719777 Add an option to enable ongoing VMU display, First in menu 2014-02-13 05:54:19 -05:00
TwistedUmbrella b98b087435 Merge pull request #270 from hooby3dfx/vmu_support
on screen vmu :)
2014-02-13 05:52:15 -05:00
TwistedUmbrella ee254ea23d Merge pull request #271 from NoblesseOblige/master
Handle the core popUp directly, but pass others to handler
2014-02-13 03:19:35 -05:00
TwistedUmbrella fd69686f78 Handle the core popUp directly, but pass others to handler 2014-02-13 03:19:10 -05:00
TwistedUmbrella b8335773d3 Merge pull request #269 from NoblesseOblige/master
@hooby3dfx has issues, but @LoungeKatt has pull requests. I win!
2014-02-13 02:42:58 -05:00
TwistedUmbrella c3a7260dc1 Moving the dismissal call to prevent an inevitable merge fail 2014-02-13 02:42:41 -05:00
Bryan Barnes 52199df953 vmu :)
Conflicts:
	shell/android/jni/src/Android.cpp
	shell/android/src/com/reicast/emulator/emu/GL2JNIActivity.java
	shell/android/src/com/reicast/emulator/emu/JNIdc.java
2014-02-13 02:17:13 -05:00
TwistedUmbrella 60d3521d47 Rename the file to avoid confusion with proprietary app files 2014-02-13 01:21:35 -05:00
TwistedUmbrella 9281d2f2ad Append the memory allocation table to error log submission 2014-02-13 00:52:13 -05:00
TwistedUmbrella 4d322feacc In case of a memory allocation failure, print current readout 2014-02-13 00:45:17 -05:00
TwistedUmbrella d9233b3440 Account for devices with small screens and stock DPI sets 2014-02-12 22:13:00 -05:00
TwistedUmbrella 89ab2420c9 Fix an issue with popup definition coming after vector calls 2014-02-12 20:08:24 -05:00
TwistedUmbrella 5485f2f16e Handle irrational decision to run screaming from file listing 2014-02-12 19:42:56 -05:00
TwistedUmbrella 188d7cbe4f Handle the popup navigation through buttons for the lazy 2014-02-12 19:34:37 -05:00
TwistedUmbrella 3f62290596 Merge pull request #268 from NoblesseOblige/master
More optimizations and stability stuff (Yah!!)
2014-02-12 18:19:52 -05:00
TwistedUmbrella bf6fd5fd09 Don't know about you, but I keep accidentally closing emu
This also removes the debug preference, since this menu is no longer
visible until pressed. If someone presses it by accident, they would
have probably enabled it by accident as well. Nothing dangerous is in
there anyway.
2014-02-12 17:56:54 -05:00
TwistedUmbrella dd78ed1c88 Stop redrawing the popup, Change enable state dynamically 2014-02-12 17:42:58 -05:00
TwistedUmbrella a28c50a13d Only use reflection method when API is unavailable for call 2014-02-12 17:21:25 -05:00
TwistedUmbrella 4782c144f0 Add the thread priority to prevent unused sound thread use 2014-02-12 16:40:40 -05:00
TwistedUmbrella e4c0e8ec61 Merge pull request #267 from NoblesseOblige/master
Massive cleanup and organization of processes by function
2014-02-12 16:18:12 -05:00
TwistedUmbrella 4368f327ae Add permanent sound option, Split debug into menu, Clean 2014-02-12 16:17:45 -05:00
TwistedUmbrella 24c4c04945 Allow menu interaction before immersive overlay recedes 2014-02-12 02:32:49 -05:00
TwistedUmbrella 1e798727d3 Reduce the number of packages, Input is really emu stuff 2014-02-11 23:41:56 -05:00
TwistedUmbrella eb1772ec2c Realign the native interface with the Java app counterpart 2014-02-11 23:38:46 -05:00
TwistedUmbrella 87e409b3cc Massive cleanup and organization of processes by function 2014-02-11 23:25:46 -05:00
TwistedUmbrella 853db5110e Merge pull request #266 from NoblesseOblige/master
If you can't combine the activity, share the static functions
2014-02-11 22:58:24 -05:00
TwistedUmbrella ec57499863 Account for the default value of unset boolean being false 2014-02-11 22:55:55 -05:00
TwistedUmbrella 1e6c050d3d Finish subclassing VJoy, EGL, OSD, Add runtime muting 2014-02-11 22:30:51 -05:00
TwistedUmbrella 858bd2c40b If you can't combine the activity, share the static functions 2014-02-11 21:22:25 -05:00
TwistedUmbrella f59da370b5 Merge pull request #260 from hooby3dfx/master
push the input data from java to c on each event
2014-02-11 21:22:16 -05:00
TwistedUmbrella d68e72b37b Merge pull request #261 from NoblesseOblige/master
Added support for immersive mode on KitKat devices [Rehash]
2014-02-11 10:24:47 -05:00
TwistedUmbrella 147e948b37 Move the non-dynamic popup back to the hosting activity 2014-02-11 10:23:09 -05:00
TwistedUmbrella e668e8068c Begin setting up generic iPhone shell configuration for emu 2014-02-10 21:14:06 -05:00
Matteo Hausner 20fb9db652 Added support for immersive mode on KitKat devices [Rehash] 2014-02-10 21:11:03 -05:00
TwistedUmbrella 9af23e0276 Merge pull request #257 from NoblesseOblige/master
Add reicast to the Sony Xperia Play games launcher menu
2014-02-10 13:25:26 -05:00
TwistedUmbrella 4c6bc0349f Add reicast to the Sony Xperia Play games launcher menu 2014-02-10 13:25:00 -05:00
TwistedUmbrella 37d9060b17 Merge pull request #249 from NoblesseOblige/master
Cleaning up and enhancing the runtime configuration menu
2014-02-10 07:34:04 -05:00
Bryan Barnes e46993f96c push the input data from java to c on each event 2014-02-09 22:44:53 -05:00
TwistedUmbrella 7f095cdb2d Render configuration file obsolete to prevent load corruption 2014-02-09 22:16:09 -05:00
TwistedUmbrella 5511bee9ef Sometimes you have to break some eggs to find a chicken 2014-02-09 21:33:31 -05:00
TwistedUmbrella af3e064269 Convert Android config to GUI, stop wasting CPU on files 2014-02-09 21:30:42 -05:00
TwistedUmbrella 8332d171da The string comparison does not process correctly, Use int 2014-02-09 21:29:12 -05:00
TwistedUmbrella 0ee5b52b52 Make static references to static variables to avoid local sets 2014-02-09 16:14:19 -05:00
TwistedUmbrella cb522d8352 Back up configuration when writing to prevent failure loss
The configuration is not always being properly written to the file.
This method will ensure the original user configuration (especially
when manually modified) is not lost in the process.
2014-02-09 15:51:46 -05:00
TwistedUmbrella ae6d694c52 Fix and simplify the new subclassing of the popup menus 2014-02-09 15:01:26 -05:00
TwistedUmbrella e70b71828c Subclass all popup menus to reduce clutter in GL2JNIView 2014-02-09 14:38:49 -05:00
TwistedUmbrella 7cd08c13ed Add runtime configuration for toggling the LimitPFS option
There ya go @hooby3dfx. I hope it’s everything you dreamed it would be
;)
2014-02-09 11:26:04 -05:00
TwistedUmbrella 94879b0cac Repurpose fast forward as actual frame skipping options 2014-02-09 11:09:42 -05:00
TwistedUmbrella 7a1323699a Merge pull request #245 from NoblesseOblige/master
Runtime config, Key code cleanup, Software rendering
2014-02-09 08:54:28 -05:00
TwistedUmbrella 81466f1591 Support Xperia Play hardware L1 / R1 through custom keys 2014-02-09 01:24:18 -05:00
TwistedUmbrella 153af36869 Make sure them menu button gets passed to OSD menus 2014-02-09 01:16:53 -05:00
TwistedUmbrella 66d0312f37 Add a configuration option to enable forced software render 2014-02-09 01:11:59 -05:00
TwistedUmbrella b728b0dfb5 Add a back option to the configuration, Close closes menu 2014-02-08 21:59:42 -05:00
TwistedUmbrella 631b4aaeea Add separate configuration popup to reduce origin clutter 2014-02-08 21:43:49 -05:00
TwistedUmbrella 83b94874a3 Add widescreen emu toggle, Get current config on app load 2014-02-08 21:43:41 -05:00
TwistedUmbrella 5ca3b4e3dc Theoretically this will add live control over frame skipping 2014-02-08 21:43:32 -05:00
TwistedUmbrella 8db0f80602 Assign native number values to Android key code variables 2014-02-08 21:43:24 -05:00
TwistedUmbrella 55d5e31a55 Merge pull request #242 from NoblesseOblige/master
@hooby3dfx Fixed cfg, localized time -|- Simplify logs, Xperia Play fixed
2014-02-08 09:55:18 -05:00
TwistedUmbrella 77bcb8de7f Fix immersive mode to automatically handle focus changes 2014-02-08 09:41:20 -05:00
TwistedUmbrella ed633dc37b Prevent keyboard / keypad opening from resetting activities 2014-02-08 08:25:52 -05:00
Bryan Barnes 61c0c39300 fix build break 2014-02-08 07:50:40 -05:00
TwistedUmbrella ddfa2ebbe3 Override the back button on Xperia Play to prevent exiting 2014-02-08 07:46:42 -05:00
TwistedUmbrella ba8d7dbde6 Xperia play does not differentiate the back key from triangle
http://developer.sonymobile.com/2011/02/13/xperia-play-game-keys/
2014-02-08 07:46:29 -05:00
TwistedUmbrella a3ea5bfe31 @hooby3dfx Localized dreamtime utility to get RTC string 2014-02-08 02:27:45 -05:00
TwistedUmbrella 6564f70cbc Boolean valueOf expects "true" or "false", so compare string 2014-02-08 02:27:45 -05:00
TwistedUmbrella f69ced47e4 Update the log generation to prevent redundant lib entries 2014-02-08 02:27:45 -05:00
hooby3dfx 747652677f Merge pull request #241 from NoblesseOblige/icons
Icons
2014-02-08 01:55:16 -05:00
hooby3dfx 5e10391508 Merge pull request #236 from hooby3dfx/master
Icons and less confusing popup menu
2014-02-07 23:23:01 -05:00
TwistedUmbrella dc606a83a1 Merge pull request #235 from NoblesseOblige/master
Shorten the procedure to edit config, Handle config issues
2014-02-07 13:36:53 -05:00
TwistedUmbrella 42019289c2 Further automating the log submission process for testers 2014-02-07 13:29:21 -05:00
TwistedUmbrella efd7183985 Assign icons, Remove unused option, Clear up description 2014-02-07 01:12:23 -05:00
TwistedUmbrella 0915a12d72 Higher res icons, Add default PSD for future icon additions 2014-02-07 01:12:14 -05:00
Bryan Barnes b5684e9498 hide crazy popup icons by default
can be enabled in settings
2014-02-07 00:34:04 -05:00
Bryan Barnes 564bb6837f vmu swap icon
AMERICA
2014-02-07 00:12:58 -05:00
Bryan Barnes 96c9a03374 mic icon
so sick
2014-02-06 23:20:01 -05:00
TwistedUmbrella 436fd57609 Shorten the procedure to edit config, Handle config issues 2014-02-06 20:52:08 -05:00
TwistedUmbrella 04addad42d Merge pull request #230 from Karaulov/patch-1
Update RU translate, strings.xml
2014-02-06 12:59:40 -05:00
TwistedUmbrella 19dc9e2247 Merge pull request #232 from hooby3dfx/vmu_swap
VMU swap
2014-02-06 12:54:21 -05:00
Bryan Barnes 76852783a7 its verking!
tested in bios only
2014-02-06 00:02:53 -05:00
TwistedUmbrella bf4e05391c Merge pull request #227 from NoblesseOblige/master
Cleanup and optimizations stuff
2014-02-05 18:31:32 -05:00
TwistedUmbrella 92f6ad350f Test Dreamcast time conversion using AICA RTC definition 2014-02-05 13:57:22 -05:00
TwistedUmbrella 98bc58215d Update the selector colors with the new "reicast" theming 2014-02-05 13:40:53 -05:00
TwistedUmbrella 8bf4e150d3 Update the logging function to account for Jelly Bean MR2 2014-02-05 12:28:00 -05:00
TwistedUmbrella de21b3d45c Fix BIOS clock prompting for setting on every startup 2014-02-05 12:27:55 -05:00
TwistedUmbrella 5536f580e4 Move the non-configuration settings to experimental header 2014-02-05 12:27:55 -05:00
Karaulov 7e43deb868 Update strings.xml 2014-02-05 13:53:41 +03:00
Karaulov 50844c5e4c Update RU translate, strings.xml
Request an update Russian translation, made ​​by myself manually.
2014-02-05 10:22:25 +03:00
Bryan Barnes 96ffc3a524 mic notes, wip vmu swap 2014-02-05 01:00:09 -05:00
hooby3dfx 4b32807c28 Merge pull request #229 from hooby3dfx/master
tweak to make dpad work again
2014-02-04 21:55:55 -08:00
Bryan Barnes 2e294c4642 tweak to make dpad work again 2014-02-05 00:54:56 -05:00
TwistedUmbrella d214a50905 Merge pull request #225 from NoblesseOblige/master
Set title when going backwards, Attempt focusable menus
2014-02-03 22:13:31 -08:00
TwistedUmbrella 2520685509 Support both methods of EGL context depending on prefs 2014-02-04 01:02:58 -05:00
TwistedUmbrella 862aab542f Add a failsafe to verify that GLES 3 exists before testing it 2014-02-04 00:01:23 -05:00
TwistedUmbrella 46577c0957 Custom selectors for menu, Redirect issue logging to paste 2014-02-03 23:45:15 -05:00
TwistedUmbrella 67616a60ce Set title when going backwards, Attempt focusable menus 2014-02-03 22:56:38 -05:00
Stefanos Kornilios Mitsis Poiitidis 310906d1b5 Merge pull request #222 from NoblesseOblige/master
The next batch of minor changes that make up a single pull
2014-02-03 13:44:29 -08:00
TwistedUmbrella 46a4312d73 @AndroidGX French translation updates 2014-02-03 16:39:35 -05:00
TwistedUmbrella d85de18b31 Add the form URL for translation submission to README 2014-02-03 15:32:59 -05:00
TwistedUmbrella 5ceb1cab7b Merge pull request #221 from NoblesseOblige/master
Add a handler to grab uncaught exceptions for issue report
2014-02-03 12:01:25 -08:00
TwistedUmbrella 5f8f4f9e3b Add a handler to grab uncaught exceptions to submit later 2014-02-03 14:55:30 -05:00
TwistedUmbrella 362c652d6c Merge pull request #219 from NoblesseOblige/master
Fix menu titles, Expand menu touch area, Add async logs
2014-02-03 10:13:37 -08:00
TwistedUmbrella 7944355f10 Traditional Chinese @weihan1102, Updated menu text size 2014-02-03 13:06:44 -05:00
TwistedUmbrella e315c8c2ee Update translations for new menu options [Need verification] 2014-02-03 13:05:34 -05:00
TwistedUmbrella a3c1734d94 Fix menu titles, Expand menu touch area, Add async logs 2014-02-03 12:22:27 -05:00
TwistedUmbrella 7211873442 Merge pull request #215 from NoblesseOblige/master
Menus, layouts, and languages. It's a regular party.
2014-02-02 23:41:57 -08:00
TwistedUmbrella e6fb44fba4 Update RTC value with Android UTC time every BIOS run 2014-02-03 02:41:09 -05:00
TwistedUmbrella 896c5d79c7 Update menu background to prevent undesired stretching 2014-02-03 02:09:29 -05:00
TwistedUmbrella e04e39fa90 Add Traditional, @weihan1102 Simplified Chinese update 2014-02-03 01:12:24 -05:00
TwistedUmbrella c9c71028a9 Update the modified drawer menu with a pretty background 2014-02-03 00:39:16 -05:00
TwistedUmbrella 15c6e731b5 Convert to unified menu layout, Add @hooby3dfx focusable
Applied the focusable to the switches, which worked.
Applied the focusable to the list items, which seems to not have
worked. Also added the state drawable, but so far it has not allowed
scrolling the list on Nvidia Shield.
2014-02-03 00:03:57 -05:00
Stefanos Kornilios Mitsis Poiitidis 1d9ec43b22 Merge pull request #109 from hooby3dfx/microphone_support
Microphone support. YARLY.
2014-02-02 19:00:37 -08:00
Bryan Barnes f571b187b0 Addressed review points
-cleanup vmu that gets replaced by the mic
-got rid of confusing old commented code
-stopped big memory leak if mic data was not getting read but it was
recording
2014-02-02 21:40:18 -05:00
TwistedUmbrella 5022ae4bd6 Merge pull request #213 from NoblesseOblige/master
@hooby3dfx Now you can scroll like the rest of us, hooray!
2014-02-02 17:26:42 -08:00
TwistedUmbrella 60de1f6c25 @hooby3dfx Now you can scroll like the rest of us, hooray! 2014-02-02 20:26:11 -05:00
TwistedUmbrella 2716bdcee8 Merge pull request #212 from ramersonw/patch-1
Fixed some typos and added more strings
2014-02-02 16:11:57 -08:00
ramersonw 250443b172 Fixed some typos and added more strings 2014-02-02 21:31:09 -02:00
TwistedUmbrella ca49ddb369 Merge pull request #211 from NoblesseOblige/master
A few reflection calls reference API 19, so we need Kitkat
2014-02-02 13:57:16 -08:00
TwistedUmbrella 4a89d5a75b A few reflection calls reference API 19, so we need Kitkat 2014-02-02 16:54:59 -05:00
TwistedUmbrella 754106a6f7 Merge pull request #210 from NoblesseOblige/master
Add note to the README about SDK platform requirement
2014-02-02 13:51:29 -08:00
TwistedUmbrella 6dd721e97f Add note to the README about SDK platform requirement 2014-02-02 16:50:57 -05:00
TwistedUmbrella a0ff5d68fd Merge pull request #208 from NoblesseOblige/master
Microphone (Squashed by major revision)
2014-02-02 13:01:48 -08:00
TwistedUmbrella 35ad9bfdee Fix compatibility with older Android versions with least effort 2014-02-02 16:01:16 -05:00
TwistedUmbrella 20422ef8c4 Remove a merge conflict generated on Github 2014-02-02 13:51:53 -05:00
TwistedUmbrella 75c2ae1e55 Merge pull request #206 from NoblesseOblige/master
Import mod of Jeremy Feinstein's SlidingMenu, EGL Mods
2014-02-02 10:50:15 -08:00
TwistedUmbrella 4c0491552f Clean up some misfired error logs, Always check KHR ES3 2014-02-02 12:46:46 -05:00
Bryan Barnes 6df7f8912c Prevent non-mic devices from doing this 2014-02-02 12:10:40 -05:00
TwistedUmbrella 4045b9a15f Remove untranslated strings, Add generic Korean resource 2014-02-02 01:03:38 -05:00
Bryan Barnes 3e33efa3ca learning the hard way
root cause found (i think). lesson: java functions called via jni dont
handle exceptions/tell you what happens when they crash.
2014-02-01 22:36:47 -05:00
TwistedUmbrella 5bc849f3f0 Add the Open GL ES View errors to the debug log output 2014-02-01 18:00:27 -05:00
TwistedUmbrella 8a9a5af00d Import mod of Jeremy Feinstein's SlidingMenu, EGL Mods
Clean up the menu or at least reduce the number of shells

Build native library against the same API base as shell app

Update Khronos source to newest stable, Reference EGL14

Add margins, Restore lost identifiers, Update tested devices

Adjust drawer menu handle to prevent unintentional launch

Revise EGL handling to check multiple contexts to configure

Update README to include information about translating

Add native library handling to the debug, Enable log reading

Adjust drawer menu touch area, Fix L / R assignment calls

Remove some merge junk from trying to resolve git issues
2014-02-01 18:00:14 -05:00
Bryan Barnes 2403d13440 umm
ok its one of those things where the logging makes it work!
not sure whats up, but without the additional logging it crashes.
2014-02-01 14:05:09 -05:00
Bryan Barnes 208bcc0d79 its verking!
figured out issue, made mic setup simpler
2014-02-01 13:52:36 -05:00
Bryan Barnes f3416fda81 grr
managed to add some instability, investigating
2014-02-01 12:37:04 -05:00
TwistedUmbrella 036be4085a Merge pull request #203 from maximu/patch-3
Update spanish translate string
2014-02-01 08:05:45 -08:00
Bryan Barnes 5b9dbd9fa3 This is ready to go
-Added config to input fragment
-Reduced logging
-Init the mic at the right time during startup so that port 2 either
gets vmu or mic
-Has not been tested on device without mic
-Needs more testing in games
2014-02-01 10:44:06 -05:00
Carlos Estrague 191a5dfcdf Update spanish translate string
Small changes in the spanish translation
2014-02-01 11:25:13 +01:00
Bryan Barnes 7e8bc2972b merge from master
i hope
2014-01-31 20:32:46 -05:00
Bryan Barnes 0c11acb931 better conformity to spec 2014-01-31 20:31:42 -05:00
Bryan Barnes e1970cf01d notes and manifest tweak 2014-01-31 20:31:42 -05:00
Bryan Barnes 800526ddcd progress
-some cleanup
-handling of retransmit
-got rid of needless sleeping in record thread
-some latency handling
2014-01-31 20:30:46 -05:00
hooby3dfx d839e8d70d minor hygiene 2014-01-31 20:30:45 -05:00
Bryan Barnes 841ed659ae AWWWW YEA
SOMEONE TRY THIS
2014-01-31 20:30:45 -05:00
Bryan Barnes b24e401e2f oh snap gets further!
jni local reference table overflow
2014-01-31 20:30:45 -05:00
Bryan Barnes 18e5bd7c95 almost working
crashes - need to figure out jni thread crap
2014-01-31 20:30:44 -05:00
Bryan Barnes babaf41482 mic device figured out?
i have satisfied seaman.
its just constantly polling for data.
next step: pipe in some audio!
2014-01-31 20:25:20 -05:00
hooby3dfx 8284f55b68 initial dox 2014-01-31 20:25:19 -05:00
hooby3dfx 1cb31dd932 logging changes
trying to hone in on commands going in and out
2014-01-31 20:25:19 -05:00
hooby3dfx 252df2cc95 Holy Seaman, batman!
Seaman will load :)
2014-01-31 20:25:18 -05:00
TwistedUmbrella c4dc18f1c1 Merge pull request #198 from NoblesseOblige/master
Remove deprecated string resources to prevent build error
2014-01-30 11:33:42 -08:00
TwistedUmbrella c94dd2e223 Remove deprecated string resources to prevent build error 2014-01-30 14:32:31 -05:00
TwistedUmbrella d6c8429446 Merge pull request #197 from NoblesseOblige/master
Updates for recent commit and repository changes
2014-01-30 07:13:28 -08:00
TwistedUmbrella 79bca874b7 @AndroidGX French Translation updates 2014-01-30 10:12:11 -05:00
TwistedUmbrella fd17b52792 Move to official repository for branch with default category
Since the about section can only track the default branch, the default
branch can be tracked locally. The androidui branch requires a mirror
with androidui set as default.
2014-01-30 10:07:58 -05:00
TwistedUmbrella 14b5f9ef06 Merge pull request #195 from NoblesseOblige/master
Squash changes from andoidui into single commit
2014-01-30 06:20:26 -08:00
TwistedUmbrella ae5394f6b6 Squash changes from andoidui into single commit
Integrate previously locked settings with valid user warning

Put a note about the beta compile link in the README.md

Add a super fancy about that supports Github commit logs

Revise about with git log, Highlight current build in commits

Check for a null value when getting the current commit sha

Chinese Simplified Translation from @weihan1102

Rename Simplified Chinese res folder for proper complie

Add links to the website and beta compile site from about

Add option for custom mapping to set joystick to non-dpad

Fix a missing check for the user saved value of the A button

The Moga only operates one way, there is no variation test

Add region values, Set cable to match formatting of others

Reduce the number of random string array calls, jsCompat

It was unnecessary to keep getting the array, It was even less
necessary to keep getting the preference values. The port
identification letters are set multi-lingual values.

Label the about links to prevent any confusion (Not mirrors)

Missing a check on the motion events to determine compat

Add a check to verify Kitkat, Remove the standard override

The new API verification complains about the Override, so this is a
preventative step for if and when it is updated. It may also prevent
some issues with compatibility.

Run organize imports to reduce the amount of excess code

Add a controller option to go to custom layout from selection

Prevent a leak where multiple items were highlighted in list

@AndroidGX French Translation resources
2014-01-30 09:18:45 -05:00
Matteo Hausner 3beb22b25c Merge pull request #186 from bwRavencl/german-translation
German translation
2014-01-29 13:55:15 -08:00
Matteo Hausner 00f55b5b4b Removed 'images' and 'nav_drawer_icons' sections from all string resources but the default one 2014-01-29 22:42:51 +01:00
Matteo Hausner 34ca48a484 Some German translations fixes 2014-01-29 22:40:11 +01:00
Matteo Hausner 50466eb9ec Added German translation 2014-01-29 22:27:15 +01:00
Matteo Hausner 0d91b53706 Merge pull request #183 from bwRavencl/immersive-mode
Immersive mode
2014-01-29 11:58:15 -08:00
Matteo Hausner 57212196fb Added support for immersive mode on KitKat devices 2014-01-29 20:27:08 +01:00
Matteo Hausner d032bc4a24 Removed hello_world from Russion translation 2014-01-29 19:49:52 +01:00
TwistedUmbrella 5771dedac8 Merge pull request #181 from ramersonw/master
Updated portuguese translation
2014-01-29 06:03:10 -08:00
ramersonw 4dac3a6800 Updated portuguese translation 2014-01-29 11:58:48 -02:00
TwistedUmbrella 84326bb12a Merge pull request #161 from MrYadro/master
Initial Russian translation & TravisCI support
2014-01-28 07:08:53 -08:00
TwistedUmbrella 1543474366 Remove all the auto RTF garbage from Strings.txt 2014-01-27 09:55:50 -05:00
TwistedUmbrella cbfda5a767 Merge pull request #166 from NoblesseOblige/master
More progress on simulated L / R, Translation shells, Custom input updates
2014-01-27 06:52:01 -08:00
TwistedUmbrella b41bb39c0e Merge pull request #159 from NoblesseOblige/master
Moga updates, Memory handling, UI issues, Config
2014-01-27 00:59:26 -08:00
Yaroslav 5a955dac3d Initial Russian translation & TravisCI support 2014-01-26 20:32:17 +07:00
ptitSeb c655c51da2 Fixed Pandora Makefile 2014-01-23 09:19:09 +01:00
ptitSeb faaa8d3630 Merge branch 'master' of https://github.com/reicast/emulator into pandora
Conflicts:
	shell/pandora/Makefile
2014-01-23 09:09:23 +01:00
ptitSeb b7177e742a PANDORA: played with ccache 2014-01-23 09:06:35 +01:00
6231 changed files with 1679980 additions and 146116 deletions

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
freebsd_instance:
image_family: freebsd-13-0
env:
CCACHE_DIR: /tmp/ccache
CIRRUS_CLONE_SUBMODULES: true
task:
install_script: pkg install -y alsa-lib ccache cmake evdev-proto git libao libevdev libudev-devd libzip mesa-libs miniupnpc ninja pkgconf png pulseaudio sdl2
ccache_cache:
folder: /tmp/ccache
script:
- cmake -B build -DCMAKE_BUILD_TYPE=Release -G Ninja
- cmake --build build --config Release
+1
View File
@@ -0,0 +1 @@
custom: ['https://utip.io/flyinghead', 'https://www.paypal.com/paypalme/FlycastEmu']
+41
View File
@@ -0,0 +1,41 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''
---
**Please Note: This form is the minimum required information for submitting bugs.**
**Removing this form may lead to your issue being closed until it is completed.**
Platform / OS / Hardware:
Github hash:
Hardware:
**_Description of the Issue_**
Add a short, concise description of the issue here
**_Debugging Steps Tested_**
* Fill in any steps already tried here
* Begin each new line with an asterisk
* If no steps are required, please skip
**_Logs Gathered_**
```
Please paste the contents of the log / logs here
You may leave this field blank if you have none.
```
**_Screenshots_**
(Replace this line with any issue screenshots)
+20
View File
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: enhancement
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.
+76
View File
@@ -0,0 +1,76 @@
name: Android CI
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Set up build environment
run: |
sudo apt-get update
sudo apt-get -y install ccache libcurl4-openssl-dev ninja-build
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- uses: actions/cache@v3
with:
path: ~/.ccache
key: android-ccache-${{ github.sha }}
restore-keys: android-ccache-
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: android-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: android-gradle-
- name: Gradle
working-directory: shell/android-studio
run: ./gradlew assembleRelease --parallel
- uses: actions/upload-artifact@v3
with:
name: flycast-release.apk
path: shell/android-studio/flycast/build/outputs/apk/release/flycast-release.apk
- name: Build dump_syms
working-directory: core/deps/breakpad
run: |
./configure --prefix=$PWD
make -j2
make install
- name: Extract symbols
run: |
DUMP_SYMS=./core/deps/breakpad/bin/dump_syms
SO_DIR=shell/android-studio/flycast/build/intermediates/cmake/release/obj
for arch in arm64-v8a armeabi-v7a x86 x86_64 ; do
$DUMP_SYMS $SO_DIR/$arch/libflycast.so > libflycast.so.sym
BUILD_ID=`head -1 libflycast.so.sym | awk '{ print $4 }'`
mkdir -p symbols/libflycast.so/$BUILD_ID
mv libflycast.so.sym symbols/libflycast.so/$BUILD_ID
done
- name: Configure AWS Credentials
id: aws-credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: AKIAJOZQS4H2PHQWYFCA
aws-secret-access-key: ${{ secrets.S3_SECRET_KEY }}
aws-region: us-east-2
if: github.repository == 'flyinghead/flycast' && github.event_name == 'push'
- name: Upload to S3
run: aws s3 sync shell/android-studio/flycast/build/outputs/apk/release s3://flycast-builds/android/${GITHUB_REF#refs/}-$GITHUB_SHA --acl public-read --exclude='*.json' --follow-symlinks
if: ${{ steps.aws-credentials.outputs.aws-account-id != '' }}
- name: Upload to S3 (symbols)
run: aws s3 sync symbols s3://flycast-symbols/android --follow-symlinks
if: ${{ steps.aws-credentials.outputs.aws-account-id != '' }}
+132
View File
@@ -0,0 +1,132 @@
name: C/C++ CI
on: [push, pull_request]
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.os }}
defaults:
run:
shell: ${{ matrix.config.shell }}
env:
CCACHE_DIR: ${{ github.workspace }}/.ccache
strategy:
matrix:
config:
- {name: i686-pc-windows-msvc, os: windows-latest, shell: cmd, arch: x86, cmakeArgs: -G Ninja, buildType: Release}
- {name: apple-darwin, os: macos-latest, shell: sh, cmakeArgs: -G Xcode, destDir: osx, buildType: Release}
- {name: apple-ios, os: macos-latest, shell: sh, cmakeArgs: -DCMAKE_SYSTEM_NAME=iOS -G Xcode, destDir: ios, buildType: Release}
- {name: x86_64-pc-linux-gnu, os: ubuntu-latest, shell: sh, cmakeArgs: -G Ninja, buildType: Release}
- {name: x86_64-pc-windows-msvc, os: windows-latest, shell: cmd, arch: x64, cmakeArgs: -G Ninja, buildType: Release}
- {name: x86_64-w64-mingw32, os: windows-latest, shell: 'msys2 {0}', cmakeArgs: -G Ninja, destDir: win, buildType: RelWithDebInfo}
- {name: libretro-x86_64-pc-linux-gnu, os: ubuntu-latest, shell: sh, cmakeArgs: -DLIBRETRO=ON -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -G Ninja, buildType: Release}
- {name: libretro-x86_64-w64-mingw32, os: windows-latest, shell: 'msys2 {0}', cmakeArgs: -DLIBRETRO=ON -G Ninja, buildType: Release}
steps:
- name: Set up build environment (macOS)
run: |
brew update
brew install libao ldid libomp ninja pulseaudio
wget https://sdk.lunarg.com/sdk/download/1.3.204.1/mac/vulkansdk-macos-1.3.204.1.dmg
hdiutil attach ./vulkansdk-macos-*.dmg
sudo /Volumes/vulkansdk-macos-*/InstallVulkan.app/Contents/MacOS/InstallVulkan --root $HOME/VulkanSDK --accept-licenses --default-answer --confirm-command install
hdiutil detach /Volumes/vulkansdk-macos-*
echo "VULKAN_SDK=$HOME/VulkanSDK/macOS" >> $GITHUB_ENV
if: runner.os == 'macOS'
- name: Set up build environment (Linux)
run: |
sudo apt-get update
sudo apt-get -y install ccache libao-dev libasound2-dev libevdev-dev libgl1-mesa-dev liblua5.3-dev libminiupnpc-dev libpulse-dev libsdl2-dev libudev-dev libzip-dev ninja-build
if: runner.os == 'Linux'
- name: Set up build environment (Windows, MinGW)
uses: msys2/setup-msys2@v2
with:
msystem: MINGW64
install: git make mingw-w64-x86_64-ccache mingw-w64-x86_64-cmake mingw-w64-x86_64-lua mingw-w64-x86_64-ninja mingw-w64-x86_64-SDL2 mingw-w64-x86_64-toolchain
if: matrix.config.shell == 'msys2 {0}'
- name: Set up build environment (Windows, Visual Studio)
run: |
choco install ccache directx-sdk ninja
echo DXSDK_DIR=C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)>> %GITHUB_ENV%
if: matrix.config.shell == 'cmd'
- uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.config.arch }}
if: matrix.config.shell == 'cmd'
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- uses: actions/cache@v3
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ matrix.config.name }}-${{ github.sha }}
restore-keys: ccache-${{ matrix.config.name }}-
if: runner.os != 'macOS'
- name: CMake
run: |
cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.config.buildType }} -DCMAKE_INSTALL_PREFIX=artifact ${{ matrix.config.cmakeArgs }}
cmake --build build --config ${{ matrix.config.buildType }} --target install
- name: Unit Tests
run: |
cmake -B build -DCMAKE_BUILD_TYPE=${{ matrix.config.buildType }} -DCMAKE_INSTALL_PREFIX=artifact -DENABLE_CTEST=ON ${{ matrix.config.cmakeArgs }}
cmake --build build --config ${{ matrix.config.buildType }}
./build/flycast
if: matrix.config.name == 'x86_64-pc-linux-gnu'
- name: Dump symbols
run: |
core/deps/breakpad/bin/dump_syms artifact/bin/flycast.exe > flycast.exe.sym 2>/dev/null
BUILD_ID=`head -1 flycast.exe.sym | awk '{ print $4 }'`
mkdir -p symbols/flycast.exe/$BUILD_ID
mv flycast.exe.sym symbols/flycast.exe/$BUILD_ID
strip artifact/bin/flycast.exe
if: matrix.config.name == 'x86_64-w64-mingw32'
- uses: actions/upload-artifact@v3
with:
name: flycast-${{ matrix.config.name }}
path: artifact/bin
- name: Package app (macos)
run: |
cd artifact/bin
zip -rm flycast.app.zip Flycast.app
if: matrix.config.name == 'apple-darwin'
- name: Package app (windows)
run: |
powershell Compress-Archive artifact/bin/flycast.exe artifact/bin/flycast.zip
rm artifact/bin/flycast.exe
if: matrix.config.name == 'x86_64-w64-mingw32'
- name: Configure AWS Credentials
id: aws-credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: AKIAJOZQS4H2PHQWYFCA
aws-secret-access-key: ${{ secrets.S3_SECRET_KEY }}
aws-region: us-east-2
if: github.repository == 'flyinghead/flycast' && github.event_name == 'push' && matrix.config.destDir != ''
- name: Upload to S3
run: aws s3 sync artifact/bin s3://flycast-builds/${{ matrix.config.destDir }}/${GITHUB_REF#refs/}-$GITHUB_SHA --acl public-read --follow-symlinks
shell: bash
if: ${{ steps.aws-credentials.outputs.aws-account-id != '' }}
- name: Upload symbols to S3
run: aws s3 sync symbols s3://flycast-symbols/${{ matrix.config.destDir }} --follow-symlinks
shell: bash
if: ${{ steps.aws-credentials.outputs.aws-account-id != '' && matrix.config.name == 'x86_64-w64-mingw32' }}
+33
View File
@@ -0,0 +1,33 @@
# Prepare source texts & upload them to Crowdin
name: Crowdin Source Texts Upload
# on change to the English texts
on:
push:
branches:
- master
paths:
- 'shell/libretro/libretro_core_options.h'
jobs:
upload_source_file:
runs-on: ubuntu-latest
steps:
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
java-version: 1.8
- name: Setup Python
uses: actions/setup-python@v3
- name: Checkout
uses: actions/checkout@v3
- name: Upload Source
shell: bash
env:
CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}
run: |
python3 intl/upload_workflow.py $CROWDIN_API_KEY "flyinghead-flycast" "shell/libretro/libretro_core_options.h"
+46
View File
@@ -0,0 +1,46 @@
# Download translations form Crowdin & Recreate libretro_core_options_intl.h
name: Crowdin Translation Integration
on:
schedule:
# please choose a random time & weekday to avoid all repos synching at the same time
- cron: '15 22 * * 5' # Fridays at 10:15 PM, UTC
jobs:
create_intl_file:
runs-on: ubuntu-latest
steps:
- name: Setup Java JDK
uses: actions/setup-java@v3
with:
java-version: 1.8
- name: Setup Python
uses: actions/setup-python@v3
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false # otherwise, the token used is the GITHUB_TOKEN, instead of your personal access token.
fetch-depth: 0 # otherwise, there would be errors pushing refs to the destination repository.
- name: Create intl file
shell: bash
env:
CROWDIN_API_KEY: ${{ secrets.CROWDIN_API_KEY }}
run: |
python3 intl/download_workflow.py $CROWDIN_API_KEY "flyinghead-flycast" "shell/libretro/libretro_core_options_intl.h"
- name: Commit files
run: |
git config --local user.email "[email protected]"
git config --local user.name "github-actions[bot]"
git add intl/*_workflow.py "shell/libretro/libretro_core_options_intl.h"
git commit -m "Fetch translations & Recreate libretro_core_options_intl.h"
- name: GitHub Push
uses: ad-m/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}
+59
View File
@@ -0,0 +1,59 @@
name: Nintendo Switch CI
on: [push, pull_request]
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ubuntu-latest
container: devkitpro/devkita64:20220128
strategy:
matrix:
config:
- {name: standalone, destDir: switch}
- {name: libretro, cmakeArgs: -DLIBRETRO=ON}
steps:
- name: Set up build environment
run: |
sudo apt-get update
sudo apt-get -y install awscli ccache ninja-build
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- uses: actions/cache@v3
with:
path: ~/.ccache
key: ccache-switch-${{ matrix.config.name }}-${{ github.sha }}
restore-keys: ccache-switch-${{ matrix.config.name }}-
- name: CMake
run: |
$DEVKITPRO/portlibs/switch/bin/aarch64-none-elf-cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=artifact -G Ninja ${{ matrix.config.cmakeArgs }}
cmake --build build --config Release --target install
- uses: actions/upload-artifact@v3
with:
name: flycast-switch-${{ matrix.config.name }}
path: artifact/bin
- name: Package app
run: zip -m artifact/bin/flycast.nro.zip artifact/bin/flycast.nro
if: hashFiles('artifact/bin/flycast.nro') != ''
- name: Configure AWS Credentials
id: aws-credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: AKIAJOZQS4H2PHQWYFCA
aws-secret-access-key: ${{ secrets.S3_SECRET_KEY }}
aws-region: us-east-2
if: github.repository == 'flyinghead/flycast' && github.event_name == 'push' && matrix.config.destDir != ''
- name: Upload to S3
run: aws s3 sync artifact/bin s3://flycast-builds/${{ matrix.config.destDir }}/${GITHUB_REF#refs/}-$GITHUB_SHA --acl public-read --follow-symlinks
if: ${{ steps.aws-credentials.outputs.aws-account-id != '' }}
+69
View File
@@ -0,0 +1,69 @@
name: Windows UWP CI
on: [push, pull_request]
jobs:
build:
runs-on: windows-latest
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
VCPKG_DEFAULT_BINARY_CACHE: ${{ github.workspace }}/vcpkg/bincache
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
submodules: true
- name: bootstrap vcpkg
run: |
git clone https://github.com/microsoft/vcpkg
mkdir vcpkg\bincache
vcpkg\bootstrap-vcpkg.bat
- uses: actions/cache@v3
with:
path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
key: vcpkg-${{ hashFiles( 'vcpkg.json' ) }}
- name: CMake
run: |
cmake -B build -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 17 2022" -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 -DCMAKE_SYSTEM_PROCESSOR=AMD64 -DCMAKE_CROSSCOMPILING=OFF -DUSE_VULKAN=OFF -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%\scripts\buildsystems\vcpkg.cmake
cmake --build build --config Release --parallel 2
shell: cmd
- uses: ilammy/msvc-dev-cmd@v1
- name: Package app
run: |
mkdir build\artifact
cd build\AppPackages\flycast\flycast_*_x64_Test
mkdir tmp
ren *.msix flycast.msix
makeappx.exe unpack /p .\flycast.msix /d tmp
copy ..\..\..\Release\*.dll tmp
makeappx pack /d tmp /p ..\..\..\artifact\flycast.appx
- name: Sign app
run: signtool sign /f shell\uwp\sign_cert.pfx /p '${{ secrets.SIGN_CERT_PWD }}' /v /fd SHA256 build\artifact\flycast.appx
if: github.repository == 'flyinghead/flycast' && github.event_name == 'push'
- uses: actions/upload-artifact@v3
with:
name: flycast-uwp
path: build/artifact
- name: Configure AWS Credentials
id: aws-credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: AKIAJOZQS4H2PHQWYFCA
aws-secret-access-key: ${{ secrets.S3_SECRET_KEY }}
aws-region: us-east-2
if: github.repository == 'flyinghead/flycast' && github.event_name == 'push'
- name: Upload to S3
run: aws s3 sync build/artifact s3://flycast-builds/xbox/${GITHUB_REF#refs/}-$GITHUB_SHA --acl public-read --follow-symlinks
shell: bash
if: ${{ steps.aws-credentials.outputs.aws-account-id != '' }}
+9 -7
View File
@@ -1,10 +1,12 @@
build/
# macOS
.DS_Store
*.class
*.orig
bin/
gen/
obj/
# Visual Studio
.vs/
out/
newdc/android/libnewdc/bin/libnewdc.jar
newdc/android/libnewdc/bin/classes/com/example/newdc/JNIdc.class
# JetBrains IDES
.idea/
cmake-build-*/
+118
View File
@@ -0,0 +1,118 @@
# DESCRIPTION: GitLab CI/CD for libRetro (NOT FOR GitLab-proper)
##############################################################################
################################# BOILERPLATE ################################
##############################################################################
# Core definitions
.core-defs:
variables:
GIT_SUBMODULE_STRATEGY: recursive
CORENAME: flycast
CORE_ARGS: -DLIBRETRO=ON -DCMAKE_BUILD_TYPE=Release
.core-defs-linux:
extends: .core-defs
variables:
CORE_ARGS: -DLIBRETRO=ON -DCMAKE_POSITION_INDEPENDENT_CODE=TRUE -DCMAKE_BUILD_TYPE=Release
.core-defs-osx-x64:
extends: .core-defs
variables:
CORE_ARGS: -DLIBRETRO=ON -G Xcode -DCMAKE_BUILD_TYPE=Release
EXTRA_PATH: Release
.core-defs-android:
extends: .core-defs
script:
- cmake $CORE_ARGS -DANDROID_PLATFORM=android-$API_LEVEL -DCMAKE_TOOLCHAIN_FILE=$NDK_ROOT/build/cmake/android.toolchain.cmake -DANDROID_STL=c++_static -DANDROID_ABI=$ANDROID_ABI -DANDROID_ARM_MODE=arm "$CMAKE_SOURCE_ROOT" -B$BUILD_DIR
- cmake --build $BUILD_DIR --target ${CORENAME}_libretro --config Release -- -j $NUMPROC
- mv $BUILD_DIR/${CORENAME}_libretro.so $LIBNAME
- if [ $STRIP_CORE_LIB -eq 1 ]; then $NDK_ROOT/toolchains/llvm/prebuilt/linux-x86_64/bin/llvm-strip $LIBNAME; fi
variables:
API_LEVEL: 18
# Inclusion templates, required for the build to work
include:
################################## DESKTOPS ################################
# Windows
- project: 'libretro-infrastructure/ci-templates'
file: '/windows-cmake-mingw.yml'
# MacOS
- project: 'libretro-infrastructure/ci-templates'
file: 'osx-cmake-x86.yml'
# Linux
- project: 'libretro-infrastructure/ci-templates'
file: '/linux-cmake.yml'
################################## CELLULAR ################################
# Android
- project: 'libretro-infrastructure/ci-templates'
file: '/android-cmake.yml'
# Stages for building
stages:
- build-prepare
- build-shared
##############################################################################
#################################### STAGES ##################################
##############################################################################
#
################################### DESKTOPS #################################
# Windows 64-bit
libretro-build-windows-x64:
extends:
- .libretro-windows-cmake-x86_64
- .core-defs
# Windows 32-bit
libretro-build-windows-i686:
extends:
- .libretro-windows-cmake-x86
- .core-defs
# Linux 64-bit
libretro-build-linux-x64:
extends:
- .libretro-linux-cmake-x86_64
- .core-defs-linux
# Linux 32-bit
libretro-build-linux-i686:
extends:
- .libretro-linux-cmake-x86
- .core-defs-linux
# MacOS 64-bit
libretro-build-osx-x64:
extends:
- .libretro-osx-cmake-x86
- .core-defs-osx-x64
################################### CELLULAR #################################
# Android ARMv7a
android-armeabi-v7a:
extends:
- .libretro-android-cmake-armeabi-v7a
- .core-defs-android
# Android ARMv8a
android-arm64-v8a:
extends:
- .libretro-android-cmake-arm64-v8a
- .core-defs-android
# Android 64-bit x86
android-x86_64:
extends:
- .libretro-android-cmake-x86_64
- .core-defs-android
# Android 32-bit x86
android-x86:
extends:
- .libretro-android-cmake-x86
- .core-defs-android
+12
View File
@@ -0,0 +1,12 @@
[submodule "core/deps/SDL"]
path = core/deps/SDL
url = https://github.com/libsdl-org/SDL.git
[submodule "core/deps/libchdr"]
path = core/deps/libchdr
url = https://github.com/rtissera/libchdr.git
[submodule "core/deps/luabridge"]
path = core/deps/luabridge
url = https://github.com/vinniefalco/LuaBridge.git
[submodule "core/deps/breakpad"]
path = core/deps/breakpad
url = https://github.com/flyinghead/mingw-breakpad
+1471
View File
File diff suppressed because it is too large. Load diff
+25 -63
View File
@@ -1,84 +1,46 @@
reicast
===========
reicast is a sega dreamcast emulator
# Flycast
This is developer oriented resource, if you just want bins head over to http://reicast.com
[![Android CI](https://github.com/flyinghead/flycast/actions/workflows/android.yml/badge.svg)](https://github.com/flyinghead/flycast/actions/workflows/android.yml)
[![C/C++ CI](https://github.com/flyinghead/flycast/actions/workflows/c-cpp.yml/badge.svg)](https://github.com/flyinghead/flycast/actions/workflows/c-cpp.yml)
[![Nintendo Switch CI](https://github.com/flyinghead/flycast/actions/workflows/switch.yml/badge.svg)](https://github.com/flyinghead/flycast/actions/workflows/switch.yml)
[![Windows UWP CI](https://github.com/flyinghead/flycast/actions/workflows/uwp.yml/badge.svg)](https://github.com/flyinghead/flycast/actions/workflows/uwp.yml)
Caution
-------
The source is a mess, and I need sleep.
We had to discover some interesting arm bugs on the cleaned/refactored branch right after the release.
Expect a much improved changed folder/make structure soon.
![flycast logo](https://github.com/flyinghead/flycast/raw/master/shell/linux/flycast.png)
Rebranding/forks
----------------
If you are interested into further porting/adapting/whatever, *please* don't fork off. I hate that. Really.
**Flycast** is a multi-platform Sega Dreamcast, Naomi and Atomiswave emulator derived from [**reicast**](https://reicast.com/).
Let's try to keep everything under a single project :)
Information about configuration and supported features can be found on [**TheArcadeStriker's flycast wiki**](https://github.com/TheArcadeStriker/flycast-wiki/wiki).
To build for android
--------------------
Tools required:
* Latest Android SDK and NDK (duh)
* Ant
Join us on our [**Discord server**](https://discord.gg/X8YWP8w) for a chat.
From project root directory:
```
cd shell\android
android update project -p .
## Install
ndk-build -j 4
### Flatpak (Linux)
ant debug
```
1. [Set up Flatpak](https://www.flatpak.org/setup/)
Beta versions
-------------------
Compiled test versions are available at recast.loungekatt.com
2. Install Flycast from [Flathub](https://flathub.org/apps/details/org.flycast.Flycast)
Donations and stuff
-------------------
Well, glad you liked the project so far!
`flatpak install -y org.flycast.Flycast`
We're currently short on hardware
3. Run Flycast
If you would like to donate some devices, get in touch at team@reicast.com. GLES3 capable stuff, some mainstream hardware and rarities would be extremely appreciated.
Keep in mind we're located in Greece for the most part
`flatpak run org.flycast.Flycast`
This has been tested/developed on
* Galaxy tab 7.0 Plus
* LG P990
* Archos 10G9
* Some Chinese tablet
* OUYA
* Various development boards
* gcw zero
### Homebrew (MacOS)
We had to buy all of these, except the gcw zero and a beaglebone which were donated (thanks! You rock!)
1. [Set up Homebrew](https://brew.sh)
Apart from that, we don't accept monetary donations right now.
We also don't plan to be releasing a premium version at any store.
Most of the project has been developed by drk||Raziel (aka, skmp, drk, Raz, etc) but it has been based on the
works of multiple people. It would be extremely unfair to charge for it and get all the credit :)
2. Install Flycast via Homebrew
`brew install --cask flycast`
We're planning for an indiegogo campaign later on to help with sustained development and running costs, so follow @reicastdc on twitter for updates
### Xbox One
Open [**gamr13's github page**](https://gamr13.github.io/) from your console.
Team
----
### Binaries
You can check the currently active committers on [the pretty graphs page](https://github.com/reicast/reicast-emulator/graphs/contributors)
Chat on freenode #reicast.
The original reicast team consisted of drk||Raziel (mostly just writing code), PsyMan (debugging/testing and everything else) and a little bit of gb_away
Special thanks
--------------
In previous iterations a lot of people have worked on this, notably David Miller (aka, ZeZu), the nullDC team, friends from #pcsx2 and all over the world :)
[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/reicast/reicast-emulator/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
Get fresh builds for your system [**on the builds page**](https://flyinghead.github.io/flycast-builds/).
**New:** Now automated test results are available as well.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
+1
View File
@@ -0,0 +1 @@
/version.h
+15 -2
View File
@@ -1,4 +1,17 @@
newdc
# core
===========
The core of the emulator
Here lies the core of our codebase. Everything that's OS inspecific rests here.
** Please check per directory README for more info **
### Some rudimentary categories are:
- hw -- DC Hardware Components Implementation
- nullDC.cpp -- Main entry points
- khronos -- OpenGL and Vulkan headers
- oslib -- Audio drivers
- cfg -- Configuration backend structure
- reios -- (Our) Implementation of the DreamCast BIOS
- deps -- External dependencies
- imgread -- Content drivers
- rec-* -- Recompilers
- rend -- OpenGL and Vulkan renderers
+124
View File
@@ -0,0 +1,124 @@
/*
Created on: Nov 22, 2018
Copyright 2018 flyinghead
This file is part of reicast.
reicast is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
reicast is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with reicast. If not, see <https://www.gnu.org/licenses/>.
*/
#include "7zArchive.h"
#include "deps/lzma/7z.h"
#include "deps/lzma/7zCrc.h"
#include "deps/lzma/Alloc.h"
#define kInputBufSize ((size_t)1 << 18)
static bool crc_tables_generated;
bool SzArchive::Open(const char* path)
{
SzArEx_Init(&szarchive);
File_Close(&archiveStream.file);
File_Construct(&archiveStream.file);
archiveStream.file.file = nowide::fopen(path, "rb");
if (archiveStream.file.file == nullptr)
return false;
FileInStream_CreateVTable(&archiveStream);
LookToRead2_CreateVTable(&lookStream, 0);
lookStream.buf = (Byte *)ISzAlloc_Alloc(&g_Alloc, kInputBufSize);
if (lookStream.buf == NULL)
{
File_Close(&archiveStream.file);
return false;
}
lookStream.bufSize = kInputBufSize;
lookStream.realStream = &archiveStream.vt;
LookToRead2_Init(&lookStream);
if (!crc_tables_generated)
{
CrcGenerateTable();
crc_tables_generated = true;
}
SRes res = SzArEx_Open(&szarchive, &lookStream.vt, &g_Alloc, &g_Alloc);
return (res == SZ_OK);
}
ArchiveFile* SzArchive::OpenFile(const char* name)
{
u16 fname[512];
for (UInt32 i = 0; i < szarchive.NumFiles; i++)
{
if (SzArEx_IsDir(&szarchive, i))
continue;
size_t len = SzArEx_GetFileNameUtf16(&szarchive, i, fname);
char szname[512];
size_t j = 0;
for (; j < len && j < sizeof(szname) - 1; j++)
szname[j] = fname[j];
szname[j] = 0;
if (strcmp(name, szname))
continue;
size_t offset = 0;
size_t out_size_processed = 0;
SRes res = SzArEx_Extract(&szarchive, &lookStream.vt, i, &block_idx, &out_buffer, &out_buffer_size, &offset, &out_size_processed, &g_Alloc, &g_Alloc);
if (res != SZ_OK)
return NULL;
return new SzArchiveFile(out_buffer, offset, (u32)out_size_processed);
}
return NULL;
}
ArchiveFile* SzArchive::OpenFileByCrc(u32 crc)
{
if (crc == 0)
return NULL;
for (UInt32 i = 0; i < szarchive.NumFiles; i++)
{
unsigned isDir = SzArEx_IsDir(&szarchive, i);
if (isDir)
continue;
if (crc != szarchive.CRCs.Vals[i])
continue;
size_t offset = 0;
size_t out_size_processed = 0;
SRes res = SzArEx_Extract(&szarchive, &lookStream.vt, i, &block_idx, &out_buffer, &out_buffer_size, &offset, &out_size_processed, &g_Alloc, &g_Alloc);
if (res != SZ_OK)
return NULL;
return new SzArchiveFile(out_buffer, offset, (u32)out_size_processed);
}
return NULL;
}
SzArchive::~SzArchive()
{
if (lookStream.buf != NULL)
{
File_Close(&archiveStream.file);
ISzAlloc_Free(&g_Alloc, lookStream.buf);
if (out_buffer != NULL)
ISzAlloc_Free(&g_Alloc, out_buffer);
SzArEx_Free(&szarchive, &g_Alloc);
}
}
+68
View File
@@ -0,0 +1,68 @@
/*
Created on: Nov 23, 2018
Copyright 2018 flyinghead
This file is part of reicast.
reicast is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
reicast is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with reicast. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include "archive.h"
#include "deps/lzma/7z.h"
#include "deps/lzma/7zFile.h"
#include <algorithm>
class SzArchive : public Archive
{
public:
SzArchive() : out_buffer(NULL) {
memset(&archiveStream, 0, sizeof(archiveStream));
memset(&lookStream, 0, sizeof(lookStream));
}
~SzArchive() override;
ArchiveFile* OpenFile(const char* name) override;
ArchiveFile *OpenFileByCrc(u32 crc) override;
private:
bool Open(const char* path) override;
CSzArEx szarchive;
UInt32 block_idx; /* it can have any value before first call (if outBuffer = 0) */
Byte *out_buffer; /* it must be 0 before first call for each new archive. */
size_t out_buffer_size; /* it can have any value before first call (if outBuffer = 0) */
CFileInStream archiveStream;
CLookToRead2 lookStream;
};
class SzArchiveFile : public ArchiveFile
{
public:
SzArchiveFile(u8 *data, u32 offset, u32 length) : data(data), offset(offset), length(length) {}
u32 Read(void *buffer, u32 length) override
{
length = std::min(length, this->length);
memcpy(buffer, data + offset, length);
return length;
}
private:
u8 *data;
u32 offset;
u32 length;
};
+90
View File
@@ -0,0 +1,90 @@
/*
Created on: Nov 23, 2018
Copyright 2018 flyinghead
This file is part of reicast.
reicast is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
reicast is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with reicast. If not, see <https://www.gnu.org/licenses/>.
*/
#include "ZipArchive.h"
ZipArchive::~ZipArchive()
{
zip_close(zip);
}
bool ZipArchive::Open(const char* path)
{
FILE *file = nowide::fopen(path, "rb");
if (file == nullptr)
return false;
zip_error_t error;
zip_source_t *source = zip_source_filep_create(file, 0, -1, &error);
if (source == nullptr)
{
std::fclose(file);
return false;
}
zip = zip_open_from_source(source, 0, NULL);
if (zip == nullptr)
zip_source_free(source);
return zip != nullptr;
}
ArchiveFile* ZipArchive::OpenFile(const char* name)
{
zip_file *zip_file = zip_fopen(zip, name, 0);
if (zip_file == NULL)
return NULL;
return new ZipArchiveFile(zip_file);
}
struct zip_file *zip_fopen_by_crc(struct zip *za, u32 crc, int flags)
{
int i, n;
struct zip_stat stat;
if (crc == 0) {
return NULL;
}
n = zip_get_num_files(za);
for (i = 0; i < n; i++) {
if (zip_stat_index(za, i, flags, &stat) < -1) {
return NULL;
}
if (stat.crc == crc) {
return zip_fopen_index(za, i, flags);
}
}
return NULL;
}
ArchiveFile* ZipArchive::OpenFileByCrc(u32 crc)
{
zip_file *zip_file = zip_fopen_by_crc(zip, crc, 0);
if (zip_file == NULL)
return NULL;
return new ZipArchiveFile(zip_file);
}
u32 ZipArchiveFile::Read(void* buffer, u32 length)
{
return zip_fread(zip_file, buffer, length);
}
+50
View File
@@ -0,0 +1,50 @@
/*
Created on: Nov 23, 2018
Copyright 2018 flyinghead
This file is part of reicast.
reicast is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
reicast is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with reicast. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include "archive.h"
#include <zip.h>
class ZipArchive : public Archive
{
public:
ZipArchive() : zip(NULL) {}
~ZipArchive() override;
ArchiveFile* OpenFile(const char* name) override;
ArchiveFile* OpenFileByCrc(u32 crc) override;
private:
bool Open(const char* path) override;
struct zip *zip;
};
class ZipArchiveFile : public ArchiveFile
{
public:
ZipArchiveFile(struct zip_file *zip_file) : zip_file(zip_file) {}
~ZipArchiveFile() override { zip_fclose(zip_file); }
u32 Read(void* buffer, u32 length) override;
private:
struct zip_file *zip_file;
};
+45
View File
@@ -0,0 +1,45 @@
/*
Created on: Nov 23, 2018
Copyright 2018 flyinghead
This file is part of reicast.
reicast is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
reicast is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with reicast. If not, see <https://www.gnu.org/licenses/>.
*/
#include "archive.h"
#include "7zArchive.h"
#include "ZipArchive.h"
Archive *OpenArchive(const char *path)
{
std::string base_path(path);
Archive *sz_archive = new SzArchive();
if (sz_archive->Open(base_path.c_str()) || sz_archive->Open((base_path + ".7z").c_str()) || sz_archive->Open((base_path + ".7Z").c_str()))
return sz_archive;
delete sz_archive;
Archive *zip_archive = new ZipArchive();
if (zip_archive->Open(base_path.c_str()) || zip_archive->Open((base_path + ".zip").c_str()) || zip_archive->Open((base_path + ".ZIP").c_str()))
return zip_archive;
delete zip_archive;
return NULL;
}
+45
View File
@@ -0,0 +1,45 @@
/*
Created on: Nov 23, 2018
Copyright 2018 flyinghead
This file is part of reicast.
reicast is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
reicast is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with reicast. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include "types.h"
class ArchiveFile
{
public:
virtual ~ArchiveFile() = default;
virtual u32 Read(void *buffer, u32 length) = 0;
};
class Archive
{
public:
virtual ~Archive() = default;
virtual ArchiveFile *OpenFile(const char *name) = 0;
virtual ArchiveFile *OpenFileByCrc(u32 crc) = 0;
friend Archive *OpenArchive(const char *path);
private:
virtual bool Open(const char *name) = 0;
};
Archive *OpenArchive(const char *path);
+151
View File
@@ -0,0 +1,151 @@
/*
Copyright 2020 flyinghead
This file is part of Flycast.
Flycast is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Flycast is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Flycast. If not, see <https://www.gnu.org/licenses/>.
*/
#include "rzip.h"
#include <zlib.h>
const u8 RZipHeader[8] = { '#', 'R', 'Z', 'I', 'P', 'v', 1, '#' };
bool RZipFile::Open(const std::string& path, bool write)
{
verify(file == nullptr);
file = nowide::fopen(path.c_str(), write ? "wb" : "rb");
if (file == nullptr)
return false;
if (!write)
{
u8 header[sizeof(RZipHeader)];
if (std::fread(header, sizeof(header), 1, file) != 1
|| memcmp(header, RZipHeader, sizeof(header))
|| std::fread(&maxChunkSize, sizeof(maxChunkSize), 1, file) != 1
|| std::fread(&size, sizeof(size), 1, file) != 1)
{
Close();
return false;
}
// savestates created on 32-bit platforms used to have a 32-bit size
if (size >> 32 != 0)
{
size &= 0xffffffff;
std::fseek(file, -4, SEEK_CUR);
}
chunk = new u8[maxChunkSize];
chunkIndex = 0;
chunkSize = 0;
}
return true;
}
void RZipFile::Close()
{
if (file != nullptr)
{
std::fclose(file);
file = nullptr;
if (chunk != nullptr)
{
delete [] chunk;
chunk = nullptr;
}
}
}
size_t RZipFile::Read(void *data, size_t length)
{
verify(file != nullptr);
u8 *p = (u8 *)data;
size_t rv = 0;
while (rv < length)
{
if (chunkIndex == chunkSize)
{
chunkSize = 0;
chunkIndex = 0;
u32 zippedSize;
if (std::fread(&zippedSize, sizeof(zippedSize), 1, file) != 1)
break;
if (zippedSize == 0)
continue;
u8 *zipped = new u8[zippedSize];
if (std::fread(zipped, zippedSize, 1, file) != 1)
{
delete [] zipped;
break;
}
uLongf tl = maxChunkSize;
if (uncompress(chunk, &tl, zipped, zippedSize) != Z_OK)
{
delete [] zipped;
break;
}
delete [] zipped;
chunkSize = (u32)tl;
}
u32 l = std::min(chunkSize - chunkIndex, (u32)length);
memcpy(p, chunk + chunkIndex, l);
p += l;
chunkIndex += l;
rv += l;
}
return rv;
}
size_t RZipFile::Write(const void *data, size_t length)
{
verify(file != nullptr);
verify(std::ftell(file) == 0);
maxChunkSize = 1024 * 1024;
size = length;
if (std::fwrite(RZipHeader, sizeof(RZipHeader), 1, file) != 1
|| std::fwrite(&maxChunkSize, sizeof(maxChunkSize), 1, file) != 1
|| std::fwrite(&size, sizeof(size), 1, file) != 1)
return 0;
const u8 *p = (const u8 *)data;
// compression output buffer must be 0.1% larger + 12 bytes
uLongf maxZippedSize = maxChunkSize + maxChunkSize / 1000 + 12;
u8 *zipped = new u8[maxZippedSize];
size_t rv = 0;
while (rv < length)
{
uLongf zippedSize = maxZippedSize;
uLongf uncompressedSize = std::min(maxChunkSize, (u32)(length - rv));
u32 rc = compress(zipped, &zippedSize, p, uncompressedSize);
if (rc != Z_OK)
{
WARN_LOG(SAVESTATE, "Compression error: %d", rc);
break;
}
u32 sz = (u32)zippedSize;
if (std::fwrite(&sz, sizeof(sz), 1, file) != 1
|| std::fwrite(zipped, zippedSize, 1, file) != 1)
{
rv = 0;
break;
}
p += uncompressedSize;
rv += uncompressedSize;
}
delete [] zipped;
return rv;
}
+44
View File
@@ -0,0 +1,44 @@
/*
Copyright 2020 flyinghead
This file is part of Flycast.
Flycast is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Flycast is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Flycast. If not, see <https://www.gnu.org/licenses/>.
*/
// Implementation of the RZIP stream format as defined by libretro
// https://github.com/libretro/libretro-common/blob/master/include/streams/rzip_stream.h
#pragma once
#include "types.h"
class RZipFile
{
public:
~RZipFile() { Close(); }
bool Open(const std::string& path, bool write);
void Close();
size_t Size() const { return size; }
size_t Read(void *data, size_t length);
size_t Write(const void *data, size_t length);
FILE *rawFile() const { return file; }
private:
FILE *file = nullptr;
u64 size = 0;
u32 maxChunkSize = 0;
u8 *chunk = nullptr;
u32 chunkSize = 0;
u32 chunkIndex = 0;
};
-83
View File
@@ -1,83 +0,0 @@
/*
* E_Branches.h
*
*/
#pragma once
namespace ARM
{
EAPI B(u32 sImm24, ConditionCode CC=AL)
{
DECL_Id(0x0A000000);
SET_CC;
I |= ((sImm24>>2)&0xFFFFFF);
EMIT_I;
}
EAPI BL(u32 sImm24, ConditionCode CC=AL)
{
DECL_Id(0x0B000000);
SET_CC;
I |= ((sImm24>>2)&0xFFFFFF);
EMIT_I;
}
// Note: Either X variant will switch to THUMB* if bit0 of addr is 1
//
EAPI BX(eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x012FFF10);
SET_CC;
I |= (Rm&15);
EMIT_I;
}
EAPI BLX(eReg Rm, ConditionCode CC=AL) // Form II
{
DECL_Id(0x012FFF30);
SET_CC;
I |= (Rm&15);
EMIT_I;
}
EAPI BXJ(eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x012FFF20);
SET_CC;
I |= (Rm&15);
EMIT_I;
}
// This encoding looks correct, but segfaults, the pc val is align(pc,4) but this should be right in ARM
//
#if defined(_DEVEL)
EAPI BLX(u32 sImm24) // Form I * H is derived so not needed, fixup sImm24 so one can just pass a real addr
{
DECL_Id(0xFA000000);
//if(sImm24&1)
// I |= 1<<24; // SET_H
I |= ((sImm24>>2)&0xFFFFFF);
EMIT_I;
}
#endif
};
-844
View File
@@ -1,844 +0,0 @@
/*
* <E_DataOp.h Title="ARMv7 ISA Emitter Middle-ware: Data-Processing Instructions" />
*
* <?CTYPE
*
* <opcode1>{<cond>}{S} <Rd>, <shifter_operand>
* <opcode1> := MOV | MVN
*
* <opcode2>{<cond>} <Rn>, <shifter_operand>
* <opcode2> := CMP | CMN | TST | TEQ
*
* <opcode3>{<cond>}{S} <Rd>, <Rn>, <shifter_operand>
* <opcode3> := ADD | SUB | RSB | ADC | SBC | RSC | AND | BIC | EOR | ORR
*
* ?/>
*/
#pragma once
namespace ARM
{
/*
* imm Rd,[Rn,] imm
* reg Rd,Rn,Rm shift
* rsr Rd,Rn,Rm type Rs
*
* sp.imm Rd {SP} imm
* sp.reg Rd {SP} Rm shift
*
*/
#if 0
#define dpInstr(iName, iId) \
EAPI iName (eReg Rd, eReg Rn, u32 Imm) ; \
EAPI iName (eReg Rd, eReg Rn, eReg Rm, eShiftOp type=S_LSL, u32 Imm=0) ; \
EAPI iName (eReg Rd, eReg Rn, eReg Rm, eShiftOp type, eReg Rs) ;
#endif
/*
ADC IMM 0x02A00000
ADC REG 0x00A00000
ADC RSR 0x00A00010
ADD IMM 0x02800000
ADD REG 0x00800000
ADD RSR 0x00800010
ADD.SP.IMM 0x028D0000
ADD.SP.REG 0x008D0000
AND IMM 0x02000000
AND REG 0x00000000
AND RSR 0x00000010
// ASR's do not fit this pattern moved elsewhere //
BIC IMM 0x03C00000
BIC REG 0x01C00000
BIC RSR 0x01C00010
CMN IMM 0x03700000 // N imm
CMN REG 0x01700000 // NMshift
CMN RSR 0x01700010 // NMtypeS
CMP IMM 0x03500000 // N imm
CMP REG 0x01500000
CMP RSR 0x01500010
EOR IMM 0x02200000
EOR REG 0x00200000
EOR REG 0x00200010
*/
#define DP_PARAMS (eReg Rd, eReg Rn, ShiftOp Shift, ConditionCode CC=AL)
#define DP_RPARAMS (eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL)
#define DP_COMMON \
DECL_I; \
\
SET_CC; \
I |= (Rn&15)<<16; \
I |= (Rd&15)<<12; \
I |= (Shift&0xFFF)
#define DP_RCOMMON \
DECL_I; \
\
SET_CC; \
I |= (Rn&15)<<16; \
I |= (Rd&15)<<12; \
I |= (Rm&15)
#define DP_OPCODE(opcode) \
I |= (opcode)<<21
EAPI AND DP_PARAMS { DP_COMMON; DP_OPCODE(DP_AND); EMIT_I; }
EAPI EOR DP_PARAMS { DP_COMMON; DP_OPCODE(DP_EOR); EMIT_I; }
EAPI SUB DP_PARAMS { DP_COMMON; DP_OPCODE(DP_SUB); EMIT_I; }
EAPI RSB DP_PARAMS { DP_COMMON; DP_OPCODE(DP_RSB); EMIT_I; }
EAPI ADD DP_PARAMS { DP_COMMON; DP_OPCODE(DP_ADD); EMIT_I; }
EAPI ADC DP_PARAMS { DP_COMMON; DP_OPCODE(DP_ADC); EMIT_I; }
EAPI SBC DP_PARAMS { DP_COMMON; DP_OPCODE(DP_SBC); EMIT_I; }
EAPI RSC DP_PARAMS { DP_COMMON; DP_OPCODE(DP_RSC); EMIT_I; }
EAPI TST DP_PARAMS { DP_COMMON; DP_OPCODE(DP_TST); EMIT_I; }
EAPI TEQ DP_PARAMS { DP_COMMON; DP_OPCODE(DP_TEQ); EMIT_I; }
// EAPI CMP DP_PARAMS { DP_COMMON; DP_OPCODE(DP_CMP); EMIT_I; }
EAPI CMN DP_PARAMS { DP_COMMON; DP_OPCODE(DP_CMN); EMIT_I; }
EAPI ORR DP_PARAMS { DP_COMMON; DP_OPCODE(DP_ORR); EMIT_I; }
EAPI MOV DP_PARAMS { DP_COMMON; DP_OPCODE(DP_MOV); EMIT_I; }
EAPI BIC DP_PARAMS { DP_COMMON; DP_OPCODE(DP_BIC); EMIT_I; }
EAPI MVN DP_PARAMS { DP_COMMON; DP_OPCODE(DP_MVN); EMIT_I; }
#if defined(_DEVEL) && defined(_NODEF_) // These require testing -> CMP/MOV Shifter(Reg)? fmt broken? // Simple third reg type w/ no shifter
EAPI AND DP_PARAMS { DP_RCOMMON; DP_OPCODE(DP_AND); EMIT_I; }
EAPI EOR DP_PARAMS { DP_RCOMMON; DP_OPCODE(DP_EOR); EMIT_I; }
EAPI SUB DP_PARAMS { DP_RCOMMON; DP_OPCODE(DP_SUB); EMIT_I; }
EAPI RSB DP_PARAMS { DP_RCOMMON; DP_OPCODE(DP_RSB); EMIT_I; }
EAPI ADD DP_PARAMS { DP_RCOMMON; DP_OPCODE(DP_ADD); EMIT_I; }
EAPI ADC DP_PARAMS { DP_RCOMMON; DP_OPCODE(DP_ADC); EMIT_I; }
EAPI SBC DP_PARAMS { DP_RCOMMON; DP_OPCODE(DP_SBC); EMIT_I; }
EAPI RSC DP_PARAMS { DP_RCOMMON; DP_OPCODE(DP_RSC); EMIT_I; }
EAPI TST DP_PARAMS { DP_RCOMMON; DP_OPCODE(DP_TST); EMIT_I; }
EAPI TEQ DP_PARAMS { DP_RCOMMON; DP_OPCODE(DP_TEQ); EMIT_I; }
EAPI CMP DP_PARAMS { DP_RCOMMON; DP_OPCODE(DP_CMP); EMIT_I; }
EAPI CMN DP_PARAMS { DP_RCOMMON; DP_OPCODE(DP_CMN); EMIT_I; }
EAPI ORR DP_PARAMS { DP_RCOMMON; DP_OPCODE(DP_ORR); EMIT_I; }
EAPI MOV DP_PARAMS { DP_RCOMMON; DP_OPCODE(DP_MOV); EMIT_I; }
EAPI BIC DP_PARAMS { DP_RCOMMON; DP_OPCODE(DP_BIC); EMIT_I; }
EAPI MVN DP_PARAMS { DP_RCOMMON; DP_OPCODE(DP_MVN); EMIT_I; }
#endif
static u32 ARMImmid8r4_enc(u32 imm32)
{
for (int i=0;i<=30;i+=2)
{
u32 immv=(imm32<<i) | (imm32>>(32-i));
if (immv<256)
{
return ((i/2)<<8) | immv;
}
}
return -1;
}
static u32 ARMImmid8r4(u32 imm8r4)
{
u32 rv = ARMImmid8r4_enc(imm8r4);
verify(rv!=-1);
return rv;
}
static bool is_i8r4(u32 i32) { return ARMImmid8r4_enc(i32) != -1; }
EAPI ADD(eReg Rd, eReg Rn, eReg Rm, u32 RmLSL, bool S, ConditionCode CC=AL)
{
DECL_Id(0x00800000);
if (S)
I |= 1<<20;
I |= (RmLSL&31)<<7;
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI ADD(eReg Rd, eReg Rn, eReg Rm, bool S, ConditionCode CC=AL)
{
ADD(Rd,Rn,Rm,0,S,CC);
}
EAPI ADD(eReg Rd, eReg Rn, eReg Rm, ShiftOp Shift, u32 Imm8, ConditionCode CC=AL)
{
DECL_Id(0x00800000);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
I |= Shift<<5;
I |= (Imm8&31)<<7;
EMIT_I;
}
EAPI ADD(eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL)
{
ADD(Rd,Rn,Rm,false,CC);
}
EAPI ADD(eReg Rd, eReg Rn, s32 Imm8, ConditionCode CC=AL)
{
DECL_Id(0x02800000);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= ARMImmid8r4(Imm8); // * 12b imm is 8b imm 4b rot. spec, add rot support!
EMIT_I;
}
EAPI ADC(eReg Rd, eReg Rn, eReg Rm, bool S, ConditionCode CC=AL)
{
DECL_Id(0x00A00000);
if (S)
I |= 1<<20;
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI ADC(eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL)
{
ADC(Rd,Rn,Rm,false,CC);
}
EAPI ADC(eReg Rd, eReg Rn, s32 Imm8, ConditionCode CC=AL)
{
DECL_Id(0x02A00000);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= ARMImmid8r4(Imm8); // * 12b imm is 8b imm 4b rot. spec, add rot support!
EMIT_I;
}
EAPI ADC(eReg Rd, eReg Rn, eReg Rm, bool S, ShiftOp Shift, u32 Imm8, ConditionCode CC=AL)
{
DECL_Id(0x00A00000);
if (S)
I |= 1<<20;
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
I |= Shift<<5;
I |= (Imm8&31)<<7;
EMIT_I;
}
EAPI ADR(eReg Rd, s32 Imm8, ConditionCode CC=AL)
{
DECL_Id(0x028F0000);
SET_CC;
I |= (Rd&15)<<12;
I |= ARMImmid8r4(Imm8); // * 12b imm is 8b imm 4b rot. spec, add rot support!
EMIT_I;
}
EAPI ADR_Zero(eReg Rd, s32 Imm8, ConditionCode CC=AL) // Special case for subtraction of 0
{
DECL_Id(0x024F0000);
SET_CC;
I |= (Rd&15)<<12;
I |= ARMImmid8r4(Imm8); // * 12b imm is 8b imm 4b rot. spec, add rot support!
EMIT_I;
}
EAPI ORR(eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x01800000);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI ORR(eReg Rd, eReg Rn, s32 Imm8, ConditionCode CC=AL)
{
DECL_Id(0x03800000);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= ARMImmid8r4(Imm8); // * 12b imm is 8b imm 4b rot. spec, add rot support!
EMIT_I;
}
EAPI ORR(eReg Rd, eReg Rn, eReg Rm, ShiftOp Shift, eReg Rs, ConditionCode CC=AL)
{
DECL_Id(0x01800000);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
I |= Shift<<5;
I |= (Rs&15)<<8;
I |= 1<<4;
EMIT_I;
}
EAPI ORR(eReg Rd, eReg Rn, eReg Rm, bool S, ShiftOp Shift, u32 Imm8, ConditionCode CC=AL)
{
DECL_Id(0x01800000);
if (S)
I |= 1<<20;
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
I |= Shift<<5;
I |= (Imm8&31)<<7;
EMIT_I;
}
EAPI AND(eReg Rd, eReg Rn, eReg Rm, bool S, ConditionCode CC=AL)
{
DECL_Id(0x00000000);
if (S)
I |= 1<<20;
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI AND(eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x00000000);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI AND(eReg Rd, eReg Rn, s32 Imm8, ConditionCode CC=AL)
{
DECL_Id(0x02000000);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= ARMImmid8r4(Imm8); // * 12b imm is 8b imm 4b rot. spec, add rot support!
EMIT_I;
}
EAPI AND(eReg Rd, eReg Rn, s32 Imm8, bool S, ConditionCode CC=AL)
{
DECL_Id(0x02000000);
if (S)
I |= 1<<20;
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= ARMImmid8r4(Imm8); // * 12b imm is 8b imm 4b rot. spec, add rot support!
EMIT_I;
}
EAPI EOR(eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x00200000);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI EOR(eReg Rd, eReg Rn, eReg Rm, bool S, ConditionCode CC=AL)
{
DECL_Id(0x00200000);
if (S)
I |= 1<<20;
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI EOR(eReg Rd, eReg Rn, s32 Imm8, ConditionCode CC=AL)
{
DECL_Id(0x02200000);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= ARMImmid8r4(Imm8); // * 12b imm is 8b imm 4b rot. spec, add rot support!
EMIT_I;
}
EAPI SUB(eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x00400000);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI SUB(eReg Rd, eReg Rn, s32 Imm8, bool S, ConditionCode CC=AL)
{
DECL_Id(0x02400000);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= ARMImmid8r4(Imm8); // * 12b imm is 8b imm 4b rot. spec, add rot support!
if (S)
I |= 1<<20;
EMIT_I;
}
EAPI SUB(eReg Rd, eReg Rn, s32 Imm8, ConditionCode CC=AL) { SUB(Rd,Rn,Imm8,false,CC); }
EAPI SBC(eReg Rd, eReg Rn, eReg Rm, bool S, ConditionCode CC=AL)
{
DECL_Id(0x00C00000);
if (S)
I |= 1<<20;
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI SBC(eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL)
{
SBC(Rd,Rn,Rm,false,CC);
}
EAPI RSB(eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x00600000);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI RSB(eReg Rd, eReg Rn, s32 Imm8, ConditionCode CC=AL)
{
DECL_Id(0x02600000);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= ARMImmid8r4(Imm8); // * 12b imm is 8b imm 4b rot. spec, add rot support!
EMIT_I;
}
EAPI RSB(eReg Rd, eReg Rn, s32 Imm8, bool S, ConditionCode CC=AL)
{
DECL_Id(0x02600000);
if (S)
I |= 1<<20;
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= ARMImmid8r4(Imm8); // * 12b imm is 8b imm 4b rot. spec, add rot support!
EMIT_I;
}
EAPI MVN(eReg Rd, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x01E00000);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI MVN(eReg Rd, s32 Imm8, ConditionCode CC=AL)
{
DECL_Id(0x03E00000);
SET_CC;
I |= (Rd&15)<<12;
I |= ARMImmid8r4(Imm8); // * 12b imm is 8b imm 4b rot. spec, add rot support!
EMIT_I;
}
EAPI TST(eReg Rn, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x01100000);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rm&15);
EMIT_I;
}
EAPI TST(eReg Rn, u32 Imm12, ConditionCode CC=AL)
{
DECL_Id(0x03100000);
SET_CC;
I |= (Rn&15)<<16;
I |= ARMImmid8r4(Imm12);
EMIT_I;
}
EAPI BIC(eReg Rd, eReg Rn, s32 Imm8, ConditionCode CC=AL)
{
DECL_Id(0x03C00000);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= ARMImmid8r4(Imm8); // * 12b imm is 8b imm 4b rot. spec, add rot support!
EMIT_I;
}
/*
*
*/
EAPI UBFX(eReg Rd, eReg Rm, u8 lsb, u8 width, ConditionCode CC=AL)
{
DECL_Id(0x07E00050);
verify(lsb+width<=32);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15);
I |= (lsb&31)<<7;
I |= ((width-1)&31)<<16;
EMIT_I;
}
EAPI MOV(eReg Rd, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x01A00000);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI MOV(eReg Rd, eReg Rm, bool S, ConditionCode CC=AL)
{
DECL_Id(0x01A00000);
if (S)
I |= 1<<20;
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI MOV(eReg Rd, eReg Rm, ShiftOp Shift, u32 Imm8, ConditionCode CC=AL)
{
DECL_Id(0x01A00000);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15);
I |= Shift<<5;
I |= (Imm8&31)<<7;
EMIT_I;
}
EAPI MOV(eReg Rd, eReg Rm, ShiftOp Shift, eReg Rs, ConditionCode CC=AL)
{
DECL_Id(0x01A00000);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15);
I |= Shift<<5;
I |= (Rs&15)<<8;
I |= 1<<4;
EMIT_I;
}
EAPI MOVW(eReg Rd, u32 Imm16, ConditionCode CC=AL)
{
DECL_Id(0x03000000);
SET_CC;
I |= (Imm16&0xF000)<<4;
I |= (Rd&15)<<12;
I |= (Imm16&0x0FFF);
EMIT_I;
}
EAPI MOVT(eReg Rd, u32 Imm16, ConditionCode CC=AL)
{
DECL_Id(0x03400000);
SET_CC;
I |= (Imm16&0xF000)<<4;
I |= (Rd&15)<<12;
I |= (Imm16&0x0FFF);
EMIT_I;
}
EAPI MOV(eReg Rd, s32 Imm8, ConditionCode CC=AL)
{
DECL_Id(0x03A00000);
SET_CC;
I |= (Rd&15)<<12;
I |= ARMImmid8r4(Imm8); // * 12b imm is 8b imm 4b rot. spec, add rot support!
EMIT_I;
}
EAPI CMP(eReg Rn, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x01500000);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rm&15);
EMIT_I;
}
EAPI CMP(eReg Rn, s32 Imm8, ConditionCode CC=AL)
{
DECL_Id(0x03500000);
SET_CC;
I |= (Rn&15)<<16;
I |= ARMImmid8r4(Imm8); // *FIXME* 12b imm is 8b imm 4b rot. spec, add rot support!
EMIT_I;
}
EAPI CMP(eReg Rd, eReg Rm, ShiftOp Shift, eReg Rs, ConditionCode CC=AL)
{
DECL_Id(0x01500000);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15);
I |= Shift<<5;
I |= (Rs&15)<<8;
I |= 1<<4;
EMIT_I;
}
EAPI CMP(eReg Rd, eReg Rm, ShiftOp Shift, u32 Imm8, ConditionCode CC=AL)
{
DECL_Id(0x01500000);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15);
I |= Shift<<5;
I |= (Imm8&31)<<7;
EMIT_I;
}
EAPI LSL(eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x01A00010);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15)<<8;
I |= (Rn&15)<<0;
EMIT_I;
}
EAPI LSL(eReg Rd, eReg Rm, s32 imm5, ConditionCode CC=AL)
{
DECL_Id(0x01A00000);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15)<<0;
I |= (imm5&31)<<7;
EMIT_I;
}
EAPI LSR(eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x01A00030);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15)<<8;
I |= (Rn&15)<<0;
EMIT_I;
}
EAPI RRX(eReg Rd, eReg Rm,bool S=false, ConditionCode CC=AL)
{
DECL_Id(0x01A00060);
if (S)
I |= 1<<20;
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15)<<0;
EMIT_I;
}
EAPI LSR(eReg Rd, eReg Rm, s32 imm5, bool S, ConditionCode CC=AL)
{
DECL_Id(0x01A00020);
if (S)
I |= 1<<20;
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15)<<0;
I |= (imm5&31)<<7;
EMIT_I;
}
EAPI LSR(eReg Rd, eReg Rm, s32 imm5, ConditionCode CC=AL)
{
LSR(Rd,Rm,imm5,false,CC);
}
EAPI ASR(eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x01A00050);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15)<<8;
I |= (Rn&15)<<0;
EMIT_I;
}
EAPI ASR(eReg Rd, eReg Rm, s32 imm5, ConditionCode CC=AL)
{
DECL_Id(0x01A00040);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15)<<0;
I |= (imm5&31)<<7;
EMIT_I;
}
EAPI ROR(eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x01A00070);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15)<<8;
I |= (Rn&15)<<0;
EMIT_I;
}
EAPI ROR(eReg Rd, eReg Rm, s32 imm5, ConditionCode CC=AL)
{
DECL_Id(0x01A00060);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15)<<0;
I |= (imm5&31)<<7;
EMIT_I;
}
#undef DP_PARAMS
#undef DP_RPARAMS
#undef DP_COMMON
#undef DP_RCOMMON
#undef DP_OPCODE
};
-151
View File
@@ -1,151 +0,0 @@
/*
* E_Extend.h
*
There are six basic instructions:
XTAB16 Extend bits[23:16] and bits[7:0] of one register to 16 bits, and add corresponding halfwordsto the values in another register.
XTAB Extend bits[ 7: 0] of one register to 32 bits, and add to the value in another register.
XTAH Extend bits[15: 0] of one register to 32 bits, and add to the value in another register.
XTB16 Extend bits[23:16] and bits[7:0] to 16 bits each.
XTB Extend bits[ 7: 0] to 32 bits.
XTH Extend bits[15: 0] to 32 bits.
Each of the six instructions is available in the following variations, indicated by the prefixes shown:
S Sign extension, with or without addition modulo 216 or 232.
U Zero (unsigned) extension, with or without addition modulo 216 or 232.
*/
#pragma once
namespace ARM
{
EAPI SXTAB16(eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x06800070);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI SXTAB(eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x06A00070);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI SXTAH(eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x06B00070);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI SXTB16(eReg Rd, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x068F0070);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI SXTB(eReg Rd, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x06AF0070);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI SXTH(eReg Rd, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x06BF0070);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI UXTAB16(eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x06C00070);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI UXTAB(eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x06E00070);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI UXTAH(eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x06F00070);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI UXTB16(eReg Rd, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x06CF0070);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI UXTB(eReg Rd, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x06EF0070);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI UXTH(eReg Rd, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x06FF0070);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
};
-310
View File
@@ -1,310 +0,0 @@
/*
* E_LoadStore.h
*
* LDR|STR{<cond>}{B}{T} Rd, <addressing_mode>
*
*/
#pragma once
namespace ARM
{
enum AddrMode {
Offset, // [Rn, offset] - Base:Offset used for access, no writeback
PostIndexed, // [Rn, offset] ! - Base:Offset used for access, written back to Base reg.
PreIndexed // [Rn],offset - Base used then Base:Offset written back to Base reg.
// offset: imm{8,12}, Rm, Rm <Shifter> #Shift
};
#define SET_Rn I |= (Rn&15)<<16
#define SET_Rt I |= (Rt&15)<<12
#define SET_Rm I |= (Rm&15)
#define SET_Rtn SET_Rt; SET_Rn
#define SET_Rtnm SET_Rt; SET_Rn; SET_Rm
#define SET_I I |= (1<<25) // Sets Register (Rather than Immediate) Addressing
#define SET_P I |= (1<<24) // If NOT Set: post-indexed, else offset||pre-indexed (W. determines which)
#define SET_U I |= (1<<23) // If SET: Offset is added to base, else its subtracted (Sign of sImm12)
#define SET_B I |= (1<<22) // If SET: Access is a byte access, else its a word access.
#define SET_W I |= (1<<21) // (P==0) [ W==0: reg. post indexed, W==1: Unprivileged T variant ] (P==1) [ W==0: Offset , W==1: Pre-indexed ]
#define SET_L I |= (1<<20) // (L==1) Load / Store
#define SET_AddrMode \
if(mode==Offset) { SET_P; } \
else if(mode==PreIndexed) { SET_P; SET_W; }
/*
#define SET_AddrMode \
\
switch(mode) { \
case PostIndexed: break; \
case Offset: SET_P; break; \
case PreIndexed: SET_P; SET_W; break; \
}
*/
#define SET_sImm12 \
\
if (0 != sImm12) { \
if (sImm12 > 0) { SET_U; } \
I |= (abs(sImm12) &0xFFF); \
}
#define SET_sImm8 \
\
if(0 != sImm8) { \
verify(is_s8(sImm8)); \
if(sImm8 > 0) { SET_U; } \
sImm8 = abs(sImm8); \
I |= ((u32)sImm8 &0x0F); \
I |= ((u32)sImm8 &0xF0)<<4; \
}
#define SET_Imm5 I |= ((Imm5&0x1F)<<7)
#define SET_type I |= ((type&3)<<5)
/* - Load/Store Encoding
--------------------------------------------------------------------------------------
cond 01-IPUBWL Rn Rt addr_mode -- Load/Store Word || Unsigned Byte
I,P,U,W - Specify type of addressing mode
L - Specify Load (L==1), else Store
B - Specify Byte (B==1), else Word
--------------------------------------------------------------------------------------
cond 000-PUIWL Rn Rt addr_mode 1SH1 addr_mode -- Load/Store Halfword || Signed byte
I,P,U,W - Specify type of addressing mode
L - Specify Load (L==1), else Store
S - Specify signed (S==1), else unsigned access
H - Specify Halfword access, else signed byte
--------------------------------------------------------------------------------------
cond 010-PUBWL Rn Rt sImm12-iiii-iiii Imm Offset
cond 011-PUBWL Rn Rt #sft sft_op 0 Rm Reg Offset
cond 000 PU1WL Rn Rt imHI 1011 imLO Imm Offset - halfword
cond 000 PU0WL Rn Rt SBZ 1011 Rm Reg Offset - halfword
cond 000 PU1W1 Rn Rt imHI 11H1 imLO Imm Offset - signed halfword/byte
cond 000 PU0W1 Rn Rt SBZ 11H1 Rm Reg Offset - signed halfword/byte
cond 000 PU1W0 Rn Rt imHI 11S1 imLO Imm Offset - two words
cond 000 PU0W0 Rn Rt SBZ 11S1 Rm Reg Offset - two words
cond 100-PUSWL Rn Register-list Multiple
cond 110-PUNWL Rn CRd cp_num offs8 COP & double reg xfer
cond 0001 0B00 Rn Rt SBZ 1001 Rm Swap [byte]
--------------------------------------------------------------------------------------
LDR L 010 1U001 11 Rt imm12 - *no literal stores*
LDR I 010 PU0W1 Rn Rt imm12 - STR I 010 PU0W0 Rn Rt imm12
LDR R 011 PU0W1 Rn Rt imm5 type 0 Rm - STR R 011 PU0W0 Rn Rt imm5 type 0 Rm
LDRT I 010 0U011 Rn Rt imm12 - STRT I 010 0U010 Rn Rt imm12
LDRT R 011 0U011 Rn Rt imm5 type 0 Rm - STRT R 011 0U010 Rn Rt imm5 type 0 Rm
LDRB L 010 1U101 11 Rt imm12 - *^^
LDRB I 010 PU1W1 Rn Rt imm12 - STRB I 010 PU1W0 Rn Rt imm12
LDRB R 011 PU1W1 Rn Rt imm5 type 0 Rm - STRB R 011 PU1W0 Rn Rt imm5 type 0 Rm
LDRBT I
LDRBT R
--------------------------------------------------------------------------------------
LDRH L 000 1U101 11 Rt imm4H 1011 imm4L - *^^
LDRH I 000 PU1W1 Rn Rt imm4H 1011 imm4L - STRH I 000 PU1W0 Rn Rt imm4H 1011 imm4L
LDRH R 000 PU0W1 Rn Rt 0000 1011 Rm - STRH R 000 PU0W0 Rn Rt 0000 1011 Rm
LDRD L 000 1U100 11 Rt imm4H 1101 imm4L - *^^
LDRD I 000 PU1W0 Rn Rt imm4H 1101 imm4L - STRD I 000 PU1W0 Rn Rt imm4H 1111 imm4L
LDRD R 000 PU0W0 Rn Rt 0000 1101 Rm - STRD R 000 PU0W0 Rn Rt 0000 1111 Rm
--------------------------------------------------------------------------------------
LDRHT/STRHT
LDREX/STREX
LDREXB/STREXB
LDREXH/STREXH
LDREXD/STREXD
--------------------------------------------------------------------------------------
EAPI LDR 0x04100000 // These were all the A1 Versions for Imm IIRC
EAPI LDRB 0x04500000
EAPI LDRBT 0x06700000
EAPI LDRD 0x00000000
EAPI LDREX 0x01900090
EAPI LDRH 0x00100090
EAPI LDRSB 0x00100000
EAPI LDRSH 0x00100000
EAPI LDRT 0x04300000
EAPI STR 0x04000000
EAPI STRB 0x04400000
EAPI STRBT 0x06600000
EAPI STRD 0x00000000
EAPI STREX 0x01800090
EAPI STRH 0x00000090
EAPI STRT 0x04200000
*/
extern u8* emit_opt;
extern eReg reg_addr;
extern eReg reg_dst;
extern s32 imma;
EAPI LDR (eReg Rt, eReg Rn, s32 sImm12=0, AddrMode mode=Offset, ConditionCode CC=AL)
{
if (emit_opt+4==(u8*)EMIT_GET_PTR() && reg_addr==Rn && imma==sImm12)
{
if (reg_dst!=Rt)
MOV(Rt,reg_dst);
}
else
{
DECL_Id(0x04100000); SET_CC; SET_Rtn; SET_AddrMode; SET_sImm12; EMIT_I;
}
}
EAPI STR (eReg Rt, eReg Rn, s32 sImm12=0, AddrMode mode=Offset, ConditionCode CC=AL)
{
emit_opt=0;//(u8*)EMIT_GET_PTR();
reg_addr=Rn;
reg_dst=Rt;
imma=sImm12;
DECL_Id(0x04000000); SET_CC; SET_Rtn; SET_AddrMode; SET_sImm12; EMIT_I;
}
EAPI LDRB(eReg Rt, eReg Rn, s32 sImm12=0, AddrMode mode=Offset, ConditionCode CC=AL) { DECL_Id(0x04500000); SET_CC; SET_Rtn; SET_AddrMode; SET_sImm12; SET_B; EMIT_I; } // Prob don't need SET_B, in iID
EAPI STRB(eReg Rt, eReg Rn, s32 sImm12=0, AddrMode mode=Offset, ConditionCode CC=AL) { DECL_Id(0x04400000); SET_CC; SET_Rtn; SET_AddrMode; SET_sImm12; SET_B; EMIT_I; } // Prob don't need SET_B, in iID
EAPI LDRT (eReg Rt, eReg Rn, s32 sImm12=0, ConditionCode CC=AL) { DECL_Id(0x04300000); SET_CC; SET_Rtn; SET_sImm12; EMIT_I; }
EAPI STRT (eReg Rt, eReg Rn, s32 sImm12=0, ConditionCode CC=AL) { DECL_Id(0x04200000); SET_CC; SET_Rtn; SET_sImm12; EMIT_I; }
EAPI LDRBT(eReg Rt, eReg Rn, s32 sImm12=0, ConditionCode CC=AL) { DECL_Id(0x04700000); SET_CC; SET_Rtn; SET_sImm12; SET_B; EMIT_I; } // Prob don't need SET_B, in iID
EAPI STRBT(eReg Rt, eReg Rn, s32 sImm12=0, ConditionCode CC=AL) { DECL_Id(0x04600000); SET_CC; SET_Rtn; SET_sImm12; SET_B; EMIT_I; } // Prob don't need SET_B, in iID
// LDR(r1,r2,r3, Offset, true, L_LSL, 5, EQ); ... LDR r1, r2, +r3 LSL #5
EAPI LDR (eReg Rt, eReg Rn, eReg Rm, AddrMode mode=Offset, bool Add=false, ShiftOp type=S_LSL, u32 Imm5=0, ConditionCode CC=AL) { DECL_Id(0x06100000); SET_CC; SET_Rtnm; SET_AddrMode; SET_Imm5; SET_type; if(Add){ SET_U; } EMIT_I; }
EAPI STR (eReg Rt, eReg Rn, eReg Rm, AddrMode mode=Offset, bool Add=false, ShiftOp type=S_LSL, u32 Imm5=0, ConditionCode CC=AL) { DECL_Id(0x06000000); SET_CC; SET_Rtnm; SET_AddrMode; SET_Imm5; SET_type; if(Add){ SET_U; } EMIT_I; }
EAPI LDRB(eReg Rt, eReg Rn, eReg Rm, AddrMode mode=Offset, bool Add=false, ShiftOp type=S_LSL, u32 Imm5=0, ConditionCode CC=AL) { DECL_Id(0x06500000); SET_CC; SET_Rtnm; SET_AddrMode; SET_Imm5; SET_type; if(Add){ SET_U; } SET_B; EMIT_I; } // Prob don't need SET_B, in iID
EAPI STRB(eReg Rt, eReg Rn, eReg Rm, AddrMode mode=Offset, bool Add=false, ShiftOp type=S_LSL, u32 Imm5=0, ConditionCode CC=AL) { DECL_Id(0x06400000); SET_CC; SET_Rtnm; SET_AddrMode; SET_Imm5; SET_type; if(Add){ SET_U; } SET_B; EMIT_I; } // Prob don't need SET_B, in iID
EAPI LDRT (eReg Rt, eReg Rn, eReg Rm, bool Add=false, ShiftOp type=S_LSL, u32 Imm5=0, ConditionCode CC=AL) { DECL_Id(0x06300000); SET_CC; SET_Rtnm; SET_Imm5; SET_type; if(Add){ SET_U; } EMIT_I; }
EAPI STRT (eReg Rt, eReg Rn, eReg Rm, bool Add=false, ShiftOp type=S_LSL, u32 Imm5=0, ConditionCode CC=AL) { DECL_Id(0x06200000); SET_CC; SET_Rtnm; SET_Imm5; SET_type; if(Add){ SET_U; } EMIT_I; }
EAPI LDRBT(eReg Rt, eReg Rn, eReg Rm, bool Add=false, ShiftOp type=S_LSL, u32 Imm5=0, ConditionCode CC=AL) { DECL_Id(0x06700000); SET_CC; SET_Rtnm; SET_Imm5; SET_type; if(Add){ SET_U; } SET_B; EMIT_I; } // Prob don't need SET_B, in iID
EAPI STRBT(eReg Rt, eReg Rn, eReg Rm, bool Add=false, ShiftOp type=S_LSL, u32 Imm5=0, ConditionCode CC=AL) { DECL_Id(0x06600000); SET_CC; SET_Rtnm; SET_Imm5; SET_type; if(Add){ SET_U; } SET_B; EMIT_I; } // Prob don't need SET_B, in iID
// LDR Rt,[PC, #(s:+/-)Imm12] *Special Case - Literal / PC Relative
EAPI LDR(eReg Rt, s32 sImm12, ConditionCode CC=AL) {
DECL_Id(0x051F0000); SET_CC; SET_Rt; SET_sImm12; EMIT_I;
}
// LDRB Rt,[PC, #(s:+/-)Imm12] *Special Case - Literal / PC Relative
EAPI LDRB(eReg Rt, s32 sImm12, ConditionCode CC=AL) {
DECL_Id(0x055F0000); SET_CC; SET_Rt; SET_sImm12; EMIT_I;
}
// Note: Following support Post-Indexed addressing only //
EAPI LDRH(eReg Rt, eReg Rn, s32 sImm8, ConditionCode CC=AL) { DECL_Id(0x005000B0); SET_CC; SET_Rtn; SET_P; SET_sImm8; EMIT_I; }
EAPI STRH(eReg Rt, eReg Rn, s32 sImm8, ConditionCode CC=AL) { DECL_Id(0x004000B0); SET_CC; SET_Rtn; SET_P; SET_sImm8; EMIT_I; }
EAPI LDRD(eReg Rt, eReg Rn, s32 sImm8, ConditionCode CC=AL) { DECL_Id(0x004000D0); SET_CC; SET_Rtn; SET_P; SET_sImm8; EMIT_I; }
EAPI STRD(eReg Rt, eReg Rn, s32 sImm8, ConditionCode CC=AL) { DECL_Id(0x004000F0); SET_CC; SET_Rtn; SET_P; SET_sImm8; EMIT_I; }
EAPI LDRH(eReg Rt, eReg Rn, eReg Rm, bool Add=true,ConditionCode CC=AL) { DECL_Id(0x001000B0); SET_CC; SET_Rtnm; SET_P; if (Add) {SET_U;} EMIT_I; }
EAPI STRH(eReg Rt, eReg Rn, eReg Rm, bool Add=true,ConditionCode CC=AL) { DECL_Id(0x000000B0); SET_CC; SET_Rtnm; SET_P; if (Add) {SET_U;} EMIT_I; }
EAPI LDRD(eReg Rt, eReg Rn, eReg Rm, bool Add=true, ConditionCode CC=AL) { DECL_Id(0x000000D0); SET_CC; SET_Rtnm; SET_P; if (Add) {SET_U;} EMIT_I; }
EAPI STRD(eReg Rt, eReg Rn, eReg Rm, bool Add=true, ConditionCode CC=AL) { DECL_Id(0x000000F0); SET_CC; SET_Rtnm; SET_P; if (Add) {SET_U;} EMIT_I; }
EAPI LDRSB(eReg Rt, eReg Rn, eReg Rm, bool Add=true,ConditionCode CC=AL) { DECL_Id(0x001000D0); SET_CC; SET_Rtnm; SET_P; if (Add) {SET_U;} EMIT_I; }
EAPI LDRSH(eReg Rt, eReg Rn, eReg Rm, bool Add=true,ConditionCode CC=AL) { DECL_Id(0x001000F0); SET_CC; SET_Rtnm; SET_P; if (Add) {SET_U;} EMIT_I; }
EAPI LDRH(eReg Rt, s32 sImm8, ConditionCode CC=AL) { DECL_Id(0x015F00B0); SET_CC; SET_Rt; SET_sImm8; EMIT_I; } // *Special Case - Literal / PC Relative
EAPI STRH(eReg Rt, s32 sImm8, ConditionCode CC=AL) { DECL_Id(0x014F00D0); SET_CC; SET_Rt; SET_sImm8; EMIT_I; } // *Special Case - Literal / PC Relative
// TODO: {LD,ST}R{SB,EX*} && friends (If required).
// Must use _Reg format
EAPI PUSH(u32 RegList, ConditionCode CC=AL)
{
DECL_Id(0x092D0000);
SET_CC;
I |= (RegList&0xFFFF);
EMIT_I;
}
EAPI POP(u32 RegList, ConditionCode CC=AL)
{
DECL_Id(0x08BD0000);
SET_CC;
I |= (RegList&0xFFFF);
EMIT_I;
}
#undef SET_Rtn
#undef SET_Rtnm
#undef SET_Rn
#undef SET_Rt
#undef SET_Rm
#undef SET_I
#undef SET_P
#undef SET_U
#undef SET_B
#undef SET_W
#undef SET_L
#undef SET_AddrMode
#undef SET_sImm12
#undef SET_sImm8
#undef SET_Imm5
#undef SET_type
};
-208
View File
@@ -1,208 +0,0 @@
/*
* E_Misc.h
*
*/
#pragma once
namespace ARM
{
/*
* Misc. Arithmetic Instructions
*/
// Count Leading Zero's
//
EAPI CLZ(eReg Rd, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x016F0F10);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
// Unsigned sum of absolute differences
//
EAPI USAD8(eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL)
{
DECL_Id(0x0780F010);
SET_CC;
I |= (Rd&15)<<16;
I |= (Rs&15)<<8;
I |= (Rm&15);
EMIT_I;
}
EAPI USADA8(eReg Rd, eReg Rm, eReg Rs, eReg Rn, ConditionCode CC=AL)
{
DECL_Id(0x07800010);
SET_CC;
I |= (Rd&15)<<16;
I |= (Rn&15)<<12;
I |= (Rs&15)<<8;
I |= (Rm&15);
EMIT_I;
}
/*
* Packing Instructions
*/
EAPI PKHBT(eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL) // * shift_imm
{
DECL_Id(0x06800010);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI PKHTB(eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL) // * shift_imm
{
DECL_Id(0x06800050);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
/*
* Swapping Instructions
*/
EAPI REV(eReg Rd, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x06BF0F30);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI REV16(eReg Rd, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x06BF0FB0);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI REVSH(eReg Rd, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x06FF0F30);
SET_CC;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
EAPI SEL(eReg Rd, eReg Rn, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x06800FB0);
SET_CC;
I |= (Rn&15)<<16;
I |= (Rd&15)<<12;
I |= (Rm&15);
EMIT_I;
}
/*
* Saturate Instructions
*/
// SSAT{<cond>} <Rd>, #<immed>, <Rm>{, <shift>}
//
EAPI SSAT(eReg Rd, u32 sat_imm, eReg Rm, u32 sft_imm, ConditionCode CC=AL) // sh&1 << 6
{
DECL_Id(0x06A00010);
SET_CC;
I |= (sat_imm&31)<<16;
I |= (Rd&15)<<12;
I |= (sft_imm&31)<<7;
I |= (Rm&15);
EMIT_I;
}
// SSAT16{<cond>} <Rd>, #<immed>, <Rm>
//
EAPI SSAT16(eReg Rd, u32 sat_imm, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x06A00030);
SET_CC;
I |= (sat_imm&15)<<16;
I |= (Rd&15)<<12;
I |= 15<<8; // * SBO
I |= (Rm&15);
EMIT_I;
}
// USAT{<cond>} <Rd>, #<immed>, <Rm>{, <shift>}
//
EAPI USAT(eReg Rd, u32 sat_imm, eReg Rm, u32 sft_imm, ConditionCode CC=AL)
{
DECL_Id(0x06E00010);
SET_CC;
I |= (sat_imm&31)<<16;
I |= (Rd&15)<<12;
I |= (sft_imm&31)<<7;
I |= (Rm&15);
EMIT_I;
}
// USAT16{<cond>} <Rd>, #<immed>, <Rm>
//
EAPI USAT16(eReg Rd, u32 sat_imm, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x06E00030);
SET_CC;
I |= (sat_imm&15)<<16;
I |= (Rd&15)<<12;
I |= 15<<8; // * SBO
I |= (Rm&15);
EMIT_I;
}
};
-99
View File
@@ -1,99 +0,0 @@
/*
* E_Multiply.h
*
*/
#pragma once
namespace ARM
{
EAPI MLA(eReg Rd, eReg Rn, eReg Rs, eReg Rm, ConditionCode CC=AL) // *FIXME* S
{
DECL_Id(0x00200090);
SET_CC;
I |= (Rd&15)<<16;
I |= (Rn&15)<<12;
I |= (Rs&15)<<8;
I |= (Rm&15);
EMIT_I;
}
EAPI MUL(eReg Rd, eReg Rs, eReg Rm, ConditionCode CC=AL) // *FIXME* S
{
DECL_Id(0x00000090);
SET_CC;
I |= (Rd&15)<<16;
I |= (Rs&15)<<8;
I |= (Rm&15);
EMIT_I;
}
EAPI UMULL(eReg Rdhi, eReg Rdlo, eReg Rs, eReg Rm, ConditionCode CC=AL) // *FIXME* S
{
DECL_Id(0x00800090);
SET_CC;
I |= (Rdhi&15)<<16;
I |= (Rdlo&15)<<12;
I |= (Rs&15)<<8;
I |= (Rm&15);
EMIT_I;
}
EAPI SMULL(eReg Rdhi, eReg Rdlo, eReg Rs, eReg Rm, ConditionCode CC=AL) // *FIXME* S
{
DECL_Id(0x00C00090);
SET_CC;
I |= (Rdhi&15)<<16;
I |= (Rdlo&15)<<12;
I |= (Rs&15)<<8;
I |= (Rm&15);
EMIT_I;
}
#if 0
SMLA<x><y> Signed halfword Multiply Accumulate.
SMLAD Signed halfword Multiply Accumulate, Dual.
SMLAL Signed Multiply Accumulate Long.
SMLAL<x><y> Signed halfword Multiply Accumulate Long.
SMLALD Signed halfword Multiply Accumulate Long, Dual.
SMLAW<y> Signed halfword by word Multiply Accumulate.
SMLSD Signed halfword Multiply Subtract, Dual.
SMLSLD Signed halfword Multiply Subtract Long Dual.
SMMLA Signed Most significant word Multiply Accumulate.
SMMLS Signed Most significant word Multiply Subtract.
SMMUL Signed Most significant word Multiply.
SMUAD Signed halfword Multiply, Add, Dual.
SMUL<x><y> Signed halfword Multiply.
SMULL Signed Multiply Long.
SMULW<y> Signed halfword by word Multiply.
SMUSD Signed halfword Multiply, Subtract, Dual.
UMAAL Unsigned Multiply Accumulate significant Long.
UMLAL Unsigned Multiply Accumulate Long.
UMULL Unsigned Multiply Long.
#endif
};
-112
View File
@@ -1,112 +0,0 @@
/*
* E_Parallel.h
*
ADD8 Adds each byte of the second operand register to the corresponding byte of the first operand
register to form the corresponding byte of the result.
ADD16 Adds the top halfwords of two registers to form the top halfword of the result.
Adds the bottom halfwords of the same two registers to form the bottom halfword of the result.
SUB8 Subtracts each byte of the second operand register from the corresponding byte of the first
operand register to form the corresponding byte of the result.
SUB16 Subtracts the top halfword of the first operand register from the top halfword of the second operand register to form the top halfword of the result.
Subtracts the bottom halfword of the second operand registers from the bottom halfword of
the first operand register to form the bottom halfword of the result.
ADDSUBX Does the following:
1. Exchanges halfwords of the second operand register.
2. Adds top halfwords and subtracts bottom halfwords.
SUBADDX Does the following:
1. Exchanges halfwords of the second operand register.
2. Subtracts top halfwords and adds bottom halfwords.
Each of the six instructions is available in the following variations, indicated by the prefixes shown:
S Signed arithmetic modulo 28 or 216. Sets the CPSR GE bits (see The GE[3:0] bits on page A2-13).
Q Signed saturating arithmetic.
SH Signed arithmetic, halving the results to avoid overflow.
U Unsigned arithmetic modulo 28 or 216. Sets the CPSR GE bits (see The GE[3:0] bits on page A2-13).
UQ Unsigned saturating arithmetic.
UH Unsigned arithmetic, halving the results to avoid overflow.
Status:
These routines require implementation if needed.
*/
#pragma once
namespace ARM
{
#if defined(_DEVEL) && 0
// S
//
EAPI SADD8 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI SADD16 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI SSUB8 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI SSUB16 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI SADDSUBX(eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI SSUBADDX(eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
// Q
//
EAPI QADD8 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI QADD16 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI QSUB8 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI QSUB16 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI QADDSUBX(eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI QSUBADDX(eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
// SH
//
EAPI SHADD8 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI SHADD16 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI SHSUB8 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI SHSUB16 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI SHADDSUBX(eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI SHSUBADDX(eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
// U
//
EAPI UADD8 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI UADD16 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI USUB8 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI USUB16 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI UADDSUBX(eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI USUBADDX(eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
// UQ
//
EAPI UQADD8 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI UQADD16 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI UQSUB8 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI UQSUB16 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI UQADDSUBX(eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI UQSUBADDX(eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
// UH
//
EAPI UHADD8 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI UHADD16 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI UHSUB8 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI UHSUB16 (eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI UHADDSUBX(eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
EAPI UHSUBADDX(eReg Rd, eReg Rm, eReg Rs, ConditionCode CC=AL) ;
#endif
};
-74
View File
@@ -1,74 +0,0 @@
/*
* E_Special.h
*
*/
#pragma once
namespace ARM
{
EAPI ARMERROR()
{
DECL_Id(0xFFFFFFFF);
EMIT_I;
}
EAPI NOP()
{
DECL_Id(0xE320F000);
EMIT_I;
}
EAPI SVC(u32 code)
{
DECL_Id(0x0F000000);
I |= code&0xFFFFFF;
EMIT_I;
}
EAPI BKPT()
{
DECL_Id(0x01200070);
EMIT_I;
}
#define SWI SVC
/*
* Synchronization & Barrier Instructions.
*
*/
EAPI DSB()
{
DECL_Id(0xF57FF04F);
EMIT_I;
}
EAPI DMB()
{
DECL_Id(0xF57FF05F);
EMIT_I;
}
EAPI ISB()
{
DECL_Id(0xF57FF06F);
EMIT_I;
}
};
-99
View File
@@ -1,99 +0,0 @@
/*
* E_Status.h
*
*/
#pragma once
namespace ARM
{
#if defined(_DEVEL)
// MRS Move PSR to General-purpose Register.
//
EAPI MRS(eReg Rd, u32 R, ConditionCode CC=AL)
{
DECL_Id(0x01000000);
SET_CC;
I |= (R&1) << 22;
I |= 15<<16; // * SBO
I |= (Rd &15)<<12;
EMIT_I;
}
/* MSR Move General-purpose Register to PSR.
MSR{<cond>} CPSR_<fields>, #<immediate>
MSR{<cond>} CPSR_<fields>, <Rm>
MSR{<cond>} SPSR_<fields>, #<immediate>
MSR{<cond>} SPSR_<fields>, <Rm>
*/
// MSR: Immediate operand
//
EAPI MSR(u32 R, u32 fmask, u32 rot_imm, u32 imm8, ConditionCode CC=AL)
{
DECL_Id(0x03200000);
SET_CC;
I |= (R&1) << 22;
I |= (fmask &15)<<16;
I |= 15<<12; // * SBO
I |= (rot_imm &15)<<8;
I |= (imm8 &255);
EMIT_I;
}
// MSR: Register operand
//
EAPI MSR(u32 R, u32 fmask, eReg Rm, ConditionCode CC=AL)
{
DECL_Id(0x01200000);
SET_CC;
I |= (R&1) << 22;
I |= (fmask &15)<<16;
I |= 15<<12; // * SBO
I |= (Rm&15);
EMIT_I;
}
// CPS Change Processor State.
//
EAPI CPS(u32 imod, u32 mmod, u32 mode) // ** [A|I|F]
{
DECL_Id(0xF1000000);
// Note: UNconditional instruction!
I |= (imod&3)<<18;
I |= (mmod&1)<<17;
I |= (mode&15);
EMIT_I;
}
// SETEND Modifies the CPSR endianness, E, bit, without changing any other bits in the CPSR.
//
EAPI SETEND(u32 E)
{
DECL_Id(0xF1010000);
// Note: UNconditional instruction!
I |= (E &1) << 9;
EMIT_I;
}
#endif
};
-667
View File
@@ -1,667 +0,0 @@
/*
* E_VDataOp.h * VFP/A.SIMD Data Processing Instruction Set Encoding
*
* V{<modifier>}<operation>{<shape>}<c><q>{.<dt>} {<dest>,} <src1>, <src2>
*
* <modifier> Meaning
* Q The operation uses saturating arithmetic.
* R The operation performs rounding.
* D The operation doubles the result (before accumulation, if any).
* H The operation halves the result.
*
* <shape> Meaning Typical register shape
* (none) The operands and result are all the same width. Dd, Dn, Dm - Qd, Qn, Qm
* L Long operation - result is 2 x width of both operands Qd, Dn, Dm
* N Narrow operation - result is width/2 both operands Dd, Qn, Qm
* W Wide operation - result and oper[1] are 2x width oper[2] Qd, Qn, Dm
*/
#pragma once
namespace ARM
{
#define SET_Qd \
I |= (((Qd<<1)&0x0E)<<12); \
I |= (((Qd<<1)&0x10)<<18)
#define SET_Qn \
I |= (((Qn<<1)&0x0E)<<16); \
I |= (((Qn<<1)&0x10)<<3)
#define SET_Qm \
I |= (((Qm<<1)&0x0E)); \
I |= (((Qm<<1)&0x10)<<1)
#define SET_Dd \
I |= ((Dd&0x0F)<<12); \
I |= ((Dd&0x10)<<18)
#define SET_Dn \
I |= ((Dn&0x0F)<<16); \
I |= ((Dn&0x10)<<3)
#define SET_Dm \
I |= ((Dm&0x0F)); \
I |= ((Dm&0x10)<<1)
#define SET_Q I |= 0x40
#define SET_U I |= ((U&1)<<24);
#define SET_Size I |= (((Size>>4)&3)<<20) // 8,16,32 -> 0,1,2
#define SET_Qdnm \
SET_Qd; SET_Qn; SET_Qm; SET_Q
#define SET_Ddnm \
SET_Dd; SET_Dn; SET_Dm
#define DECL_Qdnm
#define VdpInstrF(viName, viId) \
EAPI V##viName##_F32 (eFQReg Qd, eFQReg Qn, eFQReg Qm) { DECL_Id(viId); SET_Qdnm; EMIT_I; } \
EAPI V##viName##_F32 (eFDReg Dd, eFDReg Dn, eFDReg Dm) { DECL_Id(viId); SET_Ddnm; EMIT_I; }
#define VdpInstrI_EOR(viName, viId) \
EAPI V##viName (eFQReg Qd, eFQReg Qn, eFQReg Qm) { DECL_Id(viId); SET_Qdnm; EMIT_I; } \
EAPI V##viName (eFDReg Dd, eFDReg Dn, eFDReg Dm) { DECL_Id(viId); SET_Ddnm; EMIT_I; } \
#define VdpInstrI(viName, viId) \
EAPI V##viName (eFQReg Qd, eFQReg Qn, eFQReg Qm, u32 Size=32) { DECL_Id(viId); SET_Qdnm; SET_Size; EMIT_I; } \
EAPI V##viName (eFDReg Dd, eFDReg Dn, eFDReg Dm, u32 Size=32) { DECL_Id(viId); SET_Ddnm; SET_Size; EMIT_I; } \
\
EAPI V##viName##_I8 (eFQReg Qd, eFQReg Qn, eFQReg Qm) { V##viName (Qd, Qn, Qm, 8); } \
EAPI V##viName##_I8 (eFDReg Dd, eFDReg Dn, eFDReg Dm) { V##viName (Dd, Dn, Dm, 8); } \
EAPI V##viName##_I16 (eFQReg Qd, eFQReg Qn, eFQReg Qm) { V##viName (Qd, Qn, Qm, 16); } \
EAPI V##viName##_I16 (eFDReg Dd, eFDReg Dn, eFDReg Dm) { V##viName (Dd, Dn, Dm, 16); } \
EAPI V##viName##_I32 (eFQReg Qd, eFQReg Qn, eFQReg Qm) { V##viName (Qd, Qn, Qm, 32); } \
EAPI V##viName##_I32 (eFDReg Dd, eFDReg Dn, eFDReg Dm) { V##viName (Dd, Dn, Dm, 32); }
#define VdpInstrU(viName, viId) \
EAPI V##viName (eFQReg Qd, eFQReg Qn, eFQReg Qm, u32 Size=32, u32 U=0) { DECL_Id(viId); SET_Qdnm; SET_U; SET_Size; EMIT_I; } \
EAPI V##viName (eFDReg Dd, eFDReg Dn, eFDReg Dm, u32 Size=32, u32 U=0) { DECL_Id(viId); SET_Ddnm; SET_U; SET_Size; EMIT_I; } \
\
EAPI V##viName##_U8 (eFQReg Qd, eFQReg Qn, eFQReg Qm) { V##viName (Qd, Qn, Qm, 8, 1); } \
EAPI V##viName##_U8 (eFDReg Dd, eFDReg Dn, eFDReg Dm) { V##viName (Dd, Dn, Dm, 8, 1); } \
EAPI V##viName##_S8 (eFQReg Qd, eFQReg Qn, eFQReg Qm) { V##viName (Qd, Qn, Qm, 8, 0); } \
EAPI V##viName##_S8 (eFDReg Dd, eFDReg Dn, eFDReg Dm) { V##viName (Dd, Dn, Dm, 8, 0); } \
EAPI V##viName##_U16 (eFQReg Qd, eFQReg Qn, eFQReg Qm) { V##viName (Qd, Qn, Qm, 16, 1); } \
EAPI V##viName##_U16 (eFDReg Dd, eFDReg Dn, eFDReg Dm) { V##viName (Dd, Dn, Dm, 16, 1); } \
EAPI V##viName##_S16 (eFQReg Qd, eFQReg Qn, eFQReg Qm) { V##viName (Qd, Qn, Qm, 16, 0); } \
EAPI V##viName##_S16 (eFDReg Dd, eFDReg Dn, eFDReg Dm) { V##viName (Dd, Dn, Dm, 16, 0); } \
EAPI V##viName##_U32 (eFQReg Qd, eFQReg Qn, eFQReg Qm) { V##viName (Qd, Qn, Qm, 32, 1); } \
EAPI V##viName##_U32 (eFDReg Dd, eFDReg Dn, eFDReg Dm) { V##viName (Dd, Dn, Dm, 32, 1); } \
EAPI V##viName##_S32 (eFQReg Qd, eFQReg Qn, eFQReg Qm) { V##viName (Qd, Qn, Qm, 32, 0); } \
EAPI V##viName##_S32 (eFDReg Dd, eFDReg Dn, eFDReg Dm) { V##viName (Dd, Dn, Dm, 32, 0); }
//# define VdpInstrImm (viName, viId)
// Another three or four like the above .. immN, above w/ size, F32 w/ sz
/*
* A.SIMD Parallel Add/Sub
*
Vector Add VADD (integer), VADD (floating-point)
Vector Add and Narrow, returning High Half VADDHN
Vector Add Long, Vector Add Wide VADDL, VADDW
Vector Halving Add, Vector Halving Subtract VHADD, VHSUB
Vector Pairwise Add and Accumulate Long VPADAL
Vector Pairwise Add VPADD (integer) , VPADD (floating-point)
Vector Pairwise Add Long VPADDL
Vector Rounding Add & Narrow, returning High Half VRADDHN
Vector Rounding Halving Add VRHADD
Vector Rounding Subtract & Narrow, ret. High Half VRSUBHN
Vector Saturating Add VQADD
Vector Saturating Subtract VQSUB
Vector Subtract VSUB (integer), VSUB (floating-point)
Vector Subtract and Narrow, returning High Half VSUBHN
Vector Subtract Long, Vector Subtract Wide VSUBL, VSUBW
*/
VdpInstrI(ADD, 0xF2000800)
VdpInstrF(ADD, 0xF2000D00)
VdpInstrI(HADD, 0xF2000800)
VdpInstrI(HSUB, 0xF2000A00)
VdpInstrI(PADD, 0xF2000B10)
VdpInstrF(PADD, 0xF3000D00)
VdpInstrU(RHADD, 0xF3000100)
VdpInstrU(QADD, 0xF2000010)
VdpInstrU(QSUB, 0xF3000210)
VdpInstrI(SUB, 0xF3000800)
VdpInstrF(SUB, 0xF2200D00)
// VADD I { DECL_Id(0xF2000800); SET_Qdnm; EMIT_I; }
// VADD F { DECL_Id(0xF2000D00); SET_Qdnm; EMIT_I; }
// VADDHN { DECL_Id(0xF2800400); SET_Qdnm; EMIT_I; } // DQQ
// VADD{L,W} { DECL_Id(0xF2800000); SET_Qdnm; EMIT_I; } // QDD || QQD
// VH{ADD,SUB} { DECL_Id(0xF2000000); SET_Qdnm; EMIT_I; }
// VPADAL { DECL_Id(0xF3B00600); SET_Qdnm; EMIT_I; } // QdQm || DdDm
// VPADD I { DECL_Id(0xF2000B10); SET_Qdnm; EMIT_I; } // DDD only
// VPADD F { DECL_Id(0xF3000D00); SET_Qdnm; EMIT_I; } // DDD only
// VPADDL { DECL_Id(0xF3B00200); SET_Qdnm; EMIT_I; } // QdQm || DdDm
// VRADDHN { DECL_Id(0xF3800400); SET_Qdnm; EMIT_I; } // DQQ
// VRHADD { DECL_Id(0xF3000100); SET_Qdnm; EMIT_I; }
// VRSUBHN { DECL_Id(0xF3800600); SET_Qdnm; EMIT_I; } // DQQ
// VQADD { DECL_Id(0xF2000010); SET_Qdnm; EMIT_I; }
// VQSUB { DECL_Id(0xF3000210); SET_Qdnm; EMIT_I; }
// VSUB I { DECL_Id(0xF3000800); SET_Qdnm; EMIT_I; }
// VSUB F { DECL_Id(0xF2200D00); SET_Qdnm; EMIT_I; }
// VSUBHN { DECL_Id(0xF2800600); SET_Qdnm; EMIT_I; } // DQQ
// VSUB{L,W} { DECL_Id(0xF2800200); SET_Qdnm; EMIT_I; } // QDD || QQD
/*
* A.SIMD Bitwise
*
Vector Bitwise AND VAND (register)
Vector Bitwise Bit Clear (AND complement) VBIC (immediate), VBIC (register)
Vector Bitwise Exclusive OR VEOR
Vector Bitwise Move VMOV (immediate), VMOV (register)
Vector Bitwise NOT VMVN (immediate), VMVN (register)
Vector Bitwise OR VORR (immediate), VORR (register)
Vector Bitwise OR NOT VORN (register)
Vector Bitwise Insert if False VBIF
Vector Bitwise Insert if True VBIT
Vector Bitwise Select VBSL
*/
VdpInstrI(AND, 0xF2000110)
VdpInstrI(BIC, 0xF2100110)
VdpInstrI_EOR(EOR, 0xF3000110)
VdpInstrI_EOR(BSL, 0xF3100110)
VdpInstrI_EOR(BIT, 0xF3200110)
VdpInstrI_EOR(BIF, 0xF3300110)
VdpInstrI(ORN, 0xF2300110)
// VAND R { DECL_Id(0xF2000110); SET_Qdnm; EMIT_I; }
// VBIC R { DECL_Id(0xF2100110); SET_Qdnm; EMIT_I; }
// VEOR { DECL_Id(0xF3000110); SET_Qdnm; EMIT_I; }
// VBSL { DECL_Id(0xF3100110); SET_Qdnm; EMIT_I; }
// VBIT { DECL_Id(0xF3200110); SET_Qdnm; EMIT_I; }
// VBIF { DECL_Id(0xF3300110); SET_Qdnm; EMIT_I; }
// VORN R { DECL_Id(0xF2300110); SET_Qdnm; EMIT_I; }
// VBIC I { DECL_Id(0xF2800030); SET_Qd; SET_IMM??; EMIT_I; }
// VMOV I { DECL_Id(0xF2800010); SET_Qd; SET_IMM??; EMIT_I; }
// VMVN I { DECL_Id(0xF2800030); SET_Qd; SET_IMM??; EMIT_I; }
// VORR I { DECL_Id(0xF2800010); SET_Qd; SET_IMM??; EMIT_I; }
// VAND I VBIC I
// VORN I VORR I
/*
* A.SIMD comparison
*
Vector Absolute Compare VACGE, VACGT, VACLE,VACLT
Vector Compare Equal VCEQ (register)
Vector Compare Equal to Zer VCEQ (immediate #0)
Vector Compare Greater Than or Equal VCGE (register)
Vector Compare Greater Than or Equal to Zero VCGE (immediate #0)
Vector Compare Greater Than VCGT (register)
Vector Compare Greater Than Zero VCGT (immediate #0)
Vector Compare Less Than or Equal to Zero VCLE (immediate #0)
Vector Compare Less Than Zero VCLT (immediate #0)
Vector Test Bits VTST
*/
// VAC{COND} { DECL_Id(0xF3000E10); SET_Vdnm; EMIT_I; }
// VCEQ { DECL_Id(0xF3000810); SET_Vdnm; EMIT_I; } .F32 { DECL_Id(0xF2000E00); SET_Vdnm; EMIT_I; }
VdpInstrI(CEQ, 0xF3200810)
// VdpInstrF(CEQ, 0xF2000e00)
// VCGE { DECL_Id(0xF2000310); SET_Vdnm; EMIT_I; } .F32 { DECL_Id(0xF3000E00); SET_Vdnm; EMIT_I; }
VdpInstrI(CGE, 0xF2200310)
// VdpInstrF(CGE, 0xF3000e00)
// VCGT { DECL_Id(0xF2000300); SET_Vdnm; EMIT_I; } .F32 { DECL_Id(0xF3200E00); SET_Vdnm; EMIT_I; }
//*SEB* 0xF220030 for S32, 0xF3200300 for U32, 0xF2000300 is for S8.
VdpInstrI(CGT, 0xF2200300)
//VdpInstrF(CGT, 0xF3200e00)
// VCLE { DECL_Id(0xF3B10180); SET_Vdnm; EMIT_I; } // R is VCGE w/ operands reversed
// VCLT { DECL_Id(0xF3B10200); SET_Vdnm; EMIT_I; } // R is VCGT w/ operands reversed
// VTST { DECL_Id(0xF2000810); SET_Vdnm; EMIT_I; }
// VCEQZ { DECL_Id(0xF3B10100); SET_Vd; SET_Vm; EMIT_I; }
// VCGEZ { DECL_Id(0xF3B10080); SET_Vd; SET_Vm; EMIT_I; }
// VCGTZ { DECL_Id(0xF3B10000); SET_Vd; SET_Vm; EMIT_I; }
/*
* A.SIMD shift ** SET_imm6; needed for non Vdnm
*
Vector Saturating Rounding Shift Left VQRSHL
Vector Saturating Rounding Shift Right and Narrow VQRSHRN, VQRSHRUN
Vector Saturating Shift Left VQSHL (register), VQSHL, VQSHLU (immediate)
Vector Saturating Shift Right and Narrow VQSHRN, VQSHRUN
Vector Rounding Shift Left VRSHL
Vector Rounding Shift Right VRSHR
Vector Rounding Shift Right and Accumulate VRSRA
Vector Rounding Shift Right and Narrow VRSHRN
Vector Shift Left VSHL (immediate) on page A8-750 VSHL (register)
Vector Shift Left Long VSHLL
Vector Shift Right VSHR
Vector Shift Right and Narrow VSHRN
Vector Shift Left and Insert VSLI
Vector Shift Right and Accumulate VSRA
Vector Shift Right and Insert VSRI
*/
// VQRSHL { DECL_Id(0xF SET_Vdnm; EMIT_I; } // * TODO
// VQRSHRN { DECL_Id(0xF SET_Vd; SET_Vm; EMIT_I; }
// VQRSHRUN { DECL_Id(0xF SET_Vd; SET_Vm; EMIT_I; }
// VQSHL R { DECL_Id(0xF SET_Vdnm; EMIT_I; }
// VQSHL I { DECL_Id(0xF SET_Vd; SET_Vm; EMIT_I; }
// VQSHLU { DECL_Id(0xF SET_Vd; SET_Vm; EMIT_I; }
// VQSHRN { DECL_Id(0xF SET_Vd; SET_Vm; EMIT_I; }
// VQSHRUN { DECL_Id(0xF SET_Vd; SET_Vm; EMIT_I; }
// VRSHL { DECL_Id(0xF SET_Vdnm; EMIT_I; }
// VRSHR { DECL_Id(0xF SET_Vd; SET_Vm; EMIT_I; }
// VRSRA { DECL_Id(0xF SET_Vd; SET_Vm; EMIT_I; }
// VRSHRN { DECL_Id(0xF SET_Vd; SET_Vm; EMIT_I; }
// VSHL I { DECL_Id(0xF SET_Vd; SET_Vm; EMIT_I; }
// VSHL R { DECL_Id(0xF SET_Vdnm; EMIT_I; }
// VSHLL { DECL_Id(0xF SET_Vd; SET_Vm; EMIT_I; }
// VSHR { DECL_Id(0xF SET_Vd; SET_Vm; EMIT_I; }
// VSHRN { DECL_Id(0xF SET_Vd; SET_Vm; EMIT_I; }
// VSLI { DECL_Id(0xF SET_Vd; SET_Vm; EMIT_I; }
// VSRA { DECL_Id(0xF SET_Vd; SET_Vm; EMIT_I; }
// VSRI { DECL_Id(0xF SET_Vd; SET_Vm; EMIT_I; }
/*
* A.SIMD multiply
*
Vector Multiply Accumulate VMLA, VMLAL, VMLS, VMLSL (integer) , VMLA, VMLS (floating-point), VMLA, VMLAL, VMLS, VMLSL (by scalar)
Vector Multiply Accumulate Long
Vector Multiply Subtract
Vector Multiply Subtract Long
Vector Multiply VMUL, VMULL (integer and polynomial)
Vector Multiply Long VMUL (floating-point) on page A8-664 VMUL, VMULL (by scalar)
Vector Saturating Doubling Multiply Accumulate Long VQDMLAL, VQDMLSL
Vector Saturating Doubling Multiply Subtract Long
Vector Saturating Doubling Multiply Returning High Half VQDMULH
Vector Saturating Rounding Doubling Multiply Ret. High Half VQRDMULH
Vector Saturating Doubling Multiply Long VQDMULL
*/
VdpInstrI(MLA, 0xF2000900)
VdpInstrI(MLS, 0xF3000900)
VdpInstrF(MLA, 0xF2000D10)
VdpInstrF(MLS, 0xF2200D10)
//by scalar
//this should be really qd,dn,sm not dm
EAPI VMUL_F32(eFQReg Qd,eFQReg Qn, eFDReg Dm, int idx)
{
DECL_Id(0xF2800840);
SET_Qd;
SET_Qn;
I |= 1<<8; //SET_F
SET_Dm;
I |= 0x1<<24; //SET_Q not compatible
I |= 2<<20; //size to 32
I |= Dm&15; //only lower 15 regs are avail
//set register sub index
if (idx)
I |= 1<<5;
EMIT_I;
}
EAPI VMLA_F32(eFQReg Qd,eFQReg Qn, eFDReg Dm, int idx)
{
DECL_Id(0xF2800040);
SET_Qd;
SET_Qn;
I |= 1<<8; //SET_F
SET_Dm;
I |= 0x1<<24; //SET_Q not compatible
I |= 2<<20; //size to 32
I |= Dm&15; //only lower 15 regs are avail
//set register sub index
if (idx)
I |= 1<<5;
EMIT_I;
}
// VdpInstrU(MLAL, 0xF2000D10) *QDD
// VdpInstrU(MLSL, 0xF2200D10) *QDD
VdpInstrI(MUL, 0xF2000910)
VdpInstrF(MUL, 0xF3000D10)
// VdpInstrU(MULL, 0xF3000D10) *QDD
// VMLA I { DECL_Id(0xF2000900); SET_Vdnm; EMIT_I; } // * I |= ((size&3)<<20)
// VMLS I { DECL_Id(0xF3000900); SET_Vdnm; EMIT_I; } // * I |= ((size&3)<<20)
// VMLAL I { DECL_Id(0xF2800800); SET_Vdnm; EMIT_I; } // * I |= ((size&3)<<20) * I |= ((U&1)<<24)
// VMLSL I { DECL_Id(0xF2800A00); SET_Vdnm; EMIT_I; } // * I |= ((size&3)<<20) * I |= ((U&1)<<24)
// VMLA F { DECL_Id(0xF2000D10); SET_Vdnm; EMIT_I; } // * I |= ((sz&1)<<20)
// VMLS F { DECL_Id(0xF2200D10); SET_Vdnm; EMIT_I; } // * I |= ((sz&1)<<20)
// VMLA S { DECL_Id(0xF2800040); SET_Vdnm; EMIT_I; } // * I |= ((size&3)<<20)
// VMLS S { DECL_Id(0xF2800440); SET_Vdnm; EMIT_I; } // * I |= ((size&3)<<20)
// CMLAL S { DECL_Id(0xF2800240); SET_Vdnm; EMIT_I; } // * I |= ((size&3)<<20) * I |= ((U&1)<<24)
// VMLSL S { DECL_Id(0xF2800640); SET_Vdnm; EMIT_I; } // * I |= ((size&3)<<20) * I |= ((U&1)<<24)
// VMUL IP { DECL_Id(0xF2000910); SET_Vdnm; EMIT_I; } // * I |= ((size&3)<<20) * I |= 1<<24 for polynomial
// VMULL IP { DECL_Id(0xF2800C00); SET_Vdnm; EMIT_I; } // * I |= ((size&3)<<20) * I |= 1<<9 for polynomial * I |= ((U&1)<<24)
// VMUL F { DECL_Id(0xF3000D10); SET_Vdnm; EMIT_I; } // * I |= ((sz&1)<<20)
// VMUL S { DECL_Id(0xF2800840); SET_Vdnm; EMIT_I; } // * I |= ((size&3)<<20)
// VMULL S { DECL_Id(0xF2800A40); SET_Vdnm; EMIT_I; } // * I |= ((size&3)<<20) * I |= ((U&1)<<24)
// VQDMLAL { DECL_Id(0xF2800900); SET_Vdnm; EMIT_I; } // * I |= ((size&3)<<20)
// VQDMLSL { DECL_Id(0xF2800B00); SET_Vdnm; EMIT_I; } // * I |= ((size&3)<<20)
// VQDMULH { DECL_Id(0xF2000B00); SET_Vdnm; EMIT_I; } // * I |= ((size&3)<<20)
// VQRDMULH { DECL_Id(0xF3000B00); SET_Vdnm; EMIT_I; } // * I |= ((size&3)<<20)
// VQDMULL { DECL_Id(0xF2800D00); SET_Vdnm; EMIT_I; } // * I |= ((size&3)<<20)
/*
* A.SIMD misc
*
Vector Absolute Difference and Accumulate VABA, VABAL
Vector Absolute Difference VABD, VABDL (integer) , VABD (floating-point)
Vector Absolute VABS
Vector Convert between floating-point and fixed point VCVT (between floating-point and fixed-point, Advanced SIMD)
Vector Convert between floating-point and integer VCVT (between floating-point and integer, Advanced SIMD)
Vector Convert between half-precision and single-precision VCVT (between half-precision and single-precision, Advanced SIMD)
Vector Count Leading Sign Bits VCLS
Vector Count Leading Zeros VCLZ
Vector Count Set Bits VCNT
Vector Duplicate scalar VDUP (scalar)
Vector Extract VEXT
Vector Move and Narrow VMOVN
Vector Move Long VMOVL
Vector Maximum, Minimum VMAX, VMIN (integer) , VMAX, VMIN (floating-point)
Vector Negate VNEG
Vector Pairwise Maximum, Minimum VPMAX, VPMIN (integer) , VPMAX, VPMIN (floating-point)
Vector Reciprocal Estimate VRECPE
Vector Reciprocal Step VRECPS
Vector Reciprocal Square Root Estimate VRSQRTE
Vector Reciprocal Square Root Step VRSQRTS
Vector Reverse VREV16, VREV32, VREV64
Vector Saturating Absolute VQABS
Vector Saturating Move and Narrow VQMOVN, VQMOVUN
Vector Saturating Negate VQNEG
Vector Swap VSWP
Vector Table Lookup VTBL, VTBX
Vector Transpose VTRN
Vector Unzip VUZP
Vector Zip VZIP
*/
// VABA { DECL_Id(0xF2000710); // WIP
// VABAL { DECL_Id(0xF2800500);
// VABD I { DECL_Id(0xF);
// VABDL I { DECL_Id(0xF);
// VABD F { DECL_Id(0xF);
// VABS { DECL_Id(0xF); SET_Vd; SET_Vm; EMIT_I; }
EAPI VSQRT_F32(eFSReg Sd, eFSReg Sm, ConditionCode CC=AL)
{
DECL_Id(0x0EB10AC0); SET_CC;
I |= ((Sd&0x1E)<<11) | ((Sd&1)<<22);
I |= ((Sm&0x1E)>>1) | ((Sm&1)<<5);
EMIT_I;
}
EAPI VABS_F32(eFSReg Sd, eFSReg Sm, ConditionCode CC=AL)
{
DECL_Id(0x0EB00AC0); SET_CC;
I |= ((Sd&0x1E)<<11) | ((Sd&1)<<22);
I |= ((Sm&0x1E)>>1) | ((Sm&1)<<5);
EMIT_I;
}
EAPI VNEG_F32(eFSReg Sd, eFSReg Sm, ConditionCode CC=AL)
{
DECL_Id(0x0EB10A40); SET_CC;
I |= ((Sd&0x1E)<<11) | ((Sd&1)<<22);
I |= ((Sm&0x1E)>>1) | ((Sm&1)<<5);
EMIT_I;
}
//imm move, fpu
EAPI VMOV(eFSReg Sd, u32 imm8_fpu, ConditionCode CC=AL)
{
DECL_Id(0x0EB10A00); SET_CC;
I |= (imm8_fpu&0x0F); //bits 3:0
I |= (imm8_fpu&0xF0)<<12; //bits 19:16
I |= ((Sd&0x1E)<<11) | ((Sd&1)<<22);
EMIT_I;
}
const u32 fpu_imm_1=0x70;//01110000
EAPI VCMP_F32(eFSReg Sd, eFSReg Sm, ConditionCode CC=AL)
{
DECL_Id(0x0EB40A40); SET_CC;
I |= ((Sd&0x1E)<<11) | ((Sd&1)<<22);
I |= ((Sm&0x1E)>>1) | ((Sm&1)<<5);
EMIT_I;
}
VdpInstrF(CEQ, 0xF2000E00)
VdpInstrF(CGE, 0xF3000E00)
VdpInstrF(CGT, 0xF3200E00)
// VCVT FFP { DECL_Id(0xF); SET_Vd; SET_Vm; EMIT_I; }
// VCVT FI { DECL_Id(0xF); SET_Vd; SET_Vm; EMIT_I; }
// VCVT HS { DECL_Id(0xF); SET_Vd; SET_Vm; EMIT_I; }
// VCLS { DECL_Id(0xF); SET_Vd; SET_Vm; EMIT_I; }
// VCLZ { DECL_Id(0xF); SET_Vd; SET_Vm; EMIT_I; }
// VCNT { DECL_Id(0xF); SET_Vd; SET_Vm; EMIT_I; }
// VEXT { DECL_Id(0xF); SET_Vdnm; EMIT_I; }
// VMAX I { DECL_Id(0xF);
// VMIN I { DECL_Id(0xF);
// VMAX F { DECL_Id(0xF);
// VMIN F { DECL_Id(0xF);
// VNEG { DECL_Id(0xF);
// VPMAX I { DECL_Id(0xF);
// VPMIN I { DECL_Id(0xF);
// VPMAX F { DECL_Id(0xF);
// VPMIN F { DECL_Id(0xF);
// VRECPE { DECL_Id(0xF3B30400); SET_Vd; SET_Vm; EMIT_I; } // size&3<<18
// VRECPS { DECL_Id(0xF2000F10); SET_Vdnm; EMIT_I; } // sz&1<<20 (.F32)
// VRSQRTE { DECL_Id(0xF3B30480); SET_Vd; SET_Vm; EMIT_I; } // size&3<<18 F&1<<8 ***
// VRSQRTS { DECL_Id(0xF2200F10); SET_Vdnm; EMIT_I; } // sz&1<<20 (.F32)
// VREVsz { DECL_Id(0xF3B00000); SET_Vd; SET_Vm; EMIT_I; } // size&3<<18 op&3<<7 ***
// VQABS { DECL_Id(0xF3B00700); SET_Vd; SET_Vm; EMIT_I; } // size&3<<18
// VQMOVN { DECL_Id(0xF3B20200); SET_Vd; SET_Vm; EMIT_I; } // size&3<<18 op&3<<6 op:00=MOVN op11=srcUnsigned op:x1=dstUnsigned
// VQMOVUN { DECL_Id(0xF3B20200); SET_Vd; SET_Vm; EMIT_I; } // size&3<<18
// VQNEG { DECL_Id(0xF3B00780); SET_Vd; SET_Vm; EMIT_I; } // size&3<<18
// VSWP { DECL_Id(0xF3B20000); SET_Vd; SET_Vm; EMIT_I; } // size&3<<18
// VTBL { DECL_Id(0xF3B00800); SET_Vdnm; EMIT_I; } // len&3<<8
// VTBX { DECL_Id(0xF3B00840); SET_Vdnm; EMIT_I; } // len&3<<8
// VTRN { DECL_Id(0xF3B20080); SET_Vd; SET_Vm; EMIT_I; } // size&3<<18
// VUZP { DECL_Id(0xF3B20100); SET_Vd; SET_Vm; EMIT_I; } // size&3<<18
// VZIP { DECL_Id(0xF3B20180); SET_Vd; SET_Vm; EMIT_I; } // size&3<<18
//
// VDUP & VMOVN & VMOVL are implemented in VRegXfer.h ...
/*
* VFPv3 Instructions
*
*/
#define SET_Sd \
I |= ((Sd&0x1E)<<11); \
I |= ((Sd&0x01)<<22)
#define SET_Sn \
I |= ((Sn&0x1E)<<15); \
I |= ((Sn&0x01)<<7)
#define SET_Sm \
I |= ((Sm&0x1E)>>1); \
I |= ((Sm&0x01)<<5)
#define SET_Sdnm SET_Sd; SET_Sn; SET_Sm
#define VfpInstrS(viName, viId) EAPI V##viName##_VFP (eFSReg Sd, eFSReg Sn, eFSReg Sm, ConditionCode CC=CC_AL) { DECL_Id(viId); SET_CC; SET_Sdnm; EMIT_I; }
VfpInstrS(MLA, 0x0E000A00)
VfpInstrS(MLS, 0x0E000A40)
VfpInstrS(NMLA, 0x0E100A40)
VfpInstrS(NMLS, 0x0E100A00)
VfpInstrS(NMUL, 0x0E200A40)
VfpInstrS(MUL, 0x0E200A00)
VfpInstrS(ADD, 0x0E300A00)
VfpInstrS(SUB, 0x0E300A40)
VfpInstrS(DIV, 0x0E800A00)
EAPI VCVT_to_S32_VFP (eFSReg Sd, eFSReg Sm, ConditionCode CC=CC_AL) { DECL_Id(0x0EBD0AC0); SET_CC; SET_Sd; SET_Sm; EMIT_I; } // VfpInstrS(ABS, 0x0EB00AC0) ** {D,S}dm
// 0x0EB80A40 is to_U32. to_S32 is 0x0EB80AC0
EAPI VCVT_from_S32_VFP (eFSReg Sd, eFSReg Sm, ConditionCode CC=CC_AL) { DECL_Id(0x0EB80AC0); SET_CC; SET_Sd; SET_Sm; EMIT_I; } // VfpInstrS(ABS, 0x0EB00AC0) ** {D,S}dm
EAPI VABS_VFP (eFSReg Sd, eFSReg Sm, ConditionCode CC=CC_AL) { DECL_Id(0x0EB00AC0); SET_CC; SET_Sd; SET_Sm; EMIT_I; } // VfpInstrS(ABS, 0x0EB00AC0) ** {D,S}dm
EAPI VNEG_VFP (eFSReg Sd, eFSReg Sm, ConditionCode CC=CC_AL) { DECL_Id(0x0EB10A40); SET_CC; SET_Sd; SET_Sm; EMIT_I; } // VfpInstrS(NEG, 0x0EB10A40) ** {D,S}dm
EAPI VSQRT_VFP(eFSReg Sd, eFSReg Sm, ConditionCode CC=CC_AL) { DECL_Id(0x0EB10AC0); SET_CC; SET_Sd; SET_Sm; EMIT_I; } // VfpInstrS(SQRT, 0x0EB10AC0) ** {D,S}dm
// - x0 Vector Move VMOV (immediate) on page A8-640
// 0000 01 Vector Move VMOV (register) on page A8-642
// 001x x1 Vector Convert VCVTB, VCVTT (between half-precision and single-precision, VFP) on page A8-588
// 010x x1 Vector Compare VCMP, VCMPE on page A8-572
// 0111 11 Vector Convert VCVT (between double-precision and single-precision) on page A8-584
// 1000 x1 Vector Convert VCVT, VCVTR (between floating-point and integer, VFP) on page A8-578
// 101x x1 Vector Convert VCVT (between floating-point and fixed-point, VFP) on page A8-582
// 110x x1 Vector Convert VCVT, VCVTR (between floating-point and integer, VFP) on page A8-578
// 111x x1 Vector Convert VCVT (between floating-point and fixed-point, VFP) on page A8-582
////// hack
EAPI VDIV_HACKF32(eFDReg Sd, eFDReg Sn, eFDReg Sm)
{
ConditionCode CC=AL;
eFSReg SdS=(eFSReg)(Sd*2);
eFSReg SnS=(eFSReg)(Sn*2);
eFSReg SmS=(eFSReg)(Sm*2);
verify(Sd<32 && Sn<32 && Sm<32);
VDIV_VFP(SdS,SnS,SmS);
}
#undef SET_Qd
#undef SET_Dd
#undef SET_Qn
#undef SET_Dn
#undef SET_Qm
#undef SET_Dm
#undef SET_Q
#undef SET_Qdnm
#undef SET_Ddnm
};
-210
View File
@@ -1,210 +0,0 @@
/*
* E_VLoadStore.h * VFP/A.SIMD Load/Store Instruction Set Encoding
*
*/
#pragma once
namespace ARM
{
// [cond][110][Opcode][-Rn-][----][101][---------]
//
// cond != 0b1111 | LDC && STC consume these
#define SET_Dd \
I |= ((Dd&0x0F)<<12); \
I |= ((Dd&0x10)<<18)
#define SET_Sd \
I |= ((Sd&0x1E)<<11); \
I |= ((Sd&0x01)<<22)
#define SET_Rn \
I |= ((Rn&15)<<16)
#define SET_uImm8 \
I |= (uImm8 & 255)
#define SET_sImm8 \
if (sImm8 > 0) { \
I |= (1<<23); \
} \
I |= (abs(sImm8) & 255)
#define SET_PUW(_P,_U,_W) \
I |= ( ((_P&1)<<24) | ((_U&1)<<23) | ((_W&1)<<21) )
/*
* V{LD,ST}R: Vector Load/Store Register
*
* V{LD,ST}R.64 // VFP && A.SIMD
* V{LD,ST}R.32 // VFP
*/
EAPI VLDR(eFDReg Dd, eReg Rn, s32 sImm8, ConditionCode CC=AL) // VLDR.64
{
DECL_Id(0x0D100B00); SET_CC;
SET_Dd; SET_Rn; SET_sImm8;
EMIT_I;
}
EAPI VLDR(eFSReg Sd, eReg Rn, s32 sImm8, ConditionCode CC=AL) // VLDR.32
{
DECL_Id(0x0D100A00); SET_CC;
SET_Sd; SET_Rn; SET_sImm8;
EMIT_I;
}
EAPI VSTR(eFDReg Dd, eReg Rn, s32 sImm8, ConditionCode CC=AL) // VSTR.64
{
DECL_Id(0x0D000B00); SET_CC;
SET_Dd; SET_Rn; SET_sImm8;
EMIT_I;
}
EAPI VSTR(eFSReg Sd, eReg Rn, s32 sImm8, ConditionCode CC=AL) // VSTR.32
{
DECL_Id(0x0D000A00); SET_CC;
SET_Sd; SET_Rn; SET_sImm8;
EMIT_I;
}
/*
* V{LD,ST}M: Vector Load/Store Multiple
*
* V{LD,ST}R.64 // VFP && A.SIMD
* V{LD,ST}R.32 // VFP
*
* uImm8: directional count, abs(sImm8) is the reg. count
* Dd: Register to start sequential operation from..
*
* suffix DB: P=1 U=0 W=1, Decrement Before, Addresses end just before the address in Rn.
* suffix IA: P=0 U=1 W=?, Increment After, Addresses start at address in Rn
*
* ** These are very complicated encoding and require a lot of error checking and even more thought when used. **
* ** Simply using, MOV32(R4, &double_array[0]); VLDM(D0, R4, 4); should however work to load an array of 4 doubles **
*/
EAPI VLDM(eFDReg Dd, eReg Rn, u32 uImm8, u32 WB=0, ConditionCode CC=AL) // VLDM.64
{
// ASSERT( (uImm8>0) && (uImm8<=16) && ((Dd+uImm8) <= 32) )
uImm8<<=1;
DECL_Id(0x0C100B00); SET_CC;
SET_Dd; SET_Rn;
SET_uImm8; SET_PUW(0,1,WB); // Defaulting to IA w/o ! (Write-back)
EMIT_I;
}
EAPI VLDM(eFSReg Sd, eReg Rn, u32 uImm8, ConditionCode CC=AL) // VLDM.32
{
// ASSERT( (uImm8>0) && ((Dd+uImm8) <= 32) )
DECL_Id(0x0C100A00); SET_CC;
SET_Sd; SET_Rn;
SET_uImm8; SET_PUW(0,1,0); // Defaulting to IA w/o ! (Write-back)
EMIT_I;
}
EAPI VSTM(eFDReg Dd, eReg Rn, u32 uImm8, ConditionCode CC=AL) // VSTM.64
{
// ASSERT( (uImm8>0) && (uImm8<=16) && ((Dd+uImm8) <= 32) )
uImm8<<=1;
DECL_Id(0x0C000B00); SET_CC;
SET_Dd; SET_Rn;
SET_uImm8; SET_PUW(0,1,0); // Defaulting to IA w/o ! (Write-back)
EMIT_I;
}
EAPI VSTM(eFSReg Sd, eReg Rn, u32 uImm8, ConditionCode CC=AL) // VSTM.32
{
// ASSERT( (uImm8>0) && ((Dd+uImm8) <= 32) )
DECL_Id(0x0C000A00); SET_CC;
SET_Sd; SET_Rn;
SET_uImm8; SET_PUW(0,1,0); // Defaulting to IA w/o ! (Write-back)
EMIT_I;
}
/*
* V{LD,ST}n: Various extra load/store multiple.
*
* Not Implemented.
*
*/
/*
* VPUSH/VPOP: Vector Load/Store multiple consecutive vector registers to the stack.
*
* V{PUSH,POP} .64: A.SIMD .32 VFP
*/
EAPI VPUSH(eFDReg Dd, eReg Rn, u32 uImm8, ConditionCode CC=AL) // VPUSH.64
{
uImm8<<=1;
DECL_Id(0x0D2D0B00); SET_CC;
SET_Dd; SET_uImm8;
EMIT_I;
}
EAPI VPUSH(eFSReg Sd, eReg Rn, u32 uImm8, ConditionCode CC=AL) // VPUSH.32
{
DECL_Id(0x0D2D0A00); SET_CC;
SET_Sd; SET_uImm8;
EMIT_I;
}
EAPI VPOP(eFDReg Dd, eReg Rn, u32 uImm8, ConditionCode CC=AL) // VPOP.64
{
uImm8<<=1;
DECL_Id(0x0CBD0B00); SET_CC;
SET_Dd; SET_uImm8;
EMIT_I;
}
EAPI VPOP(eFSReg Sd, eReg Rn, u32 uImm8, ConditionCode CC=AL) // VPOP.32
{
DECL_Id(0x0CBD0A00); SET_CC;
SET_Sd; SET_uImm8;
EMIT_I;
}
/*
* Best practice is to remove macro definitions,
* this way they can't affect subsequent headers.
*/
#undef SET_Dd
#undef SET_Sd
#undef SET_Rn
#undef SET_uImm8
#undef SET_sImm8
#undef SET_PUW
};
-344
View File
@@ -1,344 +0,0 @@
/*
* E_VRegXfer.h * VFP/A.SIMD Register Transfer Instruction Set Encoding
*
*/
#pragma once
namespace ARM
{
/////// REPLACE THIS MESS W. SET_Rto16 / SET_Rto16_H22 , SET_Rto12 , SET_Rto0_H5 OR just leave it all in the fn's //////
#define SET_Qd \
I |= (((Qd<<1)&0x0E)<<16); \
I |= (((Qd<<1)&0x10)<<3)
#define SET_Qm \
I |= (((Qm<<1)&0x0E)); \
I |= (((Qm<<1)&0x10)<<1)
#define SET_Dd \
I |= ((Dd&0x0F)<<16); \
I |= ((Dd&0x10)<<3)
#define SET_Dm \
I |= ((Dm&0x0F)); \
I |= ((Dm&0x10)<<1)
#define SET_Sn \
I |= ((Sn&0x1E)<<15); \
I |= ((Sn&0x01)<<7)
#define SET_Sm \
I |= ((Sm&0x1E)>>1); \
I |= ((Sm&0x01)<<5)
#define SET_Rn \
I |= ((Rn&15)<<16)
#define SET_Rt \
I |= ((Rt&15)<<12)
#define SET_Rtx2 \
I |= ((Rt&15)<<12) | ((Rt2&15)<<16)
// VDUP VMOV VMRS VMSR
/*
* VDUP.SZ: Duplicates an element from ARM reg Rt into every element of {Q,D}d A.SIMD
*
*/
EAPI VDUP(eFQReg Qd, eReg Rt, u32 Size=32, ConditionCode CC=AL)
{
DECL_Id(0x0E800B10); SET_CC;
SET_Qd; SET_Rt; I |= (1<<21); // Q
if (Size==16) { I |= (1<<5); } // e
if (Size==8) { I |= (1<<22); } // b
EMIT_I;
}
EAPI VDUP(eFDReg Dd, eReg Rt, u32 Size=32, ConditionCode CC=AL)
{
DECL_Id(0x0E800B10); SET_CC;
SET_Dd; SET_Rt; // No Q
if (Size==16) { I |= (1<<5); } // e
if (Size==8) { I |= (1<<22); } // b
EMIT_I;
}
EAPI VDUP8 (eFQReg Qd, eReg Rt, ConditionCode=AL) { VDUP(Qd,Rt,8, CC); }
EAPI VDUP8 (eFDReg Dd, eReg Rt, ConditionCode=AL) { VDUP(Dd,Rt,8, CC); }
EAPI VDUP16(eFQReg Qd, eReg Rt, ConditionCode=AL) { VDUP(Qd,Rt,16,CC); }
EAPI VDUP16(eFDReg Dd, eReg Rt, ConditionCode=AL) { VDUP(Dd,Rt,16,CC); }
EAPI VDUP32(eFQReg Qd, eReg Rt, ConditionCode=AL) { VDUP(Qd,Rt,32,CC); }
EAPI VDUP32(eFDReg Dd, eReg Rt, ConditionCode=AL) { VDUP(Dd,Rt,32,CC); }
EAPI VDUP32(eFQReg Qd, eFDReg Dm, int idx)
{
DECL_Id(0xF3B00C00);
//Set_Qd seems to be incompitable here ?
I |= (((Qd<<1)&0x0E)<<12); \
I |= (((Qd<<1)&0x10)<<18);
SET_Dm;
I |= 0x40; //SET_Q
I |= 0x4 << 16; // 32 bits 4=0100
I |= (idx&1) << 19; // set idx
EMIT_I;
}
/*
* VMOV: (register)
*
* VMOV { <Qd, Qm> , <Dd, Dm> } A.SIMD
* VMOV { <Dd, Dm> , <Sd, Sm> } VFP sz1 UNDEFINED in single only VFP
*/
EAPI VMOV(eFQReg Qd, eFQReg Qm) // UNCONDITIONAL
{
DECL_Id(0xF2200110);
I |= ((Qd&0x0F)<<12) | ((Qd&0x10)<<18);
I |= ((Qm&0x0F)<<16) | ((Qm&0x10)<<1); // If !Consistent(M:Qm) then its VORR
I |= ((Qm&0x0F)) | ((Qm&0x10)<<3); // If !Consistent(M:Qm) then its VORR
EMIT_I;
}
EAPI VMOV(eFDReg Dd, eFDReg Dm) // UNCONDITIONAL
{
DECL_Id(0xF2200110);
I |= ((Dd&0x0F)<<12) | ((Dd&0x10)<<18);
I |= ((Dm&0x0F)<<16) | ((Dm&0x10)<<3); // If !Consistent(M:Dm) then its VORR
I |= ((Dm&0x0F)) | ((Dm&0x10)<<1); // If !Consistent(M:Dm) then its VORR
EMIT_I;
}
// EAPI VMOV(eFDReg Dd, eFDReg Dm, ConditionCode CC=AL) {} VFP Double Version Not Implemented here for obvious reasons : same as below except would set SZ @bit8 : 0x0EB00B40
EAPI VMOV(eFSReg Sd, eFSReg Sm, ConditionCode CC=AL)
{
DECL_Id(0x0EB00A40); SET_CC;
I |= ((Sd&0x1E)<<11) | ((Sd&1)<<22);
I |= ((Sm&0x1E)>>1) | ((Sm&1)<<5);
EMIT_I;
}
/*
* VMOV: (Immediate) A.SIMD / VFP
*
*/
//// TO BE IMPLEMENTED ////
/*
* VMOV: (ARM to scalar) A.SIMD / VFP IF Size=32
*
*/
EAPI VMOV(eFDReg Dd, u32 Index, eReg Rt, u32 Size=32, ConditionCode CC=AL)
{
DECL_Id(0x0E000B10); SET_CC;
SET_Dd; SET_Rt;
// Dd[x] where x==Index Dd is 64b, 2x32[0,1](1bit) 4x16[0-3](2bits) 8x8[0-7](3bits)
if (Size== 8) { I |= (1<<22) | ((Index&4)<<18) | ((Index&3)<<5) ; } // x -> opc1:0, opc2 (3bits) | opc1:1 SET
if (Size==16) { I |= (1<<5) | ((Index&2)<<20) | ((Index&1<<6)) ; } // x -> opc1:0, opc2:1 (2bits) | opc2:0 SET
if (Size==32) { I |= ((Index&1)<<21) ; } // x -> opc1:0 (1bit)
EMIT_I;
}
/*
* VMOV: (scalar to ARM) A.SIMD / VFP IF Size=32
*
* Note: U (bit32) is unsigned bit, invalid for 32b and we do not handle it at all.. might want to set it for byte,short
*/
EAPI VMOV(eReg Rt, eFDReg Dd, u32 Index, u32 Size=32, ConditionCode CC=AL) // This is really Vn, but we'll use the same macros..
{
DECL_Id(0x0E100B10); SET_CC;
SET_Dd; SET_Rt;
// Dd[x] where x==Index Dd is 64b, 2x32[0,1](1bit) 4x16[0-3](2bits) 8x8[0-7](3bits)
if (Size== 8) { I |= (1<<22) | ((Index&4)<<18) | ((Index&3)<<5) ; } // x -> opc1:0, opc2 (3bits) | opc1:1 SET
if (Size==16) { I |= (1<<5) | ((Index&2)<<20) | ((Index&1<<6)) ; } // x -> opc1:0, opc2:1 (2bits) | opc2:0 SET
if (Size==32) { I |= ((Index&1)<<21) ; } // x -> opc1:0 (1bit)
EMIT_I;
}
/*
* VMOV: (between ARM and single either direction) VFP
*
*/
EAPI VMOV(eReg Rt, eFSReg Sn, ConditionCode CC=AL) // Sn !d
{
DECL_Id(0x0E000A10); SET_CC;
SET_Sn; SET_Rt; I |= (1<<20); // op set = TO ARM reg
EMIT_I;
}
EAPI VMOV(eFSReg Sn, eReg Rt, ConditionCode CC=AL) // Sn !d
{
DECL_Id(0x0E000A10); SET_CC;
SET_Sn; SET_Rt; // op NOT set = TO FP Single reg
EMIT_I;
}
/*
* VMOV: (between two ARM regs and two contiguous singles either direction) VFP
*
*/
EAPI VMOV(eReg Rt, eReg Rt2, eFSReg Sm, ConditionCode CC=AL) // Sn !d
{
DECL_Id(0x0E000A10); SET_CC;
SET_Sm; SET_Rtx2; I |= (1<<20); // op set = TO ARM regs
EMIT_I;
}
EAPI VMOV(eFSReg Sm, eReg Rt, eReg Rt2, ConditionCode CC=AL) // Sn !d
{
DECL_Id(0x0E000A10); SET_CC;
SET_Sm; SET_Rtx2; // op NOT set = TO FP Single(s)
EMIT_I;
}
/*
* VMOV: (between two ARM regs and a Double) Dm <-> Rt2:Rt A.SIMD/VFP
*
*/
EAPI VMOV(eReg Rt, eReg Rt2, eFDReg Dm, ConditionCode CC=AL) // Sn !d
{
DECL_Id(0x0C400B10); SET_CC;
SET_Dm; SET_Rtx2; I |= (1<<20); // op set = TO ARM regs
EMIT_I;
}
EAPI VMOV(eFDReg Dm, eReg Rt, eReg Rt2, ConditionCode CC=AL) // Sn !d
{
DECL_Id(0x0C400B10); SET_CC;
SET_Dm; SET_Rtx2; // op NOT set = TO FP Single(s)
EMIT_I;
}
/*
* VMOVL: Takes each element in a VDouble && Sign or Zero extends into a VQuad A.SIMD
*
*/
EAPI VMOVL(eFQReg Qd, eFDReg Dm, u32 Size=32, u32 Sign=0) // UNCONDITIONAL Q & ~1
{
Size >>= 3; // Sz/8 = 1,2 or 4 else if >0 its VSHLL
Sign = (Sign>0)?0:1; // Invert to Unsigned
DECL_Id(0xF2800A10);
SET_Dm;
I |= ((Qd&0x0F)<<12);
I |= ((Qd&0x10)<<18);
I |= ((Size &7)<<19); // imm3
I |= ((Sign &1)<<24); // U
EMIT_I;
}
EAPI VMOVL_S8 (eFQReg Qd, eFDReg Dm) { VMOVL(Qd,Dm,8,1); }
EAPI VMOVL_U8 (eFQReg Qd, eFDReg Dm) { VMOVL(Qd,Dm,8,0); }
EAPI VMOVL_S16(eFQReg Qd, eFDReg Dm) { VMOVL(Qd,Dm,16,1); }
EAPI VMOVL_U16(eFQReg Qd, eFDReg Dm) { VMOVL(Qd,Dm,16,0); }
EAPI VMOVL_S32(eFQReg Qd, eFDReg Dm) { VMOVL(Qd,Dm,32,1); }
EAPI VMOVL_U32(eFQReg Qd, eFDReg Dm) { VMOVL(Qd,Dm,32,0); }
/*
* VMOVN: Copies least significant half of each element of a VQuad into the elements of a VDouble A.SIMD
*
*/
EAPI VMOVN(eFDReg Dd, eFQReg Qm, u32 Size=32) // UNCONDITIONAL Q & ~1
{
Size >>= 4; // Sz/32 = 0,1 or 2
DECL_Id(0xF3B20200);
SET_Qm;
I |= ((Dd&0x0F)<<12);
I |= ((Dd&0x10)<<18);
I |= ((Size &3)<<18); // size
EMIT_I;
}
EAPI VMOVN16(eFDReg Dd, eFQReg Qm) { VMOVN(Dd,Qm,16); }
EAPI VMOVN32(eFDReg Dd, eFQReg Qm) { VMOVN(Dd,Qm,32); }
EAPI VMOVN64(eFDReg Dd, eFQReg Qm) { VMOVN(Dd,Qm,64); }
/*
* VM{RS,SR} Move ARM reg To/From FPSCR A.SIMD/VFP
*/
EAPI VMRS(eReg Rt, ConditionCode CC=AL)
{
DECL_Id(0x0EF10A10);
SET_CC; SET_Rt;
EMIT_I;
}
EAPI VMSR(eReg Rt, ConditionCode CC=AL)
{
DECL_Id(0x0EE10A10);
SET_CC; SET_Rt;
EMIT_I;
}
#undef SET_Qd
#undef SET_Qm
#undef SET_Dd
#undef SET_Dm
#undef SET_Sn
#undef SET_Sm
#undef SET_Rn
#undef SET_Rt
#undef SET_Rtx2
};
-75
View File
@@ -1,75 +0,0 @@
/*
* H_Branches.h
*
*
*/
#pragma once
namespace ARM
{
inline static snat Literal(unat FnAddr)
{
u8* pc_addr = (u8*)EMIT_GET_PTR();
return (snat)((snat)FnAddr - ((snat)pc_addr+8));
//return -(snat)((pc_addr+8)-(snat)FnAddr);
}
EAPI CALL(unat FnAddr, ConditionCode CC=AL)
{
snat lit = Literal(FnAddr);
if(0==lit) {
printf("Error, Compiler caught NULL literal, CALL(%08X)\n", FnAddr);
verify(false);
return;
}
if( (lit<-33554432) || (lit>33554428) ) // ..28 for BL ..30 for BLX
{
printf("Warning, CALL(%08X) is out of range for literal(%08X)\n", FnAddr, lit);
// verify(false);
MOV32(IP, FnAddr, CC);
BLX(IP, CC);
return;
}
BL(lit,CC);
}
EAPI JUMP(unat FnAddr, ConditionCode CC=AL)
{
snat lit = Literal(FnAddr);
/*if(0==lit) {
printf("Error, Compiler caught NULL literal, JUMP(%08X)\n", FnAddr);
verify(false);
return;
}*/
if( (lit<-33554432) || (lit>33554428) ) // ..28 for BL ..30 for BLX
{
printf("Warning, %X is out of range for imm jump! \n", FnAddr);
//verify(false);
MOV32(IP, FnAddr, CC);
BX(IP, CC);
return;
}
B(lit,CC); // Note, wont work for THUMB*, have to use bx which is reg only !
}
}
-150
View File
@@ -1,150 +0,0 @@
/*
* H_LoadStore.h
*
*
*/
#pragma once
namespace ARM
{
/*
* Load Helpers
*/
EAPI LoadImmBase(eReg Rt, u32 Base, ConditionCode CC=AL)
{
MOV32(Rt, Base, CC);
#if defined(_DEVEL)
LDR(Rt,Rt,0, Offset, CC);
#else
LDR(Rt,Rt,0, CC);
#endif
}
EAPI LoadImmBase(eReg Rt, eReg Rn, u32 Base, ConditionCode CC=AL)
{
MOV32(Rn, Base, CC);
#if defined(_DEVEL)
LDR(Rt,Rn,0, Offset, CC);
#else
LDR(Rt,Rn,0, CC);
#endif
}
EAPI LoadImmBase16(eReg Rt, u32 Base, bool Extend=false, ConditionCode CC=AL)
{
MOV32(Rt, Base, CC);
LDRH(Rt,Rt,0, CC);
if(Extend)
SXTH(Rt,Rt);
}
EAPI LoadImmBase16(eReg Rt, eReg Rn, u32 Base, bool Extend=false, ConditionCode CC=AL)
{
MOV32(Rn, Base, CC);
LDRH(Rt,Rn,0, CC);
if(Extend)
SXTH(Rt,Rt);
}
/*
* Store Helpers
*/
// you pick regs, loads Base with reg addr, you supply data in Rt
EAPI StoreImmBase(eReg Rt, eReg Rn, u32 Base, ConditionCode CC=AL)
{
MOV32(Rn, Base, CC);
#if defined(_DEVEL)
STR(Rt,Rn,0, Offset, CC);
#else
STR(Rt,Rn,0, CC);
#endif
}
// you pick regs, loads Rt with const val, you supply base for Rn
EAPI StoreImmVal(eReg Rt, eReg Rn, u32 Val, ConditionCode CC=AL)
{
MOV32(Rt, Val, CC);
#if defined(_DEVEL)
STR(Rt,Rn,0, Offset, CC);
#else
STR(Rt,Rn,0, CC);
#endif
}
// you pick regs, loads Base with reg addr, loads Rt with const val
EAPI StoreImms(eReg Rt, eReg Rn, u32 Base, u32 Val, ConditionCode CC=AL)
{
MOV32(Rn, Base, CC);
MOV32(Rt, Val, CC);
#if defined(_DEVEL)
STR(Rt,Rn,0, Offset, CC);
#else
STR(Rt,Rn,0, CC);
#endif
}
#if defined(_DEVEL) && 0 // These require testing //
EAPI LoadImmBase8(eReg Rt, u32 Base, bool Extend=false, ConditionCode CC=AL)
{
MOV32(Rt, Base, CC);
LDRB(Rt,Rt,0, CC);
if(Extend)
SXTB(Rt,Rt);
}
EAPI LoadImmBase8(eReg Rt, eReg Rn, u32 Base, bool Extend=false, ConditionCode CC=AL)
{
MOV32(Rn, Base, CC);
LDRB(Rt,Rn,0, CC);
if(Extend)
SXTB(Rt,Rt);
}
#endif // defined(_DEVEL)
}
-102
View File
@@ -1,102 +0,0 @@
/*
* H_fp.h
*
* ARMv7 floating point help routines.
*/
#pragma once
/// WIP ///
namespace ARM
{
#if defined(_DEVEL)
/*
* vfpVersion(): Returns VFP Arch. Version, or -1 if not supported
*/
int vfpVersion()
{
// FPSID bits [22:16] contain version
return 0;
}
int neonVersion()
{
// ??
return 0;
}
#define VFP_SINGLE (1<<0)
#define VFP_DOUBLE (1<<1)
#define NEON_INTEGER (1<<2)
#define NEON_SINGLE (1<<3)
#define VFP_TRAPS (1<<8) // VFPv3U
#define FPEXT_HALF (1<<16) // Half precision extension
u32 fpFeatures()
{
return 0;
}
#endif // _DEVEL
#if 0
Version 1 of the Common VFP subarchitecture has special behavior when the FPSCR.IXE bit is set to 1.
The Common VFP subarchitecture version can be identified by checking FPSID bits [22:16]. This field is
0b0000001 for version 1. In version 1 of the Common VFP subarchitecture the FPEXC.DEX bit is RAZ/WI.
Detecting which VFP Common subarchitecture registers are implemented
An implementation can choose not to implement FPINST and FPINST2, if these registers are not required.
Set FPEXC.EX=1 and FPEXC.FP2V=1
Read back the FPEXC register
if FPEXC.EX == 0 then
Neither FPINST nor FPINST2 are implemented
else
if FPEXC.FP2V == 0 then
FPINST is implemented, FPINST2 is not implemented.
else
Both FPINST and FPINST2 are implemented.
Clean up
#endif
}
-29
View File
@@ -1,29 +0,0 @@
/*
* H_psuedo.h
*
*/
#pragma once
namespace ARM
{
EAPI MOV32(eReg Rd, u32 Imm32, ConditionCode CC=AL)
{
MOVW(Rd,((Imm32)&0xFFFF),CC);
if (Imm32>>16)
MOVT(Rd,((Imm32>>16)&0xFFFF),CC);
}
#if 0
EAPI NEG(eReg Rd,eReg Rs)
{
RSB(Rd,Rs,0);
}
#endif
EAPI NOT(eReg Rd,eReg Rs)
{
MVN(Rd,Rs);
}
}
-64
View File
@@ -1,64 +0,0 @@
/*
* H_state.h
*
*/
#pragma once
namespace ARM
{
enum InstructionSet {
IS_ARM,
IS_Thumb,
IS_Jazelle,
IS_ThumbEE
};
enum Endian {
E_Little,
E_Big
};
}
-254
View File
@@ -1,254 +0,0 @@
/*
* coding.h, arm binary instruction coding
*
*/
#pragma once
namespace ARM
{
/*
* Encoding Hi-Order 4bits, ConditionCode
*
*/
enum ConditionCode
{
EQ = 0x00, Equal = EQ, // 0000 Equal Z set
NE = 0x01, NotEqual = NE, // 0001 Not equal Z clear
CS = 0x02, CarrySet = CS, // 0010 Carry set/unsigned higher or same C set
CC = 0x03, CarryClr = CC, // 0011 Carry clear/unsigned lowe C clear
MI = 0x04, Minus = MI, // 0100 Minus/negative N set
PL = 0x05, Plus = PL, // 0101 Plus/positive or zero N clear
VS = 0x06, Overflow = VS, // 0110 Overflow V set
VC = 0x07, NoOverflow = VC, // 0111 No overflow V clear
HI = 0x08, UnHigher = HI, // 1000 Unsigned higher C set and Z clear
LS = 0x09, UnLower = LS, // 1001 Unsigned lower or same C clear or Z set
GE = 0x0A, GrOrEqual = GE, // 1010 Signed greater than or equal N set and V set, or N clear and V clear (N == V)
LT = 0x0B, Less = LT, // 1011 Signed less than N set and V clear, or N clear and V set (N != V)
GT = 0x0C, Greater = GT, // 1100 Signed greater than Z clear, and either N set and V set, or N clear and V clear (Z == 0,N == V)
LE = 0x0D, LessOrEqual = LE, // 1101 Signed less than or equal Z set, or N set and V clear, or N clear and V set (Z == 1 or N != V)
AL = 0x0E, Always = AL, // 1110 Always (unconditional) -
UC = 0x0F, Unconditional= UC, // 1111 Unconditional Special Instruction for ARMv5? and above
#define _ARM_COMPAT
#if defined(_ARM_COMPAT)
CC_EQ=EQ, CC_NE=NE, CC_CS=CS, CC_CC=CC, CC_MI=MI, CC_PL=PL, CC_VS=VS, CC_VC=VC,
CC_HI=HI, CC_LS=LS, CC_GE=GE, CC_LT=LT, CC_GT=GT, CC_LE=LE, CC_AL=AL, CC_UC=UC,
CC_HS=CS, CC_LO=CC,
#endif
ConditionCode_Size
};
/*
* Data-processing OPCODE 4bits, DPOP
*
*/
enum DPOP
{
DP_AND, // 0000 Logical AND Rd := Rn AND shifter_operand
DP_EOR, // 0001 Logical Exclusive OR Rd := Rn EOR shifter_operand
DP_SUB, // 0010 Subtract Rd := Rn - shifter_operand
DP_RSB, // 0011 Reverse Subtract Rd := shifter_operand - Rn
DP_ADD, // 0100 Add Rd := Rn + shifter_operand
DP_ADC, // 0101 Add with Carry Rd := Rn + shifter_operand + Carry Flag
DP_SBC, // 0110 Subtract with Carry Rd := Rn - shifter_operand - NOT(Carry Flag)
DP_RSC, // 0111 Reverse Subtract with Carry Rd := shifter_operand - Rn - NOT(Carry Flag)
DP_TST, // 1000 Test Update flags after Rn AND shifter_operand
DP_TEQ, // 1001 Test Equivalence Update flags after Rn EOR shifter_operand
DP_CMP, // 1010 Compare Update flags after Rn - shifter_operand
DP_CMN, // 1011 Compare Negated Update flags after Rn + shifter_operand
DP_ORR, // 1100 Logical (inclusive) OR Rd := Rn OR shifter_operand
DP_MOV, // 1101 Move Rd := shifter_operand (no first operand)
DP_BIC, // 1110 Bit Clear Rd := Rn AND NOT(shifter_operand)
DP_MVN // 1111 Move Not Rd := NOT shifter_operand (no first operand)
};
enum ShiftOp {
S_LSL,
S_LSR,
S_ASR,
S_ROR,
S_RRX=S_ROR
};
/*
* eReg: ARM Register ID
*
*/
enum eReg
{
r0=0,r1, r2, r3,
r4, r5, r6, r7,
r8, r9, r10, r11,
r12, r13, r14, r15,
R0=0,R1, R2, R3,
R4, R5, R6, R7,
R8, R9, R10, R11,
R12, R13, R14, R15,
// Aliases
a1 = r0, a2 = r1, a3 = r2, a4 = r3,
A1 = R0, A2 = R1, A3 = R2, A4 = R3,
v1 = r4, v2 = r5, v3 = r6, v4 = r7, v5 = r8, v6 = r9,
V1 = R4, V2 = R5, V3 = R6, V4 = R7, V5 = R8, V6 = R9,
rfp = r9, sl = r10, fp = r11, ip = r12, sp = r13, lr = r14, pc = r15,
RFP = R9, SL = R10, FP = R11, IP = R12, SP = R13, LR = R14, PC = R15,
};
/*
* eFQReg: Float [Quad] Register ID (A.SIMD)
*
*/
enum eFQReg
{
q0=0,q1, q2, q3,
q4, q5, q6, q7,
q8, q9, q10, q11,
q12, q13, q14, q15,
Q0=0,Q1, Q2, Q3,
Q4, Q5, Q6, Q7,
Q8, Q9, Q10, Q11,
Q12, Q13, Q14, Q15
};
/*
* eFDReg: Float [Double] Register ID (VFP / A.SIMD)
*
*/
enum eFDReg
{
d0=0,d1, d2, d3,
d4, d5, d6, d7,
d8, d9, d10, d11,
d12, d13, d14, d15,
d16, d17, d18, d19,
d20, d21, d22, d23,
d24, d25, d26, d27,
d28, d29, d30, d31,
D0=0,D1, D2, D3,
D4, D5, D6, D7,
D8, D9, D10, D11,
D12, D13, D14, D15,
D16, D17, D18, D19,
D20, D21, D22, D23,
D24, D25, D26, D27,
D28, D29, D30, D31
};
/*
* eFSReg: Float [Single] Register ID (VFP)
*
* Note: Using [f,F]regN syntax to avoid clash with s{8,16,32} types.
*/
enum eFSReg
{
f0=0,f1, f2, f3,
f4, f5, f6, f7,
f8, f9, f10, f11,
f12, f13, f14, f15,
f16, f17, f18, f19,
f20, f21, f22, f23,
f24, f25, f26, f27,
f28, f29, f30, f31,
F0=0,F1, F2, F3,
F4, F5, F6, F7,
F8, F9, F10, F11,
F12, F13, F14, F15,
F16, F17, F18, F19,
F20, F21, F22, F23,
F24, F25, F26, F27,
F28, F29, F30, F31
};
enum eFSpecialReg
{
// VM**
FPINST = 9,
FPINST2=10,
FP_R_ERROR=0xFF
};
enum ePushPopReg
{
_r0 =0x0001, _r1 =0x0002, _r2 =0x0004, _r3 =0x0008,
_r4 =0x0010, _r5 =0x0020, _r6 =0x0040, _r7 =0x0080,
_r8 =0x0100, _r9 =0x0200, _r10=0x0400, _r11=0x0800,
_r12=0x1000, _r13=0x2000, _r14=0x4000, _r15=0x8000,
_a1 = _r0, _a2 = _r1, _a3 = _r2, _a4 = _r3,
_v1 = _r4, _v2 = _r5, _v3 = _r6, _v4 = _r7,
_v5 = _r8, _v6 = _r9, _rfp = _r9, _sl = _r10,
_fp = _r11, _ip = _r12, _sp = _r13, _lr = _r14,
_pc = _r15,
_push_all = 0xFFFF, // Save All 15
_push_call = _lr|_rfp, // Save lr && _rfb(cycle count)
_push_eabi = _lr|_v1|_v2|_v3|_v4|_v5|_v6|_sl|_fp|_ip, // this is guesswork ..
};
/// WIP ///
struct FPReg
{
union
{
u8 vQ8[16];
u8 vD8[8];
u8 vS8[4];
u16 vQ16[8]; // *VFP: If half-word extensions are enabled
u16 vD16[4]; // *VFP: If half-word extensions are enabled
u16 vS16[2]; // *VFP: If half-word extensions are enabled
u32 vQ32[4];
u32 vD32[2];
u32 S;
// u64 vQ64[2];
// u64 D;
};
};
};
-242
View File
@@ -1,242 +0,0 @@
/*
* disasm.h, a horribly static yet (hopefully) correct disassembler
*
*/
#pragma once
namespace ARM
{
inline static void armdis_cc(u32 cond, char *ccbuff) // Length is always 8 for our static'{n,m}ess
{
switch(cond)
{
case EQ: sprintf(ccbuff, "EQ"); return;
case NE: sprintf(ccbuff, "NE"); return;
case CS: sprintf(ccbuff, "CS"); return;
case CC: sprintf(ccbuff, "CC"); return;
case MI: sprintf(ccbuff, "MI"); return;
case PL: sprintf(ccbuff, "PL"); return;
case VS: sprintf(ccbuff, "VS"); return;
case VC: sprintf(ccbuff, "VC"); return;
case HI: sprintf(ccbuff, "HI"); return;
case LS: sprintf(ccbuff, "LS"); return;
case GE: sprintf(ccbuff, "GE"); return;
case LT: sprintf(ccbuff, "LT"); return;
case GT: sprintf(ccbuff, "GT"); return;
case LE: sprintf(ccbuff, "LE"); return;
case AL: return; // sprintf(ccbuff, "AL"); -- ALways doesn't need to be specified
case UC: //
default: return; // DIE
}
}
inline static void armdis_dp(u32 dpop, char *dpbuff) // Length is always 8 ...
{
switch(dpop)
{
case DP_AND: sprintf(dpbuff, "AND"); return;
case DP_EOR: sprintf(dpbuff, "EOR"); return;
case DP_SUB: sprintf(dpbuff, "SUB"); return;
case DP_RSB: sprintf(dpbuff, "RSB"); return;
case DP_ADD: sprintf(dpbuff, "ADD"); return;
case DP_ADC: sprintf(dpbuff, "ADC"); return;
case DP_SBC: sprintf(dpbuff, "SBC"); return;
case DP_RSC: sprintf(dpbuff, "RSC"); return;
case DP_TST: sprintf(dpbuff, "TST"); return;
case DP_TEQ: sprintf(dpbuff, "TEQ"); return;
case DP_CMP: sprintf(dpbuff, "CMP"); return;
case DP_CMN: sprintf(dpbuff, "CMN"); return;
case DP_ORR: sprintf(dpbuff, "ORR"); return;
case DP_MOV: sprintf(dpbuff, "MOV"); return;
case DP_BIC: sprintf(dpbuff, "BIC"); return;
case DP_MVN: sprintf(dpbuff, "MVN"); return;
}
}
inline static void armdis(u32 op, char *disbuf, u32 len=512)
{
char ipref[8]={0}, isuff[8]={0}, icond[8]={0} ;
// u32 uOP = ((op>>12)&0xFF00) | ((op>>4)&255) ;
u32 uCC = ((op>>28) & 0x0F) ; //
u32 uO1 = ((op>>25) & 0x07) ; //
u32 uO2 = ((op>> 4) & 0x01) ; //
u32 uC1 = ((op>>21) & 0x0F) ; //
u32 uC2 = ((op>> 5) & 0x07) ; //
u32 uSB = ((op>>20) & 0x01) ; // Sign Change Bit
/*
if (uCC == UC) {
printf ("DBG armdis has UC instruction %X\n", op);
sprintf (disbuf, "UNCONDITIONAL / UNHANDLED INSTRUCTION");
return;
}
if (uCC != AL) {
armdis_cc(uCC,isuff);
}
if (uO1 == 0)
{
if (uO2 == 0) {
if ((uC1 & 0xC) == 8) {
printf ("DBG armdis 0:0 10xx misc instruction \n", uCC);
sprintf (disbuf, "UNHANDLED INSTRUCTION 0:");
return;
}
// DP imm.shift
}
else if (uO2 == 1) {
sprintf (disbuf, "UNHANDLED INSTRUCTION 0:");
}
}
else if (uO1 == 1) {
sprintf (disbuf, "UNHANDLED INSTRUCTION 1:");
}
else if (uO1 == 2) {
sprintf (disbuf, "UNHANDLED INSTRUCTION 2:");
}
else if (uO1 == 3) {
sprintf (disbuf, "UNHANDLED INSTRUCTION 3:");
}
else if (uO1 == 4) {
sprintf (disbuf, "UNHANDLED INSTRUCTION 4:");
}
else if (uO1 == 5) {
sprintf (disbuf, "UNHANDLED INSTRUCTION 5:");
}
else if (uO1 == 6) {
sprintf (disbuf, "UNHANDLED INSTRUCTION 6:");
}
else if (uO1 == 7) {
sprintf (disbuf, "UNHANDLED INSTRUCTION 7:");
}
else if (uO1 == 8) {
sprintf (disbuf, "UNHANDLED INSTRUCTION 8:");
}
else if (uO1 == 9) {
sprintf (disbuf, "UNHANDLED INSTRUCTION 9:");
}
else if (uO1 == 10) {
sprintf (disbuf, "UNHANDLED INSTRUCTION 10:");
}
else if (uO1 == 11) {
sprintf (disbuf, "UNHANDLED INSTRUCTION 11:");
}
else if (uO1 == 12) {
sprintf (disbuf, "UNHANDLED INSTRUCTION 12:");
}
else if (uO1 == 13) {
sprintf (disbuf, "UNHANDLED INSTRUCTION 13:");
}
else if (uO1 == 14) {
sprintf (disbuf, "UNHANDLED INSTRUCTION 14:");
}
else if (uO1 == 15) {
sprintf (disbuf, "UNHANDLED INSTRUCTION 15:");
}
else {
sprintf (disbuf, "INVALID INSTRUCTION");
}
*/
if (!uC1 && uO1==5) {
//B
char tmp[20];
tmp[0]='\0';
armdis_cc(uCC, tmp);
sprintf(disbuf, "B%s %08X", tmp, (op&0xffffff)<<2);
} else {
armdis_dp(uC1, disbuf);
char tmp[20];
tmp[0]='\0';
armdis_cc(uCC, tmp);
if (tmp[0]) {
strcat(disbuf, ".\0");
strcat(disbuf, tmp);
}
if (uSB) strcat(disbuf, ".S\0");
bool shifter=false;
switch (uO1) {
case 0:
// reg_reg
sprintf(tmp,"\tr%d, r%d", (op>>12)&0x0f, (op)&0x0f);
shifter=true;
break;
case 1:
// reg_imm
sprintf(tmp,"\tr%d, %04X", (op>>16)&0x0f, (op)&0xffff);
break;
default:
shifter=true;
sprintf(tmp, " 0x%0X", uO1);
}
strcat(disbuf, tmp);
char* ShiftOpStr[]={"LSL","LSR","ASR","ROR"};
u32 shiftop=(op>>5)&0x3;
u32 shiftoptype=(op>>4)&0x1;
u32 shiftopreg=(op>>8)&0xf;
u32 shiftopimm=(op>>7)&0x1f;
if (shifter) {
if (!shiftop && !shiftoptype && !shiftopimm)
{
//nothing
} else {
if ((shiftop==1) || (shiftop==2)) if (!shiftoptype) if (!shiftopimm) shiftopimm=32;
sprintf(tmp, " ,%s %s%d", ShiftOpStr[shiftop], (shiftoptype)?" r":" #", (shiftoptype)?shiftopreg:shiftopimm);
strcat(disbuf, tmp);
}
}
}
}
};
-128
View File
@@ -1,128 +0,0 @@
/*
* Emitter.h
*
* ARMv7 ISA Emitter for code generation.
*
* David Miller, 2011.
*/
#pragma once
#include "arm_coding.h"
#include "arm_registers.h"
//#include "arm_disasm.h"
namespace ARM
{
/*
* Emitter - Reserved for use w/ static members ..
*
*
*/
class Emitter
{
};
#if defined(_DEBUG) || defined(DEBUG)
#define EAPI void
#define DECL_I \
u32 Instruction=0
#define DECL_Id(d) \
u32 Instruction=(d)
#else
// #define _inlineExSVoidA __extension__ static __inline void __attribute__ ((__always_inline__))
#define EAPI \
inline static void
#define DECL_I \
static u32 Instruction; \
Instruction=0
#define DECL_Id(d) \
static u32 Instruction; \
Instruction=(d)
#endif
/*
* TEMP
*/
#define I (Instruction)
#define SET_CC I |= (((u32)CC&15)<<28)
#ifndef EMIT_I
#define EMIT_I emit_Write32((I));
#endif
#ifndef EMIT_GET_PTR
#define EMIT_GET_PTR() emit_GetCCPtr()
#endif
};
/*
* ARM Core Instructions
*/
#include "E_Branches.h"
#include "E_DataOp.h"
#include "E_Multiply.h"
#include "E_Parallel.h"
#include "E_Extend.h"
#include "E_Misc.h"
#include "E_Status.h"
#include "E_LoadStore.h"
#include "E_Special.h"
/*
* ARM VFP/A.SIMD Extension Instructions
*/
#include "E_VLoadStore.h"
#include "E_VRegXfer.h"
#include "E_VDataOp.h"
/*
* Helper Routines & Psuedo-Instructions
*/
#include "H_psuedo.h"
#include "H_Branches.h"
#include "H_LoadStore.h"
//#include "H_state.h"
//#include "H_fp.h"
-487
View File
@@ -1,487 +0,0 @@
/*
* registers.h
*
* ARMv7-A system register(s).
*/
#pragma once
namespace ARM
{
/*************************************************************************************************
* CP15 Registers for VMSA Implementation. [ref.DDI0406B B3.12]
*************************************************************************************************/
/*
<CRn> <opc1> <CRm> <opc2> [NAME,] Description [Flags]
c0 {
0 c0 {
0 MIDR, Main ID RO
1 CTR, Cache Type RO
2 TCMTR, TCM Type RO, IMPL.DEFINED
3 TLBTR, TLB Type RO, IMPL.DEFINED
5 MPIDR, Multiprocessor Affinity RO
{4,6,7} MIDR$, Main ID Aliases RO
}
0 c[1-7] [0-7] CPUID ID_{PFRn,DFRn,AFR0,MMFRn,ISARn} RO
1 c0 0 CCSIDR, Cache Size ID RO
1 c0 1 CLIDR, Cache Level ID RO
1 c0 7 AIDR, Aux ID RO, IMPL.DEFINED
2 c0 0 CSSELR, Cache Size Selection RW
}
c1 0 c0 [0-2] System Control RW
c1 0 c1 [0-2] Security Extension RW, IMPL.OPTIONAL
c2 0 c0 [0-2] Translation Table Base RW
c3 0 c0 0 DACR, Domain Access Control RW
c5 0 c{0,1} {0,1} Fault Status RW
c6 0 c0 {0,2] Fault Address RW
c7 0 {
c0 4 NOP WO
c1 {0,6} Cache Maintenance operations, Multiprocessing Extensions WO
c4 0 PAR, Physical Address RW
c5 {0,1,6,7} Cache and branch predictor maintenance operations WO
c5 4 CP15ISB, Instruction barrier operation WO, USER
c6 {1,2} Cache Maintenance operations WO
c8 [0-7] VA to PA translation ops. WO
c10 {1,2} Cache management ops. WO
c10 {4,5} Data barrier ops. WO, USER
c11 1 DCCMVAU, Cache barrier ops. WO
c13 1 NOP WO
c14 {1,2} Cache management ops. WO
}
c8 0 c{3,5,6,7} [0-3] TLB maintenance ops. * WO
c9 [0-7] c{0,2,5,8} [0-7] Reserved for Branch Predictor, Cache and TCM ops. RSVD, OP.ACCESS
c9 [0-7] c[12-15] [0-7] Reserved for Performance monitors. RSVD, OP.ACCESS
c10 0 c{0,1,4,8} [0-7] Reserved for TLB lockdown ops. RSVD, OP.ACCESS
c10 0 c2 {0,1} PRRR, NMRRR, TEX Remap RW
c11 [0-7] c{0,8,15} [0-7] Reserved for DMA ops. TCM access. RSVD, OP.ACCESS
c12 0 c0 {0,1} Security Extensions RW, IMPL.OPTIONAL
c12 0 c1 0 ISR, Security Extensions RO, IMPL.OPTIONAL
c13 0 c0 0 FCSEIDR, FCSE PID RO-if-FCSE-!IMPL / RW?
c13 0 c0 [1-4] Software Thread and Context ID RW
c15 * * * IMPLEMENTATION DEFINED IMPL.DEFINED
*/
/*************************************************************************************************
* CP15 c0: ID codes registers
*************************************************************************************************/
/*
* MIDR: Main ID Register
*/
struct MIDR
{
u32 Revision : 4;
u32 PriPartNum : 12; // IF Impl:ARM && PriPartNo top 4bits are 0 || 7: arch&variant encoding differs
u32 Architecture : 4;
u32 Variant : 4;
u32 Implementer : 8;
};
enum MIDR_Implementer
{
ARM_Ltd = 0x41, // 'A'
DigitalEquipment_Corp = 0x44, // 'D'
Motorola_FreescaleSemi_Inc = 0x4D, // 'M'
QUALCOMM_Inc = 0x51, // 'Q'
MarvellSemi_Inc = 0x56, // 'V'
Intel_Corp = 0x69, // 'i'
TexasInstruments_Inc = 0xFF // 'T' ???
};
enum MIDR_Arch
{
ARMv4 = 1,
ARMv4T = 2,
ARMv5 = 3, // obselete
ARMv5T = 4,
ARMv5TE = 5,
ARMv5TEJ = 6,
ARMv6 = 7,
CPUID_Defined = 15
};
/*
* CTR, Cache Type Register
*/
struct CTR
{
u32 IminLine : 4;
u32 SBZ : 10;
u32 L1Ip : 2;
u32 DminLine : 4; //
u32 ERG : 4; // Exclusives Reservation Granule.
u32 CWG : 4; // Cache Writeback Granule.
u32 RAZ : 1;
u32 REGFMT : 3; // Set to 0b100 for ARMv7 register format, or 0b000 for <=ARMv6 format
};
/*
* TCMTR, TCM Type Register
*/
// High 3 bits is 0b100, the rest is IMPL.DEFINED
typedef u32 TCMTR;
/*
* TLBTR, TLB Type Register
*/
// Low bit is nU : SET:1: Not unified ( separate instruction and data TLBs )
typedef u32 TLBTR;
/*
* MPIDR, Multiprocessor Affinity Register
*/
struct MPIDR
{
u32 AffinityLevel0 : 8;
u32 AffinityLevel1 : 8;
u32 AffinityLevel2 : 8;
u32 MT : 1;
u32 RAZ : 5; // Reserved As Zero
u32 U : 1; // Set: Processor is part of a Uniprocessor system.
u32 MP_Impl : 1; // RAO if MP Extensions are implemented.
};
/*
* CCSIDR, Cache Size ID Registers
*/
struct CCSIDR
{
u32 LineSize : 3;
u32 Associativity : 10;
u32 NumSets : 15;
u32 WA : 1;
u32 RA : 1;
u32 WB : 1;
u32 WT : 1;
};
/*
* CLIDR, Cache Level ID Register
*/
struct CLIDR
{
u32 Ctype1 : 3;
u32 Ctype2 : 3;
u32 Ctype3 : 3;
u32 Ctype4 : 3;
u32 Ctype5 : 3;
u32 Ctype6 : 3;
u32 Ctype7 : 3;
u32 LoUIS : 3;
u32 LoC : 3;
u32 LoUU : 3;
u32 RAZ : 2; // RAZ
};
/*
* AIDR, Auxiliary ID Register.
*/
typedef u32 AIDR; // IMPLEMENTATION DEFINED
/*
* CSSELR, Cache Size Selection Register
*/
struct CSSELR
{
u32 InD : 1;
u32 Level : 3;
u32 SBZP : 28;
};
/*************************************************************************************************
* CP15 c1: System control registers
*************************************************************************************************/
// SCTRL, ACTLR ////////////////////// TODO ///////////////////////
/*
* CPACR: Coprocessor Access Control Register.
*
* Controls access to all coprocessors other than CP14 & CP15.
* It may be used to check for their presence by testing modification to cpN bits.
*
* Notes:
*
* D32DIS:1 && ASEDIS:0 is INVALID
* ASEDIS on hw { w. VFP & w.o A.SIMD } is RAO/WI, if bit is not supported it is RAZ/WI.
*
* When Security Extensions are enabled, NSACR controls CP access from non-secure state.
*
* VFP uses CP10 && CP11, the values of .cp10 && .cp11 should be the same.
*/
union CPACR
{
struct {
u32 cp0 : 2; // cpN [0-13]:
u32 cp1 : 2; // Defines access rights for individual coprocessors.
u32 cp2 : 2; // See CP_Access enum below for possible values;
u32 cp3 : 2; //
u32 cp4 : 2; // To test
u32 cp5 : 2;
u32 cp6 : 2;
u32 cp7 : 2;
u32 cp8 : 2;
u32 cp9 : 2;
u32 cp10 : 2;
u32 cp11 : 2;
u32 cp12 : 2;
u32 cp13 : 2;
u32 rsvcd: 2; // SBZP
u32 D32DIS:1; // SET: Disables use of D16-D32 of the VFP register file.
u32 ASEDIS:1; // SET: Disables all A.SIMD Instructions, VFPv3 shall remain valid.
};
u32 R;
};
/*
* CP_Access: Enumerates access rights for CPACR.cpN
*
*/
enum CP_Access
{
A_Deny, // Deny Access, Attempts to access cause Exception::Undefined_Instruction
A_Privileged, // Privileged Access, Attempts to access cause Exception::Undefined_Instruction in User mode.
A_Reserved, // Reserved Value, Use of this value is UNPREDICTABLE.
A_Full // Full Access, Access is defined by coprocessor.
};
/*
* SCR: Secure Configuration Register.
*
* Requires: Security Extension.
*/
union SCR
{
struct {
u32 NS : 1; //
u32 IRQ : 1; //
u32 FIQ : 1; //
u32 EA : 1; //
u32 FW : 1; //
u32 AW : 1; //
u32 nET : 1; //
u32 SBZP:25;
};
u32 R;
};
// SDER, Secure Debug Enable Register
// NSACR, Non-Secure Access Control Register
/*************************************************************************************************
* CP15 c{2,3}: Memory protection and control registers
*************************************************************************************************/
// TTBR0 TTVR1 TTVCR
// DACR, Domain Access Control Register
/*************************************************************************************************
* CP15 c4: Not used
*************************************************************************************************/
/*************************************************************************************************
* CP15 c{5,6}: Memory system fault registers
*************************************************************************************************/
// DFSR, Data Fault Status Register
// IFSR, Instruction Fault Status Register
// ADFSR, Aux. DFSR
// AIFSR, Aux. IFSR
// DFAR, Data Fault Address Register
// IFAR, Instruction Fault Address Register
/*************************************************************************************************
* CP15 c7: Cache maintenance / misc
*************************************************************************************************/
/*************************************************************************************************
*************************************************************************************************
* A.SIMD and VFP extension system registers
*************************************************************************************************
*************************************************************************************************/
enum FP_SysRegs
{
R_FPSID = 0, // 0b0000
R_MVFR1 = 6, // 0b0110
R_MVFR0 = 7, // 0b0111
};
// FPSID Floating Point System ID Register
// MVFR1 Media and VFP Feature Register 1
// MVFR0 Media and VFP Feature Register 0
struct FPSID
{
u32 Revision : 4; // IMPL.DEFINED
u32 Variant : 4; // IMPL.DEFINED
u32 PartNumber : 8; // IMPL.DEFINED
u32 SubArch : 7; // MSB:1 when designed by ARM
u32 SW : 1; // Is a software impl. if set
u32 Implementer : 8; // Same as MIDR.Implementer
};
enum FP_SubArch
{
VFPv1 = 0, // Not Permitted in ARMv7
VFPv2_Cv1, // Not Permitted in ARMv7
VFPv3_Cv2, //
VFPv3_Null, // Full hardware, no trap
VFPv3_Cv3, //
};
// Floating-point status and control register
//
struct FPSCR
{
u32 IOC : 1; // * All * bits are cumulative exception bits
u32 DZC : 1; // *
u32 OFC : 1; // *
u32 UFC : 1; // *
u32 IXC : 1; // *
u32 SBZP1 : 2; //
u32 IDC : 1; // *
u32 IOE : 1; // ** All ** bits are FP trap enable bits
u32 DZE : 1; // ** only supported in VFPv2 && VFPv3U
u32 OFE : 1; // ** - RAZ elsewhere -
u32 UFE : 1; // **
u32 IXE : 1; // **
u32 SBZP2 : 2; //
u32 IDE : 1; // **
u32 Len : 3; // SBZ for ARMv7 VFP, ignored for A.SIMD
u32 SBZP3 : 1; //
u32 Stride : 2; // SBZ for ARMv7 VFP, ignored for A.SIMD
u32 RMode : 2; // Rounding Mode
u32 FZ : 1; // Flush-to-Zero
u32 DN : 1; // Default NaN mode control
u32 AHP : 1; // Alt. Half-precision
u32 QC : 1; // Cumulative saturation, A.SIMD
u32 V : 1; // CC Overflow
u32 C : 1; // CC Carry
u32 Z : 1; // CC Zero
u32 N : 1; // CC Negative
};
enum FP_RoundingMode // A.SIMD Always uses RN !
{
RN, // Round to Nearest
RP, // Round towards Plus Infinity
RM, // Round towards Minus Infinity
RZ // Round towards Zero
};
struct MVFR0
{
u32 A_SIMD : 4;
u32 Single : 4;
u32 Double : 4;
u32 Trap : 4;
u32 Divide : 4;
u32 Sqrt : 4;
u32 ShortVec: 4;
u32 Rounding: 4;
};
struct MVFR1
{
u32 FtZ_mode : 4;
u32 D_NaN_mode : 4;
u32 NFP_LdStr : 4;
u32 NFP_int : 4;
u32 NFP_SPFP : 4;
u32 NFP_HPFP : 4;
u32 VFP_HPFP : 4;
u32 RAZ : 4;
};
};
+226 -47
View File
@@ -1,75 +1,254 @@
/*
reicast build options
nullDC-Beagle build configuration options
Reicast can support a lot of stuff, and this is an attempt
to organize the build time options
fine grained options
HOST_OS,HOST_CPU, ..
Option categories
BUILD_* - BUILD_COMPILER, etc...
definitions about the build machine
HOST_*
definitions about the host machine
FEAT_*
definitions about the features that this build targets
This is higly related to HOST_*, but it's for options that might
or might not be avaiable depending on the target host, or that
features that are irrelevant of the host
Eg, Alsa, Pulse Audio and OSS might sense as HOST dedinitions
but it usually makes more sense to detect them as runtime. In
that context, HOST_ALSA makes no sense because the host might
or might not have alsa installed/ running
MMU makes no sense as a HOST definition at all, so it should
be FEAT_HAS_MMU
TARGET_*
A preconfigured default. Eg TARGET_WIN86.
Naming of options, option values, and how to use them
for options that makes sense to have a list of values
{CATEGORY}_{OPTION}
{OPTION}_{VALUE}
eg.
BUILD_COMPILER == COMPILER_GCC, HOST_CPU != CPU_X64, ...
for options that are boolean
{CATEGORY}_IS_{OPTION} or {CATEGORY}_HAS_{OPTION}
Evaluates to 0 or 1
If an configuration cannot be neatly split into a set of
of orthogonal options, then it makes sense to break things
to "sets" or have a hierarchy of options.
Example
-------
In the beggining it made sense to have an audio backend
per operating system. It made sense to have it depend
on HOST_OS and seleect DirectSound or alsa.
// no option needed
Then, as android was introduced, which also uses OS_LINUX
atm, the audio could have been made an option. It could be
a HOST_* option, or FEAT_* one. I'd prefer FEAT_*.
FEAT_* makes more sense as future wise we might want
to support multiple backends.
FEAT_AUDIO_BACKEND
AUDIO_BACKEND_NONE
AUDIO_BACKEND_DS
AUDIO_BACKEND_ALSA
AUDIO_BACKEND_ANDROID
Used like
#if FEAT_AUDIO_BACKEND == AUDIO_BACKEND_DS ....
At some point, we might have multiple audio backends that
can be compiled in and autodetected/selected at runtime.
In that case, it might make sense to have the options like
FEAT_HAS_ALSA
FEAT_HAS_DIRECTSOUND
FEAT_HAS_ANDROID_AUDIO
or
FEAT_HAS_AUDIO_ALSA
FEAT_HAS_AUDIO_DS
FEAT_HAS_AUDIO_ANDROID
The none option might or might not make sense. In this
case it can be removed, as it should always be avaiable.
Guidelines
----------
General rule of thumb, don't overcomplicate things. Start
with a simple option, and then make it more complicated
as new uses apply (see the example above)
Don't use too long names, don't use too cryptic names.
Most team developers should be able to understand or
figure out most of the acronyms used.
Try to be consistent on the acronyms across all definitions
Code shouldn't depend on build level options whenever possible
Generally, the file should compile even if the option/module is
disabled. This makes makefiles etc much easier to write
TARGET_* options should generally only be used in this file
The current source is *not* good example of these guidelines
We'll try to be smart and figure out some options/defaults on this file
but this shouldn't get too complicated
build-level options
TARGET_BEAGLE, TARGET_WIN86, ...
code shouldn't depend on build level options whenever possible
*/
//ndc configs
#define NO_MMU
//#define HOST_NO_REC
//#define STRICT_MODE
#ifndef STRICT_MODE
#define FAST_MMU
#define USE_WINCE_HACK
#endif
#define DC_PLATFORM_MASK 7
#define DC_PLATFORM_NORMAL 0 /* Works, for the most part */
#define DC_PLATFORM_DREAMCAST 0 /* Works, for the most part */
#define DC_PLATFORM_DEV_UNIT 1 /* This is missing hardware */
#define DC_PLATFORM_NAOMI 2 /* Works, for the most part */
#define DC_PLATFORM_NAOMI2 3 /* Needs to be done, 2xsh4 + 2xpvr + custom TNL */
#define DC_PLATFORM_ATOMISWAVE 4 /* Needs to be done, DC-like hardware with possibly more ram */
#define DC_PLATFORM_ATOMISWAVE 4 /* Works, for the most part */
#define DC_PLATFORM_HIKARU 5 /* Needs to be done, 2xsh4, 2x aica , custom vpu */
#define DC_PLATFORM_AURORA 6 /* Needs to be done, Uses newer 300 mhz sh4 + 150 mhz pvr mbx SoC */
#define DC_PLATFORM DC_PLATFORM_NORMAL
//Target platform configs
//HOST_OS
#define OS_WINDOWS 0x10000001
#define OS_LINUX 0x10000002
//HOST_CPU
#define CPU_X86 0x20000001
#define CPU_ARM 0x20000002
#define CPU_MIPS 0x20000003
#define CPU_X64 0x20000004
#define CPU_GENERIC 0x20000005 //used for pnacl, emscripten, etc
#define CPU_PPC 0x20000006
#define CPU_PPC64 0x20000007
#define CPU_ARM64 0x20000008
#define CPU_MIPS64 0x20000009
//BUILD_COMPILER
#define COMPILER_VC 0x30000001
#define COMPILER_GCC 0x30000002
//FEAT_SHREC, FEAT_AREC, FEAT_DSPREC
#define DYNAREC_NONE 0x40000001
#define DYNAREC_JIT 0x40000002
#define DYNAREC_CPP 0x40000003
///
#if (!defined(TARGET_WIN86) && !defined(TARGET_BEAGLE) && !defined(TARGET_NACL32) && !defined(TARGET_GCW0) && !defined(TARGET_PANDORA))
#define TARGET_WIN86
#endif
#ifdef TARGET_WIN86
#define HOST_OS OS_WINDOWS
//automatic
#if defined(__x86_64__) || defined(_M_X64)
#define HOST_CPU CPU_X64
#elif defined(__i386__) || defined(_M_IX86)
#define HOST_CPU CPU_X86
#define BUILD_COMPILER COMPILER_VC
#elif TARGET_PANDORA
#define HOST_OS OS_LINUX
#elif defined(__arm__) || defined (_M_ARM)
#define HOST_CPU CPU_ARM
#define BUILD_COMPILER COMPILER_GCC
#elif TARGET_BEAGLE
#define HOST_OS OS_LINUX
#define HOST_CPU CPU_ARM
#define BUILD_COMPILER COMPILER_GCC
#elif TARGET_GCW0
#define HOST_OS OS_LINUX
#elif defined(__aarch64__) || defined(_M_ARM64)
#define HOST_CPU CPU_ARM64
#elif defined(__mips__)
#define HOST_CPU CPU_MIPS
#define BUILD_COMPILER COMPILER_GCC
#elif TARGET_NACL32
#define HOST_OS OS_LINUX
#define HOST_CPU CPU_X86
#define BUILD_COMPILER COMPILER_GCC
#else
#error Invalid Target: TARGET_* not defined
#define HOST_CPU CPU_GENERIC
#endif
#if defined(TARGET_NO_REC)
#define FEAT_SHREC DYNAREC_NONE
#define FEAT_AREC DYNAREC_NONE
#define FEAT_DSPREC DYNAREC_NONE
#endif
#if defined(TARGET_NO_AREC)
#define FEAT_SHREC DYNAREC_JIT
#define FEAT_AREC DYNAREC_NONE
#define FEAT_DSPREC DYNAREC_NONE
#endif
#if defined(TARGET_NO_JIT)
#define FEAT_SHREC DYNAREC_CPP
#define FEAT_AREC DYNAREC_NONE
#define FEAT_DSPREC DYNAREC_NONE
#endif
#ifdef __SWITCH__
#define FEAT_NO_RWX_PAGES
#endif
//defaults
#ifndef FEAT_SHREC
#if HOST_CPU == CPU_ARM || HOST_CPU == CPU_ARM64 || HOST_CPU == CPU_X86 || HOST_CPU == CPU_X64
#define FEAT_SHREC DYNAREC_JIT
#else
#define FEAT_SHREC DYNAREC_NONE
#endif
#endif
#ifndef FEAT_AREC
#if HOST_CPU == CPU_ARM || HOST_CPU == CPU_ARM64 || HOST_CPU == CPU_X64
#define FEAT_AREC DYNAREC_JIT
#else
#define FEAT_AREC DYNAREC_NONE
#endif
#endif
#ifndef FEAT_DSPREC
#if HOST_CPU == CPU_ARM || HOST_CPU == CPU_ARM64 || HOST_CPU == CPU_X86 || HOST_CPU == CPU_X64
#define FEAT_DSPREC DYNAREC_JIT
#else
#define FEAT_DSPREC DYNAREC_NONE
#endif
#endif
// Some restrictions on FEAT_NO_RWX_PAGES
#if defined(FEAT_NO_RWX_PAGES) && FEAT_SHREC == DYNAREC_JIT
#if HOST_CPU != CPU_X64 && HOST_CPU != CPU_ARM64
#error "FEAT_NO_RWX_PAGES Only implemented for X64 and ARMv8"
#endif
#endif
#ifdef _WIN32
#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
#define TARGET_UWP
#endif
#if !defined(LIBRETRO) && !defined(TARGET_UWP)
#define USE_DX9
#endif
#endif
#if !defined(LIBRETRO) && !defined(TARGET_NO_EXCEPTIONS)
#define USE_GGPO
#endif
// TARGET PLATFORM
#define RAM_SIZE_MAX (32*1024*1024)
#define VRAM_SIZE_MAX (16*1024*1024)
#define ARAM_SIZE_MAX (8*1024*1024)
#define GD_CLOCK 33868800 //GDROM XTAL -- 768fs
#define AICA_CORE_CLOCK (GD_CLOCK*4/3) //[45158400] GD->PLL 3:4 -> AICA CORE -- 1024fs
#define ADAC_CLOCK (AICA_CORE_CLOCK/4) //[11289600] 44100*256, AICA CORE -> PLL 4:1 -> ADAC -- 256fs
#define AICA_ARM_CLOCK (AICA_CORE_CLOCK/2) //[22579200] AICA CORE -> PLL 2:1 -> ARM
#define AICA_SDRAM_CLOCK (GD_CLOCK*2) //[67737600] GD-> PLL 2 -> SDRAM
#define SH4_MAIN_CLOCK (200*1000*1000) //[200000000] XTal(13.5) -> PLL (33.3) -> PLL 1:6 (200)
#define SH4_RAM_CLOCK (100*1000*1000) //[100000000] XTal(13.5) -> PLL (33.3) -> PLL 1:3 (100) , also suplied to HOLLY chip
#define G2_BUS_CLOCK (25*1000*1000) //[25000000] from Holly, from SH4_RAM_CLOCK w/ 2 2:1 plls
#if defined(GLES) && !defined(GLES3) && !defined(GLES2)
// Only use GL ES 2.0 API functions
#define GLES2
#endif
+83 -398
View File
@@ -1,435 +1,120 @@
/*
Config file crap
Supports various things, as virtual config entries and such crap
Works surprisingly well considering how old it is ...
*/
#define _CRT_SECURE_NO_DEPRECATE (1)
#include "cfg.h"
#include "ini.h"
#include "stdclass.h"
string cfgPath;
#include <cerrno>
//A config remains virtual only as long as a write at it
//doesn't override the virtual value.While a config is virtual, a copy of its 'real' value is held and preserved
static std::string cfgPath;
static bool save_config = true;
static bool autoSave = true;
//Is this a virtual entry ?
#define CEM_VIRTUAL 1
//Should the value be saved ?
#define CEM_SAVE 2
//is this entry readonly ?
#define CEM_READONLY 4
//the move is from loading ?
#define CEM_LOAD 8
static emucfg::ConfigFile cfgdb;
struct ConfigEntry
static void saveConfigFile()
{
ConfigEntry(ConfigEntry* pp)
{
next=pp;
flags=0;
}
u32 flags;
string name;
string value;
string valueVirtual;
ConfigEntry* next;
void SaveFile(FILE* file)
{
if (flags & CEM_SAVE)
fprintf(file,"%s=%s\n",name.c_str(),value.c_str());
}
string GetValue()
{
if (flags&CEM_VIRTUAL)
return valueVirtual;
else
return value;
}
};
struct ConfigSection
{
u32 flags;
string name;
ConfigEntry* entrys;
ConfigSection* next;
ConfigSection(ConfigSection* pp)
{
next=pp;
flags=0;
entrys=0;
}
ConfigEntry* FindEntry(string name)
{
ConfigEntry* c= entrys;
while(c)
{
if (stricmp(name.c_str(),c->name.c_str())==0)
return c;
c=c->next;
}
return 0;
}
void SetEntry(string name,string value,u32 eflags)
{
ConfigEntry* c=FindEntry(name);
if (c)
{
//readonly is read only =)
if (c->flags & CEM_READONLY)
return;
//virtual : save only if different value
if (c->flags & CEM_VIRTUAL)
{
if(stricmp(c->valueVirtual.c_str(),value.c_str())==0)
return;
c->flags&=~CEM_VIRTUAL;
}
}
else
{
entrys=c= new ConfigEntry(entrys);
c->name=name;
}
verify(!(c->flags&(CEM_VIRTUAL|CEM_READONLY)));
//Virtual
//Virtual | ReadOnly
//Save
if (eflags & CEM_VIRTUAL)
{
verify(!(eflags & CEM_SAVE));
c->flags|=eflags;
c->valueVirtual=value;
}
else if (eflags & CEM_SAVE)
{
verify(!(eflags & (CEM_VIRTUAL|CEM_READONLY)));
flags|=CEM_SAVE;
c->flags|=CEM_SAVE;
c->value=value;
}
else
{
die("Invalid eflags value");
}
}
~ConfigSection()
{
ConfigEntry* n=entrys;
while(n)
{
ConfigEntry* p=n;
n=n->next;
delete p;
}
}
void SaveFile(FILE* file)
{
if (flags&CEM_SAVE)
{
fprintf(file,"[%s]\n",name.c_str());
vector<ConfigEntry*> stuff;
ConfigEntry* n=entrys;
while(n)
{
stuff.push_back(n);
n=n->next;
}
for (int i=stuff.size()-1;i>=0;i--)
{
stuff[i]->SaveFile(file);
}
fprintf(file,"\n");
}
}
};
struct ConfigFile
{
ConfigSection* entrys;
ConfigSection* FindSection(string name)
{
ConfigSection* c= entrys;
while(c)
{
if (stricmp(name.c_str(),c->name.c_str())==0)
return c;
c=c->next;
}
return 0;
}
ConfigSection* GetEntry(string name)
{
ConfigSection* c=FindSection(name);
if (!c)
{
entrys=c= new ConfigSection(entrys);
c->name=name;
}
return c;
}
~ConfigFile()
{
ConfigSection* n=entrys;
while(n)
{
ConfigSection* p=n;
n=n->next;
delete p;
}
}
void ParseFile(FILE* file)
{
}
void SaveFile(FILE* file)
{
vector<ConfigSection*> stuff;
ConfigSection* n=entrys;
while(n)
{
stuff.push_back(n);
n=n->next;
}
for (int i=stuff.size()-1;i>=0;i--)
{
if (stuff[i]->name!="emu")
stuff[i]->SaveFile(file);
}
}
};
ConfigFile cfgdb;
void savecfgf()
{
FILE* cfgfile = fopen(cfgPath.c_str(),"wt");
FILE* cfgfile = nowide::fopen(cfgPath.c_str(), "wt");
if (!cfgfile)
printf("Error : Unable to open file for saving \n");
{
WARN_LOG(COMMON, "Error: Unable to open file '%s' for saving", cfgPath.c_str());
}
else
{
cfgdb.SaveFile(cfgfile);
fclose(cfgfile);
cfgdb.save(cfgfile);
std::fclose(cfgfile);
}
}
void cfgSaveStr(const wchar * Section, const wchar * Key, const wchar * String)
void cfgSaveStr(const std::string& section, const std::string& key, const std::string& value)
{
cfgdb.GetEntry(Section)->SetEntry(Key,String,CEM_SAVE);
savecfgf();
//WritePrivateProfileString(Section,Key,String,cfgPath);
cfgdb.set(section, key, value);
if (save_config && autoSave)
saveConfigFile();
}
//New config code
/*
I want config to be really flexible .. so , here is the new implementation :
Functions :
cfgLoadInt : Load an int , if it does not exist save the default value to it and return it
cfgSaveInt : Save an int
cfgLoadStr : Load a str , if it does not exist save the default value to it and return it
cfgSaveStr : Save a str
cfgExists : Returns true if the Section:Key exists. If Key is null , it retuns true if Section exists
Config parameters can be read from the config file , and can be given at the command line
-cfg section:key=value -> defines a value at command line
If a cfgSave* is made on a value defined by command line , then the command line value is replaced by it
cfg values set by command line are not written to the cfg file , unless a cfgSave* is used
There are some special values , all of em are on the emu namespace :)
These are readonly :
emu:AppPath : Returns the path where the emulator is stored
emu:PluginPath : Returns the path where the plugins are loaded from
emu:DataPath : Returns the path where the bios/data files are
emu:FullName : str,returns the emulator's name + version string (ex."nullDC v1.0.0 Private Beta 2 built on {datetime}")
emu:ShortName : str,returns the emulator's name + version string , short form (ex."nullDC 1.0.0pb2")
emu:Name : str,returns the emulator's name (ex."nullDC")
These are read/write
emu:Caption : str , get/set the window caption
*/
///////////////////////////////
/*
** This will verify there is a working file @ ./szIniFn
** - if not present, it will write defaults
*/
struct vitem
{
string s;
string n;
string v;
vitem(string a,string b,string c){s=a;n=b;v=c;}
};
vector<vitem> vlist;
wchar* trim_ws(wchar* str);
bool cfgOpen()
{
cfgPath=GetPath("/emu.cfg");
FILE* cfgfile = fopen(cfgPath.c_str(),"r");
if(!cfgfile) {
cfgfile = fopen(cfgPath.c_str(),"wt");
if(!cfgfile)
printf("Unable to open the config file for reading or writing\nfile : %s\n",cfgPath.c_str());
else
{
fseek(cfgfile,0,SEEK_SET);
fclose(cfgfile);
cfgfile = fopen(cfgPath.c_str(),"r");
if(!cfgfile)
printf("Unable to open the config file for reading\nfile : %s\n",cfgPath.c_str());
}
if (get_writable_config_path("").empty())
// Config dir not set (android onboarding)
return false;
const char* filename = "emu.cfg";
std::string config_path_read = get_readonly_config_path(filename);
cfgPath = get_writable_config_path(filename);
FILE* cfgfile = nowide::fopen(config_path_read.c_str(), "r");
if(cfgfile != NULL) {
cfgdb.parse(cfgfile);
std::fclose(cfgfile);
}
wchar line[512];
wchar cur_sect[512]={0};
int cline=0;
while(cfgfile && !feof(cfgfile))
else
{
fgets(line,512,cfgfile);
if (feof(cfgfile))
break;
cline++;
if (strlen(line)<3)
continue;
if (line[strlen(line)-1]=='\r' || line[strlen(line)-1]=='\n')
line[strlen(line)-1]=0;
wchar* tl=trim_ws(line);
if (tl[0]=='[' && tl[strlen(tl)-1]==']')
// Config file can't be opened
int error_code = errno;
WARN_LOG(COMMON, "Warning: Unable to open the config file '%s' for reading (%s)", config_path_read.c_str(), strerror(error_code));
if (error_code == ENOENT || cfgPath != config_path_read)
{
tl[strlen(tl)-1]=0;
strcpy(cur_sect,tl+1);
trim_ws(cur_sect);
// Config file didn't exist
INFO_LOG(COMMON, "Creating new empty config file at '%s'", cfgPath.c_str());
saveConfigFile();
}
else
{
if (cur_sect[0]==0)
continue;//no open section
wchar* str1=strstr(tl,"=");
if (!str1)
{
printf("Malformed entry on config - ignoring @ %d(%s)\n",cline,tl);
continue;
}
*str1=0;
str1++;
wchar* v=trim_ws(str1);
wchar* k=trim_ws(tl);
if (v && k)
{
ConfigSection*cs=cfgdb.GetEntry(cur_sect);
//if (!cs->FindEntry(k))
cs->SetEntry(k,v,CEM_SAVE|CEM_LOAD);
}
else
{
printf("Malformed entry on config - ignoring @ %d(%s)\n",cline,tl);
}
// There was some other error (may be a permissions problem or something like that)
save_config = false;
}
}
for (size_t i=0;i<vlist.size();i++)
{
cfgdb.GetEntry(vlist[i].s)->SetEntry(vlist[i].n,vlist[i].v,CEM_VIRTUAL);
}
if (cfgfile)
{
cfgdb.SaveFile(cfgfile);
fclose(cfgfile);
}
return true;
}
//Implementations of the interface :)
//Section must be set
//If key is 0 , it looks for the section
//0 : not found
//1 : found section , key was 0
//2 : found section & key
s32 cfgExists(const wchar * Section, const wchar * Key)
std::string cfgLoadStr(const std::string& section, const std::string& key, const std::string& def)
{
if (Section==0)
return -1;
//return cfgRead(Section,Key,0);
ConfigSection*cs= cfgdb.FindSection(Section);
if (cs == 0)
return 0;
if (Key==0)
return 1;
ConfigEntry* ce=cs->FindEntry(Key);
if (ce!=0)
return 2;
else
return 0;
}
void cfgLoadStr(const wchar * Section, const wchar * Key, wchar * Return,const wchar* Default)
{
verify(Section!=0 && strlen(Section)!=0);
verify(Key!=0 && strlen(Key)!=0);
verify(Return!=0);
if (Default==0)
Default="";
ConfigSection* cs= cfgdb.GetEntry(Section);
ConfigEntry* ce=cs->FindEntry(Key);
if (!ce)
{
cs->SetEntry(Key,Default,CEM_SAVE);
strcpy(Return,Default);
}
else
{
strcpy(Return,ce->GetValue().c_str());
}
return cfgdb.get(section, key, def);
}
//These are helpers , mainly :)
s32 cfgLoadInt(const wchar * Section, const wchar * Key,s32 Default)
void cfgSaveInt(const std::string& section, const std::string& key, s32 value)
{
wchar temp_d[30];
wchar temp_o[30];
sprintf(temp_d,"%d",Default);
cfgLoadStr(Section,Key,temp_o,temp_d);
return atoi(temp_o);
cfgSaveStr(section, key, std::to_string(value));
}
void cfgSaveInt(const wchar * Section, const wchar * Key, s32 Int)
s32 cfgLoadInt(const std::string& section, const std::string& key, s32 def)
{
wchar tmp[32];
sprintf(tmp,"%d", Int);
cfgSaveStr(Section,Key,tmp);
return cfgdb.get_int(section, key, def);
}
void cfgSetVitual(const wchar * Section, const wchar * Key, const wchar * String)
void cfgSaveBool(const std::string& section, const std::string& key, bool value)
{
vlist.push_back(vitem(Section,Key,String));
//cfgdb.GetEntry(Section,CEM_VIRTUAL)->SetEntry(Key,String,CEM_VIRTUAL);
}
cfgSaveStr(section, key, value ? "yes" : "no");
}
bool cfgLoadBool(const std::string& section, const std::string& key, bool def)
{
return cfgdb.get_bool(section, key, def);
}
void cfgSetVirtual(const std::string& section, const std::string& key, const std::string& value)
{
cfgdb.set(section, key, value, true);
}
bool cfgIsVirtual(const std::string& section, const std::string& key)
{
return cfgdb.is_virtual(section, key);
}
bool cfgHasSection(const std::string& section)
{
return cfgdb.has_section(section);
}
void cfgDeleteSection(const std::string& section)
{
cfgdb.delete_section(section);
}
void cfgSetAutoSave(bool autoSave)
{
::autoSave = autoSave;
if (autoSave)
saveConfigFile();
}
+13 -14
View File
@@ -2,19 +2,18 @@
#include "types.h"
/*
** cfg* prototypes, if you pass NULL to a cfgSave* it will wipe out the section
** } if you pass it to lpKey it will wipe out that particular entry
** } if you add write to something it will create it if its not present
** } ** Strings passed to LoadStr should be MAX_PATH in size ! **
*/
bool cfgOpen();
s32 cfgLoadInt(const wchar * lpSection, const wchar * lpKey,s32 Default);
void cfgSaveInt(const wchar * lpSection, const wchar * lpKey, s32 Int);
void cfgLoadStr(const wchar * lpSection, const wchar * lpKey, wchar * lpReturn,const wchar* lpDefault);
void cfgSaveStr(const wchar * lpSection, const wchar * lpKey, const wchar * lpString);
s32 cfgExists(const wchar * Section, const wchar * Key);
void cfgSetVitual(const wchar * lpSection, const wchar * lpKey, const wchar * lpString);
s32 cfgLoadInt(const std::string& section, const std::string& key, s32 def);
void cfgSaveInt(const std::string& section, const std::string& key, s32 value);
std::string cfgLoadStr(const std::string& section, const std::string& key, const std::string& def);
void cfgSaveStr(const std::string& section, const std::string& key, const std::string& value);
void cfgSaveBool(const std::string& section, const std::string& key, bool value);
bool cfgLoadBool(const std::string& section, const std::string& key, bool def);
void cfgSetVirtual(const std::string& section, const std::string& key, const std::string& value);
bool cfgIsVirtual(const std::string& section, const std::string& key);
bool ParseCommandLine(int argc,wchar* argv[]);
bool ParseCommandLine(int argc, char *argv[]);
void cfgSetAutoSave(bool autoSave);
bool cfgHasSection(const std::string& section);
void cfgDeleteSection(const std::string& section);
+72 -78
View File
@@ -1,91 +1,54 @@
/*
Command line parsing
~yay~
Nothing too interesting here, really
*/
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include <cstdio>
#include <cctype>
#include <cstring>
#include "cfg/cfg.h"
#include "stdclass.h"
wchar* trim_ws(wchar* str)
{
if (str==0 || strlen(str)==0)
return 0;
while(*str)
{
if (!isspace(*str))
break;
str++;
}
size_t l=strlen(str);
if (l==0)
return 0;
while(l>0)
{
if (!isspace(str[l-1]))
break;
str[l-1]=0;
l--;
}
if (l==0)
return 0;
return str;
}
int setconfig(wchar** arg,int cl)
static int setconfig(char *arg[], int cl)
{
int rv=0;
for(;;)
{
if (cl<1)
{
printf("-config : invalid number of parameters, format is section:key=value\n");
return rv;
WARN_LOG(COMMON, "-config : invalid number of parameters, format is section:key=value");
break;
}
wchar* sep=strstr(arg[1],":");
if (sep==0)
std::string value(arg[1]);
auto seppos = value.find(':');
if (seppos == std::string::npos)
{
printf("-config : invalid parameter %s, format is section:key=value\n",arg[1]);
return rv;
WARN_LOG(COMMON, "-config : invalid parameter %s, format is section:key=value", value.c_str());
break;
}
wchar* value=strstr(sep+1,"=");
if (value==0)
auto eqpos = value.find('=', seppos);
if (eqpos == std::string::npos)
{
printf("-config : invalid parameter %s, format is section:key=value\n",arg[1]);
return rv;
WARN_LOG(COMMON, "-config : invalid parameter %s, format is section:key=value", value.c_str());
break;
}
*sep++=0;
*value++=0;
std::string sect = trim_ws(value.substr(0, seppos));
std::string key = trim_ws(value.substr(seppos + 1, eqpos - seppos - 1));
value = trim_ws(value.substr(eqpos + 1));
wchar* sect=trim_ws(arg[1]);
wchar* key=trim_ws(sep);
value=trim_ws(value);
if (sect==0 || key==0)
if (sect.empty() || key.empty())
{
printf("-config : invalid parameter, format is section:key=value\n");
return rv;
WARN_LOG(COMMON, "-config : invalid parameter, format is section:key=value");
break;
}
if (value==0)
value="";
printf("Virtual cfg %s:%s=%s\n",sect,key,value);
INFO_LOG(COMMON, "Virtual cfg %s:%s=%s", sect.c_str(), key.c_str(), value.c_str());
cfgSetVitual(sect,key,value);
cfgSetVirtual(sect, key, value);
rv++;
if (cl>=3 && stricmp(arg[2],",")==0)
if (cl>=3 && strcmp(arg[2],",")==0)
{
cl-=2;
arg+=2;
@@ -98,41 +61,72 @@ int setconfig(wchar** arg,int cl)
return rv;
}
int showhelp(wchar** arg,int cl)
static int showhelp()
{
printf("Available commands :\n");
printf("-config section:key=value [, ..]: add a virtual config value\n Virtual config values wont be saved to the .cfg file\n unless a different value is writen to em\nNote :\n You can specify many settings in the xx:yy=zz , gg:hh=jj , ...\n format.The spaces betwen the values and ',' are needed.");
printf("Usage: flycast [OPTION]... [CONTENT]\n\n");
printf("Options:\n");
printf("-config section:key=value add a virtual config value;\n");
printf(" virtual config values won't be saved to the .cfg file\n");
printf(" unless a different value is written to them\n");
printf("-help display this help\n");
exit(0);
return 0;
}
bool ParseCommandLine(int argc,wchar* argv[])
{
bool ParseCommandLine(int argc,char* argv[])
{
settings.content.path.clear();
int cl=argc-2;
wchar** arg=argv+1;
char** arg=argv+1;
while(cl>=0)
{
if (stricmp(*arg,"-help")==0)
if (stricmp(*arg,"-help")==0 || stricmp(*arg,"--help")==0)
{
int as=showhelp(arg,cl);
cl-=as;
arg+=as;
return true;
showhelp();
}
else if (stricmp(*arg,"-config")==0)
else if (stricmp(*arg,"-config")==0 || stricmp(*arg,"--config")==0)
{
int as=setconfig(arg,cl);
cl-=as;
arg+=as;
}
#if defined(__APPLE__)
else if (!strncmp(*arg, "-NSDocumentRevisions", 20))
{
arg++;
cl--;
}
#endif
else if ((*arg)[0] == '-')
{
WARN_LOG(COMMON, "Ignoring unknown command line option '%s'", *arg);
}
else
{
printf("wtf %s is suposed to do ?\n",*arg);
char* extension = strrchr(*arg, '.');
if (extension
&& (stricmp(extension, ".cdi") == 0 || stricmp(extension, ".chd") == 0
|| stricmp(extension, ".gdi") == 0 || stricmp(extension, ".cue") == 0))
{
INFO_LOG(COMMON, "Using '%s' as cd image", *arg);
settings.content.path = *arg;
}
else if (extension && stricmp(extension, ".elf") == 0)
{
INFO_LOG(COMMON, "Using '%s' as reios elf file", *arg);
cfgSetVirtual("config", "bios.UseReios", "yes");
settings.content.path = *arg;
}
else
{
INFO_LOG(COMMON, "Using '%s' as rom", *arg);
settings.content.path = *arg;
}
}
arg++;
cl--;
}
printf("\n");
return false;
}
}
+275
View File
@@ -0,0 +1,275 @@
#include "ini.h"
#include "types.h"
#include <sstream>
#include "stdclass.h"
namespace emucfg {
/* ConfigEntry */
const std::string& ConfigEntry::get_string() const
{
return this->value;
}
int ConfigEntry::get_int()
{
if (strstr(this->value.c_str(), "0x") != NULL)
{
return (int)strtoul(this->value.c_str(), NULL, 16);
}
else
{
return atoi(this->value.c_str());
}
}
bool ConfigEntry::get_bool()
{
if (stricmp(this->value.c_str(), "yes") == 0 ||
stricmp(this->value.c_str(), "true") == 0 ||
stricmp(this->value.c_str(), "on") == 0 ||
stricmp(this->value.c_str(), "1") == 0)
{
return true;
}
else
{
return false;
}
}
/* ConfigSection */
bool ConfigSection::has_entry(const std::string& name)
{
return (this->entries.count(name) == 1);
}
ConfigEntry* ConfigSection::get_entry(const std::string& name)
{
if(this->has_entry(name))
{
return &this->entries[name];
}
return NULL;
}
void ConfigSection::set(const std::string& name, const std::string& value)
{
ConfigEntry new_entry = { value };
this->entries[name] = new_entry;
}
void ConfigSection::delete_entry(const std::string& name)
{
this->entries.erase(name);
}
/* ConfigFile */
ConfigSection* ConfigFile::add_section(const std::string& name, bool is_virtual)
{
ConfigSection new_section;
if (is_virtual)
{
this->virtual_sections.insert(std::make_pair(name, new_section));
return &this->virtual_sections[name];
}
this->sections.insert(std::make_pair(name, new_section));
return &this->sections[name];
}
bool ConfigFile::has_section(const std::string& name)
{
return (this->virtual_sections.count(name) == 1 || this->sections.count(name) == 1);
}
bool ConfigFile::has_entry(const std::string& section_name, const std::string& entry_name)
{
ConfigSection* section = this->get_section(section_name, true);
if ((section != NULL) && section->has_entry(entry_name))
{
return true;
}
section = this->get_section(section_name, false);
return ((section != NULL) && section->has_entry(entry_name));
}
ConfigSection* ConfigFile::get_section(const std::string& name, bool is_virtual)
{
if(is_virtual)
{
if (this->virtual_sections.count(name) == 1)
{
return &this->virtual_sections[name];
}
}
else
{
if (this->sections.count(name) == 1)
{
return &this->sections[name];
}
}
return NULL;
}
ConfigEntry* ConfigFile::get_entry(const std::string& section_name, const std::string& entry_name)
{
ConfigSection* section = this->get_section(section_name, true);
if(section != NULL && section->has_entry(entry_name))
{
return section->get_entry(entry_name);
}
section = this->get_section(section_name, false);
if(section != NULL)
{
return section->get_entry(entry_name);
}
return NULL;
}
std::string ConfigFile::get(const std::string& section_name, const std::string& entry_name, const std::string& default_value)
{
ConfigEntry* entry = this->get_entry(section_name, entry_name);
if (entry == NULL)
{
return default_value;
}
else
{
return entry->get_string();
}
}
int ConfigFile::get_int(const std::string& section_name, const std::string& entry_name, int default_value)
{
ConfigEntry* entry = this->get_entry(section_name, entry_name);
if (entry == NULL)
{
return default_value;
}
else
{
return entry->get_int();
}
}
bool ConfigFile::get_bool(const std::string& section_name, const std::string& entry_name, bool default_value)
{
ConfigEntry* entry = this->get_entry(section_name, entry_name);
if (entry == NULL)
{
return default_value;
}
else
{
return entry->get_bool();
}
}
void ConfigFile::set(const std::string& section_name, const std::string& entry_name, const std::string& value, bool is_virtual)
{
ConfigSection* section = this->get_section(section_name, is_virtual);
if(section == NULL)
{
section = this->add_section(section_name, is_virtual);
}
section->set(entry_name, value);
}
void ConfigFile::set_int(const std::string& section_name, const std::string& entry_name, int value, bool is_virtual)
{
std::stringstream str_value;
str_value << value;
this->set(section_name, entry_name, str_value.str(), is_virtual);
}
void ConfigFile::set_bool(const std::string& section_name, const std::string& entry_name, bool value, bool is_virtual)
{
std::string str_value = (value ? "yes" : "no");
this->set(section_name, entry_name, str_value, is_virtual);
}
void ConfigFile::parse(FILE* file)
{
if (file == nullptr)
return;
char line[512];
std::string section;
int cline = 0;
while (true)
{
if (std::fgets(line, sizeof(line), file) == nullptr)
break;
cline++;
std::string s(line);
s = trim_ws(s, " \r\n");
if (s.empty())
continue;
if (s.length() >= 3 && s[0] == '[' && s[s.length() - 1] == ']')
{
section = s.substr(1, s.length() - 2);
continue;
}
auto eqpos = s.find('=');
if (eqpos == std::string::npos)
{
WARN_LOG(COMMON, "Malformed entry on config - ignoring line %d: %s", cline, s.c_str());
continue;
}
std::string property = trim_ws(s.substr(0, eqpos));
std::string value = trim_ws(s.substr(eqpos + 1));
if (value.length() >= 2 && value[0] == '"' && value[value.length() - 1] == '"')
value = value.substr(1, value.length() - 2);
set(section, property, value);
}
}
void ConfigFile::save(FILE* file)
{
for (const auto& section_it : this->sections)
{
const std::string& section_name = section_it.first;
const ConfigSection& section = section_it.second;
if (!section_name.empty())
std::fprintf(file, "[%s]\n", section_name.c_str());
for (const auto& entry_it : section.entries)
{
const std::string& entry_name = entry_it.first;
const ConfigEntry& entry = entry_it.second;
std::fprintf(file, "%s = %s\n", entry_name.c_str(), entry.get_string().c_str());
}
if (!section_name.empty())
std::fputc('\n', file);
}
}
void ConfigFile::delete_section(const std::string& section_name) {
sections.erase(section_name);
virtual_sections.erase(section_name);
}
void ConfigFile::delete_entry(const std::string& section_name, const std::string& entry_name)
{
ConfigSection *section = get_section(section_name, false);
if (section != NULL)
section->delete_entry(entry_name);
}
bool ConfigFile::is_virtual(const std::string& section_name, const std::string& entry_name)
{
ConfigSection *section = get_section(section_name, true);
if (section == nullptr)
return false;
return section->has_entry(entry_name);
}
} // namespace emucfg
+55
View File
@@ -0,0 +1,55 @@
#pragma once
#include <cstdio>
#include <map>
#include <string>
namespace emucfg {
struct ConfigEntry {
std::string value;
const std::string& get_string() const;
int get_int();
bool get_bool();
};
struct ConfigSection {
std::map<std::string, ConfigEntry> entries;
bool has_entry(const std::string& name);
void set(const std::string& name, const std::string& value);
void delete_entry(const std::string& name);
ConfigEntry* get_entry(const std::string& name);
};
struct ConfigFile {
private:
std::map<std::string, ConfigSection> sections;
std::map<std::string, ConfigSection> virtual_sections;
ConfigSection* add_section(const std::string& name, bool is_virtual);
ConfigSection* get_section(const std::string& name, bool is_virtual);
ConfigEntry* get_entry(const std::string& section_name, const std::string& entry_name);
public:
bool has_section(const std::string& name);
bool has_entry(const std::string& section_name, const std::string& entry_name);
bool is_virtual(const std::string& section_name, const std::string& entry_name);
void parse(FILE* file);
void save(FILE* file);
/* getting values */
std::string get(const std::string& section_name, const std::string& entry_name, const std::string& default_value = "");
int get_int(const std::string& section_name, const std::string& entry_name, int default_value = 0);
bool get_bool(const std::string& section_name, const std::string& entry_name, bool default_value = false);
/* setting values */
void set(const std::string& section_name, const std::string& entry_name, const std::string& value, bool is_virtual = false);
void set_int(const std::string& section_name, const std::string& entry_name, int value, bool is_virtual = false);
void set_bool(const std::string& section_name, const std::string& entry_name, bool value, bool is_virtual = false);
void delete_section(const std::string& section_name);
void delete_entry(const std::string& section_name, const std::string& entry_name);
};
} // namespace emucfg
+168
View File
@@ -0,0 +1,168 @@
/*
Copyright 2021 flyinghead
This file is part of Flycast.
Flycast is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Flycast is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Flycast. If not, see <https://www.gnu.org/licenses/>.
*/
#include "option.h"
namespace config {
// Dynarec
Option<bool> DynarecEnabled("Dynarec.Enabled", true);
Option<bool> DynarecIdleSkip("Dynarec.idleskip", true);
// General
Option<int> Cable("Dreamcast.Cable", 3); // TV Composite
Option<int> Region("Dreamcast.Region", 1); // USA
Option<int> Broadcast("Dreamcast.Broadcast", 0); // NTSC
Option<int> Language("Dreamcast.Language", 1); // English
Option<bool> FullMMU("Dreamcast.FullMMU");
Option<bool> ForceWindowsCE("Dreamcast.ForceWindowsCE");
Option<bool> AutoLoadState("Dreamcast.AutoLoadState");
Option<bool> AutoSaveState("Dreamcast.AutoSaveState");
Option<int> SavestateSlot("Dreamcast.SavestateSlot");
// Sound
Option<bool> DSPEnabled("aica.DSPEnabled", false);
#if HOST_CPU == CPU_ARM
Option<int> AudioBufferSize("aica.BufferSize", 5644); // 128 ms
#else
Option<int> AudioBufferSize("aica.BufferSize", 2822); // 64 ms
#endif
Option<bool> AutoLatency("aica.AutoLatency",
#ifdef __ANDROID__
true
#else
false
#endif
);
OptionString AudioBackend("backend", "auto", "audio");
AudioVolumeOption AudioVolume;
// Rendering
RendererOption RendererType;
Option<bool> UseMipmaps("rend.UseMipmaps", true);
Option<bool> Widescreen("rend.WideScreen");
Option<bool> SuperWidescreen("rend.SuperWideScreen");
Option<bool> ShowFPS("rend.ShowFPS");
Option<bool> RenderToTextureBuffer("rend.RenderToTextureBuffer");
Option<bool> TranslucentPolygonDepthMask("rend.TranslucentPolygonDepthMask");
Option<bool> ModifierVolumes("rend.ModifierVolumes", true);
Option<int> TextureUpscale("rend.TextureUpscale", 1);
Option<int> MaxFilteredTextureSize("rend.MaxFilteredTextureSize", 256);
Option<float> ExtraDepthScale("rend.ExtraDepthScale", 1.f);
Option<bool> CustomTextures("rend.CustomTextures");
Option<bool> DumpTextures("rend.DumpTextures");
Option<int> ScreenStretching("rend.ScreenStretching", 100);
Option<bool> Fog("rend.Fog", true);
Option<bool> FloatVMUs("rend.FloatVMUs");
Option<bool> Rotate90("rend.Rotate90");
Option<bool> PerStripSorting("rend.PerStripSorting");
#ifdef __APPLE__
Option<bool> DelayFrameSwapping("rend.DelayFrameSwapping", false);
#else
Option<bool> DelayFrameSwapping("rend.DelayFrameSwapping", true);
#endif
Option<bool> WidescreenGameHacks("rend.WidescreenGameHacks");
std::array<Option<int>, 4> CrosshairColor {
Option<int>("rend.CrossHairColor1"),
Option<int>("rend.CrossHairColor2"),
Option<int>("rend.CrossHairColor3"),
Option<int>("rend.CrossHairColor4"),
};
Option<int> SkipFrame("ta.skip");
Option<int> MaxThreads("pvr.MaxThreads", 3);
Option<int> AutoSkipFrame("pvr.AutoSkipFrame", 0);
Option<int> RenderResolution("rend.Resolution", 480);
Option<bool> VSync("rend.vsync", true);
Option<u64> PixelBufferSize("rend.PixelBufferSize", 512 * 1024 * 1024);
Option<int> AnisotropicFiltering("rend.AnisotropicFiltering", 1);
Option<int> TextureFiltering("rend.TextureFiltering", 0); // Default
Option<bool> ThreadedRendering("rend.ThreadedRendering", true);
Option<bool> DupeFrames("rend.DupeFrames", false);
// Misc
Option<bool> SerialConsole("Debug.SerialConsoleEnabled");
Option<bool> SerialPTY("Debug.SerialPTY");
Option<bool> UseReios("UseReios");
Option<bool> FastGDRomLoad("FastGDRomLoad", false);
Option<bool> OpenGlChecks("OpenGlChecks", false, "validate");
Option<std::vector<std::string>, false> ContentPath("Dreamcast.ContentPath");
Option<bool, false> HideLegacyNaomiRoms("Dreamcast.HideLegacyNaomiRoms", true);
// Network
Option<bool> NetworkEnable("Enable", false, "network");
Option<bool> ActAsServer("ActAsServer", false, "network");
OptionString DNS("DNS", "46.101.91.123", "network");
OptionString NetworkServer("server", "", "network");
Option<bool> EmulateBBA("EmulateBBA", false, "network");
Option<bool> GGPOEnable("GGPO", false, "network");
Option<int> GGPODelay("GGPODelay", 0, "network");
Option<bool> NetworkStats("Stats", true, "network");
Option<int> GGPOAnalogAxes("GGPOAnalogAxes", 0, "network");
Option<bool> GGPOChat("GGPOChat", true, "network");
#ifdef SUPPORT_DISPMANX
Option<bool> DispmanxMaintainAspect("maintain_aspect", true, "dispmanx");
#endif
#ifdef USE_OMX
Option<int> OmxAudioLatency("audio_latency", 100, "omx");
Option<bool> OmxAudioHdmi("audio_hdmi", true, "omx");
#endif
// Maple
Option<int> MouseSensitivity("MouseSensitivity", 100, "input");
Option<int> VirtualGamepadVibration("VirtualGamepadVibration", 20, "input");
std::array<Option<MapleDeviceType>, 4> MapleMainDevices {
Option<MapleDeviceType>("device1", MDT_SegaController, "input"),
Option<MapleDeviceType>("device2", MDT_None, "input"),
Option<MapleDeviceType>("device3", MDT_None, "input"),
Option<MapleDeviceType>("device4", MDT_None, "input"),
};
std::array<std::array<Option<MapleDeviceType>, 2>, 4> MapleExpansionDevices {
Option<MapleDeviceType>("device1.1", MDT_SegaVMU, "input"),
Option<MapleDeviceType>("device1.2", MDT_SegaVMU, "input"),
Option<MapleDeviceType>("device2.1", MDT_None, "input"),
Option<MapleDeviceType>("device2.2", MDT_None, "input"),
Option<MapleDeviceType>("device3.1", MDT_None, "input"),
Option<MapleDeviceType>("device3.2", MDT_None, "input"),
Option<MapleDeviceType>("device4.1", MDT_None, "input"),
Option<MapleDeviceType>("device4.2", MDT_None, "input"),
};
#ifdef _WIN32
Option<bool> UseRawInput("RawInput", false, "input");
#endif
#ifdef USE_LUA
OptionString LuaFileName("LuaFileName", "flycast.lua");
#endif
} // namespace config
+497
View File
@@ -0,0 +1,497 @@
/*
Copyright 2021 flyinghead
This file is part of Flycast.
Flycast is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Flycast is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Flycast. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include <string>
#include <vector>
#include <array>
#include <cmath>
#include "cfg.h"
#include "hw/maple/maple_cfg.h"
#ifdef LIBRETRO
#include <libretro.h>
#endif
namespace config {
class BaseOption {
public:
virtual ~BaseOption() = default;
virtual void save() const = 0;
virtual void load() = 0;
virtual void reset() = 0;
};
#ifdef LIBRETRO
#include "option_lr.h"
#else
class Settings {
public:
void reset() {
for (const auto& o : options)
o->reset();
gameId.clear();
perGameConfig = false;
}
void load(bool gameSpecific) {
if (gameSpecific)
{
if (gameId.empty())
return;
if (!cfgHasSection(gameId))
return;
perGameConfig = true;
}
for (const auto& o : options)
o->load();
}
void save() {
cfgSetAutoSave(false);
for (const auto& o : options)
o->save();
cfgSetAutoSave(true);
}
void setGameId(const std::string& gameId) {
this->gameId = gameId;
}
bool hasPerGameConfig() const {
return perGameConfig;
}
void setPerGameConfig(bool perGameConfig) {
this->perGameConfig = perGameConfig;
if (!perGameConfig) {
if (!gameId.empty())
cfgDeleteSection(gameId);
reset();
}
}
static Settings& instance() {
static Settings *_instance = new Settings();
return *_instance;
}
private:
std::vector<BaseOption *> options;
std::string gameId;
bool perGameConfig = false;
template<typename T, bool PerGameOption>
friend class Option;
};
// Missing in C++11
template <bool B, typename T = void>
using enable_if_t = typename std::enable_if<B, T>::type;
template<typename T, bool PerGameOption = true>
class Option : public BaseOption {
public:
Option(const std::string& name, T defaultValue = T(), const std::string& section = "config")
: section(section), name(name), value(defaultValue), defaultValue(defaultValue),
settings(Settings::instance())
{
settings.options.push_back(this);
}
void reset() override {
set(defaultValue);
overridden = false;
}
void load() override {
if (PerGameOption && settings.hasPerGameConfig())
set(doLoad(settings.gameId, section + "." + name));
else
{
set(doLoad(section, name));
if (cfgIsVirtual(section, name))
override(value);
}
}
void save() const override
{
if (overridden) {
if (value == overriddenDefault)
return;
if (!settings.hasPerGameConfig())
// overridden options can only be saved in per-game settings
return;
}
else if (PerGameOption && settings.hasPerGameConfig())
{
if (value == doLoad(section, name))
return;
}
if (PerGameOption && settings.hasPerGameConfig())
doSave(settings.gameId, section + "." + name);
else
doSave(section, name);
}
T& get() { return value; }
void set(T v) { value = v; }
void override(T v) {
verify(PerGameOption);
overriddenDefault = v;
overridden = true;
value = v;
}
bool isReadOnly() const {
return overridden && !settings.hasPerGameConfig();
}
explicit operator T() const { return value; }
operator T&() { return value; }
T& operator=(const T& v) { set(v); return value; }
protected:
template <typename U = T>
enable_if_t<std::is_same<U, bool>::value, T>
doLoad(const std::string& section, const std::string& name) const
{
return cfgLoadBool(section, name, value);
}
template <typename U = T>
enable_if_t<(std::is_integral<U>::value || std::is_enum<U>::value)
&& !std::is_same<U, bool>::value, T>
doLoad(const std::string& section, const std::string& name) const
{
return (T)cfgLoadInt(section, name, (int)value);
}
template <typename U = T>
enable_if_t<std::is_same<U, std::string>::value, T>
doLoad(const std::string& section, const std::string& name) const
{
return cfgLoadStr(section, name, value);
}
template <typename U = T>
enable_if_t<std::is_same<float, U>::value, T>
doLoad(const std::string& section, const std::string& name) const
{
std::string strValue = cfgLoadStr(section, name, "");
if (strValue.empty())
return value;
else
return (float)atof(strValue.c_str());
}
template <typename U = T>
enable_if_t<std::is_same<std::vector<std::string>, U>::value, T>
doLoad(const std::string& section, const std::string& name) const
{
std::string paths = cfgLoadStr(section, name, "");
if (paths.empty())
return value;
std::string::size_type start = 0;
std::vector<std::string> newValue;
while (true)
{
if (paths[start] == '"')
{
std::string v;
start++;
while (true)
{
if (paths[start] == '"')
{
if (start + 1 >= paths.size())
{
newValue.push_back(v);
return newValue;
}
if (paths[start + 1] == '"')
{
v += paths[start++];
start++;
}
else if (paths[start + 1] == ';')
{
newValue.push_back(v);
start += 2;
break;
}
else
{
v += paths[start++];
}
}
else
v += paths[start++];
}
}
else
{
std::string::size_type end = paths.find(';', start);
if (end == std::string::npos)
end = paths.size();
if (start != end)
newValue.push_back(paths.substr(start, end - start));
if (end == paths.size())
break;
start = end + 1;
}
}
return newValue;
}
template <typename U = T>
enable_if_t<std::is_same<U, bool>::value>
doSave(const std::string& section, const std::string& name) const
{
cfgSaveBool(section, name, value);
}
template <typename U = T>
enable_if_t<(std::is_integral<U>::value || std::is_enum<U>::value)
&& !std::is_same<U, bool>::value>
doSave(const std::string& section, const std::string& name) const
{
cfgSaveInt(section, name, (int)value);
}
template <typename U = T>
enable_if_t<std::is_same<U, std::string>::value>
doSave(const std::string& section, const std::string& name) const
{
cfgSaveStr(section, name, value);
}
template <typename U = T>
enable_if_t<std::is_same<float, U>::value>
doSave(const std::string& section, const std::string& name) const
{
char buf[64];
snprintf(buf, sizeof(buf), "%f", value);
cfgSaveStr(section, name, buf);
}
template <typename U = T>
enable_if_t<std::is_same<std::vector<std::string>, U>::value>
doSave(const std::string& section, const std::string& name) const
{
std::string s;
for (const auto& v : value)
{
if (!s.empty())
s += ';';
if (v.find(';') != std::string::npos || (!v.empty() && v[0] == '"'))
{
s += '"';
std::string v2 = v;
while (true)
{
auto pos = v2.find('"');
if (pos != std::string::npos)
{
s += v2.substr(0, pos + 1) + '"';
v2 = v2.substr(pos + 1);
}
else
{
s += v2;
break;
}
}
s += '"';
}
else
s += v;
}
cfgSaveStr(section, name, s);
}
std::string section;
std::string name;
T value;
T defaultValue;
T overriddenDefault = T();
bool overridden = false;
Settings& settings;
};
#endif
using OptionString = Option<std::string>;
// Dynarec
extern Option<bool> DynarecEnabled;
extern Option<bool> DynarecIdleSkip;
constexpr bool DynarecSafeMode = false;
// General
extern Option<int> Cable; // 0 -> VGA, 1 -> VGA, 2 -> RGB, 3 -> TV Composite
extern Option<int> Region; // 0 -> JP, 1 -> USA, 2 -> EU, 3 -> default
extern Option<int> Broadcast; // 0 -> NTSC, 1 -> PAL, 2 -> PAL/M, 3 -> PAL/N, 4 -> default
extern Option<int> Language; // 0 -> JP, 1 -> EN, 2 -> DE, 3 -> FR, 4 -> SP, 5 -> IT, 6 -> default
extern Option<bool> FullMMU;
extern Option<bool> ForceWindowsCE;
extern Option<bool> AutoLoadState;
extern Option<bool> AutoSaveState;
extern Option<int> SavestateSlot;
// Sound
constexpr bool LimitFPS = true;
extern Option<bool> DSPEnabled;
extern Option<int> AudioBufferSize; //In samples ,*4 for bytes
extern Option<bool> AutoLatency;
extern OptionString AudioBackend;
class AudioVolumeOption : public Option<int> {
public:
AudioVolumeOption() : Option<int>("aica.Volume", 100) {};
float logarithmic_volume_scale = 1.0;
void load() override {
Option<int>::load();
calcDbPower();
}
float dbPower()
{
return logarithmic_volume_scale;
}
void calcDbPower()
{
// dB scaling calculation: https://www.dr-lex.be/info-stuff/volumecontrols.html
logarithmic_volume_scale = std::min(std::exp(4.605f * float(value) / 100.f) / 100.f, 1.f);
if (value < 10)
logarithmic_volume_scale *= value / 10.f;
}
};
extern AudioVolumeOption AudioVolume;
// Rendering
class RendererOption : public Option<RenderType> {
public:
RendererOption()
#ifdef USE_DX9
: Option<RenderType>("pvr.rend", RenderType::DirectX9) {}
#elif defined(TARGET_UWP)
: Option<RenderType>("pvr.rend", RenderType::DirectX11) {}
#else
: Option<RenderType>("pvr.rend", RenderType::OpenGL) {}
#endif
RenderType& operator=(const RenderType& v) { set(v); return value; }
void reset() override {
// don't reset the value to avoid quick switching when starting a game
overridden = false;
}
};
extern RendererOption RendererType;
extern Option<bool> UseMipmaps;
extern Option<bool> Widescreen;
extern Option<bool> SuperWidescreen;
extern Option<bool> ShowFPS;
extern Option<bool> RenderToTextureBuffer;
extern Option<bool> TranslucentPolygonDepthMask;
extern Option<bool> ModifierVolumes;
constexpr bool Clipping = true;
#ifndef LIBRETRO
extern Option<int> TextureUpscale;
extern Option<int> MaxFilteredTextureSize;
#endif
extern Option<float> ExtraDepthScale;
extern Option<bool> CustomTextures;
extern Option<bool> DumpTextures;
extern Option<int> ScreenStretching; // in percent. 150 means stretch from 4/3 to 6/3
extern Option<bool> Fog;
extern Option<bool> FloatVMUs;
extern Option<bool> Rotate90;
extern Option<bool> PerStripSorting;
extern Option<bool> DelayFrameSwapping; // Delay swapping frame until FB_R_SOF matches FB_W_SOF
extern Option<bool> WidescreenGameHacks;
extern std::array<Option<int>, 4> CrosshairColor;
extern Option<int> SkipFrame;
extern Option<int> MaxThreads;
extern Option<int> AutoSkipFrame; // 0: none, 1: some, 2: more
extern Option<int> RenderResolution;
extern Option<bool> VSync;
extern Option<u64> PixelBufferSize;
extern Option<int> AnisotropicFiltering;
extern Option<int> TextureFiltering; // 0: default, 1: force nearest, 2: force linear
extern Option<bool> ThreadedRendering;
extern Option<bool> DupeFrames;
// Misc
extern Option<bool> SerialConsole;
extern Option<bool> SerialPTY;
extern Option<bool> UseReios;
extern Option<bool> FastGDRomLoad;
extern Option<bool> OpenGlChecks;
extern Option<std::vector<std::string>, false> ContentPath;
extern Option<bool, false> HideLegacyNaomiRoms;
// Network
extern Option<bool> NetworkEnable;
extern Option<bool> ActAsServer;
extern OptionString DNS;
extern OptionString NetworkServer;
extern Option<bool> EmulateBBA;
extern Option<bool> GGPOEnable;
extern Option<int> GGPODelay;
extern Option<bool> NetworkStats;
extern Option<int> GGPOAnalogAxes;
extern Option<bool> GGPOChat;
#ifdef SUPPORT_DISPMANX
extern Option<bool> DispmanxMaintainAspect;
#endif
#ifdef USE_OMX
extern Option<int> OmxAudioLatency;
extern Option<bool> OmxAudioHdmi;
#endif
// Maple
extern Option<int> MouseSensitivity;
extern Option<int> VirtualGamepadVibration;
extern std::array<Option<MapleDeviceType>, 4> MapleMainDevices;
extern std::array<std::array<Option<MapleDeviceType>, 2>, 4> MapleExpansionDevices;
#ifdef _WIN32
extern Option<bool> UseRawInput;
#else
constexpr bool UseRawInput = false;
#endif
#ifdef USE_LUA
extern OptionString LuaFileName;
#endif
} // namespace config
+802
View File
@@ -0,0 +1,802 @@
/*
Created on: Sep 23, 2019
Credits for cheats: Esppiral, S4pph4rad, yzb37859365, Shenmue_Trilogy, Radaron, Virgin KLM, Joel, Zorlon,
ELOTROLADO.NET, SEGARETRO.ORG, Sakuragi @ emutalk.net
Copyright 2019 flyinghead
This file is part of Flycast.
Flycast is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Flycast is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Flycast. If not, see <https://www.gnu.org/licenses/>.
*/
#include "cheats.h"
#include "hw/sh4/sh4_mem.h"
#include "reios/reios.h"
#include "cfg/cfg.h"
#include "cfg/ini.h"
const WidescreenCheat CheatManager::widescreen_cheats[] =
{
{ "MK-51064", nullptr, { 0x39EFF4, 0 }, { 0x43700000 } }, // 18 wheeler (USA)
{ "MK-5106450", nullptr, { 0x39EFF4, 0 }, { 0x43700000 } }, // 18 wheeler (PAL)
{ "HDR-0080", nullptr, { 0x6625C0, 0 }, { 0x43700000 } }, // 18 wheeler (JP)
{ "T-9708N", nullptr, { 0x0AD5B0, 0x112E00, 0 }, { 0x4A2671C4, 0x401CCCCD } }, // 4 Wheel Thunder (USA)
{ "MK-5119050", nullptr, { 0x104A34, 0 }, { 0x3F52CCCD } }, // 90 Minutes - Sega Championship Football (PAL)
{ "T40209D 50", nullptr, { 0x2A8750, 0 }, { 0x3F400000 } }, // AeroWings 2 (PAL)
{ "T34101M", nullptr, { 0x24CF20, 0x24CEEC, 0 }, { 0x3FAAAAAB, 0x43F00000, 0 } }, // Animastar (JP)
{ "MK-51171", nullptr, { 0xCA20B8, 0 }, { 0x43700000 } }, // Alien Front Online (USA)
{ "T2101M", nullptr, { 0x13E8B4, 0x13E8E4, 0 }, { 0x43F00000, 0x3F400000 } }, // Berserk (JP)
{ "T13001D 18", nullptr, { 0x2DAC44, 0 }, { 0x3F400000 } }, // Blue Stinger (En, De) (PAL)
{ "xxxxxxxxxx", nullptr, { 0x2DAB84, 0 }, { 0x3F400000 } }, // Blue Stinger (Fr) (PAL)
{ "T13001D-05", nullptr, { 0x2D9C84, 0 }, { 0x3F400000 } }, // Blue Stinger (Es, It?) (PAL)
{ "T13001N", nullptr, { 0x2D9CA4, 0 }, { 0x3F400000 } }, // Blue Stinger (USA)
{ "HDR-0003", nullptr, { 0x2D6D80, 0 }, { 0x3F400000 } }, // Blue Stinger (JP)
{ "T42903M", nullptr, { 0x286E2C, 0x286E5C, 0 }, { 0x43F00000, 0x3F400000 } }, // Bomber Hehhe! (JP)
{ "MK-51065", nullptr, { 0x387B84, 0x387BB4, 0 }, { 0x43F00000, 0x3F400000 } }, // Bomberman Online (USA)
{ "T6801M", nullptr, { 0x042F3C, 0 }, { 0x4384BC09 } }, // Buggy Heat (JP)
{ "T46601D 05", nullptr, { 0xBB3D14, 0 }, { 0x440A7C9A } }, // Cannon Spike (PAL)
{ "T1215N", nullptr, { 0xBB3C74, 0 }, { 0x440A7C9A } }, // Cannon Spike (USA)
{ "T44901D 50", nullptr, { 0xB0109C, 0xB010CC, 0 }, { 0x43F00000, 0x3F400000 } }, // Carrier (PAL)
{ "T5701N", nullptr, { 0xAFD93C, 0xAFD96C, 0 }, { 0x43F00000, 0x3F400000 } }, // Carrier (USA)
// Capcom vs. SNK Pro (JP)
// You can see the end of the backgrounds on each side. The HUD is shifted to the right.
// Code 2 sets HUD and movements of the characters to a 4:3 zone
{ "T1247M", nullptr, { 0x1E8238, 0x3D3658, 0x3D3628, 0 }, { 0x43F00000, 0x43D20000, 0x43700000 } },
// Capcom vs. SNK 2 (JP)
// You can see the end of the backgrounds on each side.
{ "T1249M", nullptr, { 0x39BFD8, 0x34E9E8, 0x34EFBC, 0 }, { 0x43700000, 0x3F400000, 0x3F400000 } },
{ "T44902D 50", nullptr, { 0x1DBFF8, 0 }, { 0x43700000 } }, // Charge ‘n Blast (PAL)
{ "T4402M", nullptr, { 0x1DA9E0, 0 }, { 0x43700000 } }, // Charge ‘n Blast (JP)
{ "MK-5104950", nullptr, { 0x2D2D40, 0x2D2D70, 0 }, { 0x3F400000, 0xC2700000 } }, // ChuChu Rocket! (PAL)
{ "T44903D 50", nullptr, { 0x315300, 0x315334, 0 }, { 0x43F00000, 0x3FAAAAAB } }, // Coaster Works (PAL)
// Confidential Mission (PAL) 022F0D58 43700000 - Only works on real Dreamcast
{ "T36901M", nullptr, { 0x1C8A98, 0 }, { 0x3F400000 } }, // Cool Boarders (JP)
{ "T3106M", nullptr, { 0x60B59C, 0 }, { 0x3F400000 } }, // Cool Cool Toon (JP)
{ "HDR-0176", nullptr, { 0x240FAC, 0 }, { 0x3F400000 } }, // Cosmic Smash (JP)
{ "MK-51035", " U ", { 0x2B08B0, 0 }, { 0x43700000 } }, // Crazy Taxi (USA)
{ "MK-51035", " E ", { 0x2B3410, 0 }, { 0x43700000 } }, // Crazy Taxi (PAL)
{ "MK-5113650", nullptr, { 0x2BFB70, 0 }, { 0x43700000 } }, // Crazy Taxi 2 (PAL)
{ "MK-51136", nullptr, { 0x2BDDD0, 0 }, { 0x43700000 } }, // Crazy Taxi 2 (USA)
// { "HDR-0159", nullptr, { 0x2FBBD0, 0 }, { 0x43700000 } }, // Crazy Taxi 2 (JP) not working
{ "T13004N", nullptr, { 0x016D94, 0 }, { 0x44234E73 } }, // Cyber Troopers - Virtual On - Oratorio Tangram (USA)
// D2 (USA)
{ "MK-51036", nullptr, { 0x4B5CF4, 0x4B5CC4, 0x3E92A0, 0x3E92A8, 0x3E92C0, 0x3E92C8 },
{ 0x3F400000, 0x43F00000, 0, 0, 0, 0 } },
// D2 (JP)
{ "T30006M", nullptr, { 0x4CF42C, 0x4CF45C, 0x3E1A36, 0x3E1A34, 0x3E1A3C, 0x3E1A54, 0x3E1A5C, 0 },
{ 0x43F00000, 0x3F400000, 0x08010000, 0, 0, 0, 0 } },
{ "MK-5103750", nullptr, { 0x1FE270, 0 }, { 0x43700000 } }, // Daytona USA (PAL)
{ "MK-51037", nullptr, { 0x1FC6D0, 0 }, { 0x43700000 } }, // Daytona USA (USA)
{ "T9501N-50", nullptr, { 0x9821D4, 0 }, { 0x3F400000 } }, // Deadly Skies (PAL)
{ "T8116D 50", nullptr, { 0x2E5530, 0 }, { 0x43700000 } }, // Dead or Alive 2 (PAL)
{ "T3601N", nullptr, { 0x2F0670, 0 }, { 0x43700000 } }, // Dead or Alive 2 (USA)
{ "T3602M", nullptr, { 0x2FF798, 0 }, { 0x43700000 } }, // Dead or Alive 2 (JP)
{ "T3601M", nullptr, { 0x2FBBD0, 0x1E6658, 0 }, { 0x43700000, 0x4414C000 } }, // Dead or Alive 2: Limited Edition (JP) (code 1 fixes HUD)
{ "T2401N", nullptr, { 0x8BD5B4, 0x8BD5E4, 0 }, { 0x43F00000, 0x3F400000 } }, // Death Crimson OX (USA)
{ "T23201M", nullptr, { 0x819F44, 0x819F74, 0 }, { 0x43F00000, 0x3F400000 } }, // Death Crimson 2 (JP)
{ "T17714D50", nullptr, { 0x0D2ED0, 0x0D2ED4, 0 }, { 0x3FAAAAAB, 0x3F400000 } }, // Donald Duck: Quack Attack (PAL) (Code 1 corrects the HUD)
{ "T12503D-50", nullptr, { 0x49CB24, 0 }, { 0x3F0CCCCD } }, // Dragons Blood (PAL)
{ "T17716D 50", nullptr, { 0xF97F40, 0x08DCF8, 0 }, { 0x00000168, 0 } }, // Dragonriders: Chronicles of Pern (PAL)
{ "T17720N", nullptr, { 0xF97F40, 0x08DCF4, 0 }, { 0x00000168, 0 } }, // Dragonriders: Chronicles of Pern (USA) (Code 1 removes black bars)
{ "MK-5101350", nullptr, { 0x4FCBC0, 0 }, { 0x43700000 } }, // Dynamite Cop (PAL)
{ "MK-51013", nullptr, { 0x4FCBC0, 0 }, { 0x43700000 } }, // Dynamite Cop (USA)
// Draconus: Cult of the Wyrm (USA)
// Code 1-2 increases drawing distance
{ "T40203N", nullptr, { 0x49D7F4, 0x49D8CC, 0x49D6F8, 0 }, { 0x3F07C3BB, 0x447A0000, 0x3FAAAAAB } },
// Ecco the Dolphin: Defender of the Future (PAL)
{ "MK-5103350", nullptr, { 0x275418, 0x040E68, 0x040D1C, 0 }, { 0x49D9A5DA, 0x3F100000, 0x3F100000 } },
{ "T17705D 05", nullptr, { 0x304870, 0 }, { 0x3F400000 } }, // Evolution - The World of Sacred Device (PAL)
{ "T45005D 50", nullptr, { 0x36CE5C, 0x36CE8C, 0 }, { 0x43F00000, 0x3F400000 } }, // Evolution 2 - Far Off Promise (PAL)
{ "T1711N", nullptr, { 0x36C76C, 0x36C73C, 0 }, { 0x3F400000, 0x43F00000 } }, // Evolution 2 - Far Off Promise (USA)
{ "T8118D 50", nullptr, { 0x2C6B7C, 0 }, { 0x00004000 } }, // Ferrari F355 Challenge (PAL) vga mode only
{ "HDR-0100", nullptr, { 0x3235D4, 0 }, { 0x00004000 } }, // Ferrari F355 Challenge (JP) vga mode only
{ "MK-5115450", nullptr, { 0x3D3B10, 0 }, { 0x43700000 } }, // Fighting Vipers 2 (PAL)
{ "HDR-0133", nullptr, { 0x3D3AF0, 0 }, { 0x43700000 } }, // Fighting Vipers 2 (JP)
{ "MK-51114", nullptr, { 0x132DD8, 0xA26CA8, 0xA26738, 0xA275B8, 0xA26AD8, 0xA26908, 0 },
{ 0x3F400000, 0x3F400000, 0x3F400000, 0x3F400000, 0x3F400000, 0x3F400000 } }, // Floigan Bros. Ep. 1 (PAL)
{ "T34201M", nullptr, { 0x586290, 0x586260, 0 }, { 0x3F400000, 0x43F00000 } }, // Frame Gride (JP)
{ "T-8113D-50", nullptr, { 0x55A354, 0 }, { 0x3FAAAAAB } }, // Fur Fighters (PAL)
{ "T-8107N", nullptr, { 0x55A374, 0 }, { 0x3FAAAAAB } }, // Fur Fighters (USA)
{ "T9707D 50", nullptr, { 0x2E7CD0, 0x2E7D04, 0x2E7D10, 0x2E7D0C, 0 },
{ 0x43BEAE39, 0x3DCCCCCD , 0x44A00000, 0xC4200000 } }, // Gauntlet Legends (PAL)
{ "HDR-0004", nullptr, { 0x364A64, 0 }, { 0x43BA0000 } }, // Godzilla Generations (JP)
{ "HDR-0047", nullptr, { 0x7C3F24, 0x7C3F54, 0 }, { 0x43F00000, 0x3F400000 } }, // Godzilla Generations Maximum Impact (JP)
{ "T41501M", nullptr, { 0x282604, 0x282634, 0 }, { 0x43F00000, 0x3F400000 } }, // Golem no Maigo (aka The Lost Golem) (JP)
{ "T1219M", nullptr, { 0xBC3C94, 0 }, { 0x440A7C9A } }, // Gun Spike (JP)
{ "T13301N", nullptr, { 0x88E780, 0 }, { 0x3F400000 } }, // Gundam Side Story (USA)
// { "T11001N", nullptr, { 0xC3D6BC, 0xD204A8, 0xD32FC8, 0xC7CF84, 0xD20548, 0 },
// { 0x00363031, 0x00000356, 0x00000280, 0x00000280, 0x00000280 } }, // Half-Life. Not working
{ "MK-5104150", nullptr, { 0x23FCC4, 0 }, { 0x44558000 } }, // Headhunter (PAL)
{ "MK-5100250", nullptr, { 0x4C6708, 0 }, { 0x43700000 } }, // House of the Dead 2, The (PAL)
{ "MK-51002", nullptr, { 0x4C6088, 0 }, { 0x43700000 } }, // House of the Dead 2, The (USA)
{ "T38706M", nullptr, { 0xC0CFA0, 0 }, { 0x3F400000 } }, // Ikaruga (JP)
{ "T46001N", nullptr, { 0x1C8A98, 0 }, { 0x3F400000 } }, // Illbleed (USA)
{ "T44904D 50", nullptr, { 0x18C15C, 0x18C18C, 0 }, { 0x43F00000, 0x3F400000 } }, // Iron Aces (PAL)
{ "MK-51058", nullptr, { 0x32E0FC, 0x32E12C, 0 }, { 0x43F00000, 0x3F400000 } }, // Jet Grind Radio (USA)
{ "MK-5105850", nullptr, { 0x32F9EC, 0x32F9BC, 0 }, { 0x3F400000, 0x43F00000 } }, // Jet Set Radio (PAL)
{ "HDR-0078", nullptr, { 0x327A8C, 0x327A5C, 0 }, { 0x3F400000, 0x43F00000 } }, // Jet Set Radio (De La) (JP)
{ "T22902D 50", nullptr, { 0x278508, 0 }, { 0x43700000 } }, // Kao The Kangaroo (PAL)
{ "T22903N", nullptr, { 0x2780A8, 0 }, { 0x43700000 } }, // Kao The Kangaroo (USA)
{ "T47803M", nullptr, { 0x0FDFAC, 0 }, { 0x3F400000 } }, // Karous (JP)
// { "T41901N", nullptr, { 0x53F580, 0xEFB748, 0xEFB750, 0 }, { 0xC4200000, 0x43A00000, 0x43200000 } }, // KISS Psycho Circus – The Nightmare Child (USA)
{ "T2501M", nullptr, { 0x24A878, 0x24A8A8, 0 }, { 0x43F00000, 0x3F400000 } }, // Langrisser Millenium (JP)
{ "T15111D 50", nullptr, { 0x29B90C, 0 }, { 0x3F400000 } }, // Le Mans 24 Hours (PAL)
{ "T15116N", nullptr, { 0x2198EC, 0 }, { 0x3F400000 } }, // Looney Tunes: Space Race (USA)
{ "MK-5105050", nullptr, { 0x33818C, 0 }, { 0x3FA66666 } }, // Maken X (PAL)
{ "MK-51050", nullptr, { 0x30CB4C, 0 }, { 0x3F400000 } }, // Maken X (USA)
{ "T1212N", nullptr, { 0x2D6B18, 0x268390, 0x268ED8, 0x268934, 0x26947C, 0x269A20, 0x269FC4, 0 },
{ 0x43700000, 0x3F400000, 0x3F400000, 0x3F400000, 0x3F400000, 0x3F400000, 0x3F400000 } }, // Marvel vs. Capcom 2 (USA)
{ "T1215M", nullptr, { 0x2FE2C0, 0x28FB38, 0x290680, 0x2900DC, 0x290C24, 0x2911C8, 0x29176C, 0 },
{ 0x43700000, 0x3F400000, 0x3F400000, 0x3F400000, 0x3F400000, 0x3F400000, 0x3F400000 } }, // Marvel vs. Capcom 2 (JP)
{ "T41402N", nullptr, { 0x551B80, 0 }, { 0x3F400000 } }, // Max Steel - Covert Missions (USA)
{ "MK-5102250", "V1.001", { 0x107FDC, 0x11253C, 0 }, { 0x3F99999A, 0x3F900000 } }, // Metropolis Street Racer (v1.001) (PAL)
{ "MK-5102250", "V1.009", { 0x106B5C, 0x1111F4, 0 }, { 0x3F99999A, 0x3F900000 } }, // Metropolis Street Racer (v1.009) (PAL)
{ "MK-51012", nullptr, { 0x10A01C, 0x1146FC, 0 }, { 0x3F99999A, 0x3F900000 } }, // Metropolis Street Racer (USA)
{ "T0000M", nullptr, { 0x1CAEAC, 0x1CAEDC, 0 }, { 0x43F00000, 0x3F400000 } }, // Millenium Racer Y2K Fighters
{ "T1221M", nullptr, { 0x426B74, 0 }, { 0x43F00000 } }, // Moero! Justice Gauken (JP)
{ "T9701D", nullptr, { 0x31290C, 0 }, { 0x3F400000 } }, // Mortal Kombat Gold (PAL)
{ "T-9701N", nullptr, { 0x337B8C, 0 }, { 0x3FA66666 } }, // Mortal Kombat Gold (USA)
{ "T7020D", nullptr, { 0x1A5D40, 0x1A5D18, 0x1A5D38, 0x1A5D34, 0x1A5D30, 0x1A5D3C, 0x1A5D0C, 0x1A5D08, 0x1ACB78, 0 },
{ 0x3F59999A, 0x44084000, 0x3FB1EB85, 0x3FAAAAAB, 0x3F800000, 0x3FA66666, 0xC31B0000, 0x42700000, 0x44160000 } }, // Mr Driller (PAL)
{ "T7604M", nullptr, { 0x43BDA4, 0x43BDD8, 0x4319E8, 0x431A08, 0x431A28, 0x431A48, 0 },
{ 0x43700000, 0x3F9AF5C2, 0x42200000, 0x42200000, 0x438C0000, 0x438C0000 } }, // Nanatsu no Hikan - Senritsu no Bishou (JP)
{ "HDR-0079", nullptr, { 0x353744, 0x353774, 0x353778, 0 },
{ 0x43F00000, 0x3F400000, 0x3F800000 } }, // Napple Tale: Arsia in Daydream (JP)
//crash { "MK-51178", nullptr, { 0x23AF00, 0x23B160, 0x144D40, 0x2105B4, 0x705B40, 0 },
// { 0xBFAAAAAB, 0xBFAAAAAB, 0xBFAAAAAB, 0xBFAAAAAB, 0x44558000 } }, // NBA 2K2
{ "T9504M", nullptr, { 0xCDE848, 0xCDE844, 0 }, { 0x3F400000, 0x3FA00000 } }, // Nightmare Creatures II (USA)
{ "T-9502D-50", nullptr, { 0xBDE9B0, 0xBDE9C4, 0 }, { 0x3F400000, 0x3FA00000 } }, // Nightmare Creatures II (PAL)
{ "MK-5110250", nullptr, { 0x87B5A4, 0 }, { 0x43700000 } }, // Outtrigger (PAL)
{ "HDR-0118", nullptr, { 0x83E284, 0 }, { 0x43700000 } }, // Outtrigger (JP)
{ "T15103D 50", nullptr, { 0x1EEE78, 0 }, { 0x3F400000 } }, // PenPen (PAL)
{ "T17001M", nullptr, { 0x1C3828, 0 }, { 0x3F400000 } }, // PenPen TriIcelon (JP)
{ "MK-5110050", nullptr, { 0x548E04, 0x0923C0, 0 }, { 0x43E80000, 0x3F966666 } }, // Phantasy Star Online (PAL) TODO
{ "MK-51100", nullptr, { 0x548E84, 0x0925A4, 0 }, { 0x43D20000, 0x3FA66666 } }, // Phantasy Star Online (USA) TODO
{ "HDR-0129", nullptr, { 0x57E344, 0x091794, 0 }, { 0x43D20000, 0x3FA66666 } }, // Phantasy Star Online (JP) TODO
{ "MK-5119350", nullptr, { 0x57552C, 0x0A2DD4, 0 }, { 0x43F00000, 0x3F911111 } }, // Phantasy Star Online Ver. 2 (PAL) TODO
{ "MK-51193", nullptr, { 0x0A3138, 0x58C8CC, 0 }, { 0x3F911111, 0x43F00000 } }, // Phantasy Star Online Ver. 2 (USA) TODO
{ "T1207N", nullptr, { 0x7D463C, 0 }, { 0x3F400000 } }, // Plasma Sword - Nightmare of Bilstein (USA)
{ "T36801D 50", nullptr, { 0x7FD3C8, 0 }, { 0x43700000 } }, // Power Stone (PAL)
{ "T1201N", nullptr, { 0x7FCEE8, 0 }, { 0x43700000 } }, // Power Stone (USA)
{ "T36812D 50", nullptr, { 0x868BA8, 0 }, { 0x43700000 } }, // Power Stone 2 (PAL)
{ "T1211N", nullptr, { 0x8689A8, 0 }, { 0x43700000 } }, // Power Stone 2 (USA)
{ "T1218M", nullptr, { 0x849AA0, 0 }, { 0x43700000 } }, // Power Stone 2 (JP)
{ "T7022D 50", nullptr, { 0x33414C, 0 }, { 0x43F00000 } }, // Project Justice (PAL)
{ "T1219N", nullptr, { 0x33374C, 0 }, { 0x43F00000 } }, // Project Justice (USA)
{ "MK-51162", nullptr, { 0x204308, 0 }, { 0x3FE38E39 } }, // Propeller Arena
{ "T-8106D-50", nullptr, { 0x7DA39C, 0 }, { 0x3F400000 } }, // Psychic Force 2012 (PAL)
{ "T9901M", nullptr, { 0x1AD848, 0 }, { 0x3F400000 } }, // Rainbow Cotton (JP)
{ "T9711D 50", nullptr, { 0x1574D8, 0 }, { 0x43700000 } }, // Ready 2 Rumble Boxing Round 2 (PAL)
{ "T7012D 05", nullptr, { 0x4FF93C, 0x4FF96C, 0 }, { 0x43F00000, 0x3F400000 } }, // Record of Lodoss War (En) (PAL)
{ "xxxxxxxxxx", nullptr, { 0x4FF25C, 0x4FF28C, 0 }, { 0x43F00000, 0x3F400000 } }, // Record of Lodoss War (De) (PAL)
{ "T7012D 09", nullptr, { 0x50499C, 0x5049CC, 0 }, { 0x43F00000, 0x3F400000 } }, // Record of Lodoss War (Fr) (PAL)
{ "MK-5102151", nullptr, { 0x3511A0, 0 }, { 0x3FC58577 } }, // Red Dog (PAL)
{ "HDR-0074", nullptr, { 0x1FF60C, 0x1FF610, 0x1FF5DC, 0 }, { 0x3F400000, 0x3F800000, 0x43DC0000 } }, //Rent a Hero n°1
// Resident Evil: Code Veronica (De) (PAL)
// Code 1-4 removes the black bars on top and bottom in FMV
{ "xxxxxxxxxx", nullptr, { 0x32A380, 0x383E18, 0x383E38, 0x383E58, 0x383E78, 0 },
{ 0x3F400000, 0x43F00000, 0, 0x43F00000, 0 } },
// Resident Evil: Code Veronica (Fr) (PAL)
// Code 1-4 removes the black bars on top and bottom in FMV
{ "T36806D 09", nullptr, { 0x32A380, 0x383E18, 0x383E38, 0x383E58, 0x383E78, 0 },
{ 0x3F400000, 0x43F00000, 0, 0x43F00000, 0 } },
// Resident Evil: Code Veronica (Sp) (PAL)
{ "xxxxxxxxxx", nullptr, { 0x32A3A0, /* 0x383E18, 0x383E38, 0x383E58, 0x383E78, */ 0 },
{ 0x3F400000, 0x43F00000, 0, 0x43F00000, 0 } },
// Resident Evil: Code Veronica (USA)
// Code 1-4 removes the black bars on top and bottom in FMV
{ "T1204N", nullptr, { 0x329E40, 0x3838D8, 0x3838F8, 0x383918, 0x383938, 0 },
{ 0x3F400000, 0x43F00000, 0, 0x43F00000, 0 } },
{ "T8107D 50", nullptr, { 0x0464FC, 0x046210, 0 }, { 0x3A888889, 0x44200000 } }, // Re-Volt (PAL) Code 1 is a render fix
{ "MK-5119250", nullptr, { 0x0C5EB4, 0 }, { 0x3A888889 } }, // Rez (PAL)
{ "T15122N", nullptr, { 0x8E7A80, 0x8E7AB4, 0 }, { 0x43E10000, 0x3FAAAAAB } }, // Ring, The - Terror's Realm (USA)
{ "MK-51010", nullptr, { 0x1A4D2C, 0x1A4D5C, 0 }, { 0x43F00000, 0x3F400000 } }, // Rippin' Riders (USA)
{ "HDR-0044", nullptr, { 0x298A94, 0x298AC4, 0 }, { 0x43F00000, 0x3F400000 } }, // Roommania #203 (JP)
{ "MK-5109250", nullptr, { 0x29E6C4, 0 }, { 0x3F400000 } }, // Samba De Amigo (PAL)
{ "T41301N", nullptr, { 0x77A178, 0 }, { 0x3F400000 } }, // Seventh Cross Evolution (USA)
{ "T8104D 58", nullptr, { 0x2C03F8, 0 }, { 0x44558000 } }, // Shadow Man (PAL)
{ "T-8106N", nullptr, { 0x2C03F4, 0 }, { 0x3F400000 } }, // Shadow Man (USA)
{ "MK-51048", nullptr, { 0x4AA4DC, 0x2B4E30, 0 }, { 0x3F400000, 0x3F400000 } }, // Seaman (USA)
{ "MK-5105350", nullptr, { 0x5D613C, 0 }, { 0x3F400000 } }, // Sega GT (PAL)
{ "MK-51096", nullptr, { 0x495050, 0 }, { 0x43700000 } }, // Sega Marine Fishing (USA)
// { "MK-51019", nullptr, { 0xB83A48, 0 }, { 0x3F400000 } }, // Sega Rally 2 (USA) not working?
// { "HDR0010", nullptr, { 0xBD9BA0, 0 }, { 0x3F400000 } }, // Sega Rally 2 (JP) not working?
{ "HDR-0151", nullptr, { 0xAF57DC, 0xAF580C, 0x2122A0, 0 },
{ 0x43F00000, 0x3F400000, 0x3F400000 } }, // SGGG – Segagaga (JP)
{ "MK-5105950", nullptr, { 0x231EF8, 0x1EF370, 0 }, { 0x43800000, 0x7C1EF400 } }, // Shenmue (PAL) code 1 reduces clipping
{ "MK-51059", nullptr, { 0x230250, 0 }, { 0x43800000 } }, // Shenmue (USA) Clipping
{ "HDR-0016", nullptr, { 0x22E8A0, 0x1EBE70, 0 }, { 0x43800000, 0x7C1EBF00 } }, // Shenmue (JP) code 1 reduces clipping
{ "MK-5118450", nullptr, { 0x31186C, 0 }, { 0x43800000 } }, // Shenmue II (PAL) 01160FF4 0000E100 for black bars in cutscenes
// Shenmue II (PAL) Alternative code without clipping or black bars. Might be demanding on real hardware.
// 02311880 C3A00000, 0227E198 35AA359E, 01160FF4 0000E100
{ "HDR-0164", nullptr, { 0x30D67C, 0 }, { 0x43700000 } }, // Shenmue II (JP) Clipping
{ "T9505D", nullptr, { 0xD1FB14, 0x096A4C, 0 }, { 0x3F400000, 0x3FAAAAAB } }, // Silent Scope (PAL) Choose 60Hz in game options
{ "MK-51052", " E ", { 0x502A84, 0 }, { 0x3F400000 } }, // Skies of Arcadia (PAL)
{ "MK-51052", " U ", { 0x599158, 0 }, { 0x3F400000 } }, // Skies of Arcadia (USA)
{ "T15104D 50", nullptr, { 0x17EF68, 0 }, { 0x43F00010 } }, // Slave Zero (PAL) Widescreen, but a bit zoomed in
{ "MK-5101050", nullptr, { 0x1A50EC, 0x1A511C, 0 }, { 0x43F00000, 0x3F400000 } }, // Snow Surfers (PAL)
{ "MK-5100050", nullptr, { 0x88F528, 0x88F55C, 0 }, { 0x43F00000, 0x3FA66666 } }, // Sonic Adventure (PAL)
{ "MK-51000", nullptr, { 0x88F5E8, 0x88F61C, 0 }, { 0x43F00000, 0x3FAAAAAB } }, // Sonic Adventure (USA)
{ "MK-51117", nullptr, { 0x28DEF8, 0x28DF28, 0 }, { 0x43F00000, 0x3f400000 } }, // Sonic Adventure 2 (USA)
{ "HDR-0165", nullptr, { 0x28DF28, 0x28DEF8, 0 }, { 0x3F400000, 0x43F00000 } }, // Sonic Adventure 2 (JP)
{ "MK-51060", nullptr, { 0x112A2C, 0 }, { 0x3F400000 } }, // Sonic Shuffle (US)
{ "MK-5106050", nullptr, { 0x110B4C, 0 }, { 0x3F400000 } }, // Sonic Shuffle (PAL)
{ "T9103M", nullptr, { 0x25C714, 0x25C744, 0 }, { 0x43F00000, 0x3F400000 } }, // Sorcerian - Shichisei Mahou no Shito
{ "T1401D 50", nullptr, { 0x2D6138, 0 }, { 0x3F400000 } }, // Soul Calibur (PAL)
{ "T1401N", nullptr, { 0x266C28, 0 }, { 0x3F400000 } }, // Soul Calibur (USA)
{ "T36802N", " E ", { 0x129FA0, 0x12A9BC, 0x1C9FDC, 0 },
{ 0x3EF55555, 0x3EF55555, 0x000000F0 } }, // Soul Reaver (PAL) Code 2 is a Render Fix
{ "HDR-0190", nullptr, { 0x14D3E0, 0 }, { 0x3F400000 } }, // Space Channel 5 Part 2 (JP)
{ "T1216M", nullptr, { 0x017C38, 0x17F00, 0 }, { 0x3A99999A, 0x3A99999A } }, // Spawn - In the Demon's Hand v1.003 (JP)
{ "T1216N", nullptr, { 0x017C58, 0x17F20, 0 }, { 0x3A99999A, 0x3A99999A } }, // Spawn - In the Demon's Hand v1.000 (US)
{ "T36816D 50", nullptr, { 0x017C78, 0x17F40, 0 }, { 0x3A99999A, 0x3A99999A } }, // Spawn - In the Demon's Hand v1.000 (EU)
// Star Wars Episode I Racer (USA)
// Code 1-4 removes the black bars on top and bottom in FMV
{ "T23001N", nullptr, { 0x17AE20, 0x29A96C, 0x29A98C, 0x29A9AC, 0x29A9CC, 0 },
{ 0x3F400000, 0x42900000, 0x42900000, 0x43CE0000, 0x43CE0000 } },
{ "T40206N", nullptr, { 0x43296C, 0 }, { 0x3F400000, 0 } }, // Super Magnetic Neo (US)
{ "T40206D 50", nullptr, { 0x43E34C, 0 }, { 0x3F400000, 0 } }, // Super Magnetic Neo (EU)
// { "T7014D 50", nullptr, { 0xE2B234, 0 }, { 0x3F800000 } }, // Super Runabout (PAL) doesn't work?
{ "T17721D 50", nullptr, { 0x45CED4, 0 }, { 0x3F400000 } }, // Surf Rocket Racers (PAL) alt: 021EBF40 3F400000
{ "T17703D 50", nullptr, { 0xCD8950, 0 }, { 0x3F111111 } }, // Suzuki Alstare Extreme Racing
{ "T36807D 05", nullptr, { 0x140F74, 0x140FA4, 0 }, { 0x43FA0000, 0x3F400000 } }, // Sword of Bersek (PAL)
{ "T-36805N", nullptr, { 0x13F1C4, 0x13F194, 0 }, { 0x3F400000, 0x43F00000 } }, // Sword of Bersek (USA)
{ "MK-51186", nullptr, { 0x4A19B0, 0 }, { 0x43700000 } }, // Tennis 2K2 (USA)
{ "T15123N", nullptr, { 0x29B7BC, 0 }, { 0x3F400000 } }, // Test Drive Le Mans (USA) doesn't work?
{ "T20801M", nullptr, { 0x1AAC80, 0x1AACB0, 0 }, { 0x43F00000, 0x3F400000 } }, // Tetris 4D (JP)
{ "MK-5101153", nullptr, { 0x14EFA8, 0x14EFD8, 0 }, { 0x43F00000, 0x3F400000 } }, // Timestalkers (PAL)
{ "T7009D50", nullptr, { 0x39173C, 0 }, { 0x3F400000 } }, // Tech Romancer (PAL)
{ "T35402M", nullptr, { 0x315370, 0x3153A0, 0 }, { 0x43F00000, 0x3F400000 } }, // Tokyo Bus Guide (JP) doesn't work?
{ "T40201D 50", nullptr, { 0x1D9F10, 0 }, { 0x3F400000 } }, // Tokyo Highway Challenge (PAL)
{ "T40210D 50", nullptr, { 0x21E4F8, 0 }, { 0x43700000 } }, // Tokyo Highway Challenge 2 (PAL)
{ "xxxxxxxxxx", nullptr, { 0x21DEF8, 0 }, { 0x3F400000 } }, // Tokyo Street Racer 2 (USA)
// { "T36804D05", nullptr, { 0xB75E28, 0 }, { 0x3EC00000 } }, // Tomb Raider: The Last Revelation (UK) (PAL) clipping, use hex patch instead
{ "T13008D 05", nullptr, { 0x1D7C20, 0 }, { 0x3FA66666 } }, // Tony Hawk's Pro Skater 2 (PAL)
{ "T13006N", nullptr, { 0x1D77A0, 0 }, { 0x3FA66666 } }, // Tony Hawk's Pro Skater 2 (USA)
{ "MK-5102050", nullptr, { 0x0D592C, 0 }, { 0x3FD00000 } }, // Toy Commander (PAL)
{ "xxxxxxxxxx", nullptr, { 0x469FCC, 0x469FFC, 0 }, { 0x44700000, 0x3F400000 } }, // Toyota Doricatch Series: Land Cruiser 100/Cygnus
{ "MK-5109505", nullptr, { 0x1B2718, 0 }, { 0x3F400000 } }, // UEFA Dream Soccer (PAL)
{ "T40203D 50", nullptr, { 0x1D74E8, 0x1D7518, 0 }, { 0x43F00000, 0x3F400000 } }, // Ultimate Fighting Championship (PAL)
{ "T40204N", nullptr, { 0x1A9684, 0 }, { 0x3F400000 } }, // Ultimate Fighting Championship (USA) problems with cam in game
{ "T-8110D-50", nullptr, { 0x0C6B90, 0x0C6B94, 0 }, { 0x43F00000, 0x43870000 } }, // Vanishing Point (PAL)
// { "MK-5109450", nullptr, { 0x244134, 0x7A73B8, 0x7830D8, 0x7A74B8, 0x783138, 0x7A85A0, 0x6C7928, 0x6C7930, 0x6C7948, 0x6C7950, 0 },
//crash { 0x43F00000, 0x3F9C932E, 0x3F9C932E, 0x3F9C932E, 0x3F9C932E, 0x3F400000, 0, 0, 0, 0 } }, // Virtua Athlete 2K (PAL)
{ "MK-5100150", nullptr, { 0x19D718, 0 }, { 0x43700000 } }, // Virtua Fighter 3 TB (PAL)
{ "HDR-0002", nullptr, { 0x199FB0, 0 }, { 0x43700000 } }, // Virtua Fighter 3 TB (JP)
{ "MK-5105450", nullptr, { 0x456378, 0 }, { 0x43700000 } }, // Virtua Tennis (v1.001) (PAL)
{ "MK-51054", nullptr, { 0x450A90, 0 }, { 0x43700000 } }, // Virtua Tennis (USA)
{ "MK-5118650", nullptr, { 0x4A4A20, 0 }, { 0x43700000 } }, // Virtua Tennis 2 (PAL)
// { "T0000", nullptr, { 0x3A514C, 0x3A6170, 0 }, { 0x3F400000, 0x00000356 } }, // Volgarr the Viking. Not working
{ "xxxxxxxxxx", nullptr, { 0x20BB68, 0x1ACBD0, 0x1B9ADC, 0 }, // Code 1 reduces clipping. Code 2 fixes the clock.
{ 0x43700000, 0x7C1ACC60, 0x3F400000 } }, // What's Shenmue (JP)
{ "T40504D 50", nullptr, { 0x75281C, 0 }, { 0x3F400000 } }, // Wetrix+ (PAL) not working?
{ "MK-51152", nullptr, { 0x014E90, 0 }, { 0x43700000 } }, // World Series Baseball 2K2 (USA)
{ "T20401M", nullptr, { 0x323CB0, 0x1ACBD0, 0x1B9ADC, 0 }, // Code 1 reduces clipping. Code 2 fixes the HUD.
{ 0x43700000, 0x1ACC60, 0x3F400000 } }, // Zero Gunner 2 (JP)
{ "MK-5103850", nullptr, { 0x9484E8, 0 }, { 0x43700000 } }, // Zombie Revenge (PAL)
{ "MK-51038", nullptr, { 0x948058, 0 }, { 0x43700000 } }, // Zombie Revenge (USA)
{ "HDR-0026", nullptr, { 0x948B18, 0 }, { 0x43700000 } }, // Zombie Revenge (JP)
{ "T43301M", nullptr, { 0x4B0218, 0 }, { 0x3F400000 } }, // Zusar Vasar (JP)
{ nullptr },
};
const WidescreenCheat CheatManager::naomi_widescreen_cheats[] =
{
{ "KNIGHTS OF VALOUR THE 7 SPIRITS", nullptr, { 0x475B70, 0x475B40, 0 }, { 0x3F400000, 0x43F00000 } },
{ "Dolphin Blue", nullptr, { 0x3F2E2C, 0x3F2190, 0x3F2E6C, 0x3F215C, 0 },
{ 0x43B90000, 0x3FAA9FBE, 0x43B90000, 0x43F00000 } },
{ "METAL SLUG 6", nullptr, { 0xE93478, 0xE9347C, 0 }, { 0x3F400000, 0x3F8872B0 } },
{ "TOY FIGHTER", nullptr, { 0x133E58, 0 }, { 0x43700000 } },
{ "LUPIN THE THIRD -THE SHOOTING-", nullptr, { 0x045490 }, { 0x3F400000 } },
{ nullptr },
};
CheatManager cheatManager;
void CheatManager::loadCheatFile(const std::string& filename)
{
#ifndef LIBRETRO
FILE* cheatfile = nowide::fopen(filename.c_str(), "r");
if (cheatfile == nullptr)
{
WARN_LOG(COMMON, "Cannot open cheat file '%s'", filename.c_str());
return;
}
emucfg::ConfigFile cfg;
cfg.parse(cheatfile);
fclose(cheatfile);
int count = cfg.get_int("", "cheats", 0);
cheats.clear();
for (int i = 0; count == 0 || i < count; i++)
{
std::string prefix = "cheat" + std::to_string(i) + "_";
Cheat cheat{};
cheat.description = cfg.get("", prefix + "desc", "Cheat " + std::to_string(i + 1));
cheat.address = cfg.get_int("", prefix + "address", -1);
if (count == 0 && cheat.address == (u32)-1)
break;
if (cheat.address >= RAM_SIZE)
{
WARN_LOG(COMMON, "Invalid address %x", cheat.address);
continue;
}
cheat.type = (Cheat::Type)cfg.get_int("", prefix + "cheat_type", (int)Cheat::Type::disabled);
cheat.size = 1 << cfg.get_int("", prefix + "memory_search_size", 0);
cheat.value = cfg.get_int("", prefix + "value", cheat.value);
cheat.repeatCount = cfg.get_int("", prefix + "repeat_count", cheat.repeatCount);
cheat.repeatValueIncrement = cfg.get_int("", prefix + "repeat_add_to_value", cheat.repeatValueIncrement);
cheat.repeatAddressIncrement = cfg.get_int("", prefix + "repeat_add_to_address", cheat.repeatAddressIncrement);
cheat.enabled = cfg.get_bool("", prefix + "enable", false);
cheat.destAddress = cfg.get_int("", prefix + "dest_address", 0);
if (cheat.destAddress >= RAM_SIZE)
{
WARN_LOG(COMMON, "Invalid address %x", cheat.destAddress);
continue;
}
cheat.valueMask = cfg.get_int("", prefix + "address_bit_position", 0);
if (cheat.type != Cheat::Type::disabled)
cheats.push_back(cheat);
}
active = !cheats.empty();
INFO_LOG(COMMON, "%d cheats loaded", (int)cheats.size());
cfgSaveStr("cheats", gameId, filename);
#endif
}
void CheatManager::reset(const std::string& gameId)
{
if (this->gameId != gameId)
{
cheats.clear();
active = false;
this->gameId = gameId;
#ifndef LIBRETRO
std::string cheatFile = cfgLoadStr("cheats", gameId, "");
if (!cheatFile.empty())
loadCheatFile(cheatFile);
#endif
}
widescreen_cheat = nullptr;
if (!config::WidescreenGameHacks)
return;
if (settings.platform.system == DC_PLATFORM_DREAMCAST)
{
for (int i = 0; widescreen_cheats[i].game_id != nullptr; i++)
{
if (!strcmp(gameId.c_str(), widescreen_cheats[i].game_id)
&& (widescreen_cheats[i].area_or_version == nullptr
|| !strncmp(ip_meta.area_symbols, widescreen_cheats[i].area_or_version, sizeof(ip_meta.area_symbols))
|| !strncmp(ip_meta.product_version, widescreen_cheats[i].area_or_version, sizeof(ip_meta.product_version))))
{
widescreen_cheat = &widescreen_cheats[i];
NOTICE_LOG(COMMON, "Applying widescreen hack to game %s", gameId.c_str());
break;
}
}
}
else
{
for (int i = 0; naomi_widescreen_cheats[i].game_id != nullptr; i++)
{
if (!strcmp(gameId.c_str(), naomi_widescreen_cheats[i].game_id))
{
widescreen_cheat = &naomi_widescreen_cheats[i];
NOTICE_LOG(COMMON, "Applying widescreen hack to game %s", gameId.c_str());
break;
}
}
}
if (widescreen_cheat == nullptr)
return;
for (size_t i = 0; i < ARRAY_SIZE(widescreen_cheat->addresses) && widescreen_cheat->addresses[i] != 0; i++)
verify(widescreen_cheat->addresses[i] < RAM_SIZE);
}
u32 CheatManager::readRam(u32 addr, u32 bits)
{
switch (bits)
{
case 8:
default:
return ReadMem8_nommu(0x8C000000 + addr);
case 16:
return ReadMem16_nommu(0x8C000000 + addr);
case 32:
return ReadMem32_nommu(0x8C000000 + addr);
}
}
void CheatManager::writeRam(u32 addr, u32 value, u32 bits)
{
switch (bits)
{
case 8:
default:
WriteMem8_nommu(0x8C000000 + addr, (u8)value);
break;
case 16:
WriteMem16_nommu(0x8C000000 + addr, (u16)value);
break;
case 32:
WriteMem32_nommu(0x8C000000 + addr, value);
break;
}
}
void CheatManager::apply()
{
if (widescreen_cheat != nullptr)
{
for (size_t i = 0; i < ARRAY_SIZE(widescreen_cheat->addresses) && widescreen_cheat->addresses[i] != 0; i++)
writeRam(widescreen_cheat->addresses[i], widescreen_cheat->values[i], 32);
}
if (active && !settings.network.online)
{
bool skipCheat = false;
for (const Cheat& cheat : cheats)
{
if (skipCheat) {
skipCheat = false;
continue;
}
if (!cheat.enabled)
continue;
bool setValue = false;
u32 valueToSet = 0;
switch (cheat.type)
{
case Cheat::Type::disabled:
default:
break;
case Cheat::Type::setValue:
setValue = true;
valueToSet = cheat.value;
break;
case Cheat::Type::increase:
setValue = true;
valueToSet = readRam(cheat.address, cheat.size) + cheat.value;
break;
case Cheat::Type::decrease:
setValue = true;
valueToSet = readRam(cheat.address, cheat.size) - cheat.value;
break;
case Cheat::Type::runNextIfEq:
skipCheat = readRam(cheat.address, cheat.size) != cheat.value;
break;
case Cheat::Type::runNextIfNeq:
skipCheat = readRam(cheat.address, cheat.size) == cheat.value;
break;
case Cheat::Type::runNextIfGt:
skipCheat = readRam(cheat.address, cheat.size) <= cheat.value;
break;
case Cheat::Type::runNextIfLt:
skipCheat = readRam(cheat.address, cheat.size) >= cheat.value;
break;
case Cheat::Type::copy:
for (u32 i = 0; i < cheat.repeatCount; i++)
writeRam(cheat.destAddress + i, readRam(cheat.address + i, cheat.size), cheat.size);
break;
}
if (setValue)
{
u32 address = cheat.address;
for (u32 repeat = 0; repeat < cheat.repeatCount; repeat++)
{
if (cheat.size < 8)
{
u8 curVal = readRam(address, 8);
for (int i = 0; i < 8; i++)
{
int bitmask = 1 << i;
if ((cheat.valueMask & bitmask) == 0)
// keep current bit value
valueToSet = (valueToSet & ~bitmask) | (curVal & bitmask);
}
}
writeRam(address, valueToSet, cheat.size);
address += cheat.repeatAddressIncrement * cheat.size / 8;
valueToSet += cheat.repeatValueIncrement;
}
}
}
}
}
static std::vector<u32> parseCodes(const std::string& s)
{
std::vector<u32> codes;
std::string curCode;
for (u8 c : s)
{
if (std::isxdigit(c))
{
curCode += c;
if (curCode.length() == 8)
{
codes.push_back(strtol(curCode.c_str(), nullptr, 16));
curCode.clear();
}
}
else if (!curCode.empty())
throw FlycastException("Invalid cheat code");
}
if (!curCode.empty())
{
if (curCode.length() != 8)
throw FlycastException("Invalid cheat code");
codes.push_back(strtol(curCode.c_str(), nullptr, 16));
}
return codes;
}
void CheatManager::addGameSharkCheat(const std::string& name, const std::string& s)
{
std::vector<u32> codes = parseCodes(s);
Cheat conditionCheat;
unsigned conditionLimit = 0;
for (unsigned i = 0; i < codes.size(); i++)
{
if (i < conditionLimit)
cheats.push_back(conditionCheat);
Cheat cheat{};
cheat.description = name;
u32 code = (codes[i] & 0xff000000) >> 24;
switch (code)
{
case 0:
case 1:
case 2:
{
// 8/16/32-bit write
if (i + 1 >= codes.size())
throw FlycastException("Missing value");
cheat.type = Cheat::Type::setValue;
cheat.size = code == 0 ? 8 : code == 1 ? 16 : 32;
cheat.address = codes[i] & 0x00ffffff;
cheat.value = codes[++i];
cheats.push_back(cheat);
}
break;
case 3:
{
u32 subcode = (codes[i] & 0x00ff0000) >> 16;
switch (subcode)
{
case 0:
{
// Group write
int count = codes[i] & 0xffff;
if (i + count + 1 >= codes.size())
throw FlycastException("Missing values");
cheat.type = Cheat::Type::setValue;
cheat.size = 32;
cheat.address = codes[++i] & 0x00ffffff;
for (int j = 0; j < count; j++)
{
if (j == 1)
cheat.description += " (cont'd)";
cheat.value = codes[++i];
cheats.push_back(cheat);
cheat.address += 4;
if (j < count - 1 && i < conditionLimit)
cheats.push_back(conditionCheat);
}
}
break;
case 1:
case 2:
{
// 8-bit inc/decrement
if (i + 1 >= codes.size())
throw FlycastException("Missing value");
cheat.type = subcode == 1 ? Cheat::Type::increase : Cheat::Type::decrease;
cheat.size = 8;
cheat.value = codes[i] & 0xff;
cheat.address = codes[++i] & 0x00ffffff;
cheats.push_back(cheat);
}
break;
case 3:
case 4:
{
// 16-bit inc/decrement
if (i + 1 >= codes.size())
throw FlycastException("Missing value");
cheat.type = subcode == 3 ? Cheat::Type::increase : Cheat::Type::decrease;
cheat.size = 16;
cheat.value = codes[i] & 0xffff;
cheat.address = codes[++i] & 0x00ffffff;
cheats.push_back(cheat);
}
break;
case 5:
case 6:
{
// 32-bit inc/decrement
if (i + 2 >= codes.size())
throw FlycastException("Missing address or value");
cheat.type = subcode == 5 ? Cheat::Type::increase : Cheat::Type::decrease;
cheat.size = 32;
cheat.address = codes[++i] & 0x00ffffff;
cheat.value = codes[++i];
cheats.push_back(cheat);
}
break;
default:
throw FlycastException("Unsupported cheat type");
}
}
break;
case 4:
{
// 32-bit repeat write
if (i + 2 >= codes.size())
throw FlycastException("Missing count or value");
cheat.type = Cheat::Type::setValue;
cheat.size = 32;
cheat.address = codes[i] & 0x00ffffff;
cheat.repeatCount = codes[++i] >> 16;
cheat.repeatAddressIncrement = codes[i] & 0xffff;
cheat.value = codes[++i];
cheats.push_back(cheat);
}
break;
case 5:
{
// copy bytes
if (i + 2 >= codes.size())
throw FlycastException("Missing count or destination address");
cheat.type = Cheat::Type::copy;
cheat.size = 8;
cheat.address = codes[i] & 0x00ffffff;
cheat.destAddress = codes[++i] & 0x00ffffff;
cheat.repeatCount = codes[++i];
cheats.push_back(cheat);
}
break;
// TODO 7 change decryption type
// TODO 0xb delay applying codes
// TODO 0xc global enable test
case 0xd:
{
// enable next code if eq/neq/lt/gt
if (i + 1 >= codes.size())
throw FlycastException("Missing count or destination address");
cheat.size = 16;
cheat.address = codes[i] & 0x00ffffff;
switch (codes[++i] >> 16)
{
case 0:
cheat.type = Cheat::Type::runNextIfEq;
break;
case 1:
cheat.type = Cheat::Type::runNextIfNeq;
break;
case 2:
cheat.type = Cheat::Type::runNextIfLt;
break;
case 3:
cheat.type = Cheat::Type::runNextIfGt;
break;
default:
throw FlycastException("Unsupported conditional code");
}
cheat.value = codes[i] & 0xffff;
cheats.push_back(cheat);
}
break;
case 0xe:
{
// multiline enable codes if eq/neq/lt/gt
if (i + 1 >= codes.size())
throw FlycastException("Missing test address");
cheat.size = 16;
cheat.value = codes[i] & 0xffff;
conditionLimit = i + 1 + ((codes[i] >> 16) & 0xff);
switch (codes[++i] >> 24)
{
case 0:
cheat.type = Cheat::Type::runNextIfEq;
break;
case 1:
cheat.type = Cheat::Type::runNextIfNeq;
break;
case 2:
cheat.type = Cheat::Type::runNextIfLt;
break;
case 3:
cheat.type = Cheat::Type::runNextIfGt;
break;
default:
throw FlycastException("Unsupported conditional code");
}
cheat.address = codes[i] & 0x00ffffff;
conditionCheat = cheat;
}
break;
default:
throw FlycastException("Unsupported cheat type");
}
}
active = !cheats.empty();
#ifndef LIBRETRO
std::string path = cfgLoadStr("cheats", gameId, "");
if (path == "")
{
path = get_game_save_prefix() + ".cht";
cfgSaveStr("cheats", gameId, path);
}
saveCheatFile(path);
#endif
}
void CheatManager::saveCheatFile(const std::string& filename)
{
#ifndef LIBRETRO
emucfg::ConfigFile cfg;
cfg.set_int("", "cheats", cheats.size());
int i = 0;
for (const Cheat& cheat : cheats)
{
std::string prefix = "cheat" + std::to_string(i) + "_";
cfg.set_int("", prefix + "address", cheat.address);
cfg.set_int("", prefix + "address_bit_position", cheat.valueMask);
cfg.set_bool("", prefix + "big_endian", false);
cfg.set_int("", prefix + "cheat_type", (int)cheat.type);
cfg.set("", prefix + "code", "");
cfg.set("", prefix + "desc", cheat.description);
cfg.set_int("", prefix + "dest_address", cheat.destAddress);
cfg.set_bool("", prefix + "enable", false); // force all cheats disabled at start
cfg.set_int("", prefix + "handler", 1);
int memSize;
switch (cheat.size) {
case 1:
memSize = 0;
break;
case 2:
memSize = 1;
break;
case 4:
memSize = 2;
break;
case 8:
memSize = 3;
break;
case 16:
memSize = 4;
break;
case 32:
default:
memSize = 5;
break;
}
cfg.set_int("", prefix + "memory_search_size", memSize);
cfg.set_int("", prefix + "value", cheat.value);
cfg.set_int("", prefix + "repeat_count", cheat.repeatCount);
cfg.set_int("", prefix + "repeat_add_to_value", cheat.repeatValueIncrement);
cfg.set_int("", prefix + "repeat_add_to_address", cheat.repeatAddressIncrement);
i++;
}
FILE *fp = nowide::fopen(filename.c_str(), "w");
if (fp == nullptr)
throw FlycastException("Can't save cheat file");
cfg.save(fp);
fclose(fp);
#endif
}
+89
View File
@@ -0,0 +1,89 @@
/*
Created on: Sep 23, 2019
Copyright 2019 flyinghead
This file is part of Flycast.
Flycast is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Flycast is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Flycast. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include "types.h"
struct WidescreenCheat
{
const char *game_id;
const char *area_or_version;
u32 addresses[16];
u32 values[16];
};
struct Cheat
{
enum class Type {
disabled,
setValue,
increase,
decrease,
runNextIfEq,
runNextIfNeq,
runNextIfGt,
runNextIfLt,
copy
};
Type type = Type::disabled;
std::string description;
bool enabled = false;
u32 size = 0;
u32 address = 0;
u32 value = 0;
u8 valueMask = 0;
u32 repeatCount = 1;
u32 repeatValueIncrement = 0;
u32 repeatAddressIncrement = 0;
u32 destAddress = 0;
};
class CheatManager
{
public:
void reset(const std::string& gameId);
void apply();
size_t cheatCount() const { return cheats.size(); }
const std::string& cheatDescription(size_t index) const { return cheats[index].description; }
bool cheatEnabled(size_t index) const { return cheats[index].enabled; }
void enableCheat(size_t index, bool enabled) { cheats[index].enabled = enabled; }
void loadCheatFile(const std::string& filename);
void saveCheatFile(const std::string& filename);
// Returns true if using 16:9 anamorphic screen ratio
bool isWidescreen() const { return widescreen_cheat != nullptr; }
void addGameSharkCheat(const std::string& name, const std::string& s);
private:
u32 readRam(u32 addr, u32 bits);
void writeRam(u32 addr, u32 value, u32 bits);
static const WidescreenCheat widescreen_cheats[];
static const WidescreenCheat naomi_widescreen_cheats[];
const WidescreenCheat *widescreen_cheat = nullptr;
bool active = false;
std::vector<Cheat> cheats;
std::string gameId;
friend class CheatManagerTest_TestLoad_Test;
friend class CheatManagerTest_TestGameShark_Test;
friend class CheatManagerTest_TestSave_Test;
};
extern CheatManager cheatManager;
-58
View File
@@ -1,58 +0,0 @@
#LOCAL_PATH:=
#MFLAGS := -marm -march=armv7-a -mtune=cortex-a8 -mfpu=vfpv3-d16 -mfloat-abi=softfp
#ASFLAGS := -march=armv7-a -mfpu=vfp-d16 -mfloat-abi=softfp
#LDFLAGS := -g -Wl,-Map,$(notdir $@).map,--gc-sections -Wl,-O3 -Wl,--sort-common
RZDCY_SRC_DIR ?= $(call my-dir)
RZDCY_MODULES := cfg/ hw/arm7/ hw/aica/ hw/holly/ hw/ hw/gdrom/ hw/maple/ \
hw/mem/ hw/pvr/ hw/sh4/ hw/sh4/interpr/ hw/sh4/modules/ plugins/ profiler/ oslib/ \
hw/extdev/ hw/arm/ imgread/ linux/ ./ deps/zlib/ deps/chdr/ deps/crypto/ deps/libelf/ deps/chdpsr/ arm_emitter/ \
deps/libzip/ deps/libpng/ rend/
ifndef NO_REC
RZDCY_MODULES += hw/sh4/dyna/
endif
ifndef NOT_ARM
RZDCY_MODULES += rec-ARM/
endif
ifndef NO_REND
RZDCY_MODULES += rend/gles/
else
RZDCY_MODULES += rend/norend/
endif
ifdef FOR_ANDROID
RZDCY_MODULES += android/ deps/libandroid/
endif
ifdef FOR_LINUX
ifdef USE_SDL
RZDCY_MODULES += sdl/
else
RZDCY_MODULES += linux-dist/
endif
endif
RZDCY_FILES := $(foreach dir,$(addprefix $(RZDCY_SRC_DIR)/,$(RZDCY_MODULES)),$(wildcard $(dir)*.cpp))
RZDCY_FILES += $(foreach dir,$(addprefix $(RZDCY_SRC_DIR)/,$(RZDCY_MODULES)),$(wildcard $(dir)*.c))
RZDCY_FILES += $(foreach dir,$(addprefix $(RZDCY_SRC_DIR)/,$(RZDCY_MODULES)),$(wildcard $(dir)*.S))
ifdef FOR_PANDORA
RZDCY_CXXFLAGS := \
$(CFLAGS) -c -g -O3 -I$(RZDCY_SRC_DIR) -I$(RZDCY_SRC_DIR)/deps \
-DRELEASE -DPANDORA\
-march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp \
-frename-registers -fsingle-precision-constant -ffast-math \
-ftree-vectorize -fomit-frame-pointer -fno-exceptions -fno-rtti -std=gnu++11
else
RZDCY_CXXFLAGS := \
$(CFLAGS) -c -g -O3 -I$(RZDCY_SRC_DIR) -I$(RZDCY_SRC_DIR)/deps \
-D_ANDROID -DRELEASE -DTARGET_BEAGLE\
-march=armv7-a -mtune=cortex-a9 -mfpu=vfpv3-d16 \
-frename-registers -fsingle-precision-constant -ffast-math \
-ftree-vectorize -fomit-frame-pointer -fno-exceptions -fno-rtti -std=gnu++11
endif
+324
View File
@@ -0,0 +1,324 @@
/*
Copyright 2021 flyinghead
This file is part of Flycast.
Flycast is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Flycast is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Flycast. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include "types.h"
#include "emulator.h"
#include "hw/sh4/sh4_if.h"
#include "hw/sh4/sh4_mem.h"
#include "hw/sh4/sh4_interpreter.h"
#include "cfg/option.h"
#include <array>
#include <signal.h>
#include <map>
#ifndef SIGTRAP
#define SIGTRAP 5
#endif
#ifndef SIGBUS
#define SIGBUS 7
#endif
const std::array<Sh4RegType, 59> Sh4RegList {
reg_r0,
reg_r1,
reg_r2,
reg_r3,
reg_r4,
reg_r5,
reg_r6,
reg_r7,
reg_r8,
reg_r9,
reg_r10,
reg_r11,
reg_r12,
reg_r13,
reg_r14,
reg_r15,
reg_nextpc,
reg_pr,
reg_gbr,
reg_vbr,
reg_mach,
reg_macl,
reg_sr_status,
reg_fpul,
reg_fpscr,
reg_fr_0, reg_fr_1, reg_fr_2, reg_fr_3, reg_fr_4, reg_fr_5, reg_fr_6, reg_fr_7,
reg_fr_8, reg_fr_9, reg_fr_10, reg_fr_11, reg_fr_12, reg_fr_13, reg_fr_14, reg_fr_15,
reg_ssr,
reg_spc,
// correct?
reg_r0, reg_r1, reg_r2, reg_r3, reg_r4, reg_r5, reg_r6, reg_r7,
reg_r0_Bank, reg_r1_Bank, reg_r2_Bank, reg_r3_Bank, reg_r4_Bank, reg_r5_Bank, reg_r6_Bank, reg_r7_Bank,
};
class DebugAgent
{
public:
void doContinue(u32 pc = 1)
{
if (pc != 1)
Sh4cntx.pc = pc;
emu.start();
}
void step()
{
bool restoreBreakpoint = removeMatchpoint(0, Sh4cntx.pc, 2);
u32 savedPc = Sh4cntx.pc;
emu.step();
if (restoreBreakpoint)
insertMatchpoint(0, savedPc, 2);
}
int readAllRegs(u32 **regs)
{
static std::array<u32, Sh4RegList.size()> allregs;
for (u32 i = 0; i < Sh4RegList.size(); i++)
{
if (Sh4RegList[i] == reg_sr_status)
allregs[i] = sh4_sr_GetFull();
else if (Sh4RegList[i] != NoReg)
allregs[i] = *GetRegPtr(Sh4RegList[i]);
}
*regs = &allregs[0];
return allregs.size();
}
void writeAllRegs(const std::vector<u32>& regs)
{
for (u32 i = 0; i < Sh4RegList.size(); i++)
if (Sh4RegList[i] != NoReg)
*GetRegPtr(Sh4RegList[i]) = regs[i];
}
u32 readReg(u32 regNum)
{
if (regNum >= Sh4RegList.size())
return 0;
Sh4RegType reg = Sh4RegList[regNum];
if (reg == reg_sr_status)
return sh4_sr_GetFull();
if (reg != NoReg)
return *GetRegPtr(reg);
return 0;
}
void writeReg(u32 regNum, u32 value)
{
if (regNum >= Sh4RegList.size())
return;
Sh4RegType reg = Sh4RegList[regNum];
if (reg == reg_sr_status)
sh4_sr_SetFull(value);
else if (reg != NoReg)
*GetRegPtr(reg) = value;
}
const u8 *readMem(u32 addr, u32 len)
{
static std::vector<u8> data;
data.resize(len);
u8 *p = &data[0];
while (len > 0)
{
if (len >= 4 && (addr & 3) == 0)
{
*(u32 *)p = ReadMem32_nommu(addr);
addr += 4;
len -= 4;
p += 4;
}
else if (len >= 2 && (addr & 1) == 0)
{
*(u16 *)p = ReadMem16_nommu(addr);
addr += 2;
len -= 2;
p += 2;
}
else
{
*p++ = ReadMem8_nommu(addr);
addr++;
len--;
}
}
return &data[0];
}
void writeMem(u32 addr, const std::vector<u8>& data)
{
const u8 *p = &data[0];
u32 len = data.size();
while (len > 0)
{
if (len >= 4 && (addr & 3) == 0)
{
WriteMem32_nommu(addr, *(u32 *)p);
addr += 4;
len -= 4;
p += 4;
}
else if (len >= 2 && (addr & 3) == 0)
{
WriteMem16_nommu(addr, *(u16 *)p);
addr += 2;
len -= 2;
p += 2;
}
else
{
WriteMem8_nommu(addr, *p++);
addr++;
len--;
}
}
}
bool insertMatchpoint(char type, u32 addr, u32 len)
{
if (type == 0 && len != 2) {
WARN_LOG(COMMON, "insertMatchpoint: length != 2: %d", len);
return false;
}
// TODO other matchpoint types
if (breakpoints.find(addr) != breakpoints.end())
return true;
breakpoints[addr] = Breakpoint(type, addr);
breakpoints[addr].savedOp = ReadMem16_nommu(addr);
WriteMem16_nommu(addr, 0xC308); // trapa #0x20
return true;
}
bool removeMatchpoint(char type, u32 addr, u32 len)
{
if (type == 0 && len != 2) {
WARN_LOG(COMMON, "removeMatchpoint: length != 2: %d", len);
return false;
}
auto it = breakpoints.find(addr);
if (it == breakpoints.end())
return false;
WriteMem16_nommu(addr, it->second.savedOp);
breakpoints.erase(it);
return true;
}
u32 interrupt()
{
config::DynarecEnabled = false;
exception = SIGINT;
emu.stop();
return exception;
}
// called on the emu thread
void debugTrap(u32 event)
{
exception = findException(event);
Sh4cntx.pc -= 2; // FIXME delay slot
}
void postDebugTrap()
{
// needed to join the emu thread since debugTrap() is called by it
emu.stop();
}
u32 currentException()
{
return exception;
}
void restart()
{
emu.unloadGame();
emu.loadGame(settings.content.path);
emu.start();
}
void detach()
{
emu.start();
}
void kill()
{
dc_exit();
}
void resetAgent()
{
stack.clear();
}
int findException(u32 event)
{
switch (event)
{
case 0x0A0: // Instruction/data TLB protection violation exception (read)
case 0x0C0: // Data TLB protection violation exception (write)
return SIGSEGV;
case 0x0E0: // Instruction/data address error (read)
case 0x100: // data address error (write)
return SIGBUS;
case 0x160: // trapa
case 0x1E0: // User break before/after instruction execution
return SIGTRAP;
case 0x180: // General illegal instruction exception
case 0x1A0: // Slot illegal instruction exception
return SIGILL;
case 0x120: // FPU exception
case 0x800: // General FPU disable exception
case 0x820: // Slot FPU disable exception
return SIGFPE;
default:
return SIGABRT;
}
}
const u32 *getStack(u32& size)
{
verify(!Sh4cntx.CpuRunning);
size = stack.size() * 8;
return (const u32 *)&stack[0];
}
void subroutineCall()
{
subroutineReturn();
stack.push_back(std::make_pair(Sh4cntx.pc, Sh4cntx.r[15]));
}
void subroutineReturn()
{
while (!stack.empty() && Sh4cntx.r[15] >= stack.back().second)
stack.pop_back();
}
u32 exception = 0;
struct Breakpoint {
Breakpoint() = default;
Breakpoint(u16 type, u32 addr) : addr(addr), type(type) { }
u32 addr = 0;
u16 type = 0;
u16 savedOp = 0;
};
std::map<u32, Breakpoint> breakpoints;
std::vector<std::pair<u32, u32>> stack;
};
+885
View File
@@ -0,0 +1,885 @@
/*
Copyright 2021 flyinghead
This file is part of Flycast.
Flycast is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Flycast is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Flycast. If not, see <https://www.gnu.org/licenses/>.
*/
#include "types.h"
#ifdef GDB_SERVER
#include "gdb_server.h"
#include "debug_agent.h"
#include "network/net_platform.h"
#include <stdexcept>
#include <thread>
#include <chrono>
#include <mutex>
#define SERVER_PORT 3263
namespace debugger {
static void emuEventCallback(Event event, void *);
class GdbServer
{
public:
struct Error : public std::runtime_error {
Error(const char *reason) : std::runtime_error(reason) {}
};
void init()
{
if (VALID(serverSocket))
return;
serverSocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
if (!VALID(serverSocket))
throw Error("gdb: Cannot create server socket");
int option = 1;
setsockopt(serverSocket, SOL_SOCKET, SO_REUSEADDR, (const char *)&option, sizeof(option));
struct sockaddr_in serveraddr;
memset(&serveraddr, 0, sizeof(serveraddr));
serveraddr.sin_family = AF_INET;
serveraddr.sin_port = htons(SERVER_PORT);
if (::bind(serverSocket, (struct sockaddr *)&serveraddr, sizeof(serveraddr)) < 0)
{
closesocket(serverSocket);
throw Error("gdb: bind() failed");
}
if (::listen(serverSocket, 5) < 0)
{
closesocket(serverSocket);
throw Error("gdb: listen() failed");
}
EventManager::listen(Event::Resume, emuEventCallback);
EventManager::listen(Event::Terminate, emuEventCallback);
}
void term()
{
EventManager::unlisten(Event::Resume, emuEventCallback);
EventManager::unlisten(Event::Terminate, emuEventCallback);
stop();
if (VALID(clientSocket))
{
closesocket(clientSocket);
clientSocket = INVALID_SOCKET;
}
if (VALID(serverSocket))
{
closesocket(serverSocket);
serverSocket = INVALID_SOCKET;
}
}
void run()
{
DEBUG_LOG(COMMON, "GdbServer starting");
thread = std::thread(&GdbServer::serverThread, this);
}
void stop()
{
if (thread.joinable())
{
DEBUG_LOG(COMMON, "GdbServer stopping");
agent.resetAgent();
stopRequested = true;
thread.join();
}
}
bool isRunning() const {
return thread.joinable();
}
// called on the emu thread
void debugTrap(u32 event)
{
if (!attached)
return;
agent.debugTrap(event);
reportException();
postDebugTrapNeeded = true;
throw Stop();
}
private:
const u32 EXCEPT_NONE = 1;
void serverThread()
{
while (!stopRequested)
{
fd_set fds;
FD_ZERO(&fds);
sock_t max_fd = serverSocket;
FD_SET(serverSocket, &fds);
if (VALID(clientSocket))
{
max_fd = std::max(max_fd, clientSocket);
FD_SET(clientSocket, &fds);
}
timeval tv;
tv.tv_sec = 0;
tv.tv_usec = 100 * 1000;
if (::select(max_fd + 1, &fds, nullptr, nullptr, &tv) > 0)
{
if (FD_ISSET(serverSocket, &fds))
{
try {
acceptClientConnection();
} catch (const Error& e) {
ERROR_LOG(COMMON, "%s", e.what());
closesocket(serverSocket);
serverSocket = INVALID_SOCKET;
break;
}
}
else if (FD_ISSET(clientSocket, &fds))
{
readCommand();
}
}
}
if (VALID(clientSocket))
{
closesocket(clientSocket);
clientSocket = INVALID_SOCKET;
}
attached = false;
stopRequested = false;
}
void acceptClientConnection()
{
if (VALID(clientSocket))
closesocket(clientSocket);
sockaddr_in src_addr{};
socklen_t addr_len = sizeof(src_addr);
clientSocket = ::accept(serverSocket, (sockaddr *)&src_addr, &addr_len);
if (!VALID(clientSocket))
{
if (get_last_error() != L_EAGAIN && get_last_error() != L_EWOULDBLOCK)
throw Error("accept failed");
}
else
{
NOTICE_LOG(NETWORK, "gdb: client connection");
attached = true;
agent.interrupt();
}
}
void readCommand()
{
if (postDebugTrapNeeded)
{
postDebugTrapNeeded = false;
agent.postDebugTrap();
}
try {
std::string packet = recvPacket();
if (packet.empty())
return;
DEBUG_LOG(NETWORK, "gdb: recv %s", packet.c_str());
switch (packet[0])
{
case '!': // Enable extended mode
sendPacket("OK");
break;
case '?': // Sent when connection is first established to query the reason the target halted
reportException();
break;
case 'A': // Initialized argv[] array passed into program. not supported
sendPacket("E01");
break;;
case 'b': // Change the serial line speed to baud. deprecated
break;
case 'B': // Set or clear a breakpoint at addr. deprecated
break;
case 'c': // Continue at addr, which is the address to resume.
// If addr is omitted, resume at current address
sendContinue(packet);
break;
case 'C': // Continue with signal sig
sendContinue(packet);
break;
case 'd': // Toggle debug flag. deprecated
break;
case 'D': // Detach GDB from the remote system
sendPacket("OK");
agent.detach();
break;
case 'F': // File-I/O protocol extension not currently supported
break;;
case 'g': // Read general registers
readAllRegs();
break;
case 'G': // Write general registers
writeAllRegs(packet);
break;
case 'H': // Set thread for subsequent operations
sendPacket("OK");
break;
case 'i': // Step the remote target by a single clock cycle
case 'I': // Signal, then cycle step
// not supported
sendPacket("");
break;
case 'k': // Kill request. Stop process/system
agent.kill();
break;
case 'm': // Read length addressable memory units
readMem(packet);
break;
case 'M': // Write length addressable memory units
writeMem(packet);
break;
case 'p': // Read the value of register
readReg(packet);
break;
case 'P': // Write register
writeReg(packet);
break;
case 'q': // General query packets
query(packet);
break;
case 'Q': // General set packets
set(packet);
break;
case 'r': // Reset the entire system. Deprecated (use 'R' instead)
break;
case 'R': // Restart the program being debugged.
restart();
break;
case 's': // Single step
step(EXCEPT_NONE);
break;
case 'S': // Step with signal
step();
break;
case 't': // Search backwards. unsupported
break;
case 'T': // Find out if the thread is alive
sendPacket("OK");
break;
case 'v': // 'v' packets to control execution
vpacket(packet);
break;
case 'X': // Write binary data to memory
writeMemBin(packet);
break;
case 'z': // Remove a breakpoint/watchpoint.
removeMatchpoint(packet);
break;
case 'Z': // Insert a breakpoint/watchpoint.
insertMatchpoint(packet);
break;
case 3:
interrupt();
break;
default:
// Unknown commands are ignored
WARN_LOG(COMMON, "Unknown gdb command: %s", packet.c_str());
break;;
}
} catch (const Error& e) {
ERROR_LOG(COMMON, "%s", e.what());
closesocket(clientSocket);
clientSocket = INVALID_SOCKET;
attached = false;
}
}
void reportException()
{
char s[4];
sprintf(s, "S%02X", agent.currentException());
sendPacket(s);
}
void sendContinue(const std::string& pkt)
{
if (pkt[0] != 'c') {
WARN_LOG(COMMON, "Continue with signal not supported");
return;
}
if (pkt == "c")
agent.doContinue();
else
{
// Get the pc at which to resume
u32 addr;
if (sscanf(pkt.c_str(), "c%x", &addr) != 1)
{
WARN_LOG(COMMON, "Continue address invalid %s", pkt.c_str());
return;
}
agent.doContinue(addr);
}
}
void readAllRegs()
{
u32 *regs;
int c = agent.readAllRegs(&regs);
std::string outpkt;
for (int i = 0; i < c; i++)
outpkt += pack(regs[i]);
sendPacket(outpkt);
}
void writeAllRegs(const std::string& pkt)
{
std::vector<u32> regs;
for (auto it = pkt.begin() + 1; it <= pkt.end() - 8; it += 8)
regs.push_back(unpack(&*it, 8));
agent.writeAllRegs(regs);
sendPacket("OK");
}
void readMem(const std::string& pkt)
{
u32 addr;
u32 len;
if (sscanf(pkt.c_str(), "m%x,%x:", &addr, &len) != 2)
{
WARN_LOG(COMMON, "readMem: invalid packet %s", pkt.c_str());
sendPacket("E01");
return;
}
const u8 *mem = agent.readMem(addr, len);
std::string outpkt;
for (u32 i = 0; i < len; i++)
{
char s[3];
sprintf(s,"%02x", mem[i]);
outpkt += s;
}
sendPacket(outpkt);
}
void writeMem(const std::string& pkt)
{
u32 addr;
u32 len;
if (sscanf(pkt.c_str(), "M%x,%x:", &addr, &len) != 2)
{
WARN_LOG(COMMON, "writeMem: invalid packet %s", pkt.c_str());
sendPacket("E01");
return;
}
std::vector<u8> data(len);
const char *p = &pkt[pkt.find(':')] + 1;
for (u32 i = 0; i < len; i++, p += 2)
{
u32 b;
sscanf(p,"%2x", &b);
data[i] = (u8)b;
}
agent.writeMem(addr, data);
sendPacket("OK");
}
void writeMemBin(const std::string& pkt)
{
u32 addr;
u32 len;
if (sscanf(pkt.c_str(), "X%x,%x:", &addr, &len) != 2)
{
WARN_LOG(COMMON, "writeMemBin invalid command: %s", pkt.c_str());
sendPacket("E01");
return;
}
const char *p = &pkt[pkt.find(':')] + 1;
std::vector<u8> data;
data.reserve(pkt.length() - (p - &pkt[0]));
for (; p <= &pkt.back(); p++)
{
u8 b = *p;
if (b == '}')
{
b = *++p ^ 0x20;
}
data.push_back(b);
}
agent.writeMem(addr, data);
sendPacket("OK");
}
void readReg(const std::string& pkt)
{
u32 regNum;
if (sscanf(pkt.c_str(), "p%x", &regNum) != 1)
{
WARN_LOG(COMMON, "readReg: invalid packet %s", pkt.c_str());
sendPacket("E01");
return;
}
u32 v = agent.readReg(regNum);
sendPacket(pack(v));
}
void writeReg(const std::string& pkt)
{
u32 regNum;
char vstr[9];
if (sscanf(pkt.c_str(), "P%x=%8s", &regNum, vstr) != 2)
{
WARN_LOG(COMMON, "writeReg: invalid packet %s", pkt.c_str());
sendPacket("E01");
return;
}
agent.writeReg(regNum, unpack(vstr, 8));
sendPacket("OK");
}
void query(const std::string& pkt)
{
if (pkt == "qC")
// Return the current thread ID. 0 is "any thread"
sendPacket("QC0.01");
else if (pkt.rfind("qCRC", 0) == 0)
{
WARN_LOG(COMMON, "CRC compute not supported %s", pkt.c_str());
sendPacket("E01");
}
else if (pkt == "qfThreadInfo")
// Obtain a list of all active thread IDs (first call)
sendPacket("m0");
else if (pkt == "qsThreadInfo")
// Obtain a list of all active thread IDs (subsequent calls -> 'l' == end of list)
sendPacket("l");
else if (pkt.rfind("qGetTLSAddr:", 0) == 0)
// Fetch the address associated with thread local storage
sendPacket("");
else if (pkt.rfind("qL", 0) == 0)
// Obtain thread information. deprecated
sendPacket("qM001");
else if (pkt == "qOffsets")
// Get section offsets. Not supported
sendPacket("");
else if (pkt.rfind("qP", 0) == 0)
// Returns information on thread. deprecated
sendPacket("");
else if (pkt.rfind("qRcmd,", 0) == 0)
{
std::string customCmd;
for (const char *p = pkt.c_str() + 6; *p != '\0'; p += 2)
customCmd += (char)unpack(p, 2);
DEBUG_LOG(COMMON, "query: custom command %s", customCmd.c_str());
if (customCmd == "reset")
restart();
else if (customCmd == "stack")
{
u32 len;
const u32 *data = agent.getStack(len);
len /= 4;
char reply[len * 9 * 2 + 1];
char *r = reply;
for (u32 i = 0; i < len; i++)
{
char n[10];
sprintf(n, "%08x ", *data++);
for (char *p = n; *p != 0; p++)
{
*r++ = packnb((*p >> 4) & 0xf);
*r++ = packnb(*p & 0xf);
}
}
*r = 0;
sendPacket(reply);
}
else
sendPacket("");
}
else if (pkt.rfind("qSupported", 0) == 0)
// Tell the remote stub about features supported by GDB,
// and query the stub for features it supports
sendPacket("PacketSize=10000");
else if (pkt.rfind("qSymbol:", 0) == 0)
// Notify the target that GDB is prepared to serve symbol lookup requests
sendPacket("OK");
else if (pkt.rfind("qThreadExtraInfo,", 0) == 0)
{
// Obtain from the target OS a printable string description of thread attributes
char s[19];
sprintf(s, "%02x%02x%02x%02x%02x%02x%02x%02x%02x", 'R', 'u', 'n', 'n', 'a', 'b', 'l', 'e', 0);
sendPacket(std::string(s, 18));
}
else if (pkt.rfind("qXfer:", 0) == 0)
// Read uninterpreted bytes from the target’s special data area identified by the keyword object
sendPacket("");
else if (pkt.rfind("qAttached", 0) == 0)
// Return an indication of whether the remote server attached to an existing process
// or created a new process
sendPacket("1"); // existing process
else if (pkt.rfind("qTfV", 0) == 0)
// request data about trace state variables
sendPacket("");
else if (pkt.rfind("qTfP", 0) == 0)
// request data about tracepoints
sendPacket("");
else if (pkt.rfind("qTStatus", 0) == 0)
// Ask the stub if there is a trace experiment running right now
sendPacket("");
else
WARN_LOG(COMMON, "query not supported %s", pkt.c_str());
}
void set(const std::string& pkt)
{
if (pkt.rfind("QPassSignals:", 0) == 0)
// Passing signals not supported
sendPacket("");
else if (pkt.rfind("QTDP", 0) == 0
|| pkt.rfind("QFrame", 0) == 0
|| pkt.rfind("QTStart", 0) == 0
|| pkt.rfind("QTStop", 0) == 0
|| pkt.rfind("QTinit", 0) == 0
|| pkt.rfind("QTro", 0) == 0)
// No tracepoint feature supported
sendPacket("");
else
WARN_LOG(COMMON, "set not supported %s", pkt.c_str());
}
void vpacket(const std::string& pkt)
{
if (pkt.rfind("vAttach;", 0) == 0)
sendPacket("S05");
else if (pkt.rfind("vCont?", 0) == 0)
// not supported
sendPacket("vCont;s;c");
else if (pkt.rfind("vCont", 0) == 0)
// not supported
WARN_LOG(COMMON, "vCont not supported %s", pkt.c_str());
else if (pkt.rfind("vFile:", 0) == 0)
// not supported
sendPacket("");
else if (pkt.rfind("vFlashErase:", 0) == 0)
// not supported
sendPacket("E01");
else if (pkt.rfind("vFlashWrite:", 0) == 0)
// not supported
sendPacket("E01");
else if (pkt.rfind("vFlashDone:", 0) == 0)
// not supported
sendPacket("E01");
else if (pkt.rfind("vRun;", 0) == 0)
{
if (pkt != "vRun;")
WARN_LOG(COMMON, "unexpected vRun args ignored: %s", pkt.c_str());
agent.restart();
sendPacket("S05");
}
else if (pkt.rfind("vKill", 0) == 0)
{
sendPacket("OK");
agent.kill();
}
else if (pkt.rfind("vMustReplyEmpty", 0) == 0)
// Reply empty packet
sendPacket("");
else
WARN_LOG(COMMON, "unknown v packet: %s", pkt.c_str());
}
void restart()
{
agent.restart();
}
void step(u32 what = 0)
{
agent.step();
sendPacket("S05");
}
void insertMatchpoint(const std::string& pkt)
{
u32 type;
u32 addr;
u32 len;
if (sscanf(pkt.c_str(), "Z%1d,%x,%1d", &type, &addr, &len) != 3) {
WARN_LOG(COMMON, "insertMatchpoint: unknown packet: %s", pkt.c_str());
sendPacket("E01");
}
switch (type) {
case 0: // soft bp
if (agent.insertMatchpoint(0, addr, len))
sendPacket("OK");
else
sendPacket("E01");
break;
case 1: // hardware bp
sendPacket("");
break;
case 2: // write watchpoint
sendPacket("");
break;
case 3: // read watchpoint
sendPacket("");
break;
case 4: // access watchpoint
sendPacket("");
break;
default:
sendPacket("");
break;
}
}
void removeMatchpoint(const std::string& pkt)
{
u32 type;
u32 addr;
u32 len;
if (sscanf(pkt.c_str(), "z%1d,%x,%1d", &type, &addr, &len) != 3) {
WARN_LOG(COMMON, "removeMatchpoint: unknown packet: %s", pkt.c_str());
sendPacket("E01");
}
switch (type) {
case 0: // soft bp
if (agent.removeMatchpoint(0, addr, len))
sendPacket("OK");
else
sendPacket("E01");
break;
case 1: // hardware bp
sendPacket("");
break;
case 2: // write watchpoint
sendPacket("");
break;
case 3: // read watchpoint
sendPacket("");
break;
case 4: // access watchpoint
sendPacket("");
break;
default:
sendPacket("");
break;
}
}
void interrupt()
{
u32 signal = agent.interrupt();
char s[10];
sprintf(s, "S%02x", signal);
sendPacket(s);
}
char recvChar()
{
char c;
int rc = ::recv(clientSocket, &c, 1, 0);
if (rc <= 0)
throw Error("gdb: I/O error");
return c;
}
void sendChar(char c)
{
std::unique_lock<std::mutex> lock(outMutex);
int rc = ::send(clientSocket, &c, 1, 0);
if (rc <= 0)
throw Error("gdb: I/O error");
}
u8 unpack(char c)
{
c = std::tolower(c);
if (c <= '9')
return c - '0';
else
return c - 'a' + 10;
}
char packnb(u8 b)
{
if (b < 10)
return '0' + b;
else
return 'a' + b - 10;
}
std::string packb(u8 v)
{
std::string s(1, packnb((v >> 4) & 0xf));
s += packnb(v & 0xf);
return s;
}
std::string pack(u32 v)
{
return packb(v & 0xff) + packb((v >> 8) & 0xff)
+ packb((v >> 16) & 0xff) + packb((v >> 24) & 0xff);
}
u32 unpack(const char *s, int l)
{
u32 r = 0;
for (int i = 0; i < l && *s != '\0'; i += 2, s += 2)
{
r |= (unpack(s[0]) << 4 | unpack(s[1])) << (i * 4);
}
return r;
}
std::string recvPacket()
{
std::string pkt;
// look for start character ('$') or BREAK
char c = recvChar();
if (c == 3)
return std::string("\03");
if (c != '$')
return pkt;
// read until '#'
u8 checksum = 0;
while (!stopRequested)
{
c = recvChar();
if (c == '$')
{
checksum = 0;
pkt.clear();
continue;
}
if (c == '#')
break;
checksum += (u8)c;
pkt.push_back(c);
}
if (stopRequested)
{
pkt.clear();
return pkt;
}
u8 recvchk = unpack(recvChar()) << 4;
recvchk |= unpack(recvChar());
// If the checksums don't match print a warning, and put the
// negative ack back to the client. Otherwise put a positive ack.
if (checksum != recvchk)
{
sendChar('-'); // Failed checksum
return "";
}
else
{
sendChar('+'); // Successful transfer
return pkt;
}
}
void sendPacket(const std::string& pkt)
{ DEBUG_LOG(NETWORK, "gdb: sending pkt");
std::unique_lock<std::mutex> lock(outMutex);
std::string data{'$'};
u8 checksum = 0;
for (char c : pkt)
{
if (c == '$' || c == '#' || c == '*' || c == '}')
{
c ^= 0x20;
checksum += (u8)'}';
data.push_back('}');
}
checksum += (u8)c;
data.push_back(c);
}
data.push_back('#');
char s[9];
sprintf(s, "%02x", checksum);
data += s;
DEBUG_LOG(NETWORK, "gdb: sent %s", data.c_str());
int ret = ::send(clientSocket, data.c_str(), data.length(), 0);
if (ret < (int)data.length())
throw Error("I/O error");
}
bool stopRequested = false;
bool attached = false;
bool postDebugTrapNeeded = false;
sock_t serverSocket = INVALID_SOCKET;
sock_t clientSocket = INVALID_SOCKET;
std::thread thread;
std::mutex outMutex;
public:
DebugAgent agent;
};
static GdbServer gdbServer;
void init()
{
gdbServer.init();
}
void term()
{
gdbServer.term();
}
void debugTrap(u32 event)
{
gdbServer.debugTrap(event);
}
void subroutineCall()
{
gdbServer.agent.subroutineCall();
}
void subroutineReturn()
{
gdbServer.agent.subroutineReturn();
}
static void emuEventCallback(Event event, void *)
{
switch (event)
{
case Event::Resume:
if (!gdbServer.isRunning())
gdbServer.run();
break;
case Event::Terminate:
gdbServer.stop();
break;
default:
break;
}
}
}
#endif
+43
View File
@@ -0,0 +1,43 @@
/*
Copyright 2021 flyinghead
This file is part of Flycast.
Flycast is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
Flycast is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Flycast. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
namespace debugger {
// exception thrown in response to trap
struct Stop { };
#ifdef GDB_SERVER
void init();
void term();
void run();
void debugTrap(u32 event);
void subroutineCall();
void subroutineReturn();
#else
static inline void init() {}
static inline void term() {}
static inline void run() {}
static inline void debugTrap(u32 event) {}
static inline void subroutineCall() {}
static inline void subroutineReturn() {}
#endif
}
Submodule
+1
Submodule core/deps/SDL added at b424665e08.
Submodule core/deps/breakpad added at d2657e1267.
+23 -13
View File
@@ -11,7 +11,6 @@ unsigned long temp_value;
/////////////////////////////////////////////////////////////////////////////
unsigned long ask_type(FILE *fsource, long header_position)
{
@@ -42,8 +41,8 @@ unsigned long track_mode;
void CDI_read_track (FILE *fsource, image_s *image, track_s *track)
{
char TRACK_START_MARK[10] = { 0, 0, 0x01, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF };
char current_start_mark[10];
unsigned char TRACK_START_MARK[10] = { 0, 0, 0x01, 0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF };
unsigned char current_start_mark[10];
fread(&temp_value, 4, 1, fsource);
if (temp_value != 0)
@@ -80,7 +79,9 @@ void CDI_read_track (FILE *fsource, image_s *image, track_s *track)
case 0 : track->sector_size = 2048; break;
case 1 : track->sector_size = 2336; break;
case 2 : track->sector_size = 2352; break;
default: printf("Unsupported sector size");
case 4 : track->sector_size = 2448; break;
default: printf("Unsupported sector size. value %ld\n", track->sector_size_value);
break;
}
if (track->mode > 2) printf( "Unsupported format: Track mode not supported");
@@ -108,19 +109,28 @@ void CDI_get_tracks (FILE *fsource, image_s *image)
fread(&image->tracks, 2, 1, fsource);
}
void CDI_init (FILE *fsource, image_s *image, char *fsourcename)
bool CDI_init (FILE *fsource, image_s *image, const char *fsourcename)
{
fseek(fsource, 0L, SEEK_END);
image->length = ftell(fsource);
fseek(fsource, 0, SEEK_END);
image->length = ftell(fsource);
if (image->length < 8) printf( "Image file is too short");
if (image->length < 8)
{
printf("%s: Image file is too short\n", fsourcename);
return false;
}
fseek(fsource, image->length-8, SEEK_SET);
fread(&image->version, 4, 1, fsource);
fread(&image->header_offset, 4, 1, fsource);
fseek(fsource, image->length-8, SEEK_SET);
fread(&image->version, 4, 1, fsource);
fread(&image->header_offset, 4, 1, fsource);
// if (errno != 0) printf( fsourcename);
if (image->header_offset == 0) printf( "Bad image format");
if ((image->version != CDI_V2 && image->version != CDI_V3 && image->version != CDI_V35)
|| image->header_offset == 0)
{
printf("%s: Bad image format\n", fsourcename);
return false;
}
return true;
}
void CDI_get_sessions (FILE *fsource, image_s *image)
+5 -8
View File
@@ -1,8 +1,6 @@
#ifndef __CDI_H__
#define __CDI_H__
/* Basic structures */
typedef struct image_s
@@ -39,11 +37,10 @@ typedef struct track_s
#define CDI_V35 0x80000006
unsigned long ask_type(FILE *fsource, long header_position);
void CDI_init (FILE *fsource, image_s *image, char *fsourcename);
void CDI_get_sessions (FILE *fsource, image_s *image);
void CDI_get_tracks (FILE *fsource, image_s *image);
void CDI_read_track (FILE *fsource, image_s *image, track_s *track);
void CDI_skip_next_session (FILE *fsource, image_s *image);
bool CDI_init(FILE *fsource, image_s *image, const char *fsourcename);
void CDI_get_sessions(FILE *fsource, image_s *image);
void CDI_get_tracks(FILE *fsource, image_s *image);
void CDI_read_track(FILE *fsource, image_s *image, track_s *track);
void CDI_skip_next_session(FILE *fsource, image_s *image);
#endif
File diff suppressed because it is too large. Load diff
-20
View File
@@ -1,20 +0,0 @@
#include "types.h"
typedef u64 UINT64;
typedef u32 UINT32;
typedef u16 UINT16;
typedef u8 UINT8;
typedef s64 INT64;
typedef s32 INT32;
typedef s16 INT16;
typedef s8 INT8;
#ifndef INLINE
#define INLINE inline
#endif
#define core_file FILE
#define ARRAY_LENGTH(x) (sizeof(x)/sizeof(x[0]))
-239
View File
@@ -1,239 +0,0 @@
/*
* This code implements the MD5 message-digest algorithm.
* The algorithm is due to Ron Rivest. This code was
* written by Colin Plumb in 1993, no copyright is claimed.
* This code is in the public domain; do with it what you wish.
*
* Equivalent code is available from RSA Data Security, Inc.
* This code has been tested against that, and is equivalent,
* except that you don't need to include two pages of legalese
* with every copy.
*
* To compute the message digest of a chunk of bytes, declare an
* MD5Context structure, pass it to MD5Init, call MD5Update as
* needed on buffers full of bytes, and then call MD5Final, which
* will fill a supplied 16-byte array with the digest.
*
* Changed so as no longer to depend on Colin Plumb's `usual.h' header
* definitions; now uses stuff from dpkg's config.h.
* - Ian Jackson <[email protected]>.
* Still in the public domain.
*/
#include <string.h> /* for memcpy() */
#include "md5.h"
#ifndef LSB_FIRST
void
byteSwap(UWORD32 *buf, unsigned words)
{
md5byte *p = (md5byte *)buf;
do {
*buf++ = (UWORD32)((unsigned)p[3] << 8 | p[2]) << 16 |
((unsigned)p[1] << 8 | p[0]);
p += 4;
} while (--words);
}
#else
#define byteSwap(buf,words)
#endif
/*
* Start MD5 accumulation. Set bit count to 0 and buffer to mysterious
* initialization constants.
*/
void
MD5Init(struct MD5Context *ctx)
{
ctx->buf[0] = 0x67452301;
ctx->buf[1] = 0xefcdab89;
ctx->buf[2] = 0x98badcfe;
ctx->buf[3] = 0x10325476;
ctx->bytes[0] = 0;
ctx->bytes[1] = 0;
}
/*
* Update context to reflect the concatenation of another buffer full
* of bytes.
*/
void
MD5Update(struct MD5Context *ctx, md5byte const *buf, unsigned len)
{
UWORD32 t;
/* Update byte count */
t = ctx->bytes[0];
if ((ctx->bytes[0] = t + len) < t)
ctx->bytes[1]++; /* Carry from low to high */
t = 64 - (t & 0x3f); /* Space available in ctx->in (at least 1) */
if (t > len) {
memcpy((md5byte *)ctx->in + 64 - t, buf, len);
return;
}
/* First chunk is an odd size */
memcpy((md5byte *)ctx->in + 64 - t, buf, t);
byteSwap(ctx->in, 16);
MD5Transform(ctx->buf, ctx->in);
buf += t;
len -= t;
/* Process data in 64-byte chunks */
while (len >= 64) {
memcpy(ctx->in, buf, 64);
byteSwap(ctx->in, 16);
MD5Transform(ctx->buf, ctx->in);
buf += 64;
len -= 64;
}
/* Handle any remaining bytes of data. */
memcpy(ctx->in, buf, len);
}
/*
* Final wrapup - pad to 64-byte boundary with the bit pattern
* 1 0* (64-bit count of bits processed, MSB-first)
*/
void
MD5Final(md5byte digest[16], struct MD5Context *ctx)
{
int count = ctx->bytes[0] & 0x3f; /* Number of bytes in ctx->in */
md5byte *p = (md5byte *)ctx->in + count;
/* Set the first char of padding to 0x80. There is always room. */
*p++ = 0x80;
/* Bytes of padding needed to make 56 bytes (-8..55) */
count = 56 - 1 - count;
if (count < 0) { /* Padding forces an extra block */
memset(p, 0, count + 8);
byteSwap(ctx->in, 16);
MD5Transform(ctx->buf, ctx->in);
p = (md5byte *)ctx->in;
count = 56;
}
memset(p, 0, count);
byteSwap(ctx->in, 14);
/* Append length in bits and transform */
ctx->in[14] = ctx->bytes[0] << 3;
ctx->in[15] = ctx->bytes[1] << 3 | ctx->bytes[0] >> 29;
MD5Transform(ctx->buf, ctx->in);
byteSwap(ctx->buf, 4);
memcpy(digest, ctx->buf, 16);
memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */
}
#ifndef ASM_MD5
/* The four core functions - F1 is optimized somewhat */
/* #define F1(x, y, z) (x & y | ~x & z) */
#define F1(x, y, z) (z ^ (x & (y ^ z)))
#define F2(x, y, z) F1(z, x, y)
#define F3(x, y, z) (x ^ y ^ z)
#define F4(x, y, z) (y ^ (x | ~z))
/* This is the central step in the MD5 algorithm. */
#define MD5STEP(f,w,x,y,z,in,s) \
(w += f(x,y,z) + in, w = (w<<s | w>>(32-s)) + x)
/*
* The core of the MD5 algorithm, this alters an existing MD5 hash to
* reflect the addition of 16 longwords of new data. MD5Update blocks
* the data and converts bytes into longwords for this routine.
*/
void
MD5Transform(UWORD32 buf[4], UWORD32 const in[16])
{
register UWORD32 a, b, c, d;
a = buf[0];
b = buf[1];
c = buf[2];
d = buf[3];
MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7);
MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12);
MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17);
MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22);
MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7);
MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12);
MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17);
MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22);
MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7);
MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12);
MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17);
MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22);
MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7);
MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12);
MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17);
MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22);
MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5);
MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9);
MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14);
MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20);
MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5);
MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9);
MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14);
MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20);
MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5);
MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9);
MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14);
MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20);
MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5);
MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9);
MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14);
MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20);
MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4);
MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11);
MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16);
MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23);
MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4);
MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11);
MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16);
MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23);
MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4);
MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11);
MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16);
MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23);
MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4);
MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11);
MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16);
MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23);
MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6);
MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10);
MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15);
MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21);
MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6);
MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10);
MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15);
MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21);
MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6);
MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10);
MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15);
MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21);
MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6);
MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10);
MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15);
MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21);
buf[0] += a;
buf[1] += b;
buf[2] += c;
buf[3] += d;
}
#endif
-42
View File
@@ -1,42 +0,0 @@
/*
* This is the header file for the MD5 message-digest algorithm.
* The algorithm is due to Ron Rivest. This code was
* written by Colin Plumb in 1993, no copyright is claimed.
* This code is in the public domain; do with it what you wish.
*
* Equivalent code is available from RSA Data Security, Inc.
* This code has been tested against that, and is equivalent,
* except that you don't need to include two pages of legalese
* with every copy.
*
* To compute the message digest of a chunk of bytes, declare an
* MD5Context structure, pass it to MD5Init, call MD5Update as
* needed on buffers full of bytes, and then call MD5Final, which
* will fill a supplied 16-byte array with the digest.
*
* Changed so as no longer to depend on Colin Plumb's `usual.h'
* header definitions; now uses stuff from dpkg's config.h
* - Ian Jackson <[email protected]>.
* Still in the public domain.
*/
#ifndef MD5_H
#define MD5_H
typedef unsigned int UWORD32;
#define md5byte unsigned char
struct MD5Context {
UWORD32 buf[4];
UWORD32 bytes[2];
UWORD32 in[16];
};
void MD5Init(struct MD5Context *context);
void MD5Update(struct MD5Context *context, md5byte const *buf, unsigned len);
void MD5Final(unsigned char digest[16], struct MD5Context *context);
void MD5Transform(UWORD32 buf[4], UWORD32 const in[16]);
#endif /* !MD5_H */
-387
View File
@@ -1,387 +0,0 @@
/* sha1.h
*
* The sha1 hash function.
*/
/* nettle, low-level cryptographics library
*
* Copyright 2001 Peter Gutmann, Andrew Kuchling, Niels Moeller
*
* The nettle library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version.
*
* The nettle library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with the nettle library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*/
#include "sha1.h"
#include <assert.h>
#include <stdlib.h>
#include <string.h>
static unsigned int READ_UINT32(const UINT8* data)
{
return ((UINT32)data[0] << 24) |
((UINT32)data[1] << 16) |
((UINT32)data[2] << 8) |
((UINT32)data[3]);
}
static void WRITE_UINT32(unsigned char* data, UINT32 val)
{
data[0] = (val >> 24) & 0xFF;
data[1] = (val >> 16) & 0xFF;
data[2] = (val >> 8) & 0xFF;
data[3] = (val >> 0) & 0xFF;
}
/* A block, treated as a sequence of 32-bit words. */
#define SHA1_DATA_LENGTH 16
/* The SHA f()-functions. The f1 and f3 functions can be optimized to
save one boolean operation each - thanks to Rich Schroeppel,
[email protected] for discovering this */
/* #define f1(x,y,z) ( ( x & y ) | ( ~x & z ) ) Rounds 0-19 */
#define f1(x,y,z) ( z ^ ( x & ( y ^ z ) ) ) /* Rounds 0-19 */
#define f2(x,y,z) ( x ^ y ^ z ) /* Rounds 20-39 */
/* #define f3(x,y,z) ( ( x & y ) | ( x & z ) | ( y & z ) ) Rounds 40-59 */
#define f3(x,y,z) ( ( x & y ) | ( z & ( x | y ) ) ) /* Rounds 40-59 */
#define f4(x,y,z) ( x ^ y ^ z ) /* Rounds 60-79 */
/* The SHA Mysterious Constants */
#define K1 0x5A827999L /* Rounds 0-19 */
#define K2 0x6ED9EBA1L /* Rounds 20-39 */
#define K3 0x8F1BBCDCL /* Rounds 40-59 */
#define K4 0xCA62C1D6L /* Rounds 60-79 */
/* SHA initial values */
#define h0init 0x67452301L
#define h1init 0xEFCDAB89L
#define h2init 0x98BADCFEL
#define h3init 0x10325476L
#define h4init 0xC3D2E1F0L
/* 32-bit rotate left - kludged with shifts */
#ifdef _MSC_VER
#define ROTL(n,X) _lrotl(X, n)
#else
#define ROTL(n,X) ( ( (X) << (n) ) | ( (X) >> ( 32 - (n) ) ) )
#endif
/* The initial expanding function. The hash function is defined over an
80-word expanded input array W, where the first 16 are copies of the input
data, and the remaining 64 are defined by
W[ i ] = W[ i - 16 ] ^ W[ i - 14 ] ^ W[ i - 8 ] ^ W[ i - 3 ]
This implementation generates these values on the fly in a circular
buffer - thanks to Colin Plumb, [email protected] for this
optimization.
The updated SHA changes the expanding function by adding a rotate of 1
bit. Thanks to Jim Gillogly, [email protected], and an anonymous contributor
for this information */
#define expand(W,i) ( W[ i & 15 ] = \
ROTL( 1, ( W[ i & 15 ] ^ W[ (i - 14) & 15 ] ^ \
W[ (i - 8) & 15 ] ^ W[ (i - 3) & 15 ] ) ) )
/* The prototype SHA sub-round. The fundamental sub-round is:
a' = e + ROTL( 5, a ) + f( b, c, d ) + k + data;
b' = a;
c' = ROTL( 30, b );
d' = c;
e' = d;
but this is implemented by unrolling the loop 5 times and renaming the
variables ( e, a, b, c, d ) = ( a', b', c', d', e' ) each iteration.
This code is then replicated 20 times for each of the 4 functions, using
the next 20 values from the W[] array each time */
#define subRound(a, b, c, d, e, f, k, data) \
( e += ROTL( 5, a ) + f( b, c, d ) + k + data, b = ROTL( 30, b ) )
/* Initialize the SHA values */
void
sha1_init(struct sha1_ctx *ctx)
{
/* Set the h-vars to their initial values */
ctx->digest[ 0 ] = h0init;
ctx->digest[ 1 ] = h1init;
ctx->digest[ 2 ] = h2init;
ctx->digest[ 3 ] = h3init;
ctx->digest[ 4 ] = h4init;
/* Initialize bit count */
ctx->count_low = ctx->count_high = 0;
/* Initialize buffer */
ctx->index = 0;
}
/* Perform the SHA transformation. Note that this code, like MD5, seems to
break some optimizing compilers due to the complexity of the expressions
and the size of the basic block. It may be necessary to split it into
sections, e.g. based on the four subrounds
Note that this function destroys the data area */
static void
sha1_transform(UINT32 *state, UINT32 *data)
{
UINT32 A, B, C, D, E; /* Local vars */
/* Set up first buffer and local data buffer */
A = state[0];
B = state[1];
C = state[2];
D = state[3];
E = state[4];
/* Heavy mangling, in 4 sub-rounds of 20 interations each. */
subRound( A, B, C, D, E, f1, K1, data[ 0] );
subRound( E, A, B, C, D, f1, K1, data[ 1] );
subRound( D, E, A, B, C, f1, K1, data[ 2] );
subRound( C, D, E, A, B, f1, K1, data[ 3] );
subRound( B, C, D, E, A, f1, K1, data[ 4] );
subRound( A, B, C, D, E, f1, K1, data[ 5] );
subRound( E, A, B, C, D, f1, K1, data[ 6] );
subRound( D, E, A, B, C, f1, K1, data[ 7] );
subRound( C, D, E, A, B, f1, K1, data[ 8] );
subRound( B, C, D, E, A, f1, K1, data[ 9] );
subRound( A, B, C, D, E, f1, K1, data[10] );
subRound( E, A, B, C, D, f1, K1, data[11] );
subRound( D, E, A, B, C, f1, K1, data[12] );
subRound( C, D, E, A, B, f1, K1, data[13] );
subRound( B, C, D, E, A, f1, K1, data[14] );
subRound( A, B, C, D, E, f1, K1, data[15] );
subRound( E, A, B, C, D, f1, K1, expand( data, 16 ) );
subRound( D, E, A, B, C, f1, K1, expand( data, 17 ) );
subRound( C, D, E, A, B, f1, K1, expand( data, 18 ) );
subRound( B, C, D, E, A, f1, K1, expand( data, 19 ) );
subRound( A, B, C, D, E, f2, K2, expand( data, 20 ) );
subRound( E, A, B, C, D, f2, K2, expand( data, 21 ) );
subRound( D, E, A, B, C, f2, K2, expand( data, 22 ) );
subRound( C, D, E, A, B, f2, K2, expand( data, 23 ) );
subRound( B, C, D, E, A, f2, K2, expand( data, 24 ) );
subRound( A, B, C, D, E, f2, K2, expand( data, 25 ) );
subRound( E, A, B, C, D, f2, K2, expand( data, 26 ) );
subRound( D, E, A, B, C, f2, K2, expand( data, 27 ) );
subRound( C, D, E, A, B, f2, K2, expand( data, 28 ) );
subRound( B, C, D, E, A, f2, K2, expand( data, 29 ) );
subRound( A, B, C, D, E, f2, K2, expand( data, 30 ) );
subRound( E, A, B, C, D, f2, K2, expand( data, 31 ) );
subRound( D, E, A, B, C, f2, K2, expand( data, 32 ) );
subRound( C, D, E, A, B, f2, K2, expand( data, 33 ) );
subRound( B, C, D, E, A, f2, K2, expand( data, 34 ) );
subRound( A, B, C, D, E, f2, K2, expand( data, 35 ) );
subRound( E, A, B, C, D, f2, K2, expand( data, 36 ) );
subRound( D, E, A, B, C, f2, K2, expand( data, 37 ) );
subRound( C, D, E, A, B, f2, K2, expand( data, 38 ) );
subRound( B, C, D, E, A, f2, K2, expand( data, 39 ) );
subRound( A, B, C, D, E, f3, K3, expand( data, 40 ) );
subRound( E, A, B, C, D, f3, K3, expand( data, 41 ) );
subRound( D, E, A, B, C, f3, K3, expand( data, 42 ) );
subRound( C, D, E, A, B, f3, K3, expand( data, 43 ) );
subRound( B, C, D, E, A, f3, K3, expand( data, 44 ) );
subRound( A, B, C, D, E, f3, K3, expand( data, 45 ) );
subRound( E, A, B, C, D, f3, K3, expand( data, 46 ) );
subRound( D, E, A, B, C, f3, K3, expand( data, 47 ) );
subRound( C, D, E, A, B, f3, K3, expand( data, 48 ) );
subRound( B, C, D, E, A, f3, K3, expand( data, 49 ) );
subRound( A, B, C, D, E, f3, K3, expand( data, 50 ) );
subRound( E, A, B, C, D, f3, K3, expand( data, 51 ) );
subRound( D, E, A, B, C, f3, K3, expand( data, 52 ) );
subRound( C, D, E, A, B, f3, K3, expand( data, 53 ) );
subRound( B, C, D, E, A, f3, K3, expand( data, 54 ) );
subRound( A, B, C, D, E, f3, K3, expand( data, 55 ) );
subRound( E, A, B, C, D, f3, K3, expand( data, 56 ) );
subRound( D, E, A, B, C, f3, K3, expand( data, 57 ) );
subRound( C, D, E, A, B, f3, K3, expand( data, 58 ) );
subRound( B, C, D, E, A, f3, K3, expand( data, 59 ) );
subRound( A, B, C, D, E, f4, K4, expand( data, 60 ) );
subRound( E, A, B, C, D, f4, K4, expand( data, 61 ) );
subRound( D, E, A, B, C, f4, K4, expand( data, 62 ) );
subRound( C, D, E, A, B, f4, K4, expand( data, 63 ) );
subRound( B, C, D, E, A, f4, K4, expand( data, 64 ) );
subRound( A, B, C, D, E, f4, K4, expand( data, 65 ) );
subRound( E, A, B, C, D, f4, K4, expand( data, 66 ) );
subRound( D, E, A, B, C, f4, K4, expand( data, 67 ) );
subRound( C, D, E, A, B, f4, K4, expand( data, 68 ) );
subRound( B, C, D, E, A, f4, K4, expand( data, 69 ) );
subRound( A, B, C, D, E, f4, K4, expand( data, 70 ) );
subRound( E, A, B, C, D, f4, K4, expand( data, 71 ) );
subRound( D, E, A, B, C, f4, K4, expand( data, 72 ) );
subRound( C, D, E, A, B, f4, K4, expand( data, 73 ) );
subRound( B, C, D, E, A, f4, K4, expand( data, 74 ) );
subRound( A, B, C, D, E, f4, K4, expand( data, 75 ) );
subRound( E, A, B, C, D, f4, K4, expand( data, 76 ) );
subRound( D, E, A, B, C, f4, K4, expand( data, 77 ) );
subRound( C, D, E, A, B, f4, K4, expand( data, 78 ) );
subRound( B, C, D, E, A, f4, K4, expand( data, 79 ) );
/* Build message digest */
state[0] += A;
state[1] += B;
state[2] += C;
state[3] += D;
state[4] += E;
}
static void
sha1_block(struct sha1_ctx *ctx, const UINT8 *block)
{
UINT32 data[SHA1_DATA_LENGTH];
int i;
/* Update block count */
if (!++ctx->count_low)
++ctx->count_high;
/* Endian independent conversion */
for (i = 0; i<SHA1_DATA_LENGTH; i++, block += 4)
data[i] = READ_UINT32(block);
sha1_transform(ctx->digest, data);
}
void
sha1_update(struct sha1_ctx *ctx,
unsigned length, const UINT8 *buffer)
{
if (ctx->index)
{ /* Try to fill partial block */
unsigned left = SHA1_DATA_SIZE - ctx->index;
if (length < left)
{
memcpy(ctx->block + ctx->index, buffer, length);
ctx->index += length;
return; /* Finished */
}
else
{
memcpy(ctx->block + ctx->index, buffer, left);
sha1_block(ctx, ctx->block);
buffer += left;
length -= left;
}
}
while (length >= SHA1_DATA_SIZE)
{
sha1_block(ctx, buffer);
buffer += SHA1_DATA_SIZE;
length -= SHA1_DATA_SIZE;
}
ctx->index = length;
if (length)
/* Buffer leftovers */
memcpy(ctx->block, buffer, length);
}
/* Final wrapup - pad to SHA1_DATA_SIZE-byte boundary with the bit pattern
1 0* (64-bit count of bits processed, MSB-first) */
void
sha1_final(struct sha1_ctx *ctx)
{
UINT32 data[SHA1_DATA_LENGTH];
int i;
int words;
i = ctx->index;
/* Set the first char of padding to 0x80. This is safe since there is
always at least one byte free */
assert(i < SHA1_DATA_SIZE);
ctx->block[i++] = 0x80;
/* Fill rest of word */
for( ; i & 3; i++)
ctx->block[i] = 0;
/* i is now a multiple of the word size 4 */
words = i >> 2;
for (i = 0; i < words; i++)
data[i] = READ_UINT32(ctx->block + 4*i);
if (words > (SHA1_DATA_LENGTH-2))
{ /* No room for length in this block. Process it and
* pad with another one */
for (i = words ; i < SHA1_DATA_LENGTH; i++)
data[i] = 0;
sha1_transform(ctx->digest, data);
for (i = 0; i < (SHA1_DATA_LENGTH-2); i++)
data[i] = 0;
}
else
for (i = words ; i < SHA1_DATA_LENGTH - 2; i++)
data[i] = 0;
/* There are 512 = 2^9 bits in one block */
data[SHA1_DATA_LENGTH-2] = (ctx->count_high << 9) | (ctx->count_low >> 23);
data[SHA1_DATA_LENGTH-1] = (ctx->count_low << 9) | (ctx->index << 3);
sha1_transform(ctx->digest, data);
}
void
sha1_digest(const struct sha1_ctx *ctx,
unsigned length,
UINT8 *digest)
{
unsigned i;
unsigned words;
unsigned leftover;
assert(length <= SHA1_DIGEST_SIZE);
words = length / 4;
leftover = length % 4;
for (i = 0; i < words; i++, digest += 4)
WRITE_UINT32(digest, ctx->digest[i]);
if (leftover)
{
UINT32 word;
unsigned j = leftover;
assert(i < _SHA1_DIGEST_LENGTH);
word = ctx->digest[i];
switch (leftover)
{
default:
/* this is just here to keep the compiler happy; it can never happen */
case 3:
digest[--j] = (word >> 8) & 0xff;
/* Fall through */
case 2:
digest[--j] = (word >> 16) & 0xff;
/* Fall through */
case 1:
digest[--j] = (word >> 24) & 0xff;
}
}
}
-63
View File
@@ -1,63 +0,0 @@
/* sha1.h
*
* The sha1 hash function.
*/
/* nettle, low-level cryptographics library
*
* Copyright 2001 Niels Moeller
*
* The nettle library is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 2.1 of the License, or (at your
* option) any later version.
*
* The nettle library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with the nettle library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
* MA 02111-1307, USA.
*/
#ifndef NETTLE_SHA1_H_INCLUDED
#define NETTLE_SHA1_H_INCLUDED
#include "../chdr/coretypes.h"
#define SHA1_DIGEST_SIZE 20
#define SHA1_DATA_SIZE 64
/* Digest is kept internally as 4 32-bit words. */
#define _SHA1_DIGEST_LENGTH 5
struct sha1_ctx
{
UINT32 digest[_SHA1_DIGEST_LENGTH]; /* Message digest */
UINT32 count_low, count_high; /* 64-bit block count */
UINT8 block[SHA1_DATA_SIZE]; /* SHA1 data buffer */
unsigned int index; /* index into buffer */
};
void
sha1_init(struct sha1_ctx *ctx);
void
sha1_update(struct sha1_ctx *ctx,
unsigned length,
const UINT8 *data);
void
sha1_final(struct sha1_ctx *ctx);
void
sha1_digest(const struct sha1_ctx *ctx,
unsigned length,
UINT8 *digest);
#endif /* NETTLE_SHA1_H_INCLUDED */
File diff suppressed because it is too large. Load diff
+618
View File
@@ -0,0 +1,618 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#ifndef _GGPONET_H_
#define _GGPONET_H_
#ifdef __cplusplus
extern "C" {
#endif
#include <stdarg.h>
// On windows, export at build time and import at runtime.
// ELF systems don't need an explicit export/import.
#ifdef _WIN32
# if defined(GGPO_SHARED_LIB)
# ifdef GGPO_SDK_EXPORT
# define GGPO_API __declspec(dllexport)
# else
# define GGPO_API __declspec(dllimport)
# endif
# else
# define GGPO_API
# endif
#else
# define GGPO_API
#endif
#ifdef __GNUC__
#if defined(_WIN32) && !defined(_WIN64)
#define __cdecl __attribute__((cdecl))
#elif !defined(__cdecl)
#define __cdecl
#endif
#endif
#define GGPO_MAX_PLAYERS 4
#define GGPO_MAX_PREDICTION_FRAMES 8
#define GGPO_MAX_SPECTATORS 32
#define GGPO_SPECTATOR_INPUT_INTERVAL 4
typedef struct GGPOSession GGPOSession;
typedef int GGPOPlayerHandle;
typedef enum {
GGPO_PLAYERTYPE_LOCAL,
GGPO_PLAYERTYPE_REMOTE,
GGPO_PLAYERTYPE_SPECTATOR,
} GGPOPlayerType;
/*
* The GGPOPlayer structure used to describe players in ggpo_add_player
*
* size: Should be set to the sizeof(GGPOPlayer)
*
* type: One of the GGPOPlayerType values describing how inputs should be handled
* Local players must have their inputs updated every frame via
* ggpo_add_local_inputs. Remote players values will come over the
* network.
*
* player_num: The player number. Should be between 1 and the number of players
* In the game (e.g. in a 2 player game, either 1 or 2).
*
* If type == GGPO_PLAYERTYPE_REMOTE:
*
* u.remote.ip_address: The ip address of the ggpo session which will host this
* player.
*
* u.remote.port: The port where udp packets should be sent to reach this player.
* All the local inputs for this session will be sent to this player at
* ip_address:port.
*
*/
typedef struct GGPOPlayer {
int size;
GGPOPlayerType type;
int player_num;
union {
struct {
bool _unused;
} local;
struct {
char ip_address[32];
unsigned short port;
} remote;
} u;
} GGPOPlayer;
typedef struct GGPOLocalEndpoint {
int player_num;
} GGPOLocalEndpoint;
#define GGPO_ERRORLIST \
GGPO_ERRORLIST_ENTRY(GGPO_OK, 0) \
GGPO_ERRORLIST_ENTRY(GGPO_ERRORCODE_SUCCESS, 0) \
GGPO_ERRORLIST_ENTRY(GGPO_ERRORCODE_GENERAL_FAILURE, -1) \
GGPO_ERRORLIST_ENTRY(GGPO_ERRORCODE_INVALID_SESSION, 1) \
GGPO_ERRORLIST_ENTRY(GGPO_ERRORCODE_INVALID_PLAYER_HANDLE, 2) \
GGPO_ERRORLIST_ENTRY(GGPO_ERRORCODE_PLAYER_OUT_OF_RANGE, 3) \
GGPO_ERRORLIST_ENTRY(GGPO_ERRORCODE_PREDICTION_THRESHOLD, 4) \
GGPO_ERRORLIST_ENTRY(GGPO_ERRORCODE_UNSUPPORTED, 5) \
GGPO_ERRORLIST_ENTRY(GGPO_ERRORCODE_NOT_SYNCHRONIZED, 6) \
GGPO_ERRORLIST_ENTRY(GGPO_ERRORCODE_IN_ROLLBACK, 7) \
GGPO_ERRORLIST_ENTRY(GGPO_ERRORCODE_INPUT_DROPPED, 8) \
GGPO_ERRORLIST_ENTRY(GGPO_ERRORCODE_PLAYER_DISCONNECTED, 9) \
GGPO_ERRORLIST_ENTRY(GGPO_ERRORCODE_TOO_MANY_SPECTATORS, 10) \
GGPO_ERRORLIST_ENTRY(GGPO_ERRORCODE_INVALID_REQUEST, 11) \
GGPO_ERRORLIST_ENTRY(GGPO_ERRORCODE_INPUT_SIZE_DIFF, 12) \
GGPO_ERRORLIST_ENTRY(GGPO_ERRORCODE_NETWORK_ERROR, 13) \
GGPO_ERRORLIST_ENTRY(GGPO_ERRORCODE_VERIFICATION_ERROR, 14)
#define GGPO_ERRORLIST_ENTRY(name, value) name = value,
typedef enum {
GGPO_ERRORLIST
} GGPOErrorCode;
#undef GGPO_ERRORLIST_ENTRY
#define GGPO_SUCCEEDED(result) ((result) == GGPO_ERRORCODE_SUCCESS)
#define GGPO_INVALID_HANDLE (-1)
/*
* The GGPOEventCode enumeration describes what type of event just happened.
*
* GGPO_EVENTCODE_CONNECTED_TO_PEER - Handshake with the game running on the
* other side of the network has been completed.
*
* GGPO_EVENTCODE_SYNCHRONIZING_WITH_PEER - Beginning the synchronization
* process with the client on the other end of the networking. The count
* and total fields in the u.synchronizing struct of the GGPOEvent
* object indicate progress.
*
* GGPO_EVENTCODE_SYNCHRONIZED_WITH_PEER - The synchronziation with this
* peer has finished.
*
* GGPO_EVENTCODE_RUNNING - All the clients have synchronized. You may begin
* sending inputs with ggpo_synchronize_inputs.
*
* GGPO_EVENTCODE_DISCONNECTED_FROM_PEER - The network connection on
* the other end of the network has closed.
*
* GGPO_EVENTCODE_TIMESYNC - The time synchronziation code has determined
* that this client is too far ahead of the other one and should slow
* down to ensure fairness. The u.timesync.frames_ahead parameter in
* the GGPOEvent object indicates how many frames the client is.
*
*/
typedef enum {
GGPO_EVENTCODE_CONNECTED_TO_PEER = 1000,
GGPO_EVENTCODE_SYNCHRONIZING_WITH_PEER = 1001,
GGPO_EVENTCODE_SYNCHRONIZED_WITH_PEER = 1002,
GGPO_EVENTCODE_RUNNING = 1003,
GGPO_EVENTCODE_DISCONNECTED_FROM_PEER = 1004,
GGPO_EVENTCODE_TIMESYNC = 1005,
GGPO_EVENTCODE_CONNECTION_INTERRUPTED = 1006,
GGPO_EVENTCODE_CONNECTION_RESUMED = 1007,
} GGPOEventCode;
/*
* The GGPOEvent structure contains an asynchronous event notification sent
* by the on_event callback. See GGPOEventCode, above, for a detailed
* explanation of each event.
*/
typedef struct {
GGPOEventCode code;
union {
struct {
GGPOPlayerHandle player;
} connected;
struct {
GGPOPlayerHandle player;
int count;
int total;
} synchronizing;
struct {
GGPOPlayerHandle player;
} synchronized;
struct {
GGPOPlayerHandle player;
} disconnected;
struct {
int frames_ahead;
} timesync;
struct {
GGPOPlayerHandle player;
int disconnect_timeout;
} connection_interrupted;
struct {
GGPOPlayerHandle player;
} connection_resumed;
} u;
} GGPOEvent;
/*
* The GGPOSessionCallbacks structure contains the callback functions that
* your application must implement. GGPO.net will periodically call these
* functions during the game. All callback functions must be implemented.
*/
typedef struct {
/*
* begin_game callback - This callback has been deprecated. You must
* implement it, but should ignore the 'game' parameter.
*/
bool (__cdecl *begin_game)(const char *game);
/*
* save_game_state - The client should allocate a buffer, copy the
* entire contents of the current game state into it, and copy the
* length into the *len parameter. Optionally, the client can compute
* a checksum of the data and store it in the *checksum argument.
*/
bool (__cdecl *save_game_state)(unsigned char **buffer, int *len, int *checksum, int frame);
/*
* load_game_state - GGPO.net will call this function at the beginning
* of a rollback. The buffer and len parameters contain a previously
* saved state returned from the save_game_state function. The client
* should make the current game state match the state contained in the
* buffer.
*/
bool (__cdecl *load_game_state)(unsigned char *buffer, int len);
/*
* log_game_state - Used in diagnostic testing. The client should use
* the ggpo_log function to write the contents of the specified save
* state in a human readible form.
*/
bool (__cdecl *log_game_state)(char *filename, unsigned char *buffer, int len);
/*
* free_buffer - Frees a game state allocated in save_game_state. You
* should deallocate the memory contained in the buffer.
*/
void (__cdecl *free_buffer)(void *buffer);
/*
* advance_frame - Called during a rollback. You should advance your game
* state by exactly one frame. Before each frame, call ggpo_synchronize_input
* to retrieve the inputs you should use for that frame. After each frame,
* you should call ggpo_advance_frame to notify GGPO.net that you're
* finished.
*
* The flags parameter is reserved. It can safely be ignored at this time.
*/
bool (__cdecl *advance_frame)(int flags);
/*
* on_event - Notification that something has happened. See the GGPOEventCode
* structure above for more information.
*/
bool (__cdecl *on_event)(GGPOEvent *info);
/*
* on_message - Delivers an application message. Allows arbitrary data to be
* exchanged with peers. This callback is optional.
*/
void (__cdecl *on_message)(unsigned char *msg, int len);
} GGPOSessionCallbacks;
/*
* The GGPONetworkStats function contains some statistics about the current
* session.
*
* network.send_queue_len - The length of the queue containing UDP packets
* which have not yet been acknowledged by the end client. The length of
* the send queue is a rough indication of the quality of the connection.
* The longer the send queue, the higher the round-trip time between the
* clients. The send queue will also be longer than usual during high
* packet loss situations.
*
* network.recv_queue_len - The number of inputs currently buffered by the
* GGPO.net network layer which have yet to be validated. The length of
* the prediction queue is roughly equal to the current frame number
* minus the frame number of the last packet in the remote queue.
*
* network.ping - The roundtrip packet transmission time as calcuated
* by GGPO.net. This will be roughly equal to the actual round trip
* packet transmission time + 2 the interval at which you call ggpo_idle
* or ggpo_advance_frame.
*
* network.kbps_sent - The estimated bandwidth used between the two
* clients, in kilobits per second.
*
* timesync.local_frames_behind - The number of frames GGPO.net calculates
* that the local client is behind the remote client at this instant in
* time. For example, if at this instant the current game client is running
* frame 1002 and the remote game client is running frame 1009, this value
* will mostly likely roughly equal 7.
*
* timesync.remote_frames_behind - The same as local_frames_behind, but
* calculated from the perspective of the remote player.
*
*/
typedef struct GGPONetworkStats {
struct {
int send_queue_len;
int recv_queue_len;
int ping;
int kbps_sent;
} network;
struct {
int local_frames_behind;
int remote_frames_behind;
} timesync;
struct {
int predicted_frames;
} sync;
} GGPONetworkStats;
/*
* ggpo_start_session --
*
* Used to being a new GGPO.net session. The ggpo object returned by ggpo_start_session
* uniquely identifies the state for this session and should be passed to all other
* functions.
*
* session - An out parameter to the new ggpo session object.
*
* cb - A GGPOSessionCallbacks structure which contains the callbacks you implement
* to help GGPO.net synchronize the two games. You must implement all functions in
* cb, even if they do nothing but 'return true';
*
* game - The name of the game. This is used internally for GGPO for logging purposes only.
*
* num_players - The number of players which will be in this game. The number of players
* per session is fixed. If you need to change the number of players or any player
* disconnects, you must start a new session.
*
* input_size - The size of the game inputs which will be passsed to ggpo_add_local_input.
*
* local_port - The port GGPO should bind to for UDP traffic.
*
* verification - Some optional data that will be matched with the peers during initial sync.
* Can be set to null if verification_size is zero. This can be used to check that all peers are
* running the same version of the application and of the game, are using the same settings, etc.
*
* verification_size - Size of the verification data. Can be set to zero to not exchange verification data.
* Maximum size is 256 bytes.
*/
GGPO_API GGPOErrorCode __cdecl ggpo_start_session(GGPOSession **session,
GGPOSessionCallbacks *cb,
const char *game,
int num_players,
int input_size,
unsigned short localport,
const void *verification,
int verification_size);
/*
* ggpo_add_player --
*
* Must be called for each player in the session (e.g. in a 3 player session, must
* be called 3 times).
*
* player - A GGPOPlayer struct used to describe the player.
*
* handle - An out parameter to a handle used to identify this player in the future.
* (e.g. in the on_event callbacks).
*/
GGPO_API GGPOErrorCode __cdecl ggpo_add_player(GGPOSession *session,
GGPOPlayer *player,
GGPOPlayerHandle *handle);
/*
* ggpo_start_synctest --
*
* Used to being a new GGPO.net sync test session. During a sync test, every
* frame of execution is run twice: once in prediction mode and once again to
* verify the result of the prediction. If the checksums of your save states
* do not match, the test is aborted.
*
* cb - A GGPOSessionCallbacks structure which contains the callbacks you implement
* to help GGPO.net synchronize the two games. You must implement all functions in
* cb, even if they do nothing but 'return true';
*
* game - The name of the game. This is used internally for GGPO for logging purposes only.
*
* num_players - The number of players which will be in this game. The number of players
* per session is fixed. If you need to change the number of players or any player
* disconnects, you must start a new session.
*
* input_size - The size of the game inputs which will be passsed to ggpo_add_local_input.
*
* frames - The number of frames to run before verifying the prediction. The
* recommended value is 1.
*
*/
GGPO_API GGPOErrorCode __cdecl ggpo_start_synctest(GGPOSession **session,
GGPOSessionCallbacks *cb,
const char *game,
int num_players,
int input_size,
int frames);
/*
* ggpo_start_spectating --
*
* Start a spectator session.
*
* cb - A GGPOSessionCallbacks structure which contains the callbacks you implement
* to help GGPO.net synchronize the two games. You must implement all functions in
* cb, even if they do nothing but 'return true';
*
* game - The name of the game. This is used internally for GGPO for logging purposes only.
*
* num_players - The number of players which will be in this game. The number of players
* per session is fixed. If you need to change the number of players or any player
* disconnects, you must start a new session.
*
* input_size - The size of the game inputs which will be passsed to ggpo_add_local_input.
*
* local_port - The port GGPO should bind to for UDP traffic.
*
* host_ip - The IP address of the host who will serve you the inputs for the game. Any
* player partcipating in the session can serve as a host.
*
* host_port - The port of the session on the host
*
* verification - Some optional data that will be matched with the peers during initial sync.
* Can be set to null if verification_size is zero. This can be used to check that all peers are
* running the same version of the application and of the game, are using the same settings, etc.
*
* verification_size - Size of the verification data. Can be set to zero to not exchange verification data.
* Maximum size is 256 bytes.
*/
GGPO_API GGPOErrorCode __cdecl ggpo_start_spectating(GGPOSession **session,
GGPOSessionCallbacks *cb,
const char *game,
int num_players,
int input_size,
unsigned short local_port,
char *host_ip,
unsigned short host_port,
const void *verification,
int verification_size);
/*
* ggpo_close_session --
* Used to close a session. You must call ggpo_close_session to
* free the resources allocated in ggpo_start_session.
*/
GGPO_API GGPOErrorCode __cdecl ggpo_close_session(GGPOSession *);
/*
* ggpo_set_frame_delay --
*
* Change the amount of frames ggpo will delay local input. Must be called
* before the first call to ggpo_synchronize_input.
*/
GGPO_API GGPOErrorCode __cdecl ggpo_set_frame_delay(GGPOSession *,
GGPOPlayerHandle player,
int frame_delay);
/*
* ggpo_idle --
* Should be called periodically by your application to give GGPO.net
* a chance to do some work. Most packet transmissions and rollbacks occur
* in ggpo_idle.
*
* timeout - The amount of time GGPO.net is allowed to spend in this function,
* in milliseconds.
*/
GGPO_API GGPOErrorCode __cdecl ggpo_idle(GGPOSession *,
int timeout);
/*
* ggpo_add_local_input --
*
* Used to notify GGPO.net of inputs that should be trasmitted to remote
* players. ggpo_add_local_input must be called once every frame for
* all player of type GGPO_PLAYERTYPE_LOCAL.
*
* player - The player handle returned for this player when you called
* ggpo_add_local_player.
*
* values - The controller inputs for this player.
*
* size - The size of the controller inputs. This must be exactly equal to the
* size passed into ggpo_start_session.
*/
GGPO_API GGPOErrorCode __cdecl ggpo_add_local_input(GGPOSession *,
GGPOPlayerHandle player,
void *values,
int size);
/*
* ggpo_synchronize_input --
*
* You should call ggpo_synchronize_input before every frame of execution,
* including those frames which happen during rollback.
*
* values - When the function returns, the values parameter will contain
* inputs for this frame for all players. The values array must be at
* least (size * players) large.
*
* size - The size of the values array.
*
* disconnect_flags - Indicated whether the input in slot (1 << flag) is
* valid. If a player has disconnected, the input in the values array for
* that player will be zeroed and the i-th flag will be set. For example,
* if only player 3 has disconnected, disconnect flags will be 8 (i.e. 1 << 3).
*/
GGPO_API GGPOErrorCode __cdecl ggpo_synchronize_input(GGPOSession *,
void *values,
int size,
int *disconnect_flags);
/*
* ggpo_disconnect_player --
*
* Disconnects a remote player from a game. Will return GGPO_ERRORCODE_PLAYER_DISCONNECTED
* if you try to disconnect a player who has already been disconnected.
*/
GGPO_API GGPOErrorCode __cdecl ggpo_disconnect_player(GGPOSession *,
GGPOPlayerHandle player);
/*
* ggpo_advance_frame --
*
* You should call ggpo_advance_frame to notify GGPO.net that you have
* advanced your gamestate by a single frame. You should call this everytime
* you advance the gamestate by a frame, even during rollbacks. GGPO.net
* may call your save_state callback before this function returns.
*/
GGPO_API GGPOErrorCode __cdecl ggpo_advance_frame(GGPOSession *);
/*
* ggpo_get_network_stats --
*
* Used to fetch some statistics about the quality of the network connection.
*
* player - The player handle returned from the ggpo_add_player function you used
* to add the remote player.
*
* stats - Out parameter to the network statistics.
*/
GGPO_API GGPOErrorCode __cdecl ggpo_get_network_stats(GGPOSession *,
GGPOPlayerHandle player,
GGPONetworkStats *stats);
/*
* ggpo_set_disconnect_timeout --
*
* Sets the disconnect timeout. The session will automatically disconnect
* from a remote peer if it has not received a packet in the timeout window.
* You will be notified of the disconnect via a GGPO_EVENTCODE_DISCONNECTED_FROM_PEER
* event.
*
* Setting a timeout value of 0 will disable automatic disconnects.
*
* timeout - The time in milliseconds to wait before disconnecting a peer.
*/
GGPO_API GGPOErrorCode __cdecl ggpo_set_disconnect_timeout(GGPOSession *,
int timeout);
/*
* ggpo_set_disconnect_notify_start --
*
* The time to wait before the first GGPO_EVENTCODE_NETWORK_INTERRUPTED timeout
* will be sent.
*
* timeout - The amount of time which needs to elapse without receiving a packet
* before the GGPO_EVENTCODE_NETWORK_INTERRUPTED event is sent.
*/
GGPO_API GGPOErrorCode __cdecl ggpo_set_disconnect_notify_start(GGPOSession *,
int timeout);
/*
* ggpo_log --
*
* Used to write to the ggpo.net log. In the current versions of the
* SDK, a log file is only generated if the "quark.log" environment
* variable is set to 1. This will change in future versions of the
* SDK.
*/
GGPO_API void __cdecl ggpo_log(GGPOSession *,
const char *fmt, ...);
/*
* ggpo_logv --
*
* A varargs compatible version of ggpo_log. See ggpo_log for
* more details.
*/
GGPO_API void __cdecl ggpo_logv(GGPOSession *,
const char *fmt,
va_list args);
/*
* ggpo_send_message --
*
* Sends application-specific data to other peers. The message is
* delivered by the on_user_message callback.
* If spectators is true, the message is also sent to spectators.
*/
GGPO_API GGPOErrorCode __cdecl ggpo_send_message(GGPOSession *,
const void *msg,
int len,
bool spectators);
#ifdef __cplusplus
};
#endif
#endif
@@ -0,0 +1,34 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#ifndef _BACKEND_H
#define _BACKEND_H
#include "../ggpo_types.h"
#include "ggponet.h"
struct GGPOSession {
virtual ~GGPOSession() { }
virtual GGPOErrorCode DoPoll(int timeout) { return GGPO_OK; }
virtual GGPOErrorCode AddPlayer(GGPOPlayer *player, GGPOPlayerHandle *handle) = 0;
virtual GGPOErrorCode AddLocalInput(GGPOPlayerHandle player, void *values, int size) = 0;
virtual GGPOErrorCode SyncInput(void *values, int size, int *disconnect_flags) = 0;
virtual GGPOErrorCode IncrementFrame(void) { return GGPO_OK; }
virtual GGPOErrorCode DisconnectPlayer(GGPOPlayerHandle handle) { return GGPO_OK; }
virtual GGPOErrorCode GetNetworkStats(GGPONetworkStats *stats, GGPOPlayerHandle handle) { return GGPO_OK; }
virtual GGPOErrorCode Logv(const char *fmt, va_list list) { ::Logv(fmt, list); return GGPO_OK; }
virtual GGPOErrorCode SetFrameDelay(GGPOPlayerHandle player, int delay) { return GGPO_ERRORCODE_UNSUPPORTED; }
virtual GGPOErrorCode SetDisconnectTimeout(int timeout) { return GGPO_ERRORCODE_UNSUPPORTED; }
virtual GGPOErrorCode SetDisconnectNotifyStart(int timeout) { return GGPO_ERRORCODE_UNSUPPORTED; }
virtual GGPOErrorCode SendMessage(const void *msg, int len, bool spectators) { return GGPO_ERRORCODE_UNSUPPORTED; }
};
typedef struct GGPOSession Quark, IQuarkBackend; /* XXX: nuke this */
#endif
+664
View File
@@ -0,0 +1,664 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#include "p2p.h"
#include <chrono>
#include <thread>
static const int RECOMMENDATION_INTERVAL = 240;
static const int DEFAULT_DISCONNECT_TIMEOUT = 5000;
static const int DEFAULT_DISCONNECT_NOTIFY_START = 750;
Peer2PeerBackend::Peer2PeerBackend(GGPOSessionCallbacks *cb,
const char *gamename,
uint16 localport,
int num_players,
int input_size,
const void *verification,
int verification_size) :
_sync(_local_connect_status),
_endpoints(nullptr),
_num_spectators(0),
_input_size(input_size),
_num_players(num_players),
_next_spectator_frame(0),
_disconnect_timeout(DEFAULT_DISCONNECT_TIMEOUT),
_disconnect_notify_start(DEFAULT_DISCONNECT_NOTIFY_START)
{
_callbacks = *cb;
_synchronizing = true;
_next_recommended_sleep = 0;
/*
* Initialize the synchronziation layer
*/
Sync::Config config = { 0 };
config.num_players = num_players;
config.input_size = input_size;
config.callbacks = _callbacks;
config.num_prediction_frames = MAX_PREDICTION_FRAMES;
_sync.Init(config);
/*
* Initialize the UDP port
*/
_udp.Init(localport, &_poll, this);
_endpoints = new UdpProtocol[_num_players];
for (int i = 0; i < _num_players; i++)
_endpoints[i].SetVerificationData(verification, verification_size);
memset(_local_connect_status, 0, sizeof(_local_connect_status));
for (unsigned i = 0; i < ARRAY_SIZE(_local_connect_status); i++) {
_local_connect_status[i].last_frame = -1;
}
/*
* Preload the ROM
*/
_callbacks.begin_game(gamename);
}
Peer2PeerBackend::~Peer2PeerBackend()
{
delete [] _endpoints;
}
void
Peer2PeerBackend::AddRemotePlayer(char *ip,
uint16 port,
int queue)
{
/*
* Start the state machine (xxx: no)
*/
_synchronizing = true;
_endpoints[queue].Init(&_udp, _poll, queue, ip, port, _local_connect_status);
_endpoints[queue].SetDisconnectTimeout(_disconnect_timeout);
_endpoints[queue].SetDisconnectNotifyStart(_disconnect_notify_start);
_endpoints[queue].Synchronize();
}
GGPOErrorCode Peer2PeerBackend::AddSpectator(char *ip,
uint16 port)
{
if (_num_spectators == GGPO_MAX_SPECTATORS) {
return GGPO_ERRORCODE_TOO_MANY_SPECTATORS;
}
/*
* Currently, we can only add spectators before the game starts.
*/
if (!_synchronizing) {
return GGPO_ERRORCODE_INVALID_REQUEST;
}
int queue = _num_spectators++;
_spectators[queue].Init(&_udp, _poll, queue + 1000, ip, port, _local_connect_status);
_spectators[queue].SetDisconnectTimeout(_disconnect_timeout);
_spectators[queue].SetDisconnectNotifyStart(_disconnect_notify_start);
_spectators[queue].Synchronize();
return GGPO_OK;
}
GGPOErrorCode
Peer2PeerBackend::DoPoll(int timeout)
{
if (!_sync.InRollback()) {
_poll.Pump(0);
PollUdpProtocolEvents();
if (!_synchronizing) {
_sync.CheckSimulation(timeout);
// notify all of our endpoints of their local frame number for their
// next connection quality report
int current_frame = _sync.GetFrameCount();
for (int i = 0; i < _num_players; i++) {
_endpoints[i].SetLocalFrameNumber(current_frame);
}
int total_min_confirmed;
if (_num_players <= 2) {
total_min_confirmed = Poll2Players(current_frame);
} else {
total_min_confirmed = PollNPlayers(current_frame);
}
Log("last confirmed frame in p2p backend is %d.\n", total_min_confirmed);
if (total_min_confirmed >= 0) {
ASSERT(total_min_confirmed != INT_MAX);
if (_num_spectators > 0) {
while (_next_spectator_frame <= total_min_confirmed) {
Log("pushing frame %d to spectators.\n", _next_spectator_frame);
GameInput input;
input.frame = _next_spectator_frame;
input.size = _input_size * _num_players;
_sync.GetConfirmedInputs(input.bits, _input_size * _num_players, _next_spectator_frame);
for (int i = 0; i < _num_spectators; i++) {
_spectators[i].SendInput(input);
}
_next_spectator_frame++;
}
}
Log("setting confirmed frame in sync to %d.\n", total_min_confirmed);
_sync.SetLastConfirmedFrame(total_min_confirmed);
}
// send timesync notifications if now is the proper time
if (current_frame > _next_recommended_sleep) {
int interval = 0;
for (int i = 0; i < _num_players; i++) {
interval = MAX(interval, _endpoints[i].RecommendFrameDelay());
}
if (interval > 0) {
GGPOEvent info;
info.code = GGPO_EVENTCODE_TIMESYNC;
info.u.timesync.frames_ahead = interval;
_callbacks.on_event(&info);
_next_recommended_sleep = current_frame + RECOMMENDATION_INTERVAL;
}
}
// XXX: this is obviously a farce...
if (timeout)
std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
}
return GGPO_OK;
}
int Peer2PeerBackend::Poll2Players(int current_frame)
{
int i;
// discard confirmed frames as appropriate
int total_min_confirmed = MAX_INT;
for (i = 0; i < _num_players; i++) {
bool queue_connected = true;
if (_endpoints[i].IsRunning()) {
int ignore;
queue_connected = _endpoints[i].GetPeerConnectStatus(i, &ignore);
}
if (!_local_connect_status[i].disconnected) {
total_min_confirmed = MIN(_local_connect_status[i].last_frame, total_min_confirmed);
}
Log(" local endp: connected = %d, last_received = %d, total_min_confirmed = %d.\n", !_local_connect_status[i].disconnected, _local_connect_status[i].last_frame, total_min_confirmed);
if (!queue_connected && !_local_connect_status[i].disconnected) {
Log("disconnecting i %d by remote request.\n", i);
DisconnectPlayerQueue(i, total_min_confirmed);
}
Log(" total_min_confirmed = %d.\n", total_min_confirmed);
}
return total_min_confirmed;
}
int Peer2PeerBackend::PollNPlayers(int current_frame)
{
int i, queue, last_received;
// discard confirmed frames as appropriate
int total_min_confirmed = MAX_INT;
for (queue = 0; queue < _num_players; queue++) {
bool queue_connected = true;
int queue_min_confirmed = MAX_INT;
Log("considering queue %d.\n", queue);
for (i = 0; i < _num_players; i++) {
// we're going to do a lot of logic here in consideration of endpoint i.
// keep accumulating the minimum confirmed point for all n*n packets and
// throw away the rest.
if (_endpoints[i].IsRunning()) {
bool connected = _endpoints[i].GetPeerConnectStatus(queue, &last_received);
queue_connected = queue_connected && connected;
queue_min_confirmed = MIN(last_received, queue_min_confirmed);
Log(" endpoint %d: connected = %d, last_received = %d, queue_min_confirmed = %d.\n", i, connected, last_received, queue_min_confirmed);
} else {
Log(" endpoint %d: ignoring... not running.\n", i);
}
}
// merge in our local status only if we're still connected!
if (!_local_connect_status[queue].disconnected) {
queue_min_confirmed = MIN(_local_connect_status[queue].last_frame, queue_min_confirmed);
}
Log(" local endp: connected = %d, last_received = %d, queue_min_confirmed = %d.\n", !_local_connect_status[queue].disconnected, _local_connect_status[queue].last_frame, queue_min_confirmed);
if (queue_connected) {
total_min_confirmed = MIN(queue_min_confirmed, total_min_confirmed);
} else {
// check to see if this disconnect notification is further back than we've been before. If
// so, we need to re-adjust. This can happen when we detect our own disconnect at frame n
// and later receive a disconnect notification for frame n-1.
if (!_local_connect_status[queue].disconnected || _local_connect_status[queue].last_frame > queue_min_confirmed) {
Log("disconnecting queue %d by remote request.\n", queue);
DisconnectPlayerQueue(queue, queue_min_confirmed);
}
}
Log(" total_min_confirmed = %d.\n", total_min_confirmed);
}
return total_min_confirmed;
}
GGPOErrorCode
Peer2PeerBackend::AddPlayer(GGPOPlayer *player,
GGPOPlayerHandle *handle)
{
if (player->type == GGPO_PLAYERTYPE_SPECTATOR) {
return AddSpectator(player->u.remote.ip_address, player->u.remote.port);
}
int queue = player->player_num - 1;
if (player->player_num < 1 || player->player_num > _num_players) {
return GGPO_ERRORCODE_PLAYER_OUT_OF_RANGE;
}
*handle = QueueToPlayerHandle(queue);
if (player->type == GGPO_PLAYERTYPE_REMOTE) {
AddRemotePlayer(player->u.remote.ip_address, player->u.remote.port, queue);
}
return GGPO_OK;
}
GGPOErrorCode
Peer2PeerBackend::AddLocalInput(GGPOPlayerHandle player,
void *values,
int size)
{
int queue;
GameInput input;
GGPOErrorCode result;
if (_sync.InRollback()) {
return GGPO_ERRORCODE_IN_ROLLBACK;
}
if (_synchronizing) {
return GGPO_ERRORCODE_NOT_SYNCHRONIZED;
}
result = PlayerHandleToQueue(player, &queue);
if (!GGPO_SUCCEEDED(result)) {
return result;
}
input.init(-1, (char *)values, size);
// Feed the input for the current frame into the synchronzation layer.
if (!_sync.AddLocalInput(queue, input)) {
return GGPO_ERRORCODE_PREDICTION_THRESHOLD;
}
if (input.frame != GameInput::NullFrame) { // xxx: <- comment why this is the case
// Update the local connect status state to indicate that we've got a
// confirmed local frame for this player. this must come first so it
// gets incorporated into the next packet we send.
Log("setting local connect status for local queue %d to %d", queue, input.frame);
_local_connect_status[queue].last_frame = input.frame;
// Send the input to all the remote players.
for (int i = 0; i < _num_players; i++) {
if (_endpoints[i].IsInitialized()) {
_endpoints[i].SendInput(input);
}
}
}
return GGPO_OK;
}
GGPOErrorCode
Peer2PeerBackend::SyncInput(void *values,
int size,
int *disconnect_flags)
{
int flags;
// Wait until we've started to return inputs.
if (_synchronizing) {
return GGPO_ERRORCODE_NOT_SYNCHRONIZED;
}
flags = _sync.SynchronizeInputs(values, size);
if (disconnect_flags) {
*disconnect_flags = flags;
}
return GGPO_OK;
}
GGPOErrorCode
Peer2PeerBackend::IncrementFrame(void)
{
Log("End of frame (%d)...\n", _sync.GetFrameCount());
_sync.IncrementFrame();
DoPoll(0);
PollSyncEvents();
return GGPO_OK;
}
void
Peer2PeerBackend::PollSyncEvents(void)
{
Sync::Event e;
while (_sync.GetEvent(e)) {
OnSyncEvent(e);
}
return;
}
void
Peer2PeerBackend::PollUdpProtocolEvents(void)
{
UdpProtocol::Event evt;
for (int i = 0; i < _num_players; i++) {
while (_endpoints[i].GetEvent(evt)) {
OnUdpProtocolPeerEvent(evt, i);
}
}
for (int i = 0; i < _num_spectators; i++) {
while (_spectators[i].GetEvent(evt)) {
OnUdpProtocolSpectatorEvent(evt, i);
}
}
}
void
Peer2PeerBackend::OnUdpProtocolPeerEvent(UdpProtocol::Event &evt, int queue)
{
OnUdpProtocolEvent(evt, QueueToPlayerHandle(queue));
switch (evt.type) {
case UdpProtocol::Event::Input:
if (!_local_connect_status[queue].disconnected) {
int current_remote_frame = _local_connect_status[queue].last_frame;
int new_remote_frame = evt.u.input.input.frame;
ASSERT(current_remote_frame == -1 || new_remote_frame == (current_remote_frame + 1));
_sync.AddRemoteInput(queue, evt.u.input.input);
// Notify the other endpoints which frame we received from a peer
Log("setting remote connect status for queue %d to %d\n", queue, evt.u.input.input.frame);
_local_connect_status[queue].last_frame = evt.u.input.input.frame;
}
break;
case UdpProtocol::Event::Disconnected:
DisconnectPlayer(QueueToPlayerHandle(queue));
break;
case UdpProtocol::Event::AppData:
if (evt.u.app_data.spectators)
for (int i = 0; i < _num_spectators; i++)
if (_spectators[i].IsInitialized())
_spectators[i].SendAppData(evt.u.app_data.data, evt.u.app_data.size, true);
Log("calling on_message callback with %d bytes", evt.u.app_data.size);
if (_callbacks.on_message != nullptr)
_callbacks.on_message(evt.u.app_data.data, evt.u.app_data.size);
break;
default:
break;
}
}
void
Peer2PeerBackend::OnUdpProtocolSpectatorEvent(UdpProtocol::Event &evt, int queue)
{
GGPOPlayerHandle handle = QueueToSpectatorHandle(queue);
OnUdpProtocolEvent(evt, handle);
if (evt.type == UdpProtocol::Event::Disconnected)
{
_spectators[queue].Disconnect();
GGPOEvent info;
info.code = GGPO_EVENTCODE_DISCONNECTED_FROM_PEER;
info.u.disconnected.player = handle;
_callbacks.on_event(&info);
}
}
void
Peer2PeerBackend::OnUdpProtocolEvent(UdpProtocol::Event &evt, GGPOPlayerHandle handle)
{
GGPOEvent info;
switch (evt.type) {
case UdpProtocol::Event::Connected:
info.code = GGPO_EVENTCODE_CONNECTED_TO_PEER;
info.u.connected.player = handle;
_callbacks.on_event(&info);
break;
case UdpProtocol::Event::Synchronizing:
info.code = GGPO_EVENTCODE_SYNCHRONIZING_WITH_PEER;
info.u.synchronizing.player = handle;
info.u.synchronizing.count = evt.u.synchronizing.count;
info.u.synchronizing.total = evt.u.synchronizing.total;
_callbacks.on_event(&info);
break;
case UdpProtocol::Event::Synchronzied:
info.code = GGPO_EVENTCODE_SYNCHRONIZED_WITH_PEER;
info.u.synchronized.player = handle;
_callbacks.on_event(&info);
CheckInitialSync();
break;
case UdpProtocol::Event::NetworkInterrupted:
info.code = GGPO_EVENTCODE_CONNECTION_INTERRUPTED;
info.u.connection_interrupted.player = handle;
info.u.connection_interrupted.disconnect_timeout = evt.u.network_interrupted.disconnect_timeout;
_callbacks.on_event(&info);
break;
case UdpProtocol::Event::NetworkResumed:
info.code = GGPO_EVENTCODE_CONNECTION_RESUMED;
info.u.connection_resumed.player = handle;
_callbacks.on_event(&info);
break;
default:
break;
}
}
/*
* Called only as the result of a local decision to disconnect. The remote
* decisions to disconnect are a result of us parsing the peer_connect_settings
* blob in every endpoint periodically.
*/
GGPOErrorCode
Peer2PeerBackend::DisconnectPlayer(GGPOPlayerHandle player)
{
int queue;
GGPOErrorCode result;
result = PlayerHandleToQueue(player, &queue);
if (!GGPO_SUCCEEDED(result)) {
return result;
}
if (_local_connect_status[queue].disconnected) {
return GGPO_ERRORCODE_PLAYER_DISCONNECTED;
}
if (!_endpoints[queue].IsInitialized()) {
int current_frame = _sync.GetFrameCount();
// xxx: we should be tracking who the local player is, but for now assume
// that if the endpoint is not initalized, this must be the local player.
Log("Disconnecting local player %d at frame %d by user request.\n", queue, _local_connect_status[queue].last_frame);
for (int i = 0; i < _num_players; i++) {
if (_endpoints[i].IsInitialized()) {
DisconnectPlayerQueue(i, current_frame);
}
}
} else {
Log("Disconnecting queue %d at frame %d by user request.\n", queue, _local_connect_status[queue].last_frame);
DisconnectPlayerQueue(queue, _local_connect_status[queue].last_frame);
}
return GGPO_OK;
}
void
Peer2PeerBackend::DisconnectPlayerQueue(int queue, int syncto)
{
GGPOEvent info;
int framecount = _sync.GetFrameCount();
_endpoints[queue].Disconnect();
Log("Changing queue %d local connect status for last frame from %d to %d on disconnect request (current: %d).\n",
queue, _local_connect_status[queue].last_frame, syncto, framecount);
_local_connect_status[queue].disconnected = 1;
_local_connect_status[queue].last_frame = syncto;
if (syncto != GameInput::NullFrame && syncto < framecount) {
Log("adjusting simulation to account for the fact that %d disconnected @ %d.\n", queue, syncto);
_sync.AdjustSimulation(syncto);
Log("finished adjusting simulation.\n");
}
info.code = GGPO_EVENTCODE_DISCONNECTED_FROM_PEER;
info.u.disconnected.player = QueueToPlayerHandle(queue);
_callbacks.on_event(&info);
CheckInitialSync();
}
GGPOErrorCode
Peer2PeerBackend::GetNetworkStats(GGPONetworkStats *stats, GGPOPlayerHandle player)
{
int queue;
GGPOErrorCode result;
result = PlayerHandleToQueue(player, &queue);
if (!GGPO_SUCCEEDED(result)) {
return result;
}
memset(stats, 0, sizeof *stats);
_endpoints[queue].GetNetworkStats(stats);
stats->sync.predicted_frames = _sync.GetPredictedFrames();
return GGPO_OK;
}
GGPOErrorCode
Peer2PeerBackend::SetFrameDelay(GGPOPlayerHandle player, int delay)
{
int queue;
GGPOErrorCode result;
result = PlayerHandleToQueue(player, &queue);
if (!GGPO_SUCCEEDED(result)) {
return result;
}
_sync.SetFrameDelay(queue, delay);
return GGPO_OK;
}
GGPOErrorCode
Peer2PeerBackend::SetDisconnectTimeout(int timeout)
{
_disconnect_timeout = timeout;
for (int i = 0; i < _num_players; i++) {
if (_endpoints[i].IsInitialized()) {
_endpoints[i].SetDisconnectTimeout(_disconnect_timeout);
}
}
return GGPO_OK;
}
GGPOErrorCode
Peer2PeerBackend::SetDisconnectNotifyStart(int timeout)
{
_disconnect_notify_start = timeout;
for (int i = 0; i < _num_players; i++) {
if (_endpoints[i].IsInitialized()) {
_endpoints[i].SetDisconnectNotifyStart(_disconnect_notify_start);
}
}
return GGPO_OK;
}
GGPOErrorCode
Peer2PeerBackend::PlayerHandleToQueue(GGPOPlayerHandle player, int *queue)
{
int offset = ((int)player - 1);
if (offset < 0 || offset >= _num_players) {
return GGPO_ERRORCODE_INVALID_PLAYER_HANDLE;
}
*queue = offset;
return GGPO_OK;
}
void
Peer2PeerBackend::OnMsg(sockaddr_in &from, UdpMsg *msg, int len)
{
for (int i = 0; i < _num_players; i++) {
if (_endpoints[i].HandlesMsg(from, msg)) {
_endpoints[i].OnMsg(msg, len);
return;
}
}
for (int i = 0; i < _num_spectators; i++) {
if (_spectators[i].HandlesMsg(from, msg)) {
_spectators[i].OnMsg(msg, len);
return;
}
}
}
void
Peer2PeerBackend::CheckInitialSync()
{
int i;
if (_synchronizing) {
// Check to see if everyone is now synchronized. If so,
// go ahead and tell the client that we're ok to accept input.
for (i = 0; i < _num_players; i++) {
// xxx: IsInitialized() must go... we're actually using it as a proxy for "represents the local player"
if (_endpoints[i].IsInitialized() && !_endpoints[i].IsSynchronized() && !_local_connect_status[i].disconnected) {
return;
}
}
for (i = 0; i < _num_spectators; i++) {
if (_spectators[i].IsInitialized() && !_spectators[i].IsSynchronized()) {
return;
}
}
GGPOEvent info;
info.code = GGPO_EVENTCODE_RUNNING;
_callbacks.on_event(&info);
_synchronizing = false;
}
}
GGPOErrorCode Peer2PeerBackend::SendMessage(const void *msg, int len, bool spectators)
{
if (_synchronizing)
return GGPO_ERRORCODE_NOT_SYNCHRONIZED;
if (len > MAX_APPDATA_SIZE)
return GGPO_ERRORCODE_INVALID_REQUEST;
for (int i = 0; i < _num_players; i++)
if (_endpoints[i].IsInitialized())
_endpoints[i].SendAppData(msg, len, spectators);
if (spectators)
for (int i = 0; i < _num_spectators; i++)
if (_spectators[i].IsInitialized())
_spectators[i].SendAppData(msg, len, spectators);
return GGPO_ERRORCODE_SUCCESS;
}
+79
View File
@@ -0,0 +1,79 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#ifndef _P2P_H
#define _P2P_H
#include "ggpo_types.h"
#include "ggpo_poll.h"
#include "sync.h"
#include "backend.h"
#include "timesync.h"
#include "network/udp_proto.h"
class Peer2PeerBackend : public IQuarkBackend, IPollSink, Udp::Callbacks {
public:
Peer2PeerBackend(GGPOSessionCallbacks *cb, const char *gamename, uint16 localport, int num_players, int input_size,
const void *verification, int verification_size);
virtual ~Peer2PeerBackend();
public:
GGPOErrorCode DoPoll(int timeout) override;
GGPOErrorCode AddPlayer(GGPOPlayer *player, GGPOPlayerHandle *handle) override;
GGPOErrorCode AddLocalInput(GGPOPlayerHandle player, void *values, int size) override;
GGPOErrorCode SyncInput(void *values, int size, int *disconnect_flags) override;
GGPOErrorCode IncrementFrame(void) override;
GGPOErrorCode DisconnectPlayer(GGPOPlayerHandle handle) override;
GGPOErrorCode GetNetworkStats(GGPONetworkStats *stats, GGPOPlayerHandle handle) override;
GGPOErrorCode SetFrameDelay(GGPOPlayerHandle player, int delay) override;
GGPOErrorCode SetDisconnectTimeout(int timeout) override;
GGPOErrorCode SetDisconnectNotifyStart(int timeout) override;
GGPOErrorCode SendMessage(const void *msg, int len, bool spectators) override;
public:
void OnMsg(sockaddr_in &from, UdpMsg *msg, int len) override;
protected:
GGPOErrorCode PlayerHandleToQueue(GGPOPlayerHandle player, int *queue);
GGPOPlayerHandle QueueToPlayerHandle(int queue) { return (GGPOPlayerHandle)(queue + 1); }
GGPOPlayerHandle QueueToSpectatorHandle(int queue) { return (GGPOPlayerHandle)(queue + 1000); } /* out of range of the player array, basically */
void DisconnectPlayerQueue(int queue, int syncto);
void PollSyncEvents(void);
void PollUdpProtocolEvents(void);
void CheckInitialSync(void);
int Poll2Players(int current_frame);
int PollNPlayers(int current_frame);
void AddRemotePlayer(char *remoteip, uint16 reportport, int queue);
GGPOErrorCode AddSpectator(char *remoteip, uint16 reportport);
virtual void OnSyncEvent(Sync::Event &e) { }
virtual void OnUdpProtocolEvent(UdpProtocol::Event &e, GGPOPlayerHandle handle);
virtual void OnUdpProtocolPeerEvent(UdpProtocol::Event &e, int queue);
virtual void OnUdpProtocolSpectatorEvent(UdpProtocol::Event &e, int queue);
protected:
GGPOSessionCallbacks _callbacks;
Poll _poll;
Sync _sync;
Udp _udp;
UdpProtocol *_endpoints;
UdpProtocol _spectators[GGPO_MAX_SPECTATORS];
int _num_spectators;
int _input_size;
bool _synchronizing;
int _num_players;
int _next_recommended_sleep;
int _next_spectator_frame;
int _disconnect_timeout;
int _disconnect_notify_start;
UdpMsg::connect_status _local_connect_status[UDP_MSG_MAX_PLAYERS];
};
#endif
@@ -0,0 +1,189 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#include "spectator.h"
SpectatorBackend::SpectatorBackend(GGPOSessionCallbacks *cb,
const char* gamename,
uint16 localport,
int num_players,
int input_size,
char *hostip,
u_short hostport,
const void *verification,
int verification_size) :
_input_size(input_size),
_num_players(num_players),
_next_input_to_send(0)
{
_callbacks = *cb;
_synchronizing = true;
for (size_t i = 0; i < ARRAY_SIZE(_inputs); i++) {
_inputs[i].frame = -1;
}
/*
* Initialize the UDP port
*/
_udp.Init(localport, &_poll, this);
/*
* Init the host endpoint
*/
_host.SetVerificationData(verification, verification_size);
_host.Init(&_udp, _poll, 0, hostip, hostport, NULL);
_host.Synchronize();
/*
* Preload the ROM
*/
_callbacks.begin_game(gamename);
}
SpectatorBackend::~SpectatorBackend()
{
}
GGPOErrorCode
SpectatorBackend::DoPoll(int timeout)
{
_poll.Pump(0);
PollUdpProtocolEvents();
return GGPO_OK;
}
GGPOErrorCode
SpectatorBackend::SyncInput(void *values,
int size,
int *disconnect_flags)
{
// Wait until we've started to return inputs.
if (_synchronizing) {
return GGPO_ERRORCODE_NOT_SYNCHRONIZED;
}
GameInput &input = _inputs[_next_input_to_send % SPECTATOR_FRAME_BUFFER_SIZE];
if (input.frame < _next_input_to_send) {
// Haven't received the input from the host yet. Wait
return GGPO_ERRORCODE_PREDICTION_THRESHOLD;
}
if (input.frame > _next_input_to_send) {
// The host is way way way far ahead of the spectator. How'd this
// happen? Anyway, the input we need is gone forever.
return GGPO_ERRORCODE_GENERAL_FAILURE;
}
ASSERT(size >= _input_size * _num_players);
memcpy(values, input.bits, _input_size * _num_players);
if (disconnect_flags) {
*disconnect_flags = 0; // xxx: should get them from the host!
}
_next_input_to_send++;
return GGPO_OK;
}
GGPOErrorCode
SpectatorBackend::IncrementFrame(void)
{
Log("End of frame (%d)...\n", _next_input_to_send - 1);
DoPoll(0);
PollUdpProtocolEvents();
return GGPO_OK;
}
void
SpectatorBackend::PollUdpProtocolEvents(void)
{
UdpProtocol::Event evt;
while (_host.GetEvent(evt)) {
OnUdpProtocolEvent(evt);
}
}
void
SpectatorBackend::OnUdpProtocolEvent(UdpProtocol::Event &evt)
{
GGPOEvent info;
switch (evt.type) {
case UdpProtocol::Event::Connected:
info.code = GGPO_EVENTCODE_CONNECTED_TO_PEER;
info.u.connected.player = 0;
_callbacks.on_event(&info);
break;
case UdpProtocol::Event::Synchronizing:
info.code = GGPO_EVENTCODE_SYNCHRONIZING_WITH_PEER;
info.u.synchronizing.player = 0;
info.u.synchronizing.count = evt.u.synchronizing.count;
info.u.synchronizing.total = evt.u.synchronizing.total;
_callbacks.on_event(&info);
break;
case UdpProtocol::Event::Synchronzied:
if (_synchronizing) {
info.code = GGPO_EVENTCODE_SYNCHRONIZED_WITH_PEER;
info.u.synchronized.player = 0;
_callbacks.on_event(&info);
info.code = GGPO_EVENTCODE_RUNNING;
_callbacks.on_event(&info);
_synchronizing = false;
}
break;
case UdpProtocol::Event::NetworkInterrupted:
info.code = GGPO_EVENTCODE_CONNECTION_INTERRUPTED;
info.u.connection_interrupted.player = 0;
info.u.connection_interrupted.disconnect_timeout = evt.u.network_interrupted.disconnect_timeout;
_callbacks.on_event(&info);
break;
case UdpProtocol::Event::NetworkResumed:
info.code = GGPO_EVENTCODE_CONNECTION_RESUMED;
info.u.connection_resumed.player = 0;
_callbacks.on_event(&info);
break;
case UdpProtocol::Event::Disconnected:
info.code = GGPO_EVENTCODE_DISCONNECTED_FROM_PEER;
info.u.disconnected.player = 0;
_callbacks.on_event(&info);
break;
case UdpProtocol::Event::Input:
{
GameInput& input = evt.u.input.input;
_host.SetLocalFrameNumber(input.frame);
_host.SendInputAck();
_inputs[input.frame % SPECTATOR_FRAME_BUFFER_SIZE] = input;
}
break;
case UdpProtocol::Event::AppData:
Log("calling on_message callback with %d bytes", evt.u.app_data.size);
if (_callbacks.on_message != nullptr)
_callbacks.on_message(evt.u.app_data.data, evt.u.app_data.size);
break;
default:
break;
}
}
void
SpectatorBackend::OnMsg(sockaddr_in &from, UdpMsg *msg, int len)
{
if (_host.HandlesMsg(from, msg)) {
_host.OnMsg(msg, len);
}
}
@@ -0,0 +1,60 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#ifndef _SPECTATOR_H
#define _SPECTATOR_H
#include "../ggpo_poll.h"
#include "../ggpo_types.h"
#include "sync.h"
#include "backend.h"
#include "timesync.h"
#include "network/udp_proto.h"
#define SPECTATOR_FRAME_BUFFER_SIZE 64
class SpectatorBackend : public IQuarkBackend, IPollSink, Udp::Callbacks {
public:
SpectatorBackend(GGPOSessionCallbacks *cb, const char *gamename, uint16 localport, int num_players, int input_size, char *hostip, u_short hostport,
const void *verification, int verification_size);
virtual ~SpectatorBackend();
public:
GGPOErrorCode DoPoll(int timeout) override;
GGPOErrorCode AddPlayer(GGPOPlayer *player, GGPOPlayerHandle *handle) override { return GGPO_ERRORCODE_UNSUPPORTED; }
GGPOErrorCode AddLocalInput(GGPOPlayerHandle player, void *values, int size) override { return GGPO_OK; }
GGPOErrorCode SyncInput(void *values, int size, int *disconnect_flags) override;
GGPOErrorCode IncrementFrame(void) override;
GGPOErrorCode DisconnectPlayer(GGPOPlayerHandle handle) override { return GGPO_ERRORCODE_UNSUPPORTED; }
GGPOErrorCode GetNetworkStats(GGPONetworkStats *stats, GGPOPlayerHandle handle) override { return GGPO_ERRORCODE_UNSUPPORTED; }
GGPOErrorCode SetFrameDelay(GGPOPlayerHandle player, int delay) override { return GGPO_ERRORCODE_UNSUPPORTED; }
GGPOErrorCode SetDisconnectTimeout(int timeout) override { return GGPO_ERRORCODE_UNSUPPORTED; }
GGPOErrorCode SetDisconnectNotifyStart(int timeout) override { return GGPO_ERRORCODE_UNSUPPORTED; }
public:
void OnMsg(sockaddr_in &from, UdpMsg *msg, int len) override;
protected:
void PollUdpProtocolEvents(void);
void CheckInitialSync(void);
void OnUdpProtocolEvent(UdpProtocol::Event &e);
protected:
GGPOSessionCallbacks _callbacks;
Poll _poll;
Udp _udp;
UdpProtocol _host;
bool _synchronizing;
int _input_size;
int _num_players;
int _next_input_to_send;
GameInput _inputs[SPECTATOR_FRAME_BUFFER_SIZE];
};
#endif
@@ -0,0 +1,224 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#include "synctest.h"
SyncTestBackend::SyncTestBackend(GGPOSessionCallbacks *cb,
const char *gamename,
int frames,
int num_players) :
_sync(NULL)
{
_callbacks = *cb;
_num_players = num_players;
_check_distance = frames;
_last_verified = 0;
_rollingback = false;
_running = false;
_logfp = NULL;
_current_input.erase();
strcpy(_game, gamename);
/*
* Initialize the synchronziation layer
*/
Sync::Config config = { 0 };
config.callbacks = _callbacks;
config.num_prediction_frames = MAX_PREDICTION_FRAMES;
_sync.Init(config);
/*
* Preload the ROM
*/
_callbacks.begin_game(gamename);
}
SyncTestBackend::~SyncTestBackend()
{
}
GGPOErrorCode
SyncTestBackend::DoPoll(int timeout)
{
if (!_running) {
GGPOEvent info;
info.code = GGPO_EVENTCODE_RUNNING;
_callbacks.on_event(&info);
_running = true;
}
return GGPO_OK;
}
GGPOErrorCode
SyncTestBackend::AddPlayer(GGPOPlayer *player, GGPOPlayerHandle *handle)
{
if (player->player_num < 1 || player->player_num > _num_players) {
return GGPO_ERRORCODE_PLAYER_OUT_OF_RANGE;
}
*handle = (GGPOPlayerHandle)(player->player_num - 1);
return GGPO_OK;
}
GGPOErrorCode
SyncTestBackend::AddLocalInput(GGPOPlayerHandle player, void *values, int size)
{
if (!_running) {
return GGPO_ERRORCODE_NOT_SYNCHRONIZED;
}
int index = (int)player;
for (int i = 0; i < size; i++) {
_current_input.bits[(index * size) + i] |= ((char *)values)[i];
}
return GGPO_OK;
}
GGPOErrorCode
SyncTestBackend::SyncInput(void *values,
int size,
int *disconnect_flags)
{
BeginLog(false);
if (_rollingback) {
_last_input = _saved_frames.front().input;
} else {
if (_sync.GetFrameCount() == 0 && _sync.GetLastSavedFrame().buf == nullptr) {
_sync.SaveCurrentFrame();
}
_last_input = _current_input;
}
memcpy(values, _last_input.bits, size);
if (disconnect_flags) {
*disconnect_flags = 0;
}
return GGPO_OK;
}
GGPOErrorCode
SyncTestBackend::IncrementFrame(void)
{
_sync.IncrementFrame();
_current_input.erase();
Log("End of frame(%d)...\n", _sync.GetFrameCount());
EndLog();
if (_rollingback) {
return GGPO_OK;
}
int frame = _sync.GetFrameCount();
// Hold onto the current frame in our queue of saved states. We'll need
// the checksum later to verify that our replay of the same frame got the
// same results.
SavedInfo info;
info.frame = frame;
info.input = _last_input;
info.cbuf = _sync.GetLastSavedFrame().cbuf;
info.buf = (char *)malloc(info.cbuf);
memcpy(info.buf, _sync.GetLastSavedFrame().buf, info.cbuf);
info.checksum = _sync.GetLastSavedFrame().checksum;
_saved_frames.push(info);
if (frame - _last_verified == _check_distance) {
// We've gone far enough ahead and should now start replaying frames.
// Load the last verified frame and set the rollback flag to true.
_sync.LoadFrame(_last_verified);
_rollingback = true;
while(!_saved_frames.empty()) {
_callbacks.advance_frame(0);
// Verify that the checksumn of this frame is the same as the one in our
// list.
info = _saved_frames.front();
_saved_frames.pop();
if (info.frame != _sync.GetFrameCount()) {
RaiseSyncError("Frame number %d does not match saved frame number %d", info.frame, frame);
}
int checksum = _sync.GetLastSavedFrame().checksum;
if (info.checksum != checksum) {
LogSaveStates(info);
RaiseSyncError("Checksum for frame %d does not match saved (%d != %d)", frame, checksum, info.checksum);
}
else
printf("Checksum %08d for frame %d matches.\n", checksum, info.frame);
free(info.buf);
}
_last_verified = frame;
_rollingback = false;
}
return GGPO_OK;
}
void
SyncTestBackend::RaiseSyncError(const char *fmt, ...)
{
char buf[1024];
va_list args;
va_start(args, fmt);
vsnprintf(buf, ARRAY_SIZE(buf), fmt, args);
va_end(args);
puts(buf);
#ifdef _WIN32
OutputDebugStringA(buf);
#endif
EndLog();
// DebugBreak();
}
GGPOErrorCode
SyncTestBackend::Logv(char *fmt, va_list list)
{
if (_logfp) {
vfprintf(_logfp, fmt, list);
}
return GGPO_OK;
}
void
SyncTestBackend::BeginLog(int saving)
{
EndLog();
char filename[MAX_PATH];
#ifdef _WIN32
CreateDirectoryA("synclogs", NULL);
#else
mkdir("synclogs", 0755);
#endif
snprintf(filename, ARRAY_SIZE(filename), "synclogs/%s-%04d-%s.log",
saving ? "state" : "log",
_sync.GetFrameCount(),
_rollingback ? "replay" : "original");
_logfp = fopen(filename, "w");
}
void
SyncTestBackend::EndLog()
{
if (_logfp) {
fprintf(_logfp, "Closing log file.\n");
fclose(_logfp);
_logfp = NULL;
}
}
void
SyncTestBackend::LogSaveStates(SavedInfo &info)
{
char filename[MAX_PATH];
snprintf(filename, ARRAY_SIZE(filename), "synclogs/state-%04d-original.log", _sync.GetFrameCount());
_callbacks.log_game_state(filename, (unsigned char *)info.buf, info.cbuf);
snprintf(filename, ARRAY_SIZE(filename), "synclogs/state-%04d-replay.log", _sync.GetFrameCount());
_callbacks.log_game_state(filename, _sync.GetLastSavedFrame().buf, _sync.GetLastSavedFrame().cbuf);
}
@@ -0,0 +1,60 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#ifndef _SYNCTEST_H
#define _SYNCTEST_H
#include "ggpo_types.h"
#include "backend.h"
#include "sync.h"
#include "ring_buffer.h"
class SyncTestBackend : public IQuarkBackend {
public:
SyncTestBackend(GGPOSessionCallbacks *cb, const char *gamename, int frames, int num_players);
virtual ~SyncTestBackend();
virtual GGPOErrorCode DoPoll(int timeout);
virtual GGPOErrorCode AddPlayer(GGPOPlayer *player, GGPOPlayerHandle *handle);
virtual GGPOErrorCode AddLocalInput(GGPOPlayerHandle player, void *values, int size);
virtual GGPOErrorCode SyncInput(void *values, int size, int *disconnect_flags);
virtual GGPOErrorCode IncrementFrame(void);
virtual GGPOErrorCode Logv(char *fmt, va_list list);
protected:
struct SavedInfo {
int frame;
int checksum;
char *buf;
int cbuf;
GameInput input;
};
void RaiseSyncError(const char *fmt, ...);
void BeginLog(int saving);
void EndLog();
void LogSaveStates(SavedInfo &info);
protected:
GGPOSessionCallbacks _callbacks;
Sync _sync;
int _num_players;
int _check_distance;
int _last_verified;
bool _rollingback;
bool _running;
FILE *_logfp;
char _game[128];
GameInput _current_input;
GameInput _last_input;
RingBuffer<SavedInfo, 32> _saved_frames;
};
#endif
+55
View File
@@ -0,0 +1,55 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#include "ggpo_types.h"
#include "bitvector.h"
void
BitVector_SetBit(uint8 *vector, int *offset)
{
vector[(*offset) / 8] |= (1 << ((*offset) % 8));
*offset += 1;
}
void
BitVector_ClearBit(uint8 *vector, int *offset)
{
vector[(*offset) / 8] &= ~(1 << ((*offset) % 8));
*offset += 1;
}
void
BitVector_WriteNibblet(uint8 *vector, int nibble, int *offset)
{
ASSERT(nibble < (1 << BITVECTOR_NIBBLE_SIZE));
for (int i = 0; i < BITVECTOR_NIBBLE_SIZE; i++) {
if (nibble & (1 << i)) {
BitVector_SetBit(vector, offset);
} else {
BitVector_ClearBit(vector, offset);
}
}
}
int
BitVector_ReadBit(uint8 *vector, int *offset)
{
int retval = !!(vector[(*offset) / 8] & (1 << ((*offset) % 8)));
*offset += 1;
return retval;
}
int
BitVector_ReadNibblet(uint8 *vector, int *offset)
{
int nibblet = 0;
for (int i = 0; i < BITVECTOR_NIBBLE_SIZE; i++) {
nibblet |= (BitVector_ReadBit(vector, offset) << i);
}
return nibblet;
}
+19
View File
@@ -0,0 +1,19 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#ifndef _BITVECTOR_H
#define _BITVECTOR_H
#define BITVECTOR_NIBBLE_SIZE 8
void BitVector_SetBit(uint8 *vector, int *offset);
void BitVector_ClearBit(uint8 *vector, int *offset);
void BitVector_WriteNibblet(uint8 *vector, int nibble, int *offset);
int BitVector_ReadBit(uint8 *vector, int *offset);
int BitVector_ReadNibblet(uint8 *vector, int *offset);
#endif // _BITVECTOR_H
+89
View File
@@ -0,0 +1,89 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#include "game_input.h"
#include "ggpo_types.h"
#include "log.h"
void
GameInput::init(int iframe, char *ibits, int isize, int offset)
{
ASSERT(isize);
ASSERT(isize <= GAMEINPUT_MAX_BYTES);
frame = iframe;
size = isize;
memset(bits, 0, sizeof(bits));
if (ibits) {
memcpy(bits + (offset * isize), ibits, isize);
}
}
void
GameInput::init(int iframe, char *ibits, int isize)
{
ASSERT(isize);
ASSERT(isize <= GAMEINPUT_MAX_BYTES * GAMEINPUT_MAX_PLAYERS);
frame = iframe;
size = isize;
memset(bits, 0, sizeof(bits));
if (ibits) {
memcpy(bits, ibits, isize);
}
}
void
GameInput::desc(char *buf, size_t buf_size, bool show_frame) const
{
ASSERT(size);
size_t remaining = buf_size;
if (show_frame) {
remaining -= snprintf(buf, buf_size, "(frame:%d size:%d ", frame, size);
} else {
remaining -= snprintf(buf, buf_size, "(size:%d ", size);
}
for (int i = 0; i < size * 8; i++) {
char buf2[16];
if (value(i)) {
int c = snprintf(buf2, ARRAY_SIZE(buf2), "%2d ", i);
strncat(buf, buf2, ARRAY_SIZE(buf2));
remaining -= c;
}
}
strcat(buf, ")");
}
void
GameInput::log(char *prefix, bool show_frame) const
{
char buf[1024];
size_t c = strlen(prefix);
strcpy(buf, prefix);
desc(buf + c, ARRAY_SIZE(buf) - c, show_frame);
strcat(buf, "\n");
Log(buf);
}
bool
GameInput::equal(GameInput &other, bool bitsonly)
{
if (!bitsonly && frame != other.frame) {
Log("frames don't match: %d, %d\n", frame, other.frame);
}
if (size != other.size) {
Log("sizes don't match: %d, %d\n", size, other.size);
}
if (memcmp(bits, other.bits, size)) {
Log("bits don't match\n");
}
ASSERT(size && other.size);
return (bitsonly || frame == other.frame) &&
size == other.size &&
memcmp(bits, other.bits, size) == 0;
}
+40
View File
@@ -0,0 +1,40 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#ifndef _GAMEINPUT_H
#define _GAMEINPUT_H
#include <stdio.h>
#include <memory.h>
// GAMEINPUT_MAX_BYTES * GAMEINPUT_MAX_PLAYERS * 8 must be less than
// 2^BITVECTOR_NIBBLE_SIZE (see bitvector.h)
#define GAMEINPUT_MAX_BYTES 9
#define GAMEINPUT_MAX_PLAYERS 2
struct GameInput {
enum Constants {
NullFrame = -1
};
int frame;
int size; /* size in bytes of the entire input for all players */
char bits[GAMEINPUT_MAX_BYTES * GAMEINPUT_MAX_PLAYERS];
bool is_null() { return frame == NullFrame; }
void init(int frame, char *bits, int size, int offset);
void init(int frame, char *bits, int size);
bool value(int i) const { return (bits[i/8] & (1 << (i%8))) != 0; }
void set(int i) { bits[i/8] |= (1 << (i%8)); }
void clear(int i) { bits[i/8] &= ~(1 << (i%8)); }
void erase() { memset(bits, 0, sizeof(bits)); }
void desc(char *buf, size_t buf_size, bool show_frame = true) const;
void log(char *prefix, bool show_frame = true) const;
bool equal(GameInput &input, bool bitsonly = false);
};
#endif
+66
View File
@@ -0,0 +1,66 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#ifndef _POLL_H
#define _POLL_H
#include "static_buffer.h"
#define MAX_POLLABLE_HANDLES 64
class IPollSink {
public:
virtual ~IPollSink() { }
virtual bool OnHandlePoll(void *) { return true; }
virtual bool OnMsgPoll(void *) { return true; }
virtual bool OnPeriodicPoll(void *, int ) { return true; }
virtual bool OnLoopPoll(void *) { return true; }
};
class Poll {
public:
Poll(void);
// void RegisterHandle(IPollSink *sink, HANDLE h, void *cookie = NULL);
void RegisterMsgLoop(IPollSink *sink, void *cookie = NULL);
void RegisterPeriodic(IPollSink *sink, int interval, void *cookie = NULL);
void RegisterLoop(IPollSink *sink, void *cookie = NULL);
void Run();
bool Pump(int timeout);
protected:
int ComputeWaitTime(int elapsed);
struct PollSinkCb {
IPollSink *sink;
void *cookie;
PollSinkCb() : sink(NULL), cookie(NULL) { }
PollSinkCb(IPollSink *s, void *c) : sink(s), cookie(c) { }
};
struct PollPeriodicSinkCb : public PollSinkCb {
int interval;
int last_fired;
PollPeriodicSinkCb() : PollSinkCb(NULL, NULL), interval(0), last_fired(0) { }
PollPeriodicSinkCb(IPollSink *s, void *c, int i) :
PollSinkCb(s, c), interval(i), last_fired(0) { }
};
int _start_time;
int _handle_count;
#ifdef _WIN32
HANDLE _handles[MAX_POLLABLE_HANDLES];
#endif
PollSinkCb _handle_sinks[MAX_POLLABLE_HANDLES];
StaticBuffer<PollSinkCb, 16> _msg_sinks;
StaticBuffer<PollSinkCb, 16> _loop_sinks;
StaticBuffer<PollPeriodicSinkCb, 16> _periodic_sinks;
};
#endif
+99
View File
@@ -0,0 +1,99 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#ifndef _TYPES_H
#define _TYPES_H
/*
* Keep the compiler happy
*/
#ifdef _MSC_VER
/*
* Disable specific compiler warnings
* 4018 - '<' : signed/unsigned mismatch
* 4100 - 'xxx' : unreferenced formal parameter
* 4127 - conditional expression is constant
* 4201 - nonstandard extension used : nameless struct/union
* 4389 - '!=' : signed/unsigned mismatch
* 4800 - 'int' : forcing value to bool 'true' or 'false' (performance warning)
*/
#pragma warning(disable: 4018 4100 4127 4201 4389 4800)
#endif
#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_FAMILY_APP)
#define TARGET_UWP
#endif
/*
* Simple types
*/
typedef unsigned char uint8;
typedef unsigned short uint16;
typedef unsigned int uint32;
typedef unsigned char byte;
typedef char int8;
typedef short int16;
typedef int int32;
#include "ggponet.h"
#include <stdexcept>
class GGPOException : public std::runtime_error {
public:
GGPOException(const char *what, GGPOErrorCode ggpoError)
: std::runtime_error(what), ggpoError(ggpoError) {}
GGPOErrorCode ggpoError;
};
/*
* Additional headers
*/
#if defined(_WIN32)
# include "platform_windows.h"
#elif defined(__unix__) || defined(__APPLE__) || defined(__SWITCH__)
# include "platform_linux.h"
#else
# error Unsupported platform
#endif
#include "log.h"
/*
* Macros
*/
#define ASSERT(x) \
do { \
if (!(x)) { \
char assert_buf[1024]; \
snprintf(assert_buf, sizeof(assert_buf) - 1, "Assertion: %s @ %s:%d (pid:%ld)", #x, __FILE__, __LINE__, (long)GGPOPlatform::GetProcessID()); \
Log("%s\n", assert_buf); \
Log("\n"); \
Log("\n"); \
Log("\n"); \
GGPOPlatform::AssertFailed(assert_buf); \
exit(0); \
} \
} while (false)
#ifndef ARRAY_SIZE
# define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
#endif
#ifndef MAX_INT
# define MAX_INT 0xEFFFFFF
#endif
#ifndef MAX
# define MAX(x, y) (((x) > (y)) ? (x) : (y))
#endif
#ifndef MIN
# define MIN(x, y) (((x) < (y)) ? (x) : (y))
#endif
#endif // _TYPES_H
+321
View File
@@ -0,0 +1,321 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#include "input_queue.h"
#include "ggpo_types.h"
#define PREVIOUS_FRAME(offset) (((offset) == 0) ? (INPUT_QUEUE_LENGTH - 1) : ((offset) - 1))
InputQueue::InputQueue(int input_size)
{
Init(-1, input_size);
}
InputQueue::~InputQueue()
{
}
void
InputQueue::Init(int id, int input_size)
{
_id = id;
_head = 0;
_tail = 0;
_length = 0;
_frame_delay = 0;
_first_frame = true;
_last_user_added_frame = GameInput::NullFrame;
_first_incorrect_frame = GameInput::NullFrame;
_last_frame_requested = GameInput::NullFrame;
_last_added_frame = GameInput::NullFrame;
_prediction.init(GameInput::NullFrame, NULL, input_size);
/*
* This is safe because we know the GameInput is a proper structure (as in,
* no virtual methods, no contained classes, etc.).
*/
memset(_inputs, 0, sizeof _inputs);
for (size_t i = 0; i < ARRAY_SIZE(_inputs); i++) {
_inputs[i].size = input_size;
}
}
int
InputQueue::GetLastConfirmedFrame()
{
Log("returning last confirmed frame %d.\n", _last_added_frame);
return _last_added_frame;
}
int
InputQueue::GetFirstIncorrectFrame()
{
return _first_incorrect_frame;
}
void
InputQueue::DiscardConfirmedFrames(int frame)
{
ASSERT(frame >= 0);
if (_last_frame_requested != GameInput::NullFrame) {
frame = MIN(frame, _last_frame_requested);
}
Log("discarding confirmed frames up to %d (last_added:%d length:%d [head:%d tail:%d]).\n",
frame, _last_added_frame, _length, _head, _tail);
if (frame >= _last_added_frame) {
_tail = _head;
} else {
int offset = frame - _inputs[_tail].frame + 1;
Log("difference of %d frames.\n", offset);
ASSERT(offset >= 0);
_tail = (_tail + offset) % INPUT_QUEUE_LENGTH;
_length -= offset;
}
Log("after discarding, new tail is %d (frame:%d).\n", _tail, _inputs[_tail].frame);
ASSERT(_length >= 0);
}
void
InputQueue::ResetPrediction(int frame)
{
ASSERT(_first_incorrect_frame == GameInput::NullFrame || frame <= _first_incorrect_frame);
Log("resetting all prediction errors back to frame %d.\n", frame);
/*
* There's nothing really to do other than reset our prediction
* state and the incorrect frame counter...
*/
_prediction.frame = GameInput::NullFrame;
_first_incorrect_frame = GameInput::NullFrame;
_last_frame_requested = GameInput::NullFrame;
}
bool
InputQueue::GetConfirmedInput(int requested_frame, GameInput *input)
{
ASSERT(_first_incorrect_frame == GameInput::NullFrame || requested_frame < _first_incorrect_frame);
int offset = requested_frame % INPUT_QUEUE_LENGTH;
if (_inputs[offset].frame != requested_frame) {
return false;
}
*input = _inputs[offset];
return true;
}
bool
InputQueue::GetInput(int requested_frame, GameInput *input)
{
Log("requesting input frame %d.\n", requested_frame);
/*
* No one should ever try to grab any input when we have a prediction
* error. Doing so means that we're just going further down the wrong
* path. ASSERT this to verify that it's true.
*/
ASSERT(_first_incorrect_frame == GameInput::NullFrame);
/*
* Remember the last requested frame number for later. We'll need
* this in AddInput() to drop out of prediction mode.
*/
_last_frame_requested = requested_frame;
ASSERT(requested_frame >= _inputs[_tail].frame);
if (_prediction.frame == GameInput::NullFrame) {
/*
* If the frame requested is in our range, fetch it out of the queue and
* return it.
*/
int offset = requested_frame - _inputs[_tail].frame;
if (offset < _length) {
offset = (offset + _tail) % INPUT_QUEUE_LENGTH;
ASSERT(_inputs[offset].frame == requested_frame);
*input = _inputs[offset];
Log("returning confirmed frame number %d.\n", input->frame);
return true;
}
/*
* The requested frame isn't in the queue. Bummer. This means we need
* to return a prediction frame. Predict that the user will do the
* same thing they did last time.
*/
if (requested_frame == 0) {
Log("basing new prediction frame from nothing, you're client wants frame 0.\n");
_prediction.erase();
} else if (_last_added_frame == GameInput::NullFrame) {
Log("basing new prediction frame from nothing, since we have no frames yet.\n");
_prediction.erase();
} else {
Log("basing new prediction frame from previously added frame (queue entry:%d, frame:%d).\n",
PREVIOUS_FRAME(_head), _inputs[PREVIOUS_FRAME(_head)].frame);
_prediction = _inputs[PREVIOUS_FRAME(_head)];
}
_prediction.frame++;
}
ASSERT(_prediction.frame >= 0);
/*
* If we've made it this far, we must be predicting. Go ahead and
* forward the prediction frame contents. Be sure to return the
* frame number requested by the client, though.
*/
*input = _prediction;
input->frame = requested_frame;
Log("returning prediction frame number %d (%d).\n", input->frame, _prediction.frame);
return false;
}
void
InputQueue::AddInput(GameInput &input)
{
int new_frame;
Log("adding input frame number %d to queue.\n", input.frame);
/*
* These next two lines simply verify that inputs are passed in
* sequentially by the user, regardless of frame delay.
*/
ASSERT(_last_user_added_frame == GameInput::NullFrame ||
input.frame == _last_user_added_frame + 1);
_last_user_added_frame = input.frame;
/*
* Move the queue head to the correct point in preparation to
* input the frame into the queue.
*/
new_frame = AdvanceQueueHead(input.frame);
if (new_frame != GameInput::NullFrame) {
AddDelayedInputToQueue(input, new_frame);
}
/*
* Update the frame number for the input. This will also set the
* frame to GameInput::NullFrame for frames that get dropped (by
* design).
*/
input.frame = new_frame;
}
void
InputQueue::AddDelayedInputToQueue(GameInput &input, int frame_number)
{
Log("adding delayed input frame number %d to queue.\n", frame_number);
if (input.size != _prediction.size)
throw GGPOException("Input size differs from peer", GGPO_ERRORCODE_INPUT_SIZE_DIFF);
ASSERT(_last_added_frame == GameInput::NullFrame || frame_number == _last_added_frame + 1);
ASSERT(frame_number == 0 || _inputs[PREVIOUS_FRAME(_head)].frame == frame_number - 1);
/*
* Add the frame to the back of the queue
*/
_inputs[_head] = input;
_inputs[_head].frame = frame_number;
_head = (_head + 1) % INPUT_QUEUE_LENGTH;
_length++;
_first_frame = false;
_last_added_frame = frame_number;
if (_prediction.frame != GameInput::NullFrame) {
ASSERT(frame_number == _prediction.frame);
/*
* We've been predicting... See if the inputs we've gotten match
* what we've been predicting. If so, don't worry about it. If not,
* remember the first input which was incorrect so we can report it
* in GetFirstIncorrectFrame()
*/
if (_first_incorrect_frame == GameInput::NullFrame && !_prediction.equal(input, true)) {
Log("frame %d does not match prediction. marking error.\n", frame_number);
_first_incorrect_frame = frame_number;
}
/*
* If this input is the same frame as the last one requested and we
* still haven't found any mis-predicted inputs, we can dump out
* of predition mode entirely! Otherwise, advance the prediction frame
* count up.
*/
if (_prediction.frame == _last_frame_requested && _first_incorrect_frame == GameInput::NullFrame) {
Log("prediction is correct! dumping out of prediction mode.\n");
_prediction.frame = GameInput::NullFrame;
} else {
_prediction.frame++;
}
}
ASSERT(_length <= INPUT_QUEUE_LENGTH);
}
int
InputQueue::AdvanceQueueHead(int frame)
{
Log("advancing queue head to frame %d.\n", frame);
int expected_frame = _first_frame ? 0 : _inputs[PREVIOUS_FRAME(_head)].frame + 1;
frame += _frame_delay;
if (expected_frame > frame) {
/*
* This can occur when the frame delay has dropped since the last
* time we shoved a frame into the system. In this case, there's
* no room on the queue. Toss it.
*/
Log("Dropping input frame %d (expected next frame to be %d).\n",
frame, expected_frame);
return GameInput::NullFrame;
}
while (expected_frame < frame) {
/*
* This can occur when the frame delay has been increased since the last
* time we shoved a frame into the system. We need to replicate the
* last frame in the queue several times in order to fill the space
* left.
*/
Log("Adding padding frame %d to account for change in frame delay.\n",
expected_frame);
GameInput &last_frame = _inputs[PREVIOUS_FRAME(_head)];
AddDelayedInputToQueue(last_frame, expected_frame);
expected_frame++;
}
ASSERT(frame == 0 || frame == _inputs[PREVIOUS_FRAME(_head)].frame + 1);
return frame;
}
void
InputQueue::Log(const char *fmt, ...)
{
char buf[1024];
size_t offset;
va_list args;
offset = snprintf(buf, ARRAY_SIZE(buf), "input q%d | ", _id);
va_start(args, fmt);
vsnprintf(buf + offset, ARRAY_SIZE(buf) - offset - 1, fmt, args);
buf[ARRAY_SIZE(buf)-1] = '\0';
::Log(buf);
va_end(args);
}
+60
View File
@@ -0,0 +1,60 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#ifndef _INPUT_QUEUE_H
#define _INPUT_QUEUE_H
#include "game_input.h"
#define INPUT_QUEUE_LENGTH 128
#define DEFAULT_INPUT_SIZE 4
class InputQueue {
public:
InputQueue(int input_size = DEFAULT_INPUT_SIZE);
~InputQueue();
public:
void Init(int id, int input_size);
int GetLastConfirmedFrame();
int GetFirstIncorrectFrame();
int GetLength() { return _length; }
void SetFrameDelay(int delay) { _frame_delay = delay; }
void ResetPrediction(int frame);
void DiscardConfirmedFrames(int frame);
bool GetConfirmedInput(int frame, GameInput *input);
bool GetInput(int frame, GameInput *input);
void AddInput(GameInput &input);
protected:
int AdvanceQueueHead(int frame);
void AddDelayedInputToQueue(GameInput &input, int i);
void Log(const char *fmt, ...);
protected:
int _id;
int _head;
int _tail;
int _length;
bool _first_frame;
int _last_user_added_frame;
int _last_added_frame;
int _first_incorrect_frame;
int _last_frame_requested;
int _frame_delay;
GameInput _inputs[INPUT_QUEUE_LENGTH];
GameInput _prediction;
};
#endif
+31
View File
@@ -0,0 +1,31 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#include "ggpo_types.h"
#include "log/Log.h"
#include "log/LogManager.h"
#include <string>
void Log(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
Logv(fmt, args);
va_end(args);
}
void Logv(const char* fmt, va_list args)
{
std::string copy;
if (fmt[strlen(fmt) - 1] == '\n') {
copy = fmt;
copy.pop_back();
fmt = copy.c_str();
}
if (LogManager::GetInstance())
LogManager::GetInstance()->Log(LogTypes::LDEBUG, LogTypes::NETWORK, __FILE__, __LINE__, fmt, args);
}
+14
View File
@@ -0,0 +1,14 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#ifndef _LOG_H
#define _LOG_H
extern void Log(const char *fmt, ...);
extern void Logv(const char *fmt, va_list list);
#endif
+276
View File
@@ -0,0 +1,276 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#include "backends/p2p.h"
#include "backends/synctest.h"
#include "backends/spectator.h"
#include "ggpo_types.h"
#include "ggponet.h"
struct Init
{
Init() {
srand(GGPOPlatform::GetCurrentTimeMS() + GGPOPlatform::GetProcessID());
#ifdef _WIN32
WSADATA wsaData;
WSAStartup(MAKEWORD(2, 0), &wsaData);
#endif
}
};
static Init init;
void
ggpo_log(GGPOSession *ggpo, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
ggpo_logv(ggpo, fmt, args);
va_end(args);
}
void
ggpo_logv(GGPOSession *ggpo, const char *fmt, va_list args)
{
if (ggpo)
ggpo->Logv(fmt, args);
}
GGPOErrorCode
ggpo_start_session(GGPOSession **session,
GGPOSessionCallbacks *cb,
const char *game,
int num_players,
int input_size,
unsigned short localport,
const void *verification,
int verification_size)
{
try {
*session= (GGPOSession *)new Peer2PeerBackend(cb,
game,
localport,
num_players,
input_size,
verification,
verification_size);
return GGPO_OK;
} catch (const GGPOException& e) {
Log("GGPOException in ggpo_start_session: %s", e.what());
return e.ggpoError;
}
}
GGPOErrorCode
ggpo_add_player(GGPOSession *ggpo,
GGPOPlayer *player,
GGPOPlayerHandle *handle)
{
if (!ggpo)
return GGPO_ERRORCODE_INVALID_SESSION;
try {
return ggpo->AddPlayer(player, handle);
} catch (const GGPOException& e) {
Log("GGPOException in ggpo_add_player: %s", e.what());
return e.ggpoError;
}
}
GGPOErrorCode
ggpo_start_synctest(GGPOSession **ggpo,
GGPOSessionCallbacks *cb,
const char *game,
int num_players,
int input_size,
int frames)
{
try {
*ggpo = (GGPOSession *)new SyncTestBackend(cb, game, frames, num_players);
return GGPO_OK;
} catch (const GGPOException& e) {
Log("GGPOException in ggpo_start_synctest: %s", e.what());
return e.ggpoError;
}
}
GGPOErrorCode
ggpo_set_frame_delay(GGPOSession *ggpo,
GGPOPlayerHandle player,
int frame_delay)
{
if (!ggpo)
return GGPO_ERRORCODE_INVALID_SESSION;
try {
return ggpo->SetFrameDelay(player, frame_delay);
} catch (const GGPOException& e) {
Log("GGPOException in ggpo_set_frame_delay: %s", e.what());
return e.ggpoError;
}
}
GGPOErrorCode
ggpo_idle(GGPOSession *ggpo, int timeout)
{
if (!ggpo)
return GGPO_ERRORCODE_INVALID_SESSION;
try {
return ggpo->DoPoll(timeout);
} catch (const GGPOException& e) {
Log("GGPOException in ggpo_idle: %s", e.what());
return e.ggpoError;
}
}
GGPOErrorCode
ggpo_add_local_input(GGPOSession *ggpo,
GGPOPlayerHandle player,
void *values,
int size)
{
if (!ggpo)
return GGPO_ERRORCODE_INVALID_SESSION;
try {
return ggpo->AddLocalInput(player, values, size);
} catch (const GGPOException& e) {
Log("GGPOException in ggpo_add_local_input: %s", e.what());
return e.ggpoError;
}
}
GGPOErrorCode
ggpo_synchronize_input(GGPOSession *ggpo,
void *values,
int size,
int *disconnect_flags)
{
if (!ggpo)
return GGPO_ERRORCODE_INVALID_SESSION;
try {
return ggpo->SyncInput(values, size, disconnect_flags);
} catch (const GGPOException& e) {
Log("GGPOException in ggpo_synchronize_input: %s", e.what());
return e.ggpoError;
}
}
GGPOErrorCode ggpo_disconnect_player(GGPOSession *ggpo,
GGPOPlayerHandle player)
{
if (!ggpo)
return GGPO_ERRORCODE_INVALID_SESSION;
try {
return ggpo->DisconnectPlayer(player);
} catch (const GGPOException& e) {
Log("GGPOException in ggpo_disconnect_player: %s", e.what());
return e.ggpoError;
}
}
GGPOErrorCode
ggpo_advance_frame(GGPOSession *ggpo)
{
if (!ggpo)
return GGPO_ERRORCODE_INVALID_SESSION;
try {
return ggpo->IncrementFrame();
} catch (const GGPOException& e) {
Log("GGPOException in ggpo_advance_frame: %s", e.what());
return e.ggpoError;
}
}
GGPOErrorCode
ggpo_get_network_stats(GGPOSession *ggpo,
GGPOPlayerHandle player,
GGPONetworkStats *stats)
{
if (!ggpo)
return GGPO_ERRORCODE_INVALID_SESSION;
try {
return ggpo->GetNetworkStats(stats, player);
} catch (const GGPOException& e) {
Log("GGPOException in ggpo_get_network_stats: %s", e.what());
return e.ggpoError;
}
}
GGPOErrorCode
ggpo_close_session(GGPOSession *ggpo)
{
if (!ggpo) {
return GGPO_ERRORCODE_INVALID_SESSION;
}
delete ggpo;
return GGPO_OK;
}
GGPOErrorCode
ggpo_set_disconnect_timeout(GGPOSession *ggpo, int timeout)
{
if (!ggpo)
return GGPO_ERRORCODE_INVALID_SESSION;
try {
return ggpo->SetDisconnectTimeout(timeout);
} catch (const GGPOException& e) {
Log("GGPOException in ggpo_set_disconnect_timeout: %s", e.what());
return e.ggpoError;
}
}
GGPOErrorCode
ggpo_set_disconnect_notify_start(GGPOSession *ggpo, int timeout)
{
if (!ggpo)
return GGPO_ERRORCODE_INVALID_SESSION;
try {
return ggpo->SetDisconnectNotifyStart(timeout);
} catch (const GGPOException& e) {
Log("GGPOException in ggpo_set_disconnect_notify_start: %s", e.what());
return e.ggpoError;
}
}
GGPOErrorCode ggpo_start_spectating(GGPOSession **session,
GGPOSessionCallbacks *cb,
const char *game,
int num_players,
int input_size,
unsigned short local_port,
char *host_ip,
unsigned short host_port,
const void *verification,
int verification_size)
{
try {
*session= (GGPOSession *)new SpectatorBackend(cb,
game,
local_port,
num_players,
input_size,
host_ip,
host_port,
verification,
verification_size);
return GGPO_OK;
} catch (const GGPOException& e) {
Log("GGPOException in ggpo_start_spectating: %s", e.what());
return e.ggpoError;
}
}
GGPOErrorCode ggpo_send_message(GGPOSession *ggpo,
const void *msg,
int len,
bool spectators)
{
if (ggpo == nullptr)
return GGPO_ERRORCODE_INVALID_SESSION;
return ggpo->SendMessage(msg, len, spectators);
}
+130
View File
@@ -0,0 +1,130 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#include "ggpo_types.h"
#include "udp.h"
SOCKET
CreateSocket(uint16 bind_port, int retries)
{
SOCKET s;
sockaddr_in sin;
uint16 port;
int optval = 1;
s = socket(AF_INET, SOCK_DGRAM, 0);
setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (const char *)&optval, sizeof optval);
optval = 0;
setsockopt(s, SOL_SOCKET, SO_LINGER, (const char *)&optval, sizeof optval);
// non-blocking...
#ifndef _WIN32
fcntl(s, F_SETFL, O_NONBLOCK);
#else
u_long iMode = 1;
ioctlsocket(s, FIONBIO, &iMode);
#endif
sin.sin_family = AF_INET;
sin.sin_addr.s_addr = htonl(INADDR_ANY);
for (port = bind_port; port <= bind_port + retries; port++) {
sin.sin_port = htons(port);
if (bind(s, (sockaddr *)&sin, sizeof sin) == 0) {
Log("Udp bound to port: %d.\n", port);
return s;
}
}
closesocket(s);
return INVALID_SOCKET;
}
Udp::Udp() :
_socket(INVALID_SOCKET),
_callbacks(NULL)
{
}
Udp::~Udp(void)
{
if (_socket != INVALID_SOCKET) {
closesocket(_socket);
_socket = INVALID_SOCKET;
}
}
void
Udp::Init(uint16 port, Poll *poll, Callbacks *callbacks)
{
_callbacks = callbacks;
poll->RegisterLoop(this);
Log("binding udp socket to port %d.\n", port);
_socket = CreateSocket(port, 0);
if (_socket == INVALID_SOCKET)
throw GGPOException("Socket creation or bind failed", GGPO_ERRORCODE_NETWORK_ERROR);
}
void
Udp::SendTo(char *buffer, int len, int flags, struct sockaddr *dst, int destlen)
{
struct sockaddr_in *to = (struct sockaddr_in *)dst;
int res = sendto(_socket, buffer, len, flags, dst, destlen);
if (res == SOCKET_ERROR) {
int err = WSAGetLastError();
Log("unknown error in sendto (erro: %d wsaerr: %d).\n", res, err);
ASSERT(false && "Unknown error in sendto");
}
char dst_ip[1024];
Log("sent packet length %d to %s:%d (ret:%d).\n", len, inet_ntop(AF_INET, (void *)&to->sin_addr, dst_ip, ARRAY_SIZE(dst_ip)), ntohs(to->sin_port), res);
}
bool
Udp::OnLoopPoll(void *cookie)
{
uint8 recv_buf[MAX_UDP_PACKET_SIZE];
sockaddr_in recv_addr;
socklen_t recv_addr_len;
for (;;) {
recv_addr_len = sizeof(recv_addr);
int len = recvfrom(_socket, (char *)recv_buf, MAX_UDP_PACKET_SIZE, 0, (struct sockaddr *)&recv_addr, &recv_addr_len);
// TODO: handle len == 0... indicates a disconnect.
if (len == -1) {
int error = WSAGetLastError();
if (error != WSAEWOULDBLOCK) {
Log("recvfrom WSAGetLastError returned %d (%x).\n", error, error);
}
break;
} else if (len > 0) {
char src_ip[1024];
Log("recvfrom returned (len:%d from:%s:%d).\n", len, inet_ntop(AF_INET, (void*)&recv_addr.sin_addr, src_ip, ARRAY_SIZE(src_ip)), ntohs(recv_addr.sin_port) );
UdpMsg *msg = (UdpMsg *)recv_buf;
_callbacks->OnMsg(recv_addr, msg, len);
}
}
return true;
}
void
Udp::Log(const char *fmt, ...)
{
char buf[1024];
size_t offset;
va_list args;
strcpy(buf, "udp | ");
offset = strlen(buf);
va_start(args, fmt);
vsnprintf(buf + offset, ARRAY_SIZE(buf) - offset - 1, fmt, args);
buf[ARRAY_SIZE(buf)-1] = '\0';
::Log(buf);
va_end(args);
}
+58
View File
@@ -0,0 +1,58 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#ifndef _UDP_H
#define _UDP_H
#include "ggpo_poll.h"
#include "udp_msg.h"
#include "ggponet.h"
#include "ring_buffer.h"
#define MAX_UDP_ENDPOINTS 16
constexpr size_t MAX_UDP_PACKET_SIZE = sizeof(UdpMsg);
class Udp : public IPollSink
{
public:
struct Stats {
int bytes_sent;
int packets_sent;
float kbps_sent;
};
struct Callbacks {
virtual ~Callbacks() { }
virtual void OnMsg(sockaddr_in &from, UdpMsg *msg, int len) = 0;
};
protected:
void Log(const char *fmt, ...);
public:
Udp();
void Init(uint16 port, Poll *p, Callbacks *callbacks);
void SendTo(char *buffer, int len, int flags, struct sockaddr *dst, int destlen);
virtual bool OnLoopPoll(void *cookie);
public:
~Udp(void);
protected:
// Network transmission information
SOCKET _socket;
// state management
Callbacks *_callbacks;
};
#endif
+121
View File
@@ -0,0 +1,121 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#ifndef _UDP_MSG_H
#define _UDP_MSG_H
#define MAX_COMPRESSED_BITS 4096
#define UDP_MSG_MAX_PLAYERS 4
#define MAX_VERIFICATION_SIZE 256
#define MAX_APPDATA_SIZE 512
#pragma pack(push, 1)
struct UdpMsg
{
enum MsgType {
Invalid = 0,
SyncRequest = 1,
SyncReply = 2,
Input = 3,
QualityReport = 4,
QualityReply = 5,
KeepAlive = 6,
InputAck = 7,
AppData = 8
};
struct connect_status {
unsigned int disconnected:1;
int last_frame:31;
};
struct {
uint16 magic;
uint16 sequence_number;
uint8 type; /* packet type */
} hdr;
union {
struct {
uint32 random_request; /* please reply back with this random data */
uint16 remote_magic;
uint8 remote_endpoint;
uint8 verification[MAX_VERIFICATION_SIZE];
} sync_request;
struct {
uint32 random_reply; /* OK, here's your random data back */
uint8 verification_failure; /* set to one by peer if verification failed */
} sync_reply;
struct {
int8 frame_advantage; /* what's the other guy's frame advantage? */
uint32 ping;
} quality_report;
struct {
uint32 pong;
} quality_reply;
struct {
connect_status peer_connect_status[UDP_MSG_MAX_PLAYERS];
uint32 start_frame;
int disconnect_requested:1;
int ack_frame:31;
uint16 num_bits;
uint8 input_size; // XXX: shouldn't be in every single packet!
uint8 bits[MAX_COMPRESSED_BITS / 8]; /* must be last */
} input;
struct {
int ack_frame:31;
} input_ack;
struct {
uint16 size;
uint8 spectators;
uint8 data[MAX_APPDATA_SIZE];
} app_data;
} u;
int verification_size = 0;
public:
int PacketSize() {
return sizeof(hdr) + PayloadSize();
}
int PayloadSize() {
switch (hdr.type) {
case SyncRequest: return (int)(&u.sync_request.verification[0] - (uint8 *)&u) + verification_size;
case SyncReply: return sizeof(u.sync_reply);
case QualityReport: return sizeof(u.quality_report);
case QualityReply: return sizeof(u.quality_reply);
case InputAck: return sizeof(u.input_ack);
case KeepAlive: return 0;
case Input:
{
int size = (int)((char *)&u.input.bits - (char *)&u.input);
size += (u.input.num_bits + 7) / 8;
return size;
}
case AppData: return sizeof(u.app_data) - sizeof(u.app_data.data) + u.app_data.size;
}
ASSERT(false);
return 0;
}
UdpMsg(MsgType t) { hdr.type = (uint8)t; }
};
#pragma pack(pop)
#endif
@@ -0,0 +1,830 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#include "udp_proto.h"
#include "../ggpo_types.h"
#include "bitvector.h"
static const int UDP_HEADER_SIZE = 28; /* Size of IP + UDP headers */
static const int NUM_SYNC_PACKETS = 5;
static const int SYNC_RETRY_INTERVAL = 2000;
static const int SYNC_FIRST_RETRY_INTERVAL = 500;
static const int RUNNING_RETRY_INTERVAL = 200;
static const int KEEP_ALIVE_INTERVAL = 200;
static const int QUALITY_REPORT_INTERVAL = 1000;
static const int NETWORK_STATS_INTERVAL = 1000;
static const int UDP_SHUTDOWN_TIMER = 5000;
static const int MAX_SEQ_DISTANCE = (1 << 15);
UdpProtocol::UdpProtocol() :
_udp(NULL),
_magic_number(0),
_queue(-1),
_remote_magic_number(0),
_connected(false),
_packets_sent(0),
_bytes_sent(0),
_stats_start_time(0),
_local_frame_advantage(0),
_remote_frame_advantage(0),
_last_send_time(0),
_shutdown_timeout(0),
_disconnect_event_sent(false),
_disconnect_timeout(0),
_disconnect_notify_start(0),
_disconnect_notify_sent(false),
_next_send_seq(0),
_next_recv_seq(0)
{
_last_sent_input.init(-1, NULL, 1);
_last_received_input.init(-1, NULL, 1);
_last_acked_input.init(-1, NULL, 1);
memset(&_state, 0, sizeof _state);
memset(_peer_connect_status, 0, sizeof(_peer_connect_status));
for (unsigned i = 0; i < ARRAY_SIZE(_peer_connect_status); i++) {
_peer_connect_status[i].last_frame = -1;
}
memset(&_peer_addr, 0, sizeof _peer_addr);
_oo_packet.msg = NULL;
_send_latency = GGPOPlatform::GetConfigInt("GGPO_NETWORK_DELAY");
_oop_percent = GGPOPlatform::GetConfigInt("GGPO_OOP_PERCENT");
}
UdpProtocol::~UdpProtocol()
{
ClearSendQueue();
}
void
UdpProtocol::Init(Udp *udp,
Poll &poll,
int queue,
char *ip,
u_short port,
UdpMsg::connect_status *status)
{
_udp = udp;
_queue = queue;
_local_connect_status = status;
_peer_addr.sin_family = AF_INET;
if (ip != nullptr && ip[0] != '\0')
{
_peer_addr.sin_port = htons(port);
inet_pton(AF_INET, ip, &_peer_addr.sin_addr.s_addr);
}
do {
_magic_number = (uint16)rand();
} while (_magic_number == 0);
poll.RegisterLoop(this);
}
void
UdpProtocol::SendInput(GameInput &input)
{
if (_udp) {
if (_current_state == Running) {
/*
* Check to see if this is a good time to adjust for the rift...
*/
_timesync.advance_frame(input, _local_frame_advantage, _remote_frame_advantage);
/*
* Save this input packet
*
* XXX: This queue may fill up for spectators who do not ack input packets in a timely
* manner. When this happens, we can either resize the queue (ug) or disconnect them
* (better, but still ug). For the meantime, make this queue really big to decrease
* the odds of this happening...
*/
_pending_output.push(input);
}
SendPendingOutput();
}
}
void
UdpProtocol::SendPendingOutput()
{
UdpMsg *msg = new UdpMsg(UdpMsg::Input);
int i, j, offset = 0;
uint8 *bits;
GameInput last;
if (_pending_output.size()) {
last = _last_acked_input;
bits = msg->u.input.bits;
msg->u.input.start_frame = _pending_output.front().frame;
msg->u.input.input_size = (uint8)_pending_output.front().size;
ASSERT(last.frame == -1 || last.frame + 1 == (int)msg->u.input.start_frame);
for (j = 0; j < _pending_output.size(); j++) {
GameInput &current = _pending_output.item(j);
if (memcmp(current.bits, last.bits, current.size) != 0) {
ASSERT((GAMEINPUT_MAX_BYTES * GAMEINPUT_MAX_PLAYERS * 8) < (1 << BITVECTOR_NIBBLE_SIZE));
for (i = 0; i < current.size * 8; i++) {
ASSERT(i < (1 << BITVECTOR_NIBBLE_SIZE));
if (current.value(i) != last.value(i)) {
BitVector_SetBit(msg->u.input.bits, &offset);
(current.value(i) ? BitVector_SetBit : BitVector_ClearBit)(bits, &offset);
BitVector_WriteNibblet(bits, i, &offset);
}
}
}
BitVector_ClearBit(msg->u.input.bits, &offset);
last = _last_sent_input = current;
}
} else {
msg->u.input.start_frame = 0;
msg->u.input.input_size = 0;
}
msg->u.input.ack_frame = _last_received_input.frame;
msg->u.input.num_bits = (uint16)offset;
msg->u.input.disconnect_requested = _current_state == Disconnected;
if (_local_connect_status) {
memcpy(msg->u.input.peer_connect_status, _local_connect_status, sizeof(UdpMsg::connect_status) * UDP_MSG_MAX_PLAYERS);
} else {
memset(msg->u.input.peer_connect_status, 0, sizeof(UdpMsg::connect_status) * UDP_MSG_MAX_PLAYERS);
}
ASSERT(offset < MAX_COMPRESSED_BITS);
SendMsg(msg);
}
void
UdpProtocol::SendInputAck()
{
UdpMsg *msg = new UdpMsg(UdpMsg::InputAck);
msg->u.input_ack.ack_frame = _last_received_input.frame;
SendMsg(msg);
}
bool
UdpProtocol::GetEvent(UdpProtocol::Event &e)
{
if (_event_queue.size() == 0) {
return false;
}
e = _event_queue.front();
_event_queue.pop();
return true;
}
bool
UdpProtocol::OnLoopPoll(void *cookie)
{
if (!_udp) {
return true;
}
unsigned int now = GGPOPlatform::GetCurrentTimeMS();
unsigned int next_interval;
PumpSendQueue();
switch (_current_state) {
case Syncing:
next_interval = (_state.sync.roundtrips_remaining == NUM_SYNC_PACKETS) ? SYNC_FIRST_RETRY_INTERVAL : SYNC_RETRY_INTERVAL;
if (_last_send_time && _last_send_time + next_interval < now && _peer_addr.sin_addr.s_addr != 0) {
Log("No luck syncing after %d ms... Re-queueing sync packet.\n", next_interval);
SendSyncRequest();
}
break;
case Running:
// xxx: rig all this up with a timer wrapper
if (!_state.running.last_input_packet_recv_time || _state.running.last_input_packet_recv_time + RUNNING_RETRY_INTERVAL < now) {
Log("Haven't exchanged packets in a while (last received:%d last sent:%d). Resending.\n", _last_received_input.frame, _last_sent_input.frame);
SendPendingOutput();
_state.running.last_input_packet_recv_time = now;
}
if (!_state.running.last_quality_report_time || _state.running.last_quality_report_time + QUALITY_REPORT_INTERVAL < now) {
UdpMsg *msg = new UdpMsg(UdpMsg::QualityReport);
msg->u.quality_report.ping = GGPOPlatform::GetCurrentTimeMS();
msg->u.quality_report.frame_advantage = (uint8)_local_frame_advantage;
SendMsg(msg);
_state.running.last_quality_report_time = now;
}
if (!_state.running.last_network_stats_interval || _state.running.last_network_stats_interval + NETWORK_STATS_INTERVAL < now) {
UpdateNetworkStats();
_state.running.last_network_stats_interval = now;
}
if (_last_send_time && _last_send_time + KEEP_ALIVE_INTERVAL < now) {
Log("Sending keep alive packet\n");
SendMsg(new UdpMsg(UdpMsg::KeepAlive));
}
if (_disconnect_timeout && _disconnect_notify_start &&
!_disconnect_notify_sent && (_last_recv_time + _disconnect_notify_start < now)) {
Log("Endpoint has stopped receiving packets for %d ms. Sending notification.\n", _disconnect_notify_start);
Event e(Event::NetworkInterrupted);
e.u.network_interrupted.disconnect_timeout = _disconnect_timeout - _disconnect_notify_start;
QueueEvent(e);
_disconnect_notify_sent = true;
}
if (_disconnect_timeout && (_last_recv_time + _disconnect_timeout < now)) {
if (!_disconnect_event_sent) {
Log("Endpoint has stopped receiving packets for %d ms. Disconnecting.\n", _disconnect_timeout);
QueueEvent(Event(Event::Disconnected));
_disconnect_event_sent = true;
}
}
break;
case Disconnected:
if (_shutdown_timeout < now) {
Log("Shutting down udp connection.\n");
_udp = NULL;
_shutdown_timeout = 0;
}
break;
default:
break;
}
return true;
}
void
UdpProtocol::Disconnect()
{
_current_state = Disconnected;
_shutdown_timeout = GGPOPlatform::GetCurrentTimeMS() + UDP_SHUTDOWN_TIMER;
}
void
UdpProtocol::SendSyncRequest()
{
_state.sync.random = rand() & 0xFFFF;
UdpMsg *msg = new UdpMsg(UdpMsg::SyncRequest);
msg->u.sync_request.random_request = _state.sync.random;
msg->verification_size = verification.size();
if (!verification.empty())
memcpy(&msg->u.sync_request.verification[0], &verification[0], verification.size());
SendMsg(msg);
}
void
UdpProtocol::SendMsg(UdpMsg *msg)
{
LogMsg("send", msg);
{
std::lock_guard<std::mutex> lock(_send_mutex);
_packets_sent++;
_last_send_time = GGPOPlatform::GetCurrentTimeMS();
_bytes_sent += msg->PacketSize();
msg->hdr.magic = _magic_number;
msg->hdr.sequence_number = _next_send_seq++;
_send_queue.push(QueueEntry(GGPOPlatform::GetCurrentTimeMS(), _peer_addr, msg));
}
PumpSendQueue();
}
bool
UdpProtocol::HandlesMsg(sockaddr_in &from,
UdpMsg *msg)
{
if (!_udp) {
return false;
}
if (_peer_addr.sin_addr.s_addr == 0)
{
_peer_addr.sin_addr.s_addr = from.sin_addr.s_addr;
_peer_addr.sin_port = from.sin_port;
return true;
}
return _peer_addr.sin_addr.s_addr == from.sin_addr.s_addr &&
_peer_addr.sin_port == from.sin_port;
}
void
UdpProtocol::OnMsg(UdpMsg *msg, int len)
{
bool handled = false;
typedef bool (UdpProtocol::*DispatchFn)(UdpMsg *msg, int len);
static const DispatchFn table[] = {
&UdpProtocol::OnInvalid, /* Invalid */
&UdpProtocol::OnSyncRequest, /* SyncRequest */
&UdpProtocol::OnSyncReply, /* SyncReply */
&UdpProtocol::OnInput, /* Input */
&UdpProtocol::OnQualityReport, /* QualityReport */
&UdpProtocol::OnQualityReply, /* QualityReply */
&UdpProtocol::OnKeepAlive, /* KeepAlive */
&UdpProtocol::OnInputAck, /* InputAck */
&UdpProtocol::OnAppData, /* AppData */
};
// filter out messages that don't match what we expect
uint16 seq = msg->hdr.sequence_number;
if (msg->hdr.type != UdpMsg::SyncRequest &&
msg->hdr.type != UdpMsg::SyncReply) {
if (msg->hdr.magic != _remote_magic_number) {
LogMsg("recv rejecting", msg);
return;
}
// filter out out-of-order packets
uint16 skipped = (uint16)((int)seq - (int)_next_recv_seq);
// Log("checking sequence number -> next - seq : %d - %d = %d\n", seq, _next_recv_seq, skipped);
if (skipped > MAX_SEQ_DISTANCE) {
Log("dropping out of order packet (seq: %d, last seq:%d)\n", seq, _next_recv_seq);
return;
}
}
_next_recv_seq = seq;
LogMsg("recv", msg);
if (msg->hdr.type >= ARRAY_SIZE(table)) {
OnInvalid(msg, len);
} else {
handled = (this->*(table[msg->hdr.type]))(msg, len);
}
if (handled) {
_last_recv_time = GGPOPlatform::GetCurrentTimeMS();
if (_disconnect_notify_sent && _current_state == Running) {
QueueEvent(Event(Event::NetworkResumed));
_disconnect_notify_sent = false;
}
}
}
void
UdpProtocol::UpdateNetworkStats(void)
{
int now = GGPOPlatform::GetCurrentTimeMS();
if (_stats_start_time == 0) {
_stats_start_time = now;
}
int total_bytes_sent = _bytes_sent + (UDP_HEADER_SIZE * _packets_sent);
float seconds = (float)((now - _stats_start_time) / 1000.0);
float Bps = total_bytes_sent / seconds;
float udp_overhead = (float)(100.0 * (UDP_HEADER_SIZE * _packets_sent) / _bytes_sent);
_kbps_sent = int(Bps / 1024);
Log("Network Stats -- Bandwidth: %.2f KBps Packets Sent: %5d (%.2f pps) "
"KB Sent: %.2f UDP Overhead: %.2f %%.\n",
_kbps_sent,
_packets_sent,
(float)_packets_sent * 1000 / (now - _stats_start_time),
total_bytes_sent / 1024.0,
udp_overhead);
}
void
UdpProtocol::QueueEvent(const UdpProtocol::Event &evt)
{
LogEvent("Queuing event", evt);
_event_queue.push(evt);
}
void
UdpProtocol::Synchronize()
{
if (_udp) {
_current_state = Syncing;
_state.sync.roundtrips_remaining = NUM_SYNC_PACKETS;
if (_peer_addr.sin_addr.s_addr != 0)
SendSyncRequest();
}
}
bool
UdpProtocol::GetPeerConnectStatus(int id, int *frame)
{
*frame = _peer_connect_status[id].last_frame;
return !_peer_connect_status[id].disconnected;
}
void
UdpProtocol::Log(const char *fmt, ...)
{
char buf[1024];
size_t offset;
va_list args;
snprintf(buf, ARRAY_SIZE(buf), "udpproto%d | ", _queue);
offset = strlen(buf);
va_start(args, fmt);
vsnprintf(buf + offset, ARRAY_SIZE(buf) - offset - 1, fmt, args);
buf[ARRAY_SIZE(buf)-1] = '\0';
::Log(buf);
va_end(args);
}
void
UdpProtocol::LogMsg(const char *prefix, UdpMsg *msg)
{
switch (msg->hdr.type) {
case UdpMsg::SyncRequest:
Log("%s sync-request (%d).\n", prefix,
msg->u.sync_request.random_request);
break;
case UdpMsg::SyncReply:
Log("%s sync-reply (%d).\n", prefix,
msg->u.sync_reply.random_reply);
break;
case UdpMsg::QualityReport:
Log("%s quality report.\n", prefix);
break;
case UdpMsg::QualityReply:
Log("%s quality reply.\n", prefix);
break;
case UdpMsg::KeepAlive:
Log("%s keep alive.\n", prefix);
break;
case UdpMsg::Input:
Log("%s game-compressed-input %d (+ %d bits).\n", prefix, msg->u.input.start_frame, msg->u.input.num_bits);
break;
case UdpMsg::InputAck:
Log("%s input ack.\n", prefix);
break;
case UdpMsg::AppData:
Log("%s app data (%d bytes).\n", prefix, msg->u.app_data.size);
break;
default:
ASSERT(false && "Unknown UdpMsg type.");
}
}
void
UdpProtocol::LogEvent(const char *prefix, const UdpProtocol::Event &evt)
{
if (evt.type == UdpProtocol::Event::Synchronzied)
Log("%s (event: Synchronzied).\n", prefix);
}
bool
UdpProtocol::OnInvalid(UdpMsg *msg, int len)
{
ASSERT(false && "Invalid msg in UdpProtocol");
return false;
}
bool
UdpProtocol::OnSyncRequest(UdpMsg *msg, int len)
{
if (_remote_magic_number != 0 && msg->hdr.magic != _remote_magic_number) {
Log("Ignoring sync request from unknown endpoint (%d != %d).\n",
msg->hdr.magic, _remote_magic_number);
return false;
}
UdpMsg *reply = new UdpMsg(UdpMsg::SyncReply);
reply->u.sync_reply.random_reply = msg->u.sync_request.random_request;
// Calculate incoming verif data size
msg->verification_size = 0;
int msgVerifSize = len - msg->PacketSize();
if (msgVerifSize != (int)verification.size()
|| (msgVerifSize != 0 && memcmp(&msg->u.sync_request.verification[0], &verification[0], msgVerifSize)))
{
Log("Verification mismatch: size received %d expected %d", msgVerifSize, (int)verification.size());
reply->u.sync_reply.verification_failure = 1;
SendMsg(reply);
throw GGPOException("Verification mismatch", GGPO_ERRORCODE_VERIFICATION_ERROR);
}
// FIXME
if (_state.sync.roundtrips_remaining == NUM_SYNC_PACKETS && msg->hdr.sequence_number == 0) {
Log("Sync request 0 received... Re-queueing sync packet.\n");
SendSyncRequest();
}
reply->u.sync_reply.verification_failure = 0;
SendMsg(reply);
return true;
}
bool
UdpProtocol::OnSyncReply(UdpMsg *msg, int len)
{
if (_current_state != Syncing) {
Log("Ignoring SyncReply while not synching.\n");
return msg->hdr.magic == _remote_magic_number;
}
if (msg->u.sync_reply.random_reply != _state.sync.random) {
Log("sync reply %d != %d. Keep looking...\n",
msg->u.sync_reply.random_reply, _state.sync.random);
return false;
}
if (msg->u.sync_reply.verification_failure == 1)
throw GGPOException("Peer reported verification failure", GGPO_ERRORCODE_VERIFICATION_ERROR);
if (!_connected) {
QueueEvent(Event(Event::Connected));
_connected = true;
}
Log("Checking sync state (%d round trips remaining).\n", _state.sync.roundtrips_remaining);
if (--_state.sync.roundtrips_remaining == 0) {
Log("Synchronized!\n");
QueueEvent(UdpProtocol::Event(UdpProtocol::Event::Synchronzied));
_current_state = Running;
_last_received_input.frame = -1;
_remote_magic_number = msg->hdr.magic;
} else {
UdpProtocol::Event evt(UdpProtocol::Event::Synchronizing);
evt.u.synchronizing.total = NUM_SYNC_PACKETS;
evt.u.synchronizing.count = NUM_SYNC_PACKETS - _state.sync.roundtrips_remaining;
QueueEvent(evt);
SendSyncRequest();
}
return true;
}
bool
UdpProtocol::OnInput(UdpMsg *msg, int len)
{
/*
* If a disconnect is requested, go ahead and disconnect now.
*/
bool disconnect_requested = msg->u.input.disconnect_requested;
if (disconnect_requested) {
if (_current_state != Disconnected && !_disconnect_event_sent) {
Log("Disconnecting endpoint on remote request.\n");
QueueEvent(Event(Event::Disconnected));
_disconnect_event_sent = true;
}
} else {
/*
* Update the peer connection status if this peer is still considered to be part
* of the network.
*/
UdpMsg::connect_status* remote_status = msg->u.input.peer_connect_status;
for (unsigned i = 0; i < ARRAY_SIZE(_peer_connect_status); i++) {
ASSERT(remote_status[i].last_frame >= _peer_connect_status[i].last_frame);
_peer_connect_status[i].disconnected = _peer_connect_status[i].disconnected || remote_status[i].disconnected;
_peer_connect_status[i].last_frame = MAX(_peer_connect_status[i].last_frame, remote_status[i].last_frame);
}
}
/*
* Decompress the input.
*/
int last_received_frame_number = _last_received_input.frame;
if (msg->u.input.num_bits) {
int offset = 0;
uint8 *bits = (uint8 *)msg->u.input.bits;
int numBits = msg->u.input.num_bits;
int currentFrame = msg->u.input.start_frame;
_last_received_input.size = msg->u.input.input_size;
if (_last_received_input.frame < 0) {
_last_received_input.frame = msg->u.input.start_frame - 1;
}
while (offset < numBits) {
/*
* Keep walking through the frames (parsing bits) until we reach
* the inputs for the frame right after the one we're on.
*/
ASSERT(currentFrame <= (_last_received_input.frame + 1));
bool useInputs = currentFrame == _last_received_input.frame + 1;
while (BitVector_ReadBit(bits, &offset)) {
int on = BitVector_ReadBit(bits, &offset);
int button = BitVector_ReadNibblet(bits, &offset);
if (useInputs) {
if (on) {
_last_received_input.set(button);
} else {
_last_received_input.clear(button);
}
}
}
ASSERT(offset <= numBits);
/*
* Now if we want to use these inputs, go ahead and send them to
* the emulator.
*/
if (useInputs) {
/*
* Move forward 1 frame in the stream.
*/
char desc[1024];
ASSERT(currentFrame == _last_received_input.frame + 1);
_last_received_input.frame = currentFrame;
/*
* Send the event to the emualtor
*/
UdpProtocol::Event evt(UdpProtocol::Event::Input);
evt.u.input.input = _last_received_input;
_last_received_input.desc(desc, ARRAY_SIZE(desc));
_state.running.last_input_packet_recv_time = GGPOPlatform::GetCurrentTimeMS();
Log("Sending frame %d to emu queue %d (%s).\n", _last_received_input.frame, _queue, desc);
QueueEvent(evt);
} else {
Log("Skipping past frame:(%d) current is %d.\n", currentFrame, _last_received_input.frame);
}
/*
* Move forward 1 frame in the input stream.
*/
currentFrame++;
}
}
ASSERT(_last_received_input.frame >= last_received_frame_number);
/*
* Get rid of our buffered input
*/
while (_pending_output.size() && _pending_output.front().frame < msg->u.input.ack_frame) {
Log("Throwing away pending output frame %d\n", _pending_output.front().frame);
_last_acked_input = _pending_output.front();
_pending_output.pop();
}
return true;
}
bool
UdpProtocol::OnInputAck(UdpMsg *msg, int len)
{
/*
* Get rid of our buffered input
*/
while (_pending_output.size() && _pending_output.front().frame < msg->u.input_ack.ack_frame) {
Log("Throwing away pending output frame %d\n", _pending_output.front().frame);
_last_acked_input = _pending_output.front();
_pending_output.pop();
}
return true;
}
bool
UdpProtocol::OnQualityReport(UdpMsg *msg, int len)
{
// send a reply so the other side can compute the round trip transmit time.
UdpMsg *reply = new UdpMsg(UdpMsg::QualityReply);
reply->u.quality_reply.pong = msg->u.quality_report.ping;
SendMsg(reply);
_remote_frame_advantage = msg->u.quality_report.frame_advantage;
return true;
}
bool
UdpProtocol::OnQualityReply(UdpMsg *msg, int len)
{
_round_trip_time = GGPOPlatform::GetCurrentTimeMS() - msg->u.quality_reply.pong;
return true;
}
bool
UdpProtocol::OnKeepAlive(UdpMsg *msg, int len)
{
return true;
}
void
UdpProtocol::GetNetworkStats(struct GGPONetworkStats *s)
{
s->network.ping = _round_trip_time;
s->network.send_queue_len = _pending_output.size();
s->network.kbps_sent = _kbps_sent;
s->timesync.remote_frames_behind = _remote_frame_advantage;
s->timesync.local_frames_behind = _local_frame_advantage;
}
void
UdpProtocol::SetLocalFrameNumber(int localFrame)
{
/*
* Estimate which frame the other guy is one by looking at the
* last frame they gave us plus some delta for the one-way packet
* trip time.
*/
int remoteFrame = _last_received_input.frame + (_round_trip_time * 60 / 1000);
/*
* Our frame advantage is how many frames *behind* the other guy
* we are. Counter-intuative, I know. It's an advantage because
* it means they'll have to predict more often and our moves will
* pop more frequenetly.
*/
_local_frame_advantage = remoteFrame - localFrame;
}
int
UdpProtocol::RecommendFrameDelay()
{
// XXX: require idle input should be a configuration parameter
return _timesync.recommend_frame_wait_duration(false);
}
void
UdpProtocol::SetDisconnectTimeout(int timeout)
{
_disconnect_timeout = timeout;
}
void
UdpProtocol::SetDisconnectNotifyStart(int timeout)
{
_disconnect_notify_start = timeout;
}
void
UdpProtocol::PumpSendQueue()
{
std::lock_guard<std::mutex> lock(_send_mutex);
while (!_send_queue.empty()) {
QueueEntry &entry = _send_queue.front();
if (_send_latency) {
// should really come up with a gaussian distributation based on the configured
// value, but this will do for now.
int jitter = (_send_latency * 2 / 3) + ((rand() % _send_latency) / 3);
if ((int)GGPOPlatform::GetCurrentTimeMS() < _send_queue.front().queue_time + jitter) {
break;
}
}
if (_oop_percent && !_oo_packet.msg && ((rand() % 100) < _oop_percent)) {
int delay = rand() % (_send_latency * 10 + 1000);
Log("creating rogue oop (seq: %d delay: %d)\n", entry.msg->hdr.sequence_number, delay);
_oo_packet.send_time = GGPOPlatform::GetCurrentTimeMS() + delay;
_oo_packet.msg = entry.msg;
_oo_packet.dest_addr = entry.dest_addr;
} else {
ASSERT(entry.dest_addr.sin_addr.s_addr);
_udp->SendTo((char *)entry.msg, entry.msg->PacketSize(), 0,
(struct sockaddr *)&entry.dest_addr, sizeof entry.dest_addr);
delete entry.msg;
}
_send_queue.pop();
}
if (_oo_packet.msg && _oo_packet.send_time < (int)GGPOPlatform::GetCurrentTimeMS()) {
Log("sending rogue oop!");
_udp->SendTo((char *)_oo_packet.msg, _oo_packet.msg->PacketSize(), 0,
(struct sockaddr *)&_oo_packet.dest_addr, sizeof _oo_packet.dest_addr);
delete _oo_packet.msg;
_oo_packet.msg = NULL;
}
}
void
UdpProtocol::ClearSendQueue()
{
std::lock_guard<std::mutex> lock(_send_mutex);
while (!_send_queue.empty()) {
delete _send_queue.front().msg;
_send_queue.pop();
}
}
void UdpProtocol::SendAppData(const void *data, int len, bool spectators)
{
if (_udp == nullptr)
return;
if (_current_state != Synchronzied && _current_state != Running)
return;
UdpMsg *msg = new UdpMsg(UdpMsg::AppData);
msg->u.app_data.spectators = spectators;
msg->u.app_data.size = len;
memcpy(msg->u.app_data.data, data, len);
SendMsg(msg);
}
bool UdpProtocol::OnAppData(UdpMsg *msg, int len)
{
UdpProtocol::Event evt(UdpProtocol::Event::AppData);
evt.u.app_data.spectators = msg->u.app_data.spectators != 0;
evt.u.app_data.size = msg->u.app_data.size;
memcpy(evt.u.app_data.data, msg->u.app_data.data, msg->u.app_data.size);
QueueEvent(evt);
return true;
}
+224
View File
@@ -0,0 +1,224 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#ifndef _UDP_PROTO_H_
#define _UDP_PROTO_H_
#include "ggpo_poll.h"
#include "udp.h"
#include "udp_msg.h"
#include "game_input.h"
#include "timesync.h"
#include "ggponet.h"
#include "ring_buffer.h"
#include <vector>
#include <mutex>
class UdpProtocol : public IPollSink
{
public:
struct Stats {
int ping;
int remote_frame_advantage;
int local_frame_advantage;
int send_queue_len;
Udp::Stats udp;
};
struct Event {
enum Type {
Unknown = -1,
Connected,
Synchronizing,
Synchronzied,
Input,
Disconnected,
NetworkInterrupted,
NetworkResumed,
AppData,
};
Type type;
union {
struct {
GameInput input;
} input;
struct {
int total;
int count;
} synchronizing;
struct {
int disconnect_timeout;
} network_interrupted;
struct {
bool spectators;
int size;
uint8 data[MAX_APPDATA_SIZE];
} app_data;
} u;
Event(Type t = Unknown) : type(t) { }
};
public:
virtual bool OnLoopPoll(void *cookie);
public:
UdpProtocol();
virtual ~UdpProtocol();
void Init(Udp *udp, Poll &p, int queue, char *ip, u_short port, UdpMsg::connect_status *status);
void Synchronize();
bool GetPeerConnectStatus(int id, int *frame);
bool IsInitialized() { return _udp != NULL; }
bool IsSynchronized() { return _current_state == Running; }
bool IsRunning() { return _current_state == Running; }
void SendInput(GameInput &input);
void SendInputAck();
bool HandlesMsg(sockaddr_in &from, UdpMsg *msg);
void OnMsg(UdpMsg *msg, int len);
void Disconnect();
void SendAppData(const void *data, int len, bool spectators);
void GetNetworkStats(struct GGPONetworkStats *stats);
bool GetEvent(UdpProtocol::Event &e);
void GGPONetworkStats(Stats *stats);
void SetLocalFrameNumber(int num);
int RecommendFrameDelay();
void SetVerificationData(const void *verification, int verification_size) {
ASSERT(verification_size <= MAX_VERIFICATION_SIZE);
this->verification.resize(verification_size);
memcpy(&this->verification[0], verification, verification_size);
}
void SetDisconnectTimeout(int timeout);
void SetDisconnectNotifyStart(int timeout);
protected:
enum State {
Syncing,
Synchronzied,
Running,
Disconnected
};
struct QueueEntry {
int queue_time;
sockaddr_in dest_addr;
UdpMsg *msg;
QueueEntry() {}
QueueEntry(int time, sockaddr_in &dst, UdpMsg *m) : queue_time(time), dest_addr(dst), msg(m) { }
};
bool CreateSocket(int retries);
void UpdateNetworkStats(void);
void QueueEvent(const UdpProtocol::Event &evt);
void ClearSendQueue(void);
void Log(const char *fmt, ...);
void LogMsg(const char *prefix, UdpMsg *msg);
void LogEvent(const char *prefix, const UdpProtocol::Event &evt);
void SendSyncRequest();
void SendMsg(UdpMsg *msg);
void PumpSendQueue();
void SendPendingOutput();
bool OnInvalid(UdpMsg *msg, int len);
bool OnSyncRequest(UdpMsg *msg, int len);
bool OnSyncReply(UdpMsg *msg, int len);
bool OnInput(UdpMsg *msg, int len);
bool OnInputAck(UdpMsg *msg, int len);
bool OnQualityReport(UdpMsg *msg, int len);
bool OnQualityReply(UdpMsg *msg, int len);
bool OnKeepAlive(UdpMsg *msg, int len);
bool OnAppData(UdpMsg *msg, int len);
protected:
/*
* Network transmission information
*/
Udp *_udp;
sockaddr_in _peer_addr;
uint16 _magic_number;
int _queue;
uint16 _remote_magic_number;
bool _connected;
int _send_latency;
int _oop_percent;
struct {
int send_time;
sockaddr_in dest_addr;
UdpMsg* msg;
} _oo_packet;
RingBuffer<QueueEntry, 64> _send_queue;
std::mutex _send_mutex;
std::vector<uint8> verification;
/*
* Stats
*/
int _round_trip_time;
int _packets_sent;
int _bytes_sent;
int _kbps_sent;
int _stats_start_time;
/*
* The state machine
*/
UdpMsg::connect_status *_local_connect_status;
UdpMsg::connect_status _peer_connect_status[UDP_MSG_MAX_PLAYERS];
State _current_state;
union {
struct {
uint32 roundtrips_remaining;
uint32 random;
} sync;
struct {
uint32 last_quality_report_time;
uint32 last_network_stats_interval;
uint32 last_input_packet_recv_time;
} running;
} _state;
/*
* Fairness.
*/
int _local_frame_advantage;
int _remote_frame_advantage;
/*
* Packet loss...
*/
RingBuffer<GameInput, 64> _pending_output;
GameInput _last_received_input;
GameInput _last_sent_input;
GameInput _last_acked_input;
unsigned int _last_send_time;
unsigned int _last_recv_time;
unsigned int _shutdown_timeout;
unsigned int _disconnect_event_sent;
unsigned int _disconnect_timeout;
unsigned int _disconnect_notify_start;
bool _disconnect_notify_sent;
uint16 _next_send_seq;
uint16 _next_recv_seq;
/*
* Rift synchronization.
*/
TimeSync _timesync;
/*
* Event queue
*/
RingBuffer<UdpProtocol::Event, 64> _event_queue;
};
#endif
@@ -0,0 +1,38 @@
/* -----------------------------------------------------------------------
* GGPO.net (http://ggpo.net) - Copyright 2009 GroundStorm Studios, LLC.
*
* Use of this software is governed by the MIT license that can be found
* in the LICENSE file.
*/
#if defined(__unix__) || defined(__APPLE__) || defined(__SWITCH__)
#include "platform_linux.h"
#include <time.h>
#include <strings.h>
#include <chrono>
uint32_t GGPOPlatform::GetCurrentTimeMS()
{
using namespace std::chrono;
static steady_clock::time_point startTime = steady_clock::now();
return (uint32_t)duration_cast<milliseconds>(steady_clock::now() - startTime).count();
}
int GGPOPlatform::GetConfigInt(const char* name)
{
char *buf = getenv(name);
if (buf == nullptr)
return 0;
return atoi(buf);
}
bool GGPOPlatform::GetConfigBool(const char* name)
{
char *buf = getenv(name);
if (buf == nullptr)
return false;
return atoi(buf) != 0 || strcasecmp(buf, "true") == 0;
}
#endif
Loaded 100 of 6231 files, more files were not shown because too many files have changed in this diff. Show more