Commit Graph

3010 Commits

Author SHA1 Message Date
Lior Halphon 10be34b5b2 Fix the fast CGB boot ROM booting with data on the second VRAM bank 2019-05-04 21:15:23 +03:00
Lior Halphon 2a0e5f667b
Fix build on some Windows machines using non-Latin locales. Fixes #165 2019-05-04 15:35:17 +03:00
Lior Halphon 9e44306c04
Update .gitattributes 2019-04-19 14:49:09 +03:00
Tim Allen becbca47d4 Update to bsnes v107r3 beta release.
byuu says:

Changes: HD mode 7 supersampling support, HD mode 7 mosaic disable option,
various HD mode 7 bugfixes, default waveOut audio latency to 128 instead of 512,
removed 512x240 hires mode 7 mode.

There's also a small experiment, making this release a beta release as well:
for a large speedup, when in EXTBG mode, I'm bypassing rendering BG1 for a
performance boost. EXTBG is only used as a priority layer, and is overwritten by
BG2 except in one extremely pathological case.
2019-04-19 18:02:31 +10:00
Tim Allen 7a548482ed Update in-repo docs since this is now "bsnes" not "higan". 2019-04-18 18:14:01 +10:00
Tim Allen 30ed7f7e0b Remove higan docs from the bsnes fork. 2019-04-18 18:04:44 +10:00
Tim Allen e05672183b gitlab-ci: Source code moved from "higan" to "bsnes" directories. 2019-04-18 18:03:57 +10:00
Tim Allen 922a0e420c Update to bsnes v107r2 beta release.
byuu says:

Added DerKoun's HD mode 7 (up to 2160p), ~100fps boost for fast forwarding,
configurable latency settings for waveOut (please configure this yourself),
filename case insensitivity, and a few other things.
2019-04-18 17:27:44 +10:00
Raphaël Zumer f8244c8119 Update libretro GBC memory map 2019-04-15 16:39:14 -04:00
Tim Allen c25d20a8d9 Don't build higan on the bsnes branch.
Since bsnes has hard-forked from bsnes, let's not expect higan stuff to keep
building indefinitely.
2019-04-13 10:49:28 +10:00
Lior Halphon 82ce597573 Line breaks 2019-04-12 20:30:02 +03:00
Lior Halphon 05cd81b77c Implemented jump-to breakpoints 2019-04-12 20:29:43 +03:00
Lior Halphon 19f42d5a3a
Merge pull request #159 from rzumer/master
Add static GBC RAM banks to libretro memory map
2019-04-12 17:37:18 +03:00
Tim Allen 4d7bb510f2 Update to bsnes v107.1 release.
byuu says:

Don't let the point release fool you, there are many significant changes in this
release. I will be keeping bsnes releases using a point system until the new
higan release is ready.

Changelog:

  - GUI: added high DPI support
  - GUI: fixed the state manager image preview
  - Windows: added a new waveOut driver with support for dynamic rate control
  - Windows: corrected the XAudio 2.1 dynamic rate control support [BearOso]
  - Windows: corrected the Direct3D 9.0 fullscreen exclusive window centering
  - Windows: fixed XInput controller support on Windows 10
  - SFC: added high-level emulation for the DSP1, DSP2, DSP4, ST010, and Cx4
    coprocessors
  - SFC: fixed a slight rendering glitch in the intro to Megalomania

If the coprocessor firmware is missing, bsnes will fallback on HLE where it is
supported, which is everything other than SD Gundam GX and the two Hayazashi
Nidan Morita Shougi games.

The Windows dynamic rate control works best with Direct3D in fullscreen
exclusive mode. I recommend the waveOut driver over the XAudio 2.1 driver, as it
is not possible to target a single XAudio2 version on all Windows OS releases.
The waveOut driver should work everywhere out of the box.

Note that with DRC, the synchronization source is your monitor, so you will
want to be running at 60hz (NTSC) or 50hz (PAL). If you have an adaptive sync
monitor, you should instead use the WASAPI (exclusive) or ASIO audio driver.
2019-04-09 11:16:30 +10:00
Raphaël Zumer b3939e8fdc Add static GBC RAM banks to libretro memory map 2019-04-06 16:58:49 -04:00
Lior Halphon a62541e577
Merge pull request #158 from trinemark/achievements
Fix libretro achievements
2019-04-06 13:05:22 +03:00
trinemark d4e8a886c5
Fix libretro achievements
https://github.com/LIJI32/SameBoy/issues/48
https://github.com/LIJI32/SameBoy/issues/157
2019-04-05 22:35:52 -05:00
Lior Halphon 7242ddae64 speling is difikult 2019-03-16 20:56:22 +02:00
Lior Halphon 936afedb4b Merge commit '57b0fe7fed8e8218d7c890cd40dea4fa93f121a5' 2019-03-15 14:36:31 +02:00
Lior Halphon c342663200 Emulate serial bit shifting, update the serial API to use bits instead of bytes, update printer emulation and libretro to use the new API 2019-03-15 14:36:10 +02:00
radius 57b0fe7fed fix input 2019-03-12 19:54:26 -05:00
Tim Allen 80cc16d62d Update to v106r107 release.
[This WIP was made after byuu's forum closed, so byuu only gave a one-line
description -Ed.]

byuu says:

This splits ColecoVision, SG-1000/SC-3000 away from Master System/Game Gear.
Was getting too crowded in there.
2019-02-27 23:03:24 +11:00
Tim Allen 7786206a4f Update to bsnes v107 release.
[This is specifically a release of bsnes, not the whole higan suite, even though
it contains all the higan source. -Ed.]

byuu says:

Today I am posting the first release of the new bsnes emulator.

bsnes is designed to be a revival of the classic bsnes design, focusing
specifically on performance and ease of use for SNES emulation.

In addition to all of the features of higan, bsnes supports the following
features:

  - 300% faster (than higan) scanline-based, multi-threaded graphics renderer
  - option to disable sprite limits in games
  - option to enable hires mode 7 graphics
  - option to enable more accurate pixel-based graphics renderer
  - option to overclock SuperFX games by up to 800%
  - periodic auto-saving of game save RAM
  - save state manager with state screenshots
  - several new save state hotkeys such as increment/decrement slot#
  - option to auto-save states when unloading a game or closing the emulator
  - option to auto-load aforementioned states when loading games
  - save state undo and redo support (with associated hotkeys)
  - speed override modes (50%, 75%, 100%, 150%, 200%)
  - recent games list
  - frame advance mode
  - screenshot hotkey
  - path selection for games, patches, saves, cheats, states, and screenshots
  - dynamic video, audio, input driver changes
  - direct loading and playing of games without the use of the higan library
  - ZIP archive and multiple file extension support for games
  - firmware folder for unappended coprocessor firmware (see documentation for
    more)
  - compatibility with sd2snes and Snes9X MSU1 game file naming
  - compatibility with higan gamepaks (game folders)
  - soft-patching support for both BPS and IPS patches
  - menubar that does not pause emulation when entered
  - video pixel shaders (requires OpenGL 3.2)
  - built-in game database with over 1,200 games to ensure perfect memory
    mapping
  - (Linux, BSD only:) audio dynamic rate control to eliminate stuttering
  - and much more!

The one feature I regret not being able to support in this release is Windows
dynamic rate control. I put in my best attempt, but XAudio2's API is simply not
fine-grained enough, and the WASAPI driver is not mature enough. I hope that DRC
support can be added to the Windows port in the near future, and I would like to
offer a large cash bounty to anyone who can help me make this happen.
2019-02-22 17:48:52 +11:00
Lior Halphon 0b03b61564 Render the first line 0, as required for SGB emulation 2019-02-16 04:19:16 +02:00
Lior Halphon 9d0aadb83f Emulate missing Vreset signal (SGB only for now) and ICD2 desyncing 2019-02-15 17:04:48 +02:00
Lior Halphon 42ef41182d Merge branch 'master' of https://github.com/LIJI32/SameBoy 2019-02-15 14:12:39 +02:00
Lior Halphon dde06e7cae Work around a crashing race condition, proper fix needed 2019-01-28 20:56:37 +02:00
Lior Halphon 5ead9d49f4
Merge pull request #139 from libretro/master
Ready to merge: SGB in the libretro core
2019-01-25 13:41:33 +02:00
Tim Allen fbc1571889 Update to v106r85 release.
byuu says:

The bad instruction was due to the instruction before it fetching one
too many bytes. Didn't notice right away as the disassembler got it
right.

The register map was incorrect on the active 16-bit flags.

I fixed and improved some other things along those lines. Hooked up some
basic KnGE (VPU) timings, made it print out VRAM and some of the WRAM
onto the screen each frame, tried to drive Vblank and Hblank IRQs, but
... I don't know for sure what vector addresses they belong to.

MAME says "INT4" for Vblank, and says nothing for Hblank. I am wildly
guessing INT4==SWI 4==0xffff10, but ... I have no idea. I'm also not
emulating the interrupts properly based on line levels, I'm just firing
on the 0→1 transitions. Sounds like Vblank is more nuanced too, but I
guess we'll see.

Emulation is running further along now, even to the point of it
successfully enabling the KnGE IRQs, but VRAM doesn't appear to get much
useful stuff written into it yet.

I reverted the nall/primitive changes, so request for testing is I guess
rescinded, for whatever it was worth.
2019-01-22 11:26:20 +11:00
Tim Allen 53843934c0 Update to v106r84 release.
byuu says:

Changelog:

  - fixed a few TLCS900H CPU and disassembler bugs
  - hooked up a basic Neo Geo Pocket emulator skeleton and memory map;
    can run a few instructions from the BIOS
  - emulated the flash memory used by Neo Geo Pocket games
  - added sourcery to the higan source archives
  - fixed ternary expressions in sfc/ppu-fast [hex_usr]
2019-01-21 16:27:24 +11:00
Lior Halphon b996ed9220 Writing to BGPD/OBPD while it’s blocked still increases BGPI/OBPI if needed. Fixes #145 2019-01-19 23:37:44 +02:00
Lior Halphon 73a54049d2 Accurate PPU access timings 2019-01-19 19:32:26 +02:00
Tim Allen 37b610da53 Update to v106r83 release.
byuu says:

Changelog:

  - reverted nall/inline-if.hpp usage for now, since the
    nall/primitives.hpp math operators still cast to (u)int64_t
  - improved nall/primitives.hpp more; integer8 x = -128; print(-x) will
    now print 128 (unary operator+ and - cast to (u)int64_t)
  - renamed processor/lr35902 to processor/sm83; after the Sharp SM83
    CPU core [gekkio discovered the name]
  - a few bugfixes to the TLCS900H CPU core
  - completed the disassembler for the TLCS900H core

As a result of reverting most of the inline if stuff, I guess the
testing priority has been reduced. Which is probably a good thing,
considering I seem to have a smaller pool of testers these days.

Indeed, the TLCS900H core has ended up at 131KiB compared to the M68000
core at 128KiB. So it's now the largest CPU core in all of higan. It's
even more ridiculous because the M68000 core would ordinarily be quite a
bit smaller, had I not gone overboard with the extreme templating to
reduce instruction decoding overhead (you kind of have to do this for
RISC CPUs, and the inverted design of the TLCS900H kind of makes it
infeasible to do the same there.)

This CPU core is bound to have dozens of extremely difficult CPU bugs,
and there's no easy way for me to test them. I would greatly appreciate
any help in looking over the core for bugs. A fresh pair of eyes to spot
a mistake could save me up to several days of tedious debugging work.

