Author Topic: Path prediction  (Read 9876 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
Re: Path prediction
« Reply #15 on: November 04, 2012, 03:00:35 pm »
Put this at the beginning of the program to do exactly what you described: Buff(56)->GDB1

Note that allocating to GDB1 won't work if the program is an app, but otherwise it should be fine

Offline dinosteven

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 194
  • Rating: +10/-1
    • View Profile
Re: Path prediction
« Reply #16 on: November 04, 2012, 03:11:27 pm »
And... um... how do you send data back from GDB1 to the variables?
I use Copy(oA,GDB1,56) to back all my variables up, then I change them for my path prediction, then I want to restore all the original variables.

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Path prediction
« Reply #17 on: November 04, 2012, 03:14:39 pm »
Just realloc the variables back. Think of the realloc command as moving around a window. Usually this window is always looking at L1+714. When you realloc somewhere else, the window has moved to look somewhere else, but the data at L1+714 still exists. So all you have to do to restore your original variables is slide this window back to L1+714. Actually, you can just call ReAlloc with no arguments and itll do that for you.

Copy(oA,GDB1,56)
ReAlloc(GDB1)
code crap
ReAlloc()
« Last Edit: November 04, 2012, 03:15:21 pm by squidgetx »

Offline dinosteven

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 194
  • Rating: +10/-1
    • View Profile
Re: Path prediction
« Reply #18 on: November 04, 2012, 04:00:35 pm »
I'm kind of understanding now. What if I want the original variables in both windows, so I can use them temporarily for path prediction, then switch back to the normal window with the variables unchanged?
I need the original variables in both windows.

Offline squidgetx

  • Food.
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1881
  • Rating: +503/-17
  • rawr.
    • View Profile
Re: Path prediction
« Reply #19 on: November 04, 2012, 04:03:09 pm »
That's exactly what the code does (I think). You're not moving the data when you copy it. When you copy it, then there are two places in data with the original variables. ReAlloc just changes where in memory A points to when you put "A" in your code. So in the code I gave you, you can do whatever you want to the vars in GDB1, but once you Realloc() back to the original variable setting, the variables there won't have changed.
« Last Edit: November 04, 2012, 04:03:16 pm by squidgetx »

Offline dinosteven

  • LV4 Regular (Next: 200)
  • ****
  • Posts: 194
  • Rating: +10/-1
    • View Profile
Re: Path prediction
« Reply #20 on: November 04, 2012, 04:10:50 pm »
OOOOOOOHHHHH. I finally get it. I'm gonna bookmark this page so I can remember. Thanks so much!

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Path prediction
« Reply #21 on: November 09, 2012, 12:16:05 pm »
Correct me if I am wrong.
So basically, if I do Realloc(L5), then °A=L5, °B=L5+2,... etc and If then I do Realloc(), °A comes back to L1+741, etc ?
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s

Offline leafy

  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1554
  • Rating: +475/-97
  • Seizon senryakuuuu!
    • View Profile
    • keff.me
Re: Path prediction
« Reply #22 on: November 09, 2012, 01:08:47 pm »
Correct me if I am wrong.
So basically, if I do Realloc(L5), then °A=L5, °B=L5+2,... etc and If then I do Realloc(), °A comes back to L1+741, etc ?
That's absolutely correct.
In-progress: Graviter (...)

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Path prediction
« Reply #23 on: November 09, 2012, 01:35:44 pm »
Correct me if I am wrong.
So basically, if I do Realloc(L5), then °A=L5, °B=L5+2,... etc and If then I do Realloc(), °A comes back to L1+741, etc ?
That's absolutely correct.
Erm, nope, I just reread my post and I made a typo, it is L1+714 not L1+741 -.-°
But yeah, I was asking about the idea, not the figures, thanks for answering :)
« Last Edit: November 09, 2012, 01:36:01 pm by Hayleia »
I own: 83+ ; 84+SE ; 76.fr ; CX CAS ; Prizm ; 84+CSE
Sorry if I answer with something that seems unrelated, English is not my primary language and I might not have understood well. Sorry if I make English mistakes too.

click here to know where you got your last +1s