Improve indentation
This commit is contained in:
parent
8402fa5ae9
commit
b4f6f78981
20
src/c/vwf.c
20
src/c/vwf.c
|
@ -1698,9 +1698,9 @@ void load_pixels_overworld_buffer()
|
||||||
byte* buffer = (byte*)(OVERWORLD_BUFFER - ((*tile_offset) * TILESET_OFFSET_BUFFER_MULTIPLIER));
|
byte* buffer = (byte*)(OVERWORLD_BUFFER - ((*tile_offset) * TILESET_OFFSET_BUFFER_MULTIPLIER));
|
||||||
for(int i = 0; i < 8 * 0x1C; i++)
|
for(int i = 0; i < 8 * 0x1C; i++)
|
||||||
{
|
{
|
||||||
//Doing this saves about 100k cycles during load
|
//Doing this saves about 100k cycles during load
|
||||||
int tile = m2_coord_table[i] + *tile_offset;
|
int tile = m2_coord_table[i] + *tile_offset;
|
||||||
int addedValue = (i >> 5) << 6;
|
int addedValue = (i >> 5) << 6;
|
||||||
int tile_buffer = (i & 0x1F) + addedValue + *tile_offset;
|
int tile_buffer = (i & 0x1F) + addedValue + *tile_offset;
|
||||||
int foregroundRow = 0xFFFFFFFF;
|
int foregroundRow = 0xFFFFFFFF;
|
||||||
buffer[(tile_buffer * 8) + 0] = reduce_bit_depth(vram[(tile * 8) + 0], foregroundRow);
|
buffer[(tile_buffer * 8) + 0] = reduce_bit_depth(vram[(tile * 8) + 0], foregroundRow);
|
||||||
|
@ -1711,8 +1711,8 @@ void load_pixels_overworld_buffer()
|
||||||
buffer[(tile_buffer * 8) + 5] = reduce_bit_depth(vram[(tile * 8) + 5], foregroundRow);
|
buffer[(tile_buffer * 8) + 5] = reduce_bit_depth(vram[(tile * 8) + 5], foregroundRow);
|
||||||
buffer[(tile_buffer * 8) + 6] = reduce_bit_depth(vram[(tile * 8) + 6], foregroundRow);
|
buffer[(tile_buffer * 8) + 6] = reduce_bit_depth(vram[(tile * 8) + 6], foregroundRow);
|
||||||
buffer[(tile_buffer * 8) + 7] = reduce_bit_depth(vram[(tile * 8) + 7], foregroundRow);
|
buffer[(tile_buffer * 8) + 7] = reduce_bit_depth(vram[(tile * 8) + 7], foregroundRow);
|
||||||
tile_buffer += 0x20;
|
tile_buffer += 0x20;
|
||||||
tile += 0x20;
|
tile += 0x20;
|
||||||
buffer[(tile_buffer * 8) + 0] = reduce_bit_depth(vram[(tile * 8) + 0], foregroundRow);
|
buffer[(tile_buffer * 8) + 0] = reduce_bit_depth(vram[(tile * 8) + 0], foregroundRow);
|
||||||
buffer[(tile_buffer * 8) + 1] = reduce_bit_depth(vram[(tile * 8) + 1], foregroundRow);
|
buffer[(tile_buffer * 8) + 1] = reduce_bit_depth(vram[(tile * 8) + 1], foregroundRow);
|
||||||
buffer[(tile_buffer * 8) + 2] = reduce_bit_depth(vram[(tile * 8) + 2], foregroundRow);
|
buffer[(tile_buffer * 8) + 2] = reduce_bit_depth(vram[(tile * 8) + 2], foregroundRow);
|
||||||
|
@ -1727,13 +1727,13 @@ void load_pixels_overworld_buffer()
|
||||||
void store_pixels_overworld_buffer(int totalYs)
|
void store_pixels_overworld_buffer(int totalYs)
|
||||||
{
|
{
|
||||||
byte* buffer = (byte*)(OVERWORLD_BUFFER - ((*tile_offset) * TILESET_OFFSET_BUFFER_MULTIPLIER));
|
byte* buffer = (byte*)(OVERWORLD_BUFFER - ((*tile_offset) * TILESET_OFFSET_BUFFER_MULTIPLIER));
|
||||||
totalYs >>= 1;
|
totalYs >>= 1;
|
||||||
int total = totalYs * 0x1C;
|
int total = totalYs * 0x1C;
|
||||||
for(int i = 0; i < total; i++)
|
for(int i = 0; i < total; i++)
|
||||||
{
|
{
|
||||||
//Not using functions for the tile values saves about 30k cycles on average
|
//Not using functions for the tile values saves about 30k cycles on average
|
||||||
int tile = m2_coord_table[i] + *tile_offset;
|
int tile = m2_coord_table[i] + *tile_offset;
|
||||||
int addedValue = (i >> 5) << 6;
|
int addedValue = (i >> 5) << 6;
|
||||||
int tile_buffer = (i & 0x1F) + addedValue + *tile_offset;
|
int tile_buffer = (i & 0x1F) + addedValue + *tile_offset;
|
||||||
int* bufferValues = (int*)(&buffer[(tile_buffer * 8)]);
|
int* bufferValues = (int*)(&buffer[(tile_buffer * 8)]);
|
||||||
unsigned int first_half = bufferValues[0];
|
unsigned int first_half = bufferValues[0];
|
||||||
|
@ -1746,7 +1746,7 @@ void store_pixels_overworld_buffer(int totalYs)
|
||||||
vram[(tile * 8) + 5] = m2_bits_to_nybbles_fast[(second_half >> 8) & 0xFF];
|
vram[(tile * 8) + 5] = m2_bits_to_nybbles_fast[(second_half >> 8) & 0xFF];
|
||||||
vram[(tile * 8) + 6] = m2_bits_to_nybbles_fast[(second_half >> 0x10) & 0xFF];
|
vram[(tile * 8) + 6] = m2_bits_to_nybbles_fast[(second_half >> 0x10) & 0xFF];
|
||||||
vram[(tile * 8) + 7] = m2_bits_to_nybbles_fast[(second_half >> 0x18) & 0xFF];
|
vram[(tile * 8) + 7] = m2_bits_to_nybbles_fast[(second_half >> 0x18) & 0xFF];
|
||||||
//Do the tile right below (Saves about 50k cycles on average)
|
//Do the tile right below (Saves about 50k cycles on average)
|
||||||
tile += 0x20;
|
tile += 0x20;
|
||||||
bufferValues += 0x40;
|
bufferValues += 0x40;
|
||||||
first_half = bufferValues[0];
|
first_half = bufferValues[0];
|
||||||
|
|
Loading…
Reference in New Issue