Author Topic: BatLib Demo Programs  (Read 50216 times)

0 Members and 1 Guest are viewing this topic.

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BatLib Demo Programs
« Reply #60 on: April 12, 2011, 10:07:58 am »
Oh, I made Blockeat before I had a lot of the commands, so it can probably be optimised, now! I will have to look at the code later to figure out where everything is :/

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: BatLib Demo Programs
« Reply #61 on: April 12, 2011, 10:08:58 am »
Oh, I made Blockeat before I had a lot of the commands, so it can probably be optimised, now! I will have to look at the code later to figure out where everything is :/

I found out where everything was, and made lots of changes, I now have my customized BLOCKEAT :)

Offline mrmprog

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 559
  • Rating: +35/-1
    • View Profile
Re: BatLib Demo Programs
« Reply #62 on: April 25, 2011, 09:16:58 pm »
I just noticed the sprite editor a few pages back! I have been trying to make one in Recode but it did not work :(  Now I will see if I can make something cool in recode.

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BatLib Demo Programs
« Reply #63 on: April 25, 2011, 10:00:48 pm »
Sweet! Another vict-- er programmer for ReCode! As a note, the hex output was done with the aid of command 35 (GetSprite). I made that command in order to make obtaining sprite data easy. The output from that command can be used directly with command 53 for sprite data :)

Offline mrmprog

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 559
  • Rating: +35/-1
    • View Profile
Re: BatLib Demo Programs
« Reply #64 on: April 26, 2011, 08:30:28 pm »
Silly me, I didn't realize there was a getsprite command  :banghead:
Using the editor, I made some funny people sprites. I am going to make a game of sorts with them soon (hopefully).

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BatLib Demo Programs
« Reply #65 on: April 26, 2011, 08:46:59 pm »
Hehe, I hope you have fun! I have noticed that many of my programs are pretty much 50% BatLib commands and the rest is BASIC. I really tried to pack plenty of tools in there to make life easy :)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55941
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: BatLib Demo Programs
« Reply #66 on: April 29, 2011, 07:52:45 pm »
If I had the motivation, I would probably have tried to create a grayscale tilemapper in Batlib. Does the app have commands to recall pictures?  I don't remember and I didn't check the readme in ages. Recallpic in xLIB/DCS is what allowed grayscale to look decent enough with them, but batlib seems so much faster.

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BatLib Demo Programs
« Reply #67 on: April 29, 2011, 11:18:13 pm »
Yes, there is a recallpic function (called PicHandle). The fastest way for creating grayscale with BatLib is to actually use the command that draws sprite directly to the LCD. That isn't the most simple version, though... To give an idea, BatLib has all the tools to store a bunch of pictures in one file, then reading it from archive, you can cycle through each picture rapidly.

Also, ReCode has a RecallPic function, so that could prove pretty useful...

Here is an example I made while trying to make a scaled down main menu:

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BatLib Demo Programs
« Reply #68 on: October 02, 2012, 06:32:54 pm »
Necropost!

I decided that this program might be a good demonstration of BatLib's compression and decompression routines. It is currently included with BatLib and is called MultiComp. Basically, it attempts lossless compression on a file as much as possible with the BatLib commands. Decompression is fast, compression takes a bit longer just because it tests to see if the file can be compressed further. Anyways, screenshot:



prgmMLTICMP
Inputs: Ans is the name of the variable to compress
Outputs: Str1 is the compressed data, Ans is the compression ratio. 0 means no compression was possible.
Destroys: A,B,C,D,Str2,Str3,Str4,Str5

prgmMLTIDCMP
Inputs: Str1 (same as the output from prgmMLTICMP)
Outputs: Str2 is the uncompressed data
Destroys: A,B,Str1

It might be useful to write a version 2 of prgmMLTIDCMP that takes Ans as an input (as the name of a variable) and then it decompresses Str1 and stores it in the variable.

Download

Next up, now that I understand grayscale much better now, I shall see if I can make a grayscale image editor in BatLib BASIC.

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: BatLib Demo Programs
« Reply #69 on: October 02, 2012, 07:58:30 pm »
woo, it's looking awesome, great work!

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: BatLib Demo Programs
« Reply #70 on: October 02, 2012, 08:51:19 pm »
* yeongJIN_COOL wonders if Grammer and Batlib will be cross-compatible later
Sig wipe!

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: BatLib Demo Programs
« Reply #71 on: October 02, 2012, 08:58:15 pm »
they are already
* Sorunome pokes batlibs group hook

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Yeong

  • Not a bridge
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3739
  • Rating: +278/-12
  • Survivor of Apocalypse
    • View Profile
Re: BatLib Demo Programs
« Reply #72 on: October 02, 2012, 08:59:14 pm »
oh.

How many stuffs am I missing out while I was out XP
Sig wipe!

Offline Sorunome

  • Fox Fox Fox Fox Fox Fox Fox!
  • Support Staff
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 7920
  • Rating: +374/-13
  • Derpy Hooves
    • View Profile
    • My website! (You might lose the game)
Re: BatLib Demo Programs
« Reply #73 on: October 02, 2012, 09:01:05 pm »
Well, batlib has basicly a group hook, so you can hook grammer, omnicalc, celtic3 and (i think) dcs to it :D

THE GAME
Also, check out my website
If OmnomIRC is screwed up, blame me!
Click here to give me an internet!

Offline Xeda112358

  • they/them
  • Project Author
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 4704
  • Rating: +719/-6
  • Calc-u-lator, do doo doo do do do.
    • View Profile
Re: BatLib Demo Programs
« Reply #74 on: October 03, 2012, 06:40:59 am »
Well, the apps need to have 3 bytes of the header modified for it to work with group hook. Also, BatLib has a command to execute Grammer code :P