2 Skelton for retropc emulator
18 #define read_dword(address) *(uint32_t *)address
19 #define write_dword(address,data) *(uint32_t *)address=data
20 #define BACKDROP_COLOR ((vdp_mode == 4 ? 0x10 : 0x00) + (regs[0x07] & 0x0f))
21 #define ADDR_MASK (0x4000 - 1)
23 #define CYCLES_PER_LINE 228
26 class _315_5124 : public DEVICE
32 outputs_t outputs_irq;
41 int pn, ct, pg, sa, sg;
55 uint8_t screen[192][256];
56 uint8_t regs[0x10], status_reg, read_ahead, first_byte;
59 uint16_t color_table, pattern_table, name_table;
60 uint16_t sprite_pattern, sprite_attrib;
61 uint16_t color_mask, pattern_mask;
62 scrntype_t palette_pc[0x20];
63 void set_intstat(bool val);
70 void draw_modebogus();
75 uint8_t addrmode; /* Type of VDP action */
77 uint8_t vdp_mode; /* Current mode of the VDP: 0,1,2,3,4 */
78 uint8_t sms_cram_expand_table[4];
79 uint8_t gg_cram_expand_table[16];
80 uint8_t *linebuf; /* Pointer to output buffer */
81 uint8_t bg_name_dirty[0x200]; /* 1= This pattern is dirty */
82 uint16_t bg_name_list[0x200]; /* List of modified pattern indices */
83 uint16_t bg_list_index; /* # of modified patterns in list */
84 uint8_t bg_pattern_cache[0x20000];/* Cached and flipped patterns */
85 uint8_t lut[0x10000]; /* Pixel look-up table */
86 uint32_t bp_lut[0x10000]; /* Bitplane to packed pixel LUT */
93 bool __315_5124_LIMIT_SPRITES;
96 _315_5124(VM* parent_vm, EMU* parent_emu) : DEVICE(parent_vm, parent_emu)
98 initialize_output_signals(&outputs_irq);
99 set_device_name(_T("315-5124"));
106 void write_io8(uint32_t addr, uint32_t data);
107 uint32_t read_io8(uint32_t addr);
108 void event_vline(int v, int clock);
110 void set_context_key(KEYBOARD* device)
114 void set_context_psg(DEVICE* device)
118 void set_context_irq(DEVICE* device, int id, uint32_t mask)
120 initialize_output_signals(&outputs_irq);
121 register_output_signal(&outputs_irq, device, id, mask);
124 void palette_sync(int index, int force);
125 void render_bg(int line);
126 void render_obj(int line);
127 void update_bg_pattern_cache(void);
128 void viewport_check(void);
129 void vdp_reg_w(uint8_t r, uint8_t d);
130 void set_console(int gg)