generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Best way to emulate R3000a CPU?

Previous Thread :: Next Thread 
julienmauriemort is not online. julienmauriemort
Joined: 09 May 2009
Total Posts: 21560
28 Sep 2012 11:28 PM
using wait(1/1000) most likely would not work and would drastically slow down performance. Anyone else know a fast method?
Report Abuse
thedeathmaster01 is not online. thedeathmaster01
Joined: 14 Mar 2010
Total Posts: 6331
28 Sep 2012 11:45 PM
?
Report Abuse
luigi01302 is not online. luigi01302
Joined: 12 Jul 2009
Total Posts: 511
29 Sep 2012 01:47 AM
I'm not really sure if this forum is the right place to ask and doing a 1/1000 of a second could generate serious lag depending on the power of your computer.
Report Abuse
ArceusInator is not online. ArceusInator
Joined: 10 Oct 2009
Total Posts: 30553
29 Sep 2012 02:05 AM
I don't think you can emulate a CPU that's more powerful than your own.
Report Abuse
Candymaniac is not online. Candymaniac
Joined: 08 Oct 2009
Total Posts: 8985
29 Sep 2012 02:40 AM
@Arceus;
Lol'd

☜▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬☞
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
29 Sep 2012 05:48 AM
1/1000 second is a whole year in computer time.
Report Abuse
TheMyrco is not online. TheMyrco
Joined: 13 Aug 2011
Total Posts: 15105
29 Sep 2012 06:12 AM
"1/1000 second is a whole year in computer time."

Can't tell if trolling.
Anyways, on Roblox, the max wait time is ~0.03 (wich equalss wait()), but there might have been an update that allows 60 FPS (~0.015 sec), wich would mean wait(0) I believe.
Report Abuse
julienmauriemort is not online. julienmauriemort
Joined: 09 May 2009
Total Posts: 21560
29 Sep 2012 08:31 AM
Just an fyi the CPU is only 20 MHz irl.
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
29 Sep 2012 09:13 AM
Its not trolling.

Most PICs (Programmable Integrated Circuits) use a crystal with a 20 MHz frequence.

The clock speed is 1/f. f = 20 MHz = 20 * 10^6 Hz

Thus Clockspeed = 1/(20*10^6) = 5,0 × 10-8 seconds.

1/1000 second = 1^-3 second.

In other words, what we think is fast (1/1000 second - your eye cant even see a movement in that speed), a computer can do THIS ammount of "thinkings":

(1^-3)/(5,0 * 10^- 8) = 20 000 000 = 20 million things in 1 thousand of seconds.

To compare: 20 million seconds are 333 333,333 hours. These are 14 221.875 days, which are 621,876712 years.

See? I'm not trolling.
Report Abuse
julienmauriemort is not online. julienmauriemort
Joined: 09 May 2009
Total Posts: 21560
29 Sep 2012 01:42 PM
Answer my question pl0x.
Report Abuse
CrazyPlanes319 is not online. CrazyPlanes319
Joined: 22 Sep 2012
Total Posts: 29
29 Sep 2012 01:43 PM
If you go into your ROBLOX Studio Settings, you can change the default wait time from 0.03 to 0.00. I did it.
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
30 Sep 2012 09:51 AM
You can, using a buffer size. Works like this;


while true do
for i=1, buffer do
--do stuff here.
end
wait()
end
Report Abuse
julienmauriemort is not online. julienmauriemort
Joined: 09 May 2009
Total Posts: 21560
30 Sep 2012 10:01 AM
@jobro That's a good suggestion, but the only problem is that the cpu has jumps in it so it would start executing at a different address.
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
30 Sep 2012 11:35 AM
Ah!!

Ur using assembly yes? Nice! I'm doing something similair on my game too, a fully functional Lua Assembly interpreter :)

Good, my suggestion is that you store a jump adress in a table. Example (maybe you want to convert the numbers to hex!)

local adress={[1]=function() print("HI") end, [2] = function(a) print(a) end}

local buffsize = 32

local curradress = 1

function JMP(A)
curradress = A
end

function CALL()
adress[curradress]()
end

while true do
for _ = 1,buffsize do
CALL()
end
end
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
30 Sep 2012 11:36 AM
Dont forget the wait() sorry forgot that :(
Report Abuse
dolphin098 is not online. dolphin098
Joined: 22 Jan 2009
Total Posts: 2784
30 Sep 2012 12:06 PM
[ Content Deleted ]
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
30 Sep 2012 12:47 PM
Base - 16 numbers. Normally we use base - 10 (numbers 0,1,2,3,4,5,6,7,8,9) and hex uses 0,1,2,3,4,5,6,7,8,9,a,b,c,d,f

So 10 in hex is a.
Report Abuse
julienmauriemort is not online. julienmauriemort
Joined: 09 May 2009
Total Posts: 21560
30 Sep 2012 12:56 PM
The only flaw is that it would most likely go back to the default wait() time on multiplayer servers.
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
30 Sep 2012 01:04 PM
No, it will not. Look you cannot time things shorter than 1/30 second (default wait time). But you can define the number of operations within these 1/30 seconds. So you can actually emulate it - but not very realistic.
Report Abuse
julienmauriemort is not online. julienmauriemort
Joined: 09 May 2009
Total Posts: 21560
30 Sep 2012 01:19 PM
Hmmm.. if 20 MHz is .00000005 of a second, and the min wait time is 1/30 of a second..

*gets pen and paper*
Report Abuse
julienmauriemort is not online. julienmauriemort
Joined: 09 May 2009
Total Posts: 21560
30 Sep 2012 01:22 PM
That's 666666.66(forever more 6's) iterations per wait(). Ugh.
Report Abuse
jobro13 is not online. jobro13
Joined: 05 Aug 2009
Total Posts: 2865
30 Sep 2012 01:26 PM
Dont do that.

Normal lua can just do a while true do loop without a wait. On roblox, everything stalls...

If you really want to emulate it, then use the normal Lua on your pc. Be warned tough, you can get an overheated processor like that.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image