• Aucun résultat trouvé

Programmation des syst´emes Working with Graphics

N/A
N/A
Protected

Academic year: 2022

Partager "Programmation des syst´emes Working with Graphics"

Copied!
6
0
0

Texte intégral

(1)

Programmation des syst´ emes Working with Graphics

March 21, 2016

(2)

Basics

I No OS or any other library, we are on our own..

I place the bits in the right place(registers/memory locations) and get things done (as specified by hardware)

I Video processing can be done in different modes (mode 3,4 and 5)

I Choice of the mode depends on your application

(3)

Screen, Pixels, Colors and Video Buffer

I Screen is represented by pixels, where a pixel is assigned a color

I Color is represented by 16 bits (mode 3), 5 Red, 5 Green, 5 Blue, 1 unused

5 5 5

(4)

Screen, Video Buffer and Pixels

I Depending on the mode, resolution of the pixel grid is defined

I Graphic you want to draw (in the form of pixels) has to be written to the video buffer

0,0 239,0

0,159 239,159

Figure : Mode 3 screen resolution240*160

I Video buffer is on the memory, starting from a specific memory address

...

240 240 240

(5)

Drawing Pixels

I Initialize the video mode (we work on mode 3 or mode 4 for this assignment)

I The register responsible for this resides in 0x4000000 address

I #define REG DISPCNT *(unsigned short *) 0x4000000

I Assign the value to this register

I #define BG2 ENABLE 0x400

I #define MODE 4 0x4

I #define MODE 3 0x3

I REG DISPCNT = MODE 4| BG2 ENABLE

I Just assign a color to the respective pixel location (i,j) on the screen

I videoBuffer[i*240+j]=color

(6)

Some more on graphics

I Mode 4 has different resolution, color representation and video buffer structure

I Colors are defined in a palette, indexed by 8 bit integers

I Offers the possibility of double buffering to make animations more smoother

I Have a look at the GBA book chapter on graphics for more details

Références

Documents relatifs

[r]

[r]

I ´ ex´ ecution : permet de lancer le prg contenu ds le fichier ss forme de code binaire ex´ ecutable ou de script shell ; pour un r´ ep, permet de traverser le r´ ep

Il avait 45 roses de plus que

• les pilotes sont appel´ es par une plateforme, potentiellement plusieurs fois, avec la configuration mat´ erielle acquise lors du boot ou de l’insertion du p´ eriph´ erique,.

This powerful concept allows the supervisor mode and user mode of the MC68008 to each have their own system stack pointer (con- sistently referred to as SP) without needing

The output pointer’s value is used for retrieving a digit from the buffer and putting it in CHARM and CHARL.. For instance, if the output pointer equals 05 hex, then the contents of

) le résultat suivant : Toute description d’événements dans l’espace nécessite l’emploi d’un corps rigide auquel les événements doivent être rapportés. ) Je définis la