Optiroc / SuperFamiconv

Flexible and composable tile graphics converter supporting Super Nintendo, Game Boy, Game Boy Color, Game Boy Advance, Mega Drive, PC Engine and WonderSwan formats.
MIT License
143 stars 20 forks source link

Add 1bpp and 8x16 for DMG/CGB #31

Closed basxto closed 3 years ago

basxto commented 3 years ago

This implements 1bpp (half 2bpp) and 8x16 (used in sprites) for original Game Boy and Game Boy Color.

Implements #25

1bpp is not supported by the hardware, but easily realized with software, it's just

ld a, (hl+)
ld (de), a
ld (de), a
inc de

Tested with

#!/bin/sh
sfc=../bin/superfamiconv
testfile=cgb_dmg_testpattern.png
echo === 1bpp
${sfc} tiles -v -Mgb --no-remap -B 1 -i ${testfile} -d ${testfile}.1bpp -o ${testfile}.1bpp.png
echo === 1bpp
${sfc} tiles -v -Mgb --no-remap -B 1 -i cgb_dmg_testpattern_mono.png -d ${testfile}_mono.1bpp -o ${testfile}_mono.1bpp.png
echo === 2bpp
${sfc} tiles -v -Mgb --no-remap -i ${testfile} -d ${testfile}.2bpp -o ${testfile}.2bpp.png
echo === sprite
${sfc} tiles -v -Mgb --no-remap --sprite-mode -i ${testfile} -d ${testfile}.spr.2bpp -o ${testfile}.spr.2bpp.png
echo === 8x16
${sfc} tiles -v -Mgb --no-remap -H 16 -i ${testfile} -d ${testfile}.16.2bpp -o ${testfile}.16.2bpp.png

and

cgb_dmg_testpattern cgb_dmg_testpattern_mono

Optiroc commented 3 years ago

Thanks! Looks good 👌