Author |
Message |
|
Job the GameQuitter
Member
Joined: 04 Jun 2003 Posts: 102
|
Posted: 14 Jun 2003 07:24:14 am Post subject: |
|
|
Note: If you don't care why I'm asking this, skip to the last paragraph, that's were I ask the question .
Okay, this is the situation: I'm writing an APP about Langton's Ant. I plan to add a multitude of features (justifying making it an APP ), like greyscale, multiple ants, customizable ant behaviour (per individual ant), customizable window size, etc.
After some pondering I've concluded that the most efficient way to handle all the different possible combinations of "rulesets" for this simulation was to use SMC. Which, as we all know, isn't really an option in an APP .
So I had this idea: when the APP creates a new simulation, it actually creates an ASM program. When you change the options you actually modify the content of the program (to be precise, you modify how the program uses SMC), and when you run the simulations you run the program. As an added benefit the program would function as a save file.
And here's the question: how does one run ASM programs from an APP? I assumed you guys could help, since you're making a shell. Or is this kind of information confidential. |
|
Back to top |
|
|
62 52 53 53 Formerly known as 62 52 53 53
Active Member
Joined: 30 May 2003 Posts: 607
|
Posted: 14 Jun 2003 09:31:58 am Post subject: |
|
|
hah! confidential! only TI would be so evil. |
|
Back to top |
|
|
David The XORcist!
Advanced Member
Joined: 20 May 2003 Posts: 268
|
Posted: 14 Jun 2003 11:37:56 am Post subject: |
|
|
It is possible to run asm programs from an app. But requires approx. 600 bytes of nearly incomprehensible asm code (my own experience) to get it working properly.
But I suspect this isn't exactly what you are or think you are looking for. It would be possible to accomplish "rulesets" using saferam vars. I don't know the exact structure of your program, but if you want to use SMC anyway, try loading it to SaveSScreen or some other saferam location and you'd be able to. |
|
Back to top |
|
|
Job the GameQuitter
Member
Joined: 04 Jun 2003 Posts: 102
|
Posted: 14 Jun 2003 01:42:07 pm Post subject: |
|
|
I already got the same advice on the Maxcoderz forum. Problem is, the routine is too big for that.
Another option would be to let the APP only create the program, then run it seperately. In that case, the question would be how to modify the content of a program.
Anyway, NimbusOS is supposed to run programs from the App, isn't it? So someone here knows and understands how to do this, right? Right? (suddenly, I feel kind of awkward about trying NimbusOS)
Last edited by Guest on 14 Jun 2003 01:44:11 pm; edited 1 time in total |
|
Back to top |
|
|
Darth Android DragonOS Dev Team
Bandwidth Hog
Joined: 31 May 2003 Posts: 2104
|
Posted: 14 Jun 2003 03:29:34 pm Post subject: |
|
|
theyre not executable, but u could store data 2 and appvar, and interpret it |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 14 Jun 2003 06:02:09 pm Post subject: |
|
|
and then, u could try nailing jello to a tree technically, appvars aren't executeable, but if u load the data into an asm prgm, then u can execute it! |
|
Back to top |
|
|
Job the GameQuitter
Member
Joined: 04 Jun 2003 Posts: 102
|
Posted: 14 Jun 2003 07:52:21 pm Post subject: |
|
|
Last post was me. Forgot to log in. |
|
Back to top |
|
|
NETWizz Byte by bit
Bandwidth Hog
Joined: 20 May 2003 Posts: 2369
|
Posted: 15 Jun 2003 04:36:23 am Post subject: |
|
|
Adm.Wiggin wrote: and then, u could try nailing jello to a tree technically, appvars aren't executeable, but if u load the data into an asm prgm, then u can execute it!
If you allocate memory in Usermem and then Nail the contents of the appvar there, then jump or call usermem, you will run the code.
In otherwords, the only difference from a program and an appvar is the symtable entry...the wraper.
All you have to do to change them is use _chkfindsym then ld a,var type number/ld (hl),a ;change var type.
This is how you protecte and unprotect programs, as well as how Justins program>AppVar works. |
|
Back to top |
|
|
Job the GameQuitter
Member
Joined: 04 Jun 2003 Posts: 102
|
Posted: 16 Jun 2003 10:31:11 am Post subject: |
|
|
Thanks for the info, but I already knew this (thanks to CoBB's tutorials) . So, if I'm not mistaken, to run a program from ann App I need to:
A: Allocate the usermem to run the program.
B: Save the adress of the routine I want to run once the program ends on the stack. (this works because programs end with a RET, thus jump to the last adress saved on the stack before running the program)
C: Copy the program to usermem and run it (eg JP 9D95h)
D: Once the program ends, run a routine to restore the memory to it's original state, or the TI-OS goes .
B doesn't require difficult coding, and C is just a matter of searching the SymTable for the program's start, followed by an LDIR. I don't know how to do A and D, though. Can anyone help me out?
Last edited by Guest on 16 Jun 2003 10:31:35 am; edited 1 time in total |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 18 Jun 2003 05:27:29 pm Post subject: |
|
|
y dont u look at ptools from Cirrus Programming? look at the source for the ZRun module... is that what u needed? |
|
Back to top |
|
|
Job the GameQuitter
Member
Joined: 04 Jun 2003 Posts: 102
|
Posted: 19 Jun 2003 10:57:42 am Post subject: |
|
|
I think it is. It's going to take me some time to understand the code, and what part of the code I need, but thanks . |
|
Back to top |
|
|
Adm.Wiggin aka Tianon
Know-It-All
Joined: 02 Jun 2003 Posts: 1874
|
Posted: 19 Jun 2003 11:37:50 am Post subject: |
|
|
just skip the loading the var part, and go strait to the exec part... |
|
Back to top |
|
|
|