I've been trying https://github.com/ljsebald/KallistiOS/ ... l/basic/gl with no success, regardless of whether it's running in an emulator or on hardware.
My dev environment is Debian Linux (see https://github.com/Drylm/dc-dev), which seems to compile the example just fine:
Code: Select all
root@a1741946a172:/src/kos-docker-test/examples/dreamcast/kgl/basic/gl# make
rm -f gltest.elf romdisk.*
kos-cc -c gltest.c -o gltest.o
gltest.c: In function 'main':
gltest.c:245:12: warning: format '%d' expects argument of type 'int', but argument 2 has type 'uint32' [-Wformat]
gltest.c:245:12: warning: format '%f' expects argument of type 'double', but argument 3 has type 'int' [-Wformat]
gltest.c:245:12: warning: format '%f' expects argument of type 'double', but argument 4 has type 'float' [-Wformat]
gltest.c:126:13: warning: variable 'texture' set but not used [-Wunused-but-set-variable]
kos-cc -c pvr-texture.c -o pvr-texture.o
/src/dc/kos/utils/genromfs/genromfs -f romdisk.img -d romdisk -v
0 rom 58661264 [0xffffffff, 0xffffffff] 37777777777, sz 0, at 0x0
1 . [0x34 , 0xff6de ] 0040755, sz 0, at 0x20
1 .. [0x34 , 0xff6da ] 0040755, sz 0, at 0x40 [link to 0x20 ]
1 glass.pvr [0x34 , 0xff6df ] 0100755, sz 32800, at 0x60
/src/dc/kos/utils/bin2o/bin2o romdisk.img romdisk romdisk.o
/opt/toolchains/dc/sh-elf/bin/sh-elf-gcc -O2 -fomit-frame-pointer -ml -m4-single-only -ffunction-sections -fdata-sections -I/src/dc/kos/../kos-ports/include -I/src/dc/kos/include -I/src/dc/kos/kernel/arch/dreamcast/include -I/src/dc/kos/addons/include -I/src/dc/kos/../kos-ports/include -D_arch_dreamcast -D_arch_sub_pristine -Wall -g -fno-builtin -fno-strict-aliasing -ml -m4-single-only -Wl,-Ttext=0x8c010000 -Wl,--gc-sections -T/src/dc/kos/utils/ldscripts/shlelf.xc -nodefaultlibs -L/src/dc/kos/lib/dreamcast -L/src/dc/kos/addons/lib/dreamcast -L/src/dc/kos/../kos-ports/lib -ml -m4-single-only -Wl,-Ttext=0x8c010000 -Wl,--gc-sections -T/src/dc/kos/utils/ldscripts/shlelf.xc -nodefaultlibs -L/src/dc/kos/lib/dreamcast -L/src/dc/kos/addons/lib/dreamcast -L/src/dc/kos/../kos-ports/lib -o gltest.elf \
gltest.o pvr-texture.o romdisk.o -lGL -lpcx -lkosutils -Wl,--start-group -lkallisti -lc -lgcc -Wl,--end-group
Code: Select all
sh-elf-objcopy -O binary gltest.elf gltest.bin
/src/dc/kos/utils/scramble/scramble gltest.bin 1ST_READ.BIN
To test using emulators, I use BootDreams to generate a .CDI and then depending on the emulator either load the CDI directly or use DaemonTools to mount it as a virtual disk drive. Here are the results:
- DreamEMU loads the scrambled .bin and just renders a black screen (similar to the real hardware, but no way to see logs).
- Demul shows the SEGA license screen then freezes (no way to see logs).
- Chankast shows the SEGA license screen then freezes (no way to see logs).
- reicast does not show the SEGA license screen, and just shows the error: "in cpu_iNimp -> ..\core\hw\sh4\interpr\sh4_opcodes.cpp : 66"
- nulldc shows the SEGA license screen then freezes with the following error:
Code: Select all
KallistiOS ##version##: Mon Oct 31 23:34:55 UTC 2016
root@f246d9df54da:/src/dc/kos
Except in block BE5ECEB | E4765B8
Except in block BE5ECEB | E4765B8
Except in block BE5FF11 | E4773F8
Except in block BE8D0EA | E4948C8
VREG = 03 ARMRST 01
Except in block BE8D552 | E495108
not implemented opcode : 740 : unknown opcode @ 449
Press Any key to continue
Edit:
I should add, I've tried a handful of other examples with similar results but am focusing on the GL example because I want to use it to experiment.
Attached are all the generated .elf, .bin and .cdi files.