MaxCoderz

for your 1 bit pleasure!

All times are UTC




Post new topic Reply to topic  [ 210 posts ]  Go to page Previous  1 ... 9, 10, 11, 12, 13, 14  Next
Author Message
 Post subject:
PostPosted: Tue 27 Dec, 2005 11:12 pm 
Offline
Calc King
User avatar

Joined: Sun 23 Jan, 2005 12:37 am
Posts: 1727
Location: Netherlands
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed 04 Jan, 2006 11:37 am 
Offline
Calc King
User avatar

Joined: Sun 23 Jan, 2005 12:37 am
Posts: 1727
Location: Netherlands
To answer this question:

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?


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.

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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed 04 Jan, 2006 6:13 pm 
Offline
Calc King
User avatar

Joined: Sat 18 Dec, 2004 6:46 am
Posts: 2932
But doesn't ions' routines give us some routines at our disposal? Of course yours is a lot easier to use, but I just wanted to make sure Ion isn't left out :P. Btw I can't wait till you have this completed as it is already amazing!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed 04 Jan, 2006 11:15 pm 
Offline
Calc King
User avatar

Joined: Sun 23 Jan, 2005 12:37 am
Posts: 1727
Location: Netherlands
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 :P 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 :mrgreen:) section (this has been my "secret" thing, because it's going to be really cool :P 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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon 09 Jan, 2006 11:19 pm 
Offline
Calc King
User avatar

Joined: Sun 23 Jan, 2005 12:37 am
Posts: 1727
Location: Netherlands
I just added the load macro to the API (I had forgotten all about it), and edited 74 routines to make use of it :P 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 :mrgreen:

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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue 10 Jan, 2006 12:05 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
Timendus wrote:
- A graphical user interface (that DOESN'T resemble Windows in ANY way :mrgreen:) section (this has been my "secret" thing, because it's going to be really cool :P In fact, it already is, but a lot needs finishing)
Any screenshots, so we can, uh, verify this non-Windows look? ;) Sounds very cool!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue 10 Jan, 2006 4:50 pm 
Offline
Calc King
User avatar

Joined: Sun 23 Jan, 2005 12:37 am
Posts: 1727
Location: Netherlands
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 :)).

_________________
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: Wed 11 Jan, 2006 8:44 pm 
Offline
Calc King
User avatar

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

Here's the full code of this little game:
Code:
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


This code alone compiles to 384 bytes, and the API routines about triple that.

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? :)

_________________
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 Tue 16 May, 2006 6:10 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed 11 Jan, 2006 9:47 pm 
Offline
Calc King
User avatar

Joined: Sat 18 Dec, 2004 6:46 am
Posts: 2932
Nice.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed 11 Jan, 2006 10:07 pm 
Offline
Regular Member

Joined: Fri 17 Dec, 2004 8:20 pm
Posts: 86
Slick.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu 12 Jan, 2006 7:11 am 
Offline
MCF Legend

Joined: Mon 20 Dec, 2004 8:45 am
Posts: 1601
Location: Budapest, Absurdistan
What about a coordinate macro? pt(x,y) -> x*256+y

_________________
The Independent Z80 Assembly Guide
Acelgoyobis
PindurTI


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu 12 Jan, 2006 8:34 am 
Offline
Calc King
User avatar

Joined: Sun 23 Jan, 2005 12:37 am
Posts: 1727
Location: Netherlands
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu 12 Jan, 2006 12:04 pm 
Offline
Maxcoderz Staff
User avatar

Joined: Thu 16 Dec, 2004 10:06 pm
Posts: 3064
Location: Croydon, England
Looking very nice!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Fri 13 Jan, 2006 3:22 am 
Offline
Sir Posts-A-Lot

Joined: Wed 12 Oct, 2005 10:46 pm
Posts: 171
add the gui stuff to the api!

_________________
Free Pencil-thin Ipod!
Image
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat 14 Jan, 2006 11:04 pm 
Offline
Calc King
User avatar

Joined: Sun 23 Jan, 2005 12:37 am
Posts: 1727
Location: Netherlands
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...

_________________
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  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 210 posts ]  Go to page Previous  1 ... 9, 10, 11, 12, 13, 14  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


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