Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
23 May, 2013, 18:47:50 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: 1 ... 3 4 [5] 6   Go Down
  Print  
Author Topic: Sprite Helpers -  (Read 6597 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Runer112
Project Author
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 06:53:04
Date Registered: 02 July, 2009, 06:38:05
Posts: 1680


Total Post Ratings: +493

View Profile
« Reply #60 on: 10 June, 2010, 04:24:06 »
0

Ah, I see what you did. Yeah, that looks to be much more efficient. Then again, it is pretty hard to fix code when you didn't write the thing and its over 5k.

If you're trying to figure out how it work, the best thing to do is look at the 14k source file on a computer, using something like SourceCoder. But good job figuring out how the whole thing works! Maybe you can tell me?
« Last Edit: 10 June, 2010, 04:24:25 by Runer112 » Logged
Magic Banana
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 27 August, 2011, 06:46:08
Date Registered: 08 June, 2010, 00:19:31
Location: California
Posts: 371


Total Post Ratings: +74

View Profile
« Reply #61 on: 10 June, 2010, 04:36:34 »
0

Well, first I just scrolled down to where Full was, removed that, then I just kept jumping labels (and also just random scrolling and a bit of luck) until I found what you stored the number checking for grayscale to (G). Then looked for anything that changed it and did trial and error from there. It actually took less time than I though because the labels kinda help to see what I'm looking at. I think a check to call sub(DG) was where I found it, which I assumed is draw grayscale.
Logged

I do sprites and stuff, so yeah.

Quote from: yunhua98
i'M NOT SURE WHAT A SWORD SKILL IS BUT HERE'S THE SWORD ANIMATION FROM THE TWO SPRITES ON PG 13
Runer112
Project Author
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 06:53:04
Date Registered: 02 July, 2009, 06:38:05
Posts: 1680


Total Post Ratings: +493

View Profile
« Reply #62 on: 10 June, 2010, 05:12:59 »
0

If you look at the commented version it would probably make a lot more sense. Also, you would know that "DG" stands for DispGraph. Any time the screen needs to be updated while sprite editing, I call this, which will perform either DispGraph, DispGraphʳ, or DispGraphʳʳ according to the sprite's grayscale level.

** Anyone who wants to, feel free to look at the source code and suggest optimizations. A good place to start may be areas that are easier to understand without knowing the intricate structures of the specific program, namely routines that perform math/graphics operations. Rotate and flip could be good candidates for this... It's really hard for me to add features with the current features already maxing out the program's size! **
« Last Edit: 10 June, 2010, 05:33:02 by Runer112 » Logged
Magic Banana
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 27 August, 2011, 06:46:08
Date Registered: 08 June, 2010, 00:19:31
Location: California
Posts: 371


Total Post Ratings: +74

View Profile
« Reply #63 on: 10 June, 2010, 05:34:57 »
0

This is what I was refering to:
:If Gsub(N0)
:sub(DG)
:End

Eh, I was close enough.

Oh wow . Just opened up the commented version in SourceCoder. The amount of detail in these comments is ridiculous!
I'll take a pass or two through it and see if any revisions can be made. Although, I don't quite have everything down for optimizing in Axe so I probably won't find much.
Logged

I do sprites and stuff, so yeah.

Quote from: yunhua98
i'M NOT SURE WHAT A SWORD SKILL IS BUT HERE'S THE SWORD ANIMATION FROM THE TWO SPRITES ON PG 13
Runer112
Project Author
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 06:53:04
Date Registered: 02 July, 2009, 06:38:05
Posts: 1680


Total Post Ratings: +493

View Profile
« Reply #64 on: 10 June, 2010, 05:40:43 »
0

One thing I'm doing is removing as much code I had previously planned on using, but never ended up finishing/getting to fit in the program. One such example is sprite moving/copying/pasting, which I just found a subroutine for that I forgot to comment out. Saved maybe 30 bytes, and at this size, every byte counts.

EDIT: Just chopped off about 150 more bytes. Realized that my sprite changing keypress handling was the complex version I needed back when I was trying to develop sprite copying/moving, so simplified that quite a bit.
« Last Edit: 10 June, 2010, 05:56:39 by Runer112 » Logged
DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 18:03:25
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50227


Total Post Ratings: +2615

View Profile WWW
« Reply #65 on: 10 June, 2010, 05:59:47 »
0

I only read page 2 of this thread so far but what I saw is totally EPIC! I'm glad to see such sprite editor for Axe. It looks great too.

I will add it to the downloads section when finished. (Unless Axe includes it)
« Last Edit: 10 June, 2010, 06:07:27 by DJ Omnimaga » Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Magic Banana
LV6 Super Member (Next: 500)
******
Offline Offline

Gender: Male
Last Login: 27 August, 2011, 06:46:08
Date Registered: 08 June, 2010, 00:19:31
Location: California
Posts: 371


Total Post Ratings: +74

View Profile
« Reply #66 on: 10 June, 2010, 06:41:35 »
0

Hey that is really cool!  Definitely will consider adding this to the Axe Tools, with your permission of course.

You might just want to put it in the downloads as well, in case somebody wants to use it, but doesn't use Axe or wants to download the entire zip just for it.

@runer112: Some optimizations that would be very helpful would be to require less free ram to use. I've had the thing throw an ERR:memory when I had around 8-9k free ram (after archiving it). Maybe Quigibo can give some tips on doing that.
Logged

I do sprites and stuff, so yeah.

Quote from: yunhua98
i'M NOT SURE WHAT A SWORD SKILL IS BUT HERE'S THE SWORD ANIMATION FROM THE TWO SPRITES ON PG 13
Quigibo
The Executioner
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: 21 May, 2013, 02:03:21
Date Registered: 22 January, 2010, 05:02:37
Location: Los Angeles
Posts: 2022


Topic starter
Total Post Ratings: +1019

View Profile
« Reply #67 on: 10 June, 2010, 09:34:11 »
+1

You can start a new thread if you want.  It doesn't have to be in the Axe subforum either.

By the way, I looked at the code and there are a lot of optimizations possible.  I'll mention a few:

You should NEVER find yourself having to make big lists of non-data.  I noticed this in the Help routine.  I know its doted out, but if you want to do it efficiently, try this:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
:.HELP
:If K=53
:  Fix 0
:  -1→A
:  Repeat sub(15)
:    sub(DT)
:    sub(GK)
:    If Ksub(1)→T and (A+1<number_you_will_need_to_determine)
:      While {A+1→A+Str00}:End
:    End
:    If K=4 and (A≠-1)
:      While {A-1→A+Str00}:End
:    End
:  End
:  sub(L)
:End


:.Draw Text
:Lbl DT
:  A→B
:  ClrDraw
:  For(J,0,9)
:    While {B+1→B+Str00}
:      Text(0,J*6+3,{B+Str00}►Frac)
:    End
:  End
:  DispGraph
:Return

You can then get rid of all those extra text subroutines.  I don't know if this routine works its untested, but you can probably see how it works.  Also, add a det(1) before Str00.


1
2
3
4
5
6
7
:      3→K
:      3-Xsub(M4)→W

Can be:

:      3→K-Xsub(M4)→W


1
2
3
4
5
6
7
:      0→D
:      2→K

Can be:

:      0→D+2→K


I'll add more stuff later.
« Last Edit: 10 June, 2010, 09:36:29 by Quigibo » Logged

___Axe_Parser___
Today the calculator, tomorrow the world!
Runer112
Project Author
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 06:53:04
Date Registered: 02 July, 2009, 06:38:05
Posts: 1680


Total Post Ratings: +493

View Profile
« Reply #68 on: 10 June, 2010, 17:43:21 »
0

I'd love to add back a help system, but with only about 200 bytes of available space left in the program, there's no way I could add one. At least until you figure out a way to let us call outside programs. Grin
« Last Edit: 10 June, 2010, 17:58:52 by Runer112 » Logged
ztrumpet
The Rarely Active One
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: Yesterday at 03:10:30
Date Registered: 08 November, 2009, 21:10:12
Location: Michigan
Posts: 5687


Total Post Ratings: +360

View Profile
« Reply #69 on: 10 June, 2010, 17:58:37 »
0

If you're trying to avoid the 8811 byte limit, remember that that's only for executable code.  If you wanted, you could have 8811 bytes of executable code and 12000 bytes of data on the end of it.  Since your help text would be data, I think you could fit it in 200 bytes of executable code. Grin
Good luck. Smiley
Logged

Runer112
Project Author
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 06:53:04
Date Registered: 02 July, 2009, 06:38:05
Posts: 1680


Total Post Ratings: +493

View Profile
« Reply #70 on: 10 June, 2010, 17:59:44 »
0

If you're trying to avoid the 8811 byte limit, remember that that's only for executable code.  If you wanted, you could have 8811 bytes of executable code and 12000 bytes of data on the end of it.  Since your help text would be data, I think you could fit it in 200 bytes of executable code. Grin
Good luck. Smiley

Wait, it's 8811? I thought it was 8192? Please say it is, that means I have 600 more bytes of free space than I thought I had!

EDIT: I just compiled and tried to run a 8,420-byte (no shell) program and it throws ERR:INVALID.

EDIT 2: However, when I run the program compiled for Ion, it successfully runs.
« Last Edit: 10 June, 2010, 18:06:26 by Runer112 » Logged
ztrumpet
The Rarely Active One
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: Yesterday at 03:10:30
Date Registered: 08 November, 2009, 21:10:12
Location: Michigan
Posts: 5687


Total Post Ratings: +360

View Profile
« Reply #71 on: 10 June, 2010, 18:02:57 »
0

Quoted from Asm in 28 days:
"Assembly programs for the TI-83 Plus cannot be more than 8811 bytes in size. Well they can, but just keep them below that. "
Yay, almost 666 more bytes! Cheesy
Logged

Runer112
Project Author
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 06:53:04
Date Registered: 02 July, 2009, 06:38:05
Posts: 1680


Total Post Ratings: +493

View Profile
« Reply #72 on: 10 June, 2010, 18:09:18 »
0

I just compiled and tried to run a 8,420-byte (no shell) program and it throws ERR:INVALID. However, when I run the program compiled for Ion, it successfully runs... I guess I could just make the program Ion-compatible only, I doubt many people even use no shell assembly programs.
Logged
ztrumpet
The Rarely Active One
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: Yesterday at 03:10:30
Date Registered: 08 November, 2009, 21:10:12
Location: Michigan
Posts: 5687


Total Post Ratings: +360

View Profile
« Reply #73 on: 10 June, 2010, 18:11:58 »
0

I just compiled and tried to run a 8,420-byte (no shell) program and it throws ERR:INVALID. However, when I run the program compiled for Ion, it successfully runs... I guess I could just make the program Ion-compatible only, I doubt many people even use no shell assembly programs.
That's odd.  Does it throw the error on smaller programs too?  Besides that's not what would happen if you hit the executable code limit; the calc would maybe turn off and then RAM Clear. Smiley
Oh, and I like no stub Asm programs. Grin
Logged

Runer112
Project Author
LV10 31337 u53r (Next: 2000)
*
Offline Offline

Gender: Male
Last Login: Today at 06:53:04
Date Registered: 02 July, 2009, 06:38:05
Posts: 1680


Total Post Ratings: +493

View Profile
« Reply #74 on: 10 June, 2010, 18:15:26 »
0

I think I've successfully run an 8197-byte no shell program before, but much more than that and I get ERR:INVALID.
Logged
Pages: 1 ... 3 4 [5] 6   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.543 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.