Author Topic: MirageOs/Ion issue  (Read 9776 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
MirageOs/Ion issue
« on: May 10, 2010, 02:10:03 am »
Hey, I noticed something weird happening when compiling for MirageOs/Ion:

Sometimes, when exiting my tunnel game, the file size in Mirage will show up as 65535 bytes, as you'll notice in the screenshot below my source code

Code: [Select]
:.DJTUNNEL Axe Parser Tunnel clone
:"vDJTUNNHS"→GDB1
:UnarchiveGDB1
:[80C0E0F0E0C08000→Pic1
:"AXE TUNNEL"→Str2
:"2010, by DJ Omnimaga"→Str3
:"SPEED:"→Str4
:0→D→P+1→S+1→Q→K
:5→J
:8→C+1→R
:29→I+1→A
:40→W→T
:Full
:DiagnosticOff
:ClrHome
:ClrDraw
:For(Z,9,21
:Line(0,Z,95,Z
:End
:Line(0,56,95,56
:StorePic
:ClrDraw
:For(Z,8,22
:Line(0,Z,95,Z
:End
:For(Z,56,63
:Line(0,Z,95,Z
:End
:DrawInv
:Fix 5
:Fix 1
:Text(20,12,Str2
:Fix 0
:Text(14,57,Str3
:Fix 3
:Text(5,35,Str4
:Repeat Z=54
:DS<(K,12)
:DispGraphr
:End
:DS<(J,11-(S*2))
:Pt-Change(I,35,Pic1)
:I+1→I
:If I=86
:29→I
:End
:End
:getKey→Z
:If Z=15
:1→S
:Goto GO
:End
:Z=3-(Z=2)+S→S
:If S=6
:5→S
:End
:!If S
:1→S
:End
:End
:ClrHome
:ClrDraw
:For(Z,10,50
:Line(0,Z,95,Z)
:End
:Repeat W=6 or getKey(15)
:P+S→P
:DS<(C,8)
:rand^2*2-1→D
:End
:R+D→R
:!If R
:1→R
:End
:If 62-W<R
:62-W→R
:End
:A-getKey(4)+getKey(1)→A
:Pt-Change(0,A,Pic1)
:Line(95,R,95,R+W)
:DS<(Q,S)
:DispGraph
:If pxl-Test(0,A) or pxl-Test(0,A+6)
:Goto GO
:End
:End
:Pt-Change(0,A,Pic1
:Horizontal(-
:DS<(T,99)
:W-1→W
:End
:End
:Lbl GO
:getKey
:Fix 4
:Fix 2
:ClrHome
:If P
:Output(0,0,"Score:",P►Dec
:End
:GetCalc(GDB1)→M
:If M
:If P>{S*2+M-2}r
:P→{S*2+M-2}r
:End
:Else
:GetCalc(GDB1,10
:GetCalc(GDB1)→M
:P→{S*2+M-2}r
:End
:Output(0,1,"SPEED HIGHSCORE
:For(S,1,5
:Output(0,S+1,S►Dec,"     ",{S*2+M-2}r►Dec
:End
:Output(0,0

This happens in version 0.2.0 through 0.2.3 of Axe Parser (basically every version that has built in shell support)
« Last Edit: May 10, 2010, 02:22:26 am by DJ Omnimaga »

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: MirageOs/Ion issue
« Reply #1 on: May 10, 2010, 02:24:34 am »
Is anyone else getting this error?

Could it be possible your high score code is leaking and overwriting the program size bytes?  Like I'm confused where that "S" is coming from when you first check if the high score file exists.  I never saw S initialized.  Also, could it be possible you're using a ram location used by MOS like L2?
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: MirageOs/Ion issue
« Reply #2 on: May 10, 2010, 02:50:08 am »
Mhmm not sure. As for S, do you mean I have to do 0->S at the beginning of my program? Cuz I actually did

0→D→P+1→S+1→Q→K

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: MirageOs/Ion issue
« Reply #3 on: May 10, 2010, 02:16:35 pm »
Any clue? I seriously don't know what I am doing wrong.

I still don't know how MirageOs+Axe works with memory together, so it's impossible for me to figure out how to not overwrite anything MirageOs uses (besides L2) if any
« Last Edit: May 10, 2010, 02:18:16 pm by DJ Omnimaga »

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: MirageOs/Ion issue
« Reply #4 on: May 10, 2010, 03:34:15 pm »
I think it's a little know fact that Mirage uses AsmFlag1 for stuff with the size.  I think Axe is using this flag somewhere, and it's causing problems.  Quigibo, could this be the problem?

To clarify: It won't cause a crash, but it's irksome that somewhere Mirage and Axe don't get along. ;D

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: MirageOs/Ion issue
« Reply #5 on: May 10, 2010, 05:56:01 pm »
Yes, I do use that flag.  That must be it.  Are there any flags that MOS doesn't use that I can steal?
___Axe_Parser___
Today the calculator, tomorrow the world!

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: MirageOs/Ion issue
« Reply #6 on: May 10, 2010, 09:23:54 pm »
I have no idea, but I will share where this knowledge came from:  There's a thread somewhere on UTI in which Iambian was dealing with the same issue in his Fishy game.  Someone brought this up and Iambian changed it.  You can see evidence of this in his source code, as it has an equate so he didn't have to change it all. ;)

I'm glad we found the glitch! ;D

Offline meishe91

  • Super Ninja
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2946
  • Rating: +115/-11
    • View Profile
    • DeviantArt
Re: MirageOs/Ion issue
« Reply #7 on: May 10, 2010, 10:33:08 pm »
Is the problem just a display issue or will it actually do something bad or anything if not fixed?
Spoiler For Spoiler:



For the 51st time, that is not my card! (Magic Joke)

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: MirageOs/Ion issue
« Reply #8 on: May 10, 2010, 10:47:01 pm »
Calc84maniac or BrandonW might actually know a lot about it.

As for now, I did not receive any crash resulting from the 65535 bytes thing. Also my game works perfectly under DoorCS6
* DJ Omnimaga hopes it remains this way in DCS7 D:

Offline TIfanx1999

  • ಠ_ಠ ( ͡° ͜ʖ ͡°)
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 6173
  • Rating: +191/-9
    • View Profile
Re: MirageOs/Ion issue
« Reply #9 on: May 11, 2010, 08:14:30 am »
Nice bug catch guys! It's really weird how some of these things pop up with older programs. =D

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: MirageOs/Ion issue
« Reply #10 on: May 11, 2010, 12:09:42 pm »
Also, I tried my game under Ion. Works perfectly. Seems to only happen in MirageOs


Offline Galandros

  • LV9 Veteran (Next: 1337)
  • *********
  • Posts: 1140
  • Rating: +42/-10
    • View Profile
Re: MirageOs/Ion issue
« Reply #11 on: May 13, 2010, 05:01:31 pm »
Yes, I do use that flag.  That must be it.  Are there any flags that MOS doesn't use that I can steal?
Maybe asm_Flag2 or asm_Flag3?
Have you fixed this? Not many assembly programs use asm_Flag2 and asm_Flag3, I think.
You can also reach the statVars safe ram through iy.
Hobbing in calculator projects.

Offline Quigibo

  • The Executioner
  • CoT Emeritus
  • LV11 Super Veteran (Next: 3000)
  • *
  • Posts: 2031
  • Rating: +1075/-24
  • I wish real life had a "Save" and "Load" button...
    • View Profile
Re: MirageOs/Ion issue
« Reply #12 on: May 13, 2010, 07:03:34 pm »
Well, it has to be a location that isn't in any of the L1-L6 free ram and it can't ever be modified from any standard bcalls.  I switched to asm_flag2, we'll see if this fixes it.
___Axe_Parser___
Today the calculator, tomorrow the world!

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: MirageOs/Ion issue
« Reply #13 on: May 13, 2010, 07:12:17 pm »
I hope this one is not used by any shell, it would suck if none of those were used by no shell at all. If it was the case, do you think in the future, you could make Axe use a different asm_flag (or something else) depending of which shell he chooses to compile for?

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: MirageOs/Ion issue
« Reply #14 on: May 13, 2010, 08:51:37 pm »
That should work I think, what say you Quigibo?  I think he already does conditional compiling to make use of built-in routines provided by the Shells.