Jump to content
  • entries
    334
  • comments
    900
  • views
    258,195

who let the bytes out?


EricBall

492 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.

4 Comments


Recommended Comments

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.

Link to comment

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.

Link to comment

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:

Link to comment
Guest
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...