This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
MindenCucc's profile picture

[Emulator] "ReadConsoleInput" ComputerCraft emulator

Started by MindenCucc, 28 April 2015 - 08:21 PM
MindenCucc #1
Posted 28 April 2015 - 10:21 PM
ReadConsoleInput

vDEV


This is a ComputerCraft emulator written in C# and Lua.

Features (pros?):
  • Uses native Windows console
    • If you're able to run Windows, then you're able to run this too, since this doesn't use DirectX, or OpenGL at all.
      • This means that your old integrated thingy is enough to run this :P/>
  • Has colors (this includes the original CC colorpalette)
  • Has mouse input
  • Multiple instances (Not yet implemented)
  • Minimalistic interfac (Not yet implemented)
  • Has a modloader (Work in progress, use pre-bios.lua for modding)
  • So tiny. Much small footprint. Wow
  • Easily configurable mounts (Work in progress, only mounting)
  • Sandboxed
  • No need to edit bios.lua (that's a lie)
  • Open-source
Cons:
  • I used the cc.jar a "little" bit :P/>
  • The FS-implementation is a bit buggy (you can edit bios.lua :lol:/>)
  • No redstone (how?! in an emulator? :lol:/>)
Not implemented:
  • HTTP
  • peripherals:
    • disks
    • gps
    • rednet
Work-table
SpoilerUrgent:
  • More stable fs.open
  • Implement basic things (native APIs)
  • Proper sandbox
  • Intelligent drawing code (paint startup time pls)
Neutral:
  • Implement file hiding for _fsconfig.txt
  • Completely fix mouse input for future compatibility
  • Peripherals!
Low priority:
  • More accurate timer (tickmgr)
  • Interface with multiple computers and draggable window-thingies - Multithreading
  • Linux compatibility

Download: finding release (2k15. 05. 13.)
Now the "rom" is included too, since Dan allows to use the .lua assets.

Please post your opinions about this software. Suggestions, comments, bugreports, and constructive critics are welcome. :D/>

Source:
SpoilerWarning: contains obscene words, and unformatted code, so expect eye-bleeding
Spoilerhttps://github.com/MarcuzD/MarcusD.CC

Usage:
Spoiler
  1. Un7z the downloaded file
  2. Start the program (MarcusD.CC.exe)
  3. Wait until lua_debug pops up
  4. Type in "cont" without quotes, press enter
  5. Use the emulator

Screenshot(s):
Spoiler



Edited on 12 May 2015 - 09:49 PM
Lignum #2
Posted 28 April 2015 - 10:36 PM
  • Closed-source (because CC is closed source, also I looked at the cc.jar a "little" bit :P/>)

ComputerCraft is closed-source but implementing it won't make your program closed-source as well. CCLite has been open source for a long time now.
MindenCucc #3
Posted 28 April 2015 - 10:45 PM
I mean it's severely based off the real CC, but there are some things that I optimized or implemented a thing differently than the original, but… I don't want Dan to report my project for using his code, so no, sorry. If Dan says yes, I'll put the source on GitHub ASAP.

Also lol, 42nd post :lol:/> Same as the executable size :D/>
Edited on 28 April 2015 - 08:47 PM
Lignum #4
Posted 28 April 2015 - 11:28 PM
I mean it's severely based off the real CC, but there are some things that I optimized or implemented a thing differently than the original, but… I don't want Dan to report my project for using his code, so no, sorry. If Dan says yes, I'll put the source on GitHub ASAP.

Also lol, 42nd post :lol:/>/> Same as the executable size :D/>/>

Oh, are you talking about the Lua code (ROM, BIOS)? Dan said somewhere you could do whatever you want with it (here, specifically). It's the Java source and assets which are closed source.

But ultimately, it is of course your decision.
MindenCucc #5
Posted 28 April 2015 - 11:31 PM
Of course it's the non-Lua code. And Lua code can't be closed source, because it's a plain text file (unless it's Lua-bytecode, in that case, it must be reverse-engineered :P/>). My code looks similar to CC's, because
I looked at the cc.jar a "little" bit :P/>
MindenCucc #6
Posted 08 May 2015 - 12:51 AM
Holy cow, what an update!
  • Fixed mouse input, it should be better
    • Also, dont worry about getting invalid co-ordinates, it's safe now to drag something outside the console
  • Added a lot of native APIs (fs, os [partially])
  • It's almost perfectly usable
  • 99% working fs.open
  • Using Dan's pcall/xpcall, because you can't yield across C-functions, because in native Lua pcall and xpcall are native functions.
Please try this release out, and post your "experience" about the first impression, and what you did/didn't like about things, and other thingies…
Also, the project is open-source, see the first post.
Edited on 13 May 2015 - 04:37 AM
flaghacker #7
Posted 11 May 2015 - 09:38 PM
Looks promising, I'll be sure to check this out when I get home!

