### Author Topic: The Optimization Compilation  (Read 90356 times)

0 Members and 1 Guest are viewing this topic.

#### Happybobjr

• James Oldiges
• LV11 Super Veteran (Next: 3000)
• Posts: 2325
• Rating: +128/-20
• Howdy :)
##### Re: The Optimization Compilation
« Reply #60 on: February 05, 2011, 10:05:32 pm »
that would explain the random pixels remaining in one of my games
School: East Central High School

Axe: １.０.0
TI-84 +SE  ||| OS: 2.53 MP (patched) ||| Version: "M"
TI-Nspire    |||  Lent out, and never returned
____________________________________________________________

#### calcdude84se

• Needs Motivation
• LV11 Super Veteran (Next: 3000)
• Posts: 2272
• Rating: +78/-13
• Wondering where their free time went...
##### Re: The Optimization Compilation
« Reply #61 on: February 05, 2011, 10:15:08 pm »
Ah, okay. That would make my inserted line "A*8-I->G" then.
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
I'll put it online when it does something.

#### Runer112

• Project Author
• LV11 Super Veteran (Next: 3000)
• Posts: 2289
• Rating: +639/-31
##### Re: The Optimization Compilation
« Reply #62 on: February 05, 2011, 11:46:14 pm »
Here's the fastest code I could come up with. It uses optimized loop structures and even more pre-calculation.

Also, did you mean to use B as the y value in your code squidgetx? Because looping from 0-11 wouldn't make much sense for y, so I changed it.

 Code: (Code) [Select]Y and ᴇF8*2+(X/2/2/2)+L₁→D⁻(X^8)→I⁻(Y^8)→J12→BLbl LB  64  Lbl LA    →A    If {*2+B+D}      →C      Pt-On(B*8+I,A+J,C*8+Pic0)    End  If A    -8    Goto LA  EndIf {°B-1}ʳ  -256→{°B-1}ʳ  Goto LBEnd  Code: (Comments) [Select]Tilemap offset; optimized version of Y/8*16+(X/8)+L₁→DX offset; Y offsetFor(B,12,0,⁻1)For(A,64,0,⁻8)If tile != 0Store tile valueDisplay tileSecond part of For(A) loopSecond part of For(B) loopUtilizes the fact that the second byte of A is 0 and -256 is faster than -1

« Last Edit: February 05, 2011, 11:54:04 pm by Runer112 »

#### Deep Toaster

• So much to do, so much time, so little motivation
• LV13 Extreme Addict (Next: 9001)
• Posts: 8217
• Rating: +758/-15
##### Re: The Optimization Compilation
« Reply #63 on: February 05, 2011, 11:48:39 pm »
Epic. I love return'd value hacks

#### calcdude84se

• Needs Motivation
• LV11 Super Veteran (Next: 3000)
• Posts: 2272
• Rating: +78/-13
• Wondering where their free time went...
##### Re: The Optimization Compilation
« Reply #64 on: February 05, 2011, 11:49:38 pm »
That's amazing, Runer. Do you always come up with code like this?
"People think computers will keep them from making mistakes. They're wrong. With computers you make mistakes faster."
I'll put it online when it does something.

#### Runer112

• Project Author
• LV11 Super Veteran (Next: 3000)
• Posts: 2289
• Rating: +639/-31
##### Re: The Optimization Compilation
« Reply #65 on: February 05, 2011, 11:53:46 pm »
Epic. I love return'd value hacks

My favorite Axe optimization trick!

That's amazing, Runer. Do you always come up with code like this?

I am so familiar with using optimized loops that I pretty much automatically come up with maximally optimized loops. The rest of the stuff, though, just takes a bit of thinking and comparing potential command sizes/speeds. This file I assembled a while ago actually helps a good deal when assessing options.

#### Deep Toaster

• So much to do, so much time, so little motivation
• LV13 Extreme Addict (Next: 9001)
• Posts: 8217
• Rating: +758/-15
##### Re: The Optimization Compilation
« Reply #66 on: February 06, 2011, 12:04:09 am »
Epic. I love return'd value hacks

My favorite Axe optimization trick!