The core still isn't ready to actually be tested: I have to hook up
cartridge loading, a memory bus, interrupts, timers, and the micro DMA
controller before it's likely that anything happens at all.
2019-01-19 12:34:17 +11:00
radius 68a72037fa add 4p support too 2019-01-17 20:33:20 -05:00
radius 10547a6d74 hookup up 2 player SGB 2019-01-17 19:44:58 -05:00
Lior Halphon 4536581a6e Fixed a bug where modifying RTC data would corrupt cartridge RAM data. Fixes #136 2019-01-18 02:36:14 +02:00
Tim Allen 2d9ce59e99 Update to v106r82 release.
byuu says:

Half of the disassembler is implemented now. Well, the decoding half
anyway. I'm splitting the decoding and string building into separate
components this time around, on account of the instruction encoding
being in reverse order. The string building portion hasn't been written
yet, either.

We're up to 112KiB now, compared to 128KiB for the 68K.
2019-01-18 10:59:49 +11:00
Tim Allen 559a6585ef Update to v106r81 release.
byuu says:

First 32 instructions implemented in the TLCS900H disassembler. Only 992
to go!

I removed the use of anonymous namespaces in nall. It was something I
rarely used, because it rarely did what I wanted.

I updated all nested namespaces to use C++17-style namespace Foo::Bar {}
syntax instead of classic C++-style namespace Foo { namespace Bar {}}.

I updated ruby::Video::acquire() to return a struct, so we can use C++17
structured bindings. Long term, I want to get away from all functions
that take references for output only. Even though C++ botched structured
bindings by not allowing you to bind to existing variables, it's even
worse to have function calls that take arguments by reference and then
write to them. From the caller side, you can't tell the value is being
written, nor that the value passed in doesn't matter, which is terrible.
2019-01-16 13:02:24 +11:00
Tim Allen 25145f59cc Update to v106r80 release.
byuu says:

Any usage of natural and integer cast to 64-bit math operations now.
Hopefully this will be the last of the major changes for a bit on
nall/primitives, at least until serious work begins on removing implicit
conversion to primitive types.

I also completed the initial TLCS900H core, sans SWI (kind of a ways off
from support interrupts.) I really shouldn't say completed, though. The
micro DMA unit is missing, interrupt priority handling is missing,
there's no debugger, and, of course, there's surely dozens of absolutely
critical CPU bugs that are going to be an absolute hellscape nightmare
to track down.

It was a damn shame, right up until the very last eight instructions,
[CP|LD][I|D](R), the instruction encoding was consistent. Of course,
there could be other inconsistencies that I missed. In fact, that's
somewhat likely ... sigh.
2019-01-16 00:09:50 +11:00
Tim Allen 17fc6d8d51 Update to v106r79 release.
byuu says:

This WIP is just work on nall/primitives ...

Basically, I'm coming to the conclusion that it's just not practical to
try and make Natural/Integer implicitly castable to primitive signed and
unsigned integers. C++ just has too many edge cases there.

I also want to get away from the problem of C++ deciding that all math
operations return 32-bit values, unless one of the parameters is 64-bit,
in which case you get a 64-bit value. You know, so things like
array[-1] won't end up accessing the 4 billionth element of the array.
It's nice to be fancy and minimally size operations (eg 32-bit+32-bit =
33-bit), but it's just too unintuitive. I think all
Natural<X>+Natural<Y> expessions should result in a Natural<64> (eg
natural) type.

nall/primitives/operators.hpp has been removed, and new
Natural<>Natural / Integer<>Integer casts exist. My feeling is that
signed and unsigned types should not be implicitly convertible where
data loss can occur. In the future, I think an integer8*natural8 is
fine to return an integer64, and the bitwise operators are probably all
fine between the two types. I could probably add
(Integer,Natural)+Boolean conversions as well.

To simplify expressions, there are new user-defined literals for _b
(boolean), _n (natural), _i (integer), _r (real), _n# (eg _n8),
_i# (eg _i8), _r# (eg _r32), and _s (nall::string).

