コミットグラフ

25 コミット

作成者 SHA1 メッセージ 日付
thekovic a65bf18645
nall: fix Wcast-user-defined warning (#1494)
Compiling with GCC 14.1 in MSYS2 caused a lot of warnings of the
`-Wcast-user-defined` variety. This PR adresses that.

Note: This PR does not address
https://github.com/ares-emulator/ares/issues/1399 . Those warnings
happen at the link stage, they don't seem to be GCC-only (since issue OP
also reports them with clang), and they don't appear at lower
optimization settings (I tested `build=debug` and `build=stable` which
compiled cleanly).
2024-05-18 16:56:32 +01:00
invertego e38b7e586d nall: add move constructors to BitField/Range
MSVC wants these to compile certain experessions, and while I'm not 100%
sure if it technically should require them, I see no reason for these
classes not to have any.
2023-03-13 11:21:26 +00:00
invertego 8f60efcb20 nall: move lowercase primitive types to namespace
Avoid conflicts with the "boolean" type added to the global namespace by
Windows headers.
2022-12-18 09:18:52 +00:00
Near b2fc626854 Update to ares v120r17 release.
- WonderSwan: disabling an interrupt source does clear its pending status
    (fixes Digimon Tamers)
  - TLCS900H: improved prefetch handling and instruction timing (still
    imperfect)
2021-06-20 21:35:00 +00:00
Near f45ccd4b7d Update to ares v119r08 release.
Really substantial Mega Drive profile=accuracy timing improvements, but still
Titan Overdrive 2 performs much worse than the default performance profile, and
that fucking audio driver still won't play any sound.
2021-04-15 19:58:00 +00:00
Near 7656765f30 Update to ares v117 release.
[No official changelog available for this version. -Ed.]
2021-02-08 09:11:00 +00:00
Near 810a18bb8c Update to ares v111r06 release.
- ares: added new Node::Properties debugger type
  - lucia: added new properties viewer tool
  - all: removed extraneous inline designators from member functions
    declared inside header files
2020-04-04 04:14:00 +00:00
byuu f3f96dba1c v108.2
* Famicom: emulated the X24C01 EEPROM for Bandai-FGC boards
** (no X24C02 support yet)
* nall: fixed a subtle yet critical issue with Natural/Integer::bit()
** (values out of range were not being masked out upon assignment)
2020-03-06 02:44:41 +09:00
byuu 6d19b5422d v106.193
* nall: transform (Natural,Integer)<T>::bits() to bit()
2019-08-07 13:51:59 +09:00
byuu 8d72549827 v106.192
* reverted .field()/.range() to .bit()
* increased flexibility of Emulator::Screen video format (RGBA24,30)
2019-08-06 11:30:51 +09:00
byuu befe585333 v106.191
* migrated SFC core from .bit(s) to .field/.range
2019-08-05 15:34:35 +09:00
Tim Allen c22035fb37 Update to v106r180 release.
byuu says:

Moved operator() to .range() and operator[] to .field() for Natural/Integer
types. Also improved Super Game Boy emulation speed by ~16%, and removed the
need for two callbacks (but adding one new one). Joypad interrupts should now
work during CPU HALT and STOP as they're supposed to.
2019-07-16 21:40:42 +10:00
Tim Allen 34555a9a86 Update to v106r179 release.
byuu says:

  - higan: hopefully fix SFC WDC65816 compilation under GCC using the new fixed
    BitRange/BitField templates
2019-07-15 21:03:26 +10:00
Tim Allen 49ce0f6d14 Update to v106r178 release.
byuu says:

  - higan: reset all thread clocks on power cycle
  - higan: fix minor regression from WDC65816 CPU rewrite
  - higan: fix nall::Integer casting regression
  - higan: removed nall/bit-field.hpp and nall/bit-vector.hpp
2019-07-14 18:48:27 +10:00
Tim Allen c86fd598c5 Update to v106r177 release.
byuu says:

  - SFC: fixed BS Memory queue.data(n) = value null-assignment
  - SFC: rewrote WDC65816 disassembler (sprintf → nall::string)
  - SFC: mostly rewritten WDC65816 CPU core
