Author Topic: App Programming  (Read 6015 times)

0 Members and 1 Guest are viewing this topic.

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
App Programming
« on: July 02, 2011, 07:58:21 pm »
Can someone help me with this concept? I'm reopening the Zelda project, in z80. I want to make it an app, as its data alone will take up at least one page. The code itself will be probably less than one page. How do I go about this? How does the header differ and what must be coded differently? I heard there are caveats to using the b_calls in an app? How do you work around this? If I wrote it as a program, entirely, would it be easy for someone to just app-ify it? 

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: App Programming
« Reply #1 on: July 02, 2011, 08:02:15 pm »
Writing the app is pretty simple if you use spasm. You don't really have to change much, aside from changing the output file name to .8xk.

Here is what I wrote in a topic a while back:
1. Your code will be running from the $4000-$7FFF page, which means you need to do .org $4000 instead of .org $9D95
2. You need a header, (which you can get from here)
3. You will have to use bcall(_jForceCMDNoChar) or similar to return as the OS jp's to the app, it doesn't call it
4. Most bcall's that take ptr's for inputs won't work if you give them an address in the $4000-$7FFF area. What this means is that you either need to reimplement bcall(_putS) with bcall(_putC), or copy all your strings to ram before displaying them
5. Obviously, don't change port 06 unless you have copied your routine to ram


6. And most importantly, you must compile your program for hex and then sign it, I would highly suggest that you just use spasm and make the output .8xk rather than .8xp. This will save you a lot of trouble.

Edit:
    And if your program size is going to be <20KB, you might want to consider making it a program since now we can run code at >C000.
« Last Edit: July 02, 2011, 08:05:05 pm by thepenguin77 »
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: App Programming
« Reply #2 on: July 02, 2011, 08:13:33 pm »
By your edit, you are referring to zStart, correct? But, no it will likely be between 20 and 30k.

Use jForceCMDNoChar at the end?

And, is there a mac version of spasm that I can use?
« Last Edit: July 02, 2011, 08:16:15 pm by ACagliano »

Offline shmibs

  • しらす丼
  • Administrator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2132
  • Rating: +281/-3
  • try to be ok, ok?
    • View Profile
    • shmibbles.me
Re: App Programming
« Reply #3 on: July 02, 2011, 08:51:02 pm »
i don't think that there is an osx version of spasm, but you can always run it under wine.

Offline ZippyDee

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 729
  • Rating: +83/-8
  • Why not zoidberg?
    • View Profile
Re: App Programming
« Reply #4 on: July 03, 2011, 02:11:38 am »
WabbitCode makes .8xk files for apps. I'm using it on my OSX for my IDE I'm developing.
There's something about Tuesday...


Pushpins 'n' stuff...


Offline BuckeyeDude

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 283
  • Rating: +42/-0
    • View Profile
Re: App Programming
« Reply #5 on: July 03, 2011, 02:18:17 am »
Yes there is a mac version of spasm. I've uploaded it to codeplex to make it easier to find. http://wabbit.codeplex.com/releases/view/45088. You might also want to check out Wabbitcode for the Mac.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: App Programming
« Reply #6 on: July 04, 2011, 03:14:16 pm »
By your edit, you are referring to zStart, correct? But, no it will likely be between 20 and 30k.

You can do it without zStart. In fact, you really shouldn't rely on zStart. The code to do it is only about 30 bytes. But if it's going to end up around 30k, then it should go in an app.
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline ACagliano

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 919
  • Rating: +32/-2
    • View Profile
    • ClrHome Productions
Re: App Programming
« Reply #7 on: July 04, 2011, 06:47:04 pm »
I have the mac version of wabbitcode. Do I need this stuff? It's saying error on the first two includes.:

.nolist
include   "ti83plus.inc"
include   "dcs7.inc"
include   "app.inc"
.list

Offline DrDnar

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 546
  • Rating: +97/-1
    • View Profile
Re: App Programming
« Reply #8 on: July 04, 2011, 10:55:58 pm »
You can run your program from RAM and stream data from the archive, although the variable-location nature of the archive can be a hassle. If your code totals less than about 20 K, as thepenguin77 noted above, you can run entirely from RAM, and the code for unlocking all of RAM for execution isn't very big. (Don't go too close to the 24 K limit or people with huge VATs will have trouble.) Running from RAM makes accessing a lot of data easier, as you can page 4000h around without incurring the cost of off-page b_calls. (The official method of accessing code/data outside of the current page involves using an extension of b_calls.)

Make sure all of your includes are in a place where Spasm can find them, which typically means the same directory as everything else. Also, Spasm may require that the include directive be prefixed with a pound (#).
"No tools will make a man a skilled workman, or master of defense, nor be of any use to him who has not learned how to handle them, and has never bestowed any attention upon them. . . . Yes, [] the tools which would teach men their own use would be beyond price."—Plato's The Republic, circa 380 BC