@@ -39,33 +39,36 @@ gfx_image_t *tileset_tiles[128];
39
39
40
40
/* Put all your code here */
41
41
void main (void ) {
42
- uint8_t key , i ;
42
+ sk_key_t key ;
43
+ uint8_t i ;
44
+ unsigned int x_offset = 0 ;
45
+ unsigned int y_offset = 0 ;
43
46
gfx_image_t * tmp_ptr ;
44
47
gfx_tilemap_t tilemap ;
45
- unsigned x_offset = 0 , y_offset = 0 ;
46
-
48
+
49
+ /* For linking purposes */
47
50
malloc (0 );
48
51
49
52
/* Decompress the tiles */
50
53
for (i = 0 ; i < 128 ; i ++ ) {
51
- tmp_ptr = gfx_AllocSprite ( TILE_WIDTH , TILE_HEIGHT , malloc );
54
+ tmp_ptr = gfx_MallocSprite ( TILE_WIDTH , TILE_HEIGHT );
52
55
dzx7_Turbo ( tileset_tiles_compressed [i ], tmp_ptr ); // or dzx7_Standard, but in this case we have a lot of tiles
53
56
tileset_tiles [i ] = tmp_ptr ;
54
57
}
55
58
56
59
/* Initialize the tilemap structure */
57
- tilemap .map = tilemap_map ;
58
- tilemap .tiles = tileset_tiles ;
59
- tilemap .type_width = gfx_tile_16_pixel ;
60
+ tilemap .map = tilemap_map ;
61
+ tilemap .tiles = tileset_tiles ;
62
+ tilemap .type_width = gfx_tile_16_pixel ;
60
63
tilemap .type_height = gfx_tile_16_pixel ;
61
64
tilemap .tile_height = TILE_HEIGHT ;
62
- tilemap .tile_width = TILE_WIDTH ;
65
+ tilemap .tile_width = TILE_WIDTH ;
63
66
tilemap .draw_height = TILEMAP_DRAW_HEIGHT ;
64
- tilemap .draw_width = TILEMAP_DRAW_WIDTH ;
65
- tilemap .height = TILEMAP_HEIGHT ;
66
- tilemap .width = TILEMAP_WIDTH ;
67
- tilemap .y_loc = Y_OFFSET ;
68
- tilemap .x_loc = X_OFFSET ;
67
+ tilemap .draw_width = TILEMAP_DRAW_WIDTH ;
68
+ tilemap .height = TILEMAP_HEIGHT ;
69
+ tilemap .width = TILEMAP_WIDTH ;
70
+ tilemap .y_loc = Y_OFFSET ;
71
+ tilemap .x_loc = X_OFFSET ;
69
72
70
73
/* Initialize the 8bpp graphics */
71
74
gfx_Begin ( gfx_8bpp );
0 commit comments