pixel column [9..0] draw: read map x [5..0]
TRANSCRIPT
Keyboard (fromUP1
package)
Map_update:Decode the keyboard scancode and update the Map
Scan_ready
Read
Scan_code [7..0]
VGA_sync (from UP1 package)
Vert_sync
Draw:Read the bitmap and update the screen
Map_X [5..0] <= Pixel_column [9..4]Map_Y [4..0] <= Pixel_row [8..4]
Bitmap_address[10..0] <= Grid_type [2..0] & Pixel_row [3..0] & Pixel_column [3..0]
Red <= Bitmap_data(2); Green <= Bitmap_data(1); Blue <= Bitmap_data(0)
Pixel_row [9..0]
Pixel_column [9..0]
Red
Green
Blue
Map_IOMap_address[10..0] <= Map_X [5..0]& Map_Y [4..0]
Write
Map_X [5..0]
Map_Y [4..0]
Reset
Level
Grid_type [2..0]G
rid_t
ype
[2..0
]
Maps(Blocks of
40 x 32 x 3bits)All levels of maps is stored here
Grid_type [2..0] a2 a1 a0 000: 4FF:
(40 x 32 x 3 bits) map for 1st level
500: 9FF:
(40 x 32 x 3 bits) map for 2nd level
… …
Current_map(40 x 32 x 3bits)
Grid_type [2..0] a2 a1 a0 000: 01F:
1st column of current map
020: 03F:
2nd column of current map
… …
4E0: 4FF:
40th column of current map
Bitmap(8 x 256 x 3bits)
redb2
greenb1
blueb0
000: 0FF:
(16 x 16 x 3 bits) bitmap for grid
type 000 (Background)
100: 1FF:
(16 x 16 x 3 bits) bitmap for grid type 001 (Wall)
… …
700: 7FF:
(16 x 16 x 3 bits) bitmap for grid
type 111 (Ball on Destination Grid)
Map_X [5..0]
Map_Y [4..0]