Presentation is loading. Please wait.

Presentation is loading. Please wait.

Game Boy Mark Green School of Creative Media City University of Hong Kong.

Similar presentations


Presentation on theme: "Game Boy Mark Green School of Creative Media City University of Hong Kong."— Presentation transcript:

1 Game Boy Mark Green School of Creative Media City University of Hong Kong

2 Introduction Probably the most successful console: Probably the most successful console: Largest number of sales Largest number of sales Longest life Longest life Basically owns the mobile game console market, even Sony is having a hard time competing against it Basically owns the mobile game console market, even Sony is having a hard time competing against it Sega was knocked out of the market, Nokia hasnt made much progress Sega was knocked out of the market, Nokia hasnt made much progress

3 Introduction Despite its size, Game Boy has all of the characteristics of larger game consoles Despite its size, Game Boy has all of the characteristics of larger game consoles Technology isnt as advanced, one or two generations behind Technology isnt as advanced, one or two generations behind But, game development, marketing, production and other aspects are all the same But, game development, marketing, production and other aspects are all the same Good case study for mobile games and consoles Good case study for mobile games and consoles

4 Introduction There are two main differences between the Game Boy and other consoles: There are two main differences between the Game Boy and other consoles: We know a lot about the Game Boy internals, the hardware used and how it can be programmed We know a lot about the Game Boy internals, the hardware used and how it can be programmed There are a number of free and inexpensive tools that can be used to develop Game Boy games There are a number of free and inexpensive tools that can be used to develop Game Boy games Ideal place to learn console game development Ideal place to learn console game development

5 Console Games Console game development is different from PC games, not a lot of companies do both Console game development is different from PC games, not a lot of companies do both Consoles are designed to be cheap, a small savings on one unit means a lot when you are making millions Consoles are designed to be cheap, a small savings on one unit means a lot when you are making millions Try to do clever engineering to reduce costs, dont care if its easy to program Try to do clever engineering to reduce costs, dont care if its easy to program

6 Console Games Consoles cant be upgraded, no changes to: Consoles cant be upgraded, no changes to: Processor Processor Graphics Graphics Sound Sound A console has a 3 to 5 year life time A console has a 3 to 5 year life time Must be better than a PC when first released, otherwise it will date very quickly Must be better than a PC when first released, otherwise it will date very quickly

7 Console Games Engineers do a lot of tricks to make things look better and run faster Engineers do a lot of tricks to make things look better and run faster Want to have a range of features that give WOW to the console Want to have a range of features that give WOW to the console Extend the life of the console Extend the life of the console Result: hardware is not well organized, may not be easy to use or program Result: hardware is not well organized, may not be easy to use or program A lot of tricks to learn A lot of tricks to learn

8 Console Game Development Different consoles are quite different Different consoles are quite different Often need to redevelop most of a game when it moves from one console to another Often need to redevelop most of a game when it moves from one console to another Program code will be quite different Program code will be quite different Art work may also be different Art work may also be different Also need to retrain developers when they move from one console to another! Also need to retrain developers when they move from one console to another!

9 Console Game Development Develop on one platform and test on another Develop on one platform and test on another Emulators can help find program bugs, but the dont give the same experience: Emulators can help find program bugs, but the dont give the same experience: Differences in processor speed Differences in processor speed Differences in graphics / display quality Differences in graphics / display quality Differences in sound generation Differences in sound generation Development process more difficult, takes longer Development process more difficult, takes longer

10 Game Boy Concentrate on the GBA Concentrate on the GBA Most recent version that we have a lot of information on Most recent version that we have a lot of information on Dont know much about the DS yet, havent seen cheap or free tools for development on it Dont know much about the DS yet, havent seen cheap or free tools for development on it Many web sites discuss the GBA hardware and programming it, so lots of information Many web sites discuss the GBA hardware and programming it, so lots of information

11 Game Boy Like most consoles a rather ugly architecture Like most consoles a rather ugly architecture Tries to get as much as it can out of a low priced unit Tries to get as much as it can out of a low priced unit Based on the ARM7TDMI CPU chip, also used on some phones and PDAs Based on the ARM7TDMI CPU chip, also used on some phones and PDAs Appears to be off-the-shelf, no customization by Nintendo Appears to be off-the-shelf, no customization by Nintendo

12 CPU Two modes, 16 bit instructions and 32 bit instructions, can switch between modes Two modes, 16 bit instructions and 32 bit instructions, can switch between modes Why? Why? Internal RAM is 32 bits Internal RAM is 32 bits ROM cartridges are 16 bits ROM cartridges are 16 bits Switch instructions to match the memory being used, can copy code from cartridge to internal RAM Switch instructions to match the memory being used, can copy code from cartridge to internal RAM

