mirror of
https://git.planet-casio.com/Lephenixnoir/gint.git
synced 2024-12-28 04:23:36 +01:00
Finished rewriting bopti, except for Checker. Removed .gitlab-ci.yml because of non-successful runner tests.
This commit is contained in:
parent
13aad50ab7
commit
f27ba1129a
8 changed files with 34 additions and 9 deletions
|
@ -1,3 +0,0 @@
|
|||
build:
|
||||
script:
|
||||
- make
|
2
Makefile
2
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
|
||||
|
||||
|
||||
|
||||
|
|
10
ginttest.c
10
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;
|
||||
|
|
BIN
ginttest.g1a
BIN
ginttest.g1a
Binary file not shown.
BIN
libc.a
BIN
libc.a
Binary file not shown.
BIN
libgint.a
BIN
libgint.a
Binary file not shown.
Binary file not shown.
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
28
src/bopti.c
28
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;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in a new issue