Update to v099r13 release.
byuu says:
Changelog:
- GB core code cleanup completed
- GBA core code cleanup completed
- some more cleanup on missed processor/arm functions/variables
- fixed FC loading icarus bug
- "Load ROM File" icarus functionality restored
- minor code unification efforts all around (not perfect yet)
- MMIO->IO
- mmio.cpp->io.cpp
- read,write->readIO,writeIO
It's been a very long work in progress ... starting all the way back with
v094r09, but the major part of the higan code cleanup is now completed! Of
course, it's very important to note that this is only for the basic style:
- under_score functions and variables are now camelCase
- return-type function-name() are now auto function-name() -> return-type
- Natural<T>/Integer<T> replace (u)intT_n types where possible
- signed/unsigned are now int/uint
- most of the x==true,x==false tests changed to x,!x
A lot of spot improvements to consistency, simplicity and quality have
gone in along the way, of course. But we'll probably never fully finishing
beautifying every last line of code in the entire codebase. Still,
this is a really great start. Going forward, WIP diffs should start
being smaller and of higher quality once again.
I know the joke is, "until my coding style changes again", but ... this
was way too stressful, way too time consuming, and way too risky. I'm
too old and tired now for extreme upheavel like this again. The only
major change I'm slowly mulling over would be renaming the using
Natural<T>/Integer<T> = (u)intT; shorthand to something that isn't as
easily confused with the (u)int_t types ... but we'll see. I'll definitely
continue to change small things all the time, but for the larger picture,
I need to just accept the style I have and live with it.
2016-06-29 11:10:28 +00:00
|
|
|
struct APU : Thread, IO {
|
Update to v098r06 release.
byuu says:
Changelog:
- emulation cores now refresh video from host thread instead of
cothreads (fix AMD crash)
- SFC: fixed another bug with leap year months in SharpRTC emulation
- SFC: cleaned up camelCase on function names for
armdsp,epsonrtc,hitachidsp,mcc,nss,sharprtc classes
- GB: added MBC1M emulation (requires manually setting mapper=MBC1M in
manifest.bml for now, sorry)
- audio: implemented Emulator::Audio mixer and effects processor
- audio: implemented Emulator::Stream interface
- it is now possible to have more than two audio streams: eg SNES
+ SGB + MSU1 + Voicer-Kun (eventually)
- audio: added reverb delay + reverb level settings; exposed balance
configuration in UI
- video: reworked palette generation to re-enable saturation, gamma,
luminance adjustments
- higan/emulator.cpp is gone since there was nothing left in it
I know you guys are going to say the color adjust/balance/reverb stuff
is pointless. And indeed it mostly is. But I like the idea of allowing
some fun special effects and configurability that isn't system-wide.
Note: there seems to be some kind of added audio lag in the SGB
emulation now, and I don't really understand why. The code should be
effectively identical to what I had before. The only main thing is that
I'm sampling things to 48000hz instead of 32040hz before mixing. There's
no point where I'm intentionally introducing added latency though. I'm
kind of stumped, so if anyone wouldn't mind taking a look at it, it'd be
much appreciated :/
I don't have an MSU1 test ROM, but the latency issue may affect MSU1 as
well, and that would be very bad.
2016-04-22 13:35:51 +00:00
|
|
|
shared_pointer<Emulator::Stream> stream;
|
|
|
|
|
2015-11-16 08:38:05 +00:00
|
|
|
static auto Enter() -> void;
|
|
|
|
auto main() -> void;
|
|
|
|
auto step(uint clocks) -> void;
|
2012-03-19 11:19:53 +00:00
|
|
|
|
Update to v099r13 release.
byuu says:
Changelog:
- GB core code cleanup completed
- GBA core code cleanup completed
- some more cleanup on missed processor/arm functions/variables
- fixed FC loading icarus bug
- "Load ROM File" icarus functionality restored
- minor code unification efforts all around (not perfect yet)
- MMIO->IO
- mmio.cpp->io.cpp
- read,write->readIO,writeIO
It's been a very long work in progress ... starting all the way back with
v094r09, but the major part of the higan code cleanup is now completed! Of
course, it's very important to note that this is only for the basic style:
- under_score functions and variables are now camelCase
- return-type function-name() are now auto function-name() -> return-type
- Natural<T>/Integer<T> replace (u)intT_n types where possible
- signed/unsigned are now int/uint
- most of the x==true,x==false tests changed to x,!x
A lot of spot improvements to consistency, simplicity and quality have
gone in along the way, of course. But we'll probably never fully finishing
beautifying every last line of code in the entire codebase. Still,
this is a really great start. Going forward, WIP diffs should start
being smaller and of higher quality once again.
I know the joke is, "until my coding style changes again", but ... this
was way too stressful, way too time consuming, and way too risky. I'm
too old and tired now for extreme upheavel like this again. The only
major change I'm slowly mulling over would be renaming the using
Natural<T>/Integer<T> = (u)intT; shorthand to something that isn't as
easily confused with the (u)int_t types ... but we'll see. I'll definitely
continue to change small things all the time, but for the larger picture,
I need to just accept the style I have and live with it.
2016-06-29 11:10:28 +00:00
|
|
|
auto readIO(uint32 addr) -> uint8;
|
|
|
|
auto writeIO(uint32 addr, uint8 byte) -> void;
|
2015-11-16 08:38:05 +00:00
|
|
|
auto power() -> void;
|
2012-04-06 04:29:50 +00:00
|
|
|
|
2015-11-16 08:38:05 +00:00
|
|
|
auto runsequencer() -> void;
|
Update to v087r26 release.
byuu says:
Changelog:
- fixed FIFO[1] reset behavior (fixes audio in Sword of Mana)
- added FlashROM emulation (both sizes)
- GBA parses RAM settings from manifest.xml now
- save RAM is written to disk now
- added save state support (it's currently broken, though)
- fixed ROM/RAM access timings
- open bus should mostly work (we don't do the PC+12 stuff yet)
- emulated the undocumented memory control register (mirror IWRAM,
disable I+EWRAM, EWRAM wait state count)
- emulated keypad interrupts
- emulated STOP (freezes video, audio, DMA and timers; only breaks on
keypad IRQs)
- probably a lot more, it was a long night ...
Show stoppers, missing things, broken things, etc:
- ST018 is still completely broken
- GBC audio sequencer apparently needs work
- GBA audio FIFO buffer seems too quiet
- PHI / ROM prefetch needs to be emulated (no idea on how to do this,
especially PHI)
- SOUNDBIAS 64/128/256khz modes should output at that resolution
(really, we need to simulate PWM properly, no idea on how to do this)
- object mosaic top-left coordinates are wrong (minor, fixing will
actually make the effect look worse)
- need to emulate PPU greenswap and color palette distortion (no idea on
how do this)
- need GBA save type database (I would also LIKE to blacklist
/ patch-out trainers, but that's a discussion for another day.)
- some ARM ops advance the prefetch buffer, so you can read PC+12 in
some cases
2012-04-16 12:19:39 +00:00
|
|
|
|
2015-11-16 08:38:05 +00:00
|
|
|
auto serialize(serializer&) -> void;
|
2017-06-08 14:05:48 +00:00
|
|
|
|
|
|
|
uint clock;
|
Update to v103r01 release.
byuu says:
Changelog:
- nall/dsp: improve one pole coefficient calculations [Fatbag]
- higan/audio: reworked filters to support selection of either one
pole (first-order) or biquad (second-order) filters
- note: the design is not stable yet; so forks should not put too
much effort into synchronizing with this change yet
- fc: added first-order filters as per NESdev wiki (90hz lowpass +
440hz lowpass + 14khz highpass)
- fc: created separate NTSC-J and NTSC-U regions
- NESdev wiki says the Japanese Famicom uses a separate audio
filtering strategy, but details are fuzzy
- there's also cartridge audio output being disabled on NES units;
and differences with controllers
- this stuff will be supported in the future, just adding the
support for it now
- gba: corrected serious bugs in PSG wave channel emulation [Cydrak]
- note that if there are still bugs here, it's my fault
- md/psg,ym2612: added first-order low-pass 2840hz filter to match
VA3-VA6 Mega Drives
- md/psg: lowered volume relative to the YM2612
- using 0x1400; multiple people agreed it was the closest to the
hardware recordings against a VA6
- ms,md/psg: don't serialize the volume levels array
- md/vdp: Hblank bit acts the same during Vblank as outside of it (it
isn't always set during Vblank)
- md/vdp: return isPAL in bit 0 of control port reads
- tomoko: change command-line option separator from : to |
- [Editor's note: This change was present in the public v103,
but it's in this changelog because it was made after the v103 WIP]
- higan/all: change the 20hz high-pass filters from second-order
three-pass to first-order one-pass
- these filters are meant to remove DC bias, but I honestly can't
hear a difference with or without them
- so there's really no sense wasting CPU power with an extremely
powerful filter here
Things I did not do:
- change icarus install rule
- work on 8-bit Mega Drive SRAM
- work on Famicom or Mega Drive region detection heuristics in icarus
My long-term dream plan is to devise a special user-configurable
filtering system where you can set relative volumes and create your own
list of filters (any number of them in any order at any frequency), that
way people can make the systems sound however they want.
Right now, the sanest place to put this information is inside the
$system.sys/manifest.bml files. But that's not very user friendly, and
upgrading to new versions will lose these changes if you don't copy them
over manually. Of course, cluttering the GUI with a fancy filter editor
is probably supreme overkill for 99% of users, so maybe that's fine.
2017-06-26 01:41:58 +00:00
|
|
|
|
|
|
|
struct Registers {
|
|
|
|
struct SoundBias {
|
|
|
|
uint10 level;
|
|
|
|
uint2 amplitude;
|
|
|
|
} bias;
|
|
|
|
} regs;
|
|
|
|
|
|
|
|
struct Sweep {
|
|
|
|
uint3 shift;
|
|
|
|
uint1 direction;
|
|
|
|
uint3 frequency;
|
|
|
|
|
|
|
|
uint1 enable;
|
|
|
|
uint1 negate;
|
|
|
|
uint3 period;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Envelope {
|
|
|
|
uint3 frequency;
|
|
|
|
uint1 direction;
|
|
|
|
uint4 volume;
|
|
|
|
|
|
|
|
uint3 period;
|
|
|
|
|
|
|
|
auto dacEnable() const -> bool { return volume || direction; }
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Square {
|
|
|
|
Envelope envelope;
|
|
|
|
uint1 enable;
|
|
|
|
uint6 length;
|
|
|
|
uint2 duty;
|
|
|
|
uint11 frequency;
|
|
|
|
uint1 counter;
|
|
|
|
uint1 initialize;
|
|
|
|
|
|
|
|
int shadowfrequency;
|
|
|
|
uint1 signal;
|
|
|
|
uint4 output;
|
|
|
|
uint period;
|
|
|
|
uint3 phase;
|
|
|
|
uint4 volume;
|
|
|
|
|
|
|
|
auto run() -> void;
|
|
|
|
auto clocklength() -> void;
|
|
|
|
auto clockenvelope() -> void;
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Square1 : Square {
|
|
|
|
Sweep sweep;
|
|
|
|
|
|
|
|
auto runsweep(bool update) -> void;
|
|
|
|
auto clocksweep() -> void;
|
|
|
|
auto read(uint addr) const -> uint8;
|
|
|
|
auto write(uint addr, uint8 byte) -> void;
|
|
|
|
auto power() -> void;
|
|
|
|
} square1;
|
|
|
|
|
|
|
|
struct Square2 : Square {
|
|
|
|
auto read(uint addr) const -> uint8;
|
|
|
|
auto write(uint addr, uint8 byte) -> void;
|
|
|
|
auto power() -> void;
|
|
|
|
} square2;
|
|
|
|
|
|
|
|
struct Wave {
|
|
|
|
uint1 mode;
|
|
|
|
uint1 bank;
|
|
|
|
uint1 dacenable;
|
|
|
|
uint8 length;
|
|
|
|
uint3 volume;
|
|
|
|
uint11 frequency;
|
|
|
|
uint1 counter;
|
|
|
|
uint1 initialize;
|
|
|
|
uint4 pattern[2 * 32];
|
|
|
|
|
|
|
|
uint1 enable;
|
|
|
|
uint4 output;
|
|
|
|
uint5 patternaddr;
|
|
|
|
uint1 patternbank;
|
|
|
|
uint4 patternsample;
|
|
|
|
uint period;
|
|
|
|
|
|
|
|
auto run() -> void;
|
|
|
|
auto clocklength() -> void;
|
|
|
|
auto read(uint addr) const -> uint8;
|
|
|
|
auto write(uint addr, uint8 byte) -> void;
|
|
|
|
auto readram(uint addr) const -> uint8;
|
|
|
|
auto writeram(uint addr, uint8 byte) -> void;
|
|
|
|
auto power() -> void;
|
|
|
|
} wave;
|
|
|
|
|
|
|
|
struct Noise {
|
|
|
|
Envelope envelope;
|
|
|
|
uint6 length;
|
|
|
|
uint3 divisor;
|
|
|
|
uint1 narrowlfsr;
|
|
|
|
uint4 frequency;
|
|
|
|
uint1 counter;
|
|
|
|
uint1 initialize;
|
|
|
|
|
|
|
|
uint1 enable;
|
|
|
|
uint15 lfsr;
|
|
|
|
uint4 output;
|
|
|
|
uint period;
|
|
|
|
uint4 volume;
|
|
|
|
|
|
|
|
auto divider() const -> uint;
|
|
|
|
auto run() -> void;
|
|
|
|
auto clocklength() -> void;
|
|
|
|
auto clockenvelope() -> void;
|
|
|
|
auto read(uint addr) const -> uint8;
|
|
|
|
auto write(uint addr, uint8 byte) -> void;
|
|
|
|
auto power() -> void;
|
|
|
|
} noise;
|
|
|
|
|
|
|
|
struct Sequencer {
|
|
|
|
uint2 volume;
|
|
|
|
uint3 lvolume;
|
|
|
|
uint3 rvolume;
|
|
|
|
uint1 lenable[4];
|
|
|
|
uint1 renable[4];
|
|
|
|
uint1 masterenable;
|
|
|
|
|
|
|
|
uint12 base;
|
|
|
|
uint3 step;
|
|
|
|
int16 lsample;
|
|
|
|
int16 rsample;
|
|
|
|
|
|
|
|
uint10 loutput;
|
|
|
|
uint10 routput;
|
|
|
|
|
|
|
|
auto sample() -> void;
|
|
|
|
|
|
|
|
auto read(uint addr) const -> uint8;
|
|
|
|
auto write(uint addr, uint8 byte) -> void;
|
|
|
|
auto power() -> void;
|
|
|
|
} sequencer;
|
|
|
|
|
|
|
|
struct FIFO {
|
|
|
|
int8 samples[32];
|
|
|
|
int8 active;
|
|
|
|
int8 output;
|
|
|
|
|
|
|
|
uint5 rdoffset;
|
|
|
|
uint5 wroffset;
|
|
|
|
uint6 size;
|
|
|
|
|
|
|
|
uint1 volume; //0 = 50%, 1 = 100%
|
|
|
|
uint1 lenable;
|
|
|
|
uint1 renable;
|
|
|
|
uint1 timer;
|
|
|
|
|
|
|
|
auto sample() -> void;
|
|
|
|
auto read() -> void;
|
|
|
|
auto write(int8 byte) -> void;
|
|
|
|
auto reset() -> void;
|
|
|
|
auto power() -> void;
|
|
|
|
} fifo[2];
|
2012-03-19 11:19:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
extern APU apu;
|