Author Topic: Xeverion  (Read 21487 times)

0 Members and 3 Guests are viewing this topic.

Offline Aichi

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +76/-3
    • View Profile
    • Devrays
Re: Xeverion
« Reply #45 on: November 15, 2010, 08:38:01 am »
Ok, my game will be 3 files. The Code in an app (I hope I can put everthing in 16Kb), a score file with the all characters & maps and an immutable file with the dialog text and all sprites. I publish two versions of the immutable file, language pack german and an english one.

But I have a big issue with these language packs at the moment.
German text wont have exactly the same lenght like english has,
so I dont know how to set the pointers to the start of these texts.
I tried to use following to point to the text starts:
Code: (English language pack) [Select]
.English
Data(Str1-40343, Str2-40343, Str3-40343)
"Wayne: Aichi, did you found a solution for the pointer issue?"->Str1
"Aichi: No, it seems to be impossible at the moment."->Str2
"Wayne: Oh, bad News. The Game."->Str3
Code: (German language pack) [Select]
.German
Data(Str1-40343, Str2-40343, Str3-40343)
"Wayne: Aichi, hast du eine Lösung zu deinem Pointer Problem gefunden?"->Str1
"Aichi: Nein, es scheint im Moment nicht möglich zu sein."->Str2
"Wayne: Oh, das sind schlechte Neuigkeiten. The Game."->Str3
Then I just would have to use the data start pointer and add the value of bytes being in the data of the first line.
But (unlike all pure asm compilers I know) Axe is not allowing to use pointers before these pointers are defined.
Thats the reason why I cant use this:

Code: [Select]
.Main
ClrHome
Getcalc("prgmENGLISH",Y1)
Getcalc("prgmGERMAN",Y2)

.Output what Aichi says on German
1->X .The second text, Str2
Output(0,0,Y2+{2*X+Y2}) .Pointer to the file + a value stored in this file to reach Str2

Repeat getkey=15
End
ClrHome

Offline matthias1992

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 408
  • Rating: +33/-5
    • View Profile
Re: Xeverion
« Reply #46 on: November 15, 2010, 08:43:19 am »
Sorry I can't help but this is the thing I like most about axe, we can now finally make neat data files and select when transferring only those that we need! This is great for a game that is designed for multiple languages!

Why the -40343? is that an appvar size limit or something?
MASM xxxxxxxxxx aborted | SADce ====:::::: 40% -Halted until further notice| XAOS =====::::: 50% -Units done| SKYBOX2D engine ========== 100% -Pre-alpha done. Need to  document it and extend |

~Those who dream by day are cognizant of much more than those who dream by night only. -Sir Edgar Allen Poe-

Offline Aichi

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +76/-3
    • View Profile
    • Devrays
Re: Xeverion
« Reply #47 on: November 15, 2010, 08:54:14 am »
Sorry I can't help but this is the thing I like most about axe, we can now finally make neat data files and select when transferring only those that we need! This is great for a game that is designed for multiple languages!

Why the -40343? is that an appvar size limit or something?
Im thinking Axe adds 40343 ($9D95+2) to the pointers, cause this should be the place where
the program is executed in RAM. I want to have the pure pointers, so I manually subtract this value from my pointers.
I dont use appvars for storing data, but programs. You can find the source code for these programs on/in/at/whatever my last post.

And yes, this thing is very useful for making big games. :)

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: Xeverion
« Reply #48 on: November 15, 2010, 11:25:24 am »
I am more concerned at the negative sign after the 40343. Could you explain exactly what is 40343? ???

That said, nice idea of having language packs. Should be much easier to update the game for bugs even if there are multiple languages.
« Last Edit: November 15, 2010, 11:26:44 am by DJ Omnimaga »

Offline Aichi

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +76/-3
    • View Profile
    • Devrays
Re: Xeverion
« Reply #49 on: November 15, 2010, 12:58:12 pm »
For example. if there is a pointer to the 8th byte of the program data, lets call this pointer Str1,
then a compiler dissolve the pointer into a word and put the value 8 + 40341 on every place where
the pointer was. It has to be the 8+40341th byte, not the 8th, cause this program won't be executed
from the first byte of RAM, but the 40341th byte. The assembly command org $9D95 (9D95 Hex = 40341 Dec)
tells the compiler how much bytes should be added to the pointers.
So, since I want to have the value 8, not the real pointer with 8+40341, I must subract 40341 from the pointer. 40343 was a mistake, it should be 40341.
I cant explain things in english very well, also I'm perhaps talking Bullsh!t. :<

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: Xeverion
« Reply #50 on: November 15, 2010, 07:35:32 pm »
Ah ok but why do you need to do such manipulations? Doesn't Axe lets you simply do stuff like Text(1,1,Str1+1 (If, for example, Str1 had HELLO, it would display ELLO.)? Someone else might need to explain this to me because I am really lost. X.x Sorry :/

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Xeverion
« Reply #51 on: November 15, 2010, 07:45:00 pm »
This is what i think he is doing.  He has an appvar full of data, and since this data sets are random length, you can't know where one starts and another ends.  How to fix this?  Well if we have 10 sets of data, we can have 10 numbers at the begining of the appvar.  The first number will say "The first data set is X bytes from the begining of this appavar" and so on.

