Jump to content

[0.21] [Alpha] [2013-09-08] Ketchup: DCPU-16 Programmable Computer


zengei

Recommended Posts

I assume that once there are external storage systems (such as the Floppy Drive), they will be persistent as well. If so, will the stored memory sections be machine-independent (i.e. of specific endianness)? I've been working on a floating point coprocessor based on the x87 architecture but I've been having endianness problems with data types spanning multiple words. It would be nice to know whether I have to invert the byte order or just the word order when interacting with DCPU memory.

Endianness trouble forms the backstory of the DCPU-16, but the spec states:

For stability and to reduce bugs, it's strongly suggested all multi-word operations use little endian in all DCPU-16 programs, wherever possible.

Link to comment
Share on other sites

Endianness trouble forms the backstory of the DCPU-16, but the spec states:
For stability and to reduce bugs, it's strongly suggested all multi-word operations use little endian in all DCPU-16 programs, wherever possible.

Little endian it is then. By the way, am I correct in my intuitive assessment that without at least single-precision floating-point arithmetic (or at least multi-word integers) orbital calculations would suffer massive rounding errors?

Link to comment
Share on other sites

Little endian it is then. By the way, am I correct in my intuitive assessment that without at least single-precision floating-point arithmetic (or at least multi-word integers) orbital calculations would suffer massive rounding errors?

Seems likely. Most physics data appears to be single-precision floats in KSP.

Link to comment
Share on other sites

  • 2 weeks later...

I think this idea is cool because we are all sitting here sort of going "ok well this thing works, it's cool for nerds, but how can it be implemented?"

I saw Micecraft in-game CPU videos on YouTube, built via their in-game "redstone" resource.

Here's one

I saw some other videos where someone was saying they had built (or were going to build) a compiler and such, so that leads me to believe that with proper hardware and HID interfaces, you could really build an ingame computer with an OS on a Hard Drive, output a Video display, and even use input like mouse/keyboard (kermouse/kerboard?)

After all, NASA used a computer that was less-powerful than a calculator to land men on the moon and return them home, correct? As an enthusiast with limited knowledge or research on the subject, how much "piloting" did the astronauts have to do?

If this is the case... I wonder... If someone could expand on the RemoteTech mod and build like a JPL-style mission control and use the signals to shoot to rovers and auto-drive them? Such as with some sort of AI (detect incline, speed, gravity, etc and realize a best-path with least resistance, etc?)

Once we get more robust resources, more finalized landscapes with items such as collidable (movable, destroyable?) rocks or cliffs to fall off/climb.. Hopefully at some point we get gysers and/or volcanoes? Maybe even detect biological substances, sort of mirror the way-awesome missions that RL has going on and planned?

I think it would be awesome too if someone could build a KOS (instead of DOS) and even maybe a KCP/IP protocol and build an in-game internet? Can a mod tell KSP to contact HTTP servers via real internet? Would be neat if there were scripts, batch files, etc... Commands we could talk to each other with...

I'm just not someone who can make any of this.

Link to comment
Share on other sites

  • 2 weeks later...

Released 0.4.1, which includes a workaround for a bug in saving and restoring values in the game's save files.

I'll release 0.5.0 this weekend, which will include implementations of the M35FD floppy drive and a community proposed firmware/BIOS.

Link to comment
Share on other sites

Wow, haven't seen anything DCPU-16 based in quite a while. I WAS waiting for the space ship control that would have been allowed if "0x10c" (the game made by notch) were going to come out, but now that that's just a thing on the ol' shelf my plans where dwindling. This has revitalized my enthusiasm for the DCPU-16, and If you need anybody to help with dev work, be it actual programming, ideas, or the like, please, contact me! Hope to see this go far!

Link to comment
Share on other sites

Wow, haven't seen anything DCPU-16 based in quite a while. I WAS waiting for the space ship control that would have been allowed if "0x10c" (the game made by notch) were going to come out, but now that that's just a thing on the ol' shelf my plans where dwindling. This has revitalized my enthusiasm for the DCPU-16, and If you need anybody to help with dev work, be it actual programming, ideas, or the like, please, contact me! Hope to see this go far!

Ha, thanks. Probably the biggest thing to do right now is to arrive at a community consensus on Kerbal-specific devices that allow the DCPU-16 to interact with the ship. There are some proposed specifications, that I've been negligent in reviewing myself, since I've been focusing on getting the core stuff "feature complete".

There are also some open issues on GitHub if you want to contribute to the main work.

One other thing is that the upcoming release will implement the M35FD floppy drive spec and get rid of the ability to "flash" the main memory. Instead, I'm implementing this proposal, which will automatically load the first sector (512 words) from the first floppy drive it finds into main memory and execute it. This would allow you to treat memory images as floppy disks so long as they are <=512 words, otherwise we'll need some sort of bootable floppy disk standard, and tools to generate floppy disk images from the memory images spat out by the assemblers.

Link to comment
Share on other sites

This is awesome! Also, being an Electrical Engineer with emphasis on microcontroller hardware, I'd love to help out with adding the external interfaces and specifications :)

Thanks, checkout my earlier post, with some links to already proposed specs (that I still have yet to get to). I've also listed some possible external devices in this issue. If you want to get a discussion going on a specific device, feel free to start a new issue in the KSP_DCPU16_Standards repository, so we can brainstorm ideas. Eventually, I'd like to see specifications like those on http://dcpu16.com/ but also including psuedo-code on how to interact with the device.

Link to comment
Share on other sites

  • 2 weeks later...
So how exactly can I play tetris? :P

:) If you really want to know...

The tetris code can be found here. First you need to assemble it into machine code using a DCPU-16 assembler, like Organic. Then you need to place the outputted bin file in Kerbal Space Program/saves/<profile>/Ketchup/FloppyDisks.

Tetris is a relatively large program, so it doesn't fit in the first sector of the floppy disk that the default firmware reads from disk on boot. So you'll have to get an alternate firmware that can read more data from disk. I've provided such a firmware under the Contrib folder of the relase download, in the source assembly file named firmware_127sectors_v1.dasm. You can assemble that into machine code using Organic, or other assembler as well. Place that outputted bin file in Kerbal Space Program/saves/<profile>/Ketchup/Firmware.

From in-game, right click on the computer part, and toggle the firmware window open. Flash it with the alternate firmware. Then toggle the interfaces for the computer, keyboard, LEM-1802 (monitor), and M35FD (floppy drive). Use the get disk option from the floppy drive window, to select the tetris image, then insert it into the drive. Power on the computer, after the few seconds it takes to read the floppy disk, the tetris flash screen should appear, and then you can click the attach button on the keyboard window to start playing.

For your and anyone else's convenience, here are some links to pre-assembled versions of the firmware and tetris game, removing the need to use organic or another assembler:

firmware_127sectors_v1.bin

tetris.bin

Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...