Author Topic: Space for Fourth Buffer  (Read 6426 times)

0 Members and 1 Guest are viewing this topic.

Offline ralphdspam

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 841
  • Rating: +38/-1
  • My name is actually Matt.
    • View Profile
Space for Fourth Buffer
« on: September 09, 2011, 10:03:28 pm »
Currently I am using SaveSScreen, appBackupScreen, and plotSScreen for display buffers.  Where can I place my fourth buffer of $300 bytes?

Thanks in advance.  :)
ld a, 0
ld a, a

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: Space for Fourth Buffer
« Reply #1 on: September 09, 2011, 10:32:51 pm »
Runer and I talked about using statVars as a fourth buffer. It looks like it should be clear to use. Starting at statVars, you have about 830 bytes to work with that really shouldn't cause any problems unless you do stat operations or graph something.

To see the complete list of what you are destroying head over here and look at everything between 8A3Ah and 8D3A.

Edit:
   $8000 is also free to use as long as you don't archive/unarchive anything, just be sure to call bcall(_fillBasePageTable) when you are done.
« Last Edit: September 09, 2011, 10:34:09 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 ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Space for Fourth Buffer
« Reply #2 on: September 09, 2011, 10:36:43 pm »
Is this a program?  If so, you could alternately add 768 bytes of data to the program and use that as your fourth buffer.
(Personally I'd use the space at $8000.  I used it in Cube Droid and found it the smoothest method of obtaining more data space.)

Offline Hot_Dog

  • CoT Emeritus
  • LV12 Extreme Poster (Next: 5000)
  • *
  • Posts: 3006
  • Rating: +445/-10
    • View Profile
Re: Space for Fourth Buffer
« Reply #3 on: September 09, 2011, 10:46:55 pm »
   $8000 is also free to use as long as you don't archive/unarchive anything, just be sure to call bcall(_fillBasePageTable) when you are done.

Why do you need the bcall routine afterwards?

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: Space for Fourth Buffer
« Reply #4 on: September 09, 2011, 10:49:30 pm »
   $8000 is also free to use as long as you don't archive/unarchive anything, just be sure to call bcall(_fillBasePageTable) when you are done.

Why do you need the bcall routine afterwards?
Some operating systems (I believe the 83 ones, but I may be wrong) there is a table that has to do with Applications somewhere in that block of memory.  If you destroy it, that bcall will rebuild it and make it as if it was never destroyed.

Offline calc84maniac

  • eZ80 Guru
  • Coder Of Tomorrow
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2912
  • Rating: +471/-17
    • View Profile
    • TI-Boy CE
Re: Space for Fourth Buffer
« Reply #5 on: September 09, 2011, 11:20:10 pm »
$8000 is also free to use as long as you don't archive/unarchive anything, just be sure to call bcall(_fillBasePageTable) when you are done.
I think using Copy() from an archived file would also destroy stuff in that area, because that uses bcall(_FlashToRam). Also, isn't the base page table only required if you're running a multi-page app with the custom bcall system?
"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman

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: Space for Fourth Buffer
« Reply #6 on: September 10, 2011, 10:22:51 am »
Remember that if you want it to be compatible with MirageOS, don't use statVars at all.




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: Space for Fourth Buffer
« Reply #7 on: September 10, 2011, 12:34:36 pm »
I think using Copy() from an archived file would also destroy stuff in that area, because that uses bcall(_FlashToRam). Also, isn't the base page table only required if you're running a multi-page app with the custom bcall system?

Yeah, really, anything related flash will destroy $8100. If you destroy the base page table, most likely, you'll never notice. The only time it matters is when you run something before the base page table is built, for instance: a hook to a multipage application (CtlgHelp). So to be safe, just call the bcall.

Remember that if you want it to be compatible with MirageOS, don't use statVars at all.

That's only if you want it to be compatible with the MirageOS interrupt system. Do an IM 1 and you can trash statVars.
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 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: Space for Fourth Buffer
« Reply #8 on: September 10, 2011, 01:31:43 pm »
Remember that if you want it to be compatible with MirageOS, don't use statVars at all.
That's only if you want it to be compatible with the MirageOS interrupt system. Do an IM 1 and you can trash statVars.
Nope, still can't, because MirageOS uses it for more than just interrupts: http://cemete.ch/t5934

EDIT: You were the one who told me that O.o
« Last Edit: September 10, 2011, 01:32:13 pm by Deep Thought »




Offline Runer112

  • Moderator
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Space for Fourth Buffer
« Reply #9 on: September 10, 2011, 02:01:04 pm »
I just ran a program under MirageOS that disables interrupts and then sets 733 bytes starting at statVars to $FF. Upon returning, I notice no errors with MirageOS and no changed options. So it certainly seems like you can trash as much of statVars as you want, just make sure you disable MirageOS's interrupt handler. Maybe MirageOS uses a few bytes for options, like the return location, but setting them to $FF doesn't appear to mess up MirageOS anyways as far as I can tell. Perhaps I need to set a certain byte to a certain value to cause bugs in MirageOS, but I don't know of any such byte.
« Last Edit: September 10, 2011, 02:05:12 pm by Runer112 »

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: Space for Fourth Buffer
« Reply #10 on: September 10, 2011, 02:08:11 pm »
Maybe MirageOS uses a few bytes for options, like the return location, but setting them to $FF doesn't appear to mess up MirageOS anyways as far as I can tell.
If you set some of the option bytes to a valid value like 0 or 1, it does cause some minor glitches when it returns to the shell (for example, making the cursor point to the eight program in a folder that has only four files, which can cause serious problems when you try to archive or rename 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: Space for Fourth Buffer
« Reply #11 on: September 10, 2011, 03:14:29 pm »
EDIT: You were the one who told me that O.o

;D Ok, so StatVars is free to destroy, however, what you leave there can have negative effects.

The only one I've ever found was leaving a 01 at $8A4A.

I think writing 00's to the whole thing should be safe though.

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 ralphdspam

  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 841
  • Rating: +38/-1
  • My name is actually Matt.
    • View Profile
Re: Space for Fourth Buffer
« Reply #12 on: September 10, 2011, 05:03:40 pm »
Thanks.  :)
Before I asked the question, I was using $8000 and hoping that I wasn't destroying anything.  :P
ld a, 0
ld a, a