Omnimaga

Omnimaga => Completed => Our Projects => BatLib => Topic started by: Xeda112358 on January 23, 2011, 04:08:03 pm

Title: BatLib Ideas/Wishlist
Post by: Xeda112358 on January 23, 2011, 04:08:03 pm
I decided to start this because I noticed a comment from way back in the beginning from DJ Omnimaga that I never really answered/noticed:
Sounds interesting. I wonder what kind of sprite stuff you plan to add. I think you should go with some features that other APPs like xLIB doesn't have, because xLIB, Celtic III and Doors CS 7 already do a lot of stuff and if your library only does a small portion of what those apps do, those apps kinda obsoletes your lib, while if you add even more stuff, people might see your lib as an alternative. I think that it would be cool if you added sprite masking, grayscale (using two sprites like in Axe and everytime you use a certain command, the checkered pattern is inverted).

It would also be nice if you had a tilemap feature that displayed maps which has their map data stored inside pics and allow pixel-testing from pic data. In Illusiat 6, 7 and 9 through 12, all map data is stored inside pics, but I am forced to recall the pic on the graph screen to pxl-test it.
-I am not sure that I will be able to get gray scale working because the app only has control when the sum( command is used.
-Sprite masking is definitely something I can do.
-I can also try to create a tilemap routine that reads tile data from pictures, however, I only plan to let it use one picture at a time.
-That pxl-test idea is a really neat idea that I think I want to implement. In fact, I think I want to make a command that lets you draw in pictures, too, not just the screen. Pretty much, I want to extend all of the drawing routines in BatLib to be able to use a picture file instead of the graph screen.

Thanks DJ!

So, if anybody has any ideas, please feel free to post. I may not be able to add it now, but I couldn't add DJ's features, before. Now, a few months later, I have the skill required.
EDIT: Wow, it looks like I missed even more!
Suggestion for a feature: Extend the Delvar command so it can also delete archived variables, pictures, lists, matrices and strings. Also do you have a command that checks if a list already exists?
Sheesh, I wish I would have payed attention. Um, I can add those without a problem. In fact, it would be pretty easy.
To determine if a list exists or not, using command 41 returns ".BAD NAME" in Ans if the var doesn't exist. This doesn't work with named lists, yet, so I will need to modify that, but it works with lists like L1. (Actually, you can get it to work, but the process is slightly complicated).
Deleting a var will be fairly easy.
Title: Re: Ideas-BatLib
Post by: Hot_Dog on January 24, 2011, 09:52:46 am
Wow, I'd better finish Correlation fast, or we'll have two programs out at the same time with duplicate features :D
Title: Re: Ideas-BatLib
Post by: AngelFish on January 24, 2011, 11:26:56 am
Alternate base arithmetic and other mathematical operations would be nice for a BASIC app.
Title: Re: Ideas-BatLib
Post by: Xeda112358 on January 24, 2011, 11:41:24 am
Sounds good Qwerty! That is where the multiprecision stuff is going. I am using it to handle very large numbers. That command that converts a hex string to another base is still the beta form, but as you can see, it can convert large numbers (it converted a 248-bit number to decimal and other bases). I plan to extend that to other math operations (I am working on the multiplying routine at the moment) so that users can make use of much larger numbers than the OS can normally handle.

@Hot_Dog- The APPs might have duplicate features, but that just means the end user won't need multiple apps to run programs which is what actually started this program. I was using Celtic 3 and Omnicalc so that I could use and edit fonts. BatLib was once a BASIC program called FONTEDIT that I made long before I learned Assembly :D Naturally, when I started learning assembly, I first took away the need for one of the APPS so that the user didn't need two apps to run simple programs. Now I am just adding a bunch of features I wanted from a long time ago :D

Also, I have been working on more sprite routines, so the syntax of some sprite commands may change (to account for things like masking, rotating, and flipping).
Title: Re: Ideas-BatLib
Post by: DJ Omnimaga on January 25, 2011, 02:17:05 am
I wonder if chaining between both apps could be possible?
Title: Re: Ideas-BatLib
Post by: Hot_Dog on January 25, 2011, 04:47:56 am
I wonder if chaining between both apps could be possible?

Whatever happens, DJ, this is another example of something that one can use WITH Correlation simply by turning Correlation on and off.
Title: Re: Ideas-BatLib
Post by: Xeda112358 on January 25, 2011, 08:12:30 am
At the moment, BatLib can chain with any other parser hook, however, if another APP uses the same RAM, then there will be problems. I recently found that Axe does not work well with BatLib, so I am going to adjust some RAM locations. Also, I have the Delvar command made and I have the Picture drawing finished, so I think I will make an update soon...

Edit: I have to fix the pixel test function for command 56 and 62, but once I find the error, I will make a release... The new functions are:
60-DelVarArc
     Deletes a variable whether in archive or RAM
61-DrawRectVar
     Draws a rectangle (using the same syntax as command 29-Rectangle), but draws to the variable, not the graph. So if you use sum(61,"Pic1",0,48,0,32,2 you would invert the upper left quarter of Pic1
62-DrawToVar
     Uses the same drawing functions as command (56-Draw) to draw directly to a variable.

Note that the last two were aimed at drawing to pictures, but other vars can be used, too. However, when drawing to a named variable, the variable type MUST be included before the name.

I also recently found a bug in command 41 that doesn't seem to like archived variables (it crashes when used on an archived variable, usually).
Title: Re: Ideas-BatLib
Post by: DJ Omnimaga on January 26, 2011, 02:05:07 am
I wonder if chaining between both apps could be possible?

Whatever happens, DJ, this is another example of something that one can use WITH Correlation simply by turning Correlation on and off.
Oh wait, I always forgot about that part. I love how it can do this, since it lets us use whatever app we want besides Correlation. :D

By the way will fonts be useable inside Axe programs too? (Not that there would be much point due to faster graph screen routines but some people may like to use special fonts for menus and stuff.
Title: Re: Ideas-BatLib
Post by: Xeda112358 on January 26, 2011, 08:58:29 am
If that is directed at me, my font hooks only modify the large font (at the moment), but they will still be in affect while an axe program is running. However, Axe and BatLib don't seem to get along well at the moment, so as soon as Axe is ran, exiting it will crash the calc (it uses one or multiple of the same spots in RAM as BatLib).

However, disabling BatLib hooks by doing sum(0,50,51will let you safely use Axe. Then, you can compile your programs and reactivate BatLib so that you can use the font hooks :)

Also, the main menu in BatLib is not finished, but in the readme I explain what I intend for it to do. It is going to be a hook manager, hopefully, that lets you install, uninstall, chain, or change the priority level of hooks.

Gah, I have to work on that menu system...
Title: Re: Ideas-BatLib
Post by: DJ Omnimaga on January 29, 2011, 02:00:39 am
COol to hear it's possible to disable it. Also will the fonts work on the graph screen too? I ask since it's possible to use large fonts there too (Text(-1,Y,X,<text>) instead of Text(Y,X,<text>))

Good job so far :D
Title: Re: Ideas-BatLib
Post by: Xeda112358 on January 29, 2011, 02:01:42 am
Hmm, I could add hooks for that, yes, but it isn't added yet.
Title: Re: Ideas-BatLib
Post by: Munchor on February 02, 2011, 05:09:16 pm
Idea: Do you already have comments?

Not sure if it can be done, but all lines starting with // (for example) would be comments and not compiled.

Once again, not sure if this is possible.
Title: Re: Ideas-BatLib
Post by: Xeda112358 on February 02, 2011, 05:14:10 pm
Ahh, this isn't a programming language, it is like Celtic 3. This just modifies the regular OS command "dim("

However, when I do get back to work on command 40 (BASIC ReCode), it uses "." as the start of a comment... BASIC ReCode is a programming language, but I am pretty sure it doesn't work anymore.
Title: Re: Ideas-BatLib
Post by: AngelFish on February 02, 2011, 05:16:08 pm
Totally awesome idea: on-calc objected Oriented language compiler that has the functions of C and the ease of Python  :w00t:

EDIT: Forgot to request the Assembler/disassembler package too :P
Title: Re: Ideas-BatLib
Post by: Xeda112358 on February 02, 2011, 05:26:30 pm
I do plan to add assembly mnemonic support in BASIC ReCode.
Title: Re: Ideas-BatLib
Post by: Munchor on February 02, 2011, 05:29:01 pm
I do plan to add assembly mnemonic support in BASIC ReCode.

like...

Mnemonic(ld hl,1

??
Title: Re: Ideas-BatLib
Post by: Xeda112358 on February 02, 2011, 05:31:53 pm
No, this does not create its own tokens. It would be like:
LD A,B
OR A
RET Z

So it would take up a lot of memory...
Maybe I should just make a compiler...
That can compile to a program or just return the hex...
I do have it working for simple mnemonics, but that just means some LD and ADD/SUB things.
Title: Re: Ideas-BatLib
Post by: DJ Omnimaga on February 03, 2011, 12:39:21 am
Ahh, this isn't a programming language, it is like Celtic 3. This just modifies the regular OS command "dim("

However, when I do get back to work on command 40 (BASIC ReCode), it uses "." as the start of a comment... BASIC ReCode is a programming language, but I am pretty sure it doesn't work anymore.
I haven't checked but I hope we can still use dim( normally with Batlib, though, right? O.O (or at least that there's a way to temporary disable Batlib when we need to use dim(. (we tend to use that command a lot to create lists.
Title: Re: Ideas-BatLib
Post by: Xeda112358 on February 03, 2011, 12:42:26 am
Yep, it still works properly :D I use it the normal way in the example program.
Title: Re: Ideas-BatLib
Post by: DJ Omnimaga on February 04, 2011, 01:31:15 am
Good to hear :D
Title: Re: Ideas-BatLib
Post by: Xeda112358 on February 04, 2011, 11:46:36 am
Okay, so I just got an idea for a super complicated command... for a new tilemap routine. I have not changed the current routine in over six months, so I think it is time for an update. So here is kind of a projected syntax:
dim(xx,DisplayMethod,"Tilemap",MapWidth,DispHeight,DispWidth,XOffset,YOffset,"SpriteVarName",SpriteHeight,SpriteWidth,FlipVert,FlipHoriz,Offset

So it will take, say, a 32x96 tilemap, display a portion of it using sprites from a variable of some size. Then, if you choose to flip a sprite vertically, say a 8x8 sprite, it will display a 16x8 sprite and flipped horizontally will make it display each tile as 16x16 (useful for symmetrical tiles).

As a note, I doubt I will add it anytime soon, but it is a neat idea that I have wanted to add for a long time.
Title: Re: Ideas-BatLib
Post by: Hot_Dog on February 04, 2011, 12:06:10 pm
Sweet idea!
Title: Re: Ideas-BatLib
Post by: DJ Omnimaga on February 04, 2011, 11:51:29 pm
Seems interesting. By the way have you thought about adding a pic-based tilemapper that reads data like Illusiat 12? Some people might want to use pics for the size advantage, despite being limited to 3 tiles and not being able to store event tiles there.
Title: Re: Ideas-BatLib
Post by: Xeda112358 on February 05, 2011, 12:06:05 am
I'm confused... Pictures use more space unless you use the whole thing... and 3 tiles? I can do it, but it will be at the cost of speed. I will try to add it :D I mean, I have over 8000 bytes to fill up yet!

Also, how about making a command to convert a pic to the form of map data used for the current tilemap command...

IDEA! Okay, before I forget, I just thought of a way to make a fast version using pics. It will be slightly slower, but much faster than what I originally thought. I am jotting this down before I forget...
Okay, so I will copy the pic to the graph buffer, convert it to saveSScreen in the proper format, and then just use the regular tilemap routine using the pointer to saveSScreen as the tile data!

Thanks DJ ^-^
Title: Re: Ideas-BatLib
Post by: DJ Omnimaga on February 05, 2011, 04:15:20 am
Oh, when you use pics to store tilemaps, you fill the entire pic with maps. If you look at Illusiat/ROL maps they usually fill entire pics. :P Otherwise the only advantage there was to use pics was that pixel test is the fastest way to do collision detection in TI-BASIC.
Title: Re: Ideas-BatLib
Post by: Xeda112358 on February 05, 2011, 11:32:08 am
Ah okay :D Yeah, I've never used a whole picture for tiles, so I just made BatLib able to use strings or appvars or any other var that could be variable size to store the sprite data. I mean, you can actually use pictures right now, but you would have a tough time recognising your sprites if you did RecallPic. But yeah, I'll work on a code to convert pictures to sprite sets right now.
Title: Re: Ideas-BatLib
Post by: DJ Omnimaga on February 05, 2011, 03:12:50 pm
Oh I didn't store sprites into the map pic. I really drew a map in a pic using Pen and the map engine read from the graph screen usign pxl-test. Sprites were stored in a different pic.
Title: Re: Ideas-BatLib
Post by: Xeda112358 on February 05, 2011, 03:35:10 pm
Oh, okay. Well, I did just make a routine that lets you use a picture as a tileset. But that being said, I did add that routine a week or two ago that lets you pixel test pictures without recalling them to the graph screen.
Title: Re: Ideas-BatLib
Post by: DJ Omnimaga on February 06, 2011, 12:58:31 am
Cool. Personally I like to store my sprites inside pics because it's easier to organize them. I always hated having to convert them to hex all the time. X.x
Title: Re: Ideas-BatLib
Post by: Xeda112358 on February 06, 2011, 01:32:37 am
Ah, yeah, I know what you are talking about... That is where command 35 comes in handy :D It converts a sprite on the graph screen to data. It even lets you choose the size of the sprite ^-^ I made the command because BatLib only used data (for speed purposes), so it was more difficult to create sprite data. This command does all the work and saves it in its compressed form.
Title: Re: Ideas-BatLib
Post by: DJ Omnimaga on February 06, 2011, 03:16:45 am
Oh ok, that can work I guess. :D
Title: Re: Ideas-BatLib
Post by: Xeda112358 on February 06, 2011, 10:45:06 am
Either way, I think I've got ya covered DJ ^-^ I added the ability to use pictures to store tiles (like with xLIB) and the speed won't be a problem as it converts everything all at once.
Title: Re: Ideas-BatLib
Post by: DJ Omnimaga on February 07, 2011, 03:16:32 pm
Awesome! This will be handy for many people. :D

So basically, Batlib will be more an hybrid of math/game-oriented functions, like Omnicalc, while xLIB, Celtic III and DCS are more game-oriented, right?
Title: Re: Ideas-BatLib
Post by: Xeda112358 on February 08, 2011, 01:08:15 am
Hopefully, yes :D As a note about the math, I have pretty much been gone all day, but I did make a code to handle large multiplication operations.
Title: Re: Ideas-BatLib
Post by: program4 on February 08, 2011, 08:04:23 pm
That's nice  :D

Since BatLib is also math-oriented, will you add specific math functions (like the gamma function)? Also, if there isn't such a command already, a possible addition would be to convert a number to a string (the opposite of the expr( command).

I love how this library helps not just game programmers, but just about any TI-BASIC programmer!
Title: Re: Ideas-BatLib
Post by: Xeda112358 on February 08, 2011, 08:46:17 pm
Thanks ^-^
And actually, now that you mention it... I do have some code lying around from way back when to convert a number to a string... I'll add that real quick before I forget!
Title: Re: Ideas-BatLib
Post by: Xeda112358 on February 28, 2011, 01:04:04 pm
At the moment, I have added 3 commands not in the newest released version:
70-PlayNote
71-Logic
72-MatrixList

And I plan to add these ones soon:
73-SearchStr: similar to inString(, but meant for use with the next few
74-left: gets the left part of a string (byte offset)
75-right: gets the right part of a string (byte offset)
76-mid: gets a portion of a string (byte offsets)
77-diag: gets a diagonal from a matrix (1,1)
78-diagI: gets a diagonal from a matrix (1,n)
79-subRow: Grabs a portion of a row of a matrix
80-subCol: Grabs a portion of a column of a matrix
81-ListToRow: copies a list to a Row in a matrix
82-ListToCol: copies a list to a Column in a matrix

With that in mind, if anybody has any similar ideas, feel free to let me know :D I am going to be gone for most of the day, but I will be back later tonight.
EDIT: Here is a glimpse at the syntax I am aiming for:
Spoiler For Spoiler:

*I want to make it so that the string/matrix can either be a name or the data itself. So if you want to get the right part of Str6, you enter 5, but if you want the right part of "HELLO" you input "HELLO" instead. Just some extra features that can be memory savers :D Again, this is what I plan to do, I don't know if I will be able to, immediately.

SearchStr   dim(73,"String"|Str,offset,"Search"
left        dim(74,"String"|Str,offset
right       dim(75,"String"|Str,offset
mid         dim(76,"String"|Str,offset,NumBytes
diag        dim(77,[matrix]|Matr,Col,Row,NumElem
diagI       dim(78,[matrix]|Matr,Col,Row,NumElem
subRow      dim(79,[matrix]|Matr,Col,Row,NumElem
subCol      dim(80,[matrix]|Matr,Col,Row,NumElem
ListToRow   dim(81,[matrix]|Matr,Col,Row,{List}|List
ListToCol   dim(82,[matrix]|Matr,Col,Row,{List}|List
Title: Re: Ideas-BatLib
Post by: DJ Omnimaga on March 02, 2011, 04:33:27 am
Darn how many commands are you planning for the final release? O.O

Also I wonder if the more commands, the slower it is? You might want to check that.
Title: Re: Ideas-BatLib
Post by: Xeda112358 on March 02, 2011, 11:38:16 am
No, it doesn't slow anything down with more commands ^-^
I plan to keep adding to it as much as I can, but it is looking like by the end of this there will be over 100 commands. I plan to add a few other features when I get time that lets you use dim( the normal way on lists and matrices even if they are archived, too. I have been a little busy, lately, trying to get my GPA up, so I might not have time to program for a little while (meaning a week or two) :(

EDIT: Okay, I just checked... the average command uses 34.5 bytes of code (the bulk of the app is comprised of calls and a bitmap) so at this rate, I have enough room for 236 more commands :D
I will probably be adding more complicated things for future commands, though, that use a large chunk of memory. When I added the 12 rectangle routines, I used almost 700 bytes of code.
Title: Re: Ideas-BatLib
Post by: DJ Omnimaga on March 03, 2011, 04:53:07 am
Good to hear. I was worried it had a lot more stuff to check with more commands. In BASIC, with 100 ifs in a row, it starts getting slow. :P

And sorry to hear about your GPA, I hope it goes well.
Title: Re: Ideas-BatLib
Post by: TIfanx1999 on March 03, 2011, 08:02:44 am
@Xeda: Wow, that is gonna be feature packed! Awesome! Oh, and yes. Grades before programming. :D
Title: Re: Ideas-BatLib
Post by: Xeda112358 on March 13, 2011, 02:09:49 pm
So I have made good on what I wanted to add (not the search function, yet), plus I added more, so I feel good about that. For now, I have been working on BASIC ReCode for the past few days and I think I will be working with that some more. Between ReCode and the dim( commnads, BatLib contains 135 commands (92 dim( commands and 43 ReCode functions). It is far enough along that games can be made with it, but it still has a lot more that I can add. For now, I want to add:
-Sprite routines using Pt-On(, Pt-Off(, and Pt-Change(
-I need to fix up the While loop to allow for End statements inside it
-I want to add string variable support
-I should add support for recalling and storing to pictures
-I should add support for modifying variables like programs.

As a note, I was thinking of adding the command Get( to act as another command subset... so something like Get(Line(EBLOCKEAT,2 could return a pointer to the second line of code in the program BLOCKEAT while Get(Shade( could return the current contrast level.

If anybody has ideas for ReCode commands, feel free to mention them!
Title: BatLib Wishlist
Post by: Xeda112358 on April 01, 2011, 08:47:42 am
Y'all may have noticed that I haven't made any updates in a long while (meaning a few weeks), but I'm mostly just burnt out at the moment. I've been doing a bunch of math, lately, and very little programming. I should definitely start making a wishlist of things to add because eventually I will get programming fever again and who knows, I might wan crazy ideas :D
So if anybody has made a request I haven't implemented or you have any ideas, feel free to post here. They can be ideas for the regular BatLib commands or for ReCode and they can be simple or crazy. I am not saying they will appear in BatLib, but who knows?
So my wishlist, currently:
-PopUp Menu
-Hook chaining/handling
-new Tilemap routines

Anybody else got anything?
Title: Re: BatLib Wishlist
Post by: mrmprog on April 05, 2011, 08:10:57 pm
Normal:Find and replace routine for editing programs.
Crazy:Key hook system that will link key combinations to programs. For example, you could press on and clear to execute <program name>.
Title: Re: BatLib Wishlist
Post by: Deep Toaster on April 05, 2011, 08:12:12 pm
Crazy actually sounds easier than Normal O.O
Title: Re: BatLib Wishlist
Post by: Xeda112358 on April 05, 2011, 09:45:30 pm
Yeah, I think in that case, Crazy is easier XD I'll see if I can, because that would be cool!
Title: Re: BatLib Wishlist
Post by: Ashbad on April 05, 2011, 10:05:41 pm
Hmm.. Maybe string compression and decompression? :) that would actually be quite cool :D
Title: Re: BatLib Wishlist
Post by: Xeda112358 on April 05, 2011, 10:08:26 pm
I have actually been meaning to add my own form of string compression and decompression. It is the same method I used in BASIC/Celtic 3 once upon a time...
Title: Re: BatLib Wishlist
Post by: Munchor on April 08, 2011, 06:01:15 pm
Zeda, shouldn't this topic be merged with the 'Ideas' one?
Title: Re: BatLib Wishlist
Post by: Xeda112358 on April 08, 2011, 06:25:20 pm
Yeah, probably. At the time I was thinking Ideas was going to be more for practical ideas to bounce around whereas this topic was for me to get a feel for what people wanted, but they can probably get merged, I guess
Title: Re: BatLib Ideas/Wishlist
Post by: ztrumpet on April 08, 2011, 06:50:46 pm
These topics were easy to merge, as they were both in the same board. ^-^  Yay!
How about an Input routine that's limited to only the letters A-Z? :D
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 08, 2011, 07:34:47 pm
Hm, I might be able to accomplish that with a little time! I'll work on it!
Title: Re: BatLib Ideas/Wishlist
Post by: Munchor on April 10, 2011, 05:13:40 am
How do If's work in Recode?

Code: [Select]
If A=4
Disp "HELLO
End

Is it like that, like in Axe? Or does it require the crappy Then?
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 10, 2011, 11:12:04 am
No, using the If command in ReCode is like using the BASIC If command. If you have one line of code following, just do:
Code: [Select]
If A=4
Disp 0,0,HELLO
If you have multiple lines of code, then you do:
Code: [Select]
If A=4
Then
Line(0,96,0,64,2
DispGraph
Disp 0,0,HELLO
End
However, some commands can appear on the same line. Unfortunately, DispGraph, Full, log(Text(, and anything using a string of data need a newline token after them. Still, if you wanted to, you could do:
Code: [Select]
If A=3
Line(0,96,0,64,2 DispGraph
All I did there was use a space before the DispGraph command, so it is all on one line :)
Title: Re: BatLib Ideas/Wishlist
Post by: Munchor on April 11, 2011, 05:05:26 am
I'd rather just use the first two samples of code.

1line    -1 if  - 0 then - 0 ends
>1 line - 1 if - 1 then - 1 end


EDIT:

Will you make dim(1) disable run indicator and "Done" message? Thanks, like DiagnosticOff in Axe.
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 11, 2011, 08:14:43 am
Yes, I will add that :) In fact, I just added it and saved it :)
Title: Re: BatLib Ideas/Wishlist
Post by: Munchor on April 11, 2011, 08:40:31 am
Yes, I will add that :) In fact, I just added it and saved it :)

Nice :)
Title: Re: BatLib Ideas/Wishlist
Post by: ztrumpet on April 11, 2011, 03:44:03 pm
Line(0,96,0,64,2
What does the 2 at the end do?
Title: Re: BatLib Ideas/Wishlist
Post by: Munchor on April 11, 2011, 04:20:03 pm
Line(0,96,0,64,2
What does the 2 at the end do?

It's the rectangle type.

You should read the ReCode readme :P

type 1 - black
type 2 - inverted
...
type 6 - borders only
...
Title: Re: BatLib Ideas/Wishlist
Post by: ztrumpet on April 11, 2011, 04:34:11 pm
You should read the ReCode readme :P
I should. :P  I've been really busy recently, though, so... </lame excuse>
Yeah, I should. ;)
Title: Re: BatLib Ideas/Wishlist
Post by: Munchor on April 11, 2011, 04:45:11 pm
You should read the ReCode readme :P
I should. :P  I've been really busy recently, though, so... </lame excuse>
Yeah, I should. ;)

And then you should code some samples :P And then create software =D
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 11, 2011, 09:16:25 pm
Hehe, code for us, ztrumpet, code for us! When I get around to creating line routines, I will need to add in new functions, but I might also add in more rectangle routines I think it was merth that mentioned some good ideas for making rectangle patterns (like turning off every x pixels on a border).
Title: Re: BatLib Ideas/Wishlist
Post by: Munchor on April 12, 2011, 02:10:06 pm
Hehe, code for us, ztrumpet, code for us! When I get around to creating line routines, I will need to add in new functions, but I might also add in more rectangle routines I think it was merth that mentioned some good ideas for making rectangle patterns (like turning off every x pixels on a border).

For us? More like for you.

I would really like circle drawing command, but not sure if this is possible.
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 12, 2011, 03:47:37 pm
Yeah, I just have to wrap my mind around the algorithm and try to make it as fast as possible. Once I manage that, I will make circles with fill methods :)
Title: Re: BatLib Ideas/Wishlist
Post by: ZippyDee on April 12, 2011, 03:48:46 pm
bresenham's is probably the best for just circles
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 12, 2011, 04:06:58 pm
Yeah, but the issue is that one byte modifies 8 pixels x.x I am working on optimising it for that little issue
Title: Re: BatLib Ideas/Wishlist
Post by: ZippyDee on April 12, 2011, 04:07:29 pm
ooh...good point >.< I hadn't thought of that.
Title: Re: BatLib Ideas/Wishlist
Post by: Munchor on April 12, 2011, 04:08:12 pm
Oooh Zeda, a fast algorithm for it would be great (in the hex code). As long as its simple in the Basic code.
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 12, 2011, 04:10:03 pm
Yeah, in the ReCode code, it would be Circle(y,x,r or something
Title: Re: BatLib Ideas/Wishlist
Post by: Munchor on April 12, 2011, 04:11:17 pm
Yeah, in the ReCode code, it would be Circle(y,x,r or something

Circle( is a new token or already exists?
Also, does ReCode/BatLib add any tokens?
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 12, 2011, 04:13:16 pm
No, there is no way to add new tokens :/ And Circle( doesn't exist yet, it was just a possible future method.
Title: Re: BatLib Ideas/Wishlist
Post by: Munchor on April 12, 2011, 04:13:47 pm
No, there is no way to add new tokens :/ And Circle( doesn't exist yet, it was just a possible future method.

Cos I have it on my calculator, perhaps it's Axe.
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 12, 2011, 04:19:28 pm
Oh, Circle( is an existing function in BASIC, but it doesn't do anything in ReCode
Title: Re: BatLib Ideas/Wishlist
Post by: Munchor on April 12, 2011, 04:24:46 pm
Oh, Circle( is an existing function in BASIC, but it doesn't do anything in ReCode

Then you can use it :)
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 14, 2011, 09:55:36 pm
Okay, so I think that the next thing I should do is make more commands compatible with the archive. I was working on Samocal when I realised that I never added in support for dim(15 (VarReadByte) to read an archived byte of data from a program. I resorted to a workaround using a combination of dim(66 (StrToReal) and dim(11 (GetBytes), but that method is slower and takes up more code space.
Title: Re: BatLib Ideas/Wishlist
Post by: Munchor on April 15, 2011, 07:21:11 am
What if we could use the normal TI-Basic Pause in Recode?
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 15, 2011, 08:39:37 am
You can do Pause If getKey≠9, but I prefer keeping the regular Pause command as it is. As a note, Pause If is read as a different command from Pause or If.
Title: Re: BatLib Ideas/Wishlist
Post by: Munchor on April 15, 2011, 08:51:27 am
You can do Pause If getKey?9, but I prefer keeping the regular Pause command as it is. As a note, Pause If is read as a different command from Pause or If.

I meant adding a new pause command, I want Pause X to remain as it is.

Also, what I suggested here (http://ourl.ca/7980/198549).
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 15, 2011, 08:55:48 am
So how would I add a new Pause command?
Title: Re: BatLib Ideas/Wishlist
Post by: Munchor on April 15, 2011, 08:57:23 am
So how would I add a new Pause command?

Not sure if you can add new tokens, but if you can't, why not use a dim( or a Basic token that's useless?
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 15, 2011, 08:58:12 am
So you want it to just Pause and wait for enter, or do you want it to Pause and wait for a key?
Title: Re: BatLib Ideas/Wishlist
Post by: Munchor on April 16, 2011, 04:42:07 am
So you want it to just Pause and wait for enter, or do you want it to Pause and wait for a key?

I want the little thing scrolling on the right top of the screen and only [ENTER] will work.
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 16, 2011, 09:37:17 am
Hmm, well for now, this will work:
Code: [Select]
Pause If getKey≠9
But otherwise, I will see if I can do anything.
Title: Re: BatLib Ideas/Wishlist
Post by: Munchor on April 17, 2011, 05:41:30 am
Hmm, well for now, this will work:
Code: [Select]
Pause If getKey≠9
But otherwise, I will see if I can do anything.

Thanks, I don't want to force you into making commands you don't wanna make though.
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 17, 2011, 01:35:14 pm
I don't know of a token I can use for that, though :/ That is the main reason why... I want to use tokens that make sense
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 17, 2011, 06:58:17 pm
Okay, sorry for the double post :/

I had another idea for new rectangle commands. I still need to get around to merth's ideas, but for now, I am thinking of adding rectangle routines that change things outside the rectangle as opposed to inside. It would kind of be the opposite of filling the rectangle. What do y'all think?

(Like, think of inverting everything outside the rectangle or something)
Title: Re: BatLib Ideas/Wishlist
Post by: mrmprog on April 17, 2011, 07:29:51 pm
Sounds good
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 17, 2011, 08:50:56 pm
Okay, so here is an example of code that I have and what it does, currently:
dim(29,6,16,6,9,1+16
It only modifies 9 rows of the graph screen starting 6 pixels down. The spot that would normally turn black is now not affected and everywhere else in those rows is turned black
Title: Re: BatLib Ideas/Wishlist
Post by: Munchor on April 18, 2011, 06:14:06 am
I'm now coding a game using BatLib... Can we use dim(56 with random Xs and Ys?
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 18, 2011, 11:24:36 am
Yes you can :D However, I do not believe that I added protection against drawing off screen, so be careful to not let your x and y values to go off screen :)

I cannot wait to see the game !
Title: Re: BatLib Ideas/Wishlist
Post by: Munchor on April 18, 2011, 11:37:22 am
Yes you can :D However, I do not believe that I added protection against drawing off screen, so be careful to not let your x and y values to go off screen :)

I cannot wait to see the game !

I was coding the game and having some progress. However, I thought "Wow, let's make this in Axe!", and I started it and I've developed it a lot further in Axe. However, I'll try and make it BatLib after I finish don't worry :D
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 18, 2011, 11:39:31 am
That is fine :) It is entirely up to you :D
Title: Re: BatLib Ideas/Wishlist
Post by: Munchor on April 18, 2011, 11:41:29 am
That is fine :) It is entirely up to you :D

I'll still make it in BatLib to learn and to teach others by sharing the source.
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 18, 2011, 10:26:08 pm
Okay, so I have been using command 54 which is DBRead and I think it is about time that I fix it up. It is used when you are creating a database to extract certain "elements." Pretty much, think of a database as a list, except with data of a variable size. Okay, here is a better context: You want to read a line in a program.

A newline token is 3Fh or 63 in decimal. So, if you create a program where each line has a word or name or some other data, you can use dim(54 to read specific lines! The only real problem at the moment is that you need a newline at the end and it does not detect the end of the file.

Also note that it can read from the archive, currently and it isn't limited to newline tokens. If you wanted, you could read between spaces or whatever you feel like using :) I am using it in Samocal for item and monster names :)

Also, I want to add in InsertEntry, DeleteEntry, and ReplaceEntry as new commands :)
Title: Re: BatLib Ideas/Wishlist
Post by: Munchor on April 20, 2011, 09:40:22 am
Woah Woah Woah, is there appvar support?
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 20, 2011, 11:34:21 am
Scout, one of the main selling points of BatLib is that it technically works with all variable types. Some types like lists and real numbers you will need to know the structure, but if a command asks for a var name, it can use any variable type.

For example, if I want to read 67 bytes of Pic7 from archive at an offset of 13:
Code: [Select]
dim(11,13,".Pic7",67That will return the data as a string in Ans. For an appvar, use a prefix byte of either U or 5. So for example:
Code: [Select]
dim(54,63,2,"5MEOWThat will read the second line in the appvar MEOW

Enjoy! :)
Title: Re: BatLib Ideas/Wishlist
Post by: Munchor on April 20, 2011, 11:34:58 am
Ooh sweet, nice!
Title: Re: BatLib Ideas/Wishlist
Post by: mrmprog on April 22, 2011, 08:59:04 pm
I would kinda like more data structures and a randint( for recode
Title: Re: BatLib Ideas/Wishlist
Post by: Xeda112358 on April 22, 2011, 09:34:35 pm
For now, a method for randInt( in ReCode would be to use the fact that division stores the remainder in Ans'. Using Ans in your code will swap Ans with Ans' so what you can do for randInt(1,8 is:
Code: [Select]
rand/8       ;This will store a remainder of 0 to 7 in Ans'
Ans+1        ;This will swap out Ans' with Ans, then add 1
I hope this helps, but if I get time to program, I will try to add in a randInt( command :)