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

0 Members and 1 Guest are viewing this topic.

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 #210 on: October 21, 2013, 10:58:25 pm »
For real(10) I had this happen with every xLIB command or alone. It just failed to switch GRAM areas.

As for text failing to update GRAM too, I discovered why: It's because real(6 stores 0 to Ans, overwriting my string. The problem would be solved by making real(6 no longer return anything to Ans. It would solve many other problems too.

As for text changing some background colors if drawn over TI-OS material, it's most likely because xLIB uses 160x120 scaled up 2x and 256 colors instead of 320x240 with 65536 colors. I don't think much can be done about that. I never had the problem happen when drawing text over xLIB sprites/backgrounds/other text. It could definitively get in the way for certain programs utilizing TI-OS and Celtic drawing, but it could actually possibly become handy for special effects in the future. :P

Regarding InvertPixel failing to update GRAM area regardless of if using 0 or 1, here's the code I used:

Code: [Select]
real(0,1,1,0)
While 1
real(7,4,0,0,1)
For(Z,0,100:End
End

The 6 MHz issue is pretty much self-explanatory. The xLIB commands runs at 6 MHz by default no matter the real(0,2,mode syntax used.

For the garbage sprites/text issue, just remove the 160x120 res command at the top of ADEMO.8xp and see what happens.


For LCD Offset failing to change, this is my code:

Code: [Select]
real(0,1,1,0)
While 1
For(Z,0,319
real(8,1,Z)
End

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: xLIB 84C Edition
« Reply #211 on: October 24, 2013, 12:04:38 am »
Ok i have fixed a lot of bugs.

BUGFIXES:
---------
DRAWSPRITE transparent background now works for 16-bit colour backgrounds
DRAWSPRITE now sets and restores the LCD entry mode independently (can be used without 160 mode set)
DRAWSTRING stringlength fix (needs verification)
DRAWSTRING newline character fix
DRAWSTRING no longer destroys ANS
DRAWSTRING inherents DRAWSPRITE entry mode fix
SETGRAMOFFSET changed so that it independently alters the LCD (no updateLCD) *REQUIRES 160 mode to be set
DRAWMAP_GETSECTIONB fixed so that it reads uservars properly
DRAWSPRITETILEBGA/B fixed added x/y offset arguments before tile check
DRAWFILLEDRECTANGLE clipping boundry fixed

Also note that some of your issues were due to outdated documentation in the wiki (like the missing SIZE argument for get/set/invert pixel :S) that was also causing you some issues. Kerm has an updated version of the code so hopefully people have more luck with RC2.

I have tested DrawString and the LCD offset examples and they seem to work ok. Note that LCD Offset will only work while the calc is in 160 mode.

Drawing sprites and strings now works on the TIOS as well (without the need for 160 mode).
"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 #212 on: October 24, 2013, 01:02:21 am »
Wow that's cool to hear. By the way was the DRAWSTRING string lenght issue why I sometimes saw an extra ?Dec or something at the end of my strings? I noticed it once I think but I thought I just did some mistake since I didn't have it happen with very small ones like HELLO/WORLD. Also what does inherents DRAWSPRITE entry mode fix mean?

Glad the text command no longer stores to Ans btw. :) Will DRAWSTRING now accept TI-OS vars for X, Y and Color?


Also glad to see this SETGRAMOFFSET fix :). I am curious about what kind of stuff could be achieved by using it and by switching active GRAMs in ways that are not meant to be :) (I'm not getting my hopes up due to the nature of TI-BASIC and my lack of knowledge in xLIB sprite functionality, but we never know lol)


Are rectangles now faster btw or will they still draw in 2 seconds? Also will 15 MHz mode be set properly?


Also suggestion: Make xLIBC doc more visible on the DCS wiki (although I guess that would go more for Kerm). The only way I could ever find it when I went there was by typing xLIBC in the search box.

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: xLIB 84C Edition
« Reply #213 on: October 24, 2013, 02:40:27 am »
When i say it inherents the DRAWSPRITE fix i mean that text now can draw over a background as well without the colours messing up (like the statusbar gray etc).

Yes DRAWSTRING will accept TIOS vars for X,Y,Colour, i have just verified this on calc and in jsTIfied:



Note that 160 mode isnt supported, but the updateLCD flag is set so you can see it switching between GRAM areas each frame.

SETGRAMOFFSET only works if you are in 160 mode, otherwise it will do nothing. You no longer have to specify whether you want to updateLCD or not, it just shifts the screen. I have tested shifting both ways on calc and it appears to work ok.

Rectangles are now very fast and will draw in a split second, i have also included a FILLSCREEN function which will fill the active GRAM side with a colour fromthe xLIB palette.

Im sure Kerm will promote the wiki when DCS is released :).
« Last Edit: October 24, 2013, 02:41:28 am by tr1p1ea »
"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 #214 on: October 24, 2013, 02:51:00 am »
Ooh ok, I didn't know what "inherents" meant. Thanks for the clarification.

