Revert "Revert "awjackson""

This commit is contained in:
Sharpy 2017-07-12 16:01:59 +01:00 committed by GitHub
parent ff735792d7
commit 3adabb8bf3
6 changed files with 51 additions and 85 deletions

View file

@ -11,7 +11,7 @@
namespace nall {
struct Keyboard;
Keyboard& keyboard(unsigned = 0);
Keyboard keyboard(unsigned = 0);
static const char KeyboardScancodeName[][64] = {
"Escape", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12",
@ -122,12 +122,9 @@ struct Keyboard {
Keyboard(unsigned ID_) : ID(ID_) {}
};
inline Keyboard& keyboard(unsigned id) {
static Keyboard kb0(0), kb1(1), kb2(2), kb3(3), kb4(4), kb5(5), kb6(6), kb7(7);
switch(id) { default:
case 0: return kb0; case 1: return kb1; case 2: return kb2; case 3: return kb3;
case 4: return kb4; case 5: return kb5; case 6: return kb6; case 7: return kb7;
}
inline Keyboard keyboard(unsigned id) {
assert(id < Keyboard::Count);
return Keyboard(id);
}
static const char MouseScancodeName[][64] = {
@ -136,7 +133,7 @@ static const char MouseScancodeName[][64] = {
};
struct Mouse;
Mouse& mouse(unsigned = 0);
Mouse mouse(unsigned = 0);
struct Mouse {
const unsigned ID;
@ -220,12 +217,9 @@ struct Mouse {
Mouse(unsigned ID_) : ID(ID_) {}
};
inline Mouse& mouse(unsigned id) {
static Mouse ms0(0), ms1(1), ms2(2), ms3(3), ms4(4), ms5(5), ms6(6), ms7(7);
switch(id) { default:
case 0: return ms0; case 1: return ms1; case 2: return ms2; case 3: return ms3;
case 4: return ms4; case 5: return ms5; case 6: return ms6; case 7: return ms7;
}
inline Mouse mouse(unsigned id) {
assert(id < Mouse::Count);
return Mouse(id);
}
static const char JoypadScancodeName[][64] = {
@ -239,7 +233,7 @@ static const char JoypadScancodeName[][64] = {
};
struct Joypad;
Joypad& joypad(unsigned = 0);
Joypad joypad(unsigned = 0);
struct Joypad {
const unsigned ID;
@ -345,12 +339,9 @@ struct Joypad {
Joypad(unsigned ID_) : ID(ID_) {}
};
inline Joypad& joypad(unsigned id) {
static Joypad jp0(0), jp1(1), jp2(2), jp3(3), jp4(4), jp5(5), jp6(6), jp7(7);
switch(id) { default:
case 0: return jp0; case 1: return jp1; case 2: return jp2; case 3: return jp3;
case 4: return jp4; case 5: return jp5; case 6: return jp6; case 7: return jp7;
}
inline Joypad joypad(unsigned id) {
assert(id < Joypad::Count);
return Joypad(id);
}
struct Scancode {

View file

@ -40,7 +40,7 @@ static BOOST::uint8_t const initial_regs [SPC_DSP::register_count] =
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xE0,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,0x00,0x00,0x00,
// 0x45,0x8B,0x5A,0x9A,0xE4,0x82,0x1B,0x78,0x00,0x00,0xAA,0x96,0x89,0x0E,0xE0,0x80,
// 0x2A,0x49,0x3D,0xBA,0x14,0xA0,0xAC,0xC5,0x00,0x00,0x51,0xBB,0x9C,0x4E,0x7B,0xFF,
@ -856,6 +856,7 @@ void SPC_DSP::soft_reset_common()
void SPC_DSP::soft_reset()
{
REG(flg) = 0xE0;
REG(endx) = 0xFF;
soft_reset_common();
}

View file

@ -337,6 +337,7 @@ void DSP::reset() {
#endif
REG(flg) = 0xe0;
REG(endx) = 0xff;
state.noise = 0x4000;
state.echo_hist_pos = 0;

View file

@ -11,7 +11,7 @@
namespace nall {
struct Keyboard;
Keyboard& keyboard(unsigned = 0);
Keyboard keyboard(unsigned = 0);
static const char KeyboardScancodeName[][64] = {
"Escape", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12",
@ -122,12 +122,9 @@ struct Keyboard {
Keyboard(unsigned ID_) : ID(ID_) {}
};
inline Keyboard& keyboard(unsigned id) {
static Keyboard kb0(0), kb1(1), kb2(2), kb3(3), kb4(4), kb5(5), kb6(6), kb7(7);
switch(id) { default:
case 0: return kb0; case 1: return kb1; case 2: return kb2; case 3: return kb3;
case 4: return kb4; case 5: return kb5; case 6: return kb6; case 7: return kb7;
}
inline Keyboard keyboard(unsigned id) {
assert(id < Keyboard::Count);
return Keyboard(id);
}
static const char MouseScancodeName[][64] = {
@ -136,7 +133,7 @@ static const char MouseScancodeName[][64] = {
};
struct Mouse;
Mouse& mouse(unsigned = 0);
Mouse mouse(unsigned = 0);
struct Mouse {
const unsigned ID;
@ -220,12 +217,9 @@ struct Mouse {
Mouse(unsigned ID_) : ID(ID_) {}
};
inline Mouse& mouse(unsigned id) {
static Mouse ms0(0), ms1(1), ms2(2), ms3(3), ms4(4), ms5(5), ms6(6), ms7(7);
switch(id) { default:
case 0: return ms0; case 1: return ms1; case 2: return ms2; case 3: return ms3;
case 4: return ms4; case 5: return ms5; case 6: return ms6; case 7: return ms7;
}
inline Mouse mouse(unsigned id) {
assert(id < Mouse::Count);
return Mouse(id);
}
static const char JoypadScancodeName[][64] = {
@ -239,7 +233,7 @@ static const char JoypadScancodeName[][64] = {
};
struct Joypad;
Joypad& joypad(unsigned = 0);
Joypad joypad(unsigned = 0);
struct Joypad {
const unsigned ID;
@ -345,12 +339,9 @@ struct Joypad {
Joypad(unsigned ID_) : ID(ID_) {}
};
inline Joypad& joypad(unsigned id) {
static Joypad jp0(0), jp1(1), jp2(2), jp3(3), jp4(4), jp5(5), jp6(6), jp7(7);
switch(id) { default:
case 0: return jp0; case 1: return jp1; case 2: return jp2; case 3: return jp3;
case 4: return jp4; case 5: return jp5; case 6: return jp6; case 7: return jp7;
}
inline Joypad joypad(unsigned id) {
assert(id < Joypad::Count);
return Joypad(id);
}
struct Scancode {

View file

@ -11,7 +11,7 @@
namespace nall {
struct Keyboard;
Keyboard& keyboard(unsigned = 0);
Keyboard keyboard(unsigned = 0);
static const char KeyboardScancodeName[][64] = {
"Escape", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12",
@ -122,12 +122,9 @@ struct Keyboard {
Keyboard(unsigned ID_) : ID(ID_) {}
};
inline Keyboard& keyboard(unsigned id) {
static Keyboard kb0(0), kb1(1), kb2(2), kb3(3), kb4(4), kb5(5), kb6(6), kb7(7);
switch(id) { default:
case 0: return kb0; case 1: return kb1; case 2: return kb2; case 3: return kb3;
case 4: return kb4; case 5: return kb5; case 6: return kb6; case 7: return kb7;
}
inline Keyboard keyboard(unsigned id) {
assert(id < Keyboard::Count);
return Keyboard(id);
}
static const char MouseScancodeName[][64] = {
@ -136,7 +133,7 @@ static const char MouseScancodeName[][64] = {
};
struct Mouse;
Mouse& mouse(unsigned = 0);
Mouse mouse(unsigned = 0);
struct Mouse {
const unsigned ID;
@ -220,12 +217,9 @@ struct Mouse {
Mouse(unsigned ID_) : ID(ID_) {}
};
inline Mouse& mouse(unsigned id) {
static Mouse ms0(0), ms1(1), ms2(2), ms3(3), ms4(4), ms5(5), ms6(6), ms7(7);
switch(id) { default:
case 0: return ms0; case 1: return ms1; case 2: return ms2; case 3: return ms3;
case 4: return ms4; case 5: return ms5; case 6: return ms6; case 7: return ms7;
}
inline Mouse mouse(unsigned id) {
assert(id < Mouse::Count);
return Mouse(id);
}
static const char JoypadScancodeName[][64] = {
@ -239,7 +233,7 @@ static const char JoypadScancodeName[][64] = {
};
struct Joypad;
Joypad& joypad(unsigned = 0);
Joypad joypad(unsigned = 0);
struct Joypad {
const unsigned ID;
@ -345,12 +339,9 @@ struct Joypad {
Joypad(unsigned ID_) : ID(ID_) {}
};
inline Joypad& joypad(unsigned id) {
static Joypad jp0(0), jp1(1), jp2(2), jp3(3), jp4(4), jp5(5), jp6(6), jp7(7);
switch(id) { default:
case 0: return jp0; case 1: return jp1; case 2: return jp2; case 3: return jp3;
case 4: return jp4; case 5: return jp5; case 6: return jp6; case 7: return jp7;
}
inline Joypad joypad(unsigned id) {
assert(id < Joypad::Count);
return Joypad(id);
}
struct Scancode {

View file

@ -11,7 +11,7 @@
namespace nall {
struct Keyboard;
Keyboard& keyboard(unsigned = 0);
Keyboard keyboard(unsigned = 0);
static const char KeyboardScancodeName[][64] = {
"Escape", "F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", "F11", "F12",
@ -122,12 +122,9 @@ struct Keyboard {
Keyboard(unsigned ID_) : ID(ID_) {}
};
inline Keyboard& keyboard(unsigned id) {
static Keyboard kb0(0), kb1(1), kb2(2), kb3(3), kb4(4), kb5(5), kb6(6), kb7(7);
switch(id) { default:
case 0: return kb0; case 1: return kb1; case 2: return kb2; case 3: return kb3;
case 4: return kb4; case 5: return kb5; case 6: return kb6; case 7: return kb7;
}
inline Keyboard keyboard(unsigned id) {
assert(id < Keyboard::Count);
return Keyboard(id);
}
static const char MouseScancodeName[][64] = {
@ -136,7 +133,7 @@ static const char MouseScancodeName[][64] = {
};
struct Mouse;
Mouse& mouse(unsigned = 0);
Mouse mouse(unsigned = 0);
struct Mouse {
const unsigned ID;
@ -220,12 +217,9 @@ struct Mouse {
Mouse(unsigned ID_) : ID(ID_) {}
};
inline Mouse& mouse(unsigned id) {
static Mouse ms0(0), ms1(1), ms2(2), ms3(3), ms4(4), ms5(5), ms6(6), ms7(7);
switch(id) { default:
case 0: return ms0; case 1: return ms1; case 2: return ms2; case 3: return ms3;
case 4: return ms4; case 5: return ms5; case 6: return ms6; case 7: return ms7;
}
inline Mouse mouse(unsigned id) {
assert(id < Mouse::Count);
return Mouse(id);
}
static const char JoypadScancodeName[][64] = {
@ -239,7 +233,7 @@ static const char JoypadScancodeName[][64] = {
};
struct Joypad;
Joypad& joypad(unsigned = 0);
Joypad joypad(unsigned = 0);
struct Joypad {
const unsigned ID;
@ -345,12 +339,9 @@ struct Joypad {
Joypad(unsigned ID_) : ID(ID_) {}
};
inline Joypad& joypad(unsigned id) {
static Joypad jp0(0), jp1(1), jp2(2), jp3(3), jp4(4), jp5(5), jp6(6), jp7(7);
switch(id) { default:
case 0: return jp0; case 1: return jp1; case 2: return jp2; case 3: return jp3;
case 4: return jp4; case 5: return jp5; case 6: return jp6; case 7: return jp7;
}
inline Joypad joypad(unsigned id) {
assert(id < Joypad::Count);
return Joypad(id);
}
struct Scancode {