MaxCoderz

for your 1 bit pleasure!

All times are UTC




Post new topic Reply to topic  [ 210 posts ]  Go to page 1, 2, 3, 4, 5 ... 14  Next
Author Message
PostPosted: Thu 17 Nov, 2005 11:55 pm 
Offline
Calc King
User avatar

Joined: Sun 23 Jan, 2005 12:37 am
Posts: 1727
Location: Netherlands
[edit]

For anyone who's new to this:

The Ti calculator API is a set of macro's and routines that is assembled to make calculator programming in z80 more simple. Normally, you have to deal with all those pesky registers and Ti-OS routines, even if you just want to display a simple string. With the Ti API you just tell the API to output the string for you, and it'll do all the boring work!

More information: http://api.timendus.com

Original first post follows:

[/edit]


I've started working on an include file today, that will allow you to write something like this:

Code:
   graph.clear()
   graph.println(welcome)
   graph.println(type)
   graph.readln(buffer, 128)
   graph.print(think)
   graph.print(buffer)
   graph.println(think2)
   graph.readln(buffer, 128)
   string.compare(buffer,yes)
   jp   z,goyes
   string.compare(buffer,no)
   jp   z,gono
   graph.println(exit)
   graph.waitkey()
   ret

welcome:
   .db "Welcome!",0
type:
   .db "Type something useless:",0
think:
   .db "So you think ",0
think2:
   .db " is useless?",0
yes:
   .db "YES",0
no:
   .db "NO",0
exit:
   .db "Not playing along, are we? Leave then!",0
buffer:
   .fill 128,0

goyes:
   graph.clear()
   graph.println(well)
   ...
   ret

well:
   .db "You really think a lot of yourself, don't you?",0

gono:
   ...
   ret

And convert it to working code. This will ask you a few questions in the graph screen, and respond depending on whatever you type in.

I'm not sure if this is worth the name API, but I guess it's as close as it gets to one on a calculator :) And I must say it's a hell of a lot more fun to code simple things like in- and output in this way than in pure asm.

How it works
Nope, it's not object based, nope it doesn't add redundant code and nope you don't need a new compiler. The include file that I'm working on defines a few macros for TASM if you include this at the beginning of your file:

Code:
#define api_defines
#include "api.inc"

The ones that are more complex than a few lines call one of the routines that you include at the bottom of your file (or wherever you like) like this:

Code:
#define api_routines
#include "api.inc"

TASM will "know" which routines need to be included and which need to be left out based on the ones that you actually use, so it shouldn't clutter up your memory with useless code.

Commands that are currently understood by this "API":
Code:
Homescreen:
disp.clear()
disp.print(str)
disp.println(str)
disp.readln(buffer,maxsize)
disp.waitkey()
disp.newline()

Graphscreen:
graph.clear()
graph.print(str)
graph.println(str)
graph.readln(buffer,maxsize)
graph.waitkey()
graph.newline()

String:
string.compare(str1,str2)

I'm currently working on link.println(str) and link.readln(buffer,maxsize) to enable writing a string over the link port, but the Ti-OS routines don't seem to be willing... And I NEED to go get some sleep because I have to get on a bus to Germany in seven hours :(

The input routines are pretty crude at the moment. You can type in caps when you turn Alpha on, and space works, but that's about it. I hope to be able to use Ben's routines once he's done with his keyboard project, so that you can use just the Ti keyboard or also an external one by adding another define. Either way, it would be abstract to the programmer where the input comes from, as long as he gets some input from the API.

Anyway, my list of ideas (so far):
Code:
- Add word wrapping (it wraps already, also in the graphscreen, but not at words)
- More String routines (append,copy,etc)
- Better linking (get it working :)/faster/running in background/more than 2 calcs)
- file.read(filename) / file.write(filename,data) for programs
- var.read(varletter) / var.write(varletter,value) for A-Z vars
- str.read(strnumber) / str.write(strnumber,data) for str0-str9
- menu.choice(str1,str2) to give a choice between two things (return in z and a)
- menu.alert(str) to give an alert that goes away after a keypress
- menu.question(str) to ask "str? Yes/No" (return in z and a)
- menu.options(menu) to give a proper menu (.db 1,"Option one" \ .db 2,"Option two" \ ... \ .db $FF) (return in a)

I don't really plan on making all that myself, but since this is all just a collection of routines anyone can optimize it and add to the API once I release the source. I plan on making a simple website where you can download the latest version, and submit ideas/improvements et cetera.

Please let me know what you think, but don't expect any response from me untill after the weekend. (Convention in Germany, see my girlfriend, party in Groningen on saterday night, calc convention on sunday in Amsterdam... so much to do :)) Good night!

_________________
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


Last edited by Timendus on Fri 21 Jul, 2006 10:54 am, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 18 Nov, 2005 1:11 am 
Offline
Calc King

Joined: Sat 26 Mar, 2005 2:45 am
Posts: 1619
Location: your shadow
Sounds cool...except I don't understand it much...well, API like code is always a good thing to see I guess


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 18 Nov, 2005 2:38 am 
Offline
Calc Wizard
User avatar

Joined: Wed 06 Jul, 2005 4:56 pm
Posts: 518
Location: 3rd rock....
awsome idea :D too bad i dont prgm asm

_________________
(\__/)
(='.'=)This is Bunny. Copy and paste bunny into your
(")_(")signature to help him gain world domination.

Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 18 Nov, 2005 2:57 am 
Offline
Calc King
User avatar

