#include "display.h"
+namespace TK80 {
+
static const int led_pattern[LED_SIZE_Y][LED_SIZE_X] = {
#if defined(_TK80BS) || defined(_TK80)
{9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9},
for(int x = 0; x < 256; x += 8) {
int code = vram[ptr++];
if(code != 0x20) {
- vm->draw_ranges = 9;
+ static_cast<VM *>(vm)->draw_ranges = 9;
}
code |= code_ofs;
uint8_t* font_base = &font[code << 3];
#define STATE_VERSION 1
-void DISPLAY::save_state(FILEIO* state_fio)
-{
- state_fio->FputUint32(STATE_VERSION);
- state_fio->FputInt32(this_device_id);
-
-#if defined(_TK80BS)
- state_fio->FputInt32(mode);
-#endif
- state_fio->FputBool(dma);
-}
-
-bool DISPLAY::load_state(FILEIO* state_fio)
+bool DISPLAY::process_state(FILEIO* state_fio, bool loading)
{
- if(state_fio->FgetUint32() != STATE_VERSION) {
+ if(!state_fio->StateCheckUint32(STATE_VERSION)) {
return false;
}
- if(state_fio->FgetInt32() != this_device_id) {
+ if(!state_fio->StateCheckInt32(this_device_id)) {
return false;
}
#if defined(_TK80BS)
- mode = state_fio->FgetInt32();
+ state_fio->StateInt32(mode);
#endif
- dma = state_fio->FgetBool();
+ state_fio->StateBool(dma);
return true;
}
+}