amiga_imgv
diff src/main.c @ 3:663471a80c21
broken + sdl emu
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 26 Oct 2017 15:49:56 +0300 |
parents | a4788c959918 |
children | 4c36d0f44aa6 |
line diff
1.1 --- a/src/main.c Thu Oct 26 10:04:29 2017 +0300 1.2 +++ b/src/main.c Thu Oct 26 15:49:56 2017 +0300 1.3 @@ -6,14 +6,8 @@ 1.4 #include "image.h" 1.5 #include "logger.h" 1.6 1.7 -#include "hwregs.h" 1.8 -#include "copper.h" 1.9 - 1.10 1.11 static int proc_event(union gfx_event *ev); 1.12 -static void show_ham_image(struct ham_image *img); 1.13 - 1.14 -static int win_width, win_height; 1.15 1.16 int main(int argc, char **argv) 1.17 { 1.18 @@ -36,7 +30,7 @@ 1.19 return 1; 1.20 } 1.21 gfx_wait_vblank(); 1.22 - show_ham_image(img); 1.23 + gfx_show_image(img); 1.24 1.25 for(;;) { 1.26 union gfx_event ev; 1.27 @@ -71,36 +65,3 @@ 1.28 } 1.29 return 0; 1.30 } 1.31 - 1.32 -#define NUM_BPL 6 1.33 -static void show_ham_image(struct ham_image *img) 1.34 -{ 1.35 - int i, j, k, fbwidth, fbheight, ncolors, prev_line; 1.36 - unsigned char *fbptr = gfx_get_framebuffer(); 1.37 - struct palchange *chg = img->chglist; 1.38 - 1.39 - fbwidth = gfx_framebuffer_width(); 1.40 - fbheight = gfx_framebuffer_height(); 1.41 - 1.42 - memcpy(fbptr, img->pixels, fbwidth * fbheight / 8 * NUM_BPL); 1.43 - 1.44 - /* create copper list that handles the palette */ 1.45 - clear_copper(); 1.46 - gfx_begin_copperlist(); 1.47 - /* initial palette at the start of frame */ 1.48 - for(i=0; i<16; i++) { 1.49 - add_copper(COPPER_MOVE(REGN_COLOR(i), img->palette[i])); 1.50 - logmsg("copper palette[%d]: %x\n", i, (unsigned int)img->palette[i]); 1.51 - } 1.52 - /* add copper instructions for palette changes according to the image changelist */ 1.53 - prev_line = -1; 1.54 - while(chg) { 1.55 - assert(chg->line >= prev_line); 1.56 - if(chg->line != prev_line) { 1.57 - prev_line = chg->line; 1.58 - add_copper(COPPER_VWAIT(chg->line)); 1.59 - } 1.60 - add_copper(COPPER_MOVE(REGN_COLOR(chg->entry >> 12), chg->entry & 0xfff)); 1.61 - } 1.62 - add_copper(COPPER_END); 1.63 -}