Prev NEXT  

Advertisement

How Dreamcast Works

Dreamcast History

Dreamcast was the first video game system to have a built-in modem and 128-bit graphics.
Dreamcast was the first video game system to have a built-in modem and 128-bit graphics.

An established leader in the arcade, Sega entered the home market right on the heels of Nintendo. Renamed the Sega Master System, the system known as the Mark III in Japan debuted in the United States in 1986. The Sega Master System used an 8-bit CPU, 128K ROM-based operating system and had a 128K of RAM. Games came on two types of cartridges: a large cartridge that could hold a megabit of game code, and a smaller cartridge that held 256 kilobits of game code.

In 1989, Sega introduced the world's first 16-bit home video game system, the Genesis. Based on Motorola's 68000 processor, the system was technically superior to anything else on the market. But the sheer dominance of Nintendo overshadowed the Genesis, when the rival company debuted the Super Nintendo Entertainment System later that same year.

Advertisement

But Sega beat Sony and Nintendo to the punch with a 32-bit system. The Saturn was officially launched on May 11, 1995. Not only was it the first 32-bit system, but it had two 28.8 MHz 32-bit Hitachi SH-2 processors working in parallel! Sega's Saturn was an amazing system with an incredible architecture, but quickly fell behind the other 32-bit system released that year, Sony's PlayStation.

Code-named Katana, the Dreamcast was released in the fall of 1999, the first system to provide a built-in modem and 128-bit graphics.

JavaScript is what is called a Client-side Scripting Language. That means that it is a computer programming language that runs inside an Internet browser (a browser is also known as a Web client because it connects to a Web server to download pages).

The way JavaScript works is interesting. Inside a normal Web page you place some JavaScript code (See How Web Pages Work for details on Web pages). When the browser loads the page, the browser has a built-in interpreter that reads the JavaScript code it finds in the page and runs it.

Web page designers use JavaScript in many different ways. One of the most common is to do field validation in a form. Many Web sites gather information from users in online forms, and JavaScript can help validate entries. For example, the programmer might validate that a person's age entered into a form falls between 1 and 120.

Another way that web page designers use JavaScript is to create calculators. Here are several examples:

To give you an example of an extremely simple JavaScript calculator, the HTML below shows you how to create a Fahrenheit to Celsius converter using JavaScript:

    
    
Fahrenheit to Celsius Converter Enter a temperature in degrees F:
Click this button to calculate the temperature
in degrees C:
Temperature in degrees C is:

If you have read How Web Pages Work and How CGI Scripts Work, then a good portion of this HTML will be familiar. This is the basic structure of any web page:

<html>
<head>
</head>
<body>
</body>
</html>

There is one piece of JavaScript code in the header that is the function to calculate the conversion from Fahrenheit to Celsius:

<head>
<script>
<!-- hide this script from old browsers
function temp(form)
{
  var f = parseFloat(form.DegF.value, 10);
  var c = 0;
  c = (f - 32.0) * 5.0 / 9.0;
  form.DegC.value = c;
}
<!-- done hiding from old browsers -->
</script>
</head>

The function is called temp. It contains JavaScript code to calculate a Celsius temperature.

In the body of the page there is a typical form:

<FORM>
<h2>Fahrenheit to Celsius Converter</h2>
Enter a temperature in degrees F: 
<INPUT NAME="DegF" VALUE="0" MAXLENGTH="15" SIZE=15>
<p>
Click this button to calculate the temperature 
in degrees C:
<INPUT NAME="calc" VALUE="Calculate" TYPE=BUTTON 
onClick=temp(this.form)>
<p>
Temperature in degrees C is: 
<INPUT NAME="DegC" READONLY SIZE=15>
</FORM>

This line is key:

<INPUT NAME="calc" VALUE="Calculate" TYPE=BUTTON 
onClick=temp(this.form)>

This is a normal button control. When the user clicks it, it calls the function in the head of the page because of the onClick notation.

As programming languages go, JavaScript is average difficulty. It is not especially hard to learn how to use it if you already understand programming, but if you are new to programming it is certainly not an easy language to start with. What you can do, however, is modify this sample code and expand it to create other calculators.


Here are several interesting links:

Advertisement

Advertisement

Advertisement

Advertisement

Advertisement

Advertisement


Advertisement


Recommended

Advertisement

Advertisement