OSDN Git Service

[INITIAL] Import 20141226 version of http://homepage3.nifty.com/takeda-toshiya/common...
[csp-qt/common_source_project-fm7.git] / source / src / vm / pasopia7 / display.h
diff --git a/source/src/vm/pasopia7/display.h b/source/src/vm/pasopia7/display.h
new file mode 100644 (file)
index 0000000..081a34e
--- /dev/null
@@ -0,0 +1,76 @@
+/*\r
+       TOSHIBA PASOPIA 7 Emulator 'EmuPIA7'\r
+\r
+       Author : Takeda.Toshiya\r
+       Date   : 2007.02.08 -\r
+\r
+       [ display ]\r
+*/\r
+\r
+#ifndef _DISPLAY_H_\r
+#define _DISPLAY_H_\r
+\r
+#include "../vm.h"\r
+#include "../../emu.h"\r
+#include "../device.h"\r
+\r
+#define SIG_DISPLAY_I8255_0_A  0\r
+#define SIG_DISPLAY_I8255_1_B  1\r
+#define SIG_DISPLAY_I8255_1_C  2\r
+\r
+class DISPLAY : public DEVICE\r
+{\r
+private:\r
+       uint8* regs;\r
+       uint8 mode, text_page;\r
+       uint16 cursor, cblink, flash_cnt;\r
+       bool blink, pal_dis;\r
+       \r
+       uint8 screen[200][640];\r
+       uint8 font[0x800];\r
+       uint8* vram_b;\r
+       uint8* vram_r;\r
+       uint8* vram_g;\r
+       uint8* vram_a;\r
+       uint8* pal;\r
+       scrntype palette_pc[8];\r
+       bool scanline;\r
+       \r
+       void draw_text_normal(uint16 src);\r
+       void draw_text_wide(uint16 src);\r
+       void draw_fine_normal(uint16 src);\r
+       void draw_fine_wide(uint16 src);\r
+       void draw_text_lcd(uint16 src);\r
+       void draw_fine_lcd(uint16 src);\r
+       \r
+public:\r
+       DISPLAY(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu) {}\r
+       ~DISPLAY() {}\r
+       \r
+       // common functions\r
+       void initialize();\r
+       void update_config();\r
+       void write_signal(int id, uint32 data, uint32 mask);\r
+       void event_frame();\r
+       \r
+       // unique function\r
+       void set_vram_ptr(uint8* ptr)\r
+       {\r
+               vram_b = ptr + 0x0000;\r
+               vram_r = ptr + 0x4000;\r
+               vram_g = ptr + 0x8000;\r
+               vram_a = ptr + 0xc000;\r
+       }\r
+       void set_pal_ptr(uint8* ptr)\r
+       {\r
+               pal = ptr;\r
+       }\r
+       void set_regs_ptr(uint8* ptr)\r
+       {\r
+               regs = ptr;\r
+       }\r
+       void draw_screen();\r
+};\r
+\r
+#endif\r
+\r