Author Topic: Cannot compile my program into a shell? (SOLVED)  (Read 3454 times)

0 Members and 1 Guest are viewing this topic.

Offline Derf321

  • LV3 Member (Next: 100)
  • ***
  • Posts: 59
  • Rating: +0/-0
    • View Profile
Cannot compile my program into a shell? (SOLVED)
« on: December 05, 2012, 11:49:18 am »
I need to use Crabcake soon, but I cannot run the program in a shell (after compiling it for a shell). When I try, it lets me into the main menu of my program fine, but when I load the main loop it will only work for a couple seconds, displays xxx instead of numbers, and freezes and clears ram. Can someone take a look at it? It still does it when I tried emulating with wabbit, and I've tried compiling it for Mirage, ION, and Doors, but only "No Shell" or Axe Fusion work.
« Last Edit: December 05, 2012, 09:39:12 pm by Derf321 »

Offline jacobly

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 205
  • Rating: +161/-1
    • View Profile
Re: Cannot compile my program into a shell?
« Reply #1 on: December 05, 2012, 11:57:05 am »
As the Axe documentation says, you cannot use L₂ in a program run from Mirage.

Offline Derf321

  • LV3 Member (Next: 100)
  • ***
  • Posts: 59
  • Rating: +0/-0
    • View Profile
Re: Cannot compile my program into a shell?
« Reply #2 on: December 05, 2012, 12:12:14 pm »
What would a good alternative be? Just split L1 into two parts and use them?

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Cannot compile my program into a shell?
« Reply #3 on: December 05, 2012, 01:09:00 pm »
As the Axe documentation says, you cannot use L₂ in a program run from Mirage.
Isn't it possible if interrupts are turned off (FnOff) ?
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 jacobly

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 205
  • Rating: +161/-1
    • View Profile
Re: Cannot compile my program into a shell?
« Reply #4 on: December 05, 2012, 01:10:32 pm »
As the Axe documentation says, you cannot use L₂ in a program run from Mirage.
Isn't it possible if interrupts are turned off (FnOff) ?
Yes, that or LnReg (FnOff has the problem that many commands such as getKeyʳ will just turn the interrupts back on).
« Last Edit: December 05, 2012, 01:11:32 pm by jacobly »

Offline Eeems

  • Mr. Dictator
  • Administrator
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6234
  • Rating: +318/-36
  • little oof
    • View Profile
    • Eeems
Re: Cannot compile my program into a shell?
« Reply #5 on: December 05, 2012, 01:11:13 pm »
It probably still wont play well with shells that use interrupts. Plus, if users want those interrupts on, it's kind of rude to disable them.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Cannot compile my program into a shell?
« Reply #6 on: December 05, 2012, 01:17:53 pm »
MirageOS uses parts of L2 for it's data as well, so even if you disable interrupts, you will still be messing with MirageOS vars and weird stuff may happen after you exit.

Offline Derf321

  • LV3 Member (Next: 100)
  • ***
  • Posts: 59
  • Rating: +0/-0
    • View Profile
Re: Cannot compile my program into a shell?
« Reply #7 on: December 05, 2012, 04:37:36 pm »
MirageOS uses parts of L2 for it's data as well, so even if you disable interrupts, you will still be messing with MirageOS vars and weird stuff may happen after you exit.
So would the best option then be to use {L1+100} instead of L2?

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: Cannot compile my program into a shell?
« Reply #8 on: December 05, 2012, 04:42:24 pm »
MirageOS uses parts of L2 for it's data as well, so even if you disable interrupts, you will still be messing with MirageOS vars and weird stuff may happen after you exit.
So would the best option then be to use {L1+100} instead of L2?
If you have less then 600 (and some more , i think 667?)  to store, then yes use L1+100
None of my posts are meant offending... I you feel hurt by one of my posts, tell me ... So i can appoligise me and/or explain why i posted it


Hi there, I'm the allmighty (read as: stupid, weak...) STEVON8TER

Offline Derf321

  • LV3 Member (Next: 100)
  • ***
  • Posts: 59
  • Rating: +0/-0
    • View Profile
Re: Cannot compile my program into a shell?
« Reply #9 on: December 05, 2012, 09:38:53 pm »
Okay, shouldn't be a problem. Thank you all!

EDIT:
If you have less then 600 (and some more , i think 667?)  to store, then yes use L1+100
I replaced all my old L2 tokens with L1+300, and my bullet system (thats what the L2 array was for) works fine except occasionally it places a pixel on the left side of the screen. This did not happen before I replaced the L2's with L1+300's. Is this some weird coding flaw on my part, or is this some other issue? I know I'm not reaching the end of the L1 allocation because I only have a few variables going at any given time.
Figured out that I couldn't do this: 0→{L1}→{L1+1}→{L1+2}, derp  <_<