Joined: Sat 18 Dec, 2004 6:46 am
Posts: 2932
I didn't understand too much :D, but sounds like it will be usefull.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 18 Nov, 2005 3:02 am 
Offline
Calc King

Joined: Sat 26 Mar, 2005 2:45 am
Posts: 1619
Location: your shadow
so, do you think you could explain this a little better for us with little to no asm understanding?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 18 Nov, 2005 3:34 am 
Offline
Calc King
User avatar

Joined: Sun 26 Dec, 2004 5:27 am
Posts: 2457
Location: SXIOPO = Infinite lives for both players
well basically rather than having to write the several lines of code for certain functions you simply have to remember macros. The benefits is it would be quicker to code simple interfaces that would normally take couple hours for inexperienced coder. Interface can be a time consuming part of coding, I can imagine this might speed things up a bit.


I hope you plan on include graphic routines.(Sprite, mapping)

How do you plan on handling a variable or constant? like say something like this:

Code:
   graph.println(pointer)

pointer:
 .dw somestring
Somestring:
 .db "Hello",0

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 18 Nov, 2005 4:37 am 
Offline
Calc Guru

Joined: Thu 27 Oct, 2005 8:28 pm
Posts: 962
wow, it cut's the esotericity out of ASM.

me likes, and me no likes

_________________
Image Image Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 18 Nov, 2005 6:09 am 
Offline
Maxcoderz Staff
User avatar

Joined: Tue 01 Nov, 2005 6:34 am
Posts: 342
Wow! I'm impressed. You're right... why had this never been done before?

_________________
Image - Now Under Development - [Progress]


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 18 Nov, 2005 6:44 am 
Offline
Calc King
User avatar

Joined: Sun 23 Jan, 2005 12:37 am
Posts: 1727
Location: Netherlands
Thanks :P

I've slept for the amazing amount of three hours because I couldn't stop thinking about this :x But anyway, here's some short answers before I go get my bus:

Jim e wrote:
I hope you plan on include graphic routines.(Sprite, mapping)

How do you plan on handling a variable or constant?

Well, the big idea is that everyone will be able to add and improve routines, it's like a replacement for that codebank idea that kv and I were working on a while ago, so yes I do expect sprite and mapping routines to be included in the near future :)
And at the moment you just give it a pointer to a string, and it displays it. To make a string with changing content, you could point it to a buffer and use the string routines (that haven't been made yet :)) to copy/paste some text in it. Or you could call the println routine "by hand".

necro wrote:
so, do you think you could explain this a little better for us with little to no asm understanding?

Well, think of it like this: in the final state where I hope to get, this include file would contain the combined knowlegde of half the community. So when writing a program you could rely on other people's routines, without having to copy them in and understand what it does. You only have to deal with the interface. In other words: ASM will become almost as simple to code in as Basic (except for if-statements and for-loops).

crzyrbl wrote:
awsome idea :D too bad i dont prgm asm

Maybe you will with this ;)

_________________
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 18 Nov, 2005 10:26 am 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
I've done something similar in the past, but it didn't get too far. ;)

TASM's macro system is pretty primitive... http://users.tkk.fi/~vhelin/wla.html might allow you more flexibility. (I've never tried building a TI-8? file in it though).

EDIT: I was writing a simple Z80 OS a while ago which has a bunch of string manipulation routines (reverse string, string->number, number->string, convert to hex, that sort of thing) - any use to you?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 18 Nov, 2005 3:49 pm 
Offline
Regular Member
User avatar

Joined: Tue 21 Dec, 2004 2:46 pm
Posts: 102
Location: Santa Clarita, California
I was working on a project similar to this, of doing an GUI API, but it's kind of on the back burner now...

_________________
--Steve Riekeberg
MaxCoderz Co-Founder, Ex-Staff Member
Image
http://www.missingintellect.net


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 18 Nov, 2005 5:00 pm 
Offline
Maxcoderz Staff

Joined: Fri 17 Dec, 2004 5:33 pm
Posts: 790
Location: On the dark side of the moon.
What does it add besides looking good and structured.?

_________________
"They say that sea was created by a man named Maarten Zwartbol, a long time ago...." - Duck, an old Corbin version


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 18 Nov, 2005 6:04 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 4094
Location: I cant seem to get out of this cryogenic chamber!
Isnt EZAsm supposed to be like this? (A set of macros).

_________________
"My world is Black & White. But if I blink fast enough, I see it in Grayscale."
Image
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 18 Nov, 2005 8:51 pm 
Offline
Calc Master
User avatar

Joined: Wed 22 Dec, 2004 3:07 am
Posts: 1454
Location: Through the Aura
EZAsm was pretty limited in its macros however.

_________________
Image


"You're very clever, young man, but it's turtles all the way down!"


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat 19 Nov, 2005 2:41 am 
Offline
Calc King

Joined: Sun 27 Mar, 2005 4:06 am
Posts: 2195
Location: sleeping
Kozak wrote:
What does it add besides looking good and structured.?

No offense, but all it will add is size and slowness. It may be a good way to start learning, but the code will be unoptimized.

_________________
Image


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 210 posts ]  Go to page 1, 2, 3, 4, 5 ... 14  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


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 post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB ® Forum Software © phpBB Group | DVGFX2 by: Matt