http://api.timendus.com
Well here is the code a day late.


Code:

:DEFHDR.HDR
:BCALL RCLANS
:BCALL CONVOP1
:CP 1
:JR Z,TI
:CP 2
:JR Z,RION
:CP 3
:JR Z,RIOFF
:CP 4
:JR Z,CLR
:CP 5
:JR Z,ND
:CP 6
:JR Z,PAUSE
:CP 7
:JR Z,POWERD
:CP 8
:JR Z,GINV
:JR NZ,DONE
:TI:
:LD A,(IY+TEXTFLAGS)
:XOR 00001000B
:LD (IY+TEXTFLAGS),A
:JR DONE
:RION:
:BCALL RUNINDICON
:JR DONE
:RIOFF:
:BCALL RUNINDICOFF
:JR DONE
:CLR:
:BCALL CLRLCDFULL
:JR DONE
:ND:
:RES 5,(IY+0)
:JR DONE
:PAUSE:
:BCALL GETKEY
:JR DONE
:POWERD:
:DI
:LD A,001H
:OUT (003H),A
:LD A,000H
:OUT (004H),A
:EI
:HALT
:RES 4,(IY+9)
:JR DONE
:GINV:
:LD BC,768
:LD HL,PLOTSSCREEN
:GILOOP:
:LD A,(HL)
:CPL
:LD (HL),A
:INC HL
:DEC BC
:LD A,C
:OR B
:JR NZ,GILOOP
:BCALL GRBUFCPY
:DONE:
:RET


And the printf does seem a little complicated. But i will see what i can do later on.
Since all you have after "done" is ret, you can replace all the "jr done"s with "ret"s
125 bites before. 117 after.
Also to save space and make it faster do:

Code:
:DEC A
:JR Z,TI
:DEC A
:JR Z,RION
:DEC A
:JR Z,RIOFF

etc.
And in your routines you can take advantage of the fact that a will be 0 when they are called.
Thanks. That knocked off six more bytes. I tried adding in the input routine but i was having trouble. What happens is it displays wierd characters. And yes i realize i already asked this in another topic but it is the same exact code and it still isnt working.


Code:

:LENGTH9872  <-- Put length in appbackupscreen.
:DEFHDR.HDR
:BCALL CLRLCDFULL
:LD A,1
:LD (LENGTH),A
:LD HL,0
:LD (PENCOL),HL
:SET 4,(IY+18)
:INPUT:
:BCALL GETKEY
:SUB 09AH  <--09ah should be kA
:LD H,0
:LD L,A
:LD DE,JUMPTABLE
:ADD HL,DE
:LD A,(HL)
:BCALL PUTC
:LD A,(LENGTH)
:INC A
:CP 8
:RET Z
:LD (LENGTH),A
:JP INPUT
:JUMPTABLE:
:.DB 'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'
Those should be quotation marks if you're using my assembler, not apostrophes. Wink
That fixed it a little. Now whenever i type a string the first letter is correct but the rest are messed up.

Edit: Got that fixed. Now i just have to figure out how to write the data to str0.
I changed the code a little so that the string isnt set to a limited length. I also made it so you can press del and it will go to the previous character so you can overwrite it. Here is the code i am using.


Code:

:LENGTH9872  <-- Put length in appbackupscreen.
:DEFHDR.HDR
:BCALL CLRLCDFULL
:LD A,1
:LD (LENGTH),A
:LD HL,0
:LD (PENCOL),HL
:SET 4,(IY+18)
:SET 6,(IY+18)
:SET 2,(IY+12)
:INPUT:
:BCALL GETKEY
:CP 05H
:JP Z,SAVE
:CP 0AH
:JR Z,DEL
:SUB 09AH  <--09ah should be kA
:LD H,0
:LD L,A
:LD DE,JUMPTABLE
:ADD HL,DE
:LD A,(HL)
:BCALL PUTC
:LD A,(LENGTH)
:INC A
:LD (LENGTH),A
:JP INPUT
:JUMPTABLE:
:.DB "A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"
:DEL:
:LD A,(LENGTH)
:DEC A
:LD (LENGTH),A
:LD A,(CURCOL)
:DEC A
:LD (CURCOL),A
:JP INPUT
:SAVE:
:RET


To save it i think i have an idea on how to do it. Would i check for str0 delete it if it exists, then load a with length then bc with a. Then do an ldir.

Edit: I am having trouble getting it to delete str0. For some reason it just wont. The code i am using to try and do it is:


Code:

:LD HL,STR0
:BCALL MOV9TOOP1
:BCALL CHKFINDSYM
:JR C,CS
:BCALL DELVAR
:CS
:RET
:STR0:
:.DB STRNGOBJ,TVARSTRNG,TSTR0,0
You can replace the BCALL to mov9ToOP1 with a rst 20h, save two bytes. I dunno about the rest, though. TI-OS' token scheme is strange and evil.
Alright i will replace that. But what has me confused is it should be working according to the documentation on wikiti.
It looks perfectly fine to me as well; I see no reason why that wouldn't work,
Since i am having problems with the text input routine i am just going to upload the api as it is now and come back to it later after i expand my knowledge of asm. This way i dont get to frustrated or anything and "accidentaly" delete it from my calculator or computer.

Edit: Here is the link to download my the finished api as it is now. I am also uploading it to ticalc.org so the members on this site and united ti will get to use it first hand instead of waiting for ticalc to upload it.

The program: http://lafferealm.awardspace.com/LBAPI.8xp
The readme: http://lafferealm.awardspace.com/ReadMe.doc

all you have to do is right click and save as. I would have uploaded them as a zip but filezilla wouldnt let me.
a few Suggestions
1. have invert text and uninvert text as two comands (it is apain if the flag gets changed by a string input) ex. my lightning game
2. black screen
3. Finish sprite routine!!!!!!
1. It saves space to keep it as one command. And if it gets reset all you have to do is run the command again.
2. That is in there. It is the inverse graph command
3. Will get to that.
1. What if you don't know if it was changed because it doesn't always do it
2. That inverts the screen but it there is text or sprites you have to clear it first so I need to use two comands where I could use one (recallpic1)
3. Hurry up Just Joking
1. Will do once first version gets uploaded
2. I will make that another command.
3. I have sort of abandoned this because of difficulty, and is way beyond my skill
Pitiful..
{X,Y,H} in L6, data in Str0
6:prgmAPI (or whatever) where X is the X coordinate, Y is the Y coordinate, H is the height, and data is 2H bytes in length.

Code:

.include "putspritexor.asm"  ;find yerself a putsprite routine (ION is a good source)
;find L6, and get hl pointing to the first byte of data-9
 ld b,3
loop:
 ld de,9
 add hl,de
 rst 20h ;mov9ToOP1
 BCALL ConvOP1
 push af
 djnz loop
;find Str0 and point HL at it
 pop af
 push af
 ld de,appBackUpScreen ;just some scrap RAM
death:
 push bc
 ld b,2
makehex:
 ld a,(hl)
 sub '0'
 cp 10
 jr c,saveA
isAtoF:
 sub 'A'-'0'
stabby:
 rla
 rla
 rla
 rla
 rla
 rlc ixh
 rla
 rlc ixh
 rla
 rlc ixh
 rla
 rlc ixh
 inc hl
 djnz makehex
 pop bc
 djnz death
 ld a,ixh
 ld (de),a
 inc de
 pop bc
;now just run your putsprite routine with the data we saved on the stack and with ix pointing to appBackUpScreen

OK, so that's not very elegant and needs to be optimized, but it's not that hard.
@Tari I should have had you make a lib for me you could have done it in one class period Just Joking

Edit: I may just have to look around ticalc to see if any other small libs have the few functions i wand or you can check their source codes.
  
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 2 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