Update to v102r12 release.

byuu says:

Changelog:

  - MD/PSG: fixed 68K bus Z80 status read address location
  - MS, GG, MD/PSG: channels post-decrement their counters, not
    pre-decrement [Cydrak]¹
  - MD/VDP: cache screen width registers once per scanline; screen
    height registers once per frame
  - MD/VDP: support 256-width display mode (used in Shining Force, etc)
  - MD/YM2612: implemented timers²
  - MD/YM2612: implemented 8-bit PCM DAC²
  - 68000: TRAP instruction should index the vector location by 32 (eg
    by 128 bytes), fixes Shining Force
  - nall: updated hex(), octal(), binary() functions to take uintmax
    instead of template<typename T> parameter³

¹: this one makes an incredible difference. Sie noticed that lots of
games set a period of 0, which would end up being a really long period
with pre-decrement. By fixing this, noise shows up in many more games,
and sounds way better in games even where it did before. You can hear
extra sound on Lunar - Sanposuru Gakuen's title screen, the noise in
Sonic The Hedgehog (Mega Drive) sounds better, etc.

²: this also really helps sound. The timers allow PSG music to play
back at the correct speed instead of playing back way too quickly. And
the PCM DAC lets you hear a lot of drum effects, as well as the
"Sega!!" sound at the start of Sonic the Hedgehog, and the infamous,
"Rise from your grave!" line from Altered Beast.

Still, most music on the Mega Drive comes from the FM channels, so
there's still not a whole lot to listen to.

I didn't implement Cydrak's $02c test register just yet. Sie wasn't 100%
certain on how the extended DAC bit worked, so I'd like to play it a
little conservative and get sound working, then I'll go back and add a
toggle or something to enable undocumented registers, that way we can
use that to detect any potential problems they might be causing.

³: unfortunately we lose support for using hex() on nall/arithmetic
types. If I have a const Pair& version of the function, then the
compiler gets confused on whether Natural<32> should use uintmax or
const Pair&, because compilers are stupid, and you can't have explicit
arguments in overloaded functions. So even though either function would
work, it just decides to error out instead >_>

This is actually really annoying, because I want hex() to be useful for
printing out nall/crypto keys and hashes directly.

But ... this change had to be made. Negative signed integers would crash
programs, and that was taking out my 68000 disassembler.
This commit is contained in:
Tim Allen
2017-02-27 19:45:51 +11:00
parent 1cab2dfeb8
commit 4c3f9b93e7
21 changed files with 205 additions and 48 deletions

View File

@@ -84,9 +84,9 @@ template<typename T> auto pad(const T& value, long precision, char padchar) -> s
return buffer;
}
template<typename T> auto hex(T value, long precision, char padchar) -> string {
auto hex(uintmax value, long precision, char padchar) -> string {
string buffer;
buffer.resize(sizeof(T) * 2);
buffer.resize(sizeof(uintmax) * 2);
char* p = buffer.get();
uint size = 0;
@@ -101,9 +101,9 @@ template<typename T> auto hex(T value, long precision, char padchar) -> string {
return buffer;
}
template<typename T> auto octal(T value, long precision, char padchar) -> string {
auto octal(uintmax value, long precision, char padchar) -> string {
string buffer;
buffer.resize(sizeof(T) * 3);
buffer.resize(sizeof(uintmax) * 3);
char* p = buffer.get();
uint size = 0;
@@ -117,9 +117,9 @@ template<typename T> auto octal(T value, long precision, char padchar) -> string
return buffer;
}
template<typename T> auto binary(T value, long precision, char padchar) -> string {
auto binary(uintmax value, long precision, char padchar) -> string {
string buffer;
buffer.resize(sizeof(T) * 8);
buffer.resize(sizeof(uintmax) * 8);
char* p = buffer.get();
uint size = 0;
@@ -133,23 +133,14 @@ template<typename T> auto binary(T value, long precision, char padchar) -> strin
return buffer;
}
template<typename T> auto pointer(const T* value, long precision) -> string {
if(value == nullptr) return "(nullptr)";
return {"0x", hex((uintptr)value, precision)};
}
auto pointer(uintptr value, long precision) -> string {
if(value == 0) return "(nullptr)";
return {"0x", hex(value, precision)};
}
/*
auto real(long double value) -> string {
string temp;
temp.resize(fromReal(nullptr, value));
fromReal(temp.get(), value);
return temp;
template<typename T> auto pointer(const T* value, long precision) -> string {
if(value == nullptr) return "(nullptr)";
return {"0x", hex((uintptr)value, precision)};
}
*/
}