BatLib

A forum where you can announce your awesome project(s).

Moderator: MaxCoderz Staff

Xeda
New Member
Posts: 42
Joined: Sun 06 Feb, 2011 7:08 am

BatLib

Post by Xeda »

Mwahahaha, so I am finally here to infect MaxCoderz with my presence >_>
Anywho, I have been working on a little project called BatLib for some time now and it is almost ready for release. I have released beta version on other sites, but the whole structure keeps changing. I am almost finished finalizing syntax and whatnot, but I imagine it will be a week or two before I am ready for the release. Anyway, here are some slightly out of date screenshots...
I had five weeks off and I wanted cursive font!
I had five weeks off and I wanted cursive font!
55-SetFont(5).gif (153.32 KiB) Viewed 50397 times
I wanted a way to extract elements from a list, fast.
I wanted a way to extract elements from a list, fast.
38-SubList.gif (98.66 KiB) Viewed 50397 times
The beta form of the base converter ^-^ It only converts hexadecimal to another base, currently.
The beta form of the base converter ^-^ It only converts hexadecimal to another base, currently.
59-BaseX (Beta version).gif (97.76 KiB) Viewed 50397 times
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Re: BatLib

Post by benryves »

Welcome to MaxCoderz!

Do I assume correctly that this is an assembly library? If so, what features do you have currently implemented and which do you have planned? I think I can see there's a way to change the font, a way to slice lists and a base converter. It certainly looks good so far. :)
Xeda
New Member
Posts: 42
Joined: Sun 06 Feb, 2011 7:08 am

Re: BatLib

Post by Xeda »