Pretty much the Axe opt trick. Everything else builds on it

#### Quigibo

• The Executioner
• CoT Emeritus
• LV11 Super Veteran (Next: 3000)
• Posts: 2031
• Rating: +1075/-24
##### Re: The Optimization Compilation
« Reply #67 on: February 06, 2011, 05:57:55 am »
That's going be a thing of the past.  That optimization is built into Axe now.
___Axe_Parser___
Today the calculator, tomorrow the world!

#### Deep Toaster

• So much to do, so much time, so little motivation
• LV13 Extreme Addict (Next: 9001)
• Posts: 8217
• Rating: +758/-15
##### Re: The Optimization Compilation
« Reply #68 on: February 06, 2011, 10:01:18 am »
That's going be a thing of the past.  That optimization is built into Axe now.

Which one?

#### squidgetx

• Food.
• CoT Emeritus
• LV10 31337 u53r (Next: 2000)
• Posts: 1881
• Rating: +503/-17
• rawr.
##### Re: The Optimization Compilation
« Reply #69 on: February 06, 2011, 11:10:11 am »
woah, that's mad nice, Runer. Is it always better to avoid For() loops and use Lbl/Goto structures instead (or the While -1 structure)?

Quigibo, do you mean that something like
Code: [Select]
A-1->A!If A...would be auto-opted to
Code: [Select]
A-1->A!If...
« Last Edit: February 06, 2011, 11:15:17 am by squidgetx »

#### Deep Toaster

• So much to do, so much time, so little motivation
• LV13 Extreme Addict (Next: 9001)
• Posts: 8217
• Rating: +758/-15
##### Re: The Optimization Compilation
« Reply #70 on: February 06, 2011, 11:44:13 am »
If so that'd be awesome. And maybe if a loop starts with While A or Repeat A, move the A to the end of the loop too?
« Last Edit: February 06, 2011, 11:44:32 am by Deep Thought »

#### Builderboy

• Physics Guru
• CoT Emeritus
• LV13 Extreme Addict (Next: 9001)
• Posts: 5673
• Rating: +613/-9
• Would you kindly?
##### Re: The Optimization Compilation
« Reply #71 on: February 06, 2011, 01:18:02 pm »
Wow thats going to be auto optimized now?  Thats gotta shave lots of bytes off of every program

#### ztrumpet

• The Rarely Active One
• CoT Emeritus
• LV13 Extreme Addict (Next: 9001)
• Posts: 5712
• Rating: +364/-4
• If you see this, send me a PM. Just for fun.
##### Re: The Optimization Compilation
« Reply #72 on: February 06, 2011, 01:18:39 pm »
That's going be a thing of the past.  That optimization is built into Axe now.
Woah, really?   Awesome!   I can't wait for a new version.
If I'm wrong, please correct me!
Unfinished Projects:
 Elmgon 14% Basic Movement Demo Homescreen Game Pack 80% Basic Latest Release Cube Droid Saves the Galaxy 65% Axe Demo Detonate 70% Axe
Completed Projects:
Exodus | Midnight |Drifter | Axe Snake | Jump! | Factory Theta | Spider | Plot Drop | Papi Jump | Numb3rs | Nibbler | Boost | Duel Tile Map Editor | Homescreen Map Editor | Key Group Check | Oasis

#### calc84maniac

• eZ80 Guru
• Coder Of Tomorrow
• LV11 Super Veteran (Next: 3000)
• Posts: 2912
• Rating: +471/-17
##### Re: The Optimization Compilation
« Reply #73 on: February 06, 2011, 02:48:26 pm »
To take advantage of it, you'd still have to code in the same way, I think. But actually typing the variable name makes much more readable code
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

#### Builderboy

• Physics Guru
• CoT Emeritus
• LV13 Extreme Addict (Next: 9001)
• Posts: 5673
• Rating: +613/-9
• Would you kindly?
##### Re: The Optimization Compilation
« Reply #74 on: February 06, 2011, 02:52:07 pm »
Quigibo, how is this being optomised?  Is it actually looking into the assembly and seeing when there is a Ld ($) HL followed by a LD HL ($) ? or something along those lines?