how would i make an api for my calculator. I know how i would do the routines but how could i check what x is equal to.
Could you please restate the question? Confused

I think you mean tell whether a button is selected, but I am not sure...
he wants to write an Asm lib and get the value of a system variable.

Code:
bcall _rclx
bcall _convop1

That will put X into the accumulator. I believe the Ans variable would be better, however.
Lafferjm, check out my InstCirc2 program for a method to read from the Ans if it is a list, so that you can have multiple arguments instead of just one

http://www.ticalc.org/archives/files/fileinfo/385/38591.html (source is included, of course Smile )
thanks. i took a look at it but the code was formatted in a way to difficult to understand and i did not feel like going through and pushing enter whenever i thought that a line was ended.
huh? the code is formatted correctly, although its indented, thats all. not sure what you were looking at... (its the file program.asm in the source/ folder)

replicated here:


Code:
      ;rcl ans and check its a list
      bcall(_rclans)
      ld a, (hl)
      cp ListObj
      ret nz
      
      ;make sure dim(list = 3
      ld a, (de)
      cp $03
      ret nz
      
      ;inc past the size info and save HL
      ex de, hl
      inc hl
      inc hl
      push hl
      
      rst $20
      bcall(_convop1)
      ld (AppBackupScreen + 1), a
      
      ;restore HL and add 9
      pop hl
      ld de, 9
      add hl, de
      push hl
      
      rst $20
      bcall(_convop1)
      ld (AppBackupScreen), a
      
      ;restore HL and add 9
      pop hl
      ld de, 9
      add hl, de
      
      rst $20
      bcall(_convop1)
      
      ld c, a
      ld de, (AppBackupScreen)
      
      call FastCircle
      bcall(_grbufcpy)
      ret
the code itself was fine. but when i opened it up in notepad and turned on word wrapping it was hard to tell where a new line was. that is what i meant by formatting. sorry for the confusion and thanks for putting code above. Smile
Well thanks to some help from Iambian and tifreak i have now started to create my api. And calc84 i'm sure you will be glad to hear that i am using your oncalc assembler to make it, that way i can work on it at school. Very Happy

Functions that i have added so far are:

pausing
runindicator off
runindicator on
clearing the screen
turning off done
text inverse

If you can think of anything i can add please tell because i am having trouble coming up with more things.
Cool, nice work. Maybe there could be something that inverses all of the pixels on the screen?
Also turning the calculator off...
Powering down is now added. All i have to do now is figure out how to invert the screen.
There are ways to do it in basic but a faster way would actually be practical in games
Very Happy
Graph screen inverting is now added. All i have to do now is make it so when you turn the calculator back on you don't get an occasional error:break message. Once i get that fixed i am going to try and recreate my input routine and have it store the input to str1.
Sweet mabe i'll use that invert function for my lightning game menu to beef it up a bit so i dont need the white boxes around text. Very Happy
Thanks to the folks on #tcpa i was able to fix the probelm i was having with the power off routine. Now all i have to do is finish my text input routine and add it. Then i will have to think of other things to add.
graphing abilites like sprite support - maybe drawing with hex from a string instead of a section of a picture.

This would probably be a little hard, but a 'printf' style function would be sweet
Oh, and PLEASE post your ASM code here so we can optimize it.
KermMartian wrote:
Oh, and PLEASE post your ASM code here so we can optimize it.


Will do as soon as i get home. And kllrnohj can you please explain the "printf". Sprites will be the next thing after text input. I also didn't think i would get this much support for something like this.
lafferjm wrote:
And kllrnohj can you please explain the "printf". Sprites will be the next thing after text input. I also didn't think i would get this much support for something like this.


http://en.wikipedia.org/wiki/Printf
  
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 2
» 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