Author Topic: xLIB 84C Edition  (Read 50777 times)

0 Members and 2 Guests are viewing this topic.

Offline Keoni29

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2466
  • Rating: +291/-16
    • View Profile
    • My electronics projects at 8times8
Re: xLIB 84C Edition
« Reply #225 on: October 25, 2013, 04:30:00 pm »
Even with ASM programming I need to look stuff up all the time and those instructions make more sense than just numbers. I hope more games will come out for the CSE soon. Once I got a 3ds, new pc and an hp prime I might consider buying a CSE :)
« Last Edit: October 25, 2013, 04:30:22 pm by Keoni29 »
If you like my work: why not give me an internet?








Offline TheCoder1998

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 434
  • Rating: +20/-2
  • my art is written in code, not in graphite
    • View Profile
    • My website :D
Re: xLIB 84C Edition
« Reply #226 on: October 26, 2013, 03:46:58 am »
yeah, i'm still learning axe, so i need my copy of commands all the time too.
but it was noticably present when i tried programming with the Doors CS SDK
« Last Edit: October 26, 2013, 03:47:17 am by TheCoder1998 »
my ticalc acc:

http://www.ticalc.org/archives/files/authors/113/11365.html

Spoiler For The Best Song Ever:


follow me on tumblr :)
www.rickdepizza.tumblr.com

check out my anilist :D
http://anilist.co/animelist/29701/Rickdepizza

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Re: xLIB 84C Edition
« Reply #227 on: October 26, 2013, 07:26:25 am »
Yeah at first I had this happen when I coded Axe, but the syntaxes are much shorter and verbose in general than just a big bunch of real commands and full of numbers. That said I find BASIC and its libs easier when it comes to external save data management.


EDIT: Feature suggestions besides the movable GRAM buffers and full screen buffers (well, rather getting rid of them as an option):

-Inverted circles and inverted filled circles.

Also question, can the sprite appvar be archived and how many xLIBC vars can we have in total? It would be nice if we had 999 vars or more.
« Last Edit: October 26, 2013, 06:34:26 pm by DJ Omnimaga »

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: xLIB 84C Edition
« Reply #228 on: October 27, 2013, 03:57:46 pm »
I had some issues with circles but I can look into it.

