mirror of
https://github.com/Polprzewodnikowy/SummerCart64.git
synced 2025-02-05 07:26:27 +01:00
compress bootloader background even further
This commit is contained in:
parent
e0721892b1
commit
e1d9a8def3
@ -68,24 +68,22 @@ static const vi_regs_t vi_config[] = {{
|
|||||||
|
|
||||||
|
|
||||||
static void display_decompress_background (uint32_t *background) {
|
static void display_decompress_background (uint32_t *background) {
|
||||||
uint32_t pixel_count = ((*background++) / sizeof(uint32_t));
|
|
||||||
uint32_t pixels_painted = 0;
|
|
||||||
uint8_t *background_data = (uint8_t *) (background);
|
|
||||||
uint32_t *framebuffer = (uint32_t *) (display_framebuffer);
|
uint32_t *framebuffer = (uint32_t *) (display_framebuffer);
|
||||||
|
|
||||||
|
int pixel_count = (int) ((*background++) / 3);
|
||||||
|
int pixels_painted = 0;
|
||||||
|
|
||||||
while (pixels_painted < pixel_count) {
|
while (pixels_painted < pixel_count) {
|
||||||
int pixel_repeat = ((background_data[0]) + 1);
|
uint32_t pixel = *background++;
|
||||||
uint32_t pixel_value = (
|
|
||||||
((background_data[1]) << 24) |
|
int pixel_repeat = (((pixel >> 24) & 0xFF) + 1);
|
||||||
((background_data[2]) << 16) |
|
uint32_t pixel_value = (((pixel << 8) & 0xFFFFFF00) | 0xFF);
|
||||||
((background_data[3]) << 8) |
|
|
||||||
(background_data[4])
|
|
||||||
);
|
|
||||||
for (int i = 0; i < pixel_repeat; i++) {
|
for (int i = 0; i < pixel_repeat; i++) {
|
||||||
cpu_io_write(framebuffer++, pixel_value);
|
cpu_io_write(framebuffer++, pixel_value);
|
||||||
}
|
}
|
||||||
|
|
||||||
pixels_painted += pixel_repeat;
|
pixels_painted += pixel_repeat;
|
||||||
background_data += 5;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -47,10 +47,10 @@ if __name__ == '__main__':
|
|||||||
|
|
||||||
try:
|
try:
|
||||||
source_asset = Image.open(asset_input)
|
source_asset = Image.open(asset_input)
|
||||||
converted_asset = source_asset.convert('RGBA').tobytes()
|
converted_asset = source_asset.convert('RGB').tobytes()
|
||||||
|
|
||||||
if (asset_compress):
|
if (asset_compress):
|
||||||
converted_asset = compress(converted_asset)
|
converted_asset = compress(converted_asset, step_size=3)
|
||||||
|
|
||||||
final_asset = open(asset_output, 'wb')
|
final_asset = open(asset_output, 'wb')
|
||||||
final_asset.write(converted_asset)
|
final_asset.write(converted_asset)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user