Jump to content




[Official] CCLite - Lightweight CC Emulator

utility

138 replies to this topic

#81 H4X0RZ

  • Members
  • 1,315 posts
  • LocationGermany

Posted 01 July 2013 - 09:45 AM

I've got a bug.

Recreate it so:
1. Start emulator
2. Type "edit rom/programs/edit
3. See the graphic bug

#82 Sorroko

  • Members
  • 87 posts

Posted 01 July 2013 - 08:49 PM

View PostKingdaro, on 01 July 2013 - 02:46 AM, said:

Incidentally, the "table" variable was redefined in the very emulator itself. The sandboxing is pretty weak there, OP.

I don't see a way around that, setfenv is the only "safe" way to sandbox that I'm aware of, especially since the emulator itself is written in lua. What would you suggest as a fix? Can't think of anything atm ( jetlag + very tired :P )

#83 Sorroko

  • Members
  • 87 posts

Posted 01 July 2013 - 08:53 PM

View PostFreack100, on 01 July 2013 - 09:45 AM, said:

I've got a bug.

Recreate it so:
1. Start emulator
2. Type "edit rom/programs/edit
3. See the graphic bug

Yeah I'm aware that tabs show up as strage characters, I should look into it but haven't got round to it yet.

#84 Kingdaro

    The Doctor

  • Members
  • 1,636 posts
  • Location'MURICA

Posted 02 July 2013 - 09:45 AM

View PostSorroko, on 01 July 2013 - 08:49 PM, said:

I don't see a way around that, setfenv is the only "safe" way to sandbox that I'm aware of, especially since the emulator itself is written in lua. What would you suggest as a fix? Can't think of anything atm ( jetlag + very tired :P )

The only thing I can suggest is threads, but we've already been there.

I suppose you would just get a separate script that runs scripts, turn it into a thread, then send a value to the script to tell it what script to run.

Note: the current basic thread functionality is going to be replaced with Channels in the future, and I still don't know how to use Threads or Channels. :lol:

#85 Xenthera

  • Members
  • 170 posts

Posted 12 July 2013 - 10:59 PM

If you want them here are the real colors computercraft uses. :)
WHITE = {240,240,240},
ORANGE = {235, 136, 68},
MAGENTA = {195, 84, 205},
LIGHT_BLUE = {102, 137, 211},
YELLOW = {222, 222, 108},
LIME = {65, 205, 52},
PINK = {216, 129, 152},
GRAY = {67,67,67},
LIGHT_GRAY = {153,153,153},
CYAN = {40,118,151},
PURPLE = {123,47,190},
BLUE = {37,49,146},
BROWN = {81,48,26},
GREEN = {59,81,26},
RED = {179,49,44},
BLACK = {0, 0, 0},


#86 MCGamer20000

  • Members
  • 49 posts

Posted 15 July 2013 - 04:03 AM

View Postjesusthekiller, on 15 June 2013 - 01:22 PM, said:

View PostKingdaro, on 15 June 2013 - 01:15 PM, said:

I'm aclua running under more lua

It's Luaception B)
Now just make CC in CC in CC in CC in CC in LOVE 2D, and you got yourself a paradox!

#87 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 15 July 2013 - 10:15 AM

View Postbunny365, on 15 July 2013 - 04:03 AM, said:

View Postjesusthekiller, on 15 June 2013 - 01:22 PM, said:

View PostKingdaro, on 15 June 2013 - 01:15 PM, said:

I'm aclua running under more lua

It's Luaception B)
Now just make CC in CC in CC in CC in CC in LOVE 2D, and you got yourself a paradox!
not how it works, codeception only works when you are layering multiple inturpreters on eachother

#88 Geforce Fan

  • Members
  • 846 posts
  • LocationMissouri, United States, America, Earth, Solar System, Milky Way, Universe 42B, Life Street, Multiverse, 4th Dimension

Posted 02 August 2013 - 06:18 PM

Wow, I'm surprised at how fast this runs. Nice work. What's even cooler is that this is in LOVE, the engine I use.
Edit: Dis was mai 222nd post.

#89 Sorroko

  • Members
  • 87 posts

Posted 03 August 2013 - 11:54 PM

View PostXenthera, on 12 July 2013 - 10:59 PM, said:

If you want them here are the real colors computercraft uses. :)
-snip-
He he, thanks for those, I'll add those in soon.

View PostIcanbreathecode, on 02 August 2013 - 06:18 PM, said:

-snip-
Thanks for the support ;) Glad you like it.

Thanks everyone, I'm currently on holiday and haven't made any progress however I've got some plans for this when I get back!

#90 Robert00001

  • Members
  • 15 posts
  • LocationI am in your room, disguised as an object :)

Posted 05 August 2013 - 02:45 AM

I have a fix for the error "Invalid UTF-8" and for tabs:
Change
local text = self.textB[y + 1][x + 1]
local offset = self.pixelWidth / 2 - self.font:getWidth(text) / 2 -- Could also create a lookup table of widths on load
to
local text = self.textB[y + 1][x + 1]
if text == "\t" then text = " " end
if text:byte() < 32 or text:byte() > 126 then
	text = "?"