When you store text into a pointer in Axe, the pointer holds the location of the text.  So after "1234"->Str1, Str1 holds the location of the String "1234".  Well, programs in assembly (and axe) *always* start at the location 40341.  So if Str1 is 10 bytes after the start of the program, it will be located at 40351.  If we want to find out how far Str1 is from the start of the program, we just subtract the location of the string (40351) from the start of the program (40341), and we get 10 :)

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: Xeverion
« Reply #52 on: November 16, 2010, 12:27:41 am »
Ah ok but I used strings and tested before and don't remember setting text to addresses this high. Is it just because he uses appvars or did something in particular change since I released Axe Tunnel?
« Last Edit: November 16, 2010, 12:28:04 am by DJ Omnimaga »

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Xeverion
« Reply #53 on: November 16, 2010, 12:33:57 am »
hmm what do you mean by setting text to addresses?

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: Xeverion
« Reply #54 on: November 16, 2010, 12:51:45 am »
40351, right?

Sorry I am completly lost in this thing. I just never saw data being stored/read/whatever this high before in Axe. All I saw was stuff like Str1+1, Str1+2, etc. Not Str1+40351.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Xeverion
« Reply #55 on: November 16, 2010, 01:09:53 am »
Try not to think of 40351 as a number, but more as a location.  40351 is the location in RAM of the start of the program.  Lets have an example program:

Code: [Select]
.Axe        40351
Pxl-On(0.0  40355
9->A        40357
"123"->Str1 40362

in this example, 40351 is the place where the program starts, line 2 starts at 40355, line 3 starts at 40357, and the string starts at line 40362.  If we wanted to find how far from the start of the program line 4 is, we would subtract the two numbers, 40362-40351 = 11 bytes from the start.  Str1 points to the same place as Line 4, so we can use Str1 instead of 40362

Yeah like you said you normally don't see this kind of thing being done, it has been able to be done for a long time but i don't think i've seen it many places o.O its a pretty advanced use of pointers

« Last Edit: November 16, 2010, 01:13:33 am by Builderboy »

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: Xeverion
« Reply #56 on: November 16, 2010, 02:02:10 am »
I know but I thought Str1 and other pointers were stored long before that, which is why I got confused. And yeah I never saw that trick before.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Xeverion
« Reply #57 on: November 16, 2010, 02:04:17 am »
yeah its a pretty confusing topic and implementation x.x

Offline Aichi

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 290
  • Rating: +76/-3
    • View Profile
    • Devrays
Re: Xeverion
« Reply #58 on: November 16, 2010, 11:51:18 am »
This is what i think he is doing.  He has an appvar full of data, and since this data sets are random length, you can't know where one starts and another ends.  How to fix this?  Well if we have 10 sets of data, we can have 10 numbers at the begining of the appvar.  The first number will say "The first data set is X bytes from the begining of this appavar" and so on.

When you store text into a pointer in Axe, the pointer holds the location of the text.  So after "1234"->Str1, Str1 holds the location of the String "1234".  Well, programs in assembly (and axe) *always* start at the location 40341.  So if Str1 is 10 bytes after the start of the program, it will be located at 40351.  If we want to find out how far Str1 is from the start of the program, we just subtract the location of the string (40351) from the start of the program (40341), and we get 10 :)

Yeah, this is exactly what my plan is. :)
The major problem is following:
Axe dont allow that I have this
Code: [Select]
Data(Str1-40341) in my code, before I use this command:
Code: [Select]
"ABC"->Str1
But (unlike all pure asm compilers I know) Axe is not allowing to use pointers before these pointers are defined.

I could put the Data( with all pointers into the last line and update the pointer to this Data( in the main code always when I change something in the language pack, but this wouldnt be efficient developing, huh?

So, the best solution for the problem would be that Quigibo let the compiler search for Str1 in the whole code, when Str1 is used before it is defined. While it isn't able to use the Data( in the first line, I have no other choice but I must put the Data( into the last line.

However, website update: http://xeverion.net.tc/ Added basic infos and the recent screenshot.

Offline Builderboy

  • Physics Guru
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5673
  • Rating: +613/-9
  • Would you kindly?
    • View Profile
Re: Xeverion
« Reply #59 on: November 16, 2010, 12:14:48 pm »
You could define empty data for the first line and then once you define the strings update the first lines.