Jul 2, 2006 at 9:47 AM
Join Date: Jun 18, 2006
Location: Montreal, Canada
Posts: 581
Age: 40
I found some interesting stuff in the code. Functions that do absolutely nothing. Here's an example.
00409670 push ebp
00409671 mov ebp, esp
00409673 pop ebp
00409674 ret
Basically this saves the base pointer, grabs the stack pointer, and immediately plops the base pointer back into whatever it was before returning. And it's never called anywhere, to boot.
There are a few cases like this. And a lot of unecessary interrupts before most functions (padding, basically.) Very interesting stuff for anyone intending to write their own code - extra space. Even a handfull of bytes can be important when dealing with machine code.
I'm going to take a wild guess here - Pixel's compiler wasn't configured to optimize its code too well. Any compiler worth its salt should've been able to detect unused functions and remove them. But hey, free space is a good thing for use hackers so who am I to complain?
Other examples include various wrappers around some functions. More code that should've been optimized out when compiled. If not simply avoided when writing the game's code.
00409670 push ebp
00409671 mov ebp, esp
00409673 pop ebp
00409674 ret
Basically this saves the base pointer, grabs the stack pointer, and immediately plops the base pointer back into whatever it was before returning. And it's never called anywhere, to boot.
There are a few cases like this. And a lot of unecessary interrupts before most functions (padding, basically.) Very interesting stuff for anyone intending to write their own code - extra space. Even a handfull of bytes can be important when dealing with machine code.
I'm going to take a wild guess here - Pixel's compiler wasn't configured to optimize its code too well. Any compiler worth its salt should've been able to detect unused functions and remove them. But hey, free space is a good thing for use hackers so who am I to complain?
Other examples include various wrappers around some functions. More code that should've been optimized out when compiled. If not simply avoided when writing the game's code.