mirror of
https://github.com/Lorenzooone/Pokemon-Gen3-to-Gen-X.git
synced 2026-04-26 08:37:40 -05:00
Save a couple of extra bytes
This commit is contained in:
parent
229c35f67a
commit
566a1b18a0
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -8,13 +8,20 @@ u8* get_table_pointer(u8* table, u16 entry){
|
|||
u8 offset_table_pos = 2;
|
||||
u8 size_initial_offset = ((table[0] >> 0)&1)+1;
|
||||
u8 size_offsets = ((table[0] >> 1)&1)+1;
|
||||
u8 offset_shifter = table[0] >> 2;
|
||||
u8 offset_shifter = (table[0] >> 2) & 7;
|
||||
u8 offset_shifter_initial_offset = (table[0] >> 5);
|
||||
if(size_initial_offset == 1)
|
||||
initial_offset = table[1];
|
||||
initial_offset = table[1]<<offset_shifter_initial_offset;
|
||||
else {
|
||||
initial_offset = table_16[1];
|
||||
initial_offset = table_16[1]<<offset_shifter_initial_offset;
|
||||
offset_table_pos = 4;
|
||||
}
|
||||
u16 entries = initial_offset-offset_table_pos;
|
||||
if(size_offsets == 2)
|
||||
entries >>= 1;
|
||||
// Sanity check
|
||||
if(entry >= entries)
|
||||
entry = 0;
|
||||
if(size_offsets == 1)
|
||||
offset = (table[(offset_table_pos)+entry]) << offset_shifter;
|
||||
else
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user