Author |
Message |
Shaos
Admin
Joined: 08 Jan 2003 23:22 Posts: 22530 Location: Silicon Valley
|
|
25 Feb 2008 07:30 |
|
|
eudoxie
Maniac
Joined: 17 Sep 2012 13:36 Posts: 277 Location: 81.170.128.52
|
I've also written a short documentation of the new assembler
http://nedopc.org/ternary/tunguska/assembler.html
And uploaded an updated version of the specifications
http://nedopc.org/ternary/tunguska/specsdraft-cvs.pdf
|
25 Feb 2008 07:36 |
|
|
eudoxie
Maniac
Joined: 17 Sep 2012 13:36 Posts: 277 Location: 81.170.128.52
|
To test out the new floppy disk system, I put together a small pong clone using vector graphics and mouse steering.
It's nice because it illustrates pretty much every change from alpha-1 to soon-to-be-alpha-2. It's a bit sphagetti-code at the moment. It's also a nice indicator of how fast Tunguska really is. I had to put 8 calls to random (which effectively is a wait for next clock interrupt) just to get it slow enough to be playable. That's just south of 3000 idle instructions.
|
25 Feb 2008 11:14 |
|
|
Shaos
Admin
Joined: 08 Jan 2003 23:22 Posts: 22530 Location: Silicon Valley
|
It's almost uncontrollable by mouse
Also it looks slow on my Linux...
P.S. After removing "random" calls it became much faster
but still impossible to control something by mouse...
|
25 Feb 2008 19:36 |
|
|
eudoxie
Maniac
Joined: 17 Sep 2012 13:36 Posts: 277 Location: 81.170.128.52
|
Yeah, I know, the mouse has issues. I havn't been able to pinpoint exactly what's going wrong though.
As for the speed thing, I've got a dual-core computer, that probably has a huge speed effect (since it's dual threaded now adays).
--edit--
I tinkered with the mouse interrupts. They -may- be less buggy now. Not completely though.
|
26 Feb 2008 01:59 |
|
|
Shaos
Admin
Joined: 08 Jan 2003 23:22 Posts: 22530 Location: Silicon Valley
|
If you add API to read "real-time clock" with 1 ms precision from Tunguska programs then it will become possible to write "self adjustable" programs that will work similar on computers with different computational power.
|
26 Feb 2008 06:25 |
|
|
eudoxie
Maniac
Joined: 17 Sep 2012 13:36 Posts: 277 Location: 81.170.128.52
|
Hm, something like that could be doable. Something like a call that simply takes the host RTC, and stores it in a register. It would only be good for differentials since it wraps around to %DDD after %444, but it could be very useful to gague stuff like "how much time does it take to do this", and then adapt the program accordingly.
I'll tinker with that later.
--edit--
I need an opinion on an idea I had: Implementing some trigonometric functions on machine level, primarily sine and cosine. It would calculate the product of sine or cosine of the accumulator with a memory address, and store it in accumulator.
And the angle argument would be in degrees (it's a hard urge to resist with 364 being so close to 360.)
It would be very useful to have fast sine and cosine functionality with vector graphics and whatnot.
|
26 Feb 2008 06:49 |
|
|
Mac Buster
Retired
Joined: 03 Aug 2003 22:37 Posts: 1474 Location: Moscow
|
Is it possible to load raw binary data to memory of Tunguska without encoding to balanced ternary code ? I mean that after loading data should take as many trits as number of bits in original binary file. Binary 0s must be left as ternary 0s, and binary 1s should be left as ternary +1s (or it could be converted to ternary -1s).
|
26 Feb 2008 13:46 |
|
|
Shaos
Admin
Joined: 08 Jan 2003 23:22 Posts: 22530 Location: Silicon Valley
|
sin/cos may be implemented with values -364...+364 instead of -1.0...+1.0 and input may be degrees (0...360)
P.S. I tried to compile last version for Windows. First problem - using of option "-o" in tg_assembler does stack dump. Also "pong" is not working for some reason...
|
27 Feb 2008 04:35 |
|
|
eudoxie
Maniac
Joined: 17 Sep 2012 13:36 Posts: 277 Location: 81.170.128.52
|
Not by design, but there shouldn't be any problem writing a converter. The file format is just a gzipped series of signed shorts with values in the range [-364,364]. So, if you wanted to convert a "plain binary" file into a file that would effectively be loaded as you describe, you could write a function like this and iterate through all the bytes in the file, and write the output of bin2tern as an array of unsigned short to a file. Hm, that could work...
That's strange. I can't think of anything I have touched since the last version you ported. Maybe it's zlib-related somehow. (that's a dependency now)
Beyond that, I really can't help you. I haven't got any experience in cross-OS porting at all.
|
27 Feb 2008 11:31 |
|
|
Shaos
Admin
Joined: 08 Jan 2003 23:22 Posts: 22530 Location: Silicon Valley
|
Actually I tried to use options for a first time just in latest Windows version, so probably it was broken since first version...
|
27 Feb 2008 17:12 |
|
|
Shaos
Admin
Joined: 08 Jan 2003 23:22 Posts: 22530 Location: Silicon Valley
|
Ok, the next "unofficial" build of Tunguska for Windows:
http://nedopc.org/ternary/tunguska/tung ... _2-win.zip (1.1M)
P.S. Demo program pong.asm and pong.ternobj are included (with build_pong.bat and launch_pong.bat)
P.P.S. For CYGWIN version the order of arguments is important:
tg_assembler pong.asm -o pong.ternobj crashes, but
tg_assembler -o pong.ternobj pong.asm works and
tunguska out.ternobj -F pong.ternobj does nothing by LOADSUB, but
tunguska -F pong.ternobj out.ternobj runs the demo...
Last edited by Shaos on 11 Nov 2012 17:39, edited 1 time in total.
|
27 Feb 2008 18:21 |
|
|
eudoxie
Maniac
Joined: 17 Sep 2012 13:36 Posts: 277 Location: 81.170.128.52
|
I think that's how it is supposed to behave in Linux as well, strictly speaking from how 'getopt' is specified. So the problem is that Linux libc does it's work better than it's supposed to.
--
I'm considering changing the default file extension away from .ternobj to something more manageable. I haven't made up my mind as to what to replace it with. I've got the following ideas:
.tto, as in ternary/tunguska object.
.tti, as in ternary/tunguska image.
.tmi as in ternary/tunguska memory image.
.tmo as in ternary/tunguska memory object.
.img as in image. Problem with this one is that the extension also is used for CD images and whatnot, and it could cause confusion as to what sort of file it is.
I'd also be glad to hear other suggestions.
--
I put up a test build of tunguska just now. If you can get it to build without any problems (it's using automake instead of that homemade makefile system I used with alpha-1), I'm going to release version 0.0.2 within a few days.
http://nedopc.org/ternary/tunguska/tung ... st.tar.bz2
|
28 Feb 2008 08:44 |
|
|
Shaos
Admin
Joined: 08 Jan 2003 23:22 Posts: 22530 Location: Silicon Valley
|
It's compiled successfully, but make install tried to install binaries to /usr/bin that is not good I think, because by default it should be /usr/local/bin, right?
P.S. What if extension will be simply .tg? tg_assembler will create tg-files
|
28 Feb 2008 17:21 |
|
|
eudoxie
Maniac
Joined: 17 Sep 2012 13:36 Posts: 277 Location: 81.170.128.52
|
That's peculiar. Could you try compile some other automake-based package and see if it does the same? It attempts to install to /usr/local/bin on my system.
--edit--
I just released version 0.0.2.
|
28 Feb 2008 23:40 |
|
|