diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml deleted file mode 100644 index 9be67b4..0000000 --- a/.gitlab-ci.yml +++ /dev/null @@ -1,3 +0,0 @@ -build: - script: - - make diff --git a/Makefile b/Makefile index a4f7209..e368635 100644 --- a/Makefile +++ b/Makefile @@ -80,7 +80,7 @@ ginttest.g1a: libgint.a $(src-app) $(res-app) $(ob) -R .comment -R .bss -O binary $(elf) $(bin) $(wr) $(bin) -o ginttest.g1a -i icon.bmp @ echo "\033[32;1mBinary file size: "`stat -c %s $(bin)`" bytes\033[0m" -# @ sh3eb-elf-objdump -h build/ginttest.elf + @ sh3eb-elf-objdump -h build/ginttest.elf diff --git a/ginttest.c b/ginttest.c index c0c4a78..f918f8c 100644 --- a/ginttest.c +++ b/ginttest.c @@ -296,18 +296,19 @@ void bitmap_test(void) enum BlendingMode blend = Blend_Or; uint32_t a32 = 0xffffffff; + int black_bg = 0; int key; while(1) { dclear(); - if(blend != Blend_Or) dreverse_area(0, 0, 127, 63); + if(black_bg) dreverse_area(0, 0, 127, 63); dimage(opt, 0, 57, Blend_Invert); dimage(sprites, 2 & a32, 2, blend); - dimage(sybl, 98 & a32, 4, blend); - dimage(sybl2, 98 & a32, 24, blend); + dimage(sybl, 30 & a32, 40, blend); + dimage(sybl2, 62 & a32, 40, blend); dupdate(); @@ -318,7 +319,8 @@ void bitmap_test(void) if(key == KEY_F2) blend = Blend_And; if(key == KEY_F3) blend = Blend_Invert; - if(key == KEY_F4) a32 ^= 31; + if(key == KEY_F4) black_bg = !black_bg; + if(key == KEY_F5) a32 ^= 31; } return; diff --git a/ginttest.g1a b/ginttest.g1a index 923559a..076483f 100644 Binary files a/ginttest.g1a and b/ginttest.g1a differ diff --git a/libc.a b/libc.a index 5af4067..fdab1e2 100644 Binary files a/libc.a and b/libc.a differ diff --git a/libgint.a b/libgint.a index 65a4c22..d03f064 100644 Binary files a/libgint.a and b/libgint.a differ diff --git a/resources/bitmap_opt.bmp b/resources/bitmap_opt.bmp index d3eb232..66fe722 100644 Binary files a/resources/bitmap_opt.bmp and b/resources/bitmap_opt.bmp differ diff --git a/src/bopti.c b/src/bopti.c index 19725fd..81a3794 100644 --- a/src/bopti.c +++ b/src/bopti.c @@ -187,7 +187,7 @@ static void bopti_rest_nover(const unsigned char *rest, int x, int y, int vram_offset = (y << 2) + (x >> 5); int row; - // We *have* shift > 0 because of this function's 'no overlap' + // We *have* shift >= 0 because of this function's 'no overlap' // requirement. int shift_base = (4 - element_size) << 3; int shift = shift_base - (x & 31); @@ -213,6 +213,32 @@ static void bopti_rest(const unsigned char *rest, int x, int y, int width, bopti_rest_nover(rest, x, y, width, height, mode); return; } + + int element_size = (width > 16) ? (4) : (width > 8) ? (2) : (1); + int vram_offset = (y << 2) + (x >> 5); + int row; + + int shift_base = (4 - element_size) << 3; + int shift1 = (x & 31) - shift_base; + int shift2 = shift_base + 32 - (x & 31); + + uint32_t and_mask_0 = 0xffffffff >> (x & 31); + uint32_t and_mask_1 = 0xffffffff << (64 - width - (x & 31)); + + uint32_t row_data, operator; + + for(row = 0; row < height; row++) + { + row_data = bopti_rest_get(&rest, element_size); + + operator = row_data >> shift1; + bopti_op(vram_offset, operator, and_mask_0, mode); + + operator = row_data << shift2; + bopti_op(vram_offset + 1, operator, and_mask_1, mode); + + vram_offset += 4; + } } /*