Jump to content

Squeeze


4 replies to this topic

#1  

    Space Invader

  • 20 posts
  • Joined: 14-September 09
  • Location:North Carolina

Posted Fri Oct 16, 2009 2:09 AM

I have somehow created this optimizer. You can use it to squeeze more stuff into your games. Let me know if you encounter any problem.

[updated to v0.3]

Attached Files


Edited by Zufolek, Mon Oct 19, 2009 3:08 AM.


#2  

    7800 Developer

  • 5,456 posts
  • Joined: 20-November 08
  • Busy bee!
  • Location:North, England

Posted Fri Oct 16, 2009 4:27 AM

:cool: How about describing what code sequences are optimized. I know the source is supplied in the zip package but not everybody is familiar with C/C++.

#3  

    Stargunner

  • 1,169 posts
  • Joined: 12-March 05
  • Juno First!
  • Location:Glasgow, UK

Posted Fri Oct 16, 2009 8:42 AM

Interesting - it looks like a generic 6502 peephole optimiser, rather than being bBasic specific. From the comments in the code, it does the following:
  • Merges multiple loads of the same value into a single load
  • Removes unnecessary compares with zero
  • Removes store followed immediately by load
  • Removes unnecessary consecutive loads and stores
  • Removes unused code (between a jmp and a label)
  • Removes unnecessary zero initialisation
  • Removes unused loads
  • Converts subroutines into jmps
  • Converts load/tax into lax
  • Converts and/tax into lxa
  • Converts sequences of short jumps into a single jump
I'm not sure all of these operations are completely safe, but it looks like a useful set.

Chris

#4  

    Space Invader

  • 20 posts
  • Joined: 14-September 09
  • Location:North Carolina

Posted Sat Oct 17, 2009 1:05 AM

I couldn't find an optimizer for 6507 assembly after a little searching, so I made this. It does many of the same assembly optimizations that I was doing to squeeze more stuff in my 4k bB games. Does anyone know of another program that works better?

Regardless, I've fixed some problems in Squeeze so it should work with more games, and I've added a simple uninstaller. I've fixed a syntax error when calling the modified 2600bas.bat with only -O option. (My bad.)

I've disabled the LXA optimization since that apparently fails (at least in emus) for whatever reason.

The updated version (0.2) is on the first post.

#5  

    Space Invader

  • 20 posts
  • Joined: 14-September 09
  • Location:North Carolina

Posted Mon Oct 19, 2009 3:13 AM

Uploaded version 0.3, which is probably about as good as it will get without a lot more work. I suppose I should mention it is free, works with every game I've tested, and requires no knowledge of assembly to use. Enjoy!





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users