Page 1 of 1

Splicing Xlib into a program

Posted: Thu 17 Nov, 2005 7:26 am
by L4E_WakaMol-King
Ok, I'm new to this site and relativly unfamiliar with Xlib, so if this suggestion makes no sense, feel free to ignore it. I haven't programmed anything in BASIC in a long time, so perhaps times have changed.

Right now, if I understand this project correctly, one needs to have Xlib on one's calculator to use the Xlib functions, right? If so, I had an interesting idea for a neat feature you might add. I don't know if it's even possible, but it would be cool if it were.

Could you create a program that splices the Xlib code into a basic program itself? Instead of having two programs, the actual program and Xlib, could they be combined into 1? Perhaps you could create a program that takes a finished BASIC program, write-protects it, and then adds the Xlib code right into the BASIC program itself, so that the Xlib functions could be used without another program present, and so that the developer could distribute just one single program?

I'm no expert with Z80, and I don't know much about apps (Xlib is an app now, right?)... so I don't know if this is even possible. But if it is, I think it would be a really neat addition.

The real questions at hand are: Can you put ASM and BASIC code into a single program? Obviously, you can't just cut and paste code, but is there any way that the two could be mixed into one unit? The other question is whether or not this would actually be useful enough to do, even if it were possible. That's up to you and the developers that use Xlib.

Anyway, I may look like a total moron for saying this, but if it's possible, I think it would be quite neat.

Posted: Thu 17 Nov, 2005 8:24 am
by tr1p1ea
Well i dont really think that is possible. Maybe with some serious hacking and slashing and would most likely end up being the equivilant of having ASM prgms which is slower than xLIB.

Its probably easier (especially for me :)) to just have it how it is ... installing xLIB isnt too hard is it?

Posted: Thu 17 Nov, 2005 1:13 pm
by dysfunction
It's really not that difficult to install... put it on your calc, open xlib, press 1, then 3. Done.

Posted: Thu 17 Nov, 2005 4:20 pm
by kalan_vod
If the person/noobs on ticalc can't figure it out then oh well! I make games/programs for my enjoyment only :D.

Posted: Thu 17 Nov, 2005 4:24 pm
by dysfunction
Now that many games are being written for xLib, people will grow more used to it, since they will need it to play hybrid games.

Posted: Thu 17 Nov, 2005 7:10 pm
by necro
dysfunction wrote:Now that many games are being written for xLib, people will grow more used to it, since they will need it to play hybrid games.
it would be cool if Xlib was a full fledge basic game shell

Posted: Thu 17 Nov, 2005 7:48 pm
by L4E_WakaMol-King
If it were, you might be able to implement some functions to run basic programs from the archive (or at least some sort of memory management program to copy only what is needed to RAM at a time).

Limited RAM combined with the inability to archive programs from other BASIC programs was always the thing I hated most about BASIC.

Posted: Thu 17 Nov, 2005 8:31 pm
by tr1p1ea
I dont see any real need to make it a shell, and the latest feature i implemented was the ability to run archived BASIC programs.

Posted: Fri 18 Nov, 2005 1:17 am
by necro
still, if it were that way then basic could be run like asm with mirage...as in crashes that don't erase your games...which would be the greastest change to basic since sprite libraries

Posted: Fri 18 Nov, 2005 1:53 am
by CompWiz
Actually, although I don't know the practicallity of L4E_WakaMol-King's idea, it sounds good. I give games to many people at my school, and they know very little about the calc. If a game's controlls are not immediately obvious, or the purpose of the game not very clear, no one will play it. Because of this, I can only give out the most basic and common games like phantom star, phenix, mario, uncle worm, tetris, etc. I would hate for many people to miss out on great xlib games because you have to install something.

Posted: Fri 18 Nov, 2005 2:41 am
by necro
which is why an available xlib "shell" would be awsome...plug and play for the peons.

Posted: Fri 18 Nov, 2005 4:31 am
by Liazon
i agree with CompWiz. Most ppl at my school don't like having extra programs. It's apparently not very cool to have to scroll through so many program names. But hey, it's just one extra program. (i think most ppl will forget to turn it off that's all, esp. when they're not suppose to play in class)

Posted: Fri 18 Nov, 2005 5:47 am
by L4E_WakaMol-King
That was why I made the suggestion... Using Xlib is easy if you know what you are doing with a Calc, but if you dont know--and the majority of people who just fiddle with their calcs in math class don't--it can be troublesome.

Posted: Fri 18 Nov, 2005 4:23 pm
by kalan_vod
It would be really cool to have it just basic programs app., like you guys said where you could select that program and then it would install the hooks and what not, then when you exit the game you close the hooks/uninstall but it does it atuomaticly.