All working now, thanks a quadrillion!
« Last Edit: December 05, 2012, 10:48:20 pm by Derf321 »

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Cannot compile my program into a shell? (SOLVED)
« Reply #10 on: December 06, 2012, 01:18:02 am »
Figured out that I couldn't do this: 0→{L1}→{L1+1}→{L1+2}, derp  <_<
Yeah, in fact, 0→{L1} returns L1, not 0 so you are actually doing L1→{L1+1} at the second arrow.
What you can do is Fill(L1,3,0), which would put zeros in the firts three bytes of L1, which is what you want :)

If you have less then 600 (and some more , i think 667?)  to store, then yes use L1+100
The "true" L1 is 768 bytes, but you have the 27 variables at the end of it (A,B,...Z and theta), each of them are 2 bytes, so the available size in L1 is 768-(27*2) :)
(As the Commands.html says, it can be expanded to 768 using Realloc, which would move the variables elsewhere than in L1+714)
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 Runer112

  • Project Author
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2289
  • Rating: +639/-31
    • View Profile
Re: Cannot compile my program into a shell? (SOLVED)
« Reply #11 on: December 06, 2012, 01:24:26 am »
Figured out that I couldn't do this: 0→{L1}→{L1+1}→{L1+2}, derp  <_<
Yeah, in fact, 0→{L1} returns L1, not 0 so you are actually doing L1→{L1+1} at the second arrow.
What you can do is Fill(L1,3,0), which would put zeros in the firts three bytes of L1, which is what you want :)

VALUE→{PTR} returns EXPR when PTR is a constant, so that code should work as far as I can see. You only get back the value of the pointer you're storing to when it's not a constant.

Also, if you're not storing anything else in L1 at the point of setting these values, the best way I would see to initialize it is actually to clear the whole thing with ClrDraw(L1), which is only 6 bytes.


If you have less then 600 (and some more , i think 667?)  to store, then yes use L1+100
The "true" L1 is 768 bytes, but you have the 27 variables at the end of it (A,B,...Z and theta), each of them are 2 bytes, so the available size in L1 is 768-(27*2) :)
(As the Commands.html says, it can be expanded to 768 using Realloc, which would move the variables elsewhere than in L1+714)
* Runer112 points to Axe 1.2.0 changelog :P
« Last Edit: December 06, 2012, 01:25:05 am by Runer112 »

Offline Hayleia

  • Programming Absol
  • Coder Of Tomorrow
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3367
  • Rating: +393/-7
    • View Profile
Re: Cannot compile my program into a shell? (SOLVED)
« Reply #12 on: December 06, 2012, 12:58:46 pm »
If you have less then 600 (and some more , i think 667?)  to store, then yes use L1+100
The "true" L1 is 768 bytes, but you have the 27 variables at the end of it (A,B,...Z and theta), each of them are 2 bytes, so the available size in L1 is 768-(27*2) :)
(As the Commands.html says, it can be expanded to 768 using Realloc, which would move the variables elsewhere than in L1+714)
* Runer112 points to Axe 1.2.0 changelog :P
O.O They have been moved O.O
Where are they now ?
« Last Edit: December 06, 2012, 12:59:08 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

Offline stevon8ter

  • LV7 Elite (Next: 700)
  • *******
  • Posts: 663
  • Rating: +10/-0
    • View Profile
Re: Cannot compile my program into a shell? (SOLVED)
« Reply #13 on: December 06, 2012, 01:18:58 pm »
Figured out that I couldn't do this: 0→{L1}→{L1+1}→{L1+2}, derp  <_<
Yeah, in fact, 0→{L1} returns L1, not 0 so you are actually doing L1→{L1+1} at the second arrow.
What you can do is Fill(L1,3,0), which would put zeros in the firts three bytes of L1, which is what you want :)

If you have less then 600 (and some more , i think 667?)  to store, then yes use L1+100
The "true" L1 is 768 bytes, but you have the 27 variables at the end of it (A,B,...Z and theta), each of them are 2 bytes, so the available size in L1 is 768-(27*2) :)
(As the Commands.html says, it can be expanded to 768 using Realloc, which would move the variables elsewhere than in L1+714)

Ooh ok, and then i substracted another 100 cause k tought he had 100 other vars in L1 already xp
None of my posts are meant offending... I you feel hurt by one of my posts, tell me ... So i can appoligise me and/or explain why i posted it


Hi there, I'm the allmighty (read as: stupid, weak...) STEVON8TER