13 Memory Many memory areas, most are quite small: Many memory areas, most are quite small: 32 Kbytes on chip memory 32 Kbytes on chip memory 256 Kbytes off chip working memory 256 Kbytes off chip working memory 96 Kbytes VRAM (video RAM) 96 Kbytes VRAM (video RAM) 1 Kbyte sprite properties 1 Kbyte sprite properties 1 Kbyte pallette 1 Kbyte pallette 32 Mbytes cartridge memory (may have several banks of this) 32 Mbytes cartridge memory (may have several banks of this)

14 Memory Access to the cartridge is quite slow Access to the cartridge is quite slow Can run 16 bit code from the cartridge Can run 16 bit code from the cartridge Better to copy important code to working memory and use 32 bit instructions Better to copy important code to working memory and use 32 bit instructions Can store art work in cartridge, bring it into memory when needed Can store art work in cartridge, bring it into memory when needed Programmers need to think more about memory allocation Programmers need to think more about memory allocation

15 Graphics The display is 240 x 160 pixels The display is 240 x 160 pixels Can display up to 32768 colours, but this depends upon the display mode Can display up to 32768 colours, but this depends upon the display mode Most of the time use a 16 colour or 256 colour palette Most of the time use a 16 colour or 256 colour palette Many different modes and options, not all of them can be combined together Many different modes and options, not all of them can be combined together

16 Graphics Two types of graphics: Two types of graphics: Backgrounds Backgrounds Sprites Sprites Background is always drawn first, sprites are drawn over top Background is always drawn first, sprites are drawn over top Can use sprite priorities to put a sprite behind part of the background, this gets to be a bit complicated Can use sprite priorities to put a sprite behind part of the background, this gets to be a bit complicated

17 Backgrounds There can be up to 4 background levels There can be up to 4 background levels There are 6 background modes There are 6 background modes Three modes are tile based, tiles can be either 16 colour or 256 colour Three modes are tile based, tiles can be either 16 colour or 256 colour Tiled backgrounds can vary from 128 x 128 to 1024 x 1024 in size Tiled backgrounds can vary from 128 x 128 to 1024 x 1024 in size Tiles are stored in VRAM and can be shared between background levels Tiles are stored in VRAM and can be shared between background levels

18 Backgrounds Three raster background modes, can access individual pixels: Three raster background modes, can access individual pixels: Single buffer, 240 x 160, 32768 colours Single buffer, 240 x 160, 32768 colours Double buffer, 240 x 160, 256 colours Double buffer, 240 x 160, 256 colours Double buffer, 160 x 128, 32768 colours Double buffer, 160 x 128, 32768 colours Size of raster backgrounds is limited by the amount of VRAM Size of raster backgrounds is limited by the amount of VRAM Cant do full screen, full colour, double buffered Cant do full screen, full colour, double buffered

19 Backgrounds Hardware supports a number of special effects on backgrounds Hardware supports a number of special effects on backgrounds Can scale and rotate some of the background levels Can scale and rotate some of the background levels Can pan all of the background levels independently Can pan all of the background levels independently Can alpha blend two background levels, also increase of decrease level brightness Can alpha blend two background levels, also increase of decrease level brightness

20 Palettes Two separate palettes, one for backgrounds, one for sprites Two separate palettes, one for backgrounds, one for sprites Palettes have 256 entries of 15 bit colour, 5 bits red, 5 bits green, 5 bits blue Palettes have 256 entries of 15 bit colour, 5 bits red, 5 bits green, 5 bits blue Total 512 bytes per palette Total 512 bytes per palette Palette can be viewed as one 256 colour palette, or 16 palettes of 16 colours Palette can be viewed as one 256 colour palette, or 16 palettes of 16 colours

21 Sprites Up to 128 sprites, some restrictions on number of sprites per line Up to 128 sprites, some restrictions on number of sprites per line Sprites built from 8x8 pixel tiles, either 16 or 256 colours Sprites built from 8x8 pixel tiles, either 16 or 256 colours Sprites can vary in size from 8x8 to 64x64 pixels, either square or rectangular Sprites can vary in size from 8x8 to 64x64 pixels, either square or rectangular Sprites can share tiles, multiple objects with same appearance dont need extra memory Sprites can share tiles, multiple objects with same appearance dont need extra memory