2019-07-12 18:50:26 +10:00
Tim Allen 2f1176df87 Update to v106r170 release.
byuu says:

I finally pass blargg's dmg-sound and cgb-sound tests, but at quite a cost.
Reads and writes can't happen on an exact T-cycle (clock cycle) point within an
M-cycle (opcode cycle) for the DMG. Writes to trigger take effect two clocks
after writes to wave RAM, for instance. Probably going to be a lot more of this
in low-level PPU emulation, so I'm biting the bullet and slowly converting the
Game Boy bus handler to this new format, which I'll use as a test bench for
doing this later to other systems with, since Game Boy performance isn't as
critical (it's a drop from 220fps to 200fps to have to poll the bus four times
per memory access and synchronize the CPU four times as often, so a lot less bad
than I'd feared at least.)
2019-06-27 22:13:03 +10:00
Tim Allen 1a4acbf74b Update to v106r112 release.
byuu says:

I made it default to the safe drivers so no more ASIO crash out of the box,
and full driver configuration is now in place, plus a skeleton Hotkeys
implementation (it won't save hotkey bindings to disk yet though...)

The way the driver stuff works is pretty spiffy...but also not complete. So when
you start the program, I don't initialize any drivers, because sucky vendor
drivers can crash higan and you get stuck in a crash loop. So instead, you
have to "activate" the driver before the driver settings are editable. For
instance, until XAudio2 is initialized, it can't query XAudio2 for all available
playback devices. So you go to audio settings, activate your driver, and now
you can change devices. whenever you change any driver setting, it updates all
driver settings again and refreshes the entire settings panel again. Because
for instance, if you change a WASAPI device, the new device may not support the
currently assigned frequency. Aren't computers fun?

Starting a system initializes the input and audio drivers, so that
auto-activates those drivers and you can immediately edit their settings. Video
is more difficult ... you have to have a visible window that has been realized
on the screen before you can initialize a video driver. So to get it to auto
activate, you have to actually power on the system. Otherwise, when you hit
activate, I flash a 1x1 pixel viewport at the bottom left of the video settings
panel, populate the settings, and then destroy it.

The downside to all of this is input ... if you try and bind hotkeys immediately
after starting higan, then no input driver will be bound. So, yeah, I gotta
figure out what I'm going to do there.

Like bsnes v107, higan now lets you change drivers on the fly, but of course
that's risky, so ... you know. you probably shouldn't. "activate" becomes
"change" once a driver is activated for the first time.
2019-03-09 13:16:46 +11:00
Tim Allen c9cdf909f1 Update to v106r88 release.
byuu says:

Couldn't sleep again.

So, this updates all cores to the new options/properties setup, and
connects onModify events to nall/settings.

manifest.bml files are no longer required for .sys folders (I still need
to delete a few of them, I forgot.)

Currently, systems with slightly different properties (WonderSwan EEPROM
sizes, Game Boy boot ROM sizes, ...) require per-system properties()
functions. This in effect exposes a limitation with trying to share the
properties from a single object. What's probably going to be necessary
is to have each Interface class hold a `vector<Settings*>`, and during
construction, add all the members said system needs. The same goes for
options (Master System has controller ports whereas Game Gear does not.)

This also means that we can't pre-declare the default values for all
systems. We'll have to declare defaults inside each Interface instance.

So in light of all of this, I'm probably going to reshape Settings to be
a single-level class holding a ton of `Settings*` objects, and the
serialization functionality will just have to build the tree from a flat
list somehow. I could probably rely on Markup::Node itself to do this
for me.

Oh, nall/primitives gained explicit specializations for converting from
a `const char*` (the string class isn't defined at this point,
regrettably.) So with that, you can make a `Setting<T>` out of any `T` that
can be explicitly constructed from a `const char*`. I want to do the same
for the string class, and allow explicit casting to the nall/primitives
types, as the toInteger(), etc classes are a little wonky to use.
2019-01-25 15:53:16 +11: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
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
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
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