Commit Graph

42 Commits

Author SHA1 Message Date
Roy Merkel 18a1fe4afd
Fixed bsnes build (#3891)
bsnes build broke when rewind.c was removed because it defined the GB_rewind_reset, which was being linked in despite being no longer present. -DGB_DISABLE_REWIND turns off this link.
2024-04-14 15:48:42 +02:00
Morilli e6fdd18858 Update bsnes makefile with sameboy changes 2024-04-13 03:01:21 +02:00
Morilli 972bc8a682 bsnes: Pull upstream fixes
Contains
- 3ca0504e67e89d37e24fce87183332f7ec577867: Extend the Super Famicom LOROM-RAM#A memory map.
- dab534b6584e4debef2c9572e6b6588a604d79a9: wdc65816: fix PLB wrapping in emulation mode
- ccbe394e7d4bc5f5596544813d887da161af3ca6: wdc65816: emulate (direct,X) wraparound bug in emulation mode
- 79770f6207a5d244652644c5e2d9f4328bd974ac: implementation of SA-1 BW-RAM protection
2024-03-01 15:56:28 +01:00
Morilli 83e784ecec Actually provide proper OAM memory domain in bsnes 2023-12-10 00:48:50 +01:00
CasualPokePlayer f3c58d816d fix #3643 2023-04-22 04:39:12 -07:00
Morilli 988ae27292 Fix #3638
I don't even
2023-04-18 17:40:11 +02:00
CasualPokePlayer e4a6d9db67 set initial rtc for epson and sharp rtc in new BSNES
this is needed due to the complete lack of time.rtc handling (and even then, if SaveRAM doesn't exist this is needed)
2023-04-01 02:13:47 -07:00
CasualPokePlayer 22e35c45fc hook up RTC support for new BSNES, resolves #3577 2023-04-01 01:23:16 -07:00
CasualPokePlayer f7b83be5ab fix lightguns in snes9x, support offscreen shots in snes9x (UI yet to be hooked up), fix lightguns in new bsnes, add option in bsnes to disable drawing light gun cursors (UI yet to be hooked up) 2023-03-30 16:34:04 -07:00
CasualPokePlayer 0a2d4405f0
Revamp Waterbox Setup (#3529)
* Waterbox setup has been revamped to use the latest llvm parts (llvm 16 for compiler_rt/libunwind/libcxx/libcxxabi).
* Clang is now possible to use, and is the preferred compiler (due to superior performance).
* Supported compilers are now clang 14/15/16, and gcc 12.
* Other core updates are mixed in.

---------

Co-authored-by: Morilli <35152647+Morilli@users.noreply.github.com>
2023-03-28 16:53:33 -07:00
Morilli 76cfee6396 rename bs memory domains (and fix rom domain)
- also some other renames for clarity
2023-03-11 07:29:23 +01:00
Morilli c906c830dd Implement bsx + bs memory loading
connect satellaview when loading bsmemory

this makes rtc somewhat work

also mark SubBSNESv115 as BSX core
2023-03-11 07:29:23 +01:00
Morilli 00060c3ffa BSNESv115: remove autoJoypad condition in lag detection code
this fixes lag frame detection in Super Bomber Man (Japan) and didn't cause any regression in my limited testing
2023-01-08 22:29:12 +01:00
Morilli f668e09048 fix dumb mistake in bsnes gamepad controller
fixes 96cc3f8745
apparently this was only an issue in sgb?
2022-12-20 04:20:30 +01:00
Morilli 837592ca11 BSNESv115+: apply patch to fix $4203 mul/div behavior
see https://github.com/bsnes-emu/bsnes/issues/256 or https://forums.nesdev.org/viewtopic.php?t=24087 for context
2022-12-11 17:18:01 +01:00
Morilli 74b37ab947 BSNESv115+: apply patch to fix CPUMSC reset test
see https://github.com/bsnes-emu/bsnes/issues/235
this patch fixes the test, but its correctness needs to be verified against real hardware
2022-12-11 17:01:02 +01:00
Morilli b0af99a68a BSNESv115+: pull upstream
43e42b2dcaf84c41d09c49745d82f8515e4f7771: simplify SA1 division
c0c60c83a84a49d4a2b822a0491cb258a3c5b98a: fix justifier controller
2022-12-11 16:41:55 +01:00
Morilli 96cc3f8745 BSNESv115: implement an extended gamepad controller with 4 extra buttons
this is a breaking change for existing movies, but only when a non-gamepad controller was used, which is rare
2022-12-06 19:21:08 +01:00
Morilli 10ba45d462 BSNESv115+: actually provide IBoardInfo properly 2022-12-04 22:48:29 +01:00
Morilli 0cb63e8d6a BSNESv115+: Implement overscan and aspect ratio correction settings 2022-11-18 13:08:27 +01:00
Morilli c21fedc76a BSNESv115+: add option for disabling ppu sprite limit 2022-11-10 23:22:17 +01:00
CasualPokePlayer cc71882059
BSNES Memory Domain Fixes (#3423)
* Use SameBoy submodule symlink for BSNES

* SGB memory domains

* Fix SGB saveram issues (extra data like rtc will be saved correctly now here)

* Various cleanups, avoid unneeded unsafe use, a little better EnterExit use

Co-authored-by: Morilli <35152647+Morilli@users.noreply.github.com>
2022-10-28 19:22:49 -07:00
Moritz Bender 6f0953aaa3
Implement snes graphics debugger for the new bsnes core (#3367)
* Partial port of graphics debugger to new BSNES

* minimal "working" copy-paste

* small fix for the previous commit

* Implement more stuff

* no idea whose responsibility "EnterExit" is but this should work

* add support for backdropcolor

i have 0% trust in this code

* implement mode7, apply backcolor on load

* 🙈

un-"implement" the nonfunctional scanlinehookmanager as well as the non-functional palette setting logic
- this may actually break config lol

* don't break libsnes config

* Provide IBSNESForGfxDebugger in the subbsnes core

* Remove redundant semicolon

* Clean up diff of `comboPalette_SelectedIndexChanged`

* Fix crash

Co-authored-by: YoshiRulz <OSSYoshiRulz@gmail.com>
2022-09-03 19:13:56 +02:00
Moritz Bender 039d822144
BSNESv115+: Replace the 'snes_audio_sample' callback with a dynamic audio sample vector to reduce callbacks (#3010)
* BSNESv115+: Replace the 'snes_audio_sample' callback with a dynamic audio sample vector to reduce callbacks

* fix integration for subbsnes core

* reduce buffer allocations
- also make frame setter private now that it's possible
2022-08-15 20:50:26 +02:00
Moritz Bender 929432086f
BSNESv115: add dedicated subframe core (#3281)
* BSNESv115: allow subframe inputs

* BSNESv115: Implement ICycleTiming

may be correct, not sure

* BSNESv115: add dedicated subframe core

I have probably overlooked something...

* Don't implement ICycleTiming in the non-subframe core

requires re-implementing the "FrameAdvance" function in the subframe core

* Register previously missing services in the subframe core as well

* Wire up SubBsnes everywhere in the frontend

* Change reset cycle to reset instruction

* Deduplicate some code

* Slightly rework frame advance logic. The main intent here is to prevent a case where two frames are ran within a single "frame." The current code probably wouldn't crash due to that, but best not to do that.
Also make SGB work here. A bit of a joke since you really can only abuse it for subframe resets, but might as well especially with the settings implying it's possible (and someone is bound to complain).

Co-authored-by: CasualPokePlayer <50538166+CasualPokePlayer@users.noreply.github.com>
2022-08-10 23:08:44 +02:00
Morilli 3d039934af BSNESv115+: expose fast dsp and fast coprocessor options 2022-03-29 02:16:42 +02:00
Moritz Bender 339d34413f
Implement msu1 handling for bsnes115+ (#3190)
* Implement msu1 handling for bsnes115+

* RomPath->RomDirectory for clarity

* Remove unnecessary include
2022-03-28 23:52:13 +02:00
Morilli da2a20e55b BSNESv115+: Some general cleanup, remove nonfunctional msu1 code 2022-03-25 08:36:11 +01:00
Moritz Bender 3726cc6291
Fix #3173 by only calling bus.map() on initial power, not subsequent calls (#3176)
* Fix #3173 by only calling bus.map() on initial power, not subsequent calls

* yeah screw that, we'll just lock the bus to prevent map calls from going through

* initialize peekable in reset with false, just for safety i guess
2022-03-09 04:31:30 +01:00
CasualPokePlayer 114124c82e
BSNES Region Override (#3169)
* region override for bsnes

* hook up SnesInitData right. still needs region override sync setting

* settings stuff, also need to make sure sameboy is using the right region for sgb

* and build

* clearer struct definition; move struct to header file

Co-authored-by: Morilli <35152647+Morilli@users.noreply.github.com>
2022-03-04 14:21:53 +01:00
CasualPokePlayer f060fdaa60
hack a peek into bsnesv115 (#3118) 2022-02-07 08:00:48 -08:00
CasualPokePlayer 096f24e7c6
Reduce bsnes115 state size (#3105)
* testing...

* more testing...

* this is probably a bad idea

* well this probably fixes state size issues

* time to debug this

* oh derp it's just not enough memory in invis heap

* let's see if this works?

* apparently this breaks slow ppu?

* testing...

* testing...

* testing...

* sanity checking

* let's try again

* i do not know what the fuck is up with this emulator nor do i care enough, state size is still under a mb anyways with slow ppu

* oops forgot to commit this

* resolve some issues

* tweak memory allocation sizes

* dont save more cache stuff

* wtf was i even thinking here

* move comment back to original pos, comment on double loading
2022-01-31 19:00:04 -08:00
Moritz Bender 0d7de83d4b
BSNESv115+: Implement snes_controller_latch function, cleanup input polling behavior (#3084)
* BSNESv115+: get rid of input_state + input_poll; just poll

* call `snes_controller_latch` on latches done in the core,

- this now also actually calls the InputCallbackSystem
- needed some edits in the core to support executing the callback even when no controller is connected in port 1

* Fix and somewhat normalize the SnesCallbacks order
2022-01-22 00:29:47 +03:00
Morilli d24629f3ad BSNESv115+: ram and rom memory domain fixes
- saveram was not working at all on certain roms, as the "CARTRIDGE_RAM" memory domain was returning a null pointer (similar thing for "CARTRIDGE_ROM"; changed it to correctly return the current rom)
- add sa1_bwram domain for clarity and an SGB_ROM domain
2021-12-15 09:10:37 +01:00
Morilli fce0f7a911 BSNESv115: Improve speed of fast ppu check 2021-12-01 19:40:53 +01:00
Moritz Bender cc38f4bcba
Implement memory callbacks for the new bsnes core (#2797)
* Actually working callbacks
now actually work after natt's changes
* Set whether memory hooks exist every frame to prevent unnecessary function calls if not
2021-11-29 19:59:47 +03:00
CasualPokePlayer 036e349337
[BSNESv115+] Fix Lag Frames For SGB (#2886)
* better lag detection for sgb. todo: might want to toggle this?

* correct logic and don't fail build this time
2021-08-01 09:54:59 -04:00
Moritz Bender 2ff7e4d39b
Add sa1_iram memory domain for new bsnes (#2803) 2021-07-16 18:41:53 -05:00
CasualPokePlayer 488fd2c6af
Add support for more SGB firmware + Use homebrew bootroms instead of bsnes' illegally provided official ones (#2837)
* add support for more SGB firmware

* replace illegally provided bootroms with legal homebrew bootroms

* let's swap these with homebrew bootroms too

* add builds

* this should probably be preferred

* Fix incorrect assignment

* Fix whitespace changes to Designer files

Co-authored-by: Morilli <35152647+Morilli@users.noreply.github.com>
Co-authored-by: YoshiRulz <OSSYoshiRulz@gmail.com>
2021-07-14 12:48:02 -05:00
Morilli 38bc953e22 Add a designated payload controller based on the multitapcontroller in the new bsnes core
- also patched out the left/right and up/down handling in the core, where it didn't belong
- also fixed the existing payloadcontroller because it wasn't working at all lol
2021-05-26 02:27:54 +02:00
Morilli 24c74c0e36 Implement IDebuggable for the new bsnes core 2021-05-23 05:02:05 +02:00
Moritz Bender 5d20862f26
Implement bsnes version 115 as a new core (#2740)
* Slam all this shit in here i don't care

* no lzma pls

* un-hack things that i hacked earlier (closer to bsnes source now)

* remove more unused files

* remove more files

* get some stuff working on this weird ass branch

* do this to get actual video (holy shit it works) while palette is incorrect

* make video look correct and hopefully fix stack waterbox allocation size uh ?

* Move the new bsnes core to its own dir as a new core and get input working

* remove leftover files from old bsnes

* fix some shit for now

* make lag frame detection work

* Improve cartridge loading to hopefully make sgb work (haven't tested)

- also changes some audio buffer stuff, might be better or worse than before idk
- need to figure out the saveram stuff
- path requests might actually completely fail atm, no idea how to verify that

* refactor to use a switch instead of some weird array with function pointers

- and implement snes_get_mapper, might be helpful or smth idk

* implement entropy c++-side and delete all this useless code holy

* delete dumb unnecessary code

* implement snes_peek_logical_register c++-side

* normalize all indentation

* attempt to properly support sharprtc and epsonrtc data loading and writing

* Duplicate winforms code to add entropy support c#-side and implement layer_enable functionality

The duplicated code is just so i can have a proper window for the new bsnes core. I do not like duplicating code like this, so this should be improved if possible

* Checkpoint for the start of getting rid of the ugly api wrapper stuff

* Next checkpoint for a full api refactor

* bullshit denied

just no.
every file is either copied or manually edited or written from scratch etc.
do not. force. one indent_style on every single file.
It just does not work.

* remove the entire eMessage_CMD handling and convert to native function calls

* general improvements regarding functionality

- adds hotfixes and fast_ppu core options
- add back the alwaysDoubleSize setting
- use bsnes's own serialize function for savestating now
- generate and use the color palette only in c# cause it doesn't need to be on the c++-side
- and more cleanup like always

* somewhat implement IMemoryDomains

* Implement trace logger and cleanup more unused stuff

* Implement ISaveRam, fix controller mapping for TAStudio and remove the pwrap stuff

* Fix ISaveRam, add a controller configuration box for the new core, (hopefully) fix controller inputs

- also differentiates BG prio0 and prio1 now (with options for it)
- some minor irrelevant edits in bsnes source

* Cleanup some more and optimize a bit

* Support firmware loading and make sgb work (hopefully)

* Remove all unused files

* Add back CropSGBFrame option and cleanup snes_video_refresh logic

* Some hopefully sensible changes

* One more cleanup pass

* Change to new PortedCore attribute

necessary after the changes in 98b07c42d5

Co-authored-by: nattthebear <goyuken@gmail.com>
2021-05-14 20:06:13 -05:00