22 Sprites Tile memory can hold between 256 and 1024 8x8 tiles, depending upon colour depth and background mode Tile memory can hold between 256 and 1024 8x8 tiles, depending upon colour depth and background mode This limits the number of large sprites and the amount of animation This limits the number of large sprites and the amount of animation For animation need to store a separate set of tiles for each frame, can quickly use up all of the tile memory for large sprites For animation need to store a separate set of tiles for each frame, can quickly use up all of the tile memory for large sprites

23 Example A 64x64 sprite requires 64 tiles for 16 colours and 128 tiles for 256 colours A 64x64 sprite requires 64 tiles for 16 colours and 128 tiles for 256 colours If there are 10 frames of animation (the player character in our phone example has 12) we need 640 or 1280 (too many) tiles If there are 10 frames of animation (the player character in our phone example has 12) we need 640 or 1280 (too many) tiles Only store some of the animation frames in tile memory, copy frames in when required Only store some of the animation frames in tile memory, copy frames in when required

24 Sprites Sprite position, address of tiles and other properties stored in sprite memory Sprite position, address of tiles and other properties stored in sprite memory Can change properties between frames Can change properties between frames 32 sets of scaling and rotation data that can be shared between the sprites 32 sets of scaling and rotation data that can be shared between the sprites Each sprite can be flipped about horizontal or vertical axis Each sprite can be flipped about horizontal or vertical axis

25 Sound A mixture of old Game Boy analogue sound and newer digital sound A mixture of old Game Boy analogue sound and newer digital sound There are 6 sound channels that are mixed to provide a final stereo sound (only heard in headphones) There are 6 sound channels that are mixed to provide a final stereo sound (only heard in headphones) The final output sound is 9 bits sampled at a rate of 32768 Hz The final output sound is 9 bits sampled at a rate of 32768 Hz This is not very high quality! This is not very high quality!

26 Sound First four channels are basically noise generators First four channels are basically noise generators Can control their parameters, each channel produces a different type of noise Can control their parameters, each channel produces a different type of noise The last two channels are for digital sound The last two channels are for digital sound This is basically 8 bits sampled at 32768 Hz This is basically 8 bits sampled at 32768 Hz Samples stored in on chip RAM Samples stored in on chip RAM

27 Serial Port There is one serial port that is used for a number of communications tasks: There is one serial port that is used for a number of communications tasks: Communications with up to three other Game Boys, multi-player games Communications with up to three other Game Boys, multi-player games Communications with external devices, like game controllers and joysticks Communications with external devices, like game controllers and joysticks Communications with development machines, downloading of code and debugging Communications with development machines, downloading of code and debugging

28 Serial Port One of the standard ways of getting code onto a Game Boy One of the standard ways of getting code onto a Game Boy Program prepared on a PC, art work collected and program compiled Program prepared on a PC, art work collected and program compiled Cable connects PC to Game Boy serial port, game is transferred to the Game Boy RAM Cable connects PC to Game Boy serial port, game is transferred to the Game Boy RAM Only works for programs that fit into 256 Kbytes RAM Only works for programs that fit into 256 Kbytes RAM

29 Cartridge Standard ROM cartridges can have up to 32 Mbytes of program Standard ROM cartridges can have up to 32 Mbytes of program Executing from cartridge is slower than RAM, but there is much more room Executing from cartridge is slower than RAM, but there is much more room Usually transfer program code to RAM for execution, take advantage of faster memory on Game Boy Usually transfer program code to RAM for execution, take advantage of faster memory on Game Boy Program split between cartridge and RAM Program split between cartridge and RAM

30 Cartridge Each cartridge has a header recorded at the start of ROM Each cartridge has a header recorded at the start of ROM Contains name of game, manufacturer, device codes, where to start execution of the game Contains name of game, manufacturer, device codes, where to start execution of the game Also contains a compressed version of the standard Nintendo logo Also contains a compressed version of the standard Nintendo logo Program will not run without the logo, Game Boy checks for this Program will not run without the logo, Game Boy checks for this

31 Cartridge One of the important steps in game development is to add the logo to the header for your program One of the important steps in game development is to add the logo to the header for your program This is put there for legal reasons, to catch piracy This is put there for legal reasons, to catch piracy Very weak protection in terms of copying, can easily copy the logo from another cartridge and add it to your program Very weak protection in terms of copying, can easily copy the logo from another cartridge and add it to your program

32 Cartridge Mainly used for court cases Mainly used for court cases The Nintendo logo is a copyrighted trademark The Nintendo logo is a copyrighted trademark You cannot use it without permission from Nintendo, so legally you cant put it in your program You cannot use it without permission from Nintendo, so legally you cant put it in your program Legal case is based on use of trademark, not the illegal copying of the game! Legal case is based on use of trademark, not the illegal copying of the game!

