Re: Mode 72 development
Posted: Sat Mar 17, 2018 7:46 am
Do the code tiles support X mirroring?
The open source retro-minimalist game console
https://uzebox.org/forums/
No, I can't do that, as I said a tile (or more appropriately a tile row) is generated by code, which is sequential (pixels are output by a stream of code). That's not something which could be reversed. Obviously, you can have Y mirrored variants of tiles "for free" (since it is just a rearrangement of the tile rows).
The generator is in the Mode 72 directory of the kernel. It has a short description on the top (below the GPL notice). You need Gimp, lay out your tileset as described there (as a 8 pixel tall image containing your tiles sequentially), convert it to indexed color if necessary (at most 16 colors, color 0 is background, color 15 is border), and save it as a header file (tileset.h), which you can copy alongside the generator. Then compile the generator, and run it, redirecting its output into an assembly file ("./a.out > tileset.s" in a Bash shell if you compiled as "gcc tilegen.c"). Not exactly user-friendly, but its a developer tool. You can then include the assembly file in your build, you can use the Mode 72 example there to start off.
I dunno what your system did to it, but the file seems to be UTF-16, a quite unusual format which the compiler likely can not recognize. You can convert it to ASCII or UTF-8 with Notepad++ or possibly something else (I just mentioned Notepad++ since I know it has such a conversion feature). The file otherwise seems to be all right, you likely generated it proper, but somehow the output became UTF-16 which for me is very odd.rocifier wrote: ↑Sun Mar 18, 2018 8:21 am Hi Jubation, seemed simple enough to generate the tileset assembly file. But I'm having difficulty compiling it in. I replaced tileset.s in the examples/videoMode72 directory, and tileset.h in the examples/videoMode72/assets directory. I get over 7000 lines of errors in the tileset.s file, most of which are null characters being ignored, but become more random and serious. Do you think it might be some kind of line ending compatibility with windows? I've attached my two files for you to try if you have time. Thanks for any help!
Wow that's weird, you're right. I changed the file and it seems much better now. Thanks for that! Hopefully this kind of stuff will help others venturing through this in windows. Just a handful of more legitimate errors which I don't understand. They all look like this... any ideas?Jubatian wrote: ↑Sun Mar 18, 2018 9:17 amI dunno what your system did to it, but the file seems to be UTF-16, a quite unusual format which the compiler likely can not recognize. You can convert it to ASCII or UTF-8 with Notepad++ or possibly something else (I just mentioned Notepad++ since I know it has such a conversion feature). The file otherwise seems to be all right, you likely generated it proper, but somehow the output became UTF-16 which for me is very odd.rocifier wrote: ↑Sun Mar 18, 2018 8:21 am Hi Jubation, seemed simple enough to generate the tileset assembly file. But I'm having difficulty compiling it in. I replaced tileset.s in the examples/videoMode72 directory, and tileset.h in the examples/videoMode72/assets directory. I get over 7000 lines of errors in the tileset.s file, most of which are null characters being ignored, but become more random and serious. Do you think it might be some kind of line ending compatibility with windows? I've attached my two files for you to try if you have time. Thanks for any help!
Code: Select all
_obj_/tileset.o: In function `tilerow_block_32':
tileset.s:1188: relocation truncated to fit: R_AVR_13_PCREL against `no symbol'
_obj_/tileset.o: In function `tilerow_block_34':
tileset.s:1201: relocation truncated to fit: R_AVR_13_PCREL against `no symbol'
They were bugs in the generator which I fixed now (check out the Mode72 branch to have the fixes). Your tileset is currently smaller than that of the example, so the generator tries to use a different code generation method for it to pack it tighter. This had a few bugs.
Code: Select all
m72_rowoff[i] = (u16)(&main_vram[((u16)(i) * 32U) + (j >> 3)]) + ((u16)(j & 7U) << 12);