Live data from Hacker News

TIS-100: An emulator for a CPU that doesn't exist

eviltrout.com

11–20 of 38 posts

Re: TIS-100: An emulator for a CPU that doesn't exist

#11
post #8

I too wrote a TIS-100 simulator in C ( https://github.com/hthh/tis100sim ) - it's interesting to compare styles. (I get a bunch of errors on OS X unless I change "CC=gcc" to "CC=clang", btw)

Well, I wrote one in Haskell, so there!

(Currently trapped in legal hell. I work for one of those annoying companies that claims ownership of everything I do, even in my personal time, so I have to get it cleared before I can push it to github...)

I added some extensions to allow one node to program another; the PROGRAM opcode resets the node in that direction, and it can then be fed a series of numbers which form the program. Once complete it starts executing.

With this, it ought to be possible to program an arbitrary network with programs from a boot ROM attached to a single node at the corner. It would have to propagate the distribution program through the network, which would then in turn propagate the program to the right place and reprogram each node in turn. Because a programmed node wouldn't contain the distribution program any more we'd have to start at the outer edge and work inwards.

I do wonder whether it would be possible to get real work done with this. I bet a node could be implemented in a tiny handful of FPGA gates.

Re: TIS-100: An emulator for a CPU that doesn't exist

#12
post #8

I too wrote a TIS-100 simulator in C ( https://github.com/hthh/tis100sim ) - it's interesting to compare styles. (I get a bunch of errors on OS X unless I change "CC=gcc" to "CC=clang", btw)

Well, I wrote one in Haskell, so there! (Currently trapped in legal hell. I work for one of those annoying companies that claims ownership of everything I do, even in my personal time, so I have to get it cleared before I can push it to github...) I added some extensions to allow one node to program another; the PROGRAM opcode resets the node in that direction, and it can then be fed a series of numbers which form th…

There's a reason to move to Silicon Valley - its illegal in CA for a company to claim work you do on your own time.

Re: TIS-100: An emulator for a CPU that doesn't exist

#15
The game itself I love. But I have some issues with it's implementation.

To be specific, it maxes out the CPU even when it's not doing anything. Given that it's supposed to emulate low-level hardware, at very slow speeds, and does not have any demanding graphics, I fail to see why it should do that.

(It's something I've seen happening in more games as of late, actually. For example, Desktop Dungeons - a very fun game which has no business demanding anything from my computer since it's turn-based, uses sprites, and barely animated. And yet my laptop heats up as soon as I open the game.)

In fact, it's a bit ironic, given that the whole theme of the game is squeezing out performance out of bare metal hardware, and I admit that I'm more annoyed by it for that somewhat irrational reason.

Re: TIS-100: An emulator for a CPU that doesn't exist

#16

The game itself I love. But I have some issues with it's implementation. To be specific, it maxes out the CPU even when it's not doing anything. Given that it's supposed to emulate low-level hardware, at very slow speeds, and does not have any demanding graphics, I fail to see why it should do that. (It's something I've seen happening in more games as of late, actually. For example, Desktop Dungeons - a very fun game…

It's still in early access, perhaps a bug report to the developer would be in order? It doesn't do this on my machine, so it might not be occurring for them.

Re: TIS-100: An emulator for a CPU that doesn't exist

#17
post #7

it's only a matter of time before someone runs linux on it.

Doubtful. Having only one usable register (plus another non-addressable "backup" register) places a (IMO) insurmountable constraint on running any multiuser unix-like kernel.

Well, the trick to the game is that you have multiple cores, each with their own register and a pipeline between them. This effectively gives you six registers, since you can bounce values back from the core on an edge register.

There are also "stack" cores, which store an arbitrary number of values and allow you to pop them back off.

If you were able to expand the system to have N cores of any type, I could easily imagine someone being able to compile C down to it.

Re: TIS-100: An emulator for a CPU that doesn't exist

#19
post #8

I too wrote a TIS-100 simulator in C ( https://github.com/hthh/tis100sim ) - it's interesting to compare styles. (I get a bunch of errors on OS X unless I change "CC=gcc" to "CC=clang", btw)

I just learned about your project today and it's fantastic! We must think alike.

Re: TIS-100: An emulator for a CPU that doesn't exist

#20

Earlier quoted context omitted.

Doubtful. Having only one usable register (plus another non-addressable "backup" register) places a (IMO) insurmountable constraint on running any multiuser unix-like kernel.

Well, the trick to the game is that you have multiple cores, each with their own register and a pipeline between them. This effectively gives you six registers, since you can bounce values back from the core on an edge register. There are also "stack" cores, which store an arbitrary number of values and allow you to pop them back off. If you were able to expand the system to have N cores of any type, I could easily i…

That's a great point. Using other cores' registers is required to pass many scenarios in the game, and I'm embarrassed I forgot about the technique after being away for only a few days :) Thank you!
Post reply on HN