Is there a way to use the "real" monitor size? Your screenshots show a bigger size…
FUNCTION MAN! #8
Posted 11 May 2015 - 09:52 PM
why windows only? that sucks.
Lignum #9
Posted 11 May 2015 - 09:57 PM
why windows only? that sucks.

You can use Mono to run it.
MindenCucc #10
Posted 11 May 2015 - 10:43 PM
Is there a way to use the "real" monitor size? Your screenshots show a bigger size…

In old XP, you could set per-app (per-title, to be more precise) properties for the console window (as I remember). Until next update, set your default console window size (not console buffer) to 90x30, and set your console font to rastered 7x12
Demonstration:
Spoiler



why windows only? that sucks.

I know… I'm a DOS/Linux fanboy :P/> But I'm too lazy to program in C/CPP. I like CLI-stuff


You can use Mono to run it.

Nope, you can use Wine to run it, since the input uses native Windows calls to kernel32. I'll do Linux compat later. Sorry :(/>
Edited on 11 May 2015 - 08:43 PM
FUNCTION MAN! #11
Posted 11 May 2015 - 11:36 PM
Is there a way to use the "real" monitor size? Your screenshots show a bigger size…

In old XP, you could set per-app (per-title, to be more precise) properties for the console window (as I remember). Until next update, set your default console window size (not console buffer) to 90x30, and set your console font to rastered 7x12
Demonstration:
Spoiler



why windows only? that sucks.

I know… I'm a DOS/Linux fanboy :P/> But I'm too lazy to program in C/CPP. I like CLI-stuff


You can use Mono to run it.

Nope, you can use Wine to run it, since the input uses native Windows calls to kernel32. I'll do Linux compat later. Sorry :(/>

You can't be a DOS/Linux fanboy as those are mutually exclusive. Either you use the derpy operating system (DOS/WinDOS) or you use the superior operating system (Linux/Free|Open|Net|DragonflyBSD/OS X).
You either start with Linux compat (and while at it *BSD/OS X) or you never get Linux (and while at it *BSD/OS X) compat. And for that, thou shalt be damned. Because this looks like a really fun project! Bad think I chose the dark side of the force.
MindenCucc #12
Posted 12 May 2015 - 12:03 AM
-snip-

//really offtopic
I didn't really understand that hard English you wrote, but I understanded it a bit. I AM really a DOS/Linux fanboy, becuase I like how everything in DOS is so commandline, and has much CC-like graphics. Wow. And I use DOS almost every day (German DOS with Hungarian Win3.1 :P/>).
And I also like Linux (especially Slackware 13.37 (LEET :P/>)), because it's more customisable than every other OS I know, and again, everything could be done from commandline. The bash-interpreter is a great and powerful tool. I used it for things, like Bukkit-patcher :P/> You gave it some .java files, and it made a patched version of those .class files, and then it made the Bukkit.jar. Also, I can't decide the name of my CC-OS… Dix or DOSix? :P/> (it's meant to be a DOS/Linux hybrid)

Edit: that means I'm a commandline-fanboy :P/>
Also, too many smilies…
Edited on 11 May 2015 - 10:14 PM
FUNCTION MAN! #13
Posted 12 May 2015 - 12:37 AM
-snip-

//really offtopic
I didn't really understand that hard English you wrote, but I understanded it a bit. I AM really a DOS/Linux fanboy, becuase I like how everything in DOS is so commandline, and has much CC-like graphics. Wow. And I use DOS almost every day (German DOS with Hungarian Win3.1 :P/>).
And I also like Linux (especially Slackware 13.37 (LEET :P/>)), because it's more customisable than every other OS I know, and again, everything could be done from commandline. The bash-interpreter is a great and powerful tool. I used it for things, like Bukkit-patcher :P/> You gave it some .java files, and it made a patched version of those .class files, and then it made the Bukkit.jar. Also, I can't decide the name of my CC-OS… Dix or DOSix? :P/> (it's meant to be a DOS/Linux hybrid)

Edit: that means I'm a commandline-fanboy :P/>
Also, too many smilies…

There is no such thing as DOS/Linux. Those don't mix!
It's like trying to make a juice out of water and oil.

// on-topic:
Yea, tried it with Wine, worked fine ish.. really cool!
MindenCucc #14
Posted 12 May 2015 - 08:05 AM
// on-topic:
Yea, tried it with Wine, worked fine ish.. really cool!

Thanks! Some of the APIs aren't finished yet, and the fs is UBER-slow and buggy. The only thing missing from the fs is find. Meh, I'll do it in lua :P/>

Edit: fixed in the update
Edited on 13 May 2015 - 05:29 AM
FUNCTION MAN! #15
Posted 12 May 2015 - 04:22 PM
Isn't it better to do those in C#?
MindenCucc #16
Posted 12 May 2015 - 04:57 PM
Well, idk… Since I wrap everything in the pre-bios, it's slow, so it might be faster to do this in lua itself.
Edited on 12 May 2015 - 03:05 PM
iAd4m #17
Posted 12 May 2015 - 06:33 PM
nvm
Edited on 12 May 2015 - 04:35 PM