Work in progress

This commit is contained in:
2017-01-30 19:37:11 +01:00
parent 415688d5c5
commit 3eba81d2bd
13 changed files with 237 additions and 50 deletions

View File

@@ -13,6 +13,7 @@
#define VDP_CMD_FLIP 6
#define VDP_CMD_COLOR 7
#define VDP_CMD_BORDER 8
#define VDP_CMD_CLRSCR 9
struct t_sprite {
Uint8 x = 0;
@@ -96,7 +97,7 @@ void vdp_quit() {
SDL_Quit();
}
static void flip() {
void vdp_flip() {
Uint8* sb = screen_buffer;
Uint8* sm = screen_map;
Uint8* sc = screen_color;
@@ -191,7 +192,7 @@ void vdp_cmd_out(const unsigned char& value) {
sprites[n].col = data_stack[data_stack_pos - 3] & 0xF;
break;
case VDP_CMD_FLIP:
flip(); break;
vdp_flip(); break;
case VDP_CMD_COLOR:
color = data_stack[0];
break;
@@ -199,6 +200,10 @@ void vdp_cmd_out(const unsigned char& value) {
border = data_stack[0] & 0xF;
SDL_SetRenderDrawColor(sdlRenderer, palette[border][0], palette[border][1], palette[border][2], palette[border][3]);
break;
case VDP_CMD_CLRSCR:
for (int i = 0; i < 16 * 12; i++) screen_map[i] = 32;
for (int i = 0; i < 16 * 12; i++) screen_color[i] = color;
break;
}
data_stack_pos = 0;
}