33 Development Process Everything is on the cartridge, Game Boy views it as a program Everything is on the cartridge, Game Boy views it as a program It doesnt know anything about files, it doesnt have any It doesnt know anything about files, it doesnt have any Content cant be stored as files on the cartridge Content cant be stored as files on the cartridge Must become part of the program, part of the data that is built into the program Must become part of the program, part of the data that is built into the program

34 Development Process Art work can be produced using standard tools, well at least some of it Art work can be produced using standard tools, well at least some of it This art work then needs to be put into a format where it can be used in the game This art work then needs to be put into a format where it can be used in the game For example, sprites need to be divided into tiles For example, sprites need to be divided into tiles Usually produce a standard set of images for the sprites, artist doesnt think about tiles Usually produce a standard set of images for the sprites, artist doesnt think about tiles

35 Development Process First use a program to divide the sprite images into tiles First use a program to divide the sprite images into tiles All the sprites use the same palette, so some care must be used here: All the sprites use the same palette, so some care must be used here: Develop a single palette that is used for all sprite images Develop a single palette that is used for all sprite images Use a program that constructs a best fit palette from all the sprite images Use a program that constructs a best fit palette from all the sprite images

36 Development Process Now have tiled sprites, plus a palette Now have tiled sprites, plus a palette Need to convert this into program code or data, something we can put in the cartridge Need to convert this into program code or data, something we can put in the cartridge Another program is used for this, produces a file that is combined with the program Another program is used for this, produces a file that is combined with the program Each time the art work changes, all these programs must be run again Each time the art work changes, all these programs must be run again

37 Development Process Backgrounds are a bit easier Backgrounds are a bit easier Tile based map editors are common, level designers are used to dealing with them Tile based map editors are common, level designers are used to dealing with them Still need to convert the background images into a format that can be included with the program Still need to convert the background images into a format that can be included with the program Sound is harder, need special tools due to the strange sound formats Sound is harder, need special tools due to the strange sound formats

38 Tool Chain The set of programs used to create the art work is called a tool chain The set of programs used to create the art work is called a tool chain Programs are executed one after the other, like the links in a chain Programs are executed one after the other, like the links in a chain If one of them is missed, or doesnt work right, the art work is no good If one of them is missed, or doesnt work right, the art work is no good A change to the original art work means we have to execute the whole chain A change to the original art work means we have to execute the whole chain

39 Tool Chain Programmers usually develop the tool chains for individual game projects Programmers usually develop the tool chains for individual game projects Usually work closely with artists, make it easier for them to produce the art work Usually work closely with artists, make it easier for them to produce the art work Tool chains sometimes shared between games Tool chains sometimes shared between games Trend towards having technically sophisticated artists produce the tool chains – technical artist Trend towards having technically sophisticated artists produce the tool chains – technical artist

40 Nintendo DS Information just beginning to appear now, still not a lot of details Information just beginning to appear now, still not a lot of details The DS is considerably more complex than the Game Boy: The DS is considerably more complex than the Game Boy: Much harder to program, some very tricky issues as we will see Much harder to program, some very tricky issues as we will see Harder to find information Harder to find information Harder to produce programming tools Harder to produce programming tools

41 CPUs The DS has two CPUs, this makes it more complicated The DS has two CPUs, this makes it more complicated The first CPU is a ARM7TDMI, same as the Game Boy, but twice as fast The first CPU is a ARM7TDMI, same as the Game Boy, but twice as fast The second CPU is an ARM9426E, more modern than Game Boy and running four times faster The second CPU is an ARM9426E, more modern than Game Boy and running four times faster Both seem to be standard off the shelf Both seem to be standard off the shelf

42 CPUs It appears that the ARM9 is the main processor, responsible for main game logic and graphics It appears that the ARM9 is the main processor, responsible for main game logic and graphics The ARM7 is a slave and deals with: The ARM7 is a slave and deals with: Sound Sound Wifi Wifi Touch pad Touch pad The ARM7 may not be able to do graphics The ARM7 may not be able to do graphics

43 Memory The DS has considerably more memory The DS has considerably more memory The working RAM is 4Mbytes, and is shared between the two processors The working RAM is 4Mbytes, and is shared between the two processors This memory is used for program code and communications between the CPUs This memory is used for program code and communications between the CPUs There is also 32 Kbytes of internal RAM, not sure if this is shared or a separate copy for each processor There is also 32 Kbytes of internal RAM, not sure if this is shared or a separate copy for each processor