Yes the appvar can be archived and there are 256 uservars. Sadly 999 of them would take 1988 bytes.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: xLIB 84C Edition
« Reply #229 on: October 27, 2013, 08:35:40 pm »
Ah ok I see. I was hoping for maybe more vars since otherwise I would need to rely on a 9 KB large (temporary) list >.<. I might have an idea, though.
« Last Edit: October 27, 2013, 08:36:16 pm by DJ Omnimaga »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: xLIB 84C Edition
« Reply #230 on: October 28, 2013, 03:20:00 pm »
One bug I forgot to mention is that the real(0,3,3 command does the opposite of what it's supposed to do. Instead of setting the LCD to a non-inverted state like the description claims, it actually sets it to inverted mode.

Also feature suggestion: A different text command that allows you to display variable content (TI-OS real vars and xLIB ones). Having to convert vars to string is a major hassle and isn't very fast >.<

Also sprites are pretty fast it seems. :D
« Last Edit: October 28, 2013, 03:31:15 pm by DJ Omnimaga »

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: xLIB 84C Edition
« Reply #231 on: October 28, 2013, 05:18:11 pm »
Ok cool ill check out the colour restore, hopefully its something simple.

And yay at least sprites are not dreadfully slow :X!

Did you manage to get the large sprite working? (((((((((Is there any progress on that program you were hopeful of making?)))))))))
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: xLIB 84C Edition
« Reply #232 on: October 28, 2013, 05:59:31 pm »
Yeah I got it to work. I used both versions, but yeah mine had wrong colors so I used yours. You should write some sort of tool that automatically remaps bitmap colors to xLIB ones, like some softwares can do, so we don't have to switch to different softwares (I don't like GIMP and don't use Photoshop/etc). I don't want to make you have to convert every sprite I'll make for me >.<.

As for the program itself, one major hurdle is that there are only 255 user vars, so I might be forced to use TI-OS lists and the game will require almost the entire RAM to run. >.< (I need about 700 elements, although with TI-OS lists I might be able to cut this down by half by using decimals). I could always shorten my levels, though.

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: xLIB 84C Edition
« Reply #233 on: October 28, 2013, 06:47:19 pm »
I guess i can try to match colours to xLIB ones, it may result in quality loss to images however. The best way for me to do it will be with nearest colour i think.
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: xLIB 84C Edition
« Reply #234 on: October 28, 2013, 10:45:09 pm »
Yeah nearest colors would be the best. I don't mind the quality loss btw (although I assume that converting images with lots of gray will be a problem, since xLIBC palette has no gray)

« Last Edit: October 29, 2013, 02:56:31 pm by DJ Omnimaga »

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: xLIB 84C Edition
« Reply #235 on: October 29, 2013, 02:56:36 pm »
By the way I got maps to work, so that's good. One nice feature would be a fill command to draw a tilemap made of just one kind of tile. Right now here's what I am using:

"0808080808
Ans+Ans+Ans+Ans
Ans+Ans+Ans+Ans+Ans
Ans+Ans+Ans->Str0
For(Z,0,1
real(3,0,0,0,20,10,0,0,19,14,1
End

This fills the entire screen with sprite 08, but as you can see, that requires plenty of string concatenation at the start, so it isn't super fast. (Not to mention the TI-OS glitches that can occur with string concatenation). It would be cool if we could just do something like this instead:

real(3,8,MAPWIDTH,XSTART,YSTART,XEND,YEND,PICINDEXSTART,TILEID,UPDATELCD):
Which would give
real(3,8,20,0,0,19,14,0,8,1
Or maybe:

"08"->Str0
real(3,8,X,Y,MAPWIDTH,XSTART,YSTART,XEND,YEND,PICINDEXSTART,PICINDEX,UPDATELCD)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: xLIB 84C Edition
« Reply #236 on: October 31, 2013, 12:37:18 am »
Question:

In which order are sprites chained? For example, if I want to draw a character that is not aligned with the tilemap and need to redraw the 4 tiles behind it, in which order should I draw the ball? Should it be drawn first or afterward? Just making sure in case chained sprites are displayed in the opposite order.

The best thing would have been if there was a clipboard feature in xLIB to copy a 8x8 chunk of the screen, so that it makes it much easier to erase character sprites that are not perfectly aligned with the 8x8 grid.

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: xLIB 84C Edition
« Reply #237 on: October 31, 2013, 12:51:34 am »
Ill have a look into the fillscreen with sprite feature, though i cant make any promises at this stage.

Sprite chaining just draws whatever list you pass to it in sequential order.

Restoring backgrounds should be done on 'old frames' as a way to prepare them for new drawing etc. the drawSpriteTileBG will take care of aligning tiles to their position on screen ... or are you talking about tiles that arent locked to 8x8 chunks of the screen (like you are drawing your own sprites for tiles?)
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."


Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: xLIB 84C Edition
« Reply #238 on: October 31, 2013, 03:13:52 am »
Oh I mean that my sprite (the character that is moving around) isn't aligned on the 8x8 grid. I worried that I would need to redraw all 4 tiles behind it every frame, and knowing that this calc is a bit slow to draw stuff due to the slow processor, I wanted as less stuff to be redrawn as possible each frame.

Also a bug report: real(1,2 and real(1,3 doesn't do anything and displays the wrong value D:. For example, in the wiki:

AddToUservar

real(1,2,Uservar_Num,Value): Add Value to the value of the given Uservar
SubFromUservar

real(1,3,Uservar_Num,Value): Subtract Value from the value of the given Uservar

However, if I want to modify uservar number 127 and add 2 to it every loop, instead of displaying its new value, it just displays 127. O.O

real(1,1,127,50
For(Z,0,150
real(1,2,127,2
Output(1,1,Ans
End

Or could the wiki info be outdated? ???
« Last Edit: October 31, 2013, 03:15:04 am by DJ Omnimaga »

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: xLIB 84C Edition
« Reply #239 on: November 03, 2013, 03:36:28 pm »
Hi DJ, the add/sub functions dont return the value of you operation, rather they return the uservar number you are modifying.

You need to use the GET function in order to store the number to Ans.

So the code would be:

real(1,1,127,50
For(Z,0,150
real(1,2,127,2
real(1,0,127
Output(1,1,Ans
End

This is because other functions take uservar references, so you can tie them together.

You can optimise the line to:

real(1,0,real(1,2,127,2
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."