Author Topic: If i know the flash page of a file, how can i read/write data to it.  (Read 3274 times)

0 Members and 1 Guest are viewing this topic.

Offline c4ooo

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 252
  • Rating: +10/-1
  • The impossible chemical compound.
    • View Profile
If i know the flash page of a file, how can a read/write to it without using Y1 or GetCalc()?
-German Kuznetsov
The impossible chemical compound.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: If i know the flash page of a file, how can i read/write data to it.
« Reply #1 on: March 08, 2015, 09:04:29 pm »
In Axe, you basically can't. There's a reason the Y1-Y0 "file" system exists, after all. :P Why would you be trying to avoid them?

Also, if you are going to use them, note that you can read and copy from pointers to archived data, but nothing else. For instance, you can't directly draw a sprite because the sprite drawing routine doesn't "know" how to read archived data, which isn't nearly as straightforward to read as data in RAM. And you can't write to a pointer to archived data simply because that's a limitation of the hardware. Writes to flash memory have to be done in a very special manner which is far too expensive and complicated to do arbitrarily.

Offline c4ooo

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 252
  • Rating: +10/-1
  • The impossible chemical compound.
    • View Profile
Re: If i know the flash page of a file, how can i read/write data to it.
« Reply #2 on: March 09, 2015, 08:56:24 pm »
Why would you be trying to avoid them?

What if ime reading stuff out of the VAT? It would be much easier to just read the flash page (which is stored in the VAT) then getCalking that var.  8)
-German Kuznetsov
The impossible chemical compound.

Offline Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: If i know the flash page of a file, how can i read/write data to it.
« Reply #3 on: March 09, 2015, 09:26:29 pm »
I guess that does make it a bit trickier. But it would still definitely be harder to implement custom archived data reading code than to just finagle the archived data pointer into a Y1-Y0 file pointer. It's a bit redundant, but I'd suggest simply reading the variable's name and using the archived file variant of GetCalc() on it. That has all the code needed to convert the page and pointer in the VAT into a file pointer that Axe understands, which isn't exactly a simple conversion to make.

Offline c4ooo

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 252
  • Rating: +10/-1
  • The impossible chemical compound.
    • View Profile
Re: If i know the flash page of a file, how can i read/write data to it.
« Reply #4 on: March 10, 2015, 06:32:08 am »
As you may have seen i have the tendency to do redounded thing  ;)
-German Kuznetsov
The impossible chemical compound.