Author Topic: Getting around the 8000 limit without using apps  (Read 12866 times)

0 Members and 1 Guest are viewing this topic.

Offline Deep Toaster

  • So much to do, so much time, so little motivation
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 8217
  • Rating: +758/-15
    • View Profile
    • ClrHome
Re: Getting around the 8000 limit without using apps
« Reply #30 on: June 08, 2012, 09:50:06 am »
Since you make a copy of the program, yep.




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: Getting around the 8000 limit without using apps
« Reply #31 on: June 09, 2012, 12:27:23 am »
If you want to be able to use all of ram without getting into annoying shell stuff, you'll need to keep the main program in flash and use bcall(_flashToRam). It's a little trickier to get right, but you could probably figure it out.

Just kidding. Here it is:
Code: [Select]
ld hl, *name*
rst 20h
bcall(_chkFindSym)
ret c
ld a, b
or a
ret z
ex de, hl
ld de, appBackUpScreen
ld bc, 2+2+*nameLength*+1+3+3+3
push af
bcall(_flashToRam)
pop af
ld bc, 2+2+*nameLength*+1+3+3+3+$4000
or a
sbc hl, bc
add hl, bc
adc a, 0
push af
ex de, hl
dec hl
dec hl
dec hl
ld a, (hl)
dec hl
ld l, (hl)
ld h, a
push hl
push de
ld de, $9D95
bcall(_insertMem)
pop hl
pop bc
pop af
bcall(_flashToRam)
jp $9D95

I realized you didn't know the structure of flash variables, so you wouldn't be able to write this.
« Last Edit: June 09, 2012, 12:27:51 am 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 calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Getting around the 8000 limit without using apps
« Reply #32 on: June 09, 2012, 09:37:11 am »
Wouldn't this fail because the shell code is running from $9D95? It would break at _InsertMem (well actually, maybe not since the data might not be touched, but it would at least fail after _flashToRam)

Edit: Also, I think it would be more optimized to read the program size from the VAT entry copied from flash to appBackUpScreen
« Last Edit: June 09, 2012, 09:41:33 am by calc84maniac »
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

Offline chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: Getting around the 8000 limit without using apps
« Reply #33 on: June 09, 2012, 11:07:58 am »
Cool, thanks! I've never really touched the VAT, archive, or any of this stuff, for now it's just to test out the game more easily (or more lazily) so really it doesn't matter TOO much if i corrupt the RAM during run-time, but this will be nice if/when it gets released :) What exactly are you copying the first time through, just the size of the program? What are the extra 9 bytes at the end (+3+3+3)?

And calc84maniac, i assume you would just load that code to saferam somewhere and run it from there.

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: Getting around the 8000 limit without using apps
« Reply #34 on: June 09, 2012, 10:01:03 pm »
Flash archive variable format:

[1:status flag] [2:archived variable total size] [1:prog type] [1:T2] [1:version] [1:page] [2:address] [1:chars in name] [name length:name] [2:size of program] [size of program:program data]

So, I have these mentally grouped. In this order, it's 3+3+3+1+nameLength+2 and then the last +2 is for BB 6D. Really, the archive is just a vat entry with those extra three bytes out front.
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 chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: Getting around the 8000 limit without using apps
« Reply #35 on: October 07, 2012, 12:53:41 pm »
thepenguin77:
I thought maybe we could add the routine you posted here to the wiki, since there are currently no examples. Would that be ok?

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: Getting around the 8000 limit without using apps
« Reply #36 on: October 07, 2012, 02:37:26 pm »
thepenguin77:
I thought maybe we could add the routine you posted here to the wiki, since there are currently no examples. Would that be ok?

Don't add this one, I'll do it. (There are much better ways)

Wait, I misunderstood what was asked.

Edit:
   Ok, I'll make the wikiti page, what do you want?
« Last Edit: October 07, 2012, 02:42:13 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 chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: Getting around the 8000 limit without using apps
« Reply #37 on: October 07, 2012, 02:48:21 pm »
I was just asking if we could add the information/example to the _FlashToRAM wikipage. :)

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: Getting around the 8000 limit without using apps
« Reply #38 on: October 07, 2012, 03:06:23 pm »
Oh, this has nothing to do with flashToRam, that wouldn't be the right place to put it. This is more suited for general OS documentation.

And looky here, the page already exists http://wikiti.brandonw.net/index.php?title=83Plus:OS:Variable_Storage_in_the_User_Archive (though without that code example)
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 chickendude

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 817
  • Rating: +90/-1
  • Pro-Riot Squad
    • View Profile
Re: Getting around the 8000 limit without using apps
« Reply #39 on: October 08, 2012, 02:37:47 am »
Ah i thought we could add it as an example of how to use _FlashToRAM since currently there isn't any, but thanks for the link, i hadn't seen that before :)

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: Getting around the 8000 limit without using apps
« Reply #40 on: October 08, 2012, 08:45:34 am »
Ah i thought we could add it as an example of how to use _FlashToRAM since currently there isn't any, but thanks for the link, i hadn't seen that before :)

Oh, sure, if that's what you're doing, then have fun with it ;D  To be completely honest, when I read your first post, I thought you were going to make a wiki page on how to bypass the 8811 limit.

So I'm saying yes, do it.
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