#22505 - sgeos - Wed Jun 23, 2004 4:21 am
Code: |
#define VRAM ((u16*)0x6000000) // BG Tile VRAM, Tilemaps, Bitmaps
#define TILE16_SIZE 0x20 // 16 color tile #define SBB_SIZE 0x800 // Screen Base Block Size #define CBB_SIZE 0x4000 // Character Base Block Size /*** This Function does not work without a cast */ void load_tiles(const void *source, u32 length, int block, int start_tile) { u16 dma_count = length / 4; void *destination = (void *) ((int)VRAM + block * CBB_SIZE + start_tile * TILE16_SIZE); // Works // (VRAM + block * CBB_SIZE + start_tile * TILE16_SIZE); // Fails if (dma_count < 1) dma_count = 1; dma_copy(3, source, destination, dma_count, 32 /* bit */); } /*** This Function *does work* without a cast */ void load_tilemap(const void *source, u32 length, int block, int start_char) { // FIXME: start_char * map_cell_size u16 dma_count = length / 4; void *destination = (void *) (VRAM + block * SBB_SIZE + start_char * TILE16_SIZE); if (dma_count < 1) dma_count = 1; dma_copy(3, source, destination, dma_count, 32 /* bit */); } |
-Brendan