SHARP X1 Emulator 'eX1'
SHARP X1twin Emulator 'eX1twin'
SHARP X1turbo Emulator 'eX1turbo'
+ SHARP X1turboZ Emulator 'eX1turboZ'
Author : Takeda.Toshiya
Date : 2013.05.01-
#define CAPS 0xfe
#define KANA 0xff
+namespace X1 {
+
static const uint8_t matrix[15][8] = {
{0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}, // (CMT buttons ???)
{0x1b, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37}, // ESC 1 2 3 4 5 6 7
#define STATE_VERSION 1
-void KEYBOARD::save_state(FILEIO* state_fio)
+bool KEYBOARD::process_state(FILEIO* state_fio, bool loading)
{
- state_fio->FputUint32(STATE_VERSION);
- state_fio->FputInt32(this_device_id);
-
- state_fio->FputUint8(caps_locked);
- state_fio->FputUint8(kana_locked);
- state_fio->FputUint16(column);
+ if(!state_fio->StateCheckUint32(STATE_VERSION)) {
+ return false;
+ }
+ if(!state_fio->StateCheckInt32(this_device_id)) {
+ return false;
+ }
+ state_fio->StateUint8(caps_locked);
+ state_fio->StateUint8(kana_locked);
+ state_fio->StateUint16(column);
+ return true;
}
-bool KEYBOARD::load_state(FILEIO* state_fio)
-{
- if(state_fio->FgetUint32() != STATE_VERSION) {
- return false;
- }
- if(state_fio->FgetInt32() != this_device_id) {
- return false;
- }
- caps_locked = state_fio->FgetUint8();
- kana_locked= state_fio->FgetUint8();
- column = state_fio->FgetUint16();
- return true;
}
-