Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
19 June, 2013, 06:43:16 *
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 ... 26 27 [28] 29 30 ... 42   Go Down
  Print  
Author Topic: Routines -  (Read 43044 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Runer112
Anti-Riot Squad
LV10 31337 u53r (Next: 2000)
*
Online Online

Gender: Male
Last Login: Today at 06:42:07
Date Registered: 02 July, 2009, 06:38:05
Posts: 1695


Total Post Ratings: +498

View Profile
« Reply #405 on: 01 October, 2010, 14:57:59 »
+1

I just helped someone out with a specific case of writing a value to an OS list, so I figured I'd post this generic routine for others to use while I'm at it.

A note about list names: for L1 through L6, you can just define the name with something like:

1
"L₁"→Str1
But for custom lists, you must do the following:

1
2
3
[015D]→Str1
"NAME"
[00]

And now the actual routine:


1
2
3
4
5
6
7
8
.Write a series of 2-byte values to an OS list (Pointer to name, number of elements, pointer to list of 2-byte values)
Lbl OSL
  GetCalc(r₁,r₂*9)→r₄
  r₂→{r₄-2}ʳ
  For(r₅,0,r₂-1)
    {r₅*2+r₃}ʳ→float{r₅*9+r₄}
  End
Return
« Last Edit: 01 October, 2010, 15:09:38 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: --)
*
Online Online

Gender: Male
Last Login: Today at 06:39:40
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50625


Total Post Ratings: +2636

View Profile WWW
« Reply #406 on: 01 October, 2010, 15:44:00 »
0

Mhmm, wait, so 015D would be the L character, right?
Logged

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

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Runer112
Anti-Riot Squad
LV10 31337 u53r (Next: 2000)
*
Online Online

Gender: Male
Last Login: Today at 06:42:07
Date Registered: 02 July, 2009, 06:38:05
Posts: 1695


Total Post Ratings: +498

View Profile
« Reply #407 on: 01 October, 2010, 15:53:36 »
0

Yes, and it doesn't appear to work correctly when trying to store it into a string. Perhaps this is something Quigibo should look into fixing?
« Last Edit: 01 October, 2010, 15:54:07 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: --)
*
Online Online

Gender: Male
Last Login: Today at 06:39:40
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50625


Total Post Ratings: +2636

View Profile WWW
« Reply #408 on: 01 October, 2010, 22:57:59 »
0

Aw I see Sad. Are you sure it would be an Axe bug? Might be something he should check, indeed.
Logged

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

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
ztrumpet
The Rarely Active One
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: 11 June, 2013, 05:10:51
Date Registered: 08 November, 2009, 21:10:12
Location: Michigan
Posts: 5688


Total Post Ratings: +360

View Profile
« Reply #409 on: 01 October, 2010, 23:04:32 »
0

That's a nice routine Runer. Smiley  Thanks! Grin
Logged

aeTIos
You got stair'd!
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: Today at 06:09:33
Date Registered: 15 September, 2010, 06:00:00
Location: Netherlands, Overijssel
Posts: 3146


Total Post Ratings: +120

View Profile
« Reply #410 on: 02 October, 2010, 14:11:04 »
0

number input routine:

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
31
32
33
34
..INNUMBER
"Your text here->Str9
.(following is not necessary)
.sub(IN)
.return

