Skip to content
Gilberto Romero edited this page Sep 2, 2016 · 7 revisions

Introduction to CPUs

Note: When describing a CPUs specs, it should be done as nUPs-nt (where n is a number, UPs is updates per second, and t is threads). EX: 20UPs-1t, 60UPs-4t, 40UPs-2t, etc.

A CPUs speed is dependent on it's UPs (updates per second, spoken as the plural of the word "up") and the amount of threads it has. When upgrading a CPU, upgrading the UPs is what will have a direct improvement on the speed of the CPU. While in theory a 20UPs-2t CPU is the equivalent of a 40UPs-1t CPU, the speed gain will only be visible if one actually takes advantage of the second thread. Following this logic, a 60UPs-4t CPU can effectively be the same as a 240UPs-1t CPU, given one takes full advantage of all four threads.

It should be noted that all threads share the same memory, or _ENV.

Spec Tiers

20UPS -> 40UPs -> 60UPs

1t -> 2t -> 3t -> 4t

Introduction to GPUs

Once creating your GPU and popping it into your system, it will automatically be detected, and all functions will be put into a table called "gpu". By default, all GPUs will have the same functions as each other, with the only difference between them being the colors you have available.

In this mod, the color system is based on channels and the amount of bits given to them. For example, with 24bit color, the same thing your monitor is most likely using now, three channels, namely r, g, and b, each get 8bits, allowing for each rgb value to have a color between 0-255.

When there is a bit count that's not evenly dividable by three, then certain channels take priority over other ones. The g channel has the most priority, while the b channel has the least. This was chosen because of how our retinas work, as we have the highest sensitivity to green, and the lowest sensitivity to blue.

You'll never have to worry about the colors per channel unless you want to change it. Using the GPU, you can set the bits per channel. For example, if you have a 4 bit system, by default, the r and b channels will get 1 bit, while the g channel gets 2. Though this can be changed so that, for example, you can have all 4 bits in the r channel, leaving the g and b channels with none. This of course would make it so that there are 16 (2^4) colors, ranging from black to red, creating a sort of "colored" gray scale.

GPU Functions

Note: Arrays refer to one-dimensional tables. Arguments enclosed in "<>" means they are optional.

gpu.bind( number port )

gpu.getSize( )

Returns: number Width, number Height

gpu.setColor( number r, number g, number b )

gpu.getColor( )

Returns: number r, number g, number b

gpu.clear( <number r, number g, number b> )

gpu.clearLine( number y, <number r, number g, number b> )

gpu.clearArea( number x, number y, number width, number height, <number r, number g, number b> )

gpu.scroll( number amount, <number r, number g, number b> )

gpu.point( number x, number y )

gpu.line( number x1, number y1, number x2, number y2 )

gpu.rectangle( string mode, number x, number y, number width, number height )

gpu.circle( string mode, number x, number y, number radius, number segments )

gpu.blitLine( table array, number x, number y )

gpu.blitArray( table array, number x, number y, number width, number height )

gpu.blitTexture( table array, number x, number y, number width, number height )

gpu.shader( function shader )

gpu.getMaxChannelBits( )

Returns: number bits

gpu.getFreeChannelBits( )

Returns: number bits

gpu.setChannelBits( number channel, number bits )

gpu.getChannelBits( number channel )

Returns: number bits

Clone this wiki locally