Dateien

> > CS2D > Lua Scripts > The 4K CS2D 8-bit machine
DateiübersichtCS2D-ÜbersichtLua Scripts-Übersicht

Englisch The 4K CS2D 8-bit machine >

19 Kommentare8 kb, 679 Downloads

alt The 4K CS2D 8-bit machine

Hador
User Off Offline

∗ This is a fully functional 8-bit computer with 4KB of RAM implemented in CS2D using buildings. ∗

• Free Turing-complete instruction set inside!!! •


> Did anybody ask for this?
> Does anybody need this?
> Does it have any use to anyone?

> Answer to all three: No! But I made it anyway.


> Does it work?
I haven't tested everything, as this was a 12-hour challenge, but the important parts do, and I will fix bugs if you find any!



How does this work? >



How do I use this? >



How do I write code? >




That's pretty much it. Please leave a comment if you have any questions and feel free to expand upon this project in any (non-commercial) manner you like, I'd love to hear of anything useful that actually comes from this!

Also, due to math, code can go out of bounds in several places, so be weary of bytes popping up in random places. Literally.

Spoiler >
13× editiert, zuletzt 26.05.20 12:30:48
Zugelassen von BcY

Download Download

8 kb, 679 Downloads

Kommentare

19 Kommentare
Zum Anfang Vorherige 1 Nächste Zum Anfang

Logge dich ein!

Du musst dich einloggen, um selber Kommentare verfassen zu können!Einloggen

alt

ImSick4Fun
User Off Offline

Looks epic gonna try this
Ich mag es!

alt

Hador
User Off Offline

@user The Dark Shadow: It's a computer within CS2D.

The map is used for memory, with different buildings representing different values with the registers at the sides of the players, while the Lua script handles the actual functionality, so it's basically the CPU.

If you press the "execute" button, the program starts running, like a real computer would, but only at ~10Hz with current settings.

The script checks the value of the program counter bytes, which represent a position in memory, and then translates the byte at that position into an operation, with the following bytes used for the data of that operation.
What the script reads might be:
CT Barbed Wire: ADD
Nothing: Register[0]
T Barbed Wire: Register[1]

The script now removes all buildings from Register[0] and replaces them with the buildings that represent the value of Register[0] + Register[1].

Then the program counter is set to the next byte after the data for the last operation and continues there until you press the abort button.

alt

1uP
User Off Offline

Yo what

alt

The Dark Shadow
User Off Offline

I couldn't understand anything, Could you introduce us what actually it is?
Ich mag es!

alt

G3tWr3ck3d
User Off Offline

intersting
Ich mag es!

alt

Hador
User Off Offline

The name was kind of half-intentional, but when computer memory was still advertised in KB, they were generally called 4K or 8K machines, as memory was the limiting factor and I guess KB was just a bit clunky to use, so it’s definitely also a nod to early 80s computers

alt

medeiros
User Off Offline

Just when I thought I've seen in it all in this tiny lil' 2D game we all love... extremely impressive!

One little thing though: I think you forgot a "B" after "4K" in the title of the upload; when I first read it, I was like "what? A 3840×2160-capable computer running inside of CS2D!?"
Ich mag es!

alt

Dousea
User Off Offline

Damn impressed.
Ich mag es!

alt

Hador
User Off Offline

Thanks!

@user Avo: Thanks for the notice, I wasn't entirely sure about that any more! NOP doesn't technically stop the execution in this implementation, it just infinitely loops on the NOP because it doesn't update the program counter - it doesn't make much of a difference though I guess with the logic implemented in lua, so you could always just add 0 or something like that for the same effect

alt

Elfing
User Off Offline

This is awesome!
Ich mag es!

alt

Avo
User Off Offline

I like it! The only thing that is surprising is that
user Hador hat geschrieben
0: NOP - the program stops

since as far as I remember, NOP usually does nothing, not stops the execution

alt

Hador
User Off Offline

It was created because that's what I felt like doing last Sunday. It has no practical use that I know of, but if you think of one, let me know!

alt

Pagyra
User Off Offline

Hmm cool... but how can we apply this in practice, why is it created?
Ich mag es!

alt

Pseudon
User Off Offline

Lovely and inspiring. Indeed; computation is amazing and I can appreciate your project!
Ich mag es!

alt

Hador
User Off Offline

It's probably a deep-seated desire to make all of the knowledge accumulated in a computer science degree useful for something.

But thanks for the positive, if confused feedback, it means a lot! cookies

alt

VADemon
User Off Offline

I've never understood this passion, here or in Minecraft, to rebuild computers.
But you get a double-chocolate cookie with milk!
Ich mag es!

alt

_Lima_
User Off Offline

I didn’t understand anything, but I think it's cool.
Ich mag es!

alt

Xirot
User Off Offline

Good job.
Ich mag es!

alt

Gaios
Reviewer Off Offline

What the hell..
Ich mag es!
Zum Anfang Vorherige 1 Nächste Zum Anfang