Lbl IN
DiagnosticOff
ClrHome
Str9->A
"+-*/^C -369)TV .258(CPS0147,SALO>LL[X2][X-1]MA->Str4
Text(2,0,A)
0->K
While K=0
getKey->K
End
Text(8,6,{Str4+K-10}>Char)
0->L
While L=0
getKey->L
End
Text(12,6,{Str4+L-10}>Char
0->M
While M=0
getKey->M
End
Text(16,6,{Str4+M-10}>Char
{Str4+K-10}->X
{Str4+L-10}->Y
{Str4+M-10}->Z
Pause 2000
ClrHome
0->K

Please notify me if the code is too long and feel free to optimize them.

NOTE and EDIT: in code you see [X2] and [X-1]
you should type X2 and X-1
in code you cant type that...
« Last Edit: 02 October, 2010, 14:14:26 by aeTIos » Logged

If something above sounds rude, feel free to vote it down, it was not meant to be rude<<lolol
--Always stay relAXEd!--


Spoiler for Hidden:


[







Spoiler for Still Alive:
This was a triumph.
I'm making a note here: HUGE SUCCESS.
It's hard to overstate my satisfaction.

Aperture Science:
We do what we must because we can.
For the good of all of us
Except the ones who are dead.

But there's no sense crying over every mistake
You just keep on trying till you run out of cake
And the science gets done and you make a neat gun
For the people who are still alive.

I'm not even angry.
I'm being so sincere right now.
Even though you broke my heart and killed me.
And tore me to pieces.
And threw every piece into a fire.
As they burned it hurt because
I was so happy for you.

Now these points of data make a beautiful line
And we're out of beta we're releasing on time.
So I'm GLaD I got burned think of all the things we learned
For the people who are still alive.

Go ahead and leave me.
I think I prefer to stay inside.
Maybe you'll find someone else to help you.
Maybe Black Mesa -
THAT WAS A JOKE. HA HA, FAT CHANCE.
Anyway, this cake is great:
It's so delicious and moist.

Look at me still talking when there's science to do.
When I look out there it makes me GLaD I'm not you.
I've experiments to run there is research to be done
On the people who are still alive

And believe me I am still alive.
I'm doing science and I'm still alive.
I feel FANTASTIC and I'm still alive.
While you're dying I'll be still alive.
And when you're dead I will be still alive.

Still alive
Still alive
Deep Thought
So much to do, so much time, so little motivation
Administrator
LV13 Extreme Addict (Next: 9001)
*
Offline Offline

Gender: Male
Last Login: 17 June, 2013, 03:12:44
Date Registered: 19 May, 2009, 08:00:00
Location: The Universe
Posts: 7832


Total Post Ratings: +713

View Profile WWW
« Reply #411 on: 02 October, 2010, 18:19:41 »
0

Nice. Some opts:

Use Repeat K instead of While K.

Save a byte by changing "+-*/^C -369)TV .258(CPS0147,SALO>LL[X2][X-1]MA->Str4 to []->Str4:"+-*/^C -369)TV .258(CPS0147,SALO>LL[X2][X-1]MA".

Also, try not to leave closing parentheses/quotes off.
Logged




ztrumpet
The Rarely Active One
LV13 Extreme Addict (Next: 9001)
*************
Offline Offline

Gender: Male
Last Login: 11 June, 2013, 05:10:51
Date Registered: 08 November, 2009, 21:10:12
Location: Michigan
Posts: 5688


Total Post Ratings: +360

View Profile
« Reply #412 on: 03 October, 2010, 03:56:22 »
0

Use Repeat K instead of While K.
To clarify, "Use Repeat K instead of While K=0." Smiley
Logged

Deep Thought
So much to do, so much time, so little motivation
Administrator
LV13 Extreme Addict (Next: 9001)
*
Offline Offline

Gender: Male
Last Login: 17 June, 2013, 03:12:44
Date Registered: 19 May, 2009, 08:00:00
Location: The Universe
Posts: 7832


Total Post Ratings: +713

View Profile WWW
« Reply #413 on: 03 October, 2010, 04:55:40 »
0

Right. I've gotta start proofing my posts...
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: --)
*
Online Online

Gender: Male
Last Login: Today at 06:39:40
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50625


Total Post Ratings: +2636

View Profile WWW
« Reply #414 on: 03 October, 2010, 10:32:42 »
0

Nice routine Cheesy
Logged

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

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Runer112
Anti-Riot Squad
LV10 31337 u53r (Next: 2000)
*
Online Online

Gender: Male
Last Login: Today at 06:42:07
Date Registered: 02 July, 2009, 06:38:05
Posts: 1695


Total Post Ratings: +498

View Profile
« Reply #415 on: 05 October, 2010, 03:42:03 »
+2

Here's a very compact 125-byte library for hex display. It contains the following subroutines:
  • N2H: Nibble to hex – Example: 13sub(N2H) would return the character "D"
  • B2H: Byte to hex – Example: sub(B2H,69) would return a pointer to the string "45"
  • W2H: Word (2 bytes) to hex – Example: sub(W2H,1234) would return a pointer to the string "04D2"

To include it in your program, send prgmHEXLIB to your calculator and put prgmHEXLIB among the other subroutines in your program. Just make that sure wherever you put it, it won't be accidentally reached and executed unless you call it.

I challenge anyone to find a single optimization in this code or produce a smaller library of their own Wink (/me waits for Quigibo to make it way more compact than anyone thought possible)


EDIT: Changed name from prgmHEXSRC to prgmHEXLIB and reuploaded. This name just seems more appropriate for a library that you don't compile as a standalone program.

* HEXLIB.8xp (0.58 KB - downloaded 61 times.)
« Last Edit: 05 October, 2010, 04:07:05 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: --)
*
Online Online

Gender: Male
Last Login: Today at 06:39:40
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50625


Total Post Ratings: +2636

View Profile WWW
« Reply #416 on: 05 October, 2010, 03:58:19 »
0

Nice! Cheesy
Logged

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

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
Deep Thought
So much to do, so much time, so little motivation
Administrator
LV13 Extreme Addict (Next: 9001)
*
Offline Offline

Gender: Male
Last Login: 17 June, 2013, 03:12:44
Date Registered: 19 May, 2009, 08:00:00
Location: The Universe
Posts: 7832


Total Post Ratings: +713

View Profile WWW
« Reply #417 on: 05 October, 2010, 04:50:45 »
0

Awesome! And great job on the optimizations Smiley

I challenge anyone to find a single optimization in this code or produce a smaller library of their own Wink (/me waits for Quigibo to make it way more compact than anyone thought possible)

Easy. Just take out the comments Wink

J/k.
Logged




aeTIos
You got stair'd!
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: Today at 06:09:33
Date Registered: 15 September, 2010, 06:00:00
Location: Netherlands, Overijssel
Posts: 3146


Total Post Ratings: +120

View Profile
« Reply #418 on: 06 October, 2010, 20:59:18 »
0

Nice routine Cheesy
thanks, it was my first
Logged

If something above sounds rude, feel free to vote it down, it was not meant to be rude<<lolol
--Always stay relAXEd!--


Spoiler for Hidden:


[







Spoiler for Still Alive:
This was a triumph.
I'm making a note here: HUGE SUCCESS.
It's hard to overstate my satisfaction.

Aperture Science:
We do what we must because we can.
For the good of all of us
Except the ones who are dead.

But there's no sense crying over every mistake
You just keep on trying till you run out of cake
And the science gets done and you make a neat gun
For the people who are still alive.

I'm not even angry.
I'm being so sincere right now.
Even though you broke my heart and killed me.
And tore me to pieces.
And threw every piece into a fire.
As they burned it hurt because
I was so happy for you.

Now these points of data make a beautiful line
And we're out of beta we're releasing on time.
So I'm GLaD I got burned think of all the things we learned
For the people who are still alive.

Go ahead and leave me.
I think I prefer to stay inside.
Maybe you'll find someone else to help you.
Maybe Black Mesa -
THAT WAS A JOKE. HA HA, FAT CHANCE.
Anyway, this cake is great:
It's so delicious and moist.

Look at me still talking when there's science to do.
When I look out there it makes me GLaD I'm not you.
I've experiments to run there is research to be done
On the people who are still alive

And believe me I am still alive.
I'm doing science and I'm still alive.
I feel FANTASTIC and I'm still alive.
While you're dying I'll be still alive.
And when you're dead I will be still alive.

Still alive
Still alive
aeTIos
You got stair'd!
LV12 Extreme Poster (Next: 5000)
************
Offline Offline

Gender: Male
Last Login: Today at 06:09:33
Date Registered: 15 September, 2010, 06:00:00
Location: Netherlands, Overijssel
Posts: 3146


Total Post Ratings: +120

View Profile
« Reply #419 on: 06 October, 2010, 21:34:31 »
0

number input routine:(EDITED)

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
31
32
33
34
..INNUMBER
"Your text here->Str9
.(following is not necessary)
.sub(IN)
.return

Lbl IN
DiagnosticOff
ClrHome
Str9->A
"+-*/^C -369)TV .258(CPS0147,SALO>LL[X2][X-1]MA->Str4
Text(2,0,A)
0->K
repeat getKey->K
End
Text(8,6,{Str4+K-10}>Char)
0->L
While L=0
getKey->L
End
Text(12,6,{Str4+L-10}>Char
0->M
While M=0
getKey->M
End
Text(16,6,{Str4+M-10}>Char
{Str4+K-10}->X
{Str4+L-10}->Y
{Str4+M-10}->Z
X-48*10+Y-48*10+Z-48->X
Pause 2000
ClrHome
0->K

WOW v2.1 Smiley

« Last Edit: 07 October, 2010, 12:45:14 by aeTIos » Logged

If something above sounds rude, feel free to vote it down, it was not meant to be rude<<lolol
--Always stay relAXEd!--


Spoiler for Hidden:


[







Spoiler for Still Alive:
This was a triumph.
I'm making a note here: HUGE SUCCESS.
It's hard to overstate my satisfaction.

Aperture Science:
We do what we must because we can.
For the good of all of us
Except the ones who are dead.

But there's no sense crying over every mistake
You just keep on trying till you run out of cake
And the science gets done and you make a neat gun
For the people who are still alive.

I'm not even angry.
I'm being so sincere right now.
Even though you broke my heart and killed me.
And tore me to pieces.
And threw every piece into a fire.
As they burned it hurt because
I was so happy for you.

Now these points of data make a beautiful line
And we're out of beta we're releasing on time.
So I'm GLaD I got burned think of all the things we learned
For the people who are still alive.

Go ahead and leave me.
I think I prefer to stay inside.
Maybe you'll find someone else to help you.
Maybe Black Mesa -
THAT WAS A JOKE. HA HA, FAT CHANCE.
Anyway, this cake is great:
It's so delicious and moist.

Look at me still talking when there's science to do.
When I look out there it makes me GLaD I'm not you.
I've experiments to run there is research to be done
On the people who are still alive

And believe me I am still alive.
I'm doing science and I'm still alive.
I feel FANTASTIC and I'm still alive.
While you're dying I'll be still alive.
And when you're dead I will be still alive.

Still alive
Still alive
Pages: 1 ... 26 27 [28] 29 30 ... 42   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 1.201 seconds with 30 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.