end
local offset = self.pixelWidth / 2 - self.font:getWidth(text) / 2 -- Could also create a lookup table of widths on load


#91 Shnupbups

  • Members
  • 596 posts
  • LocationThat place over there. Y'know. The one where I am.

Posted 08 August 2013 - 05:08 PM

Yeah, don't know if this is noted (I'm too lazy to look :P ) but the mouse clicking doesn't work properly. I click at 3,3 and get 1,1. Also, the numpad enter/return isn't recognised as enter/return...

But onto some suggestions!

Since you've already included a program of your own (preview) could you implement an API for the emulator, within the emulator? Would it be possible?
Functions like:

emu.titleBar(str) --#Changes the text in the title bar from 'ComputerCraft Emulator' to a provided string.
emu.PCsize(int,int) --# Changes the width and height of the PC, like editing the CC config to make the screen bigger.


#92 TorakTu

  • Members
  • 231 posts

Posted 09 August 2013 - 06:54 AM

I at first thought this thread was a joke.. but as I read it I realized it is a real emulator. Dude ! This is great !! I soo needed something like this. TY!!!!

#93 kornichen

  • Members
  • 220 posts
  • LocationGermany

Posted 19 August 2013 - 01:00 PM

Just saw it... I love it! It is started speedy and working fine. Thank you!


It is crashing when using HTTP things like pastebin unfortunately.

And Windows Copy & Paste would be nice :D

#94 oeed

    Oversimplifier

  • Members
  • 2,095 posts
  • LocationAuckland, New Zealand

Posted 19 August 2013 - 05:21 PM

Oh it's on now, 4 emulators on the market (or in dev). Finally, an emulator the supports Mac :D

#95 kornichen

  • Members
  • 220 posts
  • LocationGermany

Posted 20 August 2013 - 12:50 AM

I have another bug:

1. Download thunderhawk via pastebin.
2. run thunderhawk
3. Thunderhawk will run one second and then the thunderhawk file will be deleted.

Edit: after redownloading was HTTP available.

#96 ElvishJerricco

  • Members
  • 803 posts

Posted 03 September 2013 - 01:50 PM

This is really nice. Perfect for my needs. I like that it's just one terminal in one window. Two problems though, one of which I've submitted a pull request to fix:
  • loadstring loads functions into the REAL _G, instead of the one you run bios.lua in. That's a problem. I fixed this in a pull request.
  • This thing takes way too much CPU. Both my cores are constantly at ~95% when running this.
Oh and one suggestion, perhaps instead of using a data folder, you should use the working directory. That'd be nice for me.

EDIT: Or maybe just allow the directory to be set via command line argument.

#97 PixelToast

  • Signature Abuser
  • 2,265 posts
  • Location3232235883

Posted 03 September 2013 - 02:17 PM

View PostElvishJerricco, on 03 September 2013 - 01:50 PM, said:

This is really nice. Perfect for my needs. I like that it's just one terminal in one window. Two problems though, one of which I've submitted a pull request to fix:
  • loadstring loads functions into the REAL _G, instead of the one you run bios.lua in. That's a problem. I fixed this in a pull request.
  • This thing takes way too much CPU. Both my cores are constantly at ~95% when running this.
Oh and one suggestion, perhaps instead of using a data folder, you should use the working directory. That'd be nice for me.
Posted Image
wouldnt this prevent things that were loadstringed to make globals?

#98 ElvishJerricco

  • Members
  • 803 posts

Posted 03 September 2013 - 02:26 PM

View PostPixelToast, on 03 September 2013 - 02:17 PM, said:

wouldnt this prevent things that were loadstringed to make globals?
Crap my mistake. I did this in a hurry. Will fix now.

#99 Symmetryc

  • Members
  • 434 posts

Posted 03 September 2013 - 07:47 PM

View Postoeed, on 19 August 2013 - 05:21 PM, said:

Oh it's on now, 4 emulators on the market (or in dev). Finally, an emulator the supports Mac :D
CCDesk, This, Grav's, and what else? CCEmu? That's been discontinued though...

#100 Sorroko

  • Members
  • 87 posts

Posted 04 September 2013 - 10:59 AM

View PostElvishJerricco, on 03 September 2013 - 01:50 PM, said:

This is really nice. Perfect for my needs. I like that it's just one terminal in one window. Two problems though, one of which I've submitted a pull request to fix:
  • loadstring loads functions into the REAL _G, instead of the one you run bios.lua in. That's a problem. I fixed this in a pull request.
  • This thing takes way too much CPU. Both my cores are constantly at ~95% when running this.
Oh and one suggestion, perhaps instead of using a data folder, you should use the working directory. That'd be nice for me.

EDIT: Or maybe just allow the directory to be set via command line argument.
Ah Thanks! Didn't even notice that, I'll merge it it now.

Unfortunately, love2d has a sandbox around the filesystem, they only allow reading/writing inside the love directory :/. There are ways around the sandbox such as using io, however I'd rather stick to the supported filesystem library.

On another note, I haven't forgotten about that update, I'm working on it ;)





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users