diff options
author | Flenk008 <frenk_0_0@hotmail.com> | 2023-03-13 18:04:59 +0100 |
---|---|---|
committer | Flenk008 <frenk_0_0@hotmail.com> | 2023-03-13 18:04:59 +0100 |
commit | 47c76e5eabd2b7aa4eb0de7ca34b4ef9ac78f395 (patch) | |
tree | d6f75676ba9f544910cc3e49e4e3f3a49cb15d7a /test/bin/test_file_read.c | |
parent | 91c9d1c9fc13cf163c6262437de16c992dadaa5b (diff) |
Revert "Revert "Merge branch 'dev' of https://github.com/Flenk008/avans-arcade into dev""
This reverts commit a9ad8e0a8ac5346108f1e2c1a0bf9360fadc20da.
Diffstat (limited to 'test/bin/test_file_read.c')
-rw-r--r-- | test/bin/test_file_read.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/test/bin/test_file_read.c b/test/bin/test_file_read.c index b3357ce..df93395 100644 --- a/test/bin/test_file_read.c +++ b/test/bin/test_file_read.c @@ -16,19 +16,22 @@ void printData(uint8_t* in) { } void hh_ppu_load_tilemap() { - char* filename = "tiles.bin"; + + + char* filename = "slime.bin"; FILE* fp = fopen(filename,"rb"); if (!fp){ return;//error } + int sprite_size = (16 * 16); fseek(fp, 0, SEEK_END); - int _size = ftell(fp)/HH_PPU_VRAM_TMM_SPRITE_SIZE; - fseek(fp, 0, 0); + int _size = ftell(fp)/sprite_size; + rewind(fp); // printf("%i",_size); for (int i = 0; i < _size; i++) { - uint8_t data[HH_PPU_VRAM_TMM_SPRITE_SIZE]; - fread(data,HH_PPU_VRAM_TMM_SPRITE_SIZE,1,fp); + uint8_t data[sprite_size]; + fread(data,1,sprite_size,fp); printData(data); } |