Compiling for Naomi: Difference between revisions

From dreamcast.wiki
Jump to navigation Jump to search
(added 2024 to the commit infos)
 
(4 intermediate revisions by the same user not shown)
Line 2: Line 2:


== Prerequisites ==
== Prerequisites ==
* if you want to use GLDC, you need recent GLdc code (you need commit bd17c995 of 03 feb 2024)
* if you want to use GLdc, you need recent GLdc code (you need at least commit [https://gitlab.com/simulant/GLdc/-/commit/b1223cfd1cc6a829c8acccc28220e15b5383522f b1223cfd] of 03 feb 2024)
* download (git clone) kos & kos-ports into separate folders, eg /kosnaomi & /kos-portsnaomi
* download (git clone) kos & kos-ports into separate folders, eg /kosnaomi & /kos-portsnaomi
* adapt the following in /kosnaomi/environ.sh:
* adapt the following in /kosnaomi/environ.sh:
Line 31: Line 31:
     /opt/toolchains/dc/kosnaomi/utils/naominetboot/naominetboot -t 192.168.1.202 -x raylib_nao.dat -a
     /opt/toolchains/dc/kosnaomi/utils/naominetboot/naominetboot -t 192.168.1.202 -x raylib_nao.dat -a


== Send your file to a Naomi via a serial cable ==
== Send your .ELF file to a Naomi via a serial cable ==
If you don't have a DIMM board, or just want to use dc-tool-serial to upload a Naomi .elf via a serial cable, you need:
If you don't have a DIMM board, or just want to use dc-tool-serial to upload a Naomi .elf via a serial cable, you need:
* a custom bios containing dc-load-ser
* a custom bios containing dc-load-ser
* recent KallistiOS code (you need commit d059b92 of 04 feb 2024)
* recent KallistiOS code (you need commit [https://github.com/KallistiOS/KallistiOS/commit/d059b922625b6fd1f05dac4381b48d0ba571650b d059b92] of 04 feb 2024)
* upload the .ELF via your regulat dc-tool-ser command, eg:
* upload the .ELF via your usual dc-tool-ser command, eg:
     dc-tool-ser -b 1562500 -t /dev/ttyUSB0 -x raylib.elf
     dc-tool-ser -b 1562500 -t /dev/ttyUSB0 -x raylib.elf

Latest revision as of 18:42, 4 February 2024

KallistiOS is able to produce executables that can run on the Sega Naomi arcarde boards.

Prerequisites

  • if you want to use GLdc, you need recent GLdc code (you need at least commit b1223cfd of 03 feb 2024)
  • download (git clone) kos & kos-ports into separate folders, eg /kosnaomi & /kos-portsnaomi
  • adapt the following in /kosnaomi/environ.sh:
    KOS_SUBARCH="naomi"
    KOS_BASE  <- point to your naomi kos folder
    KOS_PORTS <- point to your naomi kos-ports folder
  • Build these /kosnaomi & /kos-portsnaomi
  • if you want to use raylib, you need recent raylib4Dreamcast code (you need commit TODO of 04 feb 2024)

Compilation to a .ELF

Example compilation for a raylib example:

  • Go to the folder that contains your example, eg:
    cd /opt/toolchains/dc/kos-portsnaomi/raylib4Dreamcast/samples/shapes/basic_shapes
  • source the environ.sh of your naomi folder:
    source /opt/toolchains/dc/kosnaomi/environ.sh
  • build the .elf for Naomi:
    make

Converting an .ELF to a .DAT to send to a Naomi DIMM

  • Convert your Naomi-built KOS .ELF to a .BIN file:
    /opt/toolchains/dc/sh-elf/sh-elf/bin/objcopy -R .stack -O binary raylib.elf raylib_nao.bin
  • convert your Naomi .BIN to a .DAT file:
    /opt/toolchains/dc/kosnaomi/utils/naomibintool/naomibintool build raylib_nao.dat -d DEVELOPERNAME -t GAMETITLE -b raylib_nao.bin

Send your .DAT file to a Naomi DIMM via ethernet

  • Assuming the IP address of the Naomi is 192.168.1.202:
    /opt/toolchains/dc/kosnaomi/utils/naominetboot/naominetboot -t 192.168.1.202 -x raylib_nao.dat -a

Send your .ELF file to a Naomi via a serial cable

If you don't have a DIMM board, or just want to use dc-tool-serial to upload a Naomi .elf via a serial cable, you need:

  • a custom bios containing dc-load-ser
  • recent KallistiOS code (you need commit d059b92 of 04 feb 2024)
  • upload the .ELF via your usual dc-tool-ser command, eg:
    dc-tool-ser -b 1562500 -t /dev/ttyUSB0 -x raylib.elf