Also this is an awesome fix. I always wanted to be able to use variables to draw text in case I do animations or need to generate a menu or something. As for 160 mode not being supported, will this be fixed in the next release or will text only be useable in 320x120 mode from now on?

Glad to hear about the rest! :)

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: xLIB 84C Edition
« Reply #215 on: October 24, 2013, 03:04:09 am »
Oh sorry i mean that jsTIfied doesnt support 160 mode! DRAWSTRING works in both 320 and 160 mode! The screenie on a real calc shows it as 1 smooth animation from top left to bottom right, not 2 sides.

However it is confined to GRAM sections so you can only ever draw on 1 side of the screen in 320 mode, if that makes sense.
"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: Re: xLIB 84C Edition
« Reply #216 on: October 24, 2013, 09:18:28 am »
Oh I see now lol. By the way we can really decide on which section of the GRAM we want to draw, right? This would be handy if someone wanted to make a game using 320x120 resolution for higher details or if screen shifting is used.

Offline Streetwalrus

  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3821
  • Rating: +80/-8
    • View Profile
Re: xLIB 84C Edition
« Reply #217 on: October 24, 2013, 01:32:05 pm »
Please don't double post. This is considered spam and thus impolite. :trollface:
* Streetwalker runs

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 #218 on: October 24, 2013, 05:03:16 pm »
I am surprised this happened, considering I got no connection error O.O. Must have been the forum spazing out.

Also tr1p1ea I tried DCSE RC2 and WOAH xLIB rectangle speed is ridiculously fast now!! *.* (also variables usage in text argument works now)

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: xLIB 84C Edition
« Reply #219 on: October 24, 2013, 06:22:04 pm »
Yay!!

Glad that its working faster now, you can set which side to draw to GRAM by using the SetLCDBuffer function. You can set it to either 0 or 1. This can make it so you can draw to the nonactive (the part that you can see) side of GRAM.
"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: Re: xLIB 84C Edition
« Reply #220 on: October 24, 2013, 07:16:31 pm »
Thanks, so Mario would be possible? *.*

Also real(8,2,offset works now :D.

EDIT: Bug report: Real(10) still doesn't work. Nothing happens at all:

real(0,1,1,0
While 1
real(10
End


Also I was wondering if there would be a way to add a real(8,2,x command that is completely independent from active GRAM buffers?
« Last Edit: October 25, 2013, 12:16:03 am by DJ Omnimaga »

Offline tr1p1ea

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 647
  • Rating: +110/-0
    • View Profile
Re: xLIB 84C Edition
« Reply #221 on: October 25, 2013, 12:12:11 am »
Ill test this when i get home, it works fine in my debug build of xLIB. I will have to wait until i get home to try out RC2.

Also Mario is always possible, i have a small demo that i made months ago. I think AsmBandit is working on it though?
"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 #222 on: October 25, 2013, 03:31:30 am »
Weird.

Also another bug report: There seems to be some Getpixel lag occuring. If, for example, I fill the entire screen with a low value color (such as black), then draw light stuff afterward, Getpixel will still return the original black value. I am unsure why this happens, but basically I had a splash screen with a black background, then overwrote the entire screen (both GRAM buffers) with the road, yet it still returned the title screen bg color as getpixel value. I was using GetpixelB (xLIB palette). ???

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 #223 on: October 25, 2013, 12:52:21 pm »
wow seeing xLIB on a ti 84+CSE really makes me wish i've had one...  :(
(although personally i like programming axe better than xLIB but that's just me)
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 #224 on: October 25, 2013, 04:24:52 pm »
Yeah the issue is that with xLIB, due to the weird real commands, you always need to carry a copy of the instructions with you when coding because it's impossible to remember commands by heart.