In the long-term, my intention is to make the conversion and cast
constructors explicit for primitive types, but obviously that'll shatter
most of higan, so for now that won't be the case.

Something I can do in the future is allow implicit conversion and
casting to (u)int64_t. That may be a nice balance.
2019-01-15 15:33:20 +11:00
radius e2d9a353a0 remove single_dual mode, code cleanup 2019-01-14 23:11:42 -05:00
radius c266e4045b try to hookup sgb2 2019-01-14 23:11:42 -05:00
radius ca8426ea60 update libretro core 2019-01-14 23:11:42 -05:00
twinaphex 9fa6a2fe92 Add MSVC2017 target - doesn't work yet 2019-01-14 23:11:42 -05:00
Lior Halphon 312478e509 CGB palettes are not accessible during Mode 3, closes #84 2019-01-14 22:22:46 +02:00
Lior Halphon 879d3b607d Removed verified TODO 2019-01-14 20:32:52 +02:00
Tim Allen 6871e0e32a Update to v106r78 release.
byuu says:

I've implemented a lot more TLCS900H instructions. There are currently
20 missing spots, all of which are unique instructions (well, MINC and
MDEC could be considered pairs of 3 each), from a map of 1024 slots.

After that, I have to write the disassembler. Then the memory bus. Then
I get to start the fun process of debugging this monstrosity.

Also new is nall/inline-if.hpp. Note that this file is technically a war
crime, so be careful when opening it. This replaces ternary() from the
previous WIP.
2019-01-14 17:16:28 +11:00
Tim Allen bb1dd8c609 Update to v106r77 release.
byuu says:

So this turned out to be a rather unproductive ten-hour rabbit hole, but
...

I reworked nall/primitives.hpp a lot. And because the changes are
massive, testing of this WIP for regressions is critically important. I
really can't stress that enough, we're almost certainly going to have
some hidden regressions here ...

We now have a nall/primitives/ subfolder that splits up the classes into
manageable components. The bit-field support is now shared between both
Natural and Integer. All of the assignment operator overloads are now
templated and take references instead of values. Things like the
GSU::Register class are non-copyable on account of the function<>
object inside of it, and previously only operator= would work with
classes like that.

The big change is nall/primitives/operators.hpp, which is a really
elaborate system to compute the minimum number of bits needed for any
operation, and to return a Natural<T> or Integer<T> when one or both of
the arguments are such a type.

Unfortunately, it doesn't really work yet ... Kirby's Dream Land 3
breaks if we include operators.hpp. Zelda 3 runs fine with this, but I
had to make a huge amount of core changes, including introducing a new
ternary(bool, lhs, rhs) function to nall/algorithm to get past
Natural<X> and Natural<Y> not being equivalent (is_integral types get a
special exemption to ternary ?: type equivalence, yet it's impossible to
simulate with our own classes, which is bullshit.) The horrifying part
is that ternary() will evaluate both lhs and rhs, unlike ?:

I converted some of the functions to test ? uint(x) : uint(y), and
others to ternary(test, x, y) ... I don't have a strong preference
either way yet.

But the part where things may have gotten broken is in the changes to
where ternary() was placed. Some cases like in the GBA PPU renderer, it
was rather unclear the order of evaluations, so I may have made a
mistake somewhere.

So again, please please test this if you can. Or even better, look over
the diff.

Longer-term, I'd really like the enable nall/primitives/operators.hpp,
but right now I'm not sure why Kirby's Dream Land 3 is breaking. Help
would be appreciated, but ... it's gonna be really complex and difficult
to debug, so I'm probably gonna be on my own here ... sigh.
2019-01-13 17:25:14 +11:00
Lior Halphon ba5c07bed9 Correctly emulate speed switch timing 2019-01-13 01:09:41 +02:00
Lior Halphon c74b39e712 The CPU core of the Game Boy is (most likely) called SM83 2019-01-12 00:42:16 +02:00