IRC logs for #opendune on OFTC at 2011-09-15
            
00:41:25 *** glx has quit IRC
00:41:36 *** glx has joined #openDune
02:59:04 *** glx has quit IRC
12:13:55 *** glx has joined #openDune
12:13:55 *** ChanServ sets mode: +o glx
12:14:47 <glx> hello
13:49:26 <TrueBrain> "I'd never have realized this without the OpenDune code though.. just as I would never have realized that tons of the previously-unknown values at the start could never be identified because they were shared by units and buildings, but completely unused by one of them. "
13:49:32 <TrueBrain> from http://forum.dune2k.com/topic/19114-dune-2-dune-ii-editor-with-107-support/page__st__540
13:49:43 <TrueBrain> and this is why I didn't want to use his information from the start :D
14:14:34 <Xaroth|Work> lol
15:34:54 <TrueBrain> glx: segra gave me the idea to make a EMC compiler, and a higher language on top of that; going to fiddle with that now (and most likely during the next 3 days :P)
15:35:12 <glx> have fun :)
15:35:18 <TrueBrain> I will :)
15:35:23 <TrueBrain> higher language will be in python
15:35:28 <TrueBrain> lower in C I guess .. :P
15:35:39 <TrueBrain> it can borrow the ChunkFile_Read nicely :P
17:12:52 <TrueBrain> hmm
17:12:55 <TrueBrain> no EMC has TEXT
17:12:56 <TrueBrain> lolz
17:13:02 <TrueBrain> most likely due to translations
17:13:35 <TrueBrain> but we can just remove that stuff I guess
17:20:16 *** Alberth has joined #openDune
17:20:16 *** ChanServ sets mode: +o Alberth
17:28:15 <TrueBrain> http://devs.opendune.org/~truebrain/team.txt
17:28:17 <TrueBrain> first extract
17:57:59 <TrueBrain> new version :D
17:58:30 <glx> better :)
17:58:55 <TrueBrain> glx: regarding the last commit ( DorpsGek is not reporting, forgot to fix that)
17:59:01 <TrueBrain> can you help me finding better names?
17:59:04 <TrueBrain> they are a bit longish now
17:59:14 <TrueBrain> Alberth / planetmaker : feel free to join the naming party :D
17:59:19 <glx> will look after dinner
18:00:16 <Alberth> enjoy :)
18:00:34 <Alberth> oh, that's much better than the previous one :)
18:01:04 <planetmaker> naming?
18:02:06 <TrueBrain> http://svn.opendune.org/?action=changelog&rev=2535
18:04:16 <TrueBrain> mostly I wonder about the names PUSH_RETURN_OR_LOCATION, STACK_REWIND, ..
18:04:23 <TrueBrain> any better suggestions are very welcome :)
18:06:14 <TrueBrain> what is a good name for the bitwise negation (~)
18:06:23 <TrueBrain> I am tempted to name it XOR
18:06:59 <planetmaker> function an instruction is the same?
18:07:09 <TrueBrain> sorry?
18:07:16 <planetmaker> of course XOR is good for that.
18:07:25 <planetmaker> I talked of values 14 and 15
18:07:42 <TrueBrain> a function is a C function
18:07:45 <TrueBrain> which can be anything
18:07:49 <TrueBrain> (there are like 80+ functions)
18:08:08 <planetmaker> ok, just checking it's really different... I'm missing the context of the diff :-)
18:08:54 <TrueBrain> yeah; I can udnerstand that :)
18:08:59 <planetmaker> your naming is good IMHO
18:09:09 <planetmaker> and they're not too long either
18:09:10 <TrueBrain> some feel icky ..
18:09:23 <TrueBrain> but if you could understand what they do, that is good :)
18:09:24 <planetmaker> well... they do... sometimes... but it's difficult
18:09:42 <planetmaker> and the comments make me feel like I should know what they do
18:10:23 <planetmaker> SCRIPT_SET_RETURNVALUE maybe
18:10:25 <planetmaker> with one _ more
18:10:36 <TrueBrain> it is variable returnValue
18:10:40 <TrueBrain> also a silly name tbh
18:10:52 <TrueBrain> lot of shit is never used too ...
18:11:19 <planetmaker> and... maybe just SCRIPT_JUMP and ..._JUMP_NE
18:11:28 <planetmaker> a jump always has a target ;-)
18:11:47 <planetmaker> (0 and 15)
18:12:44 <TrueBrain> http://svn.opendune.org/?action=changelog&rev=2536
18:12:47 <TrueBrain> (sucky DorpsGek :P)
18:13:15 <Xaroth|Work> DorpsGek is teh b0rked?
18:13:15 <planetmaker> like that, yes
18:13:23 <TrueBrain> Xaroth|Work: it listens on the wrong port :P
18:13:36 <Xaroth|Work> then change the commit script? :P
18:14:06 <TrueBrain> there is nothing I can change it into which makes it work
18:14:24 <Xaroth|Work> ah
18:14:43 <TrueBrain> http://devs.opendune.org/~truebrain/team.txt
18:14:46 <TrueBrain> almost readable :P
18:16:21 <TrueBrain> http://devs.opendune.org/~truebrain/build.txt
18:16:24 <TrueBrain> http://devs.opendune.org/~truebrain/unit.txt
18:21:37 <TrueBrain> lets reduce the amount of labels ...
18:24:58 <TrueBrain> http://devs.opendune.org/~truebrain/team.txt
18:25:00 <TrueBrain> :D
18:29:46 <Alberth> STACKREWIND 1 <-- DROP 1 (or just DROP)
18:30:05 <TrueBrain> but then how to call STACKFORWARD?
18:30:11 <TrueBrain> (I wouldn't know why that would ever be used, but enfin)
18:30:37 <TrueBrain> unit uses it a few times, bah
18:31:33 <Alberth> the code reminds me a bit of Forth :)
18:33:06 <Alberth> RESERVE 3 ?
18:34:55 <TrueBrain> nice
18:35:18 <TrueBrain> updated team.txt
18:37:36 <Alberth> XOR -> INVERT ??
18:37:49 <TrueBrain> no
18:37:51 <TrueBrain> ~a
18:37:56 <TrueBrain> bitwise negation
18:38:05 <TrueBrain> INVERT is ambigious
18:38:10 <TrueBrain> I guess in some way it is the same :)
18:42:35 <TrueBrain> PUSH 1
18:42:37 <TrueBrain> JNE 39
18:42:39 <TrueBrain> even in scripts they are just silly
18:42:48 <TrueBrain> NOP NOP
18:42:49 <Alberth> xor is a binary operator for me, you are probably right that xor is more clear what it does
18:42:50 <TrueBrain> does the same
18:43:04 <TrueBrain> XOR is also an unary operator, which is always the issue :)
18:43:09 <TrueBrain> the binary I called BXOR
18:43:19 <TrueBrain> a similar problem exists with AND and BAND
18:43:22 <Alberth> they had a very stupid compiler :)
18:43:27 <TrueBrain> AND is the binary compare, and BAND the binary operator
18:43:50 <TrueBrain> I am trying to get Xaroth|Work write a higher language for this ... I think he is going for Python atm :P
18:44:19 <Alberth> good choice Xaroth|Work :)
18:44:44 <TrueBrain> all the script functions start with this PUSH 1 JNE <end of script>
18:44:46 <TrueBrain> I wonder why ...
18:44:51 <Alberth> and I was always thinking compare was written as CMP :p
18:45:11 <TrueBrain> where?
18:45:13 <Alberth> return value?
18:45:32 <Alberth> strcmp for example :)
18:45:41 <TrueBrain> to what were you refering
18:45:53 <TrueBrain> it sounds a bit out-of-the-blue comment without a context
18:45:53 <Alberth> "AND is the binary compare"
18:46:05 <TrueBrain> ugh ... lolz
18:46:22 <TrueBrain> if you call && CMP, fine by me :)
18:46:41 <Alberth> your short term memory needs to be increased in size, or you need a higher chat window :)
18:46:48 <TrueBrain> POP LOCATION
18:46:49 <TrueBrain> POP LOCATION
18:46:51 <TrueBrain> always ends a function
18:46:52 <TrueBrain> very odd
18:48:51 <TrueBrain> now how am I going to name CALL IDs
18:49:00 <TrueBrain> these names are far from known and are prone to changing
18:50:19 <TrueBrain> what do you guys think: we can either implement lua (embedded) in OpenDUNE to replace EMC, or use an encoder (like grfs) and keep this bytecode?
18:50:37 <Alberth> you'd think a true stack-based language would be simpler to implement than this mix
18:51:13 <TrueBrain> lua embedding is relative easy to add
18:51:16 <Alberth> in amount of work, lua is simpler probably
18:51:17 <TrueBrain> but it is another dep on the project
18:51:30 <TrueBrain> and it restrict you to one language
18:51:48 <TrueBrain> that while with a higher language which is not in OpenDUNE, you have a bit of freedom (NML vs NFO)
18:52:07 <Alberth> I did a small bit of lua in corsix, and I am not sure what to make of it
18:52:28 <TrueBrain> it is so insane fast :P
18:52:52 <Alberth> they seem to have lots of trouble with the dynamic nature, variables pointing to nil
18:52:57 <TrueBrain> meh; I don't like the idea of restricting ourself to a language tbh ...
18:53:27 <TrueBrain> no, lets keep EMC, clean it up where possible, extend it for all I care, and lets make a higher language on top :)
18:53:48 <Alberth> I picked the nml-route in freerct
18:53:58 <Alberth> but there you have a lot of graphics
18:54:30 <Alberth> I think keeping EMC is the right thing here
18:55:22 <TrueBrain> yeah, keeping NML like stuff for graphics is the best thing to do
18:55:30 <TrueBrain> modularity without cross-compile issues
18:56:19 <Alberth> actually, I am very much thinking to replace nml by python itself atm :)
18:56:41 <TrueBrain> Xaroth|Work noticed you can get the lex result of a piece of python from python
18:56:45 <TrueBrain> tokonizer or what is it called
18:56:50 <TrueBrain> in fact, you can even get the bytecode :P
18:57:05 <TrueBrain> really powerful to convert it to another format I think
18:57:14 <TrueBrain> I rather have the AST, but okay
18:57:16 <Alberth> yeah, Python is very well designed for such stuff
18:57:25 <TrueBrain> I wonder if Python has optimizers for its AST
18:57:40 <Alberth> there is a -O flag iirc
18:58:00 <Alberth> but the bytecode and AST is version specific
18:58:14 <TrueBrain> I wonder if there is any valid reason why the EMC functions start with this PUSH 1 / JNE, and end with POP LOCATION POP LOCATION ...
18:59:00 <Xaroth|Work> import tokenize
18:59:01 <Alberth> they jump just to the next location with JNE ?
19:00:13 <glx> TrueBrain: the end is not clear
19:00:47 <glx> maybe PUSH 1 /JNE is a kind of stack check
19:01:17 <Alberth> or a jump to 1 (or 0?) means 'end of routine' ?
19:02:55 <TrueBrain> Alberth: but nothing jumps to 1
19:02:57 <TrueBrain> which is odd
19:03:01 <TrueBrain> glx: which end, sorry?
19:03:25 <glx> end of function, I don't understand how it ends
19:03:36 <TrueBrain> they don't
19:03:38 <TrueBrain> infinite loop
19:05:07 <glx> ha right, unless the JNE jumps
19:05:30 <TrueBrain> which can never happen ...
19:05:37 <TrueBrain> UNIT.EMC is also weird, starts with dead code :P
19:35:42 <TrueBrain> http://devs.opendune.org/~truebrain/team.txt
19:35:43 <TrueBrain> prettier
19:37:19 <TrueBrain> (name dfunctions)
19:37:30 <TrueBrain> @calc 0x3f
19:37:30 <DorpsGek> TrueBrain: 63
19:38:27 <Alberth> you should know such values without calculator :)
19:40:07 <Alberth> code is becoming readable even :)
19:46:37 <TrueBrain> updated the other scripts too
19:46:47 <TrueBrain> there is one problem with changing the EMC
19:46:51 <TrueBrain> loading savegames break immediatly :)
19:48:45 <TrueBrain> call (null)
19:48:46 <TrueBrain> that is wrong :D
19:49:40 <TrueBrain> it helps to pick the right array :D
19:50:45 <TrueBrain> lol; slabs:
19:50:52 <TrueBrain> C100:
19:50:53 <TrueBrain> PUSH 1
19:50:54 <TrueBrain> JNE C108
19:50:56 <TrueBrain> PUSH 600
19:50:57 <TrueBrain> CALL GENERAL DELAY
19:50:59 <TrueBrain> DROP 1
19:51:00 <TrueBrain> JUMP C100
19:53:58 <TrueBrain> POP LOCATION is of course just RET
19:54:03 <TrueBrain> (it also modified the framepointer for example)
19:54:07 <TrueBrain> then what to call PUSH LOCATION
19:54:12 <TrueBrain> INIT ?
19:54:20 <TrueBrain> PUSH SUB
19:54:29 <Alberth> START
19:54:37 <TrueBrain> PUSH LOCATION
19:54:38 <TrueBrain> JUMP C0
19:54:40 <TrueBrain> is an example
19:54:50 <TrueBrain> returns with:
19:54:52 <TrueBrain> C60:
19:54:53 <TrueBrain> POP LOCATION
19:55:32 <TrueBrain> ugh, I would just have made that one opcode called: SUB C0
19:55:36 <TrueBrain> but okay
19:56:18 <Alberth> once Xaroth|Work has finished the program, you'll never see this code any more :)
19:56:35 <TrueBrain> no, but it is generated :P
19:56:38 <TrueBrain> so I want it to be tight :D
19:57:05 <TrueBrain> SAVE / JUMP ... / RET
19:57:07 <TrueBrain> makes sense/
19:57:11 <TrueBrain> (or sense enough)
19:57:23 <TrueBrain> STORE?
19:57:26 <TrueBrain> PREPARE?
19:57:35 <Alberth> POP PC
19:57:48 <TrueBrain> well, it is the PUSH I wonder about
19:57:51 <TrueBrain> the POP we can call RET :)
19:58:23 <Alberth> ENTER
19:58:31 <TrueBrain> <3
19:58:56 <TrueBrain> that makes much more sense :D
19:59:37 <glx> the first push is opcode 2 ?
19:59:37 <TrueBrain> unit.emc doesn't start with silly JNE
19:59:51 <TrueBrain> opcode 2, parameter 1, yes
20:00:13 <glx> then push was too generic ;)
20:00:20 <TrueBrain> it was PUSH LOCATION
20:00:37 <glx> it was PUSH 1 in some versions ;)
20:00:42 <TrueBrain> it never was
20:00:53 <glx> C0:
20:00:53 <glx> PUSH 1
20:00:53 <glx> JNE 39
20:00:55 <TrueBrain> yes
20:00:57 <TrueBrain> we aer not talking about that
20:01:08 <TrueBrain> that is still PUSH 1
20:02:08 <glx> and that still makes no sense ;)
20:02:18 <TrueBrain> owh, I know :D
20:02:25 <TrueBrain> they indeed had a higher language :)
20:02:28 <TrueBrain> while (1) {}
20:02:31 <TrueBrain> it is exactly that :D
20:02:50 <glx> ha right
20:03:00 <glx> JNE checks stack
20:06:59 <TrueBrain> spotted it because of windtraps :)
20:07:03 <TrueBrain> they first animate, then remove fog, THEN go in this while
20:08:18 <Alberth> TrueBrain wins the main price today :)
21:13:14 *** Alberth has left #openDune
21:29:59 <TrueBrain> ah; stackpointer forward is used for local variables :)
21:30:01 <TrueBrain> nice
21:30:13 <TrueBrain> RESERVE 2
21:30:15 <TrueBrain> PUSH 10
21:30:16 <TrueBrain> POP LOCAL 2
23:20:42 <TrueBrain> okay, I have a decoder and encoder :D
23:20:46 <TrueBrain> well, almost .. encoder needs labels :P