Documentation Discussion
#41
Posted 21 October 2005 - 06:48 PM
For the CLSN:
I would do it this way:
Limit the Numbe of boxes to 256 (good for numbering)
For the "Same name" boxes I would really much like to create some kind of grouped version (read sth. about it somewhere).
So say you call the box "Group:Name" and then you can check for collision with "Group:Name" or wirh "Group:*" which would include all boxes of the group ("*.*" is forbidden because of speed) Also I would limit the objects in one group to 8).
Objects that dont need grouing (like the one box character) will get in a "general group" which will have no name ":foe01" for example. The unnamed group will accept 64 boxes.
This is my idea for the usage in the data section:
Group:Name ---> 0:0 (first group, first name)
In the memory area for the CLSN boxes you will have 1 byte for the group (0 beeing the unnamed group) and 1 byte for the id. This byte (5 bits remaining) does also include:
*a collide flag that will call the COLLIDE function with the names of the 2 objects if set and if a collision happens (good for constantly moving objects)
*a rotate flag (need to be set if the box needs to be rotated too (good for speed if you have a sprite where the box needn't be rotated). The box is only rotated if on
*a flip flag (same as above for flipping)
2 preserved flags
then the 4 edges folow (? 1 byte) --> 4 byte and then you have 6 bytes per box.
this makes for the unnamed group a maximum of 600 bytes
and for the other groups (255*8*6) = 11,96 KB maximum
...
thinking about it I also come slowly to the conclusion that a data section has some major benefits for speed on such complex solutions that actually are not set up but only changed during runtime ... maybe I'll reintroduce it. .. so till I decided this and worked it out no beta
Anyway
I need urgently a good 5x6 font (5 pixles + 1 free col for space and 6 pixels + 1 free line) If anyone is skilled at making one (paint) then PLEASE do so. I simply can't do a good font ... I had one for CNC but it looked ugly. I can upload it if you want but I don't think I'll use it for MLC2 ...
here is the new MLC2 verision: www.earthforge.com/huhnm/MLC/MLC21012.pdf
(I also updated the link in the first post)
#42
Posted 21 October 2005 - 09:42 PM
For the font, does it HAVE to be a 5x6 one? maybe you could consider using 4x7 MLC1 font?
Anyway, i'll try to create some font but i don't promise it will be great
EDIT:
Ok, here's something i made in those 10 minutes: (5 pixels per character + 1 pixel blank space. Is that what you meant?) I just didn't have any good idea for '{' and '}' characters... |
#43
Posted 22 October 2005 - 07:20 AM
maybe I could help a bit with the font. For another project I made a modified ASCII char table including most greek chars and special math / logic symbols once. Maybe you could need some parts of it, the one is 5x6, 5x7 the other:
#44
Posted 22 October 2005 - 08:37 AM
thanks for your work though, deimos but there are some chars missing.
I'd like 5x6 since this gives us 10 lines of text (like marco did it) and 21 columns (like the original font for the casio).
I can't imagine that 4x7 is readable since the chars are quite narrow then and chars like y or w or m look difficult.
You can't see wether it is m or n anymore then.
#45
Posted 22 October 2005 - 04:23 PM
#46
Posted 24 October 2005 - 08:39 PM
#47
Posted 24 October 2005 - 09:45 PM
SPRT.BOX(1)={1,1,8,8} // sets first clsn box to go from 1,1 to 8,8 (positions relative to sprite)
then for CLSN: i think we need 2 types of CLSN functions, we're trying to jam to much into a single function.
CLSN: accepts a sprite and returns pointers to all sprites touching it
#CLSN <sprite> <pointer array>
note: i forget if we can do pointer arrays, so i have a workaround below.
BHIT: takes two sprites and returns a list of boxes that are touching.
#BHIT <sprite> <sprite> <array>
CLSN can be used as a quick check to see if a BHIT is even needed in any given circumstance, and it allows for much more flexibility.
--> Workaround for pointer arrays:
if we cant do pointer arrays, we can do this instead, give each sprite an ID property, and create a function that can retrieve a sprite given its ID. ex:
CLSN ^SPR1 @A // A is given all IDs of sprites touching SPR1
#SPID @A(1) *SPR // gets a pointer to a sprite using its ID
#BHIT ^SPR1 *SPR @BOX // gets all touching boxes in the two sprites
btw, fogive me if im using outdated sentax
#48
Posted 25 October 2005 - 05:03 PM
Actually the main problem is the compiler since it needs quite some work. The VM is getting better and better
#49
Posted 25 October 2005 - 07:39 PM
#50
Posted 27 October 2005 - 06:45 PM
#51
Posted 27 October 2005 - 07:30 PM
the first release will only be a proof of concept so it will only be of worth for you if you can code in the bytecode (doc only in german atm ) but it should have some functions (and even some additions to the doc I have a working version right in front of me. The only thing that is not tested is grayscale since it does not work with WG100 and I can't connect the calc to the Notebook and since most of the coding I do at work I can't test ... had no time yet
#52
Posted 27 October 2005 - 07:59 PM
Huhn_m, did Crimson give you the CLSN docs ? I wish he did it. I hope it will help you better to understand all what I tried to explain (most are in page 2 and 3). I'd like to make my MLC street fighter game better.
#53
Posted 27 October 2005 - 08:44 PM
#54
Posted 27 October 2005 - 09:06 PM
#55
Posted 28 October 2005 - 05:09 PM
#56
Posted 29 October 2005 - 06:57 AM
#57
Posted 03 November 2005 - 07:41 PM
Implemented:
Timer, (Delay ... basics for time based functions)
Text function
WaitKey function
HALF function
CLRS function
Mouse support (together with keyboard, partial)
Since I figured that only the bitcode interpreter is not much use and
since coding goes so smoothly the last days I decided to also code
the compiler before the first beta. Since most of the MLC2 users probably don't even know ASM I don't think they can cope with the sole numbers in the bytecode.
So the next target is the 14th of November for the real first beta, with a working compiler. (99% also with function support already but probably no real graphics functions (sprites, lines etc) so still more a proof of concept.
Btw. has anyone a GOOD source for a line drawing routine is ASM for the AFX (NOT one that draws each pixel seperately! It should be fast) since this would ease my pain a little. Also not hline or vline but a REAL line algorithm.
#58
Posted 04 November 2005 - 01:51 PM
The Line routine doesn't draw each pixel seperately but assembles lines out of several HLines (or VLines, if the line is more than 45 degrees). I didn't put the routine into AFXGFX public version because I haven't translated it into assembler, it's pretty fast nevertheless (around 100 to 200 lines from top left corner of the screen to bottom right) cause the V- / HLINE routines are made in assembler (maybe you also could rewrite the algorithm in assembler completely but I think it wouldn't be much faster as most time is consumed by V - / HLine subroutines anyway)
#59
Posted 04 November 2005 - 02:59 PM
No, I don't use the pascal libraries any more since I'm just not good enough in pascal to acchieve this project. I use 100% asm now and it works
I only need some routines that are difficult to do (like the line routine)
#60
Posted 04 November 2005 - 07:46 PM
And what does the HALF functio do? I couldn't find it in the doc.
#61
Posted 04 November 2005 - 09:32 PM
I looked in the updated documentation and couldn't find anything about array types...is it '#arry %intarry,5', then?
Can chars be treated as ints? (so huge lookup tables aren't needed for printing chars in order, for example)
What's the max length of varnames and function names?
Are there plans for modulus, AND, and OR operators?
Also, the pointer should have a dereference operator ('*ptr=3' instead of 'ptr.=3', for situations like '%int=*ptr+1', '#pixt 20,30,*ptr', etc.)
#62
Posted 05 November 2005 - 01:24 PM
2) Array: see the docs ... it is in there from the update 2 weeks ago... the array char plush the type char (so 2 prefixes)
3) Chars as ints... yes. I do this. But the compiler has to do range checking
4) Max lengths. I set it for 14 chars for me. Ultimately the length doesn't matter but only the first 14 chars are used to differ the function
so MLC2RocksMyBoxers
is the same as MLC2RocksMyBoxes
5) These are in the VM (already implemented ... don't know if it will be in MLC2 .. do we need them? If yes how do you want them. You can decide too! Its not only my project )
#63
Posted 05 November 2005 - 11:30 PM
Btw. you really write *everything* in assembler? Even the compiler??
#64
Posted 06 November 2005 - 02:07 PM
It is also good practice sine I want to write a native 64-Bit OS for my new machine (just for working. E.g. easy word processor, spreadsheet and so on. This is a lot of fun (for me) and will be a hyper-fast, instant on os!
#65
Posted 07 November 2005 - 07:48 PM
Just a question : I know the max int values (+-32 000) are given by the bit numbers of the processor. However, couldn't there be a way to increase this number limit for specifics vars ? Or using floating points. In some case, it's necessary. Or a way to have real numbers (3,4) more easily than using DX and VX ? If someone has a great idea ... Say it.
#66
Posted 07 November 2005 - 08:23 PM
At most fixed poiint maths but I don't think so, too easy to implement, would shed the roots of the engine (nearly complete rewrite needed, verry complex ... not with me. Sorry )
#67
Posted 07 November 2005 - 08:58 PM
How much times would it be possible to be faster than MLC1 ?
Well, don't know MLC1 performance, but if he still uses the framework we worked out for the VM when I still was in the project it should make around 140k ADD instructions a second.
#68
Posted 07 November 2005 - 09:16 PM
So yes. 140K or faster
I use TASM btw and for AMD64 I use FASM (only one with curremt builds, I use the one from last month)
#69
Posted 08 November 2005 - 03:45 PM
#70
Posted 08 November 2005 - 04:59 PM
I think that we do need modulus, it can be quite useful. I would also like to see a function computing absolute value in mlc2 - it was one of the things i wanted to see since mlc1.(modulus, AND, OR)
5) These are in the VM (already implemented ... don't know if it will be in MLC2 .. do we need them? If yes how do you want them. You can decide too! Its not only my project )
IMO logical operators would be really nice to have too.
#71
Posted 10 November 2005 - 07:37 PM
2) Array: see the docs ... it is in there from the update 2 weeks ago... the array char plush the type char (so 2 prefixes)
3) Chars as ints... yes. I do this. But the compiler has to do range checking
4) Max lengths. I set it for 14 chars for me. Ultimately the length doesn't matter but only the first 14 chars are used to differ the function
so MLC2RocksMyBoxers
is the same as MLC2RocksMyBoxes
OK, MLC1 arrays will just have the var type prefix (because I'm lazy and don't feel like writing all the extra code ), char values will wrap around after 255, and 14 chars would take up too much mem on the 86, so that'll be cut down to 10 in MLC1. What does everyone else think about the pointer dereference operator? Sorry, one more question:
Will numbers be allowed in string expressions? ($STR="Score: "+%SCORE / $STR=3+4 / etc.) They were in the first version of MLC, and ended up being very useful. BTW, the result of the second expression would be "34", not "7".
<offtopic>
You're writing your own OS in ASM?!?!? *bows down in awe*
</offtopic>
Edited by burntfuse, 10 November 2005 - 07:40 PM.
#72
Posted 10 November 2005 - 08:10 PM
the first beta out ... sorry for the delay but had some problems at
work and stuff (and the PC upgrade and so on ...)
Still, there is one thing left. I need a GOOD coder who can write a dedicated editor for MLC2. Else the whole thing is quite shaky.I don't like the way it was done in MLC1 (with replacing and stuff).
So if there is any ASM/C coder for the AFX out there who feels capable to write such an editor feel free to do so. No limitations (Pascal allowed etc. )
No interface things. Just an editor. (Though tooken selection would be nice but is not allowed).
Numbers in expressions. No. At least not in the first version. Use the ITOS (Int To String) function instead. The translation should be similar so maybe
we'll add direct concatentating (sp?) later.
OS: Wait ... I'm still reading the AMD64 Bit system programmers manual and it is quite badly written (repetitive, to many text, to few examples, but I think the most tricky part is to get the damn CPU in long mode. Once this is done everything should be fine. I just want a FAST working environment (graphically, VESA based or so) that has an instant on effect and is 100% optimized to the dual core Athlon64 (though I still need to find dual-core docs )
#73
Posted 12 November 2005 - 08:51 AM
#74
Posted 12 November 2005 - 10:27 AM
#75
Posted 12 November 2005 - 05:55 PM
I'm prepared to test the beta. Let's gooooo.
#76
Posted 13 November 2005 - 10:35 AM
#77
Posted 13 November 2005 - 02:03 PM
It's not that hard to implement, could be this like: Press F6 in the editor and it will remove itself from memory and start the compiler with passing the name of the file to be compiled as a command line argument.
The compiler compiles the source then and starts the interpreter (with the bytecode file's filename as a command line argument) if no error occured. If an error occured during compilation, it will remove itself from memory and start the editor again, passing the filename of the source and the position within source where the error occured as command line arguments. Using this arguments the editor scrolls down directly to the position where the error was and you can fix it.
This way you had fine edit->compile->test->edit - cycle like in a real IDE, so finding / removing errors in source also would be much easier and faster
#78
Posted 13 November 2005 - 03:00 PM
#79
Posted 13 November 2005 - 04:10 PM
But unfortunately i can't offer writing an editor - i have very little spare time recently, and i'm still not very good at C programming.
#80
Posted 13 November 2005 - 05:41 PM
I recently said that I would make MLC2 open source. after throughly reading on gnu.org. I decided against it.
I now intend it to be Free Software.
See these sites for the reason:
http://www.gnu.org/p...or-freedom.html
http://www.gnu.org/g...ux-and-gnu.html
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users