Video wird geladen...

Video konnte nicht geladen werden

Zur Startseite

no if/else. no switch. dispatch table. array of structs holding function pointers. walked at runtime, matched by key, called through. jump table in c. index in, call out. watch it, then read the article. covers the x86 ASM, the compiler side, tracing in IDA.

16,172 Aufrufe • vor 1 Monat •via X (Twitter)

0 Kommentare

Keine Kommentare verfügbar

Kommentare vom Original-Post werden hier angezeigt

Ähnliche Videos

Going for a relaxing cruise through Rainbow Road in Mario Kart 64... on my Sega Dreamcast, of course! Let's take a look at this footage I just barely recorded directly from my DC of jnmartin's latest build! First of all, yes, there's still no audio. No, I don't care how blasphemous it is to put the Sonic R soundtrack to Mario Kart! 😂 BUT BEYOND THAT, omg, look at how freaking good everything looks and how smoothly its all running! All of the texture corruption has been fixed, the smoke particles coming from the carts are no longer blocks, the star sprite animations are present, and the trails from the koopa shells are no longer bright blue! The biggest change; however, is the fact that the background textures of the characters in the sky are no longer so corrupted and distorted that they look like evil demons from hell! ...and you won't believe what the cause was! The decompilation code for this particular level has a bunch of lookup tables for the color palettes associated with each character texture in the night sky. Each CLUT is declared as a constant static array of 256 color values, defined sequentially. Then there's a routine that initializes the night sky texture for a given character, using its respective table... and the freaking thing decided that it could just treat these disjoint tables as though they were one big-ass table, being able to grab the table associated with a given character programmatically by doing some pointer arithmetic on the address of the first table to jump to the correct one! ...there's just one problem. Who said the order in which you define these tables dictates the order in which they are put into the .rodata segment of the binary!? C and C++ certainly don't give a shit about your ordering! So the problem? The MIPS GCC compiler used on N64 does maintain this ordering within the compiled binary, while the SH GCC compiler used for Dreamcast (and even x86, apparently), do it in the opposite order! The result? Hellish nightmare demons in the sky whose texture colors were initialized from another character's palette! WHOOPS!

Falco Girgis

21,418 Aufrufe • vor 11 Monaten