44 Video The main external feature of the DS The main external feature of the DS Two 256x192 pixel displays, still 16 bit colour Two 256x192 pixel displays, still 16 bit colour Approximately 700 Kbytes of video RAM Approximately 700 Kbytes of video RAM Four main banks of 128 Kbytes that appear to serve the same function as Game Boy VRAM Four main banks of 128 Kbytes that appear to serve the same function as Game Boy VRAM Can simulate Game Boy graphics Can simulate Game Boy graphics

45 Video There are two 2D graphics engines, main and sub (attached to the two displays??) There are two 2D graphics engines, main and sub (attached to the two displays??) The main engine is more powerful The main engine is more powerful Has at least 7 background modes, many are tile based and similar to the Game Boy Has at least 7 background modes, many are tile based and similar to the Game Boy Can also have full frame buffer access, can apparently use the first four memory banks for this Can also have full frame buffer access, can apparently use the first four memory banks for this

46 Video Sprite support seems to be similar to Game Boy Sprite support seems to be similar to Game Boy The 2D engines have separate palette and sprite memory, but it might be possible to share the VRAM The 2D engines have separate palette and sprite memory, but it might be possible to share the VRAM Big advance is 3D graphics engine, can be shared between the two screens, but there is a speed penalty Big advance is 3D graphics engine, can be shared between the two screens, but there is a speed penalty

47 3D Primitive by modern standards Primitive by modern standards No floating point, uses fixed point integer coordinates, etc No floating point, uses fixed point integer coordinates, etc Need to be careful with model construction, particularly transformations Need to be careful with model construction, particularly transformations May need to process models before they can be used on the DS May need to process models before they can be used on the DS This could be a bit tricky This could be a bit tricky

48 3D Still 16 bit colour Still 16 bit colour Has texture mapping, but no texture filtering Has texture mapping, but no texture filtering Can do hardware anti-aliasing Can do hardware anti-aliasing There are suggestions that it can do special video effects like toon shading, but this hasnt been seen There are suggestions that it can do special video effects like toon shading, but this hasnt been seen

49 Sound May support Game Boy sound May support Game Boy sound Appears to have a better sound system that is based on sampled sounds Appears to have a better sound system that is based on sampled sounds Appears to have up to 8 channels of sampled or wave sound that can be mixed and played together Appears to have up to 8 channels of sampled or wave sound that can be mixed and played together Appears that the ARM7 controls the sound Appears that the ARM7 controls the sound

50 WIFI The DS can use standard 802.11g wireless networking, not sure how complete this is The DS can use standard 802.11g wireless networking, not sure how complete this is It also has its own Nintendo based protocol – called NIFI It also has its own Nintendo based protocol – called NIFI This is mainly used for multiplayer games, same as the link cables on Game Boy This is mainly used for multiplayer games, same as the link cables on Game Boy Can also download games over NIFI Can also download games over NIFI

51 Cartridges The DS cartridges are encrypted in real time, so they are harder to deal with than Game Boy ones The DS cartridges are encrypted in real time, so they are harder to deal with than Game Boy ones The cartridge itself has a processor for encryption, the DS sends it the information for encryption when it starts The cartridge itself has a processor for encryption, the DS sends it the information for encryption when it starts Only the initial cartridge header isnt encrypted Only the initial cartridge header isnt encrypted

52 Development The first problem is getting code onto the DS, cant simply write cartridges The first problem is getting code onto the DS, cant simply write cartridges There are now two approaches There are now two approaches First is to intercept the DS cartridge header and modify it to point to the GBA cartridge First is to intercept the DS cartridge header and modify it to point to the GBA cartridge The GBA cartridge has the DS program, can be written by standard GBA tools The GBA cartridge has the DS program, can be written by standard GBA tools

53 Development This requires a DS cartridge to use as a header donor, and a special hardware device to modify the header This requires a DS cartridge to use as a header donor, and a special hardware device to modify the header The second approach is to use NIFI to download a program, usually to read the game from the GBA cartridge The second approach is to use NIFI to download a program, usually to read the game from the GBA cartridge This requires a particular WIFI adaptor for the PC, only one type will work This requires a particular WIFI adaptor for the PC, only one type will work This seems to be the best approach This seems to be the best approach

54 Development Most of the tools used for Game Boy development can also be used with DS Most of the tools used for Game Boy development can also be used with DS The 2D art work is basically the same, and similar processors are used The 2D art work is basically the same, and similar processors are used The main difference is in sound formats and 3D graphics The main difference is in sound formats and 3D graphics Need to keep the ARM7 and ARM9 code separate Need to keep the ARM7 and ARM9 code separate


Download ppt "Game Boy Mark Green School of Creative Media City University of Hong Kong."

Similar presentations


Ads by Google