So, I've been having some question about xlibc lately, so here thay are! (only one for now)

How do I dispay a varible on the status bar in the Cse? I tried using real(6,1 but I couldn't get it to display where I wanted it to, top right corner of the screen in white.

Code:
real(6,1,5,1,255,T,1
the real(6,1 command is used like

Code:
real(6,1,x,y,color,*text*[,and if needed updatelcd]

so, it should look something like real(6,1,1,1,255,T
but, it will only work if the number stored in T is smaller than 10000, any larger numbers will give a dim error, you can always split it up like divide the number by 1000 and store that into some other variable, output the ipart(of that answer and output 1000*the number-1000*ipart(*the number*, I know it sounds complicated, i'll just make an example and edit this post once i'm done
edit: Okay so say I want to output T and the number stored in T is for example 621346. I would do:

Code:
621346->T
T/1000->T
real(6,1,1,1,255,ipart(T
1000T-(1000ipart(T->T
real(6,1,24,1,255,T

there ya go, it should be outputted at the top left of the screen in white Smile
mr womp womp wrote:

1000T-(1000ipart(T->T

1000fPart(T→T is a better way to do this. Great explanation otherwise Smile
Although Unicorn does seem to have been doing it correctly, so I'm curious as to why it didn't look right. Care to elaborate or share a screenshot, Unicorn?
Unicorn wrote:
I tried using real(6,1 but I couldn't get it to display where I wanted it to, top right corner of the screen in white.
When in half-resolution mode, xLIBC makes the screen 160 pixels wide and effectively 120 pixels tall, hence "half-resolution" mode. If you were drawing text without putting the calculator into half-resolution mode, you need to deal with the fact that the left half and the right half of the full-resolution LCD correspond to the two GRAM "buffers", if you will, used for half-resolution mode. In xLIBC, there's a command to switch the buffer you're using, and when you're in full-resolution mode, you're really switching between the two sides of the screen (and without tricks, you can't display things spanning the two sides). If you have the first GRAM buffer activated, X=0 is at the left edge of the full-resolution screen. If you have the second GRAM buffer activated, X=0 is at the middle (pixel X=160) of the screen. Try using SetLCDBuffer to set the other side of the screen (the right side, the second buffer) as the one you're using, then use real(6... again.
Welp, thanks for all your help, but I forgot I was in inverted colors mode. Razz So, I solved it myself.

Anyways, here's another question how can I remove the running indicator at the top right hand corner of the screen? I'm trying to make Cat Nipper and Caterite use the status bar, and I need to remove the run indicator to do that.
With xLIBC that is automatic done in half-resolution mode. Otherwise, you must find an ASM/Z80 code that will do that.
KermMartian wrote:
Unicorn wrote:
I tried using real(6,1 but I couldn't get it to display where I wanted it to, top right corner of the screen in white.
When in half-resolution mode, xLIBC makes the screen 160 pixels wide and effectively 120 pixels tall, hence "half-resolution" mode. If you were drawing text without putting the calculator into half-resolution mode, you need to deal with the fact that the left half and the right half of the full-resolution LCD correspond to the two GRAM "buffers", if you will, used for half-resolution mode. In xLIBC, there's a command to switch the buffer you're using, and when you're in full-resolution mode, you're really switching between the two sides of the screen (and without tricks, you can't display things spanning the two sides). If you have the first GRAM buffer activated, X=0 is at the left edge of the full-resolution screen. If you have the second GRAM buffer activated, X=0 is at the middle (pixel X=160) of the screen. Try using SetLCDBuffer to set the other side of the screen (the right side, the second buffer) as the one you're using, then use real(6... again.

oopsie, I must have read too quickly, he wanted it on the right side XO sorry bout that
Unicorn wrote:
Welp, thanks for all your help, but I forgot I was in inverted colors mode. Razz So, I solved it myself.

Anyways, here's another question how can I remove the running indicator at the top right hand corner of the screen? I'm trying to make Cat Nipper and Caterite use the status bar, and I need to remove the run indicator to do that.
In xLIB, switch to 160*240 then immediately switch back to full resolution mode without redrawing the status bar. This keeps the run indicator turned off.
Thanks for the tip, DJ.
So, the uservars, I don't understand them. Are they variables that are numbered as identification? I know how to use them (I think),I just want to know how they are selected.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement