[Featured][Beta] API - Why hasn't this been done yet?!
Moderator: MaxCoderz Staff
Exactely. The entire API isn't very flag or register friendly, nor does it state what gets destroyed and what not. You could see that as a flaw, but it hasn't really bothered me yet when coding with the API. I think that the entire idea is that you're fiddling with blocks of data and with hardware rather than with registers...
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
To answer this question:
That's why I wrote "why hasn't this been done yet?". On every other platform and language programmers have some form of libraries at their disposal, and all we have (had ) are some stupid includes that define some memory areas and romcalls. Those can't DO anything for you, they just memorize some numbers. But you can actually let the API do some WORK for you
Does using libraries in C make it another programming language? Does including other packages in Java make it another programming language? Of course it doesn't. With the API included, you're still programming in z80, but you rely on other routines to do the really down to earth boring things, like you would in any other serious programming language.calcul831415 wrote:If this is all for the API, why not make API into it's own language? Like a better version of EZASM and Basic?
That's why I wrote "why hasn't this been done yet?". On every other platform and language programmers have some form of libraries at their disposal, and all we have (had ) are some stupid includes that define some memory areas and romcalls. Those can't DO anything for you, they just memorize some numbers. But you can actually let the API do some WORK for you
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
Yes, you're right of course. The ION routines are the only exception. I'm sorry I forgot about them.
Anyway, "completed" is a pretty relative thing for this project I hope to see other people working on routines in the API long after I stop working on them myself
I'm still working on a few things to add at the moment, but at a very slow pace. Several other things currently have a higher priority.
Things I'm working on, in no particular order:
- Finally making that homescreen word wrap print routine
- Better/more key input (already have a few nice new routines to add on my PC, but need a few more)
- A graphical user interface (that DOESN'T resemble Windows in ANY way ) section (this has been my "secret" thing, because it's going to be really cool In fact, it already is, but a lot needs finishing)
- Link port routines with error handling shite (but I'm not sure how to do error handling with the TI-OS routines, could someone please tell me that?)
Anyway, "completed" is a pretty relative thing for this project I hope to see other people working on routines in the API long after I stop working on them myself
I'm still working on a few things to add at the moment, but at a very slow pace. Several other things currently have a higher priority.
Things I'm working on, in no particular order:
- Finally making that homescreen word wrap print routine
- Better/more key input (already have a few nice new routines to add on my PC, but need a few more)
- A graphical user interface (that DOESN'T resemble Windows in ANY way ) section (this has been my "secret" thing, because it's going to be really cool In fact, it already is, but a lot needs finishing)
- Link port routines with error handling shite (but I'm not sure how to do error handling with the TI-OS routines, could someone please tell me that?)
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
I just added the load macro to the API (I had forgotten all about it), and edited 74 routines to make use of it I have confirmed that the old demo still runs properly, so I guess I didn't make too many mistakes, and I'm going to bed now
If someone could confirm that the demo still works with the new api.inc when compiled with TASM that would be nice
If someone could confirm that the demo still works with the new api.inc when compiled with TASM that would be nice
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
I'll try to make a nice one soon
I'm not sure how the system should be used yet, so I'm still very much working on that (when I have the time ).
I'm not sure how the system should be used yet, so I'm still very much working on that (when I have the time ).
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
Here's the full code of this little game:
Code: Select all
init_all:
math.random(10) ; Random a number for the user to guess
ld (savesscreen),a
game:
graph.clear() ; Clean up the screen
gui.drawPlane(256*1+1,256*43+53) ; Draw three Planes
gui.drawPlane(256*46+1,256*93+9)
gui.drawPlane(256*46+12,256*93+53)
gui.print(256*2+48,str,50) ; Print two texts
gui.print(256*13+48,str2,40)
gui.resetChoices() ; Reset the choices pane
gui.setChoiceKeyHandler(myhandler) ; Add a keyhandler to the pane...
gui.addChoice(new,newgo) ; and three choices
gui.addChoice(quit,quitgo)
gui.addChoice(about,aboutgo)
gui.goChoices() ; Give execution to the choices pane
; Gets called by the choices pane if F1 is pressed
newgo:
jp init_all
; Gets called by the choices pane if F2 is pressed
quitgo:
ret
; Gets called by the choices pane if F3 is pressed
aboutgo:
gui.alert("Number Guess by Timendus as an API demo")
jp game
; Gets called by the choices pane if another button than F1-F5 is pressed
; a = Button pressed (getcsc-style)
myhandler:
cp $21
ld c,0
jr z,myhandler_checkvalue
cp $22
ld c,1
jr z,myhandler_checkvalue
cp $1A
ld c,2
jr z,myhandler_checkvalue
cp $12
ld c,3
jr z,myhandler_checkvalue
cp $23
ld c,4
jr z,myhandler_checkvalue
cp $1B
ld c,5
jr z,myhandler_checkvalue
cp $13
ld c,6
jr z,myhandler_checkvalue
cp $24
ld c,7
jr z,myhandler_checkvalue
cp $1C
ld c,8
jr z,myhandler_checkvalue
cp $14
ld c,9
jr z,myhandler_checkvalue
ret
myhandler_checkvalue:
push bc
int.decToString(savesscreen+1,c)
gui.print(256*2+3,myhandler_string,50)
graph.print(savesscreen+1)
pop bc
ld a,(savesscreen)
ld hl,good
cp c
jr z,myhandler_disp
ld hl,higher
jr nc,myhandler_disp
ld hl,lower
myhandler_disp:
gui.print(256*10+3,hl,40)
call ionFastCopy
ret
; Data
myhandler_string:
.db "You tried ",0
higher:
.db "Too low!",0
lower:
.db "Too high!",0
good:
.db "You guessed it! Congrats! :)",0
new:
.db "New",0
about:
.db "About",0
quit:
.db "Exit",0
str:
.db "Number guess",0
str2:
.db "Guess a number between 0 and 9!",0
I have not yet added those routines to the API, because they aren't 100% stable yet, and they can be improved/optimized/expanded. But what do you think?
Last edited by Timendus on Tue 16 May, 2006 6:10 pm, edited 1 time in total.
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
-
- Regular Member
- Posts: 86
- Joined: Fri 17 Dec, 2004 8:20 pm
- Contact:
Hey, good idea I'll add it some time soon!
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
Thanks for the compliments y'all
I'll add the gui stuff as soon as it's finished. That's probably in a few weeks time, because I have exams, projects, work, et cetera ahead in the coming weeks...
I'll add the gui stuff as soon as it's finished. That's probably in a few weeks time, because I have exams, projects, work, et cetera ahead in the coming weeks...
http://clap.timendus.com/ - The Calculator Link Alternative Protocol
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS
http://api.timendus.com/ - Make your life easier, leave the coding to the API
http://vera.timendus.com/ - The calc lover's OS