Jump to content





Photo

who let the bytes out?

Posted by EricBall, 24 October 2006 · 39 views

"Origin Reverse Indexed", i.e. I've run out of space somewhere in the code. My latest AI changes filled bank 1, grump. I managed to squeeze out the few bytes, but I wanted to add some debugging code to help me figure out how well the AI meets my expectations. There's also a couple of TODOs left in the code. I guess I'm going to have to start looking for places to optimize. Un-fun.




I enjoy optimizing, but I hate having to optimize unexpectedly.

I feel your pain. :ponder:
  • Report

vdub_bobby, on Tue Oct 24, 2006 12:48 PM, said:

I enjoy optimizing, but I hate having to optimize unexpectedly.

I feel your pain. :ponder:
Yeah. There's a difference between figuring out a better way to accomplish a small task (i.e. TJ's CMP #$80, ROR for a signed right shift). But realizing that you really need to find some way to squeeze a hundred bytes out of a K of code is kinda depressing.
  • Report

EricBall, on Tue Oct 24, 2006 2:23 PM, said:

vdub_bobby, on Tue Oct 24, 2006 12:48 PM, said:

I enjoy optimizing, but I hate having to optimize unexpectedly.

I feel your pain. :ponder:
Yeah. There's a difference between figuring out a better way to accomplish a small task (i.e. TJ's CMP #$80, ROR for a signed right shift). But realizing that you really need to find some way to squeeze a hundred bytes out of a K of code is kinda depressing.
Speaking of squeezing >100 bytes out of 1k, take a look at the source for TJ's 1k minigames - chances are you'll learn something. Probably the most useful was the combined score digits trick. But there are lots of subtle things like a BRK subroutine trick, which further saves the byte after the BRK by doing DEC $FE, RTI to get back.

In my own minigames, other than doing some of TJ's tricks, I found that avoiding lookup tables in favor of pure calculation can save lots of space, though at the expense of cycles. And even when you've optimized the obvious, you can still find more savings. After a while your code does get heavily obfuscated, however.
  • Report

batari, on Tue Oct 24, 2006 11:41 PM, said:

After a while your code does get heavily obfuscated, however.
You can bet your life on that.

Still it is always somewhat rewarding when you find another byte in your already heavily optimized, obfuscated code. :ponder:
  • Report

February 2012

S M T W T F S
   1234
56789 10 11
12131415161718
19202122232425
26272829   

Recent Entries

Recent Comments

Search My Blog