Well, it is an assembly library with 64 functions so far... it includes some stuff to manipulate fonts, manipulate data, read from the archive, sprites, tilemapping, key presses (including multiple keys), executing hex codes, changing the contrast, drawing to the LCD, 12 rectangle routines, flag editing, picture handling, a programming language (doesn't do much yet), sound, key hooks (including a hook that controls the speed of your repeat keys), a simple line reading function, drawing functions, base converter, drawing directly to pictures (including the ability to pxl-test( pictures), and a program to copy variables to other variables (from RAM or archive). Here is a list of the commands:
00-DisableFont
01-IndicatorOff
02-EnableFont
03-SetData
04-LoadData
05-HexToken
06-TokenHex
07-SetMap
08-GetMap
09-GetTile
10-GetKeyGroup
11-GetBytes
12-StoBytes
13-TileMap
14-VarEditByte
15-VarReadByte
16-VarDrawSprit
17-MemEdit
18-MemRead
19-Editbyte
20-ReadByte
21-GetVar
22-ASMHex
23-ASMToken
24-DPutSprite
25-VarType
26-BatteryLevel
27-IncContrast
28-DecContrast
29-Rectangle
30-ScrnToGraph
31-DispChar
32-SetContrast
33-FlagWrite
34-FlagRead
35-GetSprite
36-PicHandle
37-OutputASCII
38-SubList
39-ZAddress
40-BASIC ReCode
41-GetStats
42-AnsType
43-Get2Key
44-PlayData
45-GetChar
46-PortEdit
47-PortRead
48-ScreenShot
49-SpeedyKeys
50-Uninstall
51-DisableKeyHooks
52-HexSprite
53-TokSprite
54-LineRead
55-SetFont
56-Draw
57-GetVersion
58-ShiftGraphRight
59-BaseX
60-DelVar
61-DrawRectVar
62-DrawToVar
63-PxlTestPic
64-CopyProg
??-DispGraph

Right now I have code that lets the user use pictures for tile data and I plan to add math functions that handle large numbers (that base converter was a demo of my division routine :D) and I am going to be working on BASIC ReCode (command 40). BASIC ReCode is an interpreted language that can appear inline with BASIC code and it can currently execute assembly code, too. It only has a few functions, though, so it isn't very useful yet.

The readme is horribly outdated but it will give you a feel for what it can do. BatLib no longer uses dim(, now, not sum(. And there is no longer a type argument. Instead, you prefix the name with a letter. E=program, U=Appvar, D=String, and others. So for example, the readme says:
sum(21,Type,"VarName"
Instead, to read the contents of prgmALPHA, use:
dim(21,"EALPHA
4.00.64.beta.zip
(219.9 KiB) Downloaded 1091 times
Here is a slightly outdated example program. Instead of putting "Str9" in Ans, use "DStr9" and it will work:
Editor 1514305591.zip
(3 KiB) Downloaded 1133 times
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Re: BatLib

Post by kalan_vod »

It is a very nice project Xeda, I hope to see it in its final form!
Xeda
New Member
Posts: 42
Joined: Sun 06 Feb, 2011 7:08 am

Re: BatLib

Post by Xeda »

Yeah, I've got a bunch of projects going right now, so I don't know how soon it will be ready. Right now I am going to completely change command 16 and modify the syntax of command 13, then it should be just about ready. I'll go through and optimise some of the commands now that all the syntaxes have changed and it should be ready for its first non-beta release.
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Re: BatLib

Post by kalan_vod »

Sounds great, we look forward to it
Galandros
Regular Member
Posts: 88
Joined: Sun 14 Sep, 2008 10:00 am

Re: BatLib

Post by Galandros »

You reached here, Xeda. Nice to see you showcasing here. ^^
Xeda
New Member
Posts: 42
Joined: Sun 06 Feb, 2011 7:08 am

Re: BatLib

Post by Xeda »

I hadn't even heard of this site, really, until I saw the post over on Omnimaga :D
The only new stuff I have for it since two days ago is an arbitrary precision multiplication routine (for handling very large numbers). I haven't really touched it since, though (other projects occupying my time :D).
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Re: BatLib

Post by kalan_vod »

Xeda wrote:I hadn't even heard of this site, really, until I saw the post over on Omnimaga :D
The only new stuff I have for it since two days ago is an arbitrary precision multiplication routine (for handling very large numbers). I haven't really touched it since, though (other projects occupying my time :D).
That sounds like fun ;), maybe you could show us some other projects you are working on?
Xeda
New Member
Posts: 42
Joined: Sun 06 Feb, 2011 7:08 am

Re: BatLib

Post by Xeda »

Okay, sure! I'll just post them, too. Also, i am thinking about changing the little "L" used in the App name to some other symbol representing an "L" because there are a lot of people who have downloaded the previous version (that is, as I have mentioned, a beta version). I still have not decided on this, yet, so I was wondering if anybody had any opinions?
Xeda
New Member
Posts: 42
Joined: Sun 06 Feb, 2011 7:08 am

Re: BatLib

Post by Xeda »

Okay, so I did actually release the non-beta version a week ago and I imagine it is about time I upload the latest version, here. So the additions and changes are:
-The menu is fixed
-I temporarily removed hook chaining (hopefully it is temporary and I can fix the problems involved)
-ShiftGraphScreenX now can shift in 8 direction instead of 1
-I CopyProg still needs some work
-I found a problem with PxlTestPic and it now works (even with archived pictures)
-I added RealToStr which converts a real number to a byte of data as a string in Ans
-I added StrToReal which converts a byte of data (as a string) to a real number in Ans
-I added DataSring which converts either a string of data to a list or a list to a string of data
-I added MakeAnsString which creates a string of some user defined size
-I added SubMatrix which extracts a portion of a matrix even if it is in archive.

The total number of commands is now at 71. Some uses for RealToStr, StrToReal, and DataString are particularly evident when you want to create some data based on an equation. For example, I was working on a program that made a sound based on which menu element was selected or at other points (it was a quick, knock-off version of Guitar Hero, so guess where else the sounds were played based on an equation :D). Also, DataString is also a program I created about a year ago that has a few hacks and interesting uses (like converting a string of uppercase letters to lowercase).

As for SubMatrix, I added that as a neat feature as it can read the matrix data directly from archive, too. It could be pretty useful for some games, too, where a large matrix is used, but only a portion needs to be checked at any given time.

My plans are:
-To add a SubString2D to handle 2 dimensional byte arrays (such as map data) that works similarly to SubMatrix so that scrolling tilemaps can be used with the current tilemap command available.
-Add some new Tilemap routines
-Add some more matrix commands like reading diagonals or portions of a matrix as a list
-Add the ability to convert full matrices to lists or visa-versa.
-Add a simple sound command that plays one byte of sound using a real number
-Work more on BASIC ReCode.
Attachments
Command 69-SubMatrix
Command 69-SubMatrix
69-SubMatr.gif (196.77 KiB) Viewed 50330 times
v4.00.00.71.zip
(235.82 KiB) Downloaded 1258 times
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Re: BatLib

Post by benryves »

That looks really grand. :-) Good work!

Do you have any particular projects in mind for this, or are you hoping that other programmers will pick it up use it? (If so, how has that been going?)
Xeda
New Member
Posts: 42
Joined: Sun 06 Feb, 2011 7:08 am

Re: BatLib

Post by Xeda »

Well I was kind of hoping that other programmers would find a use for it, but most of the commands I have added are commands I wanted for a particular task in BASIC. I have been meaning to get back to working on remaking an old RPG that I lost 3 years ago, but I want to add more features. I have been designing BatLib for speed and size which is why some of the commands are designed for more advanced programmers (like how tilemaps work with bytes instead of matrices). At the same time, I have been adding commands to make creating the data easier, too. For example, there isn't a command that can source a sprite from a picture, but there are commands that let you display sprites using data in the form of a string (the data is linear). So to make it easier to create the data I added the command GetSprite which will convert a sprite on the graph screen to the proper string for future display use.
User avatar
Madskillz
Calc Wizard
Posts: 745
Joined: Fri 17 Dec, 2004 10:22 pm
Location: Wandering around in the Jungle...
Contact:

Re: BatLib

Post by Madskillz »

This is really impressive Xeda, it is definitely useful and I'm sure some of the BASIC programmers are gonna find this very useful.
The Revolution is here...
User avatar
kalan_vod
Calc King
Posts: 2932
Joined: Sat 18 Dec, 2004 6:46 am
Contact:

Re: BatLib

Post by kalan_vod »

That submatrix routine would be useful for someone that has a large archived matrix, I know I could have used this for Res/Tank :)
Post Reply