amiga_cyberspace
changeset 3:200e512488e4
reduced sky copperlist, works on emulator only apparently
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 27 Jul 2017 10:42:36 +0300 |
parents | b98fa9b135ea |
children | 12ec766e435c |
files | src/main.c |
diffstat | 1 files changed, 36 insertions(+), 28 deletions(-) [+] |
line diff
1.1 --- a/src/main.c Thu Jul 27 02:34:42 2017 +0300 1.2 +++ b/src/main.c Thu Jul 27 10:42:36 2017 +0300 1.3 @@ -26,26 +26,33 @@ 1.4 #define MAX_GRID_SHADES 6 1.5 static uint32_t *cplist_pal[MAX_GRID_SHADES]; 1.6 1.7 -#define MAX_SKY_SHADES 32 1.8 -static uint16_t sky_color[] = { 1.9 - 0x204, 1.10 - 0x306, 1.11 - 0x307, 1.12 - 0x408, 0x408, 1.13 - 0x509, 1.14 - 0x50a, 1.15 - 0x60b, 0x60b, 1.16 - 0x60c, 0x60c, 1.17 - 0x70c, 0x70c, 1.18 - 0x80c, 1.19 - 0x80d, 1.20 - 0x90d, 0x90d, 1.21 - 0xa0d, 1.22 - 0xb0c, 0xb0c, 0xb0c, 1.23 - 0xc0c, 0xc0c, 1.24 - 0xd0c, 0xd0c, 1.25 - 0xd0b, 0xd0b, 0xd0b, 0xd0b, 1.26 - 0xe0a, 0xe0a, 0xe0a 1.27 +#define MAX_SKY_SHADES 25 1.28 +static uint16_t sky_color[][2] = { 1.29 + {0, 0x204}, 1.30 + {2, 0x205}, 1.31 + {3, 0x305}, 1.32 + {4, 0x306}, 1.33 + {8, 0x307}, 1.34 + {10, 0x407}, 1.35 + {12, 0x408}, 1.36 + {18, 0x508}, 1.37 + {20, 0x509}, 1.38 + {26, 0x50a}, 1.39 + {28, 0x60a}, 1.40 + {30, 0x60b}, 1.41 + {38, 0x60c}, 1.42 + {46, 0x70c}, 1.43 + {52, 0x80c}, 1.44 + {58, 0x80d}, 1.45 + {62, 0x90d}, 1.46 + {68, 0xa0d}, 1.47 + {72, 0xb0d}, 1.48 + {74, 0xb0c}, 1.49 + {86, 0xc0c}, 1.50 + {94, 0xd0c}, 1.51 + {102, 0xd0b}, 1.52 + {116, 0xe0b}, 1.53 + {118, 0xe0a} 1.54 }; 1.55 1.56 int init(void); 1.57 @@ -78,8 +85,6 @@ 1.58 for(i=0; i<MAX_GRID_SHADES; i++) { 1.59 cplptr = (uint16_t*)cplist_pal[i]; 1.60 for(j=1; j<8; j++) { 1.61 - /*uint16_t foo = 15 * (i + 1) / MAX_GRID_SHADES; 1.62 - cplptr[1] = (foo << 8) | (foo << 4) | foo;*/ 1.63 uint16_t r = ((grid_pal[j] & 0xf00) >> 8) * (i + 1) / MAX_GRID_SHADES; 1.64 uint16_t g = ((grid_pal[j] & 0xf0) >> 4) * (i + 1) / MAX_GRID_SHADES; 1.65 uint16_t b = (grid_pal[j] & 0xf) * (i + 1) / MAX_GRID_SHADES; 1.66 @@ -128,9 +133,12 @@ 1.67 1.68 grid_pal = (uint16_t*)(grid_addr + BPLSIZE * 3); 1.69 1.70 - grid_bpl0_addr = grid_addr; 1.71 - grid_bpl1_addr = grid_addr + BPLSIZE; 1.72 - grid_bpl2_addr = grid_addr + BPLSIZE * 2; 1.73 + /* XXX +10 hardcoded temporary scroll to see the middle of the grid 1.74 + * until we implement proper scrolling and parallax 1.75 + */ 1.76 + grid_bpl0_addr = grid_addr + 10; 1.77 + grid_bpl1_addr = grid_addr + BPLSIZE + 10; 1.78 + grid_bpl2_addr = grid_addr + BPLSIZE * 2 + 10; 1.79 1.80 for(i=0; i<8; i++) { 1.81 REG_COLOR_PTR[i] = grid_pal[i]; 1.82 @@ -141,11 +149,11 @@ 1.83 add_copper(COPPER_MOVE(REGN_BPL1PTH, backdrop_addr >> 16)); 1.84 add_copper(COPPER_MOVE(REGN_BPL1PTL, backdrop_addr)); 1.85 1.86 - add_copper(COPPER_MOVE(REGN_COLOR1, sky_color[0])); 1.87 + add_copper(COPPER_MOVE(REGN_COLOR1, sky_color[0][1])); 1.88 1.89 for(i=0; i<MAX_SKY_SHADES; i++) { 1.90 - add_copper(COPPER_VWAIT(i * 128 / MAX_SKY_SHADES)); 1.91 - add_copper(COPPER_MOVE(REGN_COLOR1, sky_color[i])); 1.92 + add_copper(COPPER_VWAIT(sky_color[i][0])); 1.93 + add_copper(COPPER_MOVE(REGN_COLOR1, sky_color[i][1])); 1.94 } 1.95 1.96 add_copper(COPPER_VWAIT(125));