lsnes rr2-β24
[lsnes.git] / src / emulation / sky / framebuffer.hpp
blob3cbf2ee082f50bb0a1db5763ba7281e0e632e528
1 #ifndef _skycore__framebuffer__hpp__included__
2 #define _skycore__framebuffer__hpp__included__
4 #include <cstdint>
6 #define FB_SCALE 3
7 #define FB_WIDTH (FB_SCALE * 320)
8 #define FB_HEIGHT (FB_SCALE * 200)
9 #define FB_MAJSTRIDE (FB_SCALE * FB_SCALE * 320)
11 namespace sky
13 inline void framebuffer_blend1(uint32_t& fbpix, uint32_t rpixel)
15 fbpix = rpixel & 0x00FFFFFFU;
18 inline void framebuffer_blend2(uint32_t& fbpix, uint32_t rpixel)
20 if((fbpix >> 31) == 0)
21 fbpix = rpixel & 0x01FFFFFFU;
24 //Take origbuffer and completely rerender framebuffer.
25 void render_backbuffer(struct instance& inst);
26 //Take a reigon of origbuffer and rerender that into framebuffer.
27 void render_framebuffer_update(struct instance& inst, uint16_t x, uint16_t y, uint16_t w, uint16_t h);
28 //Render a vertical line into framebuffer. Uses n*320x200 screen size!
29 void render_framebuffer_vline(struct instance& inst, uint16_t x, uint16_t y1, uint16_t y2, uint32_t color);
30 //Render a gauge block.
31 void draw_block(struct instance& inst, const uint8_t* pointer, uint16_t position, uint32_t c1, uint32_t c2,
32 bool zero = false);
33 void draw_block2(struct instance& inst, const char* pointer, uint16_t position, uint32_t c1, uint32_t c2,
34 bool zero = false);
35 //Render a message.
36 void draw_message(struct instance& inst, const char* pointer, uint32_t c1, uint32_t c2);
37 //Draw column in distance gauge.
38 void draw_distance_column(struct instance& inst, uint16_t col, uint32_t c);
39 //Blink between colors in specified block.
40 void blink_between(struct instance& inst, unsigned x, unsigned y, unsigned w, unsigned h, uint32_t c1,
41 uint32_t c2);
42 //Draw a bitmap at full resolution.
43 void draw_bitmap(struct instance& inst, const uint32_t* bitmap, unsigned x, unsigned y);
46 #endif