Upload
toby-reed
View
222
Download
1
Tags:
Embed Size (px)
Citation preview
Very Important Points
• Classroom etiquette• Lab etiquette• Problems with – Teacher– Course content (Course Outline)– Evaluation– Programming for labs– Personal
Basics
• Game Consoles and mobile devices• Hardware, Software and Firmware• 1’s and 0’s• Assembly Language• HLL (High Level Language)
Game Consoles and Mobile
• All game machines share their internals with regular computer architecture
• All game machines have– Input– Output– Processing
Hardware, Software & Firmware
• Hardware refers to a PHYSICAL DEVICE• Software refers to INFORMATION that
commands a device• Firmware refers to EMBEDDED Software –
fixed INSIDE a device
Processing
• Game consoles have microprocessors that understand and perform operations based on a PATTERN of 1’s and 0’s
1’s and 0’s
• Can be COMMANDS (or INSTRUCTIONS) to a device
• Can be DATA for use by a device• Determination of interpretation depends on
the CONTEXT of the 1s and 0s
Machine Code
• Jumping to the address 1024:[ op | target address ] 2 1024 decimal000010 00000 00000 00000 10000 000000
binary
Assembly Code• MOV r0, #0C ;load base address of string into r0
LOAD: MOV r1,(r0) ;load contents into r1CALL PRINT ; call a print routine to print the character in r1INC r0 ;point to next characterJMP LOAD ;load next character
• ALMOST ENGLISH
High Level Language
• Early HLL – Fortran – Cobol• Basic• Pascal• C (from B) Jumping to the address 1024:• C++• Java
Why C++?
• Industry Standard• 70% of Game Developers use this language on
a DAILY basis• Object-oriented• Practical outside of game development in
industry
COMPILE
• Command Line
cc -c file.c
• GUI (Graphical User Interface)
Go to menu option… Build and select Compile
COMPILE (More)
• Compiling takes English-like language and creates instructions that the computer can follow.
• Calls to other code will be links and need to be resolved in order to build REAL executable 1’s and 0’s
LINK and LOAD
• Command Line
ln file1.o file2.o
• GUI (Graphical User Interface)
Go to menu option… Build and select BUILD
LINK and LOAD (More)
• All calls to other code are resolved into actual locations where the code is now residing.
• Programmers use libraries that contain many commonly requested functions. These are resolved in the LINK and LOAD process as well
• The LOAD process refers to the first part of executing (or running) the program on a computer.
Hello World in C++#include <iostream>
using namespace std;
int main(){ cout << “Hello World" << endl; return 0;}
Hello World in C++
#include <iostream>
• Preprocessor command – starts with ‘#’ • Processed BEFORE actual compile• Effect of including an entire file inside your file
Hello World in C++
using namespace std;
• Declares where to assume you are “using” functions
• “std” means STANDARD and allows a command like “cout” to be understood
Hello World in C++
int main(){}• A function called “main” which returns an “int”
value• “main” MUST be in all C++ programs• “{“ “}” delimit the function (indicate what is
inside the function)
Hello World in C++
cout << “Hello World" << endl;• “cout” is an object that is connected to our
terminal screen by default• “Hello World” is sent to the object for display
on the screen• “endl” is a “manipulator” that adds a
CR LF (Carriage Return and Line Feed)
Compiling Hello World in C++
• Save the contents of the program into a file called “hello.cpp”
• Run the following command
c++ -o hello hello.cpp
• The PROGRAM is created… linking and loading is ALSO performed (by default)