Author Topic: [idea] multi-page apps  (Read 5097 times)

0 Members and 1 Guest are viewing this topic.

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
[idea] multi-page apps
« on: December 16, 2010, 07:50:18 pm »
Now, I know that everyone's all like: blargh imma wanting some of that multipage app goodness, and Quigibo's like....not practical.

If I understand correctly, it's not that compiling a multipage app is difficult because it's large, but it's that creating the instructions to swap pages and that knowing when and where to swap pages in an arbitrary program makes it difficult.

Now, simplifying, the problem would be would that the parser doesn't have enough information (that only the programmer would know) to accurately create the multipage app.

So my idea was, to have integrate a compiler command to indicate the different pages :| There would probably two commands, one to call the 2nd page and one that is some kind of modification to the #include (prgmXXX) function, where that program would be parsed into the 2nd page. Then, in the app's code, when the program needs to swap pages, there would just be some command in the 'mother app' to switch pages. For example, if you wanted to mix a battle engine (in prgmBATTLE) with a tilemapper, the code might look like this:
Code: (main program) [Select]
blah blah blah tilemapper code
<when a battle occurs>
instruction to swap to 2nd page of app
more code blah
...

instruction to parse prgmBATTLE as the second page of the app

Basically, what this could do would be to enable "packaging" of a second app together with the first app, sort of like what Builderboy's virtual-page program does, but only with real app pages. While this method would in no way be close to producing the flexibility of a real asm-programmed multipage app, I figure that this, well, it's better than what we have right now :P. It would require the programmer to make sure that his pages can run completely independently of eachother (no subroutines or anything), but that's a small price to pay.

Thoughts? Is this even possible?
« Last Edit: December 16, 2010, 08:06:02 pm by squidgetx »

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: [idea] multi-page apps
« Reply #1 on: December 16, 2010, 07:56:12 pm »
That's certainly an idea to consider

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: [idea] multi-page apps
« Reply #2 on: December 16, 2010, 08:56:45 pm »
The only problem is that the routine to swap the pages cannot be located on the page you're trying to swap.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: [idea] multi-page apps
« Reply #3 on: December 16, 2010, 09:27:18 pm »
The idea I had for multipage apps would be that you could have up to 16KB of code and unlimited data. The static pointers on other pages could be treated almost exactly like the file objects, I think (but static instead of variable, and relative page instead of absolute page)
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: [idea] multi-page apps
« Reply #4 on: December 16, 2010, 10:50:26 pm »
The best way to have multi-paged code is page calls.  On the main page, you write all your normal code.  But subroutines can be called off-page by special routines so perhaps they could be put on the other pages with the data.  The reason I can't do this though is that the parser simply doesn't have enough memory left to keep track of all the multi-page functionality.  The all data idea that calc84maniac is talking about seems like the only practical way at the moment.  And just for the record, the reason I haven't implemented this yet is actually because its difficult for the compiler.  Writing things to multiple pages of flash, additional parsing passes, creating new syntax, checking for errors, all while being compatible for all versions of calcs (which have different starting points for the app tables) is challenging and time consuming.  If there are any assembly programmers who want to help me with it, I can post the app writing code if you're up for it, but I can hardly understand it myself since about a third of it is written by TI.

This is why I think a computer version would be much more efficient.  But I think if I do end up doing that, it will look a lot more like C than Axe since the computer is fast enough and has enough memory to that I can automatically optimize the code so that you don't have to do all those weird syntax tricks like calling things with missing arguments or storing things after each other.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: [idea] multi-page apps
« Reply #5 on: December 17, 2010, 12:04:04 am »
Would we still be able to use the original Axe syntax, though? It would be nice to have a computer version of Axe where we can still use Axe syntax if we do not understand C (like me, unless it's a higher level version of C?)

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: [idea] multi-page apps
« Reply #6 on: December 17, 2010, 09:40:57 pm »
If there are any assembly programmers who want to help me with it, I can post the app writing code if you're up for it, but I can hardly understand it myself since about a third of it is written by TI.
Can I get that code?
« Last Edit: December 17, 2010, 09:41:06 pm by graphmastur »

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: [idea] multi-page apps
« Reply #7 on: December 19, 2010, 05:02:16 am »
This is all of it I think.  It won't compile because its missing some variable declarations, and it isn't used in context, but if anyone can write pseudo-code or something that would be enough.  This is pretty complicated stuff.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: [idea] multi-page apps
« Reply #8 on: December 19, 2010, 06:44:57 pm »
Oh, thank you very much! What does P2ldir do?

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: [idea] multi-page apps
« Reply #9 on: December 20, 2010, 02:14:56 am »
Its identical to ldir, but from page 2 of the app.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: [idea] multi-page apps
« Reply #10 on: December 20, 2010, 07:47:51 am »
Okay, then what is RAM defined as?