Commit Graph

143 Commits

Author SHA1 Message Date
Flyinghead b5879e6e1d unintended change and merge issue
log: revert change that wasn't supposed to be committed
emulator: fix incorrect merge
2023-02-10 12:56:57 +01:00
Flyinghead 98531e07ea hle bios: fix SF rush, jeremy mc grath and the grinch
protection checksum and game bugs
2023-02-06 15:15:44 +01:00
Flyinghead debe21de7b Merge remote-tracking branch 'origin/master' into dev 2023-02-05 22:20:28 +01:00
Flyinghead 6e940e4d08 ggpo: move endOfFrame() call back to start render
Naomi2 TA context geometry for the current frame is lost when
rollbacking during vblank in because it hasn't been queued for render
yet.
Fixes black screen after GGPO rollback for Naomi 2 games
2023-02-03 11:34:58 +01:00
Flyinghead 6b2063b06f GGPO fixes
Memwatchers weren't properly reset after a ggpo session.

Race condition when stopping if GGPO restarts the cpu for a new frame.

The emu thread might still run some rollback frames before stopping, so
the emu state must be updated only after ggpo is stopped.
Fixes MINIDUMP-6P

Don't autosavestate when GGPO is on

Really disable renderer during GGPO advance frame

Don't stop the sh4 after render (single threaded) when GGPO is on

android: Don't restart when unpaused if online
2023-02-01 18:04:26 +01:00
Flyinghead 5875eda4d0 game id of console games wasn't trimmed
regression introduced by ee84567c17
2023-01-31 12:58:43 +01:00
Flyinghead 0305904873 force NTSC for some games 2023-01-30 13:40:35 +01:00
Flyinghead ee84567c17 naomi: use gameId instead of naomi_game_id to get current game name
naomi_game_id isn't reset if a console game is loaded.
settings.content.gameId should be used instead.

Issue #901
Fixes MINIDUMP-6G
2023-01-30 13:34:06 +01:00
Flyinghead b1479e6e34 aica: use namespaces, simplify api, handle serialization
Rename VArray2 to RamRegion. Add alloc(), free(), setRegion() and
de/serialize()
2023-01-30 10:40:07 +01:00
Flyinghead 143073b61d rename _vmem to addrspace and move platform vmem stuff to virtmem ns
use namespaces
simplify names
no functional changes
2023-01-29 18:48:33 +01:00
Flyinghead 99d5266aa0 Merge remote-tracking branch 'origin/master' into dev
# Conflicts:
#	core/hw/holly/sb_mem.cpp
#	core/hw/naomi/naomi.cpp
#	core/hw/naomi/naomi_flashrom.cpp
#	core/hw/pvr/ta_ctx.h
#	core/rend/gui.cpp
2023-01-27 15:41:45 +01:00
Flyinghead e18a4afcbb vk and pvr fixes. Renderer::Process returns void. N2 light 0 is no-light
pvr: Heap use after free due to PolyParam vector reallocation
vk: fix wrong buffer size calculation
Renderer::Process now returns void since it can't fail anymore
naomi2: light model at index 0 is "no light"
dx9, gles: throw if naomi 2 not supported
2023-01-27 11:16:25 +01:00
scribam 80cf4406a7 cleanup include headers 2023-01-26 10:06:51 +01:00
Flyinghead 5096d50d37 move rom/flash stuff to hw/flashrom. nvmem api 2023-01-24 19:17:48 +01:00
Flyinghead 31debefbe1 release dynarec mem allocs when terminating, including arm and dsp
Issue #453
2023-01-24 09:21:46 +01:00
Flyinghead db9fbbaebf custom texture loader must be stopped before the tex cache is cleared
Fix for MINIDUMP-53
2023-01-22 17:22:04 +01:00
Flyinghead aea228c3df force real BIOS for Fushigi no Dungeon 2023-01-22 17:07:16 +01:00
Flyinghead 36e67203a4 Merge remote-tracking branch 'origin/master' into dev
# Conflicts:
#	core/deps/oboe
#	core/emulator.cpp
#	core/hw/maple/maple_jvs.cpp
#	core/rend/gui.cpp
2023-01-17 21:20:14 +01:00
Flyinghead 9d3125c546 fix tony hawk's 1 & 2 PAL disk ids 2023-01-17 11:41:50 +01:00
Flyinghead 13428ba696 allow screen stretching to be overridden when using widescreen cheat
Issue #870
2023-01-15 11:14:21 +01:00
Flyinghead 659d21680b android: race condition on Emulator::threadResult
The emu thread can be stopped/started by the app main java thread while
the render thread is running. This can lead to a race condition on the
threadResult future between checkStatus() and start(). So protect
relevant sections with a mutex.

Fix for MINIDUMP-1G, MINIDUMP-1H, MINIDUMP-2G and MINIDUMP-33
2023-01-14 10:52:27 +01:00
Flyinghead 66eb08f2d1 sh4: check that dma-ch2 source address is in ram
Force real BIOS for Force Five dc conversion
Fix for MINIDUMP-2W
2023-01-13 09:28:45 +01:00
Flyinghead 7e4572a86a naomi: f355 multiboard support WIP 2023-01-11 22:31:36 +01:00
Flyinghead d0bb0aea97 android: defer stopping audio until after current frame is rendered
In android, stop requests are not run in the UI thread so in
single-threaded mode, they must be deferred until after the current
frame is rendered to avoid deadlocking on audio.
2023-01-07 11:51:32 +01:00
Flyinghead 53ed006a54 naomi: 18wheeler, soulsurfer and wldrider input improvements
18wheeler: limit wheel range. Issue #693
18wheeler: Implement gear tristate lever with 2 buttons. Fake motor drive board to avoid error messages in deluxe version.
soulsurfer: floormat button/contact is always on
wldriders: unmap rear brake so it doesn't have to be released
2022-12-24 10:48:17 +01:00
Matt Phillips 6d913f42c8
Host-side profiler - initial commit (#834)
* Host-side (Flycast) profiler - initial commit

* Profiler - configurable frame warning time

* Compile fix for !DC_PROFILER
2022-12-21 11:24:11 +01:00
Matt Phillips 13f3c8281f Fixed single stepping, added support for vCont packets and ranged stepping (faster), initial work to support other breakpoint types 2022-12-18 16:27:38 +01:00
Flyinghead 51758b965e ggpo: disable full framebuffer emulation. memwatch perf fix
Disable full framebuffer emulation with ggpo if threaded rendering is
enabled. Would require thread synchronization on VRAM page map.
memwatch: do single lookup on page map in hit()
2022-12-17 10:54:01 +01:00
Matt Phillips b0a520fe18
Various GDB fixes and improvements (#832)
* Enabled GDB server, compile fix for MSVC, added GDB option to config

* GDB - 'vMustReplyEmpty' should not be explicitly handled, it is a test for how the target responds to unknown vpackets (which was incorrect)

* GDB wait for debugger option to allow debugging from bootstrap, and Event::Resume moved after renderer init so agent.interrupt() can pause the renderer

* Draw "Waiting for debugger", and fixed UI not rendering last frame before a state change

* Fixed GDB regs/mem endianness
2022-12-16 20:34:30 +01:00
Flyinghead cdca559d99 ggpo: optimize memwatch, save/load state. endOfFrame on vblank in
ggpo: Optimize memwatch and load/save state. Unprotect memory before restoring a state. Smaller timesync wait. Missing error handling.
pvr: call ggpo::endOfFrame() on vblank in only
ssa: fix warning
2022-12-10 17:19:34 +01:00
Flyinghead 32e3e7d9c5 vmem: no more 4GB vmem mode. only map elan RAM in naomi2 mode
Do not attempt to reserve 4GM of virtual space on 64-bit hosts. Use
512MB everywhere.
Don't map elan RAM if not needed and dont protect/unprotect it in
memwatch.
2022-12-09 17:37:49 +01:00
Flyinghead d417237e64 Merge remote-tracking branch 'origin/master' into dev
# Conflicts:
#	core/emulator.cpp
2022-12-06 21:47:50 +01:00
Flyinghead 446619ce85 atomiswave only has 2 MB of aica ram
new savestate version
build.h clean up
2022-12-06 20:51:45 +01:00
Flyinghead e48b72a859 race condition causing emu thread exceptions to be ignored
in multithreaded mode, checkStatus() *must* be called to report
exceptions thrown by the emu thread
2022-12-05 21:24:27 +01:00
Flyinghead 59ff44132b aica: get rid of audio samples batching
Some audio issues are reported because of this option and the now
correctly clocked aica cpu.
2022-12-05 18:34:52 +01:00
Flyinghead a40210c55c no aica batching for Tony Hawk's 1 & 2 2022-11-29 17:27:31 +01:00
Flyinghead 76cf989455 disable free play for radirgy noa
Issue #527
2022-11-14 16:00:11 +01:00
Flyinghead 94f3d80a75 Merge remote-tracking branch 'origin/master' into dev
# Conflicts:
#	CMakeLists.txt
#	core/hw/pvr/Renderer_if.cpp
#	core/oslib/audiobackend_alsa.cpp
#	core/rend/vulkan/desc_set.h
#	core/rend/vulkan/oit/oit_drawer.cpp
2022-11-02 20:12:34 +01:00
Flyinghead c15f446ffc hle bios: fix pal detection for some pal wince games
Caesar's Palace 2K, The Next Tetris, KISS
2022-10-31 11:31:21 +01:00
Flyinghead 40dbf53792 pvr: use render pass # to read the right tile when marking blocks
Fixes Unreal Tournament flashing/black screen.
gl: mark vram area in rtt to avoid overwriting data (Worms World Party)
Force Worms World Party to use CopyToVRam (regression due to
6a5db32d5d)
Don't calculate precise aspect ratio and use 4/3 instead (or more if
widescreen or stretch).
Fix clipping issue when using SCALER_CTL.vscalefactor. Avoir crash when
clip values are >= width or height.
vulkan: RenderFramebuffer wasn't working at all if !EmulateFramebuffer
2022-10-30 12:10:24 +01:00
Flyinghead 5722dc90f0 Full framebuffer emulation. Renderer interface changes
Helps for:
Densha de Go! 2, Issue #171
Vigilante 8, Issue #275
Xtreme Sports
Sonic Shuffle
The Ring of the Nibelungen
2022-10-23 16:32:42 +02:00
Flyinghead 1fd95c2886 Roadsters (US) doesn't support RGB cable
Issue #791
Compile warnings
2022-10-21 10:54:26 +02:00
Flyinghead 20f9450218 ignore start() if emulator already started
can happen on android
2022-10-19 10:06:53 +02:00
Edward Li 6add19fb04 unprotect elan memory during `dc_reset` hard 2022-10-15 21:32:49 +02:00
Flyinghead 02d4b821d7 naomi: allow eeprom-based settings to be overridden (rotate, region) 2022-10-12 22:59:46 +02:00
Flyinghead f88abf9987 extra depth scaling for south park rally
fixes car depth on character selection screen
2022-09-14 17:52:35 +02:00
Flyinghead e0d87eb093 Merge remote-tracking branch 'origin/master' into dev
# Conflicts:
#	core/rend/gui.cpp
2022-08-22 13:09:56 +02:00
bslenul 75ff5409f4 Switch broadcast region for San Francisco Rush 2049 and Sega Smash Pack - Volume 1 2022-07-25 11:26:12 +02:00
Flyinghead 4f206d2773 pvr: set correct framebuffer size in 240p/pixel_double
Some games use 240p and pixel_double resulting in a 320x240 framebuffer.
Renderer should be resized accordingly.
Fixes linear filtering artifact in KoF dream match 1999 (Issue #690)
2022-07-12 15:55:49 +02:00
Enrique Santos c0e52b9a1a load game: destroy old maple devices before create call 2022-07-08 20:38:16 +02:00
Flyinghead 19112aecb2 Merge remote-tracking branch 'origin/master' into dev
# Conflicts:
#	core/hw/naomi/naomi_cart.cpp
2022-07-01 12:42:37 +02:00
Flyinghead 907131b7f5 allow ForceWindowsCE option to be used in per-game config
Issue #252
2022-06-24 13:27:21 +02:00
Flyinghead 5eb302898f box art fetch and display
Issue #22
2022-06-15 21:22:12 +02:00
Flyinghead 77a2bbbb8d reios: cancel gd dma int in g1_end_dma. drv_stat returns busy when busy
Cancel G1 DMA interrupt in G1_DMA_END (fixes MSR, Psychic Force, Pro
Pinball, Sega Swirl)
GET_DRV_STAT must return busy when drive is busy (fixes Hell Gate, Zero
Gunner)
Better named constants
2022-04-29 15:18:41 +02:00
Flyinghead f2f4010203 clean up types.h, refactoring 2022-04-14 11:34:45 +02:00
Flyinghead 6c38295d62 new naomi network protocol. vblank event. initd rumble support
new vblank event, used by cheats, lua and naomi net
new udp net protocol for naomi. rx/tx on vblank on emu thread.
input: rumble power configurable (Issue #158)
ui: rumble intensity slider, enable/disable upnp
aica: hook to consume midi out
decode midi out to simulate rumble for initd
upnp can now be disabled
2022-03-27 15:23:21 +02:00
Flyinghead a5bad2b9b7 more naomi widescreen cheats. Fix vathlete 4-player mode
widescreen cheats for asndynmt, doa2m, slashout, spikers battle,
18wheeler, beach spikers. Courtesy of Esppiral
vathlete needs 2 I/O boards for 4-player mode
2022-03-20 17:49:50 +01:00
Flyinghead 56768f2d3d naomi2: use TA parser. Use N2light directly with vk, dx11
Use TA parser to handle list type and clipping for Naomi 2 polys.
Pass all pass-throuch TA data to TA parser but stop on naomi2 command.
Set default projection matrix instead of identity (fixes Area conquered
screen invisible in initd).
Change N2Light and N2LightModel so they are usable in GLSL (vulkan) and
HLSL (dx11).
TA parser throws exception for unhandled param.
ta_vtx.cpp refactoring.
Support for subtractive lights (diffuse+specular). Used in some clubk
circuits.
Fix vulkan crash when direct FB render.
2022-03-16 17:28:45 +01:00
Flyinghead ecc03e3ebc naomi: use boot rom id to configure eeprom
Make eeprom from scratch if it doesn't exist based on boot id info.
Override eeprom settings to make game happy
Change region to supported one
Get rid of per-rom region info in rom list
New option to configure Naomi games in free play
2022-02-18 17:35:20 +01:00
Flyinghead 38765dc89a pvr: fix multipass. naomi2: constant color shading.
pvr: link multipass TA contexts. Each pass has its own.
pvr: get rid of context pool
naomi2: constant color shading. Use model diffuse and specular
selection. Don't use vtx color for offset color.
naomi2: pseudo-parallel lights fix
naomi2: pass-through TA data needs forced list type. Terminate with
end-of-list
enable RTT copy to vram for Beach Spikers
2022-01-31 20:40:09 +01:00
Flyinghead e5d517dad2 use platform.isConsole(), platform.isNaomi(), ... 2022-01-27 17:52:19 +01:00
Flyinghead 4335aa563f naomi2 WIP 2022-01-16 22:41:42 +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 0478ec9696 dx11: per-pixel renderer 2021-12-11 18:53:35 +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 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 03161446b9 can't launch BIOS after playing a game 2021-11-04 08:57:15 +01:00
Flyinghead 46ae8f92cc input: per game input mapping 2021-11-01 12:39:50 +01: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 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 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 2803ee8274 imgread.ImagePath clean up. ggpo: poll input late if !thread 2021-09-30 14:24:17 +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 8b266b1327 ggpo: force aica.nobatch 2021-09-13 13:01:52 +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 69d0801121 net rollback with ggpo 2021-09-02 17:51:23 +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 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 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 8a46853dfd lr: deadlock on exit with custom textures (win32)
less log
2021-08-02 12:07:40 +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 edc6474f27 save nvmem/flash files when stopping emu 2021-07-19 18:20:58 +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 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 57874a9bcb libretro: savestate compatibility. B1/D1 vmus now visible 2021-07-10 17:39:16 +02:00
Flyinghead 81546fe727 libretro: handle ThreadedRendering transition. Fix hang in !threaded 2021-07-09 16:28:28 +02:00
Flyinghead 7dbd79750c WIP libretro core update 2021-07-05 19:44:08 +02:00