<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://dreamcast.wiki/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tchan</id>
	<title>dreamcast.wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://dreamcast.wiki/wiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Tchan"/>
	<link rel="alternate" type="text/html" href="https://dreamcast.wiki/Special:Contributions/Tchan"/>
	<updated>2026-04-27T06:06:58Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.3</generator>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Coder%27s_cable&amp;diff=3833</id>
		<title>Coder&#039;s cable</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Coder%27s_cable&amp;diff=3833"/>
		<updated>2025-11-08T15:22:33Z</updated>

		<summary type="html">&lt;p&gt;Tchan: corrected MacOS support for custom baudrates&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;coder&#039;s cable&#039;&#039;&#039; is the name given to the serial-based cable some developers use to test and debug code during development. Originally, cables were connected to host devices via serial, but modern cable designs incorporate a USB controller instead. Coder&#039;s cables can also be used for other purpose&#039;s besides development, such as transferring VMU data back to a PC or dumping GD-ROMs (although quite slowly).&lt;br /&gt;
&lt;br /&gt;
== Buy a pre-made cable ==&lt;br /&gt;
* eg: Contact &#039;&#039;&#039;darc&#039;&#039;&#039; on the [https://dcemulation.org/phpBB/memberlist.php?mode=viewprofile&amp;amp;u=5284 Message Board] or [https://discord.gg/wDEfkUh63h Discord] for a pre-made CP2102N-based cable&lt;br /&gt;
* eg: [https://www.retroonyx.com/product-page/dreamcast-usb-coders-cable retroonyx cable], FTDI-based cable.&lt;br /&gt;
* (only mentioned for historical purposes - not sold anymore since long - &amp;quot;Lik-Sang coder&#039;s cable&amp;quot; - max speed of 781250)&lt;br /&gt;
&lt;br /&gt;
== Build your own cable ==&lt;br /&gt;
* DC serial connector:&lt;br /&gt;
** best connector today is the one used by the [https://www.ebay.com/sch/i.html?_nkw=DC+SD+Adapter+V2 DC SD Adapter V2] (+- 20 USD)&lt;br /&gt;
{|&lt;br /&gt;
| [[File:DC SD Adapter V2.jpg|thumb|alt=DC SD Adapter V2|DC SD Adapter V2]]&lt;br /&gt;
|}&lt;br /&gt;
* select a usb-to-serial chip/cable (+- 15 USD)&lt;br /&gt;
** [https://www.silabs.com/interface/usb-bridges/usbxpress Silicon Labs &#039;&#039;&#039;CP2102N&#039;&#039;&#039;]:&lt;br /&gt;
*** Supports 1600000, which is a 2,4% baudrate mismatch with the Dreamcast, which seems acceptable for high speeds. Best chip that can be recommended today. Tests give speeds of 170-190 kByte/sec and more thanks to compression.&lt;br /&gt;
*** eg [https://www.adafruit.com/product/5335 Adafruit CP2102N Friend (USB-C)]&lt;br /&gt;
*** eg [https://www.silabs.com/development-tools/interface/cp2102n-mini-development-kit?tab=overview Silicon Labs CP2102N-MINIEK (mini USB)]&lt;br /&gt;
*** eg [https://www.amazon.co.uk/DSD-TECH-SH-U09BL-Serial-CP2102N/dp/B08JLRP6YV DSD TECH SH-U09BL USB to TTL Serial Cable with CP2102N Chip]&lt;br /&gt;
*** eg [https://github.com/cepawiel/dc-serial Colton&#039;s custom PCB] - Kicad files to order a custom PCB with a CP2102N, to be soldered to the serial connector of a DC SD Adapter V2&lt;br /&gt;
&lt;br /&gt;
** FDTI&#039;s &#039;&#039;&#039;FT232R&#039;&#039;&#039;-like chips:&lt;br /&gt;
*** &#039;&#039;&#039;good until 781250&#039;&#039;&#039;, does not support 1562500.&lt;br /&gt;
*** 500000 and 1500000 will not work with all chips/on all pc, because of a 4% baud rate mismatch with the baudrates of the Dreamcast.&lt;br /&gt;
**** Even if you&#039;re lucky, you won&#039;t really get 1500000-worthy speeds - more probably around 130-150 kByte/sec...&lt;br /&gt;
&lt;br /&gt;
* connect the following pins (cfr [[Serial_interface]]):&lt;br /&gt;
** GND &amp;lt;-&amp;gt; GND&lt;br /&gt;
** TXD &amp;lt;-&amp;gt; RXD&lt;br /&gt;
** RXD &amp;lt;-&amp;gt; TXD&lt;br /&gt;
** RTS &amp;lt;-&amp;gt; CTS&lt;br /&gt;
** CTS &amp;lt;-&amp;gt; RTS&lt;br /&gt;
&lt;br /&gt;
== Software to use ==&lt;br /&gt;
[[Dcload-serial]]&lt;br /&gt;
&lt;br /&gt;
== Supported Baud Rates ==&lt;br /&gt;
&#039;&#039;&#039;Not all common baudrates work&#039;&#039;&#039;, so the recommendations are:&lt;br /&gt;
* &#039;&#039;&#039;up until 115200&#039;&#039;&#039;, you can use the common baudrates: 9600, 19200, 38400, 57600, 115200&lt;br /&gt;
** if 115200 does not work, you can add the &amp;quot;-e&amp;quot; speedhack option&lt;br /&gt;
* &#039;&#039;&#039;higher baudrates&#039;&#039;&#039;: &lt;br /&gt;
** try first with the &#039;&#039;&#039;dreamcast-specific baudrates&#039;&#039;&#039; (223214, 260416, 312500, 390625, &#039;&#039;&#039;520833, 781250, 1562500&#039;&#039;&#039;)&lt;br /&gt;
*** Disclaimer for Linux: Make sure you get a recent dc-tool-ser (Sep 4, 2023 or later) to select custom baudrates&lt;br /&gt;
*** Disclaimer for MacOS: Make sure you get a recent dc-tool-ser (June 26, 2025 or later) to select custom baudrates&lt;br /&gt;
** &#039;&#039;&#039;230400&#039;&#039;&#039;: use the -e speedhack option if you absolutely need 230400 at pc-side, but the DC will use 223214 or 260416 anyways.&lt;br /&gt;
** &#039;&#039;&#039;500000 and 1500000&#039;&#039;&#039;: you can try, but that will not work on all pc (the mismatch with the baudrate of the Dreamcast is sometimes too big (4%))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{DCWiki:Stub}}&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Creating_a_bootable_Dreamcast_disc&amp;diff=3819</id>
		<title>Creating a bootable Dreamcast disc</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Creating_a_bootable_Dreamcast_disc&amp;diff=3819"/>
		<updated>2025-10-25T06:53:26Z</updated>

		<summary type="html">&lt;p&gt;Tchan: removed (Linux only for now) from /* mkdcdisc (Linux only for now) */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Full Overview of the steps involved ==&lt;br /&gt;
&lt;br /&gt;
The full list of steps to make self-bootable disc for the [[Dreamcast]] goes like this:&lt;br /&gt;
&lt;br /&gt;
* Build your source (usually using [[KallistiOS]])&lt;br /&gt;
* Transform your .elf executable into binary&lt;br /&gt;
* Scramble the binary&lt;br /&gt;
* Build a .iso image from a directory (representing the &#039;&#039;second&#039;&#039; session of a multisession disc and not bootable)&lt;br /&gt;
* Transform the .iso into a .cdi image (representing a self-booting multisession disc image)&lt;br /&gt;
* Transfer the .cdi image to your GDEMU (or other optical disc drive emulator device), or burn the .cdi image to a CD-R to launch it in a standard Dreamcast.&lt;br /&gt;
&lt;br /&gt;
There are other details that could be taken into account:&lt;br /&gt;
* You can make Audio/Data and Data/Data .cdi files. Both can selfboot, but the files will be organized differently on the physical CD. {{Citation needed}}&lt;br /&gt;
* You&#039;ll need to provide a valid [[IP.BIN]], these can be modified to display a logo during the boot screen, apply patches or execute some code. &lt;br /&gt;
* It is possible to make CDDA compatible images, this process in not currently covered here.&lt;br /&gt;
&lt;br /&gt;
Depending on the method/tools used, some of the above steps are simplified a lot:&lt;br /&gt;
* mkdcdisc: does the heavy lifting for you. Linux only for now.&lt;br /&gt;
* mkisofs + cdi4dc&lt;br /&gt;
* mkisofs + cdrecord&lt;br /&gt;
&lt;br /&gt;
== mkdcdisc ==&lt;br /&gt;
&lt;br /&gt;
[https://gitlab.com/simulant/mkdcdisc mkdcdisc] is a recent (2022) tool that pretty much does all the steps for you.&lt;br /&gt;
&lt;br /&gt;
The minimum you need for it, is your executable .elf (or the equivalent scrambled or unscrambled bin file).&lt;br /&gt;
&lt;br /&gt;
Example to build a bootable DC disc image nehe05.cdi, starting from an executable called nehe05.elf:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdcdisc -e nehe05.elf -o nehe05.cdi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example to build a bootable DC disc image mygame.cdi, starting from an executable called mygame.elf, with assets/textures/... files stored in a subfolder called &amp;quot;data&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdcdisc -e mygame.elf -D data -o mygame.cdi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a lot of commandline options, so be sure to check them all out!&lt;br /&gt;
&lt;br /&gt;
== mkisofs + cdi4dc ==&lt;br /&gt;
&lt;br /&gt;
This is an example for automating the .cdi image process under Linux. Consider this more like a template as you&#039;ll need to edit the paths, names, etc to your own project. &lt;br /&gt;
&lt;br /&gt;
  #! /bin/sh&lt;br /&gt;
  PROJECT_DIR=$PWD/build&lt;br /&gt;
  PROJECT_NAME=&amp;quot;Project_Name&amp;quot;&lt;br /&gt;
  TARGET=&amp;quot;main.elf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  # Build your program&lt;br /&gt;
  # This assumes that you can properly build your source code. The program main output will be $TARGET&lt;br /&gt;
  make $TARGET&lt;br /&gt;
&lt;br /&gt;
  # Elf transform&lt;br /&gt;
  sh-elf-objcopy -R .stack -O binary $TARGET output.bin&lt;br /&gt;
&lt;br /&gt;
  # Scrambling process&lt;br /&gt;
  $KOS_BASE/utils/scramble/scramble output.bin 1ST_READ.bin&lt;br /&gt;
&lt;br /&gt;
  # Creating a .iso image from a directory &lt;br /&gt;
  # Make sure you have a working [[IP.BIN]] in your current directory. Or change IP.BIN path to wherever you like.&lt;br /&gt;
  # Useful option for mkisofs is *-m* which allow to exclude files from the iso image (useful to remove .git, or some other folder) &lt;br /&gt;
  mkisofs -C 0,11702 -V $PROJECT_NAME -G IP.BIN -r -J -l -o $PROJECT_NAME.iso $DIR&lt;br /&gt;
&lt;br /&gt;
  # Transform your .iso into a .cdi&lt;br /&gt;
  $KOS_BASE/utils/cdi4dc/cdi4dc $PROJECT_NAME.iso $PROJECT_NAME.cdi&lt;br /&gt;
&lt;br /&gt;
== mkisofs + cdrecord  ==&lt;br /&gt;
TODO&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Compiling_for_Naomi&amp;diff=3818</id>
		<title>Compiling for Naomi</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Compiling_for_Naomi&amp;diff=3818"/>
		<updated>2025-10-16T07:17:59Z</updated>

		<summary type="html">&lt;p&gt;Tchan: adapt environ.sh to the latest kos changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;KallistiOS is able to produce executables that can run on the Sega Naomi arcarde boards.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* 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)&lt;br /&gt;
* download (git clone) kos &amp;amp; kos-ports into separate folders, eg /kosnaomi &amp;amp; /kos-portsnaomi&lt;br /&gt;
* adapt the following in /kosnaomi/environ.sh:&lt;br /&gt;
     export KOS_SUBARCH=&amp;quot;naomi&amp;quot; &amp;lt;- uncomment this line&lt;br /&gt;
     KOS_BASE  &amp;lt;- point to your naomi kos folder&lt;br /&gt;
     KOS_PORTS &amp;lt;- point to your naomi kos-ports folder&lt;br /&gt;
* Build these /kosnaomi &amp;amp; /kos-portsnaomi&lt;br /&gt;
* if you want to use raylib, you need recent raylib4Dreamcast code (you need commit TODO of 04 feb 2024)&lt;br /&gt;
&lt;br /&gt;
== Compilation to a .ELF ==&lt;br /&gt;
Example compilation for a raylib example:&lt;br /&gt;
* Go to the folder that contains your example, eg:&lt;br /&gt;
     cd /opt/toolchains/dc/kos-portsnaomi/raylib4Dreamcast/samples/shapes/basic_shapes&lt;br /&gt;
* source the environ.sh of your naomi folder:&lt;br /&gt;
     source /opt/toolchains/dc/kosnaomi/environ.sh&lt;br /&gt;
* build the .elf for Naomi:&lt;br /&gt;
     make&lt;br /&gt;
&lt;br /&gt;
== Converting an .ELF to a .DAT to send to a Naomi DIMM ==&lt;br /&gt;
* Convert your Naomi-built KOS .ELF to a .BIN file:&lt;br /&gt;
     /opt/toolchains/dc/sh-elf/sh-elf/bin/objcopy -R .stack -O binary raylib.elf raylib_nao.bin&lt;br /&gt;
&lt;br /&gt;
* convert your Naomi .BIN to a .DAT file:&lt;br /&gt;
     /opt/toolchains/dc/kosnaomi/utils/naomibintool/naomibintool build raylib_nao.dat -d DEVELOPERNAME -t GAMETITLE -b raylib_nao.bin&lt;br /&gt;
&lt;br /&gt;
== Send your .DAT file to a Naomi DIMM via ethernet ==&lt;br /&gt;
* Assuming the IP address of the Naomi is 192.168.1.202:&lt;br /&gt;
     /opt/toolchains/dc/kosnaomi/utils/naominetboot/naominetboot -t 192.168.1.202 -x raylib_nao.dat -a&lt;br /&gt;
&lt;br /&gt;
== Send your .ELF file to a Naomi via a serial cable ==&lt;br /&gt;
If you don&#039;t have a DIMM board, or just want to use dc-tool-serial to upload a Naomi .elf via a serial cable, you need:&lt;br /&gt;
* a custom bios containing dc-load-ser&lt;br /&gt;
* recent KallistiOS code (you need commit [https://github.com/KallistiOS/KallistiOS/commit/d059b922625b6fd1f05dac4381b48d0ba571650b d059b92] of 04 feb 2024)&lt;br /&gt;
* upload the .ELF via your usual dc-tool-ser command, eg:&lt;br /&gt;
     dc-tool-ser -b 1562500 -t /dev/ttyUSB0 -x raylib.elf&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Visual_Studio_Code&amp;diff=3754</id>
		<title>Visual Studio Code</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Visual_Studio_Code&amp;diff=3754"/>
		<updated>2025-04-19T18:41:00Z</updated>

		<summary type="html">&lt;p&gt;Tchan: improved C_Cpp.default.includePath&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a guide to setup your [https://code.visualstudio.com/ Visual Studio Code] project with debugging support on both on a real Dreamcast and with an emulator.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To start with, this tutorial makes the following assumptions:&lt;br /&gt;
* You have already installed and [https://dreamcast.wiki/Getting_Started_with_Dreamcast_development set up your KallistiOS development environment]]&lt;br /&gt;
# if you want to be able to debug, be sure to compile gdb as specified on that page&lt;br /&gt;
* You have already downloaded and installed [https://code.visualstudio.com/ Visual Studio Code] (version 1.78.2 was used for this tutorial)&lt;br /&gt;
&lt;br /&gt;
== VSCode Setup ==&lt;br /&gt;
* Launch Visual Studio Code&lt;br /&gt;
* (optional but recommended) To keep your configuration settings, plugins, ... specific to Dreamcast projects only:&lt;br /&gt;
# Create a &amp;quot;Profile&amp;quot; (Menu: File-Preferences-Profiles) called &amp;quot;Dreamcast&amp;quot;&lt;br /&gt;
* Install the following extensions: (Menu: View-Extensions)&lt;br /&gt;
# Required:&lt;br /&gt;
## [https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools C/C++] from Microsoft&lt;br /&gt;
# Required only if you are using WSL (Windows Subsystem for Linux):&lt;br /&gt;
## [https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl WSL from Microsoft]&lt;br /&gt;
# (Not recommended at this moment:)&lt;br /&gt;
## ([https://marketplace.visualstudio.com/items?itemName=ms-vscode.makefile-tools Makefile Tools] from Microsoft: the current version (June 2023) is not really adapted for remote debugging)&lt;br /&gt;
&lt;br /&gt;
== Setup per Project ==&lt;br /&gt;
&lt;br /&gt;
=== Compilation ===&lt;br /&gt;
==== Preparation ====&lt;br /&gt;
(all the following steps happen in Visual Studio Code)&lt;br /&gt;
# Open the folder containing your project - eg: /opt/toolchains/dc/kos/examples/dreamcast/2ndmix:&lt;br /&gt;
##If you are using WSL:&lt;br /&gt;
###&amp;quot;F1&amp;quot; - &amp;quot;Connect To WSL&amp;quot;&lt;br /&gt;
##Menu: File-Open Folder...&lt;br /&gt;
# (if you are using Profiles) Make sure that the &amp;quot;Dreamcast&amp;quot; profile is selected (Menu: File-Preferences-Profiles)&lt;br /&gt;
#If you are using WSL, check that the C/C++ extension is correctly installed for WSL - if you get a warning like &amp;quot;install in WSL: Ubuntu&amp;quot;, do so.&lt;br /&gt;
# Create a new subfolder &amp;quot;.vscode&amp;quot;&lt;br /&gt;
# insert the following files in the &#039;&#039;&#039;&amp;quot;.vscode&amp;quot; subfolder&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;kos_environ.sh&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#set the KOS environtment variables&lt;br /&gt;
source /opt/toolchains/dc/kos/environ.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;kos_make.sh&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#set the KOS environtment variables&lt;br /&gt;
source /opt/toolchains/dc/kos/environ.sh&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;settings.json&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;C_Cpp.default.includePath&amp;quot;: [&lt;br /&gt;
        &amp;quot;/opt/toolchains/dc/sh-elf/sh-elf/include/**&amp;quot;,&lt;br /&gt;
        &amp;quot;/opt/toolchains/dc/kos/include/**&amp;quot;,&lt;br /&gt;
        &amp;quot;/opt/toolchains/dc/kos/kernel/arch/dreamcast/include/**&amp;quot;,&lt;br /&gt;
        &amp;quot;/opt/toolchains/dc/kos/addons/include/**&amp;quot;,&lt;br /&gt;
        &amp;quot;/opt/toolchains/dc/kos-ports/**&amp;quot;,&lt;br /&gt;
        &amp;quot;${workspaceFolder}/**&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;C_Cpp.default.defines&amp;quot;: [&lt;br /&gt;
            &amp;quot;_arch_dreamcast&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;C_Cpp.default.compilerPath&amp;quot;: &amp;quot;/opt/toolchains/dc/sh-elf/bin/sh-elf-gcc&amp;quot;,&lt;br /&gt;
    &amp;quot;C_Cpp.default.cStandard&amp;quot;: &amp;quot;c11&amp;quot;,&lt;br /&gt;
    &amp;quot;C_Cpp.default.cppStandard&amp;quot;: &amp;quot;c++17&amp;quot;,&lt;br /&gt;
    &amp;quot;C_Cpp.default.intelliSenseMode&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;terminal.integrated.defaultProfile.linux&amp;quot;: &amp;quot;kos-bash&amp;quot;,&lt;br /&gt;
    &amp;quot;terminal.integrated.profiles.linux&amp;quot;: {&lt;br /&gt;
        &amp;quot;kos-bash&amp;quot;: {&lt;br /&gt;
            &amp;quot;path&amp;quot;: &amp;quot;/usr/bin/bash&amp;quot;,&lt;br /&gt;
            &amp;quot;args&amp;quot;: [&amp;quot;--init-file&amp;quot;, &amp;quot;${workspaceFolder}/.vscode/kos_environ.sh&amp;quot; ],&lt;br /&gt;
            &amp;quot;overrideName&amp;quot;: true&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(TODO: to be tested for Mac/OSX: probably needs the 2 lines terminal.integrated.*.linux replaced with terminal.integrated.*.osx)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;tasks.json&#039;&#039;&#039; &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;version&amp;quot;: &amp;quot;2.0.0&amp;quot;,&lt;br /&gt;
    &amp;quot;tasks&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;label&amp;quot;: &amp;quot;Build&amp;quot;,&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;process&amp;quot;,&lt;br /&gt;
            &amp;quot;command&amp;quot;: &amp;quot;bash&amp;quot;,&lt;br /&gt;
            &amp;quot;args&amp;quot;: [&lt;br /&gt;
                &amp;quot;--init-file&amp;quot;, &amp;quot;${workspaceFolder}/.vscode/kos_make.sh&amp;quot;&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;group&amp;quot;: {&lt;br /&gt;
                &amp;quot;kind&amp;quot;: &amp;quot;build&amp;quot;,&lt;br /&gt;
                &amp;quot;isDefault&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
        },&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result should look like this:&lt;br /&gt;
{|&lt;br /&gt;
| [[File:Vscode cfg files.png|thumb]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
At this point, you should be able to compile applications for the Dreamcast!&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
You can compile via 2 ways:&lt;br /&gt;
# via the VSCode [https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette Command Palette] - &amp;quot;Tasks: Run Build Task&amp;quot;, or&lt;br /&gt;
# by opening a &amp;quot;kos-bash&amp;quot; terminal (Menu: View-Terminal if not visible yet, then click on the &amp;quot;+&amp;quot; to see the terminals to choose from, and select &amp;quot;kos-bash&amp;quot;), and typing &amp;quot;make&amp;quot;&lt;br /&gt;
In both cases, the compilation should generate an executable file, ending with .elf&lt;br /&gt;
&lt;br /&gt;
Note: &amp;quot;kos-bash&amp;quot; is a bash shell with the &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot; already executed for you. It should be your default shell in VSCode as long as you used the settings.json mentioned above.&lt;br /&gt;
&lt;br /&gt;
==== Running a program ====&lt;br /&gt;
For this, we will use the &amp;quot;make run&amp;quot; command that you can find in many (all?) Makefiles of the KallistiOs project, to send and run the program on a real dreamcast:&lt;br /&gt;
&lt;br /&gt;
* Typically, one of the following tools is used to run a program for the Dreamcast:&lt;br /&gt;
# on a real Dreamcast:&lt;br /&gt;
##via an ethernet cable &amp;amp; a [https://dreamcast.wiki/Broadband_adapter Broadband] (BBA) or [https://dreamcast.wiki/LAN_adapter LAN] adapter: &#039;&#039;&#039;[https://dreamcast.wiki/Dcload-ip dcload-ip]&#039;&#039;&#039;&lt;br /&gt;
## via a [https://dreamcast.wiki/Coder%27s_cable coder&#039;s cable] &amp;amp; the serial port of the Dreamcast: &#039;&#039;&#039;[https://dreamcast.wiki/Dcload-serial dcload-serial]&#039;&#039;&#039;&lt;br /&gt;
# on an emulator, like lxdream-nitro&lt;br /&gt;
&lt;br /&gt;
* Make sure that the &#039;&#039;&#039;KOS_LOADER&#039;&#039;&#039; variable in &#039;&#039;&#039;/opt/toolchains/dc/kos/environ.sh&#039;&#039;&#039; is configured correctly:&lt;br /&gt;
&lt;br /&gt;
# for &#039;&#039;&#039;dcload-ip&#039;&#039;&#039; (example if the IP of the Dreamcast is 192.168.1.210):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export KOS_LOADER=&amp;quot;dc-tool-ip -t 192.168.1.210 -x&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# for &#039;&#039;&#039;dcload-serial&#039;&#039;&#039; (example if the Dreamcast is on serial port /dev/ttyS0):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export KOS_LOADER=&amp;quot;dc-tool-ser -t /dev/ttyS0 -x&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# for &#039;&#039;&#039;the emulator&#039;&#039;&#039; (example with lxdream-nitro):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export KOS_LOADER=&amp;quot;/opt/toolchains/dc/lxdream-nitro/builddir/lxdream-nitro -e&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If want to run it on a real Dreamcast, power it on with the dcload disc loaded, and wait for the blue screen&lt;br /&gt;
* Open a &amp;quot;kos-bash&amp;quot; terminal, and type: make run&lt;br /&gt;
* The program will be running on your Dreamcast or on the emulator !&lt;br /&gt;
* (If you ran the 2ndmix example, you can press the START button on the Dreamcast pad to exit)&lt;br /&gt;
* Note: be sure to not have a gdb_init(); line added in your code when you only want to run a program &amp;amp; not debug it.&lt;br /&gt;
&lt;br /&gt;
=== Debugging ===&lt;br /&gt;
==== Preparation ====&lt;br /&gt;
* Make sure that you compiled gdb for the Dreamcast, ie &#039;&#039;&#039;/opt/toolchains/dc/sh-elf/bin/sh-elf-gdb&#039;&#039;&#039; should exist (cfr prerequisites)&lt;br /&gt;
* Debugging in Visual Studio Code is configured in a &#039;&#039;&#039;.vscode/launch.json&#039;&#039;&#039; file. You can add as many debugging configurations as you want inside that launch.json file, eg 1 for debugging on a dreamcast, 1 for debugging on an emulator, ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# insert the following files in the &#039;&#039;&#039;&amp;quot;.vscode&amp;quot; subfolder&#039;&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;launch.json&#039;&#039;&#039; (example with the IP of the Dreamcast = 192.168.1.210 for the BBA/LAN or /dev/ttyS0 for the serial cable):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;version&amp;quot;: &amp;quot;0.2.0&amp;quot;,&lt;br /&gt;
    &amp;quot;configurations&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;name&amp;quot;: &amp;quot;BBA_LAN&amp;quot;,&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;cppdbg&amp;quot;,&lt;br /&gt;
            &amp;quot;request&amp;quot;: &amp;quot;launch&amp;quot;,&lt;br /&gt;
            &amp;quot;preLaunchTask&amp;quot;: &amp;quot;Build&amp;quot;,&lt;br /&gt;
            &amp;quot;cwd&amp;quot;: &amp;quot;${workspaceFolder}&amp;quot;,&lt;br /&gt;
            &amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/${workspaceFolderBasename}.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/2ndmix.elf&amp;quot;,&lt;br /&gt;
            &amp;quot;MIMode&amp;quot;: &amp;quot;gdb&amp;quot;,&lt;br /&gt;
            &amp;quot;miDebuggerPath&amp;quot;: &amp;quot;/opt/toolchains/dc/sh-elf/bin/sh-elf-gdb&amp;quot;,&lt;br /&gt;
            &amp;quot;miDebuggerServerAddress&amp;quot;:&amp;quot;localhost:2159&amp;quot;,//common misconception: we connect to the gdb server offered by dc-tool-ip, NOT to the Dreamcast directly !&lt;br /&gt;
            &amp;quot;debugServerPath&amp;quot;:&amp;quot;/opt/toolchains/dc/bin/dc-tool-ip&amp;quot;,&lt;br /&gt;
            &amp;quot;debugServerArgs&amp;quot;: &amp;quot;-g -t 192.168.1.210 -x ${workspaceFolder}/${workspaceFolderBasename}.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;debugServerArgs&amp;quot;: &amp;quot;-g -t 192.168.1.210 -x ${workspaceFolder}/2ndmix.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;stopAtEntry&amp;quot;: true,&lt;br /&gt;
            &amp;quot;externalConsole&amp;quot;: false,&lt;br /&gt;
            &amp;quot;avoidWindowsConsoleRedirection&amp;quot;: false,&lt;br /&gt;
            &amp;quot;internalConsoleOptions&amp;quot;: &amp;quot;openOnSessionStart&amp;quot;,&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;name&amp;quot;: &amp;quot;SERIAL&amp;quot;,&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;cppdbg&amp;quot;,&lt;br /&gt;
            &amp;quot;request&amp;quot;: &amp;quot;launch&amp;quot;,&lt;br /&gt;
            &amp;quot;preLaunchTask&amp;quot;: &amp;quot;Build&amp;quot;,&lt;br /&gt;
            &amp;quot;cwd&amp;quot;: &amp;quot;${workspaceFolder}&amp;quot;,&lt;br /&gt;
            &amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/${workspaceFolderBasename}.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/2ndmix.elf&amp;quot;,&lt;br /&gt;
            &amp;quot;MIMode&amp;quot;: &amp;quot;gdb&amp;quot;,&lt;br /&gt;
            &amp;quot;miDebuggerPath&amp;quot;: &amp;quot;/opt/toolchains/dc/sh-elf/bin/sh-elf-gdb&amp;quot;,&lt;br /&gt;
            &amp;quot;miDebuggerServerAddress&amp;quot;:&amp;quot;localhost:2159&amp;quot;,//common misconception: we connect to the gdb server offered by dc-tool-ser, NOT to the Dreamcast directly !&lt;br /&gt;
            &amp;quot;debugServerPath&amp;quot;:&amp;quot;/opt/toolchains/dc/bin/dc-tool-ser&amp;quot;,&lt;br /&gt;
            &amp;quot;debugServerArgs&amp;quot;: &amp;quot;-g -t /dev/ttyS0 -x ${workspaceFolder}/${workspaceFolderBasename}.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;debugServerArgs&amp;quot;: &amp;quot;-g -t /dev/ttyS0 -x ${workspaceFolder}/2ndmix.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;stopAtEntry&amp;quot;: true,&lt;br /&gt;
            &amp;quot;externalConsole&amp;quot;: false,&lt;br /&gt;
            &amp;quot;avoidWindowsConsoleRedirection&amp;quot;: false,&lt;br /&gt;
            &amp;quot;internalConsoleOptions&amp;quot;: &amp;quot;openOnSessionStart&amp;quot;,&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;name&amp;quot;: &amp;quot;LXDream&amp;quot;,&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;cppdbg&amp;quot;,&lt;br /&gt;
            &amp;quot;request&amp;quot;: &amp;quot;launch&amp;quot;,&lt;br /&gt;
            &amp;quot;preLaunchTask&amp;quot;: &amp;quot;Build&amp;quot;,&lt;br /&gt;
            &amp;quot;cwd&amp;quot;: &amp;quot;${workspaceRoot}&amp;quot;,&lt;br /&gt;
            &amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/${workspaceFolderBasename}.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/2ndmix.elf&amp;quot;,&lt;br /&gt;
            &amp;quot;miDebuggerPath&amp;quot;: &amp;quot;/opt/toolchains/dc/sh-elf/bin/sh-elf-gdb&amp;quot;,&lt;br /&gt;
            &amp;quot;setupCommands&amp;quot;: [{&lt;br /&gt;
                &amp;quot;text&amp;quot;: &amp;quot;set architecture sh&amp;quot;,&lt;br /&gt;
                &amp;quot;description&amp;quot;: &amp;quot;Set GDB Arch to SuperH&amp;quot;,&lt;br /&gt;
                &amp;quot;ignoreFailures&amp;quot; : false,&lt;br /&gt;
            }],&lt;br /&gt;
            &amp;quot;miDebuggerServerAddress&amp;quot;: &amp;quot;:9999&amp;quot;,&lt;br /&gt;
            // path to lxdream-nitro&lt;br /&gt;
            &amp;quot;debugServerPath&amp;quot;: &amp;quot;PATH_TO_LXDREAM&amp;quot;,&lt;br /&gt;
            // lxdream-nitro flags&lt;br /&gt;
            &amp;quot;debugServerArgs&amp;quot;: &amp;quot;--log=DEBUG --gdb-sh4=9999 -A null -e ${workspaceRoot}/${workspaceFolderBasename}.elf -n&amp;quot;,&lt;br /&gt;
            //&amp;quot;debugServerArgs&amp;quot;: &amp;quot;--log=DEBUG --gdb-sh4=9999 -A null -e ${workspaceRoot}/2ndmix.elf -n&amp;quot;,&lt;br /&gt;
            &amp;quot;filterStdout&amp;quot;: true,&lt;br /&gt;
            &amp;quot;filterStderr&amp;quot;: true,&lt;br /&gt;
            // run on connect&lt;br /&gt;
            &amp;quot;stopAtConnect&amp;quot;: false,&lt;br /&gt;
            // stop at main&lt;br /&gt;
            &amp;quot;stopAtEntry&amp;quot;: true,&lt;br /&gt;
            &amp;quot;externalConsole&amp;quot;: false,&lt;br /&gt;
            &amp;quot;avoidWindowsConsoleRedirection&amp;quot;: false,&lt;br /&gt;
            &amp;quot;internalConsoleOptions&amp;quot;: &amp;quot;openOnSessionStart&amp;quot;,&lt;br /&gt;
            &amp;quot;launchCompleteCommand&amp;quot;: &amp;quot;exec-run&amp;quot;,&lt;br /&gt;
            &amp;quot;serverStarted&amp;quot;: &amp;quot;SH4 GDB server running on port&amp;quot;,&lt;br /&gt;
            &amp;quot;useExtendedRemote&amp;quot;: true&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that for the 3 launch configurations above, you have 2 lines for &lt;br /&gt;
&amp;quot;program&amp;quot; and &amp;quot;debugServerArgs&amp;quot;, one of which is commented out.&lt;br /&gt;
${workspaceFolderBasename} is the name of your project directory (eg: 2ndmix), and if that matches the name of your target .elf file (eg: 2ndmix.elf), then you can use ${workspaceFolderBasename}.&lt;br /&gt;
If not, you can just use the other line by replacing ${workspaceFolderBasename} with the real .elf filename.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also need to replace &amp;quot;PATH_TO_LXDREAM&amp;quot; with the path to the emulator installed on your pc.&lt;br /&gt;
&lt;br /&gt;
==== Launching a Debug session ====&lt;br /&gt;
{|&lt;br /&gt;
| [[File:Vscode debugging.png|thumb|alt=Vscode debugging|Vscode debugging]]&lt;br /&gt;
|}&lt;br /&gt;
* put a line to initialize gdb in your code (1):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
gdb_init();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If using lxdream-nitro, a gdb server is already provided and so gdb_init() should ```not``` be called.&lt;br /&gt;
&lt;br /&gt;
TODO: conditional include&lt;br /&gt;
* insert a breakpoint &#039;&#039;&#039;AFTER&#039;&#039;&#039; this gdb_init(); line (1). You can&#039;t put a breakpoint before or on this line !&lt;br /&gt;
* If want to run it on a real Dreamcast, power it on with the dcload disc loaded, and wait for the blue screen&lt;br /&gt;
* Click on the &amp;quot;Debugger&amp;quot; icon (2) on the left&lt;br /&gt;
* Select the configuration you want to launch (BBA_LAN, SERIAL, or LXDream)(3)&lt;br /&gt;
* Click on the green arrow (&amp;quot;Start Debugging&amp;quot; - F5)(4)&lt;br /&gt;
&lt;br /&gt;
==== Tips ====&lt;br /&gt;
* If you want to print out the value of a variable to the console (Terminal) on the pc, add a line like this to your code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
dbglog(DBG_INFO, &amp;quot;value is: 0x%08X\n&amp;quot;, variable);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting Tips ====&lt;br /&gt;
* If the dc-tool app does not seem to react anymore:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo netstat -ap | grep :2159&lt;br /&gt;
sudo kill &amp;lt;pid&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
[https://forums.sonicretro.org/index.php?threads/setting-up-gdb-with-redream-in-linux.38824/ netstat tip source]&lt;br /&gt;
&lt;br /&gt;
[https://dcemulation.org/phpBB/viewtopic.php?t=105596&amp;amp;start=20 Original VSCode topic on dcemulation.org]&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Creating_a_bootable_Dreamcast_disc&amp;diff=3752</id>
		<title>Creating a bootable Dreamcast disc</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Creating_a_bootable_Dreamcast_disc&amp;diff=3752"/>
		<updated>2025-04-06T12:20:14Z</updated>

		<summary type="html">&lt;p&gt;Tchan: typo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Full Overview of the steps involved ==&lt;br /&gt;
&lt;br /&gt;
The full list of steps to make self-bootable disc for the [[Dreamcast]] goes like this:&lt;br /&gt;
&lt;br /&gt;
* Build your source (usually using [[KallistiOS]])&lt;br /&gt;
* Transform your .elf executable into binary&lt;br /&gt;
* Scramble the binary&lt;br /&gt;
* Build a .iso image from a directory (representing the &#039;&#039;second&#039;&#039; session of a multisession disc and not bootable)&lt;br /&gt;
* Transform the .iso into a .cdi image (representing a self-booting multisession disc image)&lt;br /&gt;
* Transfer the .cdi image to your GDEMU (or other optical disc drive emulator device), or burn the .cdi image to a CD-R to launch it in a standard Dreamcast.&lt;br /&gt;
&lt;br /&gt;
There are other details that could be taken into account:&lt;br /&gt;
* You can make Audio/Data and Data/Data .cdi files. Both can selfboot, but the files will be organized differently on the physical CD. {{Citation needed}}&lt;br /&gt;
* You&#039;ll need to provide a valid [[IP.BIN]], these can be modified to display a logo during the boot screen, apply patches or execute some code. &lt;br /&gt;
* It is possible to make CDDA compatible images, this process in not currently covered here.&lt;br /&gt;
&lt;br /&gt;
Depending on the method/tools used, some of the above steps are simplified a lot:&lt;br /&gt;
* mkdcdisc: does the heavy lifting for you. Linux only for now.&lt;br /&gt;
* mkisofs + cdi4dc&lt;br /&gt;
* mkisofs + cdrecord&lt;br /&gt;
&lt;br /&gt;
== mkdcdisc (Linux only for now) ==&lt;br /&gt;
&lt;br /&gt;
[https://gitlab.com/simulant/mkdcdisc mkdcdisc] is a recent (2022) tool that pretty much does all the steps for you.&lt;br /&gt;
&lt;br /&gt;
The minimum you need for it, is your executable .elf (or the equivalent scrambled or unscrambled bin file).&lt;br /&gt;
&lt;br /&gt;
Example to build a bootable DC disc image nehe05.cdi, starting from an executable called nehe05.elf:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdcdisc -e nehe05.elf -o nehe05.cdi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example to build a bootable DC disc image mygame.cdi, starting from an executable called mygame.elf, with assets/textures/... files stored in a subfolder called &amp;quot;data&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdcdisc -e mygame.elf -D data -o mygame.cdi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a lot of commandline options, so be sure to check them all out!&lt;br /&gt;
&lt;br /&gt;
== mkisofs + cdi4dc ==&lt;br /&gt;
&lt;br /&gt;
This is an example for automating the .cdi image process under Linux. Consider this more like a template as you&#039;ll need to edit the paths, names, etc to your own project. &lt;br /&gt;
&lt;br /&gt;
  #! /bin/sh&lt;br /&gt;
  PROJECT_DIR=$PWD/build&lt;br /&gt;
  PROJECT_NAME=&amp;quot;Project_Name&amp;quot;&lt;br /&gt;
  TARGET=&amp;quot;main.elf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  # Build your program&lt;br /&gt;
  # This assumes that you can properly build your source code. The program main output will be $TARGET&lt;br /&gt;
  make $TARGET&lt;br /&gt;
&lt;br /&gt;
  # Elf transform&lt;br /&gt;
  sh-elf-objcopy -R .stack -O binary $TARGET output.bin&lt;br /&gt;
&lt;br /&gt;
  # Scrambling process&lt;br /&gt;
  $KOS_BASE/utils/scramble/scramble output.bin 1ST_READ.bin&lt;br /&gt;
&lt;br /&gt;
  # Creating a .iso image from a directory &lt;br /&gt;
  # Make sure you have a working [[IP.BIN]] in your current directory. Or change IP.BIN path to wherever you like.&lt;br /&gt;
  # Useful option for mkisofs is *-m* which allow to exclude files from the iso image (useful to remove .git, or some other folder) &lt;br /&gt;
  mkisofs -C 0,11702 -V $PROJECT_NAME -G IP.BIN -r -J -l -o $PROJECT_NAME.iso $DIR&lt;br /&gt;
&lt;br /&gt;
  # Transform your .iso into a .cdi&lt;br /&gt;
  $KOS_BASE/utils/cdi4dc/cdi4dc $PROJECT_NAME.iso $PROJECT_NAME.cdi&lt;br /&gt;
&lt;br /&gt;
== mkisofs + cdrecord  ==&lt;br /&gt;
TODO&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Creating_a_bootable_Dreamcast_disc&amp;diff=3751</id>
		<title>Creating a bootable Dreamcast disc</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Creating_a_bootable_Dreamcast_disc&amp;diff=3751"/>
		<updated>2025-04-06T12:19:40Z</updated>

		<summary type="html">&lt;p&gt;Tchan: an .elf is not required anymore for mkdcdisc, .bin also work now&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Full Overview of the steps involved ==&lt;br /&gt;
&lt;br /&gt;
The full list of steps to make self-bootable disc for the [[Dreamcast]] goes like this:&lt;br /&gt;
&lt;br /&gt;
* Build your source (usually using [[KallistiOS]])&lt;br /&gt;
* Transform your .elf executable into binary&lt;br /&gt;
* Scramble the binary&lt;br /&gt;
* Build a .iso image from a directory (representing the &#039;&#039;second&#039;&#039; session of a multisession disc and not bootable)&lt;br /&gt;
* Transform the .iso into a .cdi image (representing a self-booting multisession disc image)&lt;br /&gt;
* Transfer the .cdi image to your GDEMU (or other optical disc drive emulator device), or burn the .cdi image to a CD-R to launch it in a standard Dreamcast.&lt;br /&gt;
&lt;br /&gt;
There are other details that could be taken into account:&lt;br /&gt;
* You can make Audio/Data and Data/Data .cdi files. Both can selfboot, but the files will be organized differently on the physical CD. {{Citation needed}}&lt;br /&gt;
* You&#039;ll need to provide a valid [[IP.BIN]], these can be modified to display a logo during the boot screen, apply patches or execute some code. &lt;br /&gt;
* It is possible to make CDDA compatible images, this process in not currently covered here.&lt;br /&gt;
&lt;br /&gt;
Depending on the method/tools used, some of the above steps are simplified a lot:&lt;br /&gt;
* mkdcdisc: does the heavy lifting for you. Linux only for now.&lt;br /&gt;
* mkisofs + cdi4dc&lt;br /&gt;
* mkisofs + cdrecord&lt;br /&gt;
&lt;br /&gt;
== mkdcdisc (Linux only for now) ==&lt;br /&gt;
&lt;br /&gt;
[https://gitlab.com/simulant/mkdcdisc mkdcdisc] is a recent (2022) tool that pretty much does all the steps for you.&lt;br /&gt;
&lt;br /&gt;
The minimum you need for it, is your executable .elf (of the equivalent scrambled or unscrambled bin file).&lt;br /&gt;
&lt;br /&gt;
Example to build a bootable DC disc image nehe05.cdi, starting from an executable called nehe05.elf:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdcdisc -e nehe05.elf -o nehe05.cdi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example to build a bootable DC disc image mygame.cdi, starting from an executable called mygame.elf, with assets/textures/... files stored in a subfolder called &amp;quot;data&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdcdisc -e mygame.elf -D data -o mygame.cdi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a lot of commandline options, so be sure to check them all out!&lt;br /&gt;
&lt;br /&gt;
== mkisofs + cdi4dc ==&lt;br /&gt;
&lt;br /&gt;
This is an example for automating the .cdi image process under Linux. Consider this more like a template as you&#039;ll need to edit the paths, names, etc to your own project. &lt;br /&gt;
&lt;br /&gt;
  #! /bin/sh&lt;br /&gt;
  PROJECT_DIR=$PWD/build&lt;br /&gt;
  PROJECT_NAME=&amp;quot;Project_Name&amp;quot;&lt;br /&gt;
  TARGET=&amp;quot;main.elf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  # Build your program&lt;br /&gt;
  # This assumes that you can properly build your source code. The program main output will be $TARGET&lt;br /&gt;
  make $TARGET&lt;br /&gt;
&lt;br /&gt;
  # Elf transform&lt;br /&gt;
  sh-elf-objcopy -R .stack -O binary $TARGET output.bin&lt;br /&gt;
&lt;br /&gt;
  # Scrambling process&lt;br /&gt;
  $KOS_BASE/utils/scramble/scramble output.bin 1ST_READ.bin&lt;br /&gt;
&lt;br /&gt;
  # Creating a .iso image from a directory &lt;br /&gt;
  # Make sure you have a working [[IP.BIN]] in your current directory. Or change IP.BIN path to wherever you like.&lt;br /&gt;
  # Useful option for mkisofs is *-m* which allow to exclude files from the iso image (useful to remove .git, or some other folder) &lt;br /&gt;
  mkisofs -C 0,11702 -V $PROJECT_NAME -G IP.BIN -r -J -l -o $PROJECT_NAME.iso $DIR&lt;br /&gt;
&lt;br /&gt;
  # Transform your .iso into a .cdi&lt;br /&gt;
  $KOS_BASE/utils/cdi4dc/cdi4dc $PROJECT_NAME.iso $PROJECT_NAME.cdi&lt;br /&gt;
&lt;br /&gt;
== mkisofs + cdrecord  ==&lt;br /&gt;
TODO&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Visual_Studio_Code&amp;diff=3694</id>
		<title>Visual Studio Code</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Visual_Studio_Code&amp;diff=3694"/>
		<updated>2025-03-09T08:53:58Z</updated>

		<summary type="html">&lt;p&gt;Tchan: added sh-elf/include to the paths to make Intellisense work&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a guide to setup your [https://code.visualstudio.com/ Visual Studio Code] project with debugging support on both on a real Dreamcast and with an emulator.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To start with, this tutorial makes the following assumptions:&lt;br /&gt;
* You have already installed and [https://dreamcast.wiki/Getting_Started_with_Dreamcast_development set up your KallistiOS development environment]]&lt;br /&gt;
# if you want to be able to debug, be sure to compile gdb as specified on that page&lt;br /&gt;
* You have already downloaded and installed [https://code.visualstudio.com/ Visual Studio Code] (version 1.78.2 was used for this tutorial)&lt;br /&gt;
&lt;br /&gt;
== VSCode Setup ==&lt;br /&gt;
* Launch Visual Studio Code&lt;br /&gt;
* (optional but recommended) To keep your configuration settings, plugins, ... specific to Dreamcast projects only:&lt;br /&gt;
# Create a &amp;quot;Profile&amp;quot; (Menu: File-Preferences-Profiles) called &amp;quot;Dreamcast&amp;quot;&lt;br /&gt;
* Install the following extensions: (Menu: View-Extensions)&lt;br /&gt;
# Required:&lt;br /&gt;
## [https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools C/C++] from Microsoft&lt;br /&gt;
# Required only if you are using WSL (Windows Subsystem for Linux):&lt;br /&gt;
## [https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl WSL from Microsoft]&lt;br /&gt;
# (Not recommended at this moment:)&lt;br /&gt;
## ([https://marketplace.visualstudio.com/items?itemName=ms-vscode.makefile-tools Makefile Tools] from Microsoft: the current version (June 2023) is not really adapted for remote debugging)&lt;br /&gt;
&lt;br /&gt;
== Setup per Project ==&lt;br /&gt;
&lt;br /&gt;
=== Compilation ===&lt;br /&gt;
==== Preparation ====&lt;br /&gt;
(all the following steps happen in Visual Studio Code)&lt;br /&gt;
# Open the folder containing your project - eg: /opt/toolchains/dc/kos/examples/dreamcast/2ndmix:&lt;br /&gt;
##If you are using WSL:&lt;br /&gt;
###&amp;quot;F1&amp;quot; - &amp;quot;Connect To WSL&amp;quot;&lt;br /&gt;
##Menu: File-Open Folder...&lt;br /&gt;
# (if you are using Profiles) Make sure that the &amp;quot;Dreamcast&amp;quot; profile is selected (Menu: File-Preferences-Profiles)&lt;br /&gt;
#If you are using WSL, check that the C/C++ extension is correctly installed for WSL - if you get a warning like &amp;quot;install in WSL: Ubuntu&amp;quot;, do so.&lt;br /&gt;
# Create a new subfolder &amp;quot;.vscode&amp;quot;&lt;br /&gt;
# insert the following files in the &#039;&#039;&#039;&amp;quot;.vscode&amp;quot; subfolder&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;kos_environ.sh&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#set the KOS environtment variables&lt;br /&gt;
source /opt/toolchains/dc/kos/environ.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;kos_make.sh&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#set the KOS environtment variables&lt;br /&gt;
source /opt/toolchains/dc/kos/environ.sh&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;settings.json&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;C_Cpp.default.includePath&amp;quot;: [&lt;br /&gt;
        &amp;quot;${workspaceFolder}/**&amp;quot;,&lt;br /&gt;
        &amp;quot;/opt/toolchains/dc/sh-elf/sh-elf/include/**&amp;quot;,&lt;br /&gt;
        &amp;quot;/opt/toolchains/dc/kos/include/**&amp;quot;,&lt;br /&gt;
        &amp;quot;/opt/toolchains/dc/kos/kernel/arch/dreamcast/include/**&amp;quot;,&lt;br /&gt;
        &amp;quot;/opt/toolchains/dc/kos/addons/include/**&amp;quot;,&lt;br /&gt;
        &amp;quot;/opt/toolchains/dc/kos-ports/include/**&amp;quot;,&lt;br /&gt;
        &amp;quot;/opt/toolchains/dc/kos-ports/*/include/**&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;C_Cpp.default.defines&amp;quot;: [&lt;br /&gt;
            &amp;quot;_arch_dreamcast&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;C_Cpp.default.compilerPath&amp;quot;: &amp;quot;/opt/toolchains/dc/sh-elf/bin/sh-elf-gcc&amp;quot;,&lt;br /&gt;
    &amp;quot;C_Cpp.default.cStandard&amp;quot;: &amp;quot;c11&amp;quot;,&lt;br /&gt;
    &amp;quot;C_Cpp.default.cppStandard&amp;quot;: &amp;quot;c++17&amp;quot;,&lt;br /&gt;
    &amp;quot;C_Cpp.default.intelliSenseMode&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;terminal.integrated.defaultProfile.linux&amp;quot;: &amp;quot;kos-bash&amp;quot;,&lt;br /&gt;
    &amp;quot;terminal.integrated.profiles.linux&amp;quot;: {&lt;br /&gt;
        &amp;quot;kos-bash&amp;quot;: {&lt;br /&gt;
            &amp;quot;path&amp;quot;: &amp;quot;/usr/bin/bash&amp;quot;,&lt;br /&gt;
            &amp;quot;args&amp;quot;: [&amp;quot;--init-file&amp;quot;, &amp;quot;${workspaceFolder}/.vscode/kos_environ.sh&amp;quot; ],&lt;br /&gt;
            &amp;quot;overrideName&amp;quot;: true&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(TODO: to be tested for Mac/OSX: probably needs the 2 lines terminal.integrated.*.linux replaced with terminal.integrated.*.osx)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;tasks.json&#039;&#039;&#039; &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;version&amp;quot;: &amp;quot;2.0.0&amp;quot;,&lt;br /&gt;
    &amp;quot;tasks&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;label&amp;quot;: &amp;quot;Build&amp;quot;,&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;process&amp;quot;,&lt;br /&gt;
            &amp;quot;command&amp;quot;: &amp;quot;bash&amp;quot;,&lt;br /&gt;
            &amp;quot;args&amp;quot;: [&lt;br /&gt;
                &amp;quot;--init-file&amp;quot;, &amp;quot;${workspaceFolder}/.vscode/kos_make.sh&amp;quot;&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;group&amp;quot;: {&lt;br /&gt;
                &amp;quot;kind&amp;quot;: &amp;quot;build&amp;quot;,&lt;br /&gt;
                &amp;quot;isDefault&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
        },&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result should look like this:&lt;br /&gt;
{|&lt;br /&gt;
| [[File:Vscode cfg files.png|thumb]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
At this point, you should be able to compile applications for the Dreamcast!&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
You can compile via 2 ways:&lt;br /&gt;
# via the VSCode [https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette Command Palette] - &amp;quot;Tasks: Run Build Task&amp;quot;, or&lt;br /&gt;
# by opening a &amp;quot;kos-bash&amp;quot; terminal (Menu: View-Terminal if not visible yet, then click on the &amp;quot;+&amp;quot; to see the terminals to choose from, and select &amp;quot;kos-bash&amp;quot;), and typing &amp;quot;make&amp;quot;&lt;br /&gt;
In both cases, the compilation should generate an executable file, ending with .elf&lt;br /&gt;
&lt;br /&gt;
Note: &amp;quot;kos-bash&amp;quot; is a bash shell with the &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot; already executed for you. It should be your default shell in VSCode as long as you used the settings.json mentioned above.&lt;br /&gt;
&lt;br /&gt;
==== Running a program ====&lt;br /&gt;
For this, we will use the &amp;quot;make run&amp;quot; command that you can find in many (all?) Makefiles of the KallistiOs project, to send and run the program on a real dreamcast:&lt;br /&gt;
&lt;br /&gt;
* Typically, one of the following tools is used to run a program for the Dreamcast:&lt;br /&gt;
# on a real Dreamcast:&lt;br /&gt;
##via an ethernet cable &amp;amp; a [https://dreamcast.wiki/Broadband_adapter Broadband] (BBA) or [https://dreamcast.wiki/LAN_adapter LAN] adapter: &#039;&#039;&#039;[https://dreamcast.wiki/Dcload-ip dcload-ip]&#039;&#039;&#039;&lt;br /&gt;
## via a [https://dreamcast.wiki/Coder%27s_cable coder&#039;s cable] &amp;amp; the serial port of the Dreamcast: &#039;&#039;&#039;[https://dreamcast.wiki/Dcload-serial dcload-serial]&#039;&#039;&#039;&lt;br /&gt;
# on an emulator, like lxdream-nitro&lt;br /&gt;
&lt;br /&gt;
* Make sure that the &#039;&#039;&#039;KOS_LOADER&#039;&#039;&#039; variable in &#039;&#039;&#039;/opt/toolchains/dc/kos/environ.sh&#039;&#039;&#039; is configured correctly:&lt;br /&gt;
&lt;br /&gt;
# for &#039;&#039;&#039;dcload-ip&#039;&#039;&#039; (example if the IP of the Dreamcast is 192.168.1.210):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export KOS_LOADER=&amp;quot;dc-tool-ip -t 192.168.1.210 -x&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# for &#039;&#039;&#039;dcload-serial&#039;&#039;&#039; (example if the Dreamcast is on serial port /dev/ttyS0):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export KOS_LOADER=&amp;quot;dc-tool-ser -t /dev/ttyS0 -x&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# for &#039;&#039;&#039;the emulator&#039;&#039;&#039; (example with lxdream-nitro):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export KOS_LOADER=&amp;quot;/opt/toolchains/dc/lxdream-nitro/builddir/lxdream-nitro -e&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If want to run it on a real Dreamcast, power it on with the dcload disc loaded, and wait for the blue screen&lt;br /&gt;
* Open a &amp;quot;kos-bash&amp;quot; terminal, and type: make run&lt;br /&gt;
* The program will be running on your Dreamcast or on the emulator !&lt;br /&gt;
* (If you ran the 2ndmix example, you can press the START button on the Dreamcast pad to exit)&lt;br /&gt;
* Note: be sure to not have a gdb_init(); line added in your code when you only want to run a program &amp;amp; not debug it.&lt;br /&gt;
&lt;br /&gt;
=== Debugging ===&lt;br /&gt;
==== Preparation ====&lt;br /&gt;
* Make sure that you compiled gdb for the Dreamcast, ie &#039;&#039;&#039;/opt/toolchains/dc/sh-elf/bin/sh-elf-gdb&#039;&#039;&#039; should exist (cfr prerequisites)&lt;br /&gt;
* Debugging in Visual Studio Code is configured in a &#039;&#039;&#039;.vscode/launch.json&#039;&#039;&#039; file. You can add as many debugging configurations as you want inside that launch.json file, eg 1 for debugging on a dreamcast, 1 for debugging on an emulator, ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# insert the following files in the &#039;&#039;&#039;&amp;quot;.vscode&amp;quot; subfolder&#039;&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;launch.json&#039;&#039;&#039; (example with the IP of the Dreamcast = 192.168.1.210 for the BBA/LAN or /dev/ttyS0 for the serial cable):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;version&amp;quot;: &amp;quot;0.2.0&amp;quot;,&lt;br /&gt;
    &amp;quot;configurations&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;name&amp;quot;: &amp;quot;BBA_LAN&amp;quot;,&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;cppdbg&amp;quot;,&lt;br /&gt;
            &amp;quot;request&amp;quot;: &amp;quot;launch&amp;quot;,&lt;br /&gt;
            &amp;quot;preLaunchTask&amp;quot;: &amp;quot;Build&amp;quot;,&lt;br /&gt;
            &amp;quot;cwd&amp;quot;: &amp;quot;${workspaceFolder}&amp;quot;,&lt;br /&gt;
            &amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/${workspaceFolderBasename}.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/2ndmix.elf&amp;quot;,&lt;br /&gt;
            &amp;quot;MIMode&amp;quot;: &amp;quot;gdb&amp;quot;,&lt;br /&gt;
            &amp;quot;miDebuggerPath&amp;quot;: &amp;quot;/opt/toolchains/dc/sh-elf/bin/sh-elf-gdb&amp;quot;,&lt;br /&gt;
            &amp;quot;miDebuggerServerAddress&amp;quot;:&amp;quot;localhost:2159&amp;quot;,//common misconception: we connect to the gdb server offered by dc-tool-ip, NOT to the Dreamcast directly !&lt;br /&gt;
            &amp;quot;debugServerPath&amp;quot;:&amp;quot;/opt/toolchains/dc/bin/dc-tool-ip&amp;quot;,&lt;br /&gt;
            &amp;quot;debugServerArgs&amp;quot;: &amp;quot;-g -t 192.168.1.210 -x ${workspaceFolder}/${workspaceFolderBasename}.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;debugServerArgs&amp;quot;: &amp;quot;-g -t 192.168.1.210 -x ${workspaceFolder}/2ndmix.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;stopAtEntry&amp;quot;: true,&lt;br /&gt;
            &amp;quot;externalConsole&amp;quot;: false,&lt;br /&gt;
            &amp;quot;avoidWindowsConsoleRedirection&amp;quot;: false,&lt;br /&gt;
            &amp;quot;internalConsoleOptions&amp;quot;: &amp;quot;openOnSessionStart&amp;quot;,&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;name&amp;quot;: &amp;quot;SERIAL&amp;quot;,&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;cppdbg&amp;quot;,&lt;br /&gt;
            &amp;quot;request&amp;quot;: &amp;quot;launch&amp;quot;,&lt;br /&gt;
            &amp;quot;preLaunchTask&amp;quot;: &amp;quot;Build&amp;quot;,&lt;br /&gt;
            &amp;quot;cwd&amp;quot;: &amp;quot;${workspaceFolder}&amp;quot;,&lt;br /&gt;
            &amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/${workspaceFolderBasename}.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/2ndmix.elf&amp;quot;,&lt;br /&gt;
            &amp;quot;MIMode&amp;quot;: &amp;quot;gdb&amp;quot;,&lt;br /&gt;
            &amp;quot;miDebuggerPath&amp;quot;: &amp;quot;/opt/toolchains/dc/sh-elf/bin/sh-elf-gdb&amp;quot;,&lt;br /&gt;
            &amp;quot;miDebuggerServerAddress&amp;quot;:&amp;quot;localhost:2159&amp;quot;,//common misconception: we connect to the gdb server offered by dc-tool-ser, NOT to the Dreamcast directly !&lt;br /&gt;
            &amp;quot;debugServerPath&amp;quot;:&amp;quot;/opt/toolchains/dc/bin/dc-tool-ser&amp;quot;,&lt;br /&gt;
            &amp;quot;debugServerArgs&amp;quot;: &amp;quot;-g -t /dev/ttyS0 -x ${workspaceFolder}/${workspaceFolderBasename}.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;debugServerArgs&amp;quot;: &amp;quot;-g -t /dev/ttyS0 -x ${workspaceFolder}/2ndmix.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;stopAtEntry&amp;quot;: true,&lt;br /&gt;
            &amp;quot;externalConsole&amp;quot;: false,&lt;br /&gt;
            &amp;quot;avoidWindowsConsoleRedirection&amp;quot;: false,&lt;br /&gt;
            &amp;quot;internalConsoleOptions&amp;quot;: &amp;quot;openOnSessionStart&amp;quot;,&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;name&amp;quot;: &amp;quot;LXDream&amp;quot;,&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;cppdbg&amp;quot;,&lt;br /&gt;
            &amp;quot;request&amp;quot;: &amp;quot;launch&amp;quot;,&lt;br /&gt;
            &amp;quot;preLaunchTask&amp;quot;: &amp;quot;Build&amp;quot;,&lt;br /&gt;
            &amp;quot;cwd&amp;quot;: &amp;quot;${workspaceRoot}&amp;quot;,&lt;br /&gt;
            &amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/${workspaceFolderBasename}.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/2ndmix.elf&amp;quot;,&lt;br /&gt;
            &amp;quot;miDebuggerPath&amp;quot;: &amp;quot;/opt/toolchains/dc/sh-elf/bin/sh-elf-gdb&amp;quot;,&lt;br /&gt;
            &amp;quot;setupCommands&amp;quot;: [{&lt;br /&gt;
                &amp;quot;text&amp;quot;: &amp;quot;set architecture sh&amp;quot;,&lt;br /&gt;
                &amp;quot;description&amp;quot;: &amp;quot;Set GDB Arch to SuperH&amp;quot;,&lt;br /&gt;
                &amp;quot;ignoreFailures&amp;quot; : false,&lt;br /&gt;
            }],&lt;br /&gt;
            &amp;quot;miDebuggerServerAddress&amp;quot;: &amp;quot;:9999&amp;quot;,&lt;br /&gt;
            // path to lxdream-nitro&lt;br /&gt;
            &amp;quot;debugServerPath&amp;quot;: &amp;quot;PATH_TO_LXDREAM&amp;quot;,&lt;br /&gt;
            // lxdream-nitro flags&lt;br /&gt;
            &amp;quot;debugServerArgs&amp;quot;: &amp;quot;--log=DEBUG --gdb-sh4=9999 -A null -e ${workspaceRoot}/${workspaceFolderBasename}.elf -n&amp;quot;,&lt;br /&gt;
            //&amp;quot;debugServerArgs&amp;quot;: &amp;quot;--log=DEBUG --gdb-sh4=9999 -A null -e ${workspaceRoot}/2ndmix.elf -n&amp;quot;,&lt;br /&gt;
            &amp;quot;filterStdout&amp;quot;: true,&lt;br /&gt;
            &amp;quot;filterStderr&amp;quot;: true,&lt;br /&gt;
            // run on connect&lt;br /&gt;
            &amp;quot;stopAtConnect&amp;quot;: false,&lt;br /&gt;
            // stop at main&lt;br /&gt;
            &amp;quot;stopAtEntry&amp;quot;: true,&lt;br /&gt;
            &amp;quot;externalConsole&amp;quot;: false,&lt;br /&gt;
            &amp;quot;avoidWindowsConsoleRedirection&amp;quot;: false,&lt;br /&gt;
            &amp;quot;internalConsoleOptions&amp;quot;: &amp;quot;openOnSessionStart&amp;quot;,&lt;br /&gt;
            &amp;quot;launchCompleteCommand&amp;quot;: &amp;quot;exec-run&amp;quot;,&lt;br /&gt;
            &amp;quot;serverStarted&amp;quot;: &amp;quot;SH4 GDB server running on port&amp;quot;,&lt;br /&gt;
            &amp;quot;useExtendedRemote&amp;quot;: true&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that for the 3 launch configurations above, you have 2 lines for &lt;br /&gt;
&amp;quot;program&amp;quot; and &amp;quot;debugServerArgs&amp;quot;, one of which is commented out.&lt;br /&gt;
${workspaceFolderBasename} is the name of your project directory (eg: 2ndmix), and if that matches the name of your target .elf file (eg: 2ndmix.elf), then you can use ${workspaceFolderBasename}.&lt;br /&gt;
If not, you can just use the other line by replacing ${workspaceFolderBasename} with the real .elf filename.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also need to replace &amp;quot;PATH_TO_LXDREAM&amp;quot; with the path to the emulator installed on your pc.&lt;br /&gt;
&lt;br /&gt;
==== Launching a Debug session ====&lt;br /&gt;
{|&lt;br /&gt;
| [[File:Vscode debugging.png|thumb|alt=Vscode debugging|Vscode debugging]]&lt;br /&gt;
|}&lt;br /&gt;
* put a line to initialize gdb in your code (1):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
gdb_init();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If using lxdream-nitro, a gdb server is already provided and so gdb_init() should ```not``` be called.&lt;br /&gt;
&lt;br /&gt;
TODO: conditional include&lt;br /&gt;
* insert a breakpoint &#039;&#039;&#039;AFTER&#039;&#039;&#039; this gdb_init(); line (1). You can&#039;t put a breakpoint before or on this line !&lt;br /&gt;
* If want to run it on a real Dreamcast, power it on with the dcload disc loaded, and wait for the blue screen&lt;br /&gt;
* Click on the &amp;quot;Debugger&amp;quot; icon (2) on the left&lt;br /&gt;
* Select the configuration you want to launch (BBA_LAN, SERIAL, or LXDream)(3)&lt;br /&gt;
* Click on the green arrow (&amp;quot;Start Debugging&amp;quot; - F5)(4)&lt;br /&gt;
&lt;br /&gt;
==== Tips ====&lt;br /&gt;
* If you want to print out the value of a variable to the console (Terminal) on the pc, add a line like this to your code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
dbglog(DBG_INFO, &amp;quot;value is: 0x%08X\n&amp;quot;, variable);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting Tips ====&lt;br /&gt;
* If the dc-tool app does not seem to react anymore:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo netstat -ap | grep :2159&lt;br /&gt;
sudo kill &amp;lt;pid&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
[https://forums.sonicretro.org/index.php?threads/setting-up-gdb-with-redream-in-linux.38824/ netstat tip source]&lt;br /&gt;
&lt;br /&gt;
[https://dcemulation.org/phpBB/viewtopic.php?t=105596&amp;amp;start=20 Original VSCode topic on dcemulation.org]&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Creating_a_bootable_Dreamcast_disc&amp;diff=3685</id>
		<title>Creating a bootable Dreamcast disc</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Creating_a_bootable_Dreamcast_disc&amp;diff=3685"/>
		<updated>2025-02-15T20:03:12Z</updated>

		<summary type="html">&lt;p&gt;Tchan: Starting refactoring. Added info about mkdcdisc.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Full Overview of the steps involved ==&lt;br /&gt;
&lt;br /&gt;
The full list of steps to make self-bootable disc for the [[Dreamcast]] goes like this:&lt;br /&gt;
&lt;br /&gt;
* Build your source (usually using [[KallistiOS]])&lt;br /&gt;
* Transform your .elf executable into binary&lt;br /&gt;
* Scramble the binary&lt;br /&gt;
* Build a .iso image from a directory&lt;br /&gt;
* Transform the .iso into a .cdi image&lt;br /&gt;
* Transfer the .gdi image to your GDEMU/..., or burn the .cdi image to a cd-rom to launch it in a standard Dreamcast.&lt;br /&gt;
&lt;br /&gt;
There are other details that could be taken into account:&lt;br /&gt;
* You can make Audio/Data and Data/Data .cdi files. Both can selfboot, but the files will be organized differently on the physical CD. {{Citation needed}}&lt;br /&gt;
* You&#039;ll need to provide a valid [[IP.BIN]], these can be modified to display a logo during the boot screen, apply patches or execute some code. &lt;br /&gt;
* It is possible to make CDDA compatible images, this process in not currently covered here.&lt;br /&gt;
&lt;br /&gt;
Depending on the method/tools used, some of the above steps are simplified a lot:&lt;br /&gt;
* mkdcdisc: does the heavy lifting for you. Linux only for now.&lt;br /&gt;
* mkisofs + cdi4dc&lt;br /&gt;
* mkisofs + cdrecord &lt;br /&gt;
&lt;br /&gt;
== mkdcdisc (Linux only for now) ==&lt;br /&gt;
&lt;br /&gt;
[https://gitlab.com/simulant/mkdcdisc mkdcdisc] is a recent (2022) tool that pretty much does all the steps for you.&lt;br /&gt;
&lt;br /&gt;
The minimum you need for it, is your executable .elf.&lt;br /&gt;
&lt;br /&gt;
Example to build a bootable DC disc image nehe05.cdi, starting from an executable called nehe05.elf:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdcdisc -e nehe05.elf -o nehe05.cdi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Example to build a bootable DC disc image mygame.cdi, starting from an executable called mygame.elf, with assets/textures/... files stored in a subfolder called &amp;quot;data&amp;quot;:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
mkdcdisc -e mygame.elf -D data -o mygame.cdi&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
There are a lot of commandline options, so be sure to check them all out!&lt;br /&gt;
&lt;br /&gt;
== mkisofs + cdi4dc ==&lt;br /&gt;
&lt;br /&gt;
This is an example for automating the .cdi image process under Linux. Consider this more like a template as you&#039;ll need to edit the paths, names, etc to your own project. &lt;br /&gt;
&lt;br /&gt;
  #! /bin/sh&lt;br /&gt;
  PROJECT_DIR=$PWD/build&lt;br /&gt;
  PROJECT_NAME=&amp;quot;Project_Name&amp;quot;&lt;br /&gt;
  TARGET=&amp;quot;main.elf&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  # Build your program&lt;br /&gt;
  # This assumes that you can properly build your source code. The program main output will be $TARGET&lt;br /&gt;
  make $TARGET&lt;br /&gt;
&lt;br /&gt;
  # Elf transform&lt;br /&gt;
  sh-elf-objcopy -R .stack -O binary $TARGET output.bin&lt;br /&gt;
&lt;br /&gt;
  # Scrambling process&lt;br /&gt;
  $KOS_BASE/utils/scramble/scramble output.bin 1ST_READ.bin&lt;br /&gt;
&lt;br /&gt;
  # Creating a .iso image from a directory &lt;br /&gt;
  # Make sure you have a working [[IP.BIN]] in your current directory. Or change IP.BIN path to wherever you like.&lt;br /&gt;
  # Useful option for mkisofs is *-m* which allow to exclude files from the iso image (useful to remove .git, or some other folder) &lt;br /&gt;
  mkisofs -C 0,11702 -V $PROJECT_NAME -G IP.BIN -r -J -l -o $PROJECT_NAME.iso $DIR&lt;br /&gt;
&lt;br /&gt;
  # Transform your .iso into a .cdi&lt;br /&gt;
  $KOS_BASE/utils/cdi4dc/cdi4dc $PROJECT_NAME.iso $PROJECT_NAME.cdi&lt;br /&gt;
&lt;br /&gt;
== mkisofs + cdrecord  ==&lt;br /&gt;
TODO&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3682</id>
		<title>Codespaces</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3682"/>
		<updated>2025-02-04T19:12:34Z</updated>

		<summary type="html">&lt;p&gt;Tchan: replace last ref to one of Colton&amp;#039;s old containers, with latest-stable&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Github [https://www.youtube.com/watch?v=sYJ3CHtT6WM Codespaces] lets you spawn a complete Dreamcast development environment in your browser in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
The only things you need are:&lt;br /&gt;
* a browser&lt;br /&gt;
* a github login.&lt;br /&gt;
&lt;br /&gt;
No need for a complex installation process anymore !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Steps Overview ==&lt;br /&gt;
The main steps to get a Codespace working, are:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Create your code repository, or fork one&lt;br /&gt;
* Add a .devcontainer/devcontainer.json file to that repository&lt;br /&gt;
* Create &amp;amp; launch your codespace, and enjoy the IDE in your browser !&lt;br /&gt;
&lt;br /&gt;
That&#039;s all there is to it.&lt;br /&gt;
&lt;br /&gt;
Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].&lt;br /&gt;
&lt;br /&gt;
== Example 1: Build an .elf from a KallistiOS example ==&lt;br /&gt;
To compile the executable .elf file from a KallistiOS examples in a Codespace:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]&lt;br /&gt;
* Click on the &amp;quot;Fork&amp;quot; button, this will create a KallistiOS repository inside your account&lt;br /&gt;
* Click on the &amp;quot;Add File&amp;quot; button, then &amp;quot;Create New File&amp;quot;&lt;br /&gt;
* Name the file: &amp;quot;.devcontainer/devcontainer.json&amp;quot;, and paste the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:latest-stable&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	//&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	//    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	//},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Click on &amp;quot;Commit changes&amp;quot;, then &amp;quot;Commit Changes&amp;quot; again to save the file&lt;br /&gt;
* Go back to the root directory of your repository&lt;br /&gt;
* Launch your Codespace by clicking on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot; - &amp;quot;Create codespace on master&amp;quot;.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Screen Shot 2024-07-14 at 8.28.13 AM.png|thumb]]&lt;br /&gt;
|}&lt;br /&gt;
* This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.&lt;br /&gt;
* 3-bars-Menu at the top left - Terminal - New Terminal&lt;br /&gt;
* cd examples/dreamcast/2ndmix&lt;br /&gt;
* make clean&lt;br /&gt;
* make&lt;br /&gt;
* You should now have a &amp;quot;2ndmix.elf&amp;quot; in that folder&lt;br /&gt;
* Navigate to that folder (examples/dreamcast/2ndmix) on the file tree on the left, right-click on the file, and choose &amp;quot;Download...&amp;quot;&lt;br /&gt;
* Congratulations ! You successfully built an executable file for the Dreamcast. You can now upload that file in your favorite emulator, or send it to a real Dreamcast via a [https://dreamcast.wiki/Coder%27s_cable Coder&#039;s Cable] or a [https://dreamcast.wiki/Broadband_adapter Broadband Adapter]&lt;br /&gt;
&lt;br /&gt;
== Example 2: create a .cdi from the .elf of Example 1 ==&lt;br /&gt;
Having an .elf executable file is nice for small tests, but often you&#039;ll find yourself needing to build a .cdi disc image file:&lt;br /&gt;
* If you closed your codespace, you can reopen it by going to your code repository, click on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot;, then on the auto-generated name of your codespace.&lt;br /&gt;
* Since our codespace does not contain mkdcdisc (the tool to build .cdi files), we&#039;ll add that to our codespace:&lt;br /&gt;
** Open a terminal in your codespace (3-bars-Menu at the top left - Terminal - New Terminal)&lt;br /&gt;
** cd /opt/toolchains/dc&lt;br /&gt;
** git clone https://gitlab.com/simulant/mkdcdisc&lt;br /&gt;
** cd mkdcdisc&lt;br /&gt;
** meson setup builddir&lt;br /&gt;
** meson compile -C builddir&lt;br /&gt;
** cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
* Build the .cdi file for 2ndmix.elf&lt;br /&gt;
** cd /opt/toolchains/dc/kos/examples/dreamcast/2ndmix&lt;br /&gt;
** mkdcdisc -e 2ndmix.elf -o 2ndmix.cdi -n &amp;quot;2ndmix&amp;quot;&lt;br /&gt;
* Compress the .cdi file into a zip file with parts of max 25 MegaBytes (otherwise your browser will have problems downloading the .cdi):&lt;br /&gt;
** zip -s 25M 2ndmix.zip 2ndmix.cdi&lt;br /&gt;
* Right-click on the generated files, and download them into your local folders&lt;br /&gt;
* Unzip the files in your local folder to reconstruct 2ndmix.cdi&lt;br /&gt;
* Launch 2ndmix.cdi in your favorite emulator, or on a real Dreamcast&lt;br /&gt;
&lt;br /&gt;
== Example 3: Configuring a more complex Codespace ==&lt;br /&gt;
If you find yourself always adding the same extra application into the codespace provided in Example 1 (eg: always having to add mkdcdisc, ...), you can simplify your setup by specifying your own Dockerfile, and add setup commands in there:&lt;br /&gt;
&lt;br /&gt;
* Modify .devcontainer/devcontainer.json so that it points to a Dockerfile:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	//&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:latest-stable&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ... and add a new file: ./devcontainer/Dockerfile&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Stage 1&lt;br /&gt;
FROM &amp;quot;ghcr.io/kos-builds/kos-ports-dc:latest-stable&amp;quot; as build&lt;br /&gt;
&lt;br /&gt;
# Add mkdcdisc&lt;br /&gt;
RUN git clone https://gitlab.com/simulant/mkdcdisc /opt/toolchains/dc/mkdcdisc \&lt;br /&gt;
    &amp;amp;&amp;amp; cd /opt/toolchains/dc/mkdcdisc \&lt;br /&gt;
    &amp;amp;&amp;amp; meson setup builddir \&lt;br /&gt;
    &amp;amp;&amp;amp; meson compile -C builddir \&lt;br /&gt;
    &amp;amp;&amp;amp; cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* The next time you create a repository &amp;amp; copy the above 2 files in it, you will get a codespace with mkdcdisc already correctly installed !&lt;br /&gt;
&lt;br /&gt;
== Example 4: Build something not from KallistiOS ==&lt;br /&gt;
All the previous examples started by forking the KallistiOS repository, but most often you&#039;ll just want to work on your own code / another Dreamcast project, so you&#039;ll work from a repository other than KallistiOS:&lt;br /&gt;
* login into [https://www.github.com github]&lt;br /&gt;
* create/go to your own repository, or fork an existing project (eg doom64-dc, ...)&lt;br /&gt;
* add at least ./devcontainer/devcontainer.json, and ./devcontainer/Dockerfile if needed&lt;br /&gt;
* create/launch your codespace&lt;br /&gt;
* follow the build instructions of that project&lt;br /&gt;
* Notes:&lt;br /&gt;
** Everything for KallistiOS should be available in the terminal, you&#039;ll find KallistiOS stuff in the folder /opt/toolchains/dc&lt;br /&gt;
** In the file-tree on the left side, you&#039;ll see the files of your repository (folder: /workspaces). If you also want to add other folders there, eg /opt/toolchains/dc, execute something like this in the terminal: code -a /opt/toolchains/dc&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
* When you&#039;re finished with your Codespace, go to &lt;br /&gt;
** the 3-bars-Menu at the top left - &amp;quot;My Codespaces&amp;quot;&lt;br /&gt;
** on the left, select the codespace you were just running&lt;br /&gt;
** click on the 3 dots next to &amp;quot;Active&amp;quot;&lt;br /&gt;
** select &amp;quot;Stop codespace&amp;quot;&lt;br /&gt;
Doing this pro-actively will save you some free minutes, since the default timeout is 30 minutes.&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3681</id>
		<title>Codespaces</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3681"/>
		<updated>2025-02-04T19:11:13Z</updated>

		<summary type="html">&lt;p&gt;Tchan: point to Colton&amp;#039;s latest-stable container, instead of an old specific version&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Github [https://www.youtube.com/watch?v=sYJ3CHtT6WM Codespaces] lets you spawn a complete Dreamcast development environment in your browser in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
The only things you need are:&lt;br /&gt;
* a browser&lt;br /&gt;
* a github login.&lt;br /&gt;
&lt;br /&gt;
No need for a complex installation process anymore !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Steps Overview ==&lt;br /&gt;
The main steps to get a Codespace working, are:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Create your code repository, or fork one&lt;br /&gt;
* Add a .devcontainer/devcontainer.json file to that repository&lt;br /&gt;
* Create &amp;amp; launch your codespace, and enjoy the IDE in your browser !&lt;br /&gt;
&lt;br /&gt;
That&#039;s all there is to it.&lt;br /&gt;
&lt;br /&gt;
Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].&lt;br /&gt;
&lt;br /&gt;
== Example 1: Build an .elf from a KallistiOS example ==&lt;br /&gt;
To compile the executable .elf file from a KallistiOS examples in a Codespace:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]&lt;br /&gt;
* Click on the &amp;quot;Fork&amp;quot; button, this will create a KallistiOS repository inside your account&lt;br /&gt;
* Click on the &amp;quot;Add File&amp;quot; button, then &amp;quot;Create New File&amp;quot;&lt;br /&gt;
* Name the file: &amp;quot;.devcontainer/devcontainer.json&amp;quot;, and paste the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:latest-stable&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	//&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	//    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	//},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Click on &amp;quot;Commit changes&amp;quot;, then &amp;quot;Commit Changes&amp;quot; again to save the file&lt;br /&gt;
* Go back to the root directory of your repository&lt;br /&gt;
* Launch your Codespace by clicking on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot; - &amp;quot;Create codespace on master&amp;quot;.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Screen Shot 2024-07-14 at 8.28.13 AM.png|thumb]]&lt;br /&gt;
|}&lt;br /&gt;
* This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.&lt;br /&gt;
* 3-bars-Menu at the top left - Terminal - New Terminal&lt;br /&gt;
* cd examples/dreamcast/2ndmix&lt;br /&gt;
* make clean&lt;br /&gt;
* make&lt;br /&gt;
* You should now have a &amp;quot;2ndmix.elf&amp;quot; in that folder&lt;br /&gt;
* Navigate to that folder (examples/dreamcast/2ndmix) on the file tree on the left, right-click on the file, and choose &amp;quot;Download...&amp;quot;&lt;br /&gt;
* Congratulations ! You successfully built an executable file for the Dreamcast. You can now upload that file in your favorite emulator, or send it to a real Dreamcast via a [https://dreamcast.wiki/Coder%27s_cable Coder&#039;s Cable] or a [https://dreamcast.wiki/Broadband_adapter Broadband Adapter]&lt;br /&gt;
&lt;br /&gt;
== Example 2: create a .cdi from the .elf of Example 1 ==&lt;br /&gt;
Having an .elf executable file is nice for small tests, but often you&#039;ll find yourself needing to build a .cdi disc image file:&lt;br /&gt;
* If you closed your codespace, you can reopen it by going to your code repository, click on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot;, then on the auto-generated name of your codespace.&lt;br /&gt;
* Since our codespace does not contain mkdcdisc (the tool to build .cdi files), we&#039;ll add that to our codespace:&lt;br /&gt;
** Open a terminal in your codespace (3-bars-Menu at the top left - Terminal - New Terminal)&lt;br /&gt;
** cd /opt/toolchains/dc&lt;br /&gt;
** git clone https://gitlab.com/simulant/mkdcdisc&lt;br /&gt;
** cd mkdcdisc&lt;br /&gt;
** meson setup builddir&lt;br /&gt;
** meson compile -C builddir&lt;br /&gt;
** cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
* Build the .cdi file for 2ndmix.elf&lt;br /&gt;
** cd /opt/toolchains/dc/kos/examples/dreamcast/2ndmix&lt;br /&gt;
** mkdcdisc -e 2ndmix.elf -o 2ndmix.cdi -n &amp;quot;2ndmix&amp;quot;&lt;br /&gt;
* Compress the .cdi file into a zip file with parts of max 25 MegaBytes (otherwise your browser will have problems downloading the .cdi):&lt;br /&gt;
** zip -s 25M 2ndmix.zip 2ndmix.cdi&lt;br /&gt;
* Right-click on the generated files, and download them into your local folders&lt;br /&gt;
* Unzip the files in your local folder to reconstruct 2ndmix.cdi&lt;br /&gt;
* Launch 2ndmix.cdi in your favorite emulator, or on a real Dreamcast&lt;br /&gt;
&lt;br /&gt;
== Example 3: Configuring a more complex Codespace ==&lt;br /&gt;
If you find yourself always adding the same extra application into the codespace provided in Example 1 (eg: always having to add mkdcdisc, ...), you can simplify your setup by specifying your own Dockerfile, and add setup commands in there:&lt;br /&gt;
&lt;br /&gt;
* Modify .devcontainer/devcontainer.json so that it points to a Dockerfile:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	//&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:latest-stable&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ... and add a new file: ./devcontainer/Dockerfile&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Stage 1&lt;br /&gt;
FROM &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot; as build&lt;br /&gt;
&lt;br /&gt;
# Add mkdcdisc&lt;br /&gt;
RUN git clone https://gitlab.com/simulant/mkdcdisc /opt/toolchains/dc/mkdcdisc \&lt;br /&gt;
    &amp;amp;&amp;amp; cd /opt/toolchains/dc/mkdcdisc \&lt;br /&gt;
    &amp;amp;&amp;amp; meson setup builddir \&lt;br /&gt;
    &amp;amp;&amp;amp; meson compile -C builddir \&lt;br /&gt;
    &amp;amp;&amp;amp; cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* The next time you create a repository &amp;amp; copy the above 2 files in it, you will get a codespace with mkdcdisc already correctly installed !&lt;br /&gt;
&lt;br /&gt;
== Example 4: Build something not from KallistiOS ==&lt;br /&gt;
All the previous examples started by forking the KallistiOS repository, but most often you&#039;ll just want to work on your own code / another Dreamcast project, so you&#039;ll work from a repository other than KallistiOS:&lt;br /&gt;
* login into [https://www.github.com github]&lt;br /&gt;
* create/go to your own repository, or fork an existing project (eg doom64-dc, ...)&lt;br /&gt;
* add at least ./devcontainer/devcontainer.json, and ./devcontainer/Dockerfile if needed&lt;br /&gt;
* create/launch your codespace&lt;br /&gt;
* follow the build instructions of that project&lt;br /&gt;
* Notes:&lt;br /&gt;
** Everything for KallistiOS should be available in the terminal, you&#039;ll find KallistiOS stuff in the folder /opt/toolchains/dc&lt;br /&gt;
** In the file-tree on the left side, you&#039;ll see the files of your repository (folder: /workspaces). If you also want to add other folders there, eg /opt/toolchains/dc, execute something like this in the terminal: code -a /opt/toolchains/dc&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
* When you&#039;re finished with your Codespace, go to &lt;br /&gt;
** the 3-bars-Menu at the top left - &amp;quot;My Codespaces&amp;quot;&lt;br /&gt;
** on the left, select the codespace you were just running&lt;br /&gt;
** click on the 3 dots next to &amp;quot;Active&amp;quot;&lt;br /&gt;
** select &amp;quot;Stop codespace&amp;quot;&lt;br /&gt;
Doing this pro-actively will save you some free minutes, since the default timeout is 30 minutes.&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Visual_Studio_Code&amp;diff=3597</id>
		<title>Visual Studio Code</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Visual_Studio_Code&amp;diff=3597"/>
		<updated>2024-09-06T05:47:45Z</updated>

		<summary type="html">&lt;p&gt;Tchan: add &amp;quot;/opt/toolchains/dc/kos-ports/*/include/**&amp;quot; to C_Cpp.default.includePath because VSCode has problems with symbolic links under Linux&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a guide to setup your [https://code.visualstudio.com/ Visual Studio Code] project with debugging support on both on a real Dreamcast and with an emulator.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To start with, this tutorial makes the following assumptions:&lt;br /&gt;
* You have already installed and [https://dreamcast.wiki/Getting_Started_with_Dreamcast_development set up your KallistiOS development environment]]&lt;br /&gt;
# if you want to be able to debug, be sure to compile gdb as specified on that page&lt;br /&gt;
* You have already downloaded and installed [https://code.visualstudio.com/ Visual Studio Code] (version 1.78.2 was used for this tutorial)&lt;br /&gt;
&lt;br /&gt;
== VSCode Setup ==&lt;br /&gt;
* Launch Visual Studio Code&lt;br /&gt;
* (optional but recommended) To keep your configuration settings, plugins, ... specific to Dreamcast projects only:&lt;br /&gt;
# Create a &amp;quot;Profile&amp;quot; (Menu: File-Preferences-Profiles) called &amp;quot;Dreamcast&amp;quot;&lt;br /&gt;
* Install the following extensions: (Menu: View-Extensions)&lt;br /&gt;
# Required:&lt;br /&gt;
## [https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools C/C++] from Microsoft&lt;br /&gt;
# Required only if you are using WSL (Windows Subsystem for Linux):&lt;br /&gt;
## [https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl WSL from Microsoft]&lt;br /&gt;
# (Not recommended at this moment:)&lt;br /&gt;
## ([https://marketplace.visualstudio.com/items?itemName=ms-vscode.makefile-tools Makefile Tools] from Microsoft: the current version (June 2023) is not really adapted for remote debugging)&lt;br /&gt;
&lt;br /&gt;
== Setup per Project ==&lt;br /&gt;
&lt;br /&gt;
=== Compilation ===&lt;br /&gt;
==== Preparation ====&lt;br /&gt;
(all the following steps happen in Visual Studio Code)&lt;br /&gt;
# Open the folder containing your project - eg: /opt/toolchains/dc/kos/examples/dreamcast/2ndmix:&lt;br /&gt;
##If you are using WSL:&lt;br /&gt;
###&amp;quot;F1&amp;quot; - &amp;quot;Connect To WSL&amp;quot;&lt;br /&gt;
##Menu: File-Open Folder...&lt;br /&gt;
# (if you are using Profiles) Make sure that the &amp;quot;Dreamcast&amp;quot; profile is selected (Menu: File-Preferences-Profiles)&lt;br /&gt;
#If you are using WSL, check that the C/C++ extension is correctly installed for WSL - if you get a warning like &amp;quot;install in WSL: Ubuntu&amp;quot;, do so.&lt;br /&gt;
# Create a new subfolder &amp;quot;.vscode&amp;quot;&lt;br /&gt;
# insert the following files in the &#039;&#039;&#039;&amp;quot;.vscode&amp;quot; subfolder&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;kos_environ.sh&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#set the KOS environtment variables&lt;br /&gt;
source /opt/toolchains/dc/kos/environ.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;kos_make.sh&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#set the KOS environtment variables&lt;br /&gt;
source /opt/toolchains/dc/kos/environ.sh&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;settings.json&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;C_Cpp.default.includePath&amp;quot;: [&lt;br /&gt;
        &amp;quot;${workspaceFolder}/**&amp;quot;,&lt;br /&gt;
        &amp;quot;/opt/toolchains/dc/kos/include/**&amp;quot;,&lt;br /&gt;
        &amp;quot;/opt/toolchains/dc/kos/kernel/arch/dreamcast/include/**&amp;quot;,&lt;br /&gt;
        &amp;quot;/opt/toolchains/dc/kos/addons/include/**&amp;quot;,&lt;br /&gt;
        &amp;quot;/opt/toolchains/dc/kos-ports/include/**&amp;quot;,&lt;br /&gt;
        &amp;quot;/opt/toolchains/dc/kos-ports/*/include/**&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;C_Cpp.default.defines&amp;quot;: [&lt;br /&gt;
            &amp;quot;_arch_dreamcast&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;C_Cpp.default.compilerPath&amp;quot;: &amp;quot;/opt/toolchains/dc/sh-elf/bin/sh-elf-gcc&amp;quot;,&lt;br /&gt;
    &amp;quot;C_Cpp.default.cStandard&amp;quot;: &amp;quot;c11&amp;quot;,&lt;br /&gt;
    &amp;quot;C_Cpp.default.cppStandard&amp;quot;: &amp;quot;c++17&amp;quot;,&lt;br /&gt;
    &amp;quot;C_Cpp.default.intelliSenseMode&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;terminal.integrated.defaultProfile.linux&amp;quot;: &amp;quot;kos-bash&amp;quot;,&lt;br /&gt;
    &amp;quot;terminal.integrated.profiles.linux&amp;quot;: {&lt;br /&gt;
        &amp;quot;kos-bash&amp;quot;: {&lt;br /&gt;
            &amp;quot;path&amp;quot;: &amp;quot;/usr/bin/bash&amp;quot;,&lt;br /&gt;
            &amp;quot;args&amp;quot;: [&amp;quot;--init-file&amp;quot;, &amp;quot;${workspaceFolder}/.vscode/kos_environ.sh&amp;quot; ],&lt;br /&gt;
            &amp;quot;overrideName&amp;quot;: true&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(TODO: to be tested for Mac/OSX: probably needs the 2 lines terminal.integrated.*.linux replaced with terminal.integrated.*.osx)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;tasks.json&#039;&#039;&#039; &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;version&amp;quot;: &amp;quot;2.0.0&amp;quot;,&lt;br /&gt;
    &amp;quot;tasks&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;label&amp;quot;: &amp;quot;Build&amp;quot;,&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;process&amp;quot;,&lt;br /&gt;
            &amp;quot;command&amp;quot;: &amp;quot;bash&amp;quot;,&lt;br /&gt;
            &amp;quot;args&amp;quot;: [&lt;br /&gt;
                &amp;quot;--init-file&amp;quot;, &amp;quot;${workspaceFolder}/.vscode/kos_make.sh&amp;quot;&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;group&amp;quot;: {&lt;br /&gt;
                &amp;quot;kind&amp;quot;: &amp;quot;build&amp;quot;,&lt;br /&gt;
                &amp;quot;isDefault&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
        },&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result should look like this:&lt;br /&gt;
{|&lt;br /&gt;
| [[File:Vscode cfg files.png|thumb]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
At this point, you should be able to compile applications for the Dreamcast!&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
You can compile via 2 ways:&lt;br /&gt;
# via the VSCode [https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette Command Palette] - &amp;quot;Tasks: Run Build Task&amp;quot;, or&lt;br /&gt;
# by opening a &amp;quot;kos-bash&amp;quot; terminal (Menu: View-Terminal if not visible yet, then click on the &amp;quot;+&amp;quot; to see the terminals to choose from, and select &amp;quot;kos-bash&amp;quot;), and typing &amp;quot;make&amp;quot;&lt;br /&gt;
In both cases, the compilation should generate an executable file, ending with .elf&lt;br /&gt;
&lt;br /&gt;
Note: &amp;quot;kos-bash&amp;quot; is a bash shell with the &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot; already executed for you. It should be your default shell in VSCode as long as you used the settings.json mentioned above.&lt;br /&gt;
&lt;br /&gt;
==== Running a program ====&lt;br /&gt;
For this, we will use the &amp;quot;make run&amp;quot; command that you can find in many (all?) Makefiles of the KallistiOs project, to send and run the program on a real dreamcast:&lt;br /&gt;
&lt;br /&gt;
* Typically, one of the following tools is used to run a program for the Dreamcast:&lt;br /&gt;
# on a real Dreamcast:&lt;br /&gt;
##via an ethernet cable &amp;amp; a [https://dreamcast.wiki/Broadband_adapter Broadband] (BBA) or [https://dreamcast.wiki/LAN_adapter LAN] adapter: &#039;&#039;&#039;[https://dreamcast.wiki/Dcload-ip dcload-ip]&#039;&#039;&#039;&lt;br /&gt;
## via a [https://dreamcast.wiki/Coder%27s_cable coder&#039;s cable] &amp;amp; the serial port of the Dreamcast: &#039;&#039;&#039;[https://dreamcast.wiki/Dcload-serial dcload-serial]&#039;&#039;&#039;&lt;br /&gt;
# on an emulator, like lxdream-nitro&lt;br /&gt;
&lt;br /&gt;
* Make sure that the &#039;&#039;&#039;KOS_LOADER&#039;&#039;&#039; variable in &#039;&#039;&#039;/opt/toolchains/dc/kos/environ.sh&#039;&#039;&#039; is configured correctly:&lt;br /&gt;
&lt;br /&gt;
# for &#039;&#039;&#039;dcload-ip&#039;&#039;&#039; (example if the IP of the Dreamcast is 192.168.1.210):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export KOS_LOADER=&amp;quot;dc-tool-ip -t 192.168.1.210 -x&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# for &#039;&#039;&#039;dcload-serial&#039;&#039;&#039; (example if the Dreamcast is on serial port /dev/ttyS0):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export KOS_LOADER=&amp;quot;dc-tool-ser -t /dev/ttyS0 -x&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# for &#039;&#039;&#039;the emulator&#039;&#039;&#039; (example with lxdream-nitro):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export KOS_LOADER=&amp;quot;/opt/toolchains/dc/lxdream-nitro/builddir/lxdream-nitro -e&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If want to run it on a real Dreamcast, power it on with the dcload disc loaded, and wait for the blue screen&lt;br /&gt;
* Open a &amp;quot;kos-bash&amp;quot; terminal, and type: make run&lt;br /&gt;
* The program will be running on your Dreamcast or on the emulator !&lt;br /&gt;
* (If you ran the 2ndmix example, you can press the START button on the Dreamcast pad to exit)&lt;br /&gt;
* Note: be sure to not have a gdb_init(); line added in your code when you only want to run a program &amp;amp; not debug it.&lt;br /&gt;
&lt;br /&gt;
=== Debugging ===&lt;br /&gt;
==== Preparation ====&lt;br /&gt;
* Make sure that you compiled gdb for the Dreamcast, ie &#039;&#039;&#039;/opt/toolchains/dc/sh-elf/bin/sh-elf-gdb&#039;&#039;&#039; should exist (cfr prerequisites)&lt;br /&gt;
* Debugging in Visual Studio Code is configured in a &#039;&#039;&#039;.vscode/launch.json&#039;&#039;&#039; file. You can add as many debugging configurations as you want inside that launch.json file, eg 1 for debugging on a dreamcast, 1 for debugging on an emulator, ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# insert the following files in the &#039;&#039;&#039;&amp;quot;.vscode&amp;quot; subfolder&#039;&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;launch.json&#039;&#039;&#039; (example with the IP of the Dreamcast = 192.168.1.210 for the BBA/LAN or /dev/ttyS0 for the serial cable):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;version&amp;quot;: &amp;quot;0.2.0&amp;quot;,&lt;br /&gt;
    &amp;quot;configurations&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;name&amp;quot;: &amp;quot;BBA_LAN&amp;quot;,&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;cppdbg&amp;quot;,&lt;br /&gt;
            &amp;quot;request&amp;quot;: &amp;quot;launch&amp;quot;,&lt;br /&gt;
            &amp;quot;preLaunchTask&amp;quot;: &amp;quot;Build&amp;quot;,&lt;br /&gt;
            &amp;quot;cwd&amp;quot;: &amp;quot;${workspaceFolder}&amp;quot;,&lt;br /&gt;
            &amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/${workspaceFolderBasename}.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/2ndmix.elf&amp;quot;,&lt;br /&gt;
            &amp;quot;MIMode&amp;quot;: &amp;quot;gdb&amp;quot;,&lt;br /&gt;
            &amp;quot;miDebuggerPath&amp;quot;: &amp;quot;/opt/toolchains/dc/sh-elf/bin/sh-elf-gdb&amp;quot;,&lt;br /&gt;
            &amp;quot;miDebuggerServerAddress&amp;quot;:&amp;quot;localhost:2159&amp;quot;,//common misconception: we connect to the gdb server offered by dc-tool-ip, NOT to the Dreamcast directly !&lt;br /&gt;
            &amp;quot;debugServerPath&amp;quot;:&amp;quot;/opt/toolchains/dc/bin/dc-tool-ip&amp;quot;,&lt;br /&gt;
            &amp;quot;debugServerArgs&amp;quot;: &amp;quot;-g -t 192.168.1.210 -x ${workspaceFolder}/${workspaceFolderBasename}.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;debugServerArgs&amp;quot;: &amp;quot;-g -t 192.168.1.210 -x ${workspaceFolder}/2ndmix.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;stopAtEntry&amp;quot;: true,&lt;br /&gt;
            &amp;quot;externalConsole&amp;quot;: false,&lt;br /&gt;
            &amp;quot;avoidWindowsConsoleRedirection&amp;quot;: false,&lt;br /&gt;
            &amp;quot;internalConsoleOptions&amp;quot;: &amp;quot;openOnSessionStart&amp;quot;,&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;name&amp;quot;: &amp;quot;SERIAL&amp;quot;,&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;cppdbg&amp;quot;,&lt;br /&gt;
            &amp;quot;request&amp;quot;: &amp;quot;launch&amp;quot;,&lt;br /&gt;
            &amp;quot;preLaunchTask&amp;quot;: &amp;quot;Build&amp;quot;,&lt;br /&gt;
            &amp;quot;cwd&amp;quot;: &amp;quot;${workspaceFolder}&amp;quot;,&lt;br /&gt;
            &amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/${workspaceFolderBasename}.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/2ndmix.elf&amp;quot;,&lt;br /&gt;
            &amp;quot;MIMode&amp;quot;: &amp;quot;gdb&amp;quot;,&lt;br /&gt;
            &amp;quot;miDebuggerPath&amp;quot;: &amp;quot;/opt/toolchains/dc/sh-elf/bin/sh-elf-gdb&amp;quot;,&lt;br /&gt;
            &amp;quot;miDebuggerServerAddress&amp;quot;:&amp;quot;localhost:2159&amp;quot;,//common misconception: we connect to the gdb server offered by dc-tool-ser, NOT to the Dreamcast directly !&lt;br /&gt;
            &amp;quot;debugServerPath&amp;quot;:&amp;quot;/opt/toolchains/dc/bin/dc-tool-ser&amp;quot;,&lt;br /&gt;
            &amp;quot;debugServerArgs&amp;quot;: &amp;quot;-g -t /dev/ttyS0 -x ${workspaceFolder}/${workspaceFolderBasename}.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;debugServerArgs&amp;quot;: &amp;quot;-g -t /dev/ttyS0 -x ${workspaceFolder}/2ndmix.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;stopAtEntry&amp;quot;: true,&lt;br /&gt;
            &amp;quot;externalConsole&amp;quot;: false,&lt;br /&gt;
            &amp;quot;avoidWindowsConsoleRedirection&amp;quot;: false,&lt;br /&gt;
            &amp;quot;internalConsoleOptions&amp;quot;: &amp;quot;openOnSessionStart&amp;quot;,&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;name&amp;quot;: &amp;quot;LXDream&amp;quot;,&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;cppdbg&amp;quot;,&lt;br /&gt;
            &amp;quot;request&amp;quot;: &amp;quot;launch&amp;quot;,&lt;br /&gt;
            &amp;quot;preLaunchTask&amp;quot;: &amp;quot;Build&amp;quot;,&lt;br /&gt;
            &amp;quot;cwd&amp;quot;: &amp;quot;${workspaceRoot}&amp;quot;,&lt;br /&gt;
            &amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/${workspaceFolderBasename}.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/2ndmix.elf&amp;quot;,&lt;br /&gt;
            &amp;quot;miDebuggerPath&amp;quot;: &amp;quot;/opt/toolchains/dc/sh-elf/bin/sh-elf-gdb&amp;quot;,&lt;br /&gt;
            &amp;quot;setupCommands&amp;quot;: [{&lt;br /&gt;
                &amp;quot;text&amp;quot;: &amp;quot;set architecture sh&amp;quot;,&lt;br /&gt;
                &amp;quot;description&amp;quot;: &amp;quot;Set GDB Arch to SuperH&amp;quot;,&lt;br /&gt;
                &amp;quot;ignoreFailures&amp;quot; : false,&lt;br /&gt;
            }],&lt;br /&gt;
            &amp;quot;miDebuggerServerAddress&amp;quot;: &amp;quot;:9999&amp;quot;,&lt;br /&gt;
            // path to lxdream-nitro&lt;br /&gt;
            &amp;quot;debugServerPath&amp;quot;: &amp;quot;PATH_TO_LXDREAM&amp;quot;,&lt;br /&gt;
            // lxdream-nitro flags&lt;br /&gt;
            &amp;quot;debugServerArgs&amp;quot;: &amp;quot;--log=DEBUG --gdb-sh4=9999 -A null -e ${workspaceRoot}/${workspaceFolderBasename}.elf -n&amp;quot;,&lt;br /&gt;
            //&amp;quot;debugServerArgs&amp;quot;: &amp;quot;--log=DEBUG --gdb-sh4=9999 -A null -e ${workspaceRoot}/2ndmix.elf -n&amp;quot;,&lt;br /&gt;
            &amp;quot;filterStdout&amp;quot;: true,&lt;br /&gt;
            &amp;quot;filterStderr&amp;quot;: true,&lt;br /&gt;
            // run on connect&lt;br /&gt;
            &amp;quot;stopAtConnect&amp;quot;: false,&lt;br /&gt;
            // stop at main&lt;br /&gt;
            &amp;quot;stopAtEntry&amp;quot;: true,&lt;br /&gt;
            &amp;quot;externalConsole&amp;quot;: false,&lt;br /&gt;
            &amp;quot;avoidWindowsConsoleRedirection&amp;quot;: false,&lt;br /&gt;
            &amp;quot;internalConsoleOptions&amp;quot;: &amp;quot;openOnSessionStart&amp;quot;,&lt;br /&gt;
            &amp;quot;launchCompleteCommand&amp;quot;: &amp;quot;exec-run&amp;quot;,&lt;br /&gt;
            &amp;quot;serverStarted&amp;quot;: &amp;quot;SH4 GDB server running on port&amp;quot;,&lt;br /&gt;
            &amp;quot;useExtendedRemote&amp;quot;: true&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that for the 3 launch configurations above, you have 2 lines for &lt;br /&gt;
&amp;quot;program&amp;quot; and &amp;quot;debugServerArgs&amp;quot;, one of which is commented out.&lt;br /&gt;
${workspaceFolderBasename} is the name of your project directory (eg: 2ndmix), and if that matches the name of your target .elf file (eg: 2ndmix.elf), then you can use ${workspaceFolderBasename}.&lt;br /&gt;
If not, you can just use the other line by replacing ${workspaceFolderBasename} with the real .elf filename.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also need to replace &amp;quot;PATH_TO_LXDREAM&amp;quot; with the path to the emulator installed on your pc.&lt;br /&gt;
&lt;br /&gt;
==== Launching a Debug session ====&lt;br /&gt;
{|&lt;br /&gt;
| [[File:Vscode debugging.png|thumb|alt=Vscode debugging|Vscode debugging]]&lt;br /&gt;
|}&lt;br /&gt;
* put a line to initialize gdb in your code (1):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
gdb_init();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
TODO: conditional include&lt;br /&gt;
* insert a breakpoint &#039;&#039;&#039;AFTER&#039;&#039;&#039; this gdb_init(); line (1). You can&#039;t put a breakpoint before or on this line !&lt;br /&gt;
* If want to run it on a real Dreamcast, power it on with the dcload disc loaded, and wait for the blue screen&lt;br /&gt;
* Click on the &amp;quot;Debugger&amp;quot; icon (2) on the left&lt;br /&gt;
* Select the configuration you want to launch (BBA_LAN, SERIAL, or LXDream)(3)&lt;br /&gt;
* Click on the green arrow (&amp;quot;Start Debugging&amp;quot; - F5)(4)&lt;br /&gt;
&lt;br /&gt;
==== Tips ====&lt;br /&gt;
* If you want to print out the value of a variable to the console (Terminal) on the pc, add a line like this to your code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
dbglog(DBG_INFO, &amp;quot;value is: 0x%08X\n&amp;quot;, variable);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting Tips ====&lt;br /&gt;
* If the dc-tool app does not seem to react anymore:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo netstat -ap | grep :2159&lt;br /&gt;
sudo kill &amp;lt;pid&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
[https://forums.sonicretro.org/index.php?threads/setting-up-gdb-with-redream-in-linux.38824/ netstat tip source]&lt;br /&gt;
&lt;br /&gt;
[https://dcemulation.org/phpBB/viewtopic.php?t=105596&amp;amp;start=20 Original VSCode topic on dcemulation.org]&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Visual_Studio_Code&amp;diff=3596</id>
		<title>Visual Studio Code</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Visual_Studio_Code&amp;diff=3596"/>
		<updated>2024-09-06T05:15:29Z</updated>

		<summary type="html">&lt;p&gt;Tchan: change C_Cpp.default.includePath to all the kos include paths specified in environ_dreamcast.sh&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This is a guide to setup your [https://code.visualstudio.com/ Visual Studio Code] project with debugging support on both on a real Dreamcast and with an emulator.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
To start with, this tutorial makes the following assumptions:&lt;br /&gt;
* You have already installed and [https://dreamcast.wiki/Getting_Started_with_Dreamcast_development set up your KallistiOS development environment]]&lt;br /&gt;
# if you want to be able to debug, be sure to compile gdb as specified on that page&lt;br /&gt;
* You have already downloaded and installed [https://code.visualstudio.com/ Visual Studio Code] (version 1.78.2 was used for this tutorial)&lt;br /&gt;
&lt;br /&gt;
== VSCode Setup ==&lt;br /&gt;
* Launch Visual Studio Code&lt;br /&gt;
* (optional but recommended) To keep your configuration settings, plugins, ... specific to Dreamcast projects only:&lt;br /&gt;
# Create a &amp;quot;Profile&amp;quot; (Menu: File-Preferences-Profiles) called &amp;quot;Dreamcast&amp;quot;&lt;br /&gt;
* Install the following extensions: (Menu: View-Extensions)&lt;br /&gt;
# Required:&lt;br /&gt;
## [https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools C/C++] from Microsoft&lt;br /&gt;
# Required only if you are using WSL (Windows Subsystem for Linux):&lt;br /&gt;
## [https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl WSL from Microsoft]&lt;br /&gt;
# (Not recommended at this moment:)&lt;br /&gt;
## ([https://marketplace.visualstudio.com/items?itemName=ms-vscode.makefile-tools Makefile Tools] from Microsoft: the current version (June 2023) is not really adapted for remote debugging)&lt;br /&gt;
&lt;br /&gt;
== Setup per Project ==&lt;br /&gt;
&lt;br /&gt;
=== Compilation ===&lt;br /&gt;
==== Preparation ====&lt;br /&gt;
(all the following steps happen in Visual Studio Code)&lt;br /&gt;
# Open the folder containing your project - eg: /opt/toolchains/dc/kos/examples/dreamcast/2ndmix:&lt;br /&gt;
##If you are using WSL:&lt;br /&gt;
###&amp;quot;F1&amp;quot; - &amp;quot;Connect To WSL&amp;quot;&lt;br /&gt;
##Menu: File-Open Folder...&lt;br /&gt;
# (if you are using Profiles) Make sure that the &amp;quot;Dreamcast&amp;quot; profile is selected (Menu: File-Preferences-Profiles)&lt;br /&gt;
#If you are using WSL, check that the C/C++ extension is correctly installed for WSL - if you get a warning like &amp;quot;install in WSL: Ubuntu&amp;quot;, do so.&lt;br /&gt;
# Create a new subfolder &amp;quot;.vscode&amp;quot;&lt;br /&gt;
# insert the following files in the &#039;&#039;&#039;&amp;quot;.vscode&amp;quot; subfolder&#039;&#039;&#039;:&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;kos_environ.sh&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#set the KOS environtment variables&lt;br /&gt;
source /opt/toolchains/dc/kos/environ.sh&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;kos_make.sh&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
#set the KOS environtment variables&lt;br /&gt;
source /opt/toolchains/dc/kos/environ.sh&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;settings.json&#039;&#039;&#039;&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;C_Cpp.default.includePath&amp;quot;: [&lt;br /&gt;
        &amp;quot;${workspaceFolder}/**&amp;quot;,&lt;br /&gt;
        &amp;quot;/opt/toolchains/dc/kos/include/**&amp;quot;,&lt;br /&gt;
        &amp;quot;/opt/toolchains/dc/kos/kernel/arch/dreamcast/include/**&amp;quot;,&lt;br /&gt;
        &amp;quot;/opt/toolchains/dc/kos/addons/include/**&amp;quot;,&lt;br /&gt;
        &amp;quot;/opt/toolchains/dc/kos-ports/include/**&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;C_Cpp.default.defines&amp;quot;: [&lt;br /&gt;
            &amp;quot;_arch_dreamcast&amp;quot;&lt;br /&gt;
    ],&lt;br /&gt;
    &amp;quot;C_Cpp.default.compilerPath&amp;quot;: &amp;quot;/opt/toolchains/dc/sh-elf/bin/sh-elf-gcc&amp;quot;,&lt;br /&gt;
    &amp;quot;C_Cpp.default.cStandard&amp;quot;: &amp;quot;c11&amp;quot;,&lt;br /&gt;
    &amp;quot;C_Cpp.default.cppStandard&amp;quot;: &amp;quot;c++17&amp;quot;,&lt;br /&gt;
    &amp;quot;C_Cpp.default.intelliSenseMode&amp;quot;: &amp;quot;&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
    &amp;quot;terminal.integrated.defaultProfile.linux&amp;quot;: &amp;quot;kos-bash&amp;quot;,&lt;br /&gt;
    &amp;quot;terminal.integrated.profiles.linux&amp;quot;: {&lt;br /&gt;
        &amp;quot;kos-bash&amp;quot;: {&lt;br /&gt;
            &amp;quot;path&amp;quot;: &amp;quot;/usr/bin/bash&amp;quot;,&lt;br /&gt;
            &amp;quot;args&amp;quot;: [&amp;quot;--init-file&amp;quot;, &amp;quot;${workspaceFolder}/.vscode/kos_environ.sh&amp;quot; ],&lt;br /&gt;
            &amp;quot;overrideName&amp;quot;: true&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
(TODO: to be tested for Mac/OSX: probably needs the 2 lines terminal.integrated.*.linux replaced with terminal.integrated.*.osx)&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;tasks.json&#039;&#039;&#039; &lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;version&amp;quot;: &amp;quot;2.0.0&amp;quot;,&lt;br /&gt;
    &amp;quot;tasks&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;label&amp;quot;: &amp;quot;Build&amp;quot;,&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;process&amp;quot;,&lt;br /&gt;
            &amp;quot;command&amp;quot;: &amp;quot;bash&amp;quot;,&lt;br /&gt;
            &amp;quot;args&amp;quot;: [&lt;br /&gt;
                &amp;quot;--init-file&amp;quot;, &amp;quot;${workspaceFolder}/.vscode/kos_make.sh&amp;quot;&lt;br /&gt;
            ],&lt;br /&gt;
            &amp;quot;group&amp;quot;: {&lt;br /&gt;
                &amp;quot;kind&amp;quot;: &amp;quot;build&amp;quot;,&lt;br /&gt;
                &amp;quot;isDefault&amp;quot;: true&lt;br /&gt;
            },&lt;br /&gt;
        },&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The result should look like this:&lt;br /&gt;
{|&lt;br /&gt;
| [[File:Vscode cfg files.png|thumb]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
At this point, you should be able to compile applications for the Dreamcast!&lt;br /&gt;
&lt;br /&gt;
==== Compilation ====&lt;br /&gt;
You can compile via 2 ways:&lt;br /&gt;
# via the VSCode [https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette Command Palette] - &amp;quot;Tasks: Run Build Task&amp;quot;, or&lt;br /&gt;
# by opening a &amp;quot;kos-bash&amp;quot; terminal (Menu: View-Terminal if not visible yet, then click on the &amp;quot;+&amp;quot; to see the terminals to choose from, and select &amp;quot;kos-bash&amp;quot;), and typing &amp;quot;make&amp;quot;&lt;br /&gt;
In both cases, the compilation should generate an executable file, ending with .elf&lt;br /&gt;
&lt;br /&gt;
Note: &amp;quot;kos-bash&amp;quot; is a bash shell with the &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot; already executed for you. It should be your default shell in VSCode as long as you used the settings.json mentioned above.&lt;br /&gt;
&lt;br /&gt;
==== Running a program ====&lt;br /&gt;
For this, we will use the &amp;quot;make run&amp;quot; command that you can find in many (all?) Makefiles of the KallistiOs project, to send and run the program on a real dreamcast:&lt;br /&gt;
&lt;br /&gt;
* Typically, one of the following tools is used to run a program for the Dreamcast:&lt;br /&gt;
# on a real Dreamcast:&lt;br /&gt;
##via an ethernet cable &amp;amp; a [https://dreamcast.wiki/Broadband_adapter Broadband] (BBA) or [https://dreamcast.wiki/LAN_adapter LAN] adapter: &#039;&#039;&#039;[https://dreamcast.wiki/Dcload-ip dcload-ip]&#039;&#039;&#039;&lt;br /&gt;
## via a [https://dreamcast.wiki/Coder%27s_cable coder&#039;s cable] &amp;amp; the serial port of the Dreamcast: &#039;&#039;&#039;[https://dreamcast.wiki/Dcload-serial dcload-serial]&#039;&#039;&#039;&lt;br /&gt;
# on an emulator, like lxdream-nitro&lt;br /&gt;
&lt;br /&gt;
* Make sure that the &#039;&#039;&#039;KOS_LOADER&#039;&#039;&#039; variable in &#039;&#039;&#039;/opt/toolchains/dc/kos/environ.sh&#039;&#039;&#039; is configured correctly:&lt;br /&gt;
&lt;br /&gt;
# for &#039;&#039;&#039;dcload-ip&#039;&#039;&#039; (example if the IP of the Dreamcast is 192.168.1.210):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export KOS_LOADER=&amp;quot;dc-tool-ip -t 192.168.1.210 -x&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# for &#039;&#039;&#039;dcload-serial&#039;&#039;&#039; (example if the Dreamcast is on serial port /dev/ttyS0):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export KOS_LOADER=&amp;quot;dc-tool-ser -t /dev/ttyS0 -x&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
# for &#039;&#039;&#039;the emulator&#039;&#039;&#039; (example with lxdream-nitro):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
export KOS_LOADER=&amp;quot;/opt/toolchains/dc/lxdream-nitro/builddir/lxdream-nitro -e&amp;quot;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* If want to run it on a real Dreamcast, power it on with the dcload disc loaded, and wait for the blue screen&lt;br /&gt;
* Open a &amp;quot;kos-bash&amp;quot; terminal, and type: make run&lt;br /&gt;
* The program will be running on your Dreamcast or on the emulator !&lt;br /&gt;
* (If you ran the 2ndmix example, you can press the START button on the Dreamcast pad to exit)&lt;br /&gt;
* Note: be sure to not have a gdb_init(); line added in your code when you only want to run a program &amp;amp; not debug it.&lt;br /&gt;
&lt;br /&gt;
=== Debugging ===&lt;br /&gt;
==== Preparation ====&lt;br /&gt;
* Make sure that you compiled gdb for the Dreamcast, ie &#039;&#039;&#039;/opt/toolchains/dc/sh-elf/bin/sh-elf-gdb&#039;&#039;&#039; should exist (cfr prerequisites)&lt;br /&gt;
* Debugging in Visual Studio Code is configured in a &#039;&#039;&#039;.vscode/launch.json&#039;&#039;&#039; file. You can add as many debugging configurations as you want inside that launch.json file, eg 1 for debugging on a dreamcast, 1 for debugging on an emulator, ...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# insert the following files in the &#039;&#039;&#039;&amp;quot;.vscode&amp;quot; subfolder&#039;&#039;&#039;: &lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;launch.json&#039;&#039;&#039; (example with the IP of the Dreamcast = 192.168.1.210 for the BBA/LAN or /dev/ttyS0 for the serial cable):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
    &amp;quot;version&amp;quot;: &amp;quot;0.2.0&amp;quot;,&lt;br /&gt;
    &amp;quot;configurations&amp;quot;: [&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;name&amp;quot;: &amp;quot;BBA_LAN&amp;quot;,&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;cppdbg&amp;quot;,&lt;br /&gt;
            &amp;quot;request&amp;quot;: &amp;quot;launch&amp;quot;,&lt;br /&gt;
            &amp;quot;preLaunchTask&amp;quot;: &amp;quot;Build&amp;quot;,&lt;br /&gt;
            &amp;quot;cwd&amp;quot;: &amp;quot;${workspaceFolder}&amp;quot;,&lt;br /&gt;
            &amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/${workspaceFolderBasename}.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/2ndmix.elf&amp;quot;,&lt;br /&gt;
            &amp;quot;MIMode&amp;quot;: &amp;quot;gdb&amp;quot;,&lt;br /&gt;
            &amp;quot;miDebuggerPath&amp;quot;: &amp;quot;/opt/toolchains/dc/sh-elf/bin/sh-elf-gdb&amp;quot;,&lt;br /&gt;
            &amp;quot;miDebuggerServerAddress&amp;quot;:&amp;quot;localhost:2159&amp;quot;,//common misconception: we connect to the gdb server offered by dc-tool-ip, NOT to the Dreamcast directly !&lt;br /&gt;
            &amp;quot;debugServerPath&amp;quot;:&amp;quot;/opt/toolchains/dc/bin/dc-tool-ip&amp;quot;,&lt;br /&gt;
            &amp;quot;debugServerArgs&amp;quot;: &amp;quot;-g -t 192.168.1.210 -x ${workspaceFolder}/${workspaceFolderBasename}.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;debugServerArgs&amp;quot;: &amp;quot;-g -t 192.168.1.210 -x ${workspaceFolder}/2ndmix.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;stopAtEntry&amp;quot;: true,&lt;br /&gt;
            &amp;quot;externalConsole&amp;quot;: false,&lt;br /&gt;
            &amp;quot;avoidWindowsConsoleRedirection&amp;quot;: false,&lt;br /&gt;
            &amp;quot;internalConsoleOptions&amp;quot;: &amp;quot;openOnSessionStart&amp;quot;,&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;name&amp;quot;: &amp;quot;SERIAL&amp;quot;,&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;cppdbg&amp;quot;,&lt;br /&gt;
            &amp;quot;request&amp;quot;: &amp;quot;launch&amp;quot;,&lt;br /&gt;
            &amp;quot;preLaunchTask&amp;quot;: &amp;quot;Build&amp;quot;,&lt;br /&gt;
            &amp;quot;cwd&amp;quot;: &amp;quot;${workspaceFolder}&amp;quot;,&lt;br /&gt;
            &amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/${workspaceFolderBasename}.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/2ndmix.elf&amp;quot;,&lt;br /&gt;
            &amp;quot;MIMode&amp;quot;: &amp;quot;gdb&amp;quot;,&lt;br /&gt;
            &amp;quot;miDebuggerPath&amp;quot;: &amp;quot;/opt/toolchains/dc/sh-elf/bin/sh-elf-gdb&amp;quot;,&lt;br /&gt;
            &amp;quot;miDebuggerServerAddress&amp;quot;:&amp;quot;localhost:2159&amp;quot;,//common misconception: we connect to the gdb server offered by dc-tool-ser, NOT to the Dreamcast directly !&lt;br /&gt;
            &amp;quot;debugServerPath&amp;quot;:&amp;quot;/opt/toolchains/dc/bin/dc-tool-ser&amp;quot;,&lt;br /&gt;
            &amp;quot;debugServerArgs&amp;quot;: &amp;quot;-g -t /dev/ttyS0 -x ${workspaceFolder}/${workspaceFolderBasename}.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;debugServerArgs&amp;quot;: &amp;quot;-g -t /dev/ttyS0 -x ${workspaceFolder}/2ndmix.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;stopAtEntry&amp;quot;: true,&lt;br /&gt;
            &amp;quot;externalConsole&amp;quot;: false,&lt;br /&gt;
            &amp;quot;avoidWindowsConsoleRedirection&amp;quot;: false,&lt;br /&gt;
            &amp;quot;internalConsoleOptions&amp;quot;: &amp;quot;openOnSessionStart&amp;quot;,&lt;br /&gt;
        },&lt;br /&gt;
        {&lt;br /&gt;
            &amp;quot;name&amp;quot;: &amp;quot;LXDream&amp;quot;,&lt;br /&gt;
            &amp;quot;type&amp;quot;: &amp;quot;cppdbg&amp;quot;,&lt;br /&gt;
            &amp;quot;request&amp;quot;: &amp;quot;launch&amp;quot;,&lt;br /&gt;
            &amp;quot;preLaunchTask&amp;quot;: &amp;quot;Build&amp;quot;,&lt;br /&gt;
            &amp;quot;cwd&amp;quot;: &amp;quot;${workspaceRoot}&amp;quot;,&lt;br /&gt;
            &amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/${workspaceFolderBasename}.elf&amp;quot;,&lt;br /&gt;
            //&amp;quot;program&amp;quot;: &amp;quot;${workspaceFolder}/2ndmix.elf&amp;quot;,&lt;br /&gt;
            &amp;quot;miDebuggerPath&amp;quot;: &amp;quot;/opt/toolchains/dc/sh-elf/bin/sh-elf-gdb&amp;quot;,&lt;br /&gt;
            &amp;quot;setupCommands&amp;quot;: [{&lt;br /&gt;
                &amp;quot;text&amp;quot;: &amp;quot;set architecture sh&amp;quot;,&lt;br /&gt;
                &amp;quot;description&amp;quot;: &amp;quot;Set GDB Arch to SuperH&amp;quot;,&lt;br /&gt;
                &amp;quot;ignoreFailures&amp;quot; : false,&lt;br /&gt;
            }],&lt;br /&gt;
            &amp;quot;miDebuggerServerAddress&amp;quot;: &amp;quot;:9999&amp;quot;,&lt;br /&gt;
            // path to lxdream-nitro&lt;br /&gt;
            &amp;quot;debugServerPath&amp;quot;: &amp;quot;PATH_TO_LXDREAM&amp;quot;,&lt;br /&gt;
            // lxdream-nitro flags&lt;br /&gt;
            &amp;quot;debugServerArgs&amp;quot;: &amp;quot;--log=DEBUG --gdb-sh4=9999 -A null -e ${workspaceRoot}/${workspaceFolderBasename}.elf -n&amp;quot;,&lt;br /&gt;
            //&amp;quot;debugServerArgs&amp;quot;: &amp;quot;--log=DEBUG --gdb-sh4=9999 -A null -e ${workspaceRoot}/2ndmix.elf -n&amp;quot;,&lt;br /&gt;
            &amp;quot;filterStdout&amp;quot;: true,&lt;br /&gt;
            &amp;quot;filterStderr&amp;quot;: true,&lt;br /&gt;
            // run on connect&lt;br /&gt;
            &amp;quot;stopAtConnect&amp;quot;: false,&lt;br /&gt;
            // stop at main&lt;br /&gt;
            &amp;quot;stopAtEntry&amp;quot;: true,&lt;br /&gt;
            &amp;quot;externalConsole&amp;quot;: false,&lt;br /&gt;
            &amp;quot;avoidWindowsConsoleRedirection&amp;quot;: false,&lt;br /&gt;
            &amp;quot;internalConsoleOptions&amp;quot;: &amp;quot;openOnSessionStart&amp;quot;,&lt;br /&gt;
            &amp;quot;launchCompleteCommand&amp;quot;: &amp;quot;exec-run&amp;quot;,&lt;br /&gt;
            &amp;quot;serverStarted&amp;quot;: &amp;quot;SH4 GDB server running on port&amp;quot;,&lt;br /&gt;
            &amp;quot;useExtendedRemote&amp;quot;: true&lt;br /&gt;
        }&lt;br /&gt;
    ]&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that for the 3 launch configurations above, you have 2 lines for &lt;br /&gt;
&amp;quot;program&amp;quot; and &amp;quot;debugServerArgs&amp;quot;, one of which is commented out.&lt;br /&gt;
${workspaceFolderBasename} is the name of your project directory (eg: 2ndmix), and if that matches the name of your target .elf file (eg: 2ndmix.elf), then you can use ${workspaceFolderBasename}.&lt;br /&gt;
If not, you can just use the other line by replacing ${workspaceFolderBasename} with the real .elf filename.&lt;br /&gt;
&lt;br /&gt;
You&#039;ll also need to replace &amp;quot;PATH_TO_LXDREAM&amp;quot; with the path to the emulator installed on your pc.&lt;br /&gt;
&lt;br /&gt;
==== Launching a Debug session ====&lt;br /&gt;
{|&lt;br /&gt;
| [[File:Vscode debugging.png|thumb|alt=Vscode debugging|Vscode debugging]]&lt;br /&gt;
|}&lt;br /&gt;
* put a line to initialize gdb in your code (1):&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
gdb_init();&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
TODO: conditional include&lt;br /&gt;
* insert a breakpoint &#039;&#039;&#039;AFTER&#039;&#039;&#039; this gdb_init(); line (1). You can&#039;t put a breakpoint before or on this line !&lt;br /&gt;
* If want to run it on a real Dreamcast, power it on with the dcload disc loaded, and wait for the blue screen&lt;br /&gt;
* Click on the &amp;quot;Debugger&amp;quot; icon (2) on the left&lt;br /&gt;
* Select the configuration you want to launch (BBA_LAN, SERIAL, or LXDream)(3)&lt;br /&gt;
* Click on the green arrow (&amp;quot;Start Debugging&amp;quot; - F5)(4)&lt;br /&gt;
&lt;br /&gt;
==== Tips ====&lt;br /&gt;
* If you want to print out the value of a variable to the console (Terminal) on the pc, add a line like this to your code:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
dbglog(DBG_INFO, &amp;quot;value is: 0x%08X\n&amp;quot;, variable);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Troubleshooting Tips ====&lt;br /&gt;
* If the dc-tool app does not seem to react anymore:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
sudo netstat -ap | grep :2159&lt;br /&gt;
sudo kill &amp;lt;pid&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Sources ==&lt;br /&gt;
[https://forums.sonicretro.org/index.php?threads/setting-up-gdb-with-redream-in-linux.38824/ netstat tip source]&lt;br /&gt;
&lt;br /&gt;
[https://dcemulation.org/phpBB/viewtopic.php?t=105596&amp;amp;start=20 Original VSCode topic on dcemulation.org]&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3588</id>
		<title>Codespaces</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3588"/>
		<updated>2024-07-15T18:19:24Z</updated>

		<summary type="html">&lt;p&gt;Tchan: /* Example 1: Build an .elf from a KallistiOS example */ forcing  the image to display at the right place&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Github [https://www.youtube.com/watch?v=sYJ3CHtT6WM Codespaces] lets you spawn a complete Dreamcast development environment in your browser in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
The only things you need are:&lt;br /&gt;
* a browser&lt;br /&gt;
* a github login.&lt;br /&gt;
&lt;br /&gt;
No need for a complex installation process anymore !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Steps Overview ==&lt;br /&gt;
The main steps to get a Codespace working, are:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Create your code repository, or fork one&lt;br /&gt;
* Add a .devcontainer/devcontainer.json file to that repository&lt;br /&gt;
* Create &amp;amp; launch your codespace, and enjoy the IDE in your browser !&lt;br /&gt;
&lt;br /&gt;
That&#039;s all there is to it.&lt;br /&gt;
&lt;br /&gt;
Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].&lt;br /&gt;
&lt;br /&gt;
== Example 1: Build an .elf from a KallistiOS example ==&lt;br /&gt;
To compile the executable .elf file from a KallistiOS examples in a Codespace:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]&lt;br /&gt;
* Click on the &amp;quot;Fork&amp;quot; button, this will create a KallistiOS repository inside your account&lt;br /&gt;
* Click on the &amp;quot;Add File&amp;quot; button, then &amp;quot;Create New File&amp;quot;&lt;br /&gt;
* Name the file: &amp;quot;.devcontainer/devcontainer.json&amp;quot;, and paste the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	//&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	//    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	//},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Click on &amp;quot;Commit changes&amp;quot;, then &amp;quot;Commit Changes&amp;quot; again to save the file&lt;br /&gt;
* Go back to the root directory of your repository&lt;br /&gt;
* Launch your Codespace by clicking on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot; - &amp;quot;Create codespace on master&amp;quot;.&lt;br /&gt;
{|&lt;br /&gt;
|[[File:Screen Shot 2024-07-14 at 8.28.13 AM.png|thumb]]&lt;br /&gt;
|}&lt;br /&gt;
* This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.&lt;br /&gt;
* 3-bars-Menu at the top left - Terminal - New Terminal&lt;br /&gt;
* cd examples/dreamcast/2ndmix&lt;br /&gt;
* make clean&lt;br /&gt;
* make&lt;br /&gt;
* You should now have a &amp;quot;2ndmix.elf&amp;quot; in that folder&lt;br /&gt;
* Navigate to that folder (examples/dreamcast/2ndmix) on the file tree on the left, right-click on the file, and choose &amp;quot;Download...&amp;quot;&lt;br /&gt;
* Congratulations ! You successfully built an executable file for the Dreamcast. You can now upload that file in your favorite emulator, or send it to a real Dreamcast via a [https://dreamcast.wiki/Coder%27s_cable Coder&#039;s Cable] or a [https://dreamcast.wiki/Broadband_adapter Broadband Adapter]&lt;br /&gt;
&lt;br /&gt;
== Example 2: create a .cdi from the .elf of Example 1 ==&lt;br /&gt;
Having an .elf executable file is nice for small tests, but often you&#039;ll find yourself needing to build a .cdi disc image file:&lt;br /&gt;
* If you closed your codespace, you can reopen it by going to your code repository, click on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot;, then on the auto-generated name of your codespace.&lt;br /&gt;
* Since our codespace does not contain mkdcdisc (the tool to build .cdi files), we&#039;ll add that to our codespace:&lt;br /&gt;
** Open a terminal in your codespace (3-bars-Menu at the top left - Terminal - New Terminal)&lt;br /&gt;
** cd /opt/toolchains/dc&lt;br /&gt;
** git clone https://gitlab.com/simulant/mkdcdisc&lt;br /&gt;
** cd mkdcdisc&lt;br /&gt;
** meson setup builddir&lt;br /&gt;
** meson compile -C builddir&lt;br /&gt;
** cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
* Build the .cdi file for 2ndmix.elf&lt;br /&gt;
** cd /opt/toolchains/dc/kos/examples/dreamcast/2ndmix&lt;br /&gt;
** mkdcdisc -e 2ndmix.elf -o 2ndmix.cdi -n &amp;quot;2ndmix&amp;quot;&lt;br /&gt;
* Compress the .cdi file into a zip file with parts of max 25 MegaBytes (otherwise your browser will have problems downloading the .cdi):&lt;br /&gt;
** zip -s 25M 2ndmix.zip 2ndmix.cdi&lt;br /&gt;
* Right-click on the generated files, and download them into your local folders&lt;br /&gt;
* Unzip the files in your local folder to reconstruct 2ndmix.cdi&lt;br /&gt;
* Launch 2ndmix.cdi in your favorite emulator, or on a real Dreamcast&lt;br /&gt;
&lt;br /&gt;
== Example 3: Configuring a more complex Codespace ==&lt;br /&gt;
If you find yourself always adding the same extra application into the codespace provided in Example 1 (eg: always having to add mkdcdisc, ...), you can simplify your setup by specifying your own Dockerfile, and add setup commands in there:&lt;br /&gt;
&lt;br /&gt;
* Modify .devcontainer/devcontainer.json so that it points to a Dockerfile:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	//&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ... and add a new file: ./devcontainer/Dockerfile&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Stage 1&lt;br /&gt;
FROM &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot; as build&lt;br /&gt;
&lt;br /&gt;
# Add mkdcdisc&lt;br /&gt;
RUN git clone https://gitlab.com/simulant/mkdcdisc /opt/toolchains/dc/mkdcdisc \&lt;br /&gt;
    &amp;amp;&amp;amp; cd /opt/toolchains/dc/mkdcdisc \&lt;br /&gt;
    &amp;amp;&amp;amp; meson setup builddir \&lt;br /&gt;
    &amp;amp;&amp;amp; meson compile -C builddir \&lt;br /&gt;
    &amp;amp;&amp;amp; cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* The next time you create a repository &amp;amp; copy the above 2 files in it, you will get a codespace with mkdcdisc already correctly installed !&lt;br /&gt;
&lt;br /&gt;
== Example 4: Build something not from KallistiOS ==&lt;br /&gt;
All the previous examples started by forking the KallistiOS repository, but most often you&#039;ll just want to work on your own code / another Dreamcast project, so you&#039;ll work from a repository other than KallistiOS:&lt;br /&gt;
* login into [https://www.github.com github]&lt;br /&gt;
* create/go to your own repository, or fork an existing project (eg doom64-dc, ...)&lt;br /&gt;
* add at least ./devcontainer/devcontainer.json, and ./devcontainer/Dockerfile if needed&lt;br /&gt;
* create/launch your codespace&lt;br /&gt;
* follow the build instructions of that project&lt;br /&gt;
* Notes:&lt;br /&gt;
** Everything for KallistiOS should be available in the terminal, you&#039;ll find KallistiOS stuff in the folder /opt/toolchains/dc&lt;br /&gt;
** In the file-tree on the left side, you&#039;ll see the files of your repository (folder: /workspaces). If you also want to add other folders there, eg /opt/toolchains/dc, execute something like this in the terminal: code -a /opt/toolchains/dc&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
* When you&#039;re finished with your Codespace, go to &lt;br /&gt;
** the 3-bars-Menu at the top left - &amp;quot;My Codespaces&amp;quot;&lt;br /&gt;
** on the left, select the codespace you were just running&lt;br /&gt;
** click on the 3 dots next to &amp;quot;Active&amp;quot;&lt;br /&gt;
** select &amp;quot;Stop codespace&amp;quot;&lt;br /&gt;
Doing this pro-actively will save you some free minutes, since the default timeout is 30 minutes.&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Docker_images&amp;diff=3585</id>
		<title>Docker images</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Docker_images&amp;diff=3585"/>
		<updated>2024-07-14T08:03:37Z</updated>

		<summary type="html">&lt;p&gt;Tchan: /* Community premade docker image */ added Colton&amp;#039;s images, marked other ones to as older&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Community premade docker image ==&lt;br /&gt;
* Newer images&lt;br /&gt;
** [https://github.com/orgs/kos-builds/packages?repo_name=KallistiOS Colton&#039;s kos-builds] - Colton&#039;s automated generation of KallistiOS images&lt;br /&gt;
* Older images&lt;br /&gt;
** [https://github.com/mrneo240/nu-dc_kos nu-dc_kos] - Contains the toolchaine + kos + some extra dev tools. Check the github&#039;s readme for usage.&lt;br /&gt;
** [https://github.com/mrneo240/nu-dcdev nu-dcdev] - Contains the toolchain + kos. Check the github&#039;s readme for usage.&lt;br /&gt;
** [https://hub.docker.com/orgs/segadreamcast/repositories segadreamcast/toolchains] - [[User:SiZiOUS|SiZiOUS]] updated toolchain (gcc5.2 and gcc9)&lt;br /&gt;
** [https://github.com/einsteinx2/docker-dcdev einsteinx2 toolchain] - [[User:Einsteinx2|einsteinx2]] updated (GCC 9.3 and GCC 4.7.4) toolchains&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Development&amp;diff=3584</id>
		<title>Development</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Development&amp;diff=3584"/>
		<updated>2024-07-14T08:00:59Z</updated>

		<summary type="html">&lt;p&gt;Tchan: /* Ready-to-use environments */ added Codespaces&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Getting started ===&lt;br /&gt;
* [[Getting Started with Dreamcast development]] -- start here!&lt;br /&gt;
====Ready-to-use environments====&lt;br /&gt;
* [[Codespaces]] (Browser-based development)&lt;br /&gt;
* [[Docker images]]&lt;br /&gt;
* [[DreamSDK]] (Windows only)&lt;br /&gt;
&lt;br /&gt;
====[[KallistiOS]]====&lt;br /&gt;
* Building on Linux, macOS, Windows Subsystem for Linux&lt;br /&gt;
** see [[Getting Started with Dreamcast development|&#039;&#039;Getting Started with Dreamcast development&#039;&#039;]]&lt;br /&gt;
* [[Building KOS on Cygwin]]&lt;br /&gt;
* [[Building KOS on MinGW/MSYS]]&lt;br /&gt;
* [[Building KOS on MinGW-w64/MSYS2]]&lt;br /&gt;
* [https://kos-docs.dreamcast.wiki/ KallistiOS Doxygen documentation]&lt;br /&gt;
&lt;br /&gt;
====Other====&lt;br /&gt;
* [[Using Ruby for Sega Dreamcast development]] (experimental)&lt;br /&gt;
* [[Compiling for Naomi]]&lt;br /&gt;
&lt;br /&gt;
=== Build &amp;amp; test ===&lt;br /&gt;
* [[Building your project]]&lt;br /&gt;
* [[Emulators]]&lt;br /&gt;
* [[Broadband adapter]] / [[LAN adapter]]&lt;br /&gt;
** [[Using dcload-ip with Linux]]&lt;br /&gt;
** [[Using dcload-ip with Windows Subsystem for Linux|Using dcload-ip with Windows 10]] (via Windows Subsystem for Linux)&lt;br /&gt;
* [[Coder&#039;s cable]]&lt;br /&gt;
&lt;br /&gt;
=== Environments and IDEs ===&lt;br /&gt;
* [[Qt Creator Dreamcast Development Environment]]&lt;br /&gt;
* [[CLion Debugging]]&lt;br /&gt;
* [[Visual Studio Code]]&lt;br /&gt;
&lt;br /&gt;
=== Tools &amp;amp; utilities ===&lt;br /&gt;
* [[Debugging throught GNU Debugger (GDB) and dcload/dc-tool]]&lt;br /&gt;
* [[Using dcprof]]&lt;br /&gt;
&lt;br /&gt;
=== Releasing your project ===&lt;br /&gt;
* Plain files&lt;br /&gt;
* Disc image&lt;br /&gt;
* Selfboot Inducer package&lt;br /&gt;
&lt;br /&gt;
=== Engines ===&lt;br /&gt;
&#039;&#039;See&#039;&#039; [[Engine &amp;amp; Library]]&lt;br /&gt;
&lt;br /&gt;
=== General ===&lt;br /&gt;
* [[Filesystem]]&lt;br /&gt;
* [[Store Queues]]&lt;br /&gt;
* [[Romdisk Swapping]]&lt;br /&gt;
* [https://mc.pp.se/dc/hw.html Marcus Comstedt&#039;s Dreamcast Hardware Reference]&lt;br /&gt;
&lt;br /&gt;
=== Graphics ===&lt;br /&gt;
* [[Texture Formats]]&lt;br /&gt;
* [[Graphics APIs]]&lt;br /&gt;
* [[Paletted Textures]]&lt;br /&gt;
* [[2D Rendering Without PVR]]&lt;br /&gt;
* [[Twiddling]]&lt;br /&gt;
&lt;br /&gt;
* PVR&lt;br /&gt;
** [[PowerVR Introduction]]&lt;br /&gt;
** [[PVR Spritesheets]]&lt;br /&gt;
* [[GLdc]]&lt;br /&gt;
** [[Drawing 2D sprites using GLdc]]&lt;br /&gt;
** [[Drawing 3D shapes using GLdc]]&lt;br /&gt;
** [https://hkowsoftware.com/articles/gldc-vertex-formats-from-vec3f-to-fastpath-to-map_buffer/ GLdc Vertex Formats: From vec3f to fastpath to map_buffer]&lt;br /&gt;
* Others&lt;br /&gt;
** [http://www.numechanix.com/blog/index.php/2015/10/03/20/ Procedural texture]&lt;br /&gt;
** [[Notes on fillrate and drawing large textures]]&lt;br /&gt;
** [[KMG Textures]]&lt;br /&gt;
** [[Loading PNG images as OpenGL textures]]&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* [[Playing SFX]]&lt;br /&gt;
* [[Streaming audio]]&lt;br /&gt;
&lt;br /&gt;
=== Maple ===&lt;br /&gt;
* Controller input&lt;br /&gt;
&lt;br /&gt;
=== VMU ===&lt;br /&gt;
* [[File Types]]&lt;br /&gt;
* [[Save/Load file]]&lt;br /&gt;
* [[Show icon]]&lt;br /&gt;
* [[Play tone]]&lt;br /&gt;
* [[VMU_development|Game Development]]&lt;br /&gt;
&lt;br /&gt;
=== Optimization ===&lt;br /&gt;
* [[GCC-SH4 tips]]&lt;br /&gt;
* [[SH4 in Compiler Explorer]]&lt;br /&gt;
* [[Fast SH4 Vertex Processing]]&lt;br /&gt;
* [[Useful programming tips]]&lt;br /&gt;
* [[Efficient usage of the Dreamcast RAM]]&lt;br /&gt;
* Registers&lt;br /&gt;
* DMA&lt;br /&gt;
* TA&lt;br /&gt;
* PVR&lt;br /&gt;
=== Website Development ===&lt;br /&gt;
*[[Development Resources]]&lt;br /&gt;
&lt;br /&gt;
=== Random Snippets ===&lt;br /&gt;
* [[Objdump]]&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3583</id>
		<title>Codespaces</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3583"/>
		<updated>2024-07-14T07:58:37Z</updated>

		<summary type="html">&lt;p&gt;Tchan: writing Example 4&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Github [https://www.youtube.com/watch?v=sYJ3CHtT6WM Codespaces] lets you spawn a complete Dreamcast development environment in your browser in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
The only things you need are:&lt;br /&gt;
* a browser&lt;br /&gt;
* a github login.&lt;br /&gt;
&lt;br /&gt;
No need for a complex installation process anymore !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Steps Overview ==&lt;br /&gt;
The main steps to get a Codespace working, are:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Create your code repository, or fork one&lt;br /&gt;
* Add a .devcontainer/devcontainer.json file to that repository&lt;br /&gt;
* Create &amp;amp; launch your codespace, and enjoy the IDE in your browser !&lt;br /&gt;
&lt;br /&gt;
That&#039;s all there is to it.&lt;br /&gt;
&lt;br /&gt;
Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].&lt;br /&gt;
&lt;br /&gt;
== Example 1: Build an .elf from a KallistiOS example ==&lt;br /&gt;
To compile the executable .elf file from a KallistiOS examples in a Codespace:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]&lt;br /&gt;
* Click on the &amp;quot;Fork&amp;quot; button, this will create a KallistiOS repository inside your account&lt;br /&gt;
* Click on the &amp;quot;Add File&amp;quot; button, then &amp;quot;Create New File&amp;quot;&lt;br /&gt;
* Name the file: &amp;quot;.devcontainer/devcontainer.json&amp;quot;, and paste the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	//&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	//    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	//},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Click on &amp;quot;Commit changes&amp;quot;, then &amp;quot;Commit Changes&amp;quot; again to save the file&lt;br /&gt;
* Go back to the root directory of your repository&lt;br /&gt;
* Launch your Codespace by clicking on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot; - &amp;quot;Create codespace on master&amp;quot;.&lt;br /&gt;
* This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.&lt;br /&gt;
* 3-bars-Menu at the top left - Terminal - New Terminal&lt;br /&gt;
* cd examples/dreamcast/2ndmix&lt;br /&gt;
* make clean&lt;br /&gt;
* make&lt;br /&gt;
* You should now have a &amp;quot;2ndmix.elf&amp;quot; in that folder&lt;br /&gt;
* Navigate to that folder (examples/dreamcast/2ndmix) on the file tree on the left, right-click on the file, and choose &amp;quot;Download...&amp;quot;&lt;br /&gt;
* Congratulations ! You successfully built an executable file for the Dreamcast. You can now upload that file in your favorite emulator, or send it to a real Dreamcast via a [https://dreamcast.wiki/Coder%27s_cable Coder&#039;s Cable] or a [https://dreamcast.wiki/Broadband_adapter Broadband Adapter]&lt;br /&gt;
&lt;br /&gt;
== Example 2: create a .cdi from the .elf of Example 1 ==&lt;br /&gt;
Having an .elf executable file is nice for small tests, but often you&#039;ll find yourself needing to build a .cdi disc image file:&lt;br /&gt;
* If you closed your codespace, you can reopen it by going to your code repository, click on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot;, then on the auto-generated name of your codespace.&lt;br /&gt;
* Since our codespace does not contain mkdcdisc (the tool to build .cdi files), we&#039;ll add that to our codespace:&lt;br /&gt;
** Open a terminal in your codespace (3-bars-Menu at the top left - Terminal - New Terminal)&lt;br /&gt;
** cd /opt/toolchains/dc&lt;br /&gt;
** git clone https://gitlab.com/simulant/mkdcdisc&lt;br /&gt;
** cd mkdcdisc&lt;br /&gt;
** meson setup builddir&lt;br /&gt;
** meson compile -C builddir&lt;br /&gt;
** cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
* Build the .cdi file for 2ndmix.elf&lt;br /&gt;
** cd /opt/toolchains/dc/kos/examples/dreamcast/2ndmix&lt;br /&gt;
** mkdcdisc -e 2ndmix.elf -o 2ndmix.cdi -n &amp;quot;2ndmix&amp;quot;&lt;br /&gt;
* Compress the .cdi file into a zip file with parts of max 25 MegaBytes (otherwise your browser will have problems downloading the .cdi):&lt;br /&gt;
** zip -s 25M 2ndmix.zip 2ndmix.cdi&lt;br /&gt;
* Right-click on the generated files, and download them into your local folders&lt;br /&gt;
* Unzip the files in your local folder to reconstruct 2ndmix.cdi&lt;br /&gt;
* Launch 2ndmix.cdi in your favorite emulator, or on a real Dreamcast&lt;br /&gt;
&lt;br /&gt;
== Example 3: Configuring a more complex Codespace ==&lt;br /&gt;
If you find yourself always adding the same extra application into the codespace provided in Example 1 (eg: always having to add mkdcdisc, ...), you can simplify your setup by specifying your own Dockerfile, and add setup commands in there:&lt;br /&gt;
&lt;br /&gt;
* Modify .devcontainer/devcontainer.json so that it points to a Dockerfile:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	//&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ... and add a new file: ./devcontainer/Dockerfile&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Stage 1&lt;br /&gt;
FROM &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot; as build&lt;br /&gt;
&lt;br /&gt;
# Add mkdcdisc&lt;br /&gt;
RUN git clone https://gitlab.com/simulant/mkdcdisc /opt/toolchains/dc/mkdcdisc \&lt;br /&gt;
    &amp;amp;&amp;amp; cd /opt/toolchains/dc/mkdcdisc \&lt;br /&gt;
    &amp;amp;&amp;amp; meson setup builddir \&lt;br /&gt;
    &amp;amp;&amp;amp; meson compile -C builddir \&lt;br /&gt;
    &amp;amp;&amp;amp; cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* The next time you create a repository &amp;amp; copy the above 2 files in it, you will get a codespace with mkdcdisc already correctly installed !&lt;br /&gt;
&lt;br /&gt;
== Example 4: Build something not from KallistiOS ==&lt;br /&gt;
All the previous examples started by forking the KallistiOS repository, but most often you&#039;ll just want to work on your own code / another Dreamcast project, so you&#039;ll work from a repository other than KallistiOS:&lt;br /&gt;
* login into [https://www.github.com github]&lt;br /&gt;
* create/go to your own repository, or fork an existing project (eg doom64-dc, ...)&lt;br /&gt;
* add at least ./devcontainer/devcontainer.json, and ./devcontainer/Dockerfile if needed&lt;br /&gt;
* create/launch your codespace&lt;br /&gt;
* follow the build instructions of that project&lt;br /&gt;
* Notes:&lt;br /&gt;
** Everything for KallistiOS should be available in the terminal, you&#039;ll find KallistiOS stuff in the folder /opt/toolchains/dc&lt;br /&gt;
** In the file-tree on the left side, you&#039;ll see the files of your repository (folder: /workspaces). If you also want to add other folders there, eg /opt/toolchains/dc, execute something like this in the terminal: code -a /opt/toolchains/dc&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
* When you&#039;re finished with your Codespace, go to &lt;br /&gt;
** the 3-bars-Menu at the top left - &amp;quot;My Codespaces&amp;quot;&lt;br /&gt;
** on the left, select the codespace you were just running&lt;br /&gt;
** click on the 3 dots next to &amp;quot;Active&amp;quot;&lt;br /&gt;
** select &amp;quot;Stop codespace&amp;quot;&lt;br /&gt;
Doing this pro-actively will save you some free minutes, since the default timeout is 30 minutes.&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3582</id>
		<title>Codespaces</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3582"/>
		<updated>2024-07-14T07:18:09Z</updated>

		<summary type="html">&lt;p&gt;Tchan: Example 3: fix cd /opt/toolchains/dc/mkdcdisc&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Github [https://www.youtube.com/watch?v=sYJ3CHtT6WM Codespaces] lets you spawn a complete Dreamcast development environment in your browser in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
The only things you need are:&lt;br /&gt;
* a browser&lt;br /&gt;
* a github login.&lt;br /&gt;
&lt;br /&gt;
No need for a complex installation process anymore !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Steps Overview ==&lt;br /&gt;
The main steps to get a Codespace working, are:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Create your code repository, or fork one&lt;br /&gt;
* Add a .devcontainer/devcontainer.json file to that repository&lt;br /&gt;
* Create &amp;amp; launch your codespace, and enjoy the IDE in your browser !&lt;br /&gt;
&lt;br /&gt;
That&#039;s all there is to it.&lt;br /&gt;
&lt;br /&gt;
Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].&lt;br /&gt;
&lt;br /&gt;
== Example 1: Build an .elf from a KallistiOS example ==&lt;br /&gt;
To compile the executable .elf file from a KallistiOS examples in a Codespace:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]&lt;br /&gt;
* Click on the &amp;quot;Fork&amp;quot; button, this will create a KallistiOS repository inside your account&lt;br /&gt;
* Click on the &amp;quot;Add File&amp;quot; button, then &amp;quot;Create New File&amp;quot;&lt;br /&gt;
* Name the file: &amp;quot;.devcontainer/devcontainer.json&amp;quot;, and paste the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	//&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	//    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	//},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Click on &amp;quot;Commit changes&amp;quot;, then &amp;quot;Commit Changes&amp;quot; again to save the file&lt;br /&gt;
* Go back to the root directory of your repository&lt;br /&gt;
* Launch your Codespace by clicking on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot; - &amp;quot;Create codespace on master&amp;quot;.&lt;br /&gt;
* This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.&lt;br /&gt;
* 3-bars-Menu at the top left - Terminal - New Terminal&lt;br /&gt;
* cd examples/dreamcast/2ndmix&lt;br /&gt;
* make clean&lt;br /&gt;
* make&lt;br /&gt;
* You should now have a &amp;quot;2ndmix.elf&amp;quot; in that folder&lt;br /&gt;
* Navigate to that folder (examples/dreamcast/2ndmix) on the file tree on the left, right-click on the file, and choose &amp;quot;Download...&amp;quot;&lt;br /&gt;
* Congratulations ! You successfully built an executable file for the Dreamcast. You can now upload that file in your favorite emulator, or send it to a real Dreamcast via a [https://dreamcast.wiki/Coder%27s_cable Coder&#039;s Cable] or a [https://dreamcast.wiki/Broadband_adapter Broadband Adapter]&lt;br /&gt;
&lt;br /&gt;
== Example 2: create a .cdi from the .elf of Example 1 ==&lt;br /&gt;
Having an .elf executable file is nice for small tests, but often you&#039;ll find yourself needing to build a .cdi disc image file:&lt;br /&gt;
* If you closed your codespace, you can reopen it by going to your code repository, click on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot;, then on the auto-generated name of your codespace.&lt;br /&gt;
* Since our codespace does not contain mkdcdisc (the tool to build .cdi files), we&#039;ll add that to our codespace:&lt;br /&gt;
** Open a terminal in your codespace (3-bars-Menu at the top left - Terminal - New Terminal)&lt;br /&gt;
** cd /opt/toolchains/dc&lt;br /&gt;
** git clone https://gitlab.com/simulant/mkdcdisc&lt;br /&gt;
** cd mkdcdisc&lt;br /&gt;
** meson setup builddir&lt;br /&gt;
** meson compile -C builddir&lt;br /&gt;
** cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
* Build the .cdi file for 2ndmix.elf&lt;br /&gt;
** cd /opt/toolchains/dc/kos/examples/dreamcast/2ndmix&lt;br /&gt;
** mkdcdisc -e 2ndmix.elf -o 2ndmix.cdi -n &amp;quot;2ndmix&amp;quot;&lt;br /&gt;
* Compress the .cdi file into a zip file with parts of max 25 MegaBytes (otherwise your browser will have problems downloading the .cdi):&lt;br /&gt;
** zip -s 25M 2ndmix.zip 2ndmix.cdi&lt;br /&gt;
* Right-click on the generated files, and download them into your local folders&lt;br /&gt;
* Unzip the files in your local folder to reconstruct 2ndmix.cdi&lt;br /&gt;
* Launch 2ndmix.cdi in your favorite emulator, or on a real Dreamcast&lt;br /&gt;
&lt;br /&gt;
== Example 3: Configuring a more complex Codespace ==&lt;br /&gt;
If you find yourself always adding the same extra application into the codespace provided in Example 1 (eg: always having to add mkdcdisc, ...), you can simplify your setup by specifying your own Dockerfile, and add setup commands in there:&lt;br /&gt;
&lt;br /&gt;
* Modify .devcontainer/devcontainer.json so that it points to a Dockerfile:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	//&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ... and add a new file: ./devcontainer/Dockerfile&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Stage 1&lt;br /&gt;
FROM &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot; as build&lt;br /&gt;
&lt;br /&gt;
# Add mkdcdisc&lt;br /&gt;
RUN git clone https://gitlab.com/simulant/mkdcdisc /opt/toolchains/dc/mkdcdisc \&lt;br /&gt;
    &amp;amp;&amp;amp; cd /opt/toolchains/dc/mkdcdisc \&lt;br /&gt;
    &amp;amp;&amp;amp; meson setup builddir \&lt;br /&gt;
    &amp;amp;&amp;amp; meson compile -C builddir \&lt;br /&gt;
    &amp;amp;&amp;amp; cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* The next time you create a repository &amp;amp; copy the above 2 files in it, you will get a codespace with mkdcdisc already correctly installed !&lt;br /&gt;
&lt;br /&gt;
== Example 4: Build something not from KallistiOS ==&lt;br /&gt;
* TODO&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
* When you&#039;re finished with your Codespace, go to &lt;br /&gt;
** the 3-bars-Menu at the top left - &amp;quot;My Codespaces&amp;quot;&lt;br /&gt;
** on the left, select the codespace you were just running&lt;br /&gt;
** click on the 3 dots next to &amp;quot;Active&amp;quot;&lt;br /&gt;
** select &amp;quot;Stop codespace&amp;quot;&lt;br /&gt;
Doing this pro-actively will save you some free minutes, since the default timeout is 30 minutes.&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3581</id>
		<title>Codespaces</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3581"/>
		<updated>2024-07-14T07:07:40Z</updated>

		<summary type="html">&lt;p&gt;Tchan: Example 3: fixing Dockerfile errors&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Github [https://www.youtube.com/watch?v=sYJ3CHtT6WM Codespaces] lets you spawn a complete Dreamcast development environment in your browser in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
The only things you need are:&lt;br /&gt;
* a browser&lt;br /&gt;
* a github login.&lt;br /&gt;
&lt;br /&gt;
No need for a complex installation process anymore !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Steps Overview ==&lt;br /&gt;
The main steps to get a Codespace working, are:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Create your code repository, or fork one&lt;br /&gt;
* Add a .devcontainer/devcontainer.json file to that repository&lt;br /&gt;
* Create &amp;amp; launch your codespace, and enjoy the IDE in your browser !&lt;br /&gt;
&lt;br /&gt;
That&#039;s all there is to it.&lt;br /&gt;
&lt;br /&gt;
Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].&lt;br /&gt;
&lt;br /&gt;
== Example 1: Build an .elf from a KallistiOS example ==&lt;br /&gt;
To compile the executable .elf file from a KallistiOS examples in a Codespace:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]&lt;br /&gt;
* Click on the &amp;quot;Fork&amp;quot; button, this will create a KallistiOS repository inside your account&lt;br /&gt;
* Click on the &amp;quot;Add File&amp;quot; button, then &amp;quot;Create New File&amp;quot;&lt;br /&gt;
* Name the file: &amp;quot;.devcontainer/devcontainer.json&amp;quot;, and paste the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	//&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	//    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	//},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Click on &amp;quot;Commit changes&amp;quot;, then &amp;quot;Commit Changes&amp;quot; again to save the file&lt;br /&gt;
* Go back to the root directory of your repository&lt;br /&gt;
* Launch your Codespace by clicking on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot; - &amp;quot;Create codespace on master&amp;quot;.&lt;br /&gt;
* This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.&lt;br /&gt;
* 3-bars-Menu at the top left - Terminal - New Terminal&lt;br /&gt;
* cd examples/dreamcast/2ndmix&lt;br /&gt;
* make clean&lt;br /&gt;
* make&lt;br /&gt;
* You should now have a &amp;quot;2ndmix.elf&amp;quot; in that folder&lt;br /&gt;
* Navigate to that folder (examples/dreamcast/2ndmix) on the file tree on the left, right-click on the file, and choose &amp;quot;Download...&amp;quot;&lt;br /&gt;
* Congratulations ! You successfully built an executable file for the Dreamcast. You can now upload that file in your favorite emulator, or send it to a real Dreamcast via a [https://dreamcast.wiki/Coder%27s_cable Coder&#039;s Cable] or a [https://dreamcast.wiki/Broadband_adapter Broadband Adapter]&lt;br /&gt;
&lt;br /&gt;
== Example 2: create a .cdi from the .elf of Example 1 ==&lt;br /&gt;
Having an .elf executable file is nice for small tests, but often you&#039;ll find yourself needing to build a .cdi disc image file:&lt;br /&gt;
* If you closed your codespace, you can reopen it by going to your code repository, click on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot;, then on the auto-generated name of your codespace.&lt;br /&gt;
* Since our codespace does not contain mkdcdisc (the tool to build .cdi files), we&#039;ll add that to our codespace:&lt;br /&gt;
** Open a terminal in your codespace (3-bars-Menu at the top left - Terminal - New Terminal)&lt;br /&gt;
** cd /opt/toolchains/dc&lt;br /&gt;
** git clone https://gitlab.com/simulant/mkdcdisc&lt;br /&gt;
** cd mkdcdisc&lt;br /&gt;
** meson setup builddir&lt;br /&gt;
** meson compile -C builddir&lt;br /&gt;
** cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
* Build the .cdi file for 2ndmix.elf&lt;br /&gt;
** cd /opt/toolchains/dc/kos/examples/dreamcast/2ndmix&lt;br /&gt;
** mkdcdisc -e 2ndmix.elf -o 2ndmix.cdi -n &amp;quot;2ndmix&amp;quot;&lt;br /&gt;
* Compress the .cdi file into a zip file with parts of max 25 MegaBytes (otherwise your browser will have problems downloading the .cdi):&lt;br /&gt;
** zip -s 25M 2ndmix.zip 2ndmix.cdi&lt;br /&gt;
* Right-click on the generated files, and download them into your local folders&lt;br /&gt;
* Unzip the files in your local folder to reconstruct 2ndmix.cdi&lt;br /&gt;
* Launch 2ndmix.cdi in your favorite emulator, or on a real Dreamcast&lt;br /&gt;
&lt;br /&gt;
== Example 3: Configuring a more complex Codespace ==&lt;br /&gt;
If you find yourself always adding the same extra application into the codespace provided in Example 1 (eg: always having to add mkdcdisc, ...), you can simplify your setup by specifying your own Dockerfile, and add setup commands in there:&lt;br /&gt;
&lt;br /&gt;
* Modify .devcontainer/devcontainer.json so that it points to a Dockerfile:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	//&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ... and add a new file: ./devcontainer/Dockerfile&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Stage 1&lt;br /&gt;
FROM &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot; as build&lt;br /&gt;
&lt;br /&gt;
# Add mkdcdisc&lt;br /&gt;
RUN git clone https://gitlab.com/simulant/mkdcdisc /opt/toolchains/dc/mkdcdisc \&lt;br /&gt;
    &amp;amp;&amp;amp; cd mkdcdisc \&lt;br /&gt;
    &amp;amp;&amp;amp; meson setup builddir \&lt;br /&gt;
    &amp;amp;&amp;amp; meson compile -C builddir \&lt;br /&gt;
    &amp;amp;&amp;amp; cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* The next time you create a repository &amp;amp; copy the above 2 files in it, you will get a codespace with mkdcdisc already correctly installed !&lt;br /&gt;
&lt;br /&gt;
== Example 4: Build something not from KallistiOS ==&lt;br /&gt;
* TODO&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
* When you&#039;re finished with your Codespace, go to &lt;br /&gt;
** the 3-bars-Menu at the top left - &amp;quot;My Codespaces&amp;quot;&lt;br /&gt;
** on the left, select the codespace you were just running&lt;br /&gt;
** click on the 3 dots next to &amp;quot;Active&amp;quot;&lt;br /&gt;
** select &amp;quot;Stop codespace&amp;quot;&lt;br /&gt;
Doing this pro-actively will save you some free minutes, since the default timeout is 30 minutes.&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3580</id>
		<title>Codespaces</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3580"/>
		<updated>2024-07-14T06:54:12Z</updated>

		<summary type="html">&lt;p&gt;Tchan: finishing example 3&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Github [https://www.youtube.com/watch?v=sYJ3CHtT6WM Codespaces] lets you spawn a complete Dreamcast development environment in your browser in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
The only things you need are:&lt;br /&gt;
* a browser&lt;br /&gt;
* a github login.&lt;br /&gt;
&lt;br /&gt;
No need for a complex installation process anymore !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Steps Overview ==&lt;br /&gt;
The main steps to get a Codespace working, are:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Create your code repository, or fork one&lt;br /&gt;
* Add a .devcontainer/devcontainer.json file to that repository&lt;br /&gt;
* Create &amp;amp; launch your codespace, and enjoy the IDE in your browser !&lt;br /&gt;
&lt;br /&gt;
That&#039;s all there is to it.&lt;br /&gt;
&lt;br /&gt;
Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].&lt;br /&gt;
&lt;br /&gt;
== Example 1: Build an .elf from a KallistiOS example ==&lt;br /&gt;
To compile the executable .elf file from a KallistiOS examples in a Codespace:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]&lt;br /&gt;
* Click on the &amp;quot;Fork&amp;quot; button, this will create a KallistiOS repository inside your account&lt;br /&gt;
* Click on the &amp;quot;Add File&amp;quot; button, then &amp;quot;Create New File&amp;quot;&lt;br /&gt;
* Name the file: &amp;quot;.devcontainer/devcontainer.json&amp;quot;, and paste the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	//&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	//    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	//},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Click on &amp;quot;Commit changes&amp;quot;, then &amp;quot;Commit Changes&amp;quot; again to save the file&lt;br /&gt;
* Go back to the root directory of your repository&lt;br /&gt;
* Launch your Codespace by clicking on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot; - &amp;quot;Create codespace on master&amp;quot;.&lt;br /&gt;
* This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.&lt;br /&gt;
* 3-bars-Menu at the top left - Terminal - New Terminal&lt;br /&gt;
* cd examples/dreamcast/2ndmix&lt;br /&gt;
* make clean&lt;br /&gt;
* make&lt;br /&gt;
* You should now have a &amp;quot;2ndmix.elf&amp;quot; in that folder&lt;br /&gt;
* Navigate to that folder (examples/dreamcast/2ndmix) on the file tree on the left, right-click on the file, and choose &amp;quot;Download...&amp;quot;&lt;br /&gt;
* Congratulations ! You successfully built an executable file for the Dreamcast. You can now upload that file in your favorite emulator, or send it to a real Dreamcast via a [https://dreamcast.wiki/Coder%27s_cable Coder&#039;s Cable] or a [https://dreamcast.wiki/Broadband_adapter Broadband Adapter]&lt;br /&gt;
&lt;br /&gt;
== Example 2: create a .cdi from the .elf of Example 1 ==&lt;br /&gt;
Having an .elf executable file is nice for small tests, but often you&#039;ll find yourself needing to build a .cdi disc image file:&lt;br /&gt;
* If you closed your codespace, you can reopen it by going to your code repository, click on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot;, then on the auto-generated name of your codespace.&lt;br /&gt;
* Since our codespace does not contain mkdcdisc (the tool to build .cdi files), we&#039;ll add that to our codespace:&lt;br /&gt;
** Open a terminal in your codespace (3-bars-Menu at the top left - Terminal - New Terminal)&lt;br /&gt;
** cd /opt/toolchains/dc&lt;br /&gt;
** git clone https://gitlab.com/simulant/mkdcdisc&lt;br /&gt;
** cd mkdcdisc&lt;br /&gt;
** meson setup builddir&lt;br /&gt;
** meson compile -C builddir&lt;br /&gt;
** cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
* Build the .cdi file for 2ndmix.elf&lt;br /&gt;
** cd /opt/toolchains/dc/kos/examples/dreamcast/2ndmix&lt;br /&gt;
** mkdcdisc -e 2ndmix.elf -o 2ndmix.cdi -n &amp;quot;2ndmix&amp;quot;&lt;br /&gt;
* Compress the .cdi file into a zip file with parts of max 25 MegaBytes (otherwise your browser will have problems downloading the .cdi):&lt;br /&gt;
** zip -s 25M 2ndmix.zip 2ndmix.cdi&lt;br /&gt;
* Right-click on the generated files, and download them into your local folders&lt;br /&gt;
* Unzip the files in your local folder to reconstruct 2ndmix.cdi&lt;br /&gt;
* Launch 2ndmix.cdi in your favorite emulator, or on a real Dreamcast&lt;br /&gt;
&lt;br /&gt;
== Example 3: Configuring a more complex Codespace ==&lt;br /&gt;
If you find yourself always adding the same extra application into the codespace provided in Example 1 (eg: always having to add mkdcdisc, ...), you can simplify your setup by specifying your own Dockerfile, and add setup commands in there:&lt;br /&gt;
&lt;br /&gt;
* Modify .devcontainer/devcontainer.json so that it points to a Dockerfile:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	//&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ... and add a new file: ./devcontainer/Dockerfile&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Stage 1&lt;br /&gt;
FROM ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0 as build&lt;br /&gt;
&lt;br /&gt;
# Add mkdcdisc&lt;br /&gt;
RUN git clone https://gitlab.com/simulant/mkdcdisc /opt/toolchains/dc/mkdcdisc \&lt;br /&gt;
    &amp;amp;&amp;amp; cd mkdcdisc&lt;br /&gt;
    &amp;amp;&amp;amp; meson setup builddir&lt;br /&gt;
    &amp;amp;&amp;amp; meson compile -C builddir&lt;br /&gt;
    &amp;amp;&amp;amp; cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* The next time you create a repository &amp;amp; copy the above 2 files in it, you will get a codespace with mkdcdisc already correctly installed !&lt;br /&gt;
&lt;br /&gt;
== Example 4: Build something not from KallistiOS ==&lt;br /&gt;
* TODO&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
* When you&#039;re finished with your Codespace, go to &lt;br /&gt;
** the 3-bars-Menu at the top left - &amp;quot;My Codespaces&amp;quot;&lt;br /&gt;
** on the left, select the codespace you were just running&lt;br /&gt;
** click on the 3 dots next to &amp;quot;Active&amp;quot;&lt;br /&gt;
** select &amp;quot;Stop codespace&amp;quot;&lt;br /&gt;
Doing this pro-actively will save you some free minutes, since the default timeout is 30 minutes.&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3579</id>
		<title>Codespaces</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3579"/>
		<updated>2024-07-14T06:51:48Z</updated>

		<summary type="html">&lt;p&gt;Tchan: example 3 dockerfile: remove kos download&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Github [https://www.youtube.com/watch?v=sYJ3CHtT6WM Codespaces] lets you spawn a complete Dreamcast development environment in your browser in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
The only things you need are:&lt;br /&gt;
* a browser&lt;br /&gt;
* a github login.&lt;br /&gt;
&lt;br /&gt;
No need for a complex installation process anymore !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Steps Overview ==&lt;br /&gt;
The main steps to get a Codespace working, are:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Create your code repository, or fork one&lt;br /&gt;
* Add a .devcontainer/devcontainer.json file to that repository&lt;br /&gt;
* Create &amp;amp; launch your codespace, and enjoy the IDE in your browser !&lt;br /&gt;
&lt;br /&gt;
That&#039;s all there is to it.&lt;br /&gt;
&lt;br /&gt;
Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].&lt;br /&gt;
&lt;br /&gt;
== Example 1: Build an .elf from a KallistiOS example ==&lt;br /&gt;
To compile the executable .elf file from a KallistiOS examples in a Codespace:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]&lt;br /&gt;
* Click on the &amp;quot;Fork&amp;quot; button, this will create a KallistiOS repository inside your account&lt;br /&gt;
* Click on the &amp;quot;Add File&amp;quot; button, then &amp;quot;Create New File&amp;quot;&lt;br /&gt;
* Name the file: &amp;quot;.devcontainer/devcontainer.json&amp;quot;, and paste the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	//&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	//    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	//},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Click on &amp;quot;Commit changes&amp;quot;, then &amp;quot;Commit Changes&amp;quot; again to save the file&lt;br /&gt;
* Go back to the root directory of your repository&lt;br /&gt;
* Launch your Codespace by clicking on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot; - &amp;quot;Create codespace on master&amp;quot;.&lt;br /&gt;
* This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.&lt;br /&gt;
* 3-bars-Menu at the top left - Terminal - New Terminal&lt;br /&gt;
* cd examples/dreamcast/2ndmix&lt;br /&gt;
* make clean&lt;br /&gt;
* make&lt;br /&gt;
* You should now have a &amp;quot;2ndmix.elf&amp;quot; in that folder&lt;br /&gt;
* Navigate to that folder (examples/dreamcast/2ndmix) on the file tree on the left, right-click on the file, and choose &amp;quot;Download...&amp;quot;&lt;br /&gt;
* Congratulations ! You successfully built an executable file for the Dreamcast. You can now upload that file in your favorite emulator, or send it to a real Dreamcast via a [https://dreamcast.wiki/Coder%27s_cable Coder&#039;s Cable] or a [https://dreamcast.wiki/Broadband_adapter Broadband Adapter]&lt;br /&gt;
&lt;br /&gt;
== Example 2: create a .cdi from the .elf of Example 1 ==&lt;br /&gt;
Having an .elf executable file is nice for small tests, but often you&#039;ll find yourself needing to build a .cdi disc image file:&lt;br /&gt;
* If you closed your codespace, you can reopen it by going to your code repository, click on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot;, then on the auto-generated name of your codespace.&lt;br /&gt;
* Since our codespace does not contain mkdcdisc (the tool to build .cdi files), we&#039;ll add that to our codespace:&lt;br /&gt;
** Open a terminal in your codespace (3-bars-Menu at the top left - Terminal - New Terminal)&lt;br /&gt;
** cd /opt/toolchains/dc&lt;br /&gt;
** git clone https://gitlab.com/simulant/mkdcdisc&lt;br /&gt;
** cd mkdcdisc&lt;br /&gt;
** meson setup builddir&lt;br /&gt;
** meson compile -C builddir&lt;br /&gt;
** cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
* Build the .cdi file for 2ndmix.elf&lt;br /&gt;
** cd /opt/toolchains/dc/kos/examples/dreamcast/2ndmix&lt;br /&gt;
** mkdcdisc -e 2ndmix.elf -o 2ndmix.cdi -n &amp;quot;2ndmix&amp;quot;&lt;br /&gt;
* Compress the .cdi file into a zip file with parts of max 25 MegaBytes (otherwise your browser will have problems downloading the .cdi):&lt;br /&gt;
** zip -s 25M 2ndmix.zip 2ndmix.cdi&lt;br /&gt;
* Right-click on the generated files, and download them into your local folders&lt;br /&gt;
* Unzip the files in your local folder to reconstruct 2ndmix.cdi&lt;br /&gt;
* Launch 2ndmix.cdi in your favorite emulator, or on a real Dreamcast&lt;br /&gt;
&lt;br /&gt;
== Example 3: Configuring a more complex Codespace ==&lt;br /&gt;
If you find yourself always adding the same extra application into the codespace provided in Example 1 (eg: always having to add mkdcdisc, ...), you can simplify your setup by specifying your own Dockerfile, and add setup commands in there:&lt;br /&gt;
&lt;br /&gt;
* Modify .devcontainer/devcontainer.json so that it points to a Dockerfile:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	//&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ... and add a new file: ./devcontainer/Dockerfile&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Stage 1&lt;br /&gt;
FROM ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0 as build&lt;br /&gt;
&lt;br /&gt;
# Add mkdcdisc&lt;br /&gt;
RUN git clone https://gitlab.com/simulant/mkdcdisc /opt/toolchains/dc/mkdcdisc \&lt;br /&gt;
    &amp;amp;&amp;amp; cd mkdcdisc&lt;br /&gt;
    &amp;amp;&amp;amp; meson setup builddir&lt;br /&gt;
    &amp;amp;&amp;amp; meson compile -C builddir&lt;br /&gt;
    &amp;amp;&amp;amp; cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example 4: Build something not from KallistiOS ==&lt;br /&gt;
* TODO&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
* When you&#039;re finished with your Codespace, go to &lt;br /&gt;
** the 3-bars-Menu at the top left - &amp;quot;My Codespaces&amp;quot;&lt;br /&gt;
** on the left, select the codespace you were just running&lt;br /&gt;
** click on the 3 dots next to &amp;quot;Active&amp;quot;&lt;br /&gt;
** select &amp;quot;Stop codespace&amp;quot;&lt;br /&gt;
Doing this pro-actively will save you some free minutes, since the default timeout is 30 minutes.&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3578</id>
		<title>Codespaces</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3578"/>
		<updated>2024-07-14T06:50:53Z</updated>

		<summary type="html">&lt;p&gt;Tchan: fixing syntaxhighlight closures&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Github [https://www.youtube.com/watch?v=sYJ3CHtT6WM Codespaces] lets you spawn a complete Dreamcast development environment in your browser in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
The only things you need are:&lt;br /&gt;
* a browser&lt;br /&gt;
* a github login.&lt;br /&gt;
&lt;br /&gt;
No need for a complex installation process anymore !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Steps Overview ==&lt;br /&gt;
The main steps to get a Codespace working, are:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Create your code repository, or fork one&lt;br /&gt;
* Add a .devcontainer/devcontainer.json file to that repository&lt;br /&gt;
* Create &amp;amp; launch your codespace, and enjoy the IDE in your browser !&lt;br /&gt;
&lt;br /&gt;
That&#039;s all there is to it.&lt;br /&gt;
&lt;br /&gt;
Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].&lt;br /&gt;
&lt;br /&gt;
== Example 1: Build an .elf from a KallistiOS example ==&lt;br /&gt;
To compile the executable .elf file from a KallistiOS examples in a Codespace:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]&lt;br /&gt;
* Click on the &amp;quot;Fork&amp;quot; button, this will create a KallistiOS repository inside your account&lt;br /&gt;
* Click on the &amp;quot;Add File&amp;quot; button, then &amp;quot;Create New File&amp;quot;&lt;br /&gt;
* Name the file: &amp;quot;.devcontainer/devcontainer.json&amp;quot;, and paste the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	//&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	//    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	//},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Click on &amp;quot;Commit changes&amp;quot;, then &amp;quot;Commit Changes&amp;quot; again to save the file&lt;br /&gt;
* Go back to the root directory of your repository&lt;br /&gt;
* Launch your Codespace by clicking on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot; - &amp;quot;Create codespace on master&amp;quot;.&lt;br /&gt;
* This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.&lt;br /&gt;
* 3-bars-Menu at the top left - Terminal - New Terminal&lt;br /&gt;
* cd examples/dreamcast/2ndmix&lt;br /&gt;
* make clean&lt;br /&gt;
* make&lt;br /&gt;
* You should now have a &amp;quot;2ndmix.elf&amp;quot; in that folder&lt;br /&gt;
* Navigate to that folder (examples/dreamcast/2ndmix) on the file tree on the left, right-click on the file, and choose &amp;quot;Download...&amp;quot;&lt;br /&gt;
* Congratulations ! You successfully built an executable file for the Dreamcast. You can now upload that file in your favorite emulator, or send it to a real Dreamcast via a [https://dreamcast.wiki/Coder%27s_cable Coder&#039;s Cable] or a [https://dreamcast.wiki/Broadband_adapter Broadband Adapter]&lt;br /&gt;
&lt;br /&gt;
== Example 2: create a .cdi from the .elf of Example 1 ==&lt;br /&gt;
Having an .elf executable file is nice for small tests, but often you&#039;ll find yourself needing to build a .cdi disc image file:&lt;br /&gt;
* If you closed your codespace, you can reopen it by going to your code repository, click on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot;, then on the auto-generated name of your codespace.&lt;br /&gt;
* Since our codespace does not contain mkdcdisc (the tool to build .cdi files), we&#039;ll add that to our codespace:&lt;br /&gt;
** Open a terminal in your codespace (3-bars-Menu at the top left - Terminal - New Terminal)&lt;br /&gt;
** cd /opt/toolchains/dc&lt;br /&gt;
** git clone https://gitlab.com/simulant/mkdcdisc&lt;br /&gt;
** cd mkdcdisc&lt;br /&gt;
** meson setup builddir&lt;br /&gt;
** meson compile -C builddir&lt;br /&gt;
** cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
* Build the .cdi file for 2ndmix.elf&lt;br /&gt;
** cd /opt/toolchains/dc/kos/examples/dreamcast/2ndmix&lt;br /&gt;
** mkdcdisc -e 2ndmix.elf -o 2ndmix.cdi -n &amp;quot;2ndmix&amp;quot;&lt;br /&gt;
* Compress the .cdi file into a zip file with parts of max 25 MegaBytes (otherwise your browser will have problems downloading the .cdi):&lt;br /&gt;
** zip -s 25M 2ndmix.zip 2ndmix.cdi&lt;br /&gt;
* Right-click on the generated files, and download them into your local folders&lt;br /&gt;
* Unzip the files in your local folder to reconstruct 2ndmix.cdi&lt;br /&gt;
* Launch 2ndmix.cdi in your favorite emulator, or on a real Dreamcast&lt;br /&gt;
&lt;br /&gt;
== Example 3: Configuring a more complex Codespace ==&lt;br /&gt;
If you find yourself always adding the same extra application into the codespace provided in Example 1 (eg: always having to add mkdcdisc, ...), you can simplify your setup by specifying your own Dockerfile, and add setup commands in there:&lt;br /&gt;
&lt;br /&gt;
* Modify .devcontainer/devcontainer.json so that it points to a Dockerfile:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	//&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ... and add a new file: ./devcontainer/Dockerfile&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Stage 1&lt;br /&gt;
FROM ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0 as build&lt;br /&gt;
&lt;br /&gt;
# Add mkdcdisc&lt;br /&gt;
RUN git clone https://github.com/KallistiOS/KallistiOS.git /opt/toolchains/dc/kos \&lt;br /&gt;
    &amp;amp;&amp;amp; cd /opt/toolchains/dc/kos \&lt;br /&gt;
    &amp;amp;&amp;amp; cp ./doc/environ.sh.sample ./environ.sh \&lt;br /&gt;
    &amp;amp;&amp;amp; source environ.sh \&lt;br /&gt;
    &amp;amp;&amp;amp; make&lt;br /&gt;
RUN git clone https://gitlab.com/simulant/mkdcdisc /opt/toolchains/dc/mkdcdisc \&lt;br /&gt;
    &amp;amp;&amp;amp; cd mkdcdisc&lt;br /&gt;
    &amp;amp;&amp;amp; meson setup builddir&lt;br /&gt;
    &amp;amp;&amp;amp; meson compile -C builddir&lt;br /&gt;
    &amp;amp;&amp;amp; cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example 4: Build something not from KallistiOS ==&lt;br /&gt;
* TODO&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
* When you&#039;re finished with your Codespace, go to &lt;br /&gt;
** the 3-bars-Menu at the top left - &amp;quot;My Codespaces&amp;quot;&lt;br /&gt;
** on the left, select the codespace you were just running&lt;br /&gt;
** click on the 3 dots next to &amp;quot;Active&amp;quot;&lt;br /&gt;
** select &amp;quot;Stop codespace&amp;quot;&lt;br /&gt;
Doing this pro-actively will save you some free minutes, since the default timeout is 30 minutes.&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3577</id>
		<title>Codespaces</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3577"/>
		<updated>2024-07-14T06:49:08Z</updated>

		<summary type="html">&lt;p&gt;Tchan: completing example 3, added info on reopening codespaces&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Github [https://www.youtube.com/watch?v=sYJ3CHtT6WM Codespaces] lets you spawn a complete Dreamcast development environment in your browser in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
The only things you need are:&lt;br /&gt;
* a browser&lt;br /&gt;
* a github login.&lt;br /&gt;
&lt;br /&gt;
No need for a complex installation process anymore !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Steps Overview ==&lt;br /&gt;
The main steps to get a Codespace working, are:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Create your code repository, or fork one&lt;br /&gt;
* Add a .devcontainer/devcontainer.json file to that repository&lt;br /&gt;
* Create &amp;amp; launch your codespace, and enjoy the IDE in your browser !&lt;br /&gt;
&lt;br /&gt;
That&#039;s all there is to it.&lt;br /&gt;
&lt;br /&gt;
Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].&lt;br /&gt;
&lt;br /&gt;
== Example 1: Build an .elf from a KallistiOS example ==&lt;br /&gt;
To compile the executable .elf file from a KallistiOS examples in a Codespace:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]&lt;br /&gt;
* Click on the &amp;quot;Fork&amp;quot; button, this will create a KallistiOS repository inside your account&lt;br /&gt;
* Click on the &amp;quot;Add File&amp;quot; button, then &amp;quot;Create New File&amp;quot;&lt;br /&gt;
* Name the file: &amp;quot;.devcontainer/devcontainer.json&amp;quot;, and paste the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	//&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	//    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	//},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Click on &amp;quot;Commit changes&amp;quot;, then &amp;quot;Commit Changes&amp;quot; again to save the file&lt;br /&gt;
* Go back to the root directory of your repository&lt;br /&gt;
* Launch your Codespace by clicking on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot; - &amp;quot;Create codespace on master&amp;quot;.&lt;br /&gt;
* This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.&lt;br /&gt;
* 3-bars-Menu at the top left - Terminal - New Terminal&lt;br /&gt;
* cd examples/dreamcast/2ndmix&lt;br /&gt;
* make clean&lt;br /&gt;
* make&lt;br /&gt;
* You should now have a &amp;quot;2ndmix.elf&amp;quot; in that folder&lt;br /&gt;
* Navigate to that folder (examples/dreamcast/2ndmix) on the file tree on the left, right-click on the file, and choose &amp;quot;Download...&amp;quot;&lt;br /&gt;
* Congratulations ! You successfully built an executable file for the Dreamcast. You can now upload that file in your favorite emulator, or send it to a real Dreamcast via a [https://dreamcast.wiki/Coder%27s_cable Coder&#039;s Cable] or a [https://dreamcast.wiki/Broadband_adapter Broadband Adapter]&lt;br /&gt;
&lt;br /&gt;
== Example 2: create a .cdi from the .elf of Example 1 ==&lt;br /&gt;
Having an .elf executable file is nice for small tests, but often you&#039;ll find yourself needing to build a .cdi disc image file:&lt;br /&gt;
* If you closed your codespace, you can reopen it by going to your code repository, click on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot;, then on the auto-generated name of your codespace.&lt;br /&gt;
* Since our codespace does not contain mkdcdisc (the tool to build .cdi files), we&#039;ll add that to our codespace:&lt;br /&gt;
** Open a terminal in your codespace (3-bars-Menu at the top left - Terminal - New Terminal)&lt;br /&gt;
** cd /opt/toolchains/dc&lt;br /&gt;
** git clone https://gitlab.com/simulant/mkdcdisc&lt;br /&gt;
** cd mkdcdisc&lt;br /&gt;
** meson setup builddir&lt;br /&gt;
** meson compile -C builddir&lt;br /&gt;
** cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
* Build the .cdi file for 2ndmix.elf&lt;br /&gt;
** cd /opt/toolchains/dc/kos/examples/dreamcast/2ndmix&lt;br /&gt;
** mkdcdisc -e 2ndmix.elf -o 2ndmix.cdi -n &amp;quot;2ndmix&amp;quot;&lt;br /&gt;
* Compress the .cdi file into a zip file with parts of max 25 MegaBytes (otherwise your browser will have problems downloading the .cdi):&lt;br /&gt;
** zip -s 25M 2ndmix.zip 2ndmix.cdi&lt;br /&gt;
* Right-click on the generated files, and download them into your local folders&lt;br /&gt;
* Unzip the files in your local folder to reconstruct 2ndmix.cdi&lt;br /&gt;
* Launch 2ndmix.cdi in your favorite emulator, or on a real Dreamcast&lt;br /&gt;
&lt;br /&gt;
== Example 3: Configuring a more complex Codespace ==&lt;br /&gt;
If you find yourself always adding the same extra application into the codespace provided in Example 1 (eg: always having to add mkdcdisc, ...), you can simplify your setup by specifying your own Dockerfile, and add setup commands in there:&lt;br /&gt;
&lt;br /&gt;
* Modify .devcontainer/devcontainer.json so that it points to a Dockerfile:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	//&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* ... and add a new file: ./devcontainer/Dockerfile&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;bash&amp;quot;&amp;gt;&lt;br /&gt;
# Stage 1&lt;br /&gt;
FROM ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0 as build&lt;br /&gt;
&lt;br /&gt;
# Add mkdcdisc&lt;br /&gt;
RUN git clone https://github.com/KallistiOS/KallistiOS.git /opt/toolchains/dc/kos \&lt;br /&gt;
    &amp;amp;&amp;amp; cd /opt/toolchains/dc/kos \&lt;br /&gt;
    &amp;amp;&amp;amp; cp ./doc/environ.sh.sample ./environ.sh \&lt;br /&gt;
    &amp;amp;&amp;amp; source environ.sh \&lt;br /&gt;
    &amp;amp;&amp;amp; make&lt;br /&gt;
RUN git clone https://gitlab.com/simulant/mkdcdisc /opt/toolchains/dc/mkdcdisc \&lt;br /&gt;
    &amp;amp;&amp;amp; cd mkdcdisc&lt;br /&gt;
    &amp;amp;&amp;amp; meson setup builddir&lt;br /&gt;
    &amp;amp;&amp;amp; meson compile -C builddir&lt;br /&gt;
    &amp;amp;&amp;amp; cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example 4: Build something not from KallistiOS ==&lt;br /&gt;
* TODO&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
* When you&#039;re finished with your Codespace, go to &lt;br /&gt;
** the 3-bars-Menu at the top left - &amp;quot;My Codespaces&amp;quot;&lt;br /&gt;
** on the left, select the codespace you were just running&lt;br /&gt;
** click on the 3 dots next to &amp;quot;Active&amp;quot;&lt;br /&gt;
** select &amp;quot;Stop codespace&amp;quot;&lt;br /&gt;
Doing this pro-actively will save you some free minutes, since the default timeout is 30 minutes.&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3576</id>
		<title>Codespaces</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3576"/>
		<updated>2024-07-13T21:32:31Z</updated>

		<summary type="html">&lt;p&gt;Tchan: add placeholder for Example 4&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Github [https://www.youtube.com/watch?v=sYJ3CHtT6WM Codespaces] lets you spawn a complete Dreamcast development environment in your browser in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
The only things you need are:&lt;br /&gt;
* a browser&lt;br /&gt;
* a github login.&lt;br /&gt;
&lt;br /&gt;
No need for a complex installation process anymore !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Steps Overview ==&lt;br /&gt;
The main steps to get a Codespace working, are:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Create your code repository, or fork one&lt;br /&gt;
* Add a .devcontainer/devcontainer.json file to that repository&lt;br /&gt;
* Create &amp;amp; launch your codespace, and enjoy the IDE in your browser !&lt;br /&gt;
&lt;br /&gt;
That&#039;s all there is to it.&lt;br /&gt;
&lt;br /&gt;
Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].&lt;br /&gt;
&lt;br /&gt;
== Example 1: Build an .elf from a KallistiOS example ==&lt;br /&gt;
To compile the executable .elf file from a KallistiOS examples in a Codespace:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]&lt;br /&gt;
* Click on the &amp;quot;Fork&amp;quot; button, this will create a KallistiOS repository inside your account&lt;br /&gt;
* Click on the &amp;quot;Add File&amp;quot; button, then &amp;quot;Create New File&amp;quot;&lt;br /&gt;
* Name the file: &amp;quot;.devcontainer/devcontainer.json&amp;quot;, and paste the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	//&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	//    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	//},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Click on &amp;quot;Commit changes&amp;quot;, then &amp;quot;Commit Changes&amp;quot; again to save the file&lt;br /&gt;
* Go back to the root directory of your repository&lt;br /&gt;
* Launch your Codespace by clicking on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot; - &amp;quot;Create codespace on master&amp;quot;.&lt;br /&gt;
* This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.&lt;br /&gt;
* 3-bars-Menu at the top left - Terminal - New Terminal&lt;br /&gt;
* cd examples/dreamcast/2ndmix&lt;br /&gt;
* make clean&lt;br /&gt;
* make&lt;br /&gt;
* You should now have a &amp;quot;2ndmix.elf&amp;quot; in that folder&lt;br /&gt;
* Navigate to that folder (examples/dreamcast/2ndmix) on the file tree on the left, right-click on the file, and choose &amp;quot;Download...&amp;quot;&lt;br /&gt;
* Congratulations ! You successfully built an executable file for the Dreamcast. You can now upload that file in your favorite emulator, or send it to a real Dreamcast via a [https://dreamcast.wiki/Coder%27s_cable Coder&#039;s Cable] or a [https://dreamcast.wiki/Broadband_adapter Broadband Adapter]&lt;br /&gt;
&lt;br /&gt;
== Example 2: create a .cdi from the .elf of Example 1 ==&lt;br /&gt;
Having an .elf executable file is nice for small tests, but often you&#039;ll find yourself needing to build a .cdi disc image file:&lt;br /&gt;
* TODO: reopen codespace if needed&lt;br /&gt;
* Since our codespace does not contain mkdcdisc (the tool to build .cdi files), we&#039;ll add that to our codespace:&lt;br /&gt;
** Open a terminal in your codespace (3-bars-Menu at the top left - Terminal - New Terminal)&lt;br /&gt;
** cd /opt/toolchains/dc&lt;br /&gt;
** git clone https://gitlab.com/simulant/mkdcdisc&lt;br /&gt;
** cd mkdcdisc&lt;br /&gt;
** meson setup builddir&lt;br /&gt;
** meson compile -C builddir&lt;br /&gt;
** cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
* Build the .cdi file for 2ndmix.elf&lt;br /&gt;
** cd /opt/toolchains/dc/kos/examples/dreamcast/2ndmix&lt;br /&gt;
** mkdcdisc -e 2ndmix.elf -o 2ndmix.cdi -n &amp;quot;2ndmix&amp;quot;&lt;br /&gt;
* Compress the .cdi file into a zip file with parts of max 25 MegaBytes (otherwise your browser will have problems downloading the .cdi):&lt;br /&gt;
** zip -s 25M 2ndmix.zip 2ndmix.cdi&lt;br /&gt;
* Right-click on the generated files, and download them into your local folders&lt;br /&gt;
* Unzip the files in your local folder to reconstruct 2ndmix.cdi&lt;br /&gt;
* Launch 2ndmix.cdi in your favorite emulator, or on a real Dreamcast&lt;br /&gt;
&lt;br /&gt;
== Example 3: Configuring a more complex Codespace ==&lt;br /&gt;
If you find yourself always adding the same extra application into the codespace provided in Example 1 (eg: always having to add mkdcdisc, ...), you can simplify your setup by specifying your own Dockerfile, and add setup commands in there:&lt;br /&gt;
&lt;br /&gt;
* TODO: devcontainer.json&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* TODO: Dockerfile&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Example 4: Build something not from KallistiOS ==&lt;br /&gt;
* TODO&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
* When you&#039;re finished with your Codespace, go to &lt;br /&gt;
** the 3-bars-Menu at the top left - &amp;quot;My Codespaces&amp;quot;&lt;br /&gt;
** on the left, select the codespace you were just running&lt;br /&gt;
** click on the 3 dots next to &amp;quot;Active&amp;quot;&lt;br /&gt;
** select &amp;quot;Stop codespace&amp;quot;&lt;br /&gt;
Doing this pro-actively will save you some free minutes, since the default timeout is 30 minutes.&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3575</id>
		<title>Codespaces</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3575"/>
		<updated>2024-07-13T21:29:43Z</updated>

		<summary type="html">&lt;p&gt;Tchan: example 2 refinements&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Github [https://www.youtube.com/watch?v=sYJ3CHtT6WM Codespaces] lets you spawn a complete Dreamcast development environment in your browser in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
The only things you need are:&lt;br /&gt;
* a browser&lt;br /&gt;
* a github login.&lt;br /&gt;
&lt;br /&gt;
No need for a complex installation process anymore !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Steps Overview ==&lt;br /&gt;
The main steps to get a Codespace working, are:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Create your code repository, or fork one&lt;br /&gt;
* Add a .devcontainer/devcontainer.json file to that repository&lt;br /&gt;
* Create &amp;amp; launch your codespace, and enjoy the IDE in your browser !&lt;br /&gt;
&lt;br /&gt;
That&#039;s all there is to it.&lt;br /&gt;
&lt;br /&gt;
Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].&lt;br /&gt;
&lt;br /&gt;
== Example 1: Build an .elf from a KallistiOS example ==&lt;br /&gt;
To compile the executable .elf file from a KallistiOS examples in a Codespace:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]&lt;br /&gt;
* Click on the &amp;quot;Fork&amp;quot; button, this will create a KallistiOS repository inside your account&lt;br /&gt;
* Click on the &amp;quot;Add File&amp;quot; button, then &amp;quot;Create New File&amp;quot;&lt;br /&gt;
* Name the file: &amp;quot;.devcontainer/devcontainer.json&amp;quot;, and paste the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	//&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	//    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	//},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Click on &amp;quot;Commit changes&amp;quot;, then &amp;quot;Commit Changes&amp;quot; again to save the file&lt;br /&gt;
* Go back to the root directory of your repository&lt;br /&gt;
* Launch your Codespace by clicking on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot; - &amp;quot;Create codespace on master&amp;quot;.&lt;br /&gt;
* This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.&lt;br /&gt;
* 3-bars-Menu at the top left - Terminal - New Terminal&lt;br /&gt;
* cd examples/dreamcast/2ndmix&lt;br /&gt;
* make clean&lt;br /&gt;
* make&lt;br /&gt;
* You should now have a &amp;quot;2ndmix.elf&amp;quot; in that folder&lt;br /&gt;
* Navigate to that folder (examples/dreamcast/2ndmix) on the file tree on the left, right-click on the file, and choose &amp;quot;Download...&amp;quot;&lt;br /&gt;
* Congratulations ! You successfully built an executable file for the Dreamcast. You can now upload that file in your favorite emulator, or send it to a real Dreamcast via a [https://dreamcast.wiki/Coder%27s_cable Coder&#039;s Cable] or a [https://dreamcast.wiki/Broadband_adapter Broadband Adapter]&lt;br /&gt;
&lt;br /&gt;
== Example 2: create a .cdi from the .elf of Example 1 ==&lt;br /&gt;
Having an .elf executable file is nice for small tests, but often you&#039;ll find yourself needing to build a .cdi disc image file:&lt;br /&gt;
* TODO: reopen codespace if needed&lt;br /&gt;
* Since our codespace does not contain mkdcdisc (the tool to build .cdi files), we&#039;ll add that to our codespace:&lt;br /&gt;
** Open a terminal in your codespace (3-bars-Menu at the top left - Terminal - New Terminal)&lt;br /&gt;
** cd /opt/toolchains/dc&lt;br /&gt;
** git clone https://gitlab.com/simulant/mkdcdisc&lt;br /&gt;
** cd mkdcdisc&lt;br /&gt;
** meson setup builddir&lt;br /&gt;
** meson compile -C builddir&lt;br /&gt;
** cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
* Build the .cdi file for 2ndmix.elf&lt;br /&gt;
** cd /opt/toolchains/dc/kos/examples/dreamcast/2ndmix&lt;br /&gt;
** mkdcdisc -e 2ndmix.elf -o 2ndmix.cdi -n &amp;quot;2ndmix&amp;quot;&lt;br /&gt;
* Compress the .cdi file into a zip file with parts of max 25 MegaBytes (otherwise your browser will have problems downloading the .cdi):&lt;br /&gt;
** zip -s 25M 2ndmix.zip 2ndmix.cdi&lt;br /&gt;
* Right-click on the generated files, and download them into your local folders&lt;br /&gt;
* Unzip the files in your local folder to reconstruct 2ndmix.cdi&lt;br /&gt;
* Launch 2ndmix.cdi in your favorite emulator, or on a real Dreamcast&lt;br /&gt;
&lt;br /&gt;
== Example 3: Configuring a more complex Codespace ==&lt;br /&gt;
If you find yourself always adding the same extra application into the codespace provided in Example 1 (eg: always having to add mkdcdisc, ...), you can simplify your setup by specifying your own Dockerfile, and add setup commands in there:&lt;br /&gt;
&lt;br /&gt;
* TODO: devcontainer.json&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* TODO: Dockerfile&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
* When you&#039;re finished with your Codespace, go to &lt;br /&gt;
** the 3-bars-Menu at the top left - &amp;quot;My Codespaces&amp;quot;&lt;br /&gt;
** on the left, select the codespace you were just running&lt;br /&gt;
** click on the 3 dots next to &amp;quot;Active&amp;quot;&lt;br /&gt;
** select &amp;quot;Stop codespace&amp;quot;&lt;br /&gt;
Doing this pro-actively will save you some free minutes, since the default timeout is 30 minutes.&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3574</id>
		<title>Codespaces</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3574"/>
		<updated>2024-07-13T20:44:59Z</updated>

		<summary type="html">&lt;p&gt;Tchan: add zip .cdi command&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Github [https://www.youtube.com/watch?v=sYJ3CHtT6WM Codespaces] lets you spawn a Dreamcast development environment in your browser in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
The only things you need are:&lt;br /&gt;
* a browser&lt;br /&gt;
* a github login.&lt;br /&gt;
&lt;br /&gt;
== Steps Overview ==&lt;br /&gt;
The main steps to get a Codespace working, are:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Create your code repository, or fork one&lt;br /&gt;
* Add a .devcontainer/devcontainer.json file to that repository&lt;br /&gt;
* Create &amp;amp; launch your codespace, and enjoy the IDE in your browser !&lt;br /&gt;
&lt;br /&gt;
That&#039;s all there is to it.&lt;br /&gt;
&lt;br /&gt;
Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].&lt;br /&gt;
&lt;br /&gt;
== Example 1: Build an .elf from a KallistiOS example ==&lt;br /&gt;
To compile the executable .elf file from a KallistiOS examples in a Codespace:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]&lt;br /&gt;
* Click on the &amp;quot;Fork&amp;quot; button, this will create a KallistiOS repository inside your account&lt;br /&gt;
* Click on the &amp;quot;Add File&amp;quot; button, then &amp;quot;Create New File&amp;quot;&lt;br /&gt;
* Name the file: &amp;quot;.devcontainer/devcontainer.json&amp;quot;, and paste the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	//&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	//    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	//},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Click on &amp;quot;Commit changes&amp;quot;, then &amp;quot;Commit Changes&amp;quot; again to save the file&lt;br /&gt;
* Go back to the root directory of your repository&lt;br /&gt;
* Launch your Codespace by clicking on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot; - &amp;quot;Create codespace on master&amp;quot;.&lt;br /&gt;
* This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.&lt;br /&gt;
* 3-bars-Menu at the top left - Terminal - New Terminal&lt;br /&gt;
* cd examples/dreamcast/2ndmix&lt;br /&gt;
* make clean&lt;br /&gt;
* make&lt;br /&gt;
* You should now have a &amp;quot;2ndmix.elf&amp;quot; in that folder&lt;br /&gt;
* Navigate to that folder (examples/dreamcast/2ndmix) on the file tree on the left, right-click on the file, and choose &amp;quot;Download...&amp;quot;&lt;br /&gt;
* Congratulations ! You successfully built an executable file for the Dreamcast. You can now upload that file in your favorite emulator, or send it to a real Dreamcast via a [https://dreamcast.wiki/Coder%27s_cable Coder&#039;s Cable] or a [https://dreamcast.wiki/Broadband_adapter Broadband Adapter]&lt;br /&gt;
&lt;br /&gt;
== Example 2: create a .cdi from the .elf of Example 1 ==&lt;br /&gt;
Having an .elf executable file is nice for small tests, but often you&#039;ll find yourself needing to build a .cdi disc image file:&lt;br /&gt;
* TODO: reopen codespace if needed&lt;br /&gt;
* Since our codespace does not contain mkdcdisc (the tool to build .cdi files), we&#039;ll add that to our codespace:&lt;br /&gt;
** Open a terminal in your codespace (3-bars-Menu at the top left - Terminal - New Terminal)&lt;br /&gt;
** cd /opt/toolchains/dc&lt;br /&gt;
** git clone https://gitlab.com/simulant/mkdcdisc&lt;br /&gt;
** cd mkdcdisc&lt;br /&gt;
** meson setup builddir&lt;br /&gt;
** meson compile -C builddir&lt;br /&gt;
** cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
* TODO: build .cdi file&lt;br /&gt;
** mkdcdisc -e 2ndmix.elf -o 2ndmix.cdi -n &amp;quot;2ndmix&amp;quot;&lt;br /&gt;
* TODO: make zip file and download - note about 25M&lt;br /&gt;
** zip -s 25M 2ndmix.zip 2ndmix.cdi&lt;br /&gt;
&lt;br /&gt;
== Example 3: Configuring a more complex Codespace ==&lt;br /&gt;
If you find yourself always adding extra application into the base codespace provided in Example 1 (eg: always having to add mkdcdisc, ...), you can simplify your setup by specifying your own Dockerfile, and add setup commands in there:&lt;br /&gt;
&lt;br /&gt;
* TODO: devcontainer.json&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* TODO: Dockerfile&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
* When you&#039;re finished with your Codespace, go to &lt;br /&gt;
** the 3-bars-Menu at the top left - &amp;quot;My Codespaces&amp;quot;&lt;br /&gt;
** on the left, select the codespace you were just running&lt;br /&gt;
** click on the 3 dots next to &amp;quot;Active&amp;quot;&lt;br /&gt;
** select &amp;quot;Stop codespace&amp;quot;&lt;br /&gt;
Doing this pro-actively will save you some free minutes, since the default timeout is 30 minutes.&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3573</id>
		<title>Codespaces</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3573"/>
		<updated>2024-07-13T20:43:43Z</updated>

		<summary type="html">&lt;p&gt;Tchan: adding mkdcdisc commands&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Github [https://www.youtube.com/watch?v=sYJ3CHtT6WM Codespaces] lets you spawn a Dreamcast development environment in your browser in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
The only things you need are:&lt;br /&gt;
* a browser&lt;br /&gt;
* a github login.&lt;br /&gt;
&lt;br /&gt;
== Steps Overview ==&lt;br /&gt;
The main steps to get a Codespace working, are:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Create your code repository, or fork one&lt;br /&gt;
* Add a .devcontainer/devcontainer.json file to that repository&lt;br /&gt;
* Create &amp;amp; launch your codespace, and enjoy the IDE in your browser !&lt;br /&gt;
&lt;br /&gt;
That&#039;s all there is to it.&lt;br /&gt;
&lt;br /&gt;
Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].&lt;br /&gt;
&lt;br /&gt;
== Example 1: Build an .elf from a KallistiOS example ==&lt;br /&gt;
To compile the executable .elf file from a KallistiOS examples in a Codespace:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]&lt;br /&gt;
* Click on the &amp;quot;Fork&amp;quot; button, this will create a KallistiOS repository inside your account&lt;br /&gt;
* Click on the &amp;quot;Add File&amp;quot; button, then &amp;quot;Create New File&amp;quot;&lt;br /&gt;
* Name the file: &amp;quot;.devcontainer/devcontainer.json&amp;quot;, and paste the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	//&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	//    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	//},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Click on &amp;quot;Commit changes&amp;quot;, then &amp;quot;Commit Changes&amp;quot; again to save the file&lt;br /&gt;
* Go back to the root directory of your repository&lt;br /&gt;
* Launch your Codespace by clicking on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot; - &amp;quot;Create codespace on master&amp;quot;.&lt;br /&gt;
* This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.&lt;br /&gt;
* 3-bars-Menu at the top left - Terminal - New Terminal&lt;br /&gt;
* cd examples/dreamcast/2ndmix&lt;br /&gt;
* make clean&lt;br /&gt;
* make&lt;br /&gt;
* You should now have a &amp;quot;2ndmix.elf&amp;quot; in that folder&lt;br /&gt;
* Navigate to that folder (examples/dreamcast/2ndmix) on the file tree on the left, right-click on the file, and choose &amp;quot;Download...&amp;quot;&lt;br /&gt;
* Congratulations ! You successfully built an executable file for the Dreamcast. You can now upload that file in your favorite emulator, or send it to a real Dreamcast via a [https://dreamcast.wiki/Coder%27s_cable Coder&#039;s Cable] or a [https://dreamcast.wiki/Broadband_adapter Broadband Adapter]&lt;br /&gt;
&lt;br /&gt;
== Example 2: create a .cdi from the .elf of Example 1 ==&lt;br /&gt;
Having an .elf executable file is nice for small tests, but often you&#039;ll find yourself needing to build a .cdi disc image file:&lt;br /&gt;
* TODO: reopen codespace if needed&lt;br /&gt;
* Since our codespace does not contain mkdcdisc (the tool to build .cdi files), we&#039;ll add that to our codespace:&lt;br /&gt;
** Open a terminal in your codespace (3-bars-Menu at the top left - Terminal - New Terminal)&lt;br /&gt;
** cd /opt/toolchains/dc&lt;br /&gt;
** git clone https://gitlab.com/simulant/mkdcdisc&lt;br /&gt;
** cd mkdcdisc&lt;br /&gt;
** meson setup builddir&lt;br /&gt;
** meson compile -C builddir&lt;br /&gt;
** cp ./builddir/mkdcdisc /opt/toolchains/dc/bin&lt;br /&gt;
* TODO: build .cdi file&lt;br /&gt;
** mkdcdisc -e 2ndmix.elf -o 2ndmix.cdi -n &amp;quot;2ndmix&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Example 3: Configuring a more complex Codespace ==&lt;br /&gt;
If you find yourself always adding extra application into the base codespace provided in Example 1 (eg: always having to add mkdcdisc, ...), you can simplify your setup by specifying your own Dockerfile, and add setup commands in there:&lt;br /&gt;
&lt;br /&gt;
* TODO: devcontainer.json&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* TODO: Dockerfile&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
* When you&#039;re finished with your Codespace, go to &lt;br /&gt;
** the 3-bars-Menu at the top left - &amp;quot;My Codespaces&amp;quot;&lt;br /&gt;
** on the left, select the codespace you were just running&lt;br /&gt;
** click on the 3 dots next to &amp;quot;Active&amp;quot;&lt;br /&gt;
** select &amp;quot;Stop codespace&amp;quot;&lt;br /&gt;
Doing this pro-actively will save you some free minutes, since the default timeout is 30 minutes.&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3572</id>
		<title>Codespaces</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3572"/>
		<updated>2024-07-13T19:26:41Z</updated>

		<summary type="html">&lt;p&gt;Tchan: add outline of Example 3&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Github [https://www.youtube.com/watch?v=sYJ3CHtT6WM Codespaces] lets you spawn a Dreamcast development environment in your browser in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
The only things you need are:&lt;br /&gt;
* a browser&lt;br /&gt;
* a github login.&lt;br /&gt;
&lt;br /&gt;
== Steps Overview ==&lt;br /&gt;
The main steps to get a Codespace working, are:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Create your code repository, or fork one&lt;br /&gt;
* Add a .devcontainer/devcontainer.json file to that repository&lt;br /&gt;
* Create &amp;amp; launch your codespace, and enjoy the IDE in your browser !&lt;br /&gt;
&lt;br /&gt;
That&#039;s all there is to it.&lt;br /&gt;
&lt;br /&gt;
Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].&lt;br /&gt;
&lt;br /&gt;
== Example 1: Build an .elf from a KallistiOS example ==&lt;br /&gt;
To compile the executable .elf file from a KallistiOS examples in a Codespace:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]&lt;br /&gt;
* Click on the &amp;quot;Fork&amp;quot; button, this will create a KallistiOS repository inside your account&lt;br /&gt;
* Click on the &amp;quot;Add File&amp;quot; button, then &amp;quot;Create New File&amp;quot;&lt;br /&gt;
* Name the file: &amp;quot;.devcontainer/devcontainer.json&amp;quot;, and paste the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	//&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	//    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	//},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Click on &amp;quot;Commit changes&amp;quot;, then &amp;quot;Commit Changes&amp;quot; again to save the file&lt;br /&gt;
* Go back to the root directory of your repository&lt;br /&gt;
* Launch your Codespace by clicking on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot; - &amp;quot;Create codespace on master&amp;quot;.&lt;br /&gt;
* This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.&lt;br /&gt;
* 3-bars-Menu at the top left - Terminal - New Terminal&lt;br /&gt;
* cd examples/dreamcast/2ndmix&lt;br /&gt;
* make clean&lt;br /&gt;
* make&lt;br /&gt;
* You should now have a &amp;quot;2ndmix.elf&amp;quot; in that folder&lt;br /&gt;
* Navigate to that folder (examples/dreamcast/2ndmix) on the file tree on the left, right-click on the file, and choose &amp;quot;Download...&amp;quot;&lt;br /&gt;
* Congratulations ! You successfully built an executable file for the Dreamcast. You can now upload that file in your favorite emulator, or send it to a real Dreamcast via a [https://dreamcast.wiki/Coder%27s_cable Coder&#039;s Cable] or a [https://dreamcast.wiki/Broadband_adapter Broadband Adapter]&lt;br /&gt;
&lt;br /&gt;
== Example 2: create a .cdi from the .elf of Example 1 ==&lt;br /&gt;
Having an .elf executable file is nice for small tests, but often you&#039;ll find yourself needing to build a .cdi disc image file:&lt;br /&gt;
* TODO: reopen codespace if needed&lt;br /&gt;
* TODO: download mkdcdisc &amp;amp; build it&lt;br /&gt;
* TODO: build .cdi file&lt;br /&gt;
&lt;br /&gt;
== Example 3: Configuring a more complex Codespace ==&lt;br /&gt;
If you find yourself always adding extra application into the base codespace provided in Example 1 (eg: always having to add mkdcdisc, ...), you can simplify your setup by specifying your own Dockerfile, and add setup commands in there:&lt;br /&gt;
&lt;br /&gt;
* TODO: devcontainer.json&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* TODO: Dockerfile&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
* When you&#039;re finished with your Codespace, go to &lt;br /&gt;
** the 3-bars-Menu at the top left - &amp;quot;My Codespaces&amp;quot;&lt;br /&gt;
** on the left, select the codespace you were just running&lt;br /&gt;
** click on the 3 dots next to &amp;quot;Active&amp;quot;&lt;br /&gt;
** select &amp;quot;Stop codespace&amp;quot;&lt;br /&gt;
Doing this pro-actively will save you some free minutes, since the default timeout is 30 minutes.&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3571</id>
		<title>Codespaces</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3571"/>
		<updated>2024-07-13T19:22:29Z</updated>

		<summary type="html">&lt;p&gt;Tchan: add outlines of Example 2&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Github [https://www.youtube.com/watch?v=sYJ3CHtT6WM Codespaces] lets you spawn a Dreamcast development environment in your browser in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
The only things you need are:&lt;br /&gt;
* a browser&lt;br /&gt;
* a github login.&lt;br /&gt;
&lt;br /&gt;
== Steps Overview ==&lt;br /&gt;
The main steps to get a Codespace working, are:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Create your code repository, or fork one&lt;br /&gt;
* Add a .devcontainer/devcontainer.json file to that repository&lt;br /&gt;
* Create &amp;amp; launch your codespace, and enjoy the IDE in your browser !&lt;br /&gt;
&lt;br /&gt;
That&#039;s all there is to it.&lt;br /&gt;
&lt;br /&gt;
Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].&lt;br /&gt;
&lt;br /&gt;
== Example 1: Build an .elf from a KallistiOS example ==&lt;br /&gt;
To compile the executable .elf file from a KallistiOS examples in a Codespace:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]&lt;br /&gt;
* Click on the &amp;quot;Fork&amp;quot; button, this will create a KallistiOS repository inside your account&lt;br /&gt;
* Click on the &amp;quot;Add File&amp;quot; button, then &amp;quot;Create New File&amp;quot;&lt;br /&gt;
* Name the file: &amp;quot;.devcontainer/devcontainer.json&amp;quot;, and paste the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	//&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	//    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	//},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Click on &amp;quot;Commit changes&amp;quot;, then &amp;quot;Commit Changes&amp;quot; again to save the file&lt;br /&gt;
* Go back to the root directory of your repository&lt;br /&gt;
* Launch your Codespace by clicking on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot; - &amp;quot;Create codespace on master&amp;quot;.&lt;br /&gt;
* This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.&lt;br /&gt;
* 3-bars-Menu at the top left - Terminal - New Terminal&lt;br /&gt;
* cd examples/dreamcast/2ndmix&lt;br /&gt;
* make clean&lt;br /&gt;
* make&lt;br /&gt;
* You should now have a &amp;quot;2ndmix.elf&amp;quot; in that folder&lt;br /&gt;
* Navigate to that folder (examples/dreamcast/2ndmix) on the file tree on the left, right-click on the file, and choose &amp;quot;Download...&amp;quot;&lt;br /&gt;
* Congratulations ! You successfully built an executable file for the Dreamcast. You can now upload that file in your favorite emulator, or send it to a real Dreamcast via a [https://dreamcast.wiki/Coder%27s_cable Coder&#039;s Cable] or a [https://dreamcast.wiki/Broadband_adapter Broadband Adapter]&lt;br /&gt;
&lt;br /&gt;
== Example 2: create a .cdi from the .elf of Example 1 ==&lt;br /&gt;
Having an .elf executable file is nice for small tests, but often you&#039;ll find yourself needing to build a .cdi disc image file:&lt;br /&gt;
* TODO: reopen codespace if needed&lt;br /&gt;
* TODO: download mkdcdisc &amp;amp; build it&lt;br /&gt;
* TODO: build .cdi file&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
* When you&#039;re finished with your Codespace, go to &lt;br /&gt;
** the 3-bars-Menu at the top left - &amp;quot;My Codespaces&amp;quot;&lt;br /&gt;
** on the left, select the codespace you were just running&lt;br /&gt;
** click on the 3 dots next to &amp;quot;Active&amp;quot;&lt;br /&gt;
** select &amp;quot;Stop codespace&amp;quot;&lt;br /&gt;
Doing this pro-actively will save you some free minutes, since the default timeout is 30 minutes.&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3570</id>
		<title>Codespaces</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3570"/>
		<updated>2024-07-13T19:10:05Z</updated>

		<summary type="html">&lt;p&gt;Tchan: add tip on how to close the codespace&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Github [https://www.youtube.com/watch?v=sYJ3CHtT6WM Codespaces] lets you spawn a Dreamcast development environment in your browser in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
The only things you need are:&lt;br /&gt;
* a browser&lt;br /&gt;
* a github login.&lt;br /&gt;
&lt;br /&gt;
== Steps Overview ==&lt;br /&gt;
The main steps to get a Codespace working, are:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Create your code repository, or fork one&lt;br /&gt;
* Add a .devcontainer/devcontainer.json file to that repository&lt;br /&gt;
* Create &amp;amp; launch your codespace, and enjoy the IDE in your browser !&lt;br /&gt;
&lt;br /&gt;
That&#039;s all there is to it.&lt;br /&gt;
&lt;br /&gt;
Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].&lt;br /&gt;
&lt;br /&gt;
== Example 1: Build an .elf from a KallistiOS example ==&lt;br /&gt;
To compile the executable .elf file from a KallistiOS examples in a Codespace:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]&lt;br /&gt;
* Click on the &amp;quot;Fork&amp;quot; button, this will create a KallistiOS repository inside your account&lt;br /&gt;
* Click on the &amp;quot;Add File&amp;quot; button, then &amp;quot;Create New File&amp;quot;&lt;br /&gt;
* Name the file: &amp;quot;.devcontainer/devcontainer.json&amp;quot;, and paste the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	//&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	//    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	//},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Click on &amp;quot;Commit changes&amp;quot;, then &amp;quot;Commit Changes&amp;quot; again to save the file&lt;br /&gt;
* Go back to the root directory of your repository&lt;br /&gt;
* Launch your Codespace by clicking on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot; - &amp;quot;Create codespace on master&amp;quot;.&lt;br /&gt;
* This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.&lt;br /&gt;
* 3-bars-Menu at the top left - Terminal - New Terminal&lt;br /&gt;
* cd examples/dreamcast/2ndmix&lt;br /&gt;
* make clean&lt;br /&gt;
* make&lt;br /&gt;
* You should now have a &amp;quot;2ndmix.elf&amp;quot; in that folder&lt;br /&gt;
* Navigate to that folder (examples/dreamcast/2ndmix) on the file tree on the left, right-click on the file, and choose &amp;quot;Download...&amp;quot;&lt;br /&gt;
* Congratulations ! You successfully built an executable file for the Dreamcast. You can now upload that file in your favorite emulator, or send it to a real Dreamcast via a [https://dreamcast.wiki/Coder%27s_cable Coder&#039;s Cable] or a [https://dreamcast.wiki/Broadband_adapter Broadband Adapter]&lt;br /&gt;
&lt;br /&gt;
== Example 2: TODO ==&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
* When you&#039;re finished with your Codespace, go to &lt;br /&gt;
** the 3-bars-Menu at the top left - &amp;quot;My Codespaces&amp;quot;&lt;br /&gt;
** on the left, select the codespace you were just running&lt;br /&gt;
** click on the 3 dots next to &amp;quot;Active&amp;quot;&lt;br /&gt;
** select &amp;quot;Stop codespace&amp;quot;&lt;br /&gt;
Doing this pro-actively will save you some free minutes, since the default timeout is 30 minutes.&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3569</id>
		<title>Codespaces</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3569"/>
		<updated>2024-07-13T19:06:10Z</updated>

		<summary type="html">&lt;p&gt;Tchan: finishing Example 1 (Kos example elf)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Github [https://www.youtube.com/watch?v=sYJ3CHtT6WM Codespaces] lets you spawn a Dreamcast development environment in your browser in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
The only things you need are:&lt;br /&gt;
* a browser&lt;br /&gt;
* a github login.&lt;br /&gt;
&lt;br /&gt;
== Steps Overview ==&lt;br /&gt;
The main steps to get a Codespace working, are:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Create your code repository, or fork one&lt;br /&gt;
* Add a .devcontainer/devcontainer.json file to that repository&lt;br /&gt;
* Create &amp;amp; launch your codespace, and enjoy the IDE in your browser !&lt;br /&gt;
&lt;br /&gt;
That&#039;s all there is to it.&lt;br /&gt;
&lt;br /&gt;
Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].&lt;br /&gt;
&lt;br /&gt;
== Example 1: Build an .elf from a KallistiOS example ==&lt;br /&gt;
To compile the executable .elf file from a KallistiOS examples in a Codespace:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]&lt;br /&gt;
* Click on the &amp;quot;Fork&amp;quot; button, this will create a KallistiOS repository inside your account&lt;br /&gt;
* Click on the &amp;quot;Add File&amp;quot; button, then &amp;quot;Create New File&amp;quot;&lt;br /&gt;
* Name the file: &amp;quot;.devcontainer/devcontainer.json&amp;quot;, and paste the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	//&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	//    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	//},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Click on &amp;quot;Commit changes&amp;quot;, then &amp;quot;Commit Changes&amp;quot; again to save the file&lt;br /&gt;
* Go back to the root directory of your repository&lt;br /&gt;
* Launch your Codespace by clicking on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot; - &amp;quot;Create codespace on master&amp;quot;.&lt;br /&gt;
* This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.&lt;br /&gt;
* 3-bars-Menu at the top left - Terminal - New Terminal&lt;br /&gt;
* cd examples/dreamcast/2ndmix&lt;br /&gt;
* make clean&lt;br /&gt;
* make&lt;br /&gt;
* You should now have a &amp;quot;2ndmix.elf&amp;quot; in that folder&lt;br /&gt;
* Navigate to that folder (examples/dreamcast/2ndmix) on the file tree on the left, right-click on the file, and choose &amp;quot;Download...&amp;quot;&lt;br /&gt;
* Congratulations ! You successfully built an executable file for the Dreamcast. You can now upload that file in your favorite emulator, or send it to a real Dreamcast via a [https://dreamcast.wiki/Coder%27s_cable Coder&#039;s Cable] or a [https://dreamcast.wiki/Broadband_adapter Broadband Adapter]&lt;br /&gt;
&lt;br /&gt;
== Example 2: TODO ==&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
* TODO&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3568</id>
		<title>Codespaces</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3568"/>
		<updated>2024-07-13T18:28:09Z</updated>

		<summary type="html">&lt;p&gt;Tchan: small changes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Github [https://www.youtube.com/watch?v=sYJ3CHtT6WM Codespaces] lets you spawn a Dreamcast development environment in your browser in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
The only things you need are:&lt;br /&gt;
* a browser&lt;br /&gt;
* a github login.&lt;br /&gt;
&lt;br /&gt;
== Steps Overview ==&lt;br /&gt;
The main steps to get a Codespace working, are:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Create your code repository, or fork one&lt;br /&gt;
* Add a .devcontainer/devcontainer.json file to that repository&lt;br /&gt;
* Create &amp;amp; launch your codespace, and enjoy the IDE in your browser !&lt;br /&gt;
&lt;br /&gt;
That&#039;s all there is to it.&lt;br /&gt;
&lt;br /&gt;
Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].&lt;br /&gt;
&lt;br /&gt;
== Example 1: Build an .elf from a KallistiOS example ==&lt;br /&gt;
To compile the executable .elf file from a KallistiOS examples in a Codespace:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]&lt;br /&gt;
* Click on the &amp;quot;Fork&amp;quot; button, this will create a KallistiOS repository inside your account&lt;br /&gt;
* Click on the &amp;quot;Add File&amp;quot; button, then &amp;quot;Create New File&amp;quot;&lt;br /&gt;
* Name the file: &amp;quot;.devcontainer/devcontainer.json&amp;quot;, and paste the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	//&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	//    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	//},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Commit (aka, save) the file&lt;br /&gt;
* Launch your Codespace by clicking on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot; - &amp;quot;Create codespace on main&amp;quot;.&lt;br /&gt;
* This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.&lt;br /&gt;
* TODO: navigate to examples, compile one, download elf&lt;br /&gt;
&lt;br /&gt;
== Example 2: TODO ==&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
* TODO&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3567</id>
		<title>Codespaces</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3567"/>
		<updated>2024-07-13T17:19:20Z</updated>

		<summary type="html">&lt;p&gt;Tchan: /* Steps Overview */ added free hours info&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Github [https://www.youtube.com/watch?v=sYJ3CHtT6WM Codespaces] lets you spawn a Dreamcast development environment in your browser in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
The only things you need are:&lt;br /&gt;
* a browser&lt;br /&gt;
* a github login.&lt;br /&gt;
&lt;br /&gt;
== Steps Overview ==&lt;br /&gt;
The main steps to get a Codespace working, are:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Create your code repository, or fork one&lt;br /&gt;
* Add a .devcontainer/devcontainer.json file to that repository&lt;br /&gt;
* Create &amp;amp; launch your codespace, and enjoy the IDE in your browser !&lt;br /&gt;
&lt;br /&gt;
That&#039;s all there is to it.&lt;br /&gt;
&lt;br /&gt;
Free github accounts get [https://docs.github.com/en/billing/managing-billing-for-github-codespaces/about-billing-for-github-codespaces#monthly-included-storage-and-core-hours-for-personal-accounts 120 free core hours per month].&lt;br /&gt;
&lt;br /&gt;
== Example 1: KallistiOS examples ==&lt;br /&gt;
To compile the KallistiOS examples in a Codespace:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]&lt;br /&gt;
* Click on the &amp;quot;Fork&amp;quot; button, this will create a KallistiOS repository inside your account&lt;br /&gt;
* Click on the &amp;quot;Add File&amp;quot; button, then &amp;quot;Create New File&amp;quot;&lt;br /&gt;
* Name the file: &amp;quot;.devcontainer/devcontainer.json&amp;quot;, and paste the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	//&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	//    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	//},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Commit (aka, save) the file&lt;br /&gt;
* Launch your Codespace by clicking on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot; - &amp;quot;Create codespace on main&amp;quot;.&lt;br /&gt;
* This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.&lt;br /&gt;
* TODO: navigate to examples, compile one, download elf&lt;br /&gt;
&lt;br /&gt;
== Example 2: TODO ==&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
* TODO&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3566</id>
		<title>Codespaces</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Codespaces&amp;diff=3566"/>
		<updated>2024-07-13T17:17:17Z</updated>

		<summary type="html">&lt;p&gt;Tchan: initial version&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Github [https://www.youtube.com/watch?v=sYJ3CHtT6WM Codespaces] lets you spawn a Dreamcast development environment in your browser in a matter of minutes.&lt;br /&gt;
&lt;br /&gt;
The only things you need are:&lt;br /&gt;
* a browser&lt;br /&gt;
* a github login.&lt;br /&gt;
&lt;br /&gt;
== Steps Overview ==&lt;br /&gt;
The main steps to get a Codespace working, are:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Create your code repository, or fork one&lt;br /&gt;
* Add a .devcontainer/devcontainer.json file to that repository&lt;br /&gt;
* Create &amp;amp; launch your codespace, and enjoy the IDE in your browser !&lt;br /&gt;
&lt;br /&gt;
That&#039;s all there is to it.&lt;br /&gt;
&lt;br /&gt;
== Example 1: KallistiOS examples ==&lt;br /&gt;
To compile the KallistiOS examples in a Codespace:&lt;br /&gt;
* Login into [https://github.com github]&lt;br /&gt;
* Got to [https://github.com/KallistiOS/KallistiOS the KallistiOS repository]&lt;br /&gt;
* Click on the &amp;quot;Fork&amp;quot; button, this will create a KallistiOS repository inside your account&lt;br /&gt;
* Click on the &amp;quot;Add File&amp;quot; button, then &amp;quot;Create New File&amp;quot;&lt;br /&gt;
* Name the file: &amp;quot;.devcontainer/devcontainer.json&amp;quot;, and paste the following contents:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;json&amp;quot;&amp;gt;&lt;br /&gt;
// For format details, see https://aka.ms/devcontainer.json. &lt;br /&gt;
// For config options, see the README at: https://github.com/devcontainers/templates/tree/main/src/alpine&lt;br /&gt;
{&lt;br /&gt;
	&amp;quot;name&amp;quot;: &amp;quot;My_Codespace&amp;quot;,&lt;br /&gt;
		&lt;br /&gt;
	// Either use a pre-built image (= a Docker container)...&lt;br /&gt;
	&amp;quot;image&amp;quot;: &amp;quot;ghcr.io/kos-builds/kos-ports-dc:sha-656a397-14.1.0&amp;quot;,&lt;br /&gt;
	// ... or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile&lt;br /&gt;
	//&amp;quot;build&amp;quot;: { // Path is relative to the devcontainer.json file.&lt;br /&gt;
	//    &amp;quot;dockerfile&amp;quot;: &amp;quot;Dockerfile&amp;quot;&lt;br /&gt;
	//},&lt;br /&gt;
		&lt;br /&gt;
	// Features to add to the dev container. More info: https://containers.dev/features.&lt;br /&gt;
	// &amp;quot;features&amp;quot;: {},&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;forwardPorts&#039; to make a list of ports inside the container available locally.&lt;br /&gt;
	// &amp;quot;forwardPorts&amp;quot;: [],&lt;br /&gt;
&lt;br /&gt;
	// Use &#039;postCreateCommand&#039; to run commands after the container is created.&lt;br /&gt;
	//&amp;quot;postCreateCommand&amp;quot;: &amp;quot;source /opt/toolchains/dc/kos/environ.sh&amp;quot;,&lt;br /&gt;
&lt;br /&gt;
	// Configure tool-specific properties.&lt;br /&gt;
	&amp;quot;customizations&amp;quot;: {&lt;br /&gt;
	    &amp;quot;vscode&amp;quot;: {&lt;br /&gt;
	        &amp;quot;extensions&amp;quot;: [&lt;br /&gt;
		    &amp;quot;ms-vscode.cpptools&amp;quot;&lt;br /&gt;
	        ]&lt;br /&gt;
	    }&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.&lt;br /&gt;
	// &amp;quot;remoteUser&amp;quot;: &amp;quot;root&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
* Commit (aka, save) the file&lt;br /&gt;
* Launch your Codespace by clicking on the &amp;quot;&amp;lt;&amp;gt; Code&amp;quot; button, then &amp;quot;Codespaces&amp;quot; - &amp;quot;Create codespace on main&amp;quot;.&lt;br /&gt;
* This will launch Visual Studio Code in your browser. The first time it will take a couple of minutes to launch, after that it will be faster.&lt;br /&gt;
* TODO: navigate to examples, compile one, download elf&lt;br /&gt;
&lt;br /&gt;
== Example 2: TODO ==&lt;br /&gt;
&lt;br /&gt;
== Tips ==&lt;br /&gt;
* TODO&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Compiling_for_Naomi&amp;diff=3397</id>
		<title>Compiling for Naomi</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Compiling_for_Naomi&amp;diff=3397"/>
		<updated>2024-02-04T18:42:50Z</updated>

		<summary type="html">&lt;p&gt;Tchan: /* Send your file to a Naomi via a serial cable */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;KallistiOS is able to produce executables that can run on the Sega Naomi arcarde boards.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* 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)&lt;br /&gt;
* download (git clone) kos &amp;amp; kos-ports into separate folders, eg /kosnaomi &amp;amp; /kos-portsnaomi&lt;br /&gt;
* adapt the following in /kosnaomi/environ.sh:&lt;br /&gt;
     KOS_SUBARCH=&amp;quot;naomi&amp;quot;&lt;br /&gt;
     KOS_BASE  &amp;lt;- point to your naomi kos folder&lt;br /&gt;
     KOS_PORTS &amp;lt;- point to your naomi kos-ports folder&lt;br /&gt;
* Build these /kosnaomi &amp;amp; /kos-portsnaomi&lt;br /&gt;
* if you want to use raylib, you need recent raylib4Dreamcast code (you need commit TODO of 04 feb 2024)&lt;br /&gt;
&lt;br /&gt;
== Compilation to a .ELF ==&lt;br /&gt;
Example compilation for a raylib example:&lt;br /&gt;
* Go to the folder that contains your example, eg:&lt;br /&gt;
     cd /opt/toolchains/dc/kos-portsnaomi/raylib4Dreamcast/samples/shapes/basic_shapes&lt;br /&gt;
* source the environ.sh of your naomi folder:&lt;br /&gt;
     source /opt/toolchains/dc/kosnaomi/environ.sh&lt;br /&gt;
* build the .elf for Naomi:&lt;br /&gt;
     make&lt;br /&gt;
&lt;br /&gt;
== Converting an .ELF to a .DAT to send to a Naomi DIMM ==&lt;br /&gt;
* Convert your Naomi-built KOS .ELF to a .BIN file:&lt;br /&gt;
     /opt/toolchains/dc/sh-elf/sh-elf/bin/objcopy -R .stack -O binary raylib.elf raylib_nao.bin&lt;br /&gt;
&lt;br /&gt;
* convert your Naomi .BIN to a .DAT file:&lt;br /&gt;
     /opt/toolchains/dc/kosnaomi/utils/naomibintool/naomibintool build raylib_nao.dat -d DEVELOPERNAME -t GAMETITLE -b raylib_nao.bin&lt;br /&gt;
&lt;br /&gt;
== Send your .DAT file to a Naomi DIMM via ethernet ==&lt;br /&gt;
* Assuming the IP address of the Naomi is 192.168.1.202:&lt;br /&gt;
     /opt/toolchains/dc/kosnaomi/utils/naominetboot/naominetboot -t 192.168.1.202 -x raylib_nao.dat -a&lt;br /&gt;
&lt;br /&gt;
== Send your .ELF file to a Naomi via a serial cable ==&lt;br /&gt;
If you don&#039;t have a DIMM board, or just want to use dc-tool-serial to upload a Naomi .elf via a serial cable, you need:&lt;br /&gt;
* a custom bios containing dc-load-ser&lt;br /&gt;
* recent KallistiOS code (you need commit [https://github.com/KallistiOS/KallistiOS/commit/d059b922625b6fd1f05dac4381b48d0ba571650b d059b92] of 04 feb 2024)&lt;br /&gt;
* upload the .ELF via your usual dc-tool-ser command, eg:&lt;br /&gt;
     dc-tool-ser -b 1562500 -t /dev/ttyUSB0 -x raylib.elf&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Compiling_for_Naomi&amp;diff=3396</id>
		<title>Compiling for Naomi</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Compiling_for_Naomi&amp;diff=3396"/>
		<updated>2024-02-04T17:13:16Z</updated>

		<summary type="html">&lt;p&gt;Tchan: /* Send your file to a Naomi via a serial cable */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;KallistiOS is able to produce executables that can run on the Sega Naomi arcarde boards.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* 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)&lt;br /&gt;
* download (git clone) kos &amp;amp; kos-ports into separate folders, eg /kosnaomi &amp;amp; /kos-portsnaomi&lt;br /&gt;
* adapt the following in /kosnaomi/environ.sh:&lt;br /&gt;
     KOS_SUBARCH=&amp;quot;naomi&amp;quot;&lt;br /&gt;
     KOS_BASE  &amp;lt;- point to your naomi kos folder&lt;br /&gt;
     KOS_PORTS &amp;lt;- point to your naomi kos-ports folder&lt;br /&gt;
* Build these /kosnaomi &amp;amp; /kos-portsnaomi&lt;br /&gt;
* if you want to use raylib, you need recent raylib4Dreamcast code (you need commit TODO of 04 feb 2024)&lt;br /&gt;
&lt;br /&gt;
== Compilation to a .ELF ==&lt;br /&gt;
Example compilation for a raylib example:&lt;br /&gt;
* Go to the folder that contains your example, eg:&lt;br /&gt;
     cd /opt/toolchains/dc/kos-portsnaomi/raylib4Dreamcast/samples/shapes/basic_shapes&lt;br /&gt;
* source the environ.sh of your naomi folder:&lt;br /&gt;
     source /opt/toolchains/dc/kosnaomi/environ.sh&lt;br /&gt;
* build the .elf for Naomi:&lt;br /&gt;
     make&lt;br /&gt;
&lt;br /&gt;
== Converting an .ELF to a .DAT to send to a Naomi DIMM ==&lt;br /&gt;
* Convert your Naomi-built KOS .ELF to a .BIN file:&lt;br /&gt;
     /opt/toolchains/dc/sh-elf/sh-elf/bin/objcopy -R .stack -O binary raylib.elf raylib_nao.bin&lt;br /&gt;
&lt;br /&gt;
* convert your Naomi .BIN to a .DAT file:&lt;br /&gt;
     /opt/toolchains/dc/kosnaomi/utils/naomibintool/naomibintool build raylib_nao.dat -d DEVELOPERNAME -t GAMETITLE -b raylib_nao.bin&lt;br /&gt;
&lt;br /&gt;
== Send your .DAT file to a Naomi DIMM via ethernet ==&lt;br /&gt;
* Assuming the IP address of the Naomi is 192.168.1.202:&lt;br /&gt;
     /opt/toolchains/dc/kosnaomi/utils/naominetboot/naominetboot -t 192.168.1.202 -x raylib_nao.dat -a&lt;br /&gt;
&lt;br /&gt;
== Send your file to a Naomi via a serial cable ==&lt;br /&gt;
If you don&#039;t have a DIMM board, or just want to use dc-tool-serial to upload a Naomi .elf via a serial cable, you need:&lt;br /&gt;
* a custom bios containing dc-load-ser&lt;br /&gt;
* recent KallistiOS code (you need commit [https://github.com/KallistiOS/KallistiOS/commit/d059b922625b6fd1f05dac4381b48d0ba571650b d059b92] of 04 feb 2024)&lt;br /&gt;
* upload the .ELF via your usual dc-tool-ser command, eg:&lt;br /&gt;
     dc-tool-ser -b 1562500 -t /dev/ttyUSB0 -x raylib.elf&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Compiling_for_Naomi&amp;diff=3395</id>
		<title>Compiling for Naomi</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Compiling_for_Naomi&amp;diff=3395"/>
		<updated>2024-02-04T17:11:12Z</updated>

		<summary type="html">&lt;p&gt;Tchan: /* Send your file to a Naomi via a serial cable */ added commit link for kos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;KallistiOS is able to produce executables that can run on the Sega Naomi arcarde boards.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* 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)&lt;br /&gt;
* download (git clone) kos &amp;amp; kos-ports into separate folders, eg /kosnaomi &amp;amp; /kos-portsnaomi&lt;br /&gt;
* adapt the following in /kosnaomi/environ.sh:&lt;br /&gt;
     KOS_SUBARCH=&amp;quot;naomi&amp;quot;&lt;br /&gt;
     KOS_BASE  &amp;lt;- point to your naomi kos folder&lt;br /&gt;
     KOS_PORTS &amp;lt;- point to your naomi kos-ports folder&lt;br /&gt;
* Build these /kosnaomi &amp;amp; /kos-portsnaomi&lt;br /&gt;
* if you want to use raylib, you need recent raylib4Dreamcast code (you need commit TODO of 04 feb 2024)&lt;br /&gt;
&lt;br /&gt;
== Compilation to a .ELF ==&lt;br /&gt;
Example compilation for a raylib example:&lt;br /&gt;
* Go to the folder that contains your example, eg:&lt;br /&gt;
     cd /opt/toolchains/dc/kos-portsnaomi/raylib4Dreamcast/samples/shapes/basic_shapes&lt;br /&gt;
* source the environ.sh of your naomi folder:&lt;br /&gt;
     source /opt/toolchains/dc/kosnaomi/environ.sh&lt;br /&gt;
* build the .elf for Naomi:&lt;br /&gt;
     make&lt;br /&gt;
&lt;br /&gt;
== Converting an .ELF to a .DAT to send to a Naomi DIMM ==&lt;br /&gt;
* Convert your Naomi-built KOS .ELF to a .BIN file:&lt;br /&gt;
     /opt/toolchains/dc/sh-elf/sh-elf/bin/objcopy -R .stack -O binary raylib.elf raylib_nao.bin&lt;br /&gt;
&lt;br /&gt;
* convert your Naomi .BIN to a .DAT file:&lt;br /&gt;
     /opt/toolchains/dc/kosnaomi/utils/naomibintool/naomibintool build raylib_nao.dat -d DEVELOPERNAME -t GAMETITLE -b raylib_nao.bin&lt;br /&gt;
&lt;br /&gt;
== Send your .DAT file to a Naomi DIMM via ethernet ==&lt;br /&gt;
* Assuming the IP address of the Naomi is 192.168.1.202:&lt;br /&gt;
     /opt/toolchains/dc/kosnaomi/utils/naominetboot/naominetboot -t 192.168.1.202 -x raylib_nao.dat -a&lt;br /&gt;
&lt;br /&gt;
== Send your file to a Naomi via a serial cable ==&lt;br /&gt;
If you don&#039;t have a DIMM board, or just want to use dc-tool-serial to upload a Naomi .elf via a serial cable, you need:&lt;br /&gt;
* a custom bios containing dc-load-ser&lt;br /&gt;
* recent KallistiOS code (you need commit [https://github.com/KallistiOS/KallistiOS/commit/d059b922625b6fd1f05dac4381b48d0ba571650b d059b92] of 04 feb 2024)&lt;br /&gt;
* upload the .ELF via your regulat dc-tool-ser command, eg:&lt;br /&gt;
     dc-tool-ser -b 1562500 -t /dev/ttyUSB0 -x raylib.elf&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Compiling_for_Naomi&amp;diff=3394</id>
		<title>Compiling for Naomi</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Compiling_for_Naomi&amp;diff=3394"/>
		<updated>2024-02-04T17:09:41Z</updated>

		<summary type="html">&lt;p&gt;Tchan: /* Prerequisites */ added gitlab link to required commit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;KallistiOS is able to produce executables that can run on the Sega Naomi arcarde boards.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* 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)&lt;br /&gt;
* download (git clone) kos &amp;amp; kos-ports into separate folders, eg /kosnaomi &amp;amp; /kos-portsnaomi&lt;br /&gt;
* adapt the following in /kosnaomi/environ.sh:&lt;br /&gt;
     KOS_SUBARCH=&amp;quot;naomi&amp;quot;&lt;br /&gt;
     KOS_BASE  &amp;lt;- point to your naomi kos folder&lt;br /&gt;
     KOS_PORTS &amp;lt;- point to your naomi kos-ports folder&lt;br /&gt;
* Build these /kosnaomi &amp;amp; /kos-portsnaomi&lt;br /&gt;
* if you want to use raylib, you need recent raylib4Dreamcast code (you need commit TODO of 04 feb 2024)&lt;br /&gt;
&lt;br /&gt;
== Compilation to a .ELF ==&lt;br /&gt;
Example compilation for a raylib example:&lt;br /&gt;
* Go to the folder that contains your example, eg:&lt;br /&gt;
     cd /opt/toolchains/dc/kos-portsnaomi/raylib4Dreamcast/samples/shapes/basic_shapes&lt;br /&gt;
* source the environ.sh of your naomi folder:&lt;br /&gt;
     source /opt/toolchains/dc/kosnaomi/environ.sh&lt;br /&gt;
* build the .elf for Naomi:&lt;br /&gt;
     make&lt;br /&gt;
&lt;br /&gt;
== Converting an .ELF to a .DAT to send to a Naomi DIMM ==&lt;br /&gt;
* Convert your Naomi-built KOS .ELF to a .BIN file:&lt;br /&gt;
     /opt/toolchains/dc/sh-elf/sh-elf/bin/objcopy -R .stack -O binary raylib.elf raylib_nao.bin&lt;br /&gt;
&lt;br /&gt;
* convert your Naomi .BIN to a .DAT file:&lt;br /&gt;
     /opt/toolchains/dc/kosnaomi/utils/naomibintool/naomibintool build raylib_nao.dat -d DEVELOPERNAME -t GAMETITLE -b raylib_nao.bin&lt;br /&gt;
&lt;br /&gt;
== Send your .DAT file to a Naomi DIMM via ethernet ==&lt;br /&gt;
* Assuming the IP address of the Naomi is 192.168.1.202:&lt;br /&gt;
     /opt/toolchains/dc/kosnaomi/utils/naominetboot/naominetboot -t 192.168.1.202 -x raylib_nao.dat -a&lt;br /&gt;
&lt;br /&gt;
== Send your file to a Naomi via a serial cable ==&lt;br /&gt;
If you don&#039;t have a DIMM board, or just want to use dc-tool-serial to upload a Naomi .elf via a serial cable, you need:&lt;br /&gt;
* a custom bios containing dc-load-ser&lt;br /&gt;
* recent KallistiOS code (you need commit d059b92 of 04 feb 2024)&lt;br /&gt;
* upload the .ELF via your regulat dc-tool-ser command, eg:&lt;br /&gt;
     dc-tool-ser -b 1562500 -t /dev/ttyUSB0 -x raylib.elf&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Compiling_for_Naomi&amp;diff=3393</id>
		<title>Compiling for Naomi</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Compiling_for_Naomi&amp;diff=3393"/>
		<updated>2024-02-04T16:43:27Z</updated>

		<summary type="html">&lt;p&gt;Tchan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;KallistiOS is able to produce executables that can run on the Sega Naomi arcarde boards.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* if you want to use GLdc, you need recent GLdc code (you need commit bd17c995 of 03 feb 2024)&lt;br /&gt;
* download (git clone) kos &amp;amp; kos-ports into separate folders, eg /kosnaomi &amp;amp; /kos-portsnaomi&lt;br /&gt;
* adapt the following in /kosnaomi/environ.sh:&lt;br /&gt;
     KOS_SUBARCH=&amp;quot;naomi&amp;quot;&lt;br /&gt;
     KOS_BASE  &amp;lt;- point to your naomi kos folder&lt;br /&gt;
     KOS_PORTS &amp;lt;- point to your naomi kos-ports folder&lt;br /&gt;
* Build these /kosnaomi &amp;amp; /kos-portsnaomi&lt;br /&gt;
* if you want to use raylib, you need recent raylib4Dreamcast code (you need commit TODO of 04 feb 2024)&lt;br /&gt;
&lt;br /&gt;
== Compilation to a .ELF ==&lt;br /&gt;
Example compilation for a raylib example:&lt;br /&gt;
* Go to the folder that contains your example, eg:&lt;br /&gt;
     cd /opt/toolchains/dc/kos-portsnaomi/raylib4Dreamcast/samples/shapes/basic_shapes&lt;br /&gt;
* source the environ.sh of your naomi folder:&lt;br /&gt;
     source /opt/toolchains/dc/kosnaomi/environ.sh&lt;br /&gt;
* build the .elf for Naomi:&lt;br /&gt;
     make&lt;br /&gt;
&lt;br /&gt;
== Converting an .ELF to a .DAT to send to a Naomi DIMM ==&lt;br /&gt;
* Convert your Naomi-built KOS .ELF to a .BIN file:&lt;br /&gt;
     /opt/toolchains/dc/sh-elf/sh-elf/bin/objcopy -R .stack -O binary raylib.elf raylib_nao.bin&lt;br /&gt;
&lt;br /&gt;
* convert your Naomi .BIN to a .DAT file:&lt;br /&gt;
     /opt/toolchains/dc/kosnaomi/utils/naomibintool/naomibintool build raylib_nao.dat -d DEVELOPERNAME -t GAMETITLE -b raylib_nao.bin&lt;br /&gt;
&lt;br /&gt;
== Send your .DAT file to a Naomi DIMM via ethernet ==&lt;br /&gt;
* Assuming the IP address of the Naomi is 192.168.1.202:&lt;br /&gt;
     /opt/toolchains/dc/kosnaomi/utils/naominetboot/naominetboot -t 192.168.1.202 -x raylib_nao.dat -a&lt;br /&gt;
&lt;br /&gt;
== Send your file to a Naomi via a serial cable ==&lt;br /&gt;
If you don&#039;t have a DIMM board, or just want to use dc-tool-serial to upload a Naomi .elf via a serial cable, you need:&lt;br /&gt;
* a custom bios containing dc-load-ser&lt;br /&gt;
* recent KallistiOS code (you need commit d059b92 of 04 feb 2024)&lt;br /&gt;
* upload the .ELF via your regulat dc-tool-ser command, eg:&lt;br /&gt;
     dc-tool-ser -b 1562500 -t /dev/ttyUSB0 -x raylib.elf&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Compiling_for_Naomi&amp;diff=3392</id>
		<title>Compiling for Naomi</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Compiling_for_Naomi&amp;diff=3392"/>
		<updated>2024-02-04T15:41:29Z</updated>

		<summary type="html">&lt;p&gt;Tchan: added 2024 to the commit infos&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;KallistiOS is able to produce executables that can run on the Sega Naomi arcarde boards.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* if you want to use GLDC, you need recent GLdc code (you need commit bd17c995 of 03 feb 2024)&lt;br /&gt;
* download (git clone) kos &amp;amp; kos-ports into separate folders, eg /kosnaomi &amp;amp; /kos-portsnaomi&lt;br /&gt;
* adapt the following in /kosnaomi/environ.sh:&lt;br /&gt;
     KOS_SUBARCH=&amp;quot;naomi&amp;quot;&lt;br /&gt;
     KOS_BASE  &amp;lt;- point to your naomi kos folder&lt;br /&gt;
     KOS_PORTS &amp;lt;- point to your naomi kos-ports folder&lt;br /&gt;
* Build these /kosnaomi &amp;amp; /kos-portsnaomi&lt;br /&gt;
* if you want to use raylib, you need recent raylib4Dreamcast code (you need commit TODO of 04 feb 2024)&lt;br /&gt;
&lt;br /&gt;
== Compilation to a .ELF ==&lt;br /&gt;
Example compilation for a raylib example:&lt;br /&gt;
* Go to the folder that contains your example, eg:&lt;br /&gt;
     cd /opt/toolchains/dc/kos-portsnaomi/raylib4Dreamcast/samples/shapes/basic_shapes&lt;br /&gt;
* source the environ.sh of your naomi folder:&lt;br /&gt;
     source /opt/toolchains/dc/kosnaomi/environ.sh&lt;br /&gt;
* build the .elf for Naomi:&lt;br /&gt;
     make&lt;br /&gt;
&lt;br /&gt;
== Converting an .ELF to a .DAT to send to a Naomi DIMM ==&lt;br /&gt;
* Convert your Naomi-built KOS .ELF to a .BIN file:&lt;br /&gt;
     /opt/toolchains/dc/sh-elf/sh-elf/bin/objcopy -R .stack -O binary raylib.elf raylib_nao.bin&lt;br /&gt;
&lt;br /&gt;
* convert your Naomi .BIN to a .DAT file:&lt;br /&gt;
     /opt/toolchains/dc/kosnaomi/utils/naomibintool/naomibintool build raylib_nao.dat -d DEVELOPERNAME -t GAMETITLE -b raylib_nao.bin&lt;br /&gt;
&lt;br /&gt;
== Send your .DAT file to a Naomi DIMM via ethernet ==&lt;br /&gt;
* Assuming the IP address of the Naomi is 192.168.1.202:&lt;br /&gt;
     /opt/toolchains/dc/kosnaomi/utils/naominetboot/naominetboot -t 192.168.1.202 -x raylib_nao.dat -a&lt;br /&gt;
&lt;br /&gt;
== Send your file to a Naomi via a serial cable ==&lt;br /&gt;
If you don&#039;t have a DIMM board, or just want to use dc-tool-serial to upload a Naomi .elf via a serial cable, you need:&lt;br /&gt;
* a custom bios containing dc-load-ser&lt;br /&gt;
* recent KallistiOS code (you need commit d059b92 of 04 feb 2024)&lt;br /&gt;
* upload the .ELF via your regulat dc-tool-ser command, eg:&lt;br /&gt;
     dc-tool-ser -b 1562500 -t /dev/ttyUSB0 -x raylib.elf&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Compiling_for_Naomi&amp;diff=3391</id>
		<title>Compiling for Naomi</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Compiling_for_Naomi&amp;diff=3391"/>
		<updated>2024-02-04T15:39:55Z</updated>

		<summary type="html">&lt;p&gt;Tchan: added info that kos/kos-ports need to be built for Naomi&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;KallistiOS is able to produce executables that can run on the Sega Naomi arcarde boards.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* if you want to use GLDC, you need recent GLdc code (you need commit bd17c995 of 03 feb 2024)&lt;br /&gt;
* download (git clone) kos &amp;amp; kos-ports into separate folders, eg /kosnaomi &amp;amp; /kos-portsnaomi&lt;br /&gt;
* adapt the following in /kosnaomi/environ.sh:&lt;br /&gt;
     KOS_SUBARCH=&amp;quot;naomi&amp;quot;&lt;br /&gt;
     KOS_BASE  &amp;lt;- point to your naomi kos folder&lt;br /&gt;
     KOS_PORTS &amp;lt;- point to your naomi kos-ports folder&lt;br /&gt;
* Build these /kosnaomi &amp;amp; /kos-portsnaomi&lt;br /&gt;
* if you want to use raylib, you need recent raylib4Dreamcast code (you need commit TODO of 04 feb )&lt;br /&gt;
&lt;br /&gt;
== Compilation to a .ELF ==&lt;br /&gt;
Example compilation for a raylib example:&lt;br /&gt;
* Go to the folder that contains your example, eg:&lt;br /&gt;
     cd /opt/toolchains/dc/kos-portsnaomi/raylib4Dreamcast/samples/shapes/basic_shapes&lt;br /&gt;
* source the environ.sh of your naomi folder:&lt;br /&gt;
     source /opt/toolchains/dc/kosnaomi/environ.sh&lt;br /&gt;
* build the .elf for Naomi:&lt;br /&gt;
     make&lt;br /&gt;
&lt;br /&gt;
== Converting an .ELF to a .DAT to send to a Naomi DIMM ==&lt;br /&gt;
* Convert your Naomi-built KOS .ELF to a .BIN file:&lt;br /&gt;
     /opt/toolchains/dc/sh-elf/sh-elf/bin/objcopy -R .stack -O binary raylib.elf raylib_nao.bin&lt;br /&gt;
&lt;br /&gt;
* convert your Naomi .BIN to a .DAT file:&lt;br /&gt;
     /opt/toolchains/dc/kosnaomi/utils/naomibintool/naomibintool build raylib_nao.dat -d DEVELOPERNAME -t GAMETITLE -b raylib_nao.bin&lt;br /&gt;
&lt;br /&gt;
== Send your .DAT file to a Naomi DIMM via ethernet ==&lt;br /&gt;
* Assuming the IP address of the Naomi is 192.168.1.202:&lt;br /&gt;
     /opt/toolchains/dc/kosnaomi/utils/naominetboot/naominetboot -t 192.168.1.202 -x raylib_nao.dat -a&lt;br /&gt;
&lt;br /&gt;
== Send your file to a Naomi via a serial cable ==&lt;br /&gt;
If you don&#039;t have a DIMM board, or just want to use dc-tool-serial to upload a Naomi .elf via a serial cable, you need:&lt;br /&gt;
* a custom bios containing dc-load-ser&lt;br /&gt;
* recent KallistiOS code (you need commit d059b92 of 04 feb)&lt;br /&gt;
* upload the .ELF via your regulat dc-tool-ser command, eg:&lt;br /&gt;
     dc-tool-ser -b 1562500 -t /dev/ttyUSB0 -x raylib.elf&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Compiling_for_Naomi&amp;diff=3390</id>
		<title>Compiling for Naomi</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Compiling_for_Naomi&amp;diff=3390"/>
		<updated>2024-02-04T15:33:37Z</updated>

		<summary type="html">&lt;p&gt;Tchan: added commit&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;KallistiOS is able to produce executables that can run on the Sega Naomi arcarde boards.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* if you want to use GLDC, you need recent GLdc code (you need commit bd17c995 of 03 feb 2024)&lt;br /&gt;
* download (git clone) kos &amp;amp; kos-ports into separate folders, eg /kosnaomi &amp;amp; /kos-portsnaomi&lt;br /&gt;
* adapt the following in /kosnaomi/environ.sh:&lt;br /&gt;
     KOS_SUBARCH=&amp;quot;naomi&amp;quot;&lt;br /&gt;
     KOS_BASE  &amp;lt;- point to your naomi kos folder&lt;br /&gt;
     KOS_PORTS &amp;lt;- point to your naomi kos-ports folder&lt;br /&gt;
     &lt;br /&gt;
* if you want to use raylib, you need recent raylib4Dreamcast code (you need commit TODO of 04 feb )&lt;br /&gt;
&lt;br /&gt;
== Compilation to a .ELF ==&lt;br /&gt;
Example compilation for a raylib example:&lt;br /&gt;
* Go to the folder that contains your example, eg:&lt;br /&gt;
     cd /opt/toolchains/dc/kos-portsnaomi/raylib4Dreamcast/samples/shapes/basic_shapes&lt;br /&gt;
* source the environ.sh of your naomi folder:&lt;br /&gt;
     source /opt/toolchains/dc/kosnaomi/environ.sh&lt;br /&gt;
* build the .elf for Naomi:&lt;br /&gt;
     make&lt;br /&gt;
&lt;br /&gt;
== Converting an .ELF to a .DAT to send to a Naomi DIMM ==&lt;br /&gt;
* Convert your Naomi-built KOS .ELF to a .BIN file:&lt;br /&gt;
     /opt/toolchains/dc/sh-elf/sh-elf/bin/objcopy -R .stack -O binary raylib.elf raylib_nao.bin&lt;br /&gt;
&lt;br /&gt;
* convert your Naomi .BIN to a .DAT file:&lt;br /&gt;
     /opt/toolchains/dc/kosnaomi/utils/naomibintool/naomibintool build raylib_nao.dat -d DEVELOPERNAME -t GAMETITLE -b raylib_nao.bin&lt;br /&gt;
&lt;br /&gt;
== Send your .DAT file to a Naomi DIMM via ethernet ==&lt;br /&gt;
* Assuming the IP address of the Naomi is 192.168.1.202:&lt;br /&gt;
     /opt/toolchains/dc/kosnaomi/utils/naominetboot/naominetboot -t 192.168.1.202 -x raylib_nao.dat -a&lt;br /&gt;
&lt;br /&gt;
== Send your file to a Naomi via a serial cable ==&lt;br /&gt;
If you don&#039;t have a DIMM board, or just want to use dc-tool-serial to upload a Naomi .elf via a serial cable, you need:&lt;br /&gt;
* a custom bios containing dc-load-ser&lt;br /&gt;
* recent KallistiOS code (you need commit d059b92 of 04 feb)&lt;br /&gt;
* upload the .ELF via your regulat dc-tool-ser command, eg:&lt;br /&gt;
     dc-tool-ser -b 1562500 -t /dev/ttyUSB0 -x raylib.elf&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Compiling_for_Naomi&amp;diff=3389</id>
		<title>Compiling for Naomi</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Compiling_for_Naomi&amp;diff=3389"/>
		<updated>2024-02-04T15:31:04Z</updated>

		<summary type="html">&lt;p&gt;Tchan: initial version&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;KallistiOS is able to produce executables that can run on the Sega Naomi arcarde boards.&lt;br /&gt;
&lt;br /&gt;
== Prerequisites ==&lt;br /&gt;
* if you want to use GLDC, you need recent GLdc code (you need commit bd17c995 of 03 feb 2024)&lt;br /&gt;
* download (git clone) kos &amp;amp; kos-ports into separate folders, eg /kosnaomi &amp;amp; /kos-portsnaomi&lt;br /&gt;
* adapt the following in /kosnaomi/environ.sh:&lt;br /&gt;
     KOS_SUBARCH=&amp;quot;naomi&amp;quot;&lt;br /&gt;
     KOS_BASE  &amp;lt;- point to your naomi kos folder&lt;br /&gt;
     KOS_PORTS &amp;lt;- point to your naomi kos-ports folder&lt;br /&gt;
     &lt;br /&gt;
* if you want to use raylib, you need recent raylib4Dreamcast code (you need commit TODO of 04 feb )&lt;br /&gt;
&lt;br /&gt;
== Compilation to a .ELF ==&lt;br /&gt;
Example compilation for a raylib example:&lt;br /&gt;
* Go to the folder that contains your example, eg:&lt;br /&gt;
     cd /opt/toolchains/dc/kos-portsnaomi/raylib4Dreamcast/samples/shapes/basic_shapes&lt;br /&gt;
* source the environ.sh of your naomi folder:&lt;br /&gt;
     source /opt/toolchains/dc/kosnaomi/environ.sh&lt;br /&gt;
* build the .elf for Naomi:&lt;br /&gt;
     make&lt;br /&gt;
&lt;br /&gt;
== Converting an .ELF to a .DAT to send to a Naomi DIMM ==&lt;br /&gt;
* Convert your Naomi-built KOS .ELF to a .BIN file:&lt;br /&gt;
     /opt/toolchains/dc/sh-elf/sh-elf/bin/objcopy -R .stack -O binary raylib.elf raylib_nao.bin&lt;br /&gt;
&lt;br /&gt;
* convert your Naomi .BIN to a .DAT file:&lt;br /&gt;
     /opt/toolchains/dc/kosnaomi/utils/naomibintool/naomibintool build raylib_nao.dat -d DEVELOPERNAME -t GAMETITLE -b raylib_nao.bin&lt;br /&gt;
&lt;br /&gt;
== Send your .DAT file to a Naomi DIMM via ethernet ==&lt;br /&gt;
* Assuming the IP address of the Naomi is 192.168.1.202:&lt;br /&gt;
     /opt/toolchains/dc/kosnaomi/utils/naominetboot/naominetboot -t 192.168.1.202 -x raylib_nao.dat -a&lt;br /&gt;
&lt;br /&gt;
== Send your file to a Naomi via a serial cable ==&lt;br /&gt;
If you don&#039;t have a DIMM board, or just want to use dc-tool-serial to upload a Naomi .elf via a serial cable, you need:&lt;br /&gt;
* a custom bios containing dc-load-ser&lt;br /&gt;
* recent KallistiOS code (you need commit TODO of TODO feb)&lt;br /&gt;
* upload the .ELF via your regulat dc-tool-ser command, eg:&lt;br /&gt;
     dc-tool-ser -b 1562500 -t /dev/ttyUSB0 -x raylib.elf&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Development&amp;diff=3388</id>
		<title>Development</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Development&amp;diff=3388"/>
		<updated>2024-02-04T15:13:42Z</updated>

		<summary type="html">&lt;p&gt;Tchan: /* Other */ add link to new page: compiling for naomi&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;=== Getting started ===&lt;br /&gt;
* [[Getting Started with Dreamcast development]] -- start here!&lt;br /&gt;
====Ready-to-use environments====&lt;br /&gt;
* [[Docker images]]&lt;br /&gt;
* [[DreamSDK]] (Windows only)&lt;br /&gt;
&lt;br /&gt;
====[[KallistiOS]]====&lt;br /&gt;
* Building on Linux, macOS, Windows Subsystem for Linux&lt;br /&gt;
** see [[Getting Started with Dreamcast development|&#039;&#039;Getting Started with Dreamcast development&#039;&#039;]]&lt;br /&gt;
* [[Building KOS on Cygwin]]&lt;br /&gt;
* [[Building KOS on MinGW/MSYS]]&lt;br /&gt;
* [[Building KOS on MinGW-w64/MSYS2]]&lt;br /&gt;
* [https://kos-docs.dreamcast.wiki/ KallistiOS Doxygen documentation]&lt;br /&gt;
&lt;br /&gt;
====Other====&lt;br /&gt;
* [[Using Ruby for Sega Dreamcast development]] (experimental)&lt;br /&gt;
* [[Compiling for Naomi]]&lt;br /&gt;
&lt;br /&gt;
=== Build &amp;amp; test ===&lt;br /&gt;
* [[Building your project]]&lt;br /&gt;
* [[Emulators]]&lt;br /&gt;
* [[Broadband adapter]] / [[LAN adapter]]&lt;br /&gt;
** [[Using dcload-ip with Linux]]&lt;br /&gt;
** [[Using dcload-ip with Windows Subsystem for Linux|Using dcload-ip with Windows 10]] (via Windows Subsystem for Linux)&lt;br /&gt;
* [[Coder&#039;s cable]]&lt;br /&gt;
&lt;br /&gt;
=== Environments and IDEs ===&lt;br /&gt;
* [[Qt Creator Dreamcast Development Environment]]&lt;br /&gt;
* [[CLion Debugging]]&lt;br /&gt;
* [[Visual Studio Code]]&lt;br /&gt;
&lt;br /&gt;
=== Tools &amp;amp; utilities ===&lt;br /&gt;
* [[Debugging throught GNU Debugger (GDB) and dcload/dc-tool]]&lt;br /&gt;
* [[Using dcprof]]&lt;br /&gt;
&lt;br /&gt;
=== Releasing your project ===&lt;br /&gt;
* Plain files&lt;br /&gt;
* Disc image&lt;br /&gt;
* Selfboot Inducer package&lt;br /&gt;
&lt;br /&gt;
=== Engines ===&lt;br /&gt;
&#039;&#039;See&#039;&#039; [[Engine &amp;amp; Library]]&lt;br /&gt;
&lt;br /&gt;
=== General ===&lt;br /&gt;
* [[Filesystem]]&lt;br /&gt;
* [[Store Queues]]&lt;br /&gt;
* [[Romdisk Swapping]]&lt;br /&gt;
* [https://mc.pp.se/dc/hw.html Marcus Comstedt&#039;s Dreamcast Hardware Reference]&lt;br /&gt;
&lt;br /&gt;
=== Graphics ===&lt;br /&gt;
* [[Texture Formats]]&lt;br /&gt;
* [[Graphics APIs]]&lt;br /&gt;
* [[Paletted Textures]]&lt;br /&gt;
* [[2D Rendering Without PVR]]&lt;br /&gt;
* [[Twiddling]]&lt;br /&gt;
&lt;br /&gt;
* PVR&lt;br /&gt;
** [[PowerVR Introduction]]&lt;br /&gt;
** [[PVR Spritesheets]]&lt;br /&gt;
* [[GLdc]]&lt;br /&gt;
** [[Drawing 2D sprites using GLdc]]&lt;br /&gt;
** [[Drawing 3D shapes using GLdc]]&lt;br /&gt;
** [https://hkowsoftware.com/articles/gldc-vertex-formats-from-vec3f-to-fastpath-to-map_buffer/ GLdc Vertex Formats: From vec3f to fastpath to map_buffer]&lt;br /&gt;
* Others&lt;br /&gt;
** [http://www.numechanix.com/blog/index.php/2015/10/03/20/ Procedural texture]&lt;br /&gt;
** [[Notes on fillrate and drawing large textures]]&lt;br /&gt;
** [[KMG Textures]]&lt;br /&gt;
** [[Loading PNG images as OpenGL textures]]&lt;br /&gt;
&lt;br /&gt;
=== Audio ===&lt;br /&gt;
* [[Playing SFX]]&lt;br /&gt;
* [[Streaming audio]]&lt;br /&gt;
&lt;br /&gt;
=== Maple ===&lt;br /&gt;
* Controller input&lt;br /&gt;
&lt;br /&gt;
=== VMU ===&lt;br /&gt;
* [[File Types]]&lt;br /&gt;
* [[Save/Load file]]&lt;br /&gt;
* [[Show icon]]&lt;br /&gt;
* [[Play tone]]&lt;br /&gt;
* [[VMU_development|Game Development]]&lt;br /&gt;
&lt;br /&gt;
=== Optimization ===&lt;br /&gt;
* [[GCC-SH4 tips]]&lt;br /&gt;
* [[SH4 in Compiler Explorer]]&lt;br /&gt;
* [[Fast SH4 Vertex Processing]]&lt;br /&gt;
* [[Useful programming tips]]&lt;br /&gt;
* [[Efficient usage of the Dreamcast RAM]]&lt;br /&gt;
* Registers&lt;br /&gt;
* DMA&lt;br /&gt;
* TA&lt;br /&gt;
* PVR&lt;br /&gt;
=== Website Development ===&lt;br /&gt;
*[[Development Resources]]&lt;br /&gt;
&lt;br /&gt;
=== Random Snippets ===&lt;br /&gt;
* [[Objdump]]&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Coder%27s_cable&amp;diff=3230</id>
		<title>Coder&#039;s cable</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Coder%27s_cable&amp;diff=3230"/>
		<updated>2023-11-21T14:11:24Z</updated>

		<summary type="html">&lt;p&gt;Tchan: price indication adaptations&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;coder&#039;s cable&#039;&#039;&#039; is the name given to the serial-based cable some developers use to test and debug code during development. Originally, cables were connected to host devices via serial, but modern cable designs incorporate a USB controller instead. Coder&#039;s cables can also be used for other purpose&#039;s besides development, such as transferring VMU data back to a PC or dumping GD-ROMs (although quite slowly).&lt;br /&gt;
&lt;br /&gt;
== Buy a pre-made cable ==&lt;br /&gt;
* eg: Contact &#039;&#039;&#039;darc&#039;&#039;&#039; on the [https://discord.com/invite/TRx94EV Simulant Discord] for a pre-made CP2102N-based cable&lt;br /&gt;
* eg: [https://www.retroonyx.com/product-page/dreamcast-usb-coders-cable retroonyx cable], FTDI-based cable.&lt;br /&gt;
* (only mentioned for historical purposes - not sold anymore since long - &amp;quot;Lik-Sang coder&#039;s cable&amp;quot; - max speed of 781250)&lt;br /&gt;
&lt;br /&gt;
== Build your own cable ==&lt;br /&gt;
* DC serial connector:&lt;br /&gt;
** best connector today is the one used by the [https://www.ebay.com/sch/i.html?_nkw=DC+SD+Adapter+V2 DC SD Adapter V2] (+- 20 USD)&lt;br /&gt;
{|&lt;br /&gt;
| [[File:DC SD Adapter V2.jpg|thumb|alt=DC SD Adapter V2|DC SD Adapter V2]]&lt;br /&gt;
|}&lt;br /&gt;
* select a usb-to-serial chip/cable (+- 15 USD)&lt;br /&gt;
** [https://www.silabs.com/interface/usb-bridges/usbxpress Silicon Labs &#039;&#039;&#039;CP2102N&#039;&#039;&#039;]:&lt;br /&gt;
*** Supports 1600000, which is a 2,4% baudrate mismatch with the Dreamcast, which seems acceptable for high speeds. Best chip that can be recommended today. Tests give speeds of 170-190 kByte/sec and more thanks to compression.&lt;br /&gt;
*** eg [https://www.adafruit.com/product/5335 Adafruit CP2102N Friend (USB-C)]&lt;br /&gt;
*** eg [https://www.silabs.com/development-tools/interface/cp2102n-mini-development-kit?tab=overview Silicon Labs CP2102N-MINIEK (mini USB)]&lt;br /&gt;
*** eg [https://www.amazon.co.uk/DSD-TECH-SH-U09BL-Serial-CP2102N/dp/B08JLRP6YV DSD TECH SH-U09BL USB to TTL Serial Cable with CP2102N Chip]&lt;br /&gt;
*** eg [https://github.com/cepawiel/dc-serial Colton&#039;s custom PCB] - Kicad files to order a custom PCB with a CP2102N, to be soldered to the serial connector of a DC SD Adapter V2&lt;br /&gt;
&lt;br /&gt;
** FDTI&#039;s &#039;&#039;&#039;FT232R&#039;&#039;&#039;-like chips:&lt;br /&gt;
*** &#039;&#039;&#039;good until 781250&#039;&#039;&#039;, does not support 1562500.&lt;br /&gt;
*** 500000 and 1500000 will not work with all chips/on all pc, because of a 4% baud rate mismatch with the baudrates of the Dreamcast.&lt;br /&gt;
**** Even if you&#039;re lucky, you won&#039;t really get 1500000-worthy speeds - more probably around 130-150 kByte/sec...&lt;br /&gt;
&lt;br /&gt;
* connect the following pins (cfr [[Serial_interface]]):&lt;br /&gt;
** GND &amp;lt;-&amp;gt; GND&lt;br /&gt;
** TXD &amp;lt;-&amp;gt; RXD&lt;br /&gt;
** RXD &amp;lt;-&amp;gt; TXD&lt;br /&gt;
** RTS &amp;lt;-&amp;gt; CTS&lt;br /&gt;
** CTS &amp;lt;-&amp;gt; RTS&lt;br /&gt;
&lt;br /&gt;
== Software to use ==&lt;br /&gt;
[[Dcload-serial]]&lt;br /&gt;
&lt;br /&gt;
== Supported Baud Rates ==&lt;br /&gt;
&#039;&#039;&#039;Not all common baudrates work&#039;&#039;&#039;, so the recommendations are:&lt;br /&gt;
* &#039;&#039;&#039;up until 115200&#039;&#039;&#039;, you can use the common baudrates: 9600, 19200, 38400, 57600, 115200&lt;br /&gt;
** if 115200 does not work, you can add the &amp;quot;-e&amp;quot; speedhack option&lt;br /&gt;
* &#039;&#039;&#039;higher baudrates&#039;&#039;&#039;: &lt;br /&gt;
** try first with the &#039;&#039;&#039;dreamcast-specific baudrates&#039;&#039;&#039; (223214, 260416, 312500, 390625, &#039;&#039;&#039;520833, 781250, 1562500&#039;&#039;&#039;)&lt;br /&gt;
*** Disclaimer for Linux only: needs dc-tool-ser (host) changes from 4 september 2023 to select custom baudrates&lt;br /&gt;
*** Disclaimer for MacOS only: custom baudrates are not supported yet&lt;br /&gt;
** &#039;&#039;&#039;230400&#039;&#039;&#039;: use the -e speedhack option if you absolutely need 230400 at pc-side, but the DC will use 223214 or 260416 anyways.&lt;br /&gt;
** &#039;&#039;&#039;500000 and 1500000&#039;&#039;&#039;: you can try, but that will not work on all pc (the mismatch with the baudrate of the Dreamcast is sometimes too big (4%))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{DCWiki:Stub}}&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Coder%27s_cable&amp;diff=3229</id>
		<title>Coder&#039;s cable</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Coder%27s_cable&amp;diff=3229"/>
		<updated>2023-11-21T13:44:33Z</updated>

		<summary type="html">&lt;p&gt;Tchan: added darc&amp;#039;s cable info, and cleaned up formatting&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;coder&#039;s cable&#039;&#039;&#039; is the name given to the serial-based cable some developers use to test and debug code during development. Originally, cables were connected to host devices via serial, but modern cable designs incorporate a USB controller instead. Coder&#039;s cables can also be used for other purpose&#039;s besides development, such as transferring VMU data back to a PC or dumping GD-ROMs (although quite slowly).&lt;br /&gt;
&lt;br /&gt;
== Buy a pre-made cable ==&lt;br /&gt;
* eg: Contact &#039;&#039;&#039;darc&#039;&#039;&#039; on the [https://discord.com/invite/TRx94EV Simulant Discord] for a pre-made CP2102N-based cable&lt;br /&gt;
* eg: [https://www.retroonyx.com/product-page/dreamcast-usb-coders-cable retroonyx cable], FTDI-based cable.&lt;br /&gt;
* (only mentioned for historical purposes - not sold anymore since long - &amp;quot;Lik-Sang coder&#039;s cable&amp;quot; - max speed of 781250)&lt;br /&gt;
&lt;br /&gt;
== Build your own cable ==&lt;br /&gt;
* DC serial connector:&lt;br /&gt;
** best connector today is the one used by the [https://www.ebay.com/sch/i.html?_nkw=DC+SD+Adapter+V2 DC SD Adapter V2] (+- 16 USD)&lt;br /&gt;
{|&lt;br /&gt;
| [[File:DC SD Adapter V2.jpg|thumb|alt=DC SD Adapter V2|DC SD Adapter V2]]&lt;br /&gt;
|}&lt;br /&gt;
* select a usb-to-serial chip/cable (+- 10 USD)&lt;br /&gt;
** [https://www.silabs.com/interface/usb-bridges/usbxpress Silicon Labs &#039;&#039;&#039;CP2102N&#039;&#039;&#039;]:&lt;br /&gt;
*** Supports 1600000, which is a 2,4% baudrate mismatch with the Dreamcast, which seems acceptable for high speeds. Best chip that can be recommended today. Tests give speeds of 170-190 kByte/sec and more thanks to compression.&lt;br /&gt;
*** eg [https://www.adafruit.com/product/5335 Adafruit CP2102N Friend (USB-C)]&lt;br /&gt;
*** eg [https://www.silabs.com/development-tools/interface/cp2102n-mini-development-kit?tab=overview Silicon Labs CP2102N-MINIEK (mini USB)]&lt;br /&gt;
*** eg [https://www.amazon.co.uk/DSD-TECH-SH-U09BL-Serial-CP2102N/dp/B08JLRP6YV DSD TECH SH-U09BL USB to TTL Serial Cable with CP2102N Chip]&lt;br /&gt;
*** eg [https://github.com/cepawiel/dc-serial Colton&#039;s custom PCB] - Kicad files to order a custom PCB with a CP2102N, to be soldered to the serial connector of a DC SD Adapter V2&lt;br /&gt;
&lt;br /&gt;
** FDTI&#039;s &#039;&#039;&#039;FT232R&#039;&#039;&#039;-like chips:&lt;br /&gt;
*** &#039;&#039;&#039;good until 781250&#039;&#039;&#039;, does not support 1562500.&lt;br /&gt;
*** 500000 and 1500000 will not work with all chips/on all pc, because of a 4% baud rate mismatch with the baudrates of the Dreamcast.&lt;br /&gt;
**** Even if you&#039;re lucky, you won&#039;t really get 1500000-worthy speeds - more probably around 130-150 kByte/sec...&lt;br /&gt;
&lt;br /&gt;
* connect the following pins (cfr [[Serial_interface]]):&lt;br /&gt;
** GND &amp;lt;-&amp;gt; GND&lt;br /&gt;
** TXD &amp;lt;-&amp;gt; RXD&lt;br /&gt;
** RXD &amp;lt;-&amp;gt; TXD&lt;br /&gt;
** RTS &amp;lt;-&amp;gt; CTS&lt;br /&gt;
** CTS &amp;lt;-&amp;gt; RTS&lt;br /&gt;
&lt;br /&gt;
== Software to use ==&lt;br /&gt;
[[Dcload-serial]]&lt;br /&gt;
&lt;br /&gt;
== Supported Baud Rates ==&lt;br /&gt;
&#039;&#039;&#039;Not all common baudrates work&#039;&#039;&#039;, so the recommendations are:&lt;br /&gt;
* &#039;&#039;&#039;up until 115200&#039;&#039;&#039;, you can use the common baudrates: 9600, 19200, 38400, 57600, 115200&lt;br /&gt;
** if 115200 does not work, you can add the &amp;quot;-e&amp;quot; speedhack option&lt;br /&gt;
* &#039;&#039;&#039;higher baudrates&#039;&#039;&#039;: &lt;br /&gt;
** try first with the &#039;&#039;&#039;dreamcast-specific baudrates&#039;&#039;&#039; (223214, 260416, 312500, 390625, &#039;&#039;&#039;520833, 781250, 1562500&#039;&#039;&#039;)&lt;br /&gt;
*** Disclaimer for Linux only: needs dc-tool-ser (host) changes from 4 september 2023 to select custom baudrates&lt;br /&gt;
*** Disclaimer for MacOS only: custom baudrates are not supported yet&lt;br /&gt;
** &#039;&#039;&#039;230400&#039;&#039;&#039;: use the -e speedhack option if you absolutely need 230400 at pc-side, but the DC will use 223214 or 260416 anyways.&lt;br /&gt;
** &#039;&#039;&#039;500000 and 1500000&#039;&#039;&#039;: you can try, but that will not work on all pc (the mismatch with the baudrate of the Dreamcast is sometimes too big (4%))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{DCWiki:Stub}}&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Coder%27s_cable&amp;diff=3187</id>
		<title>Coder&#039;s cable</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Coder%27s_cable&amp;diff=3187"/>
		<updated>2023-09-10T13:51:27Z</updated>

		<summary type="html">&lt;p&gt;Tchan: adapted Linux &amp;amp; MacOS disclaimers with the latest info, after commit of Linux custom baudrates has been added to the repo&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;coder&#039;s cable&#039;&#039;&#039; is the name given to the serial-based cable some developers use to test and debug code during development. Originally, cables were connected to host devices via serial, but modern cable designs incorporate a USB controller instead. Coder&#039;s cables can also be used for other purpose&#039;s besides development, such as transferring VMU data back to a PC or dumping GD-ROMs (although quite slowly).&lt;br /&gt;
&lt;br /&gt;
== How to build/buy a cable ==&lt;br /&gt;
* Buy:&lt;br /&gt;
** eg [https://www.retroonyx.com/product-page/dreamcast-usb-coders-cable retroonyx cable], FTDI-based cable.&lt;br /&gt;
** (only mentioned for historical purposes - not sold anymore since long - &amp;quot;Lik-Sang coder&#039;s cable&amp;quot; - max speed of 781250)&lt;br /&gt;
* Build:&lt;br /&gt;
** DC serial connector:&lt;br /&gt;
*** best connector today is the one used by the [https://www.ebay.com/sch/i.html?_nkw=DC+SD+Adapter+V2 DC SD Adapter V2] (+- 16 USD)&lt;br /&gt;
{|&lt;br /&gt;
| [[File:DC SD Adapter V2.jpg|thumb|alt=DC SD Adapter V2|DC SD Adapter V2]]&lt;br /&gt;
|}&lt;br /&gt;
** select a usb-to-serial chip/cable (+- 10 USD)&lt;br /&gt;
*** [https://www.silabs.com/interface/usb-bridges/usbxpress Silicon Labs &#039;&#039;&#039;CP2102N&#039;&#039;&#039;]:&lt;br /&gt;
**** Supports 1600000, which is a 2,4% baudrate mismatch with the Dreamcast, which seems acceptable for high speeds. Best chip that can be recommended today. Tests give speeds of 170-190 kByte/sec and more thanks to compression.&lt;br /&gt;
**** eg [https://www.adafruit.com/product/5335 Adafruit CP2102N Friend (USB-C)]&lt;br /&gt;
**** eg [https://www.silabs.com/development-tools/interface/cp2102n-mini-development-kit?tab=overview Silicon Labs CP2102N-MINIEK (mini USB)]&lt;br /&gt;
**** eg [https://www.amazon.co.uk/DSD-TECH-SH-U09BL-Serial-CP2102N/dp/B08JLRP6YV DSD TECH SH-U09BL USB to TTL Serial Cable with CP2102N Chip]&lt;br /&gt;
**** eg [https://github.com/cepawiel/dc-serial Colton&#039;s custom PCB] - Kicad files to order a custom PCB with a CP2102N, to be soldered to the serial connector of a DC SD Adapter V2&lt;br /&gt;
&lt;br /&gt;
*** FDTI&#039;s &#039;&#039;&#039;FT232R&#039;&#039;&#039;-like chips:&lt;br /&gt;
**** &#039;&#039;&#039;good until 781250&#039;&#039;&#039;, does not support 1562500.&lt;br /&gt;
**** 500000 and 1500000 will not work with all chips/on all pc, because of a 4% baud rate mismatch with the baudrates of the Dreamcast.&lt;br /&gt;
***** Even if you&#039;re lucky, you won&#039;t really get 1500000-worthy speeds - more probably around 130-150 kByte/sec...&lt;br /&gt;
&lt;br /&gt;
** connect the following pins (cfr [[Serial_interface]]):&lt;br /&gt;
*** GND &amp;lt;-&amp;gt; GND&lt;br /&gt;
*** TXD &amp;lt;-&amp;gt; RXD&lt;br /&gt;
*** RXD &amp;lt;-&amp;gt; TXD&lt;br /&gt;
*** RTS &amp;lt;-&amp;gt; CTS&lt;br /&gt;
*** CTS &amp;lt;-&amp;gt; RTS&lt;br /&gt;
&lt;br /&gt;
== Software to use ==&lt;br /&gt;
[[Dcload-serial]]&lt;br /&gt;
&lt;br /&gt;
== Supported Baud Rates ==&lt;br /&gt;
&#039;&#039;&#039;Not all common baudrates work&#039;&#039;&#039;, so the recommendations are:&lt;br /&gt;
* &#039;&#039;&#039;up until 115200&#039;&#039;&#039;, you can use the common baudrates: 9600, 19200, 38400, 57600, 115200&lt;br /&gt;
** if 115200 does not work, you can add the &amp;quot;-e&amp;quot; speedhack option&lt;br /&gt;
* &#039;&#039;&#039;higher baudrates&#039;&#039;&#039;: &lt;br /&gt;
** try first with the &#039;&#039;&#039;dreamcast-specific baudrates&#039;&#039;&#039; (223214, 260416, 312500, 390625, &#039;&#039;&#039;520833, 781250, 1562500&#039;&#039;&#039;)&lt;br /&gt;
*** Disclaimer for Linux only: needs dc-tool-ser (host) changes from 4 september 2023 to select custom baudrates&lt;br /&gt;
*** Disclaimer for MacOS only: custom baudrates are not supported yet&lt;br /&gt;
** &#039;&#039;&#039;230400&#039;&#039;&#039;: use the -e speedhack option if you absolutely need 230400 at pc-side, but the DC will use 223214 or 260416 anyways.&lt;br /&gt;
** &#039;&#039;&#039;500000 and 1500000&#039;&#039;&#039;: you can try, but that will not work on all pc (the mismatch with the baudrate of the Dreamcast is sometimes too big (4%))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{DCWiki:Stub}}&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Coder%27s_cable&amp;diff=3182</id>
		<title>Coder&#039;s cable</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Coder%27s_cable&amp;diff=3182"/>
		<updated>2023-08-15T08:07:57Z</updated>

		<summary type="html">&lt;p&gt;Tchan: added link to Colton&amp;#039;s PCB files&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;coder&#039;s cable&#039;&#039;&#039; is the name given to the serial-based cable some developers use to test and debug code during development. Originally, cables were connected to host devices via serial, but modern cable designs incorporate a USB controller instead. Coder&#039;s cables can also be used for other purpose&#039;s besides development, such as transferring VMU data back to a PC or dumping GD-ROMs (although quite slowly).&lt;br /&gt;
&lt;br /&gt;
== How to build/buy a cable ==&lt;br /&gt;
* Buy:&lt;br /&gt;
** eg [https://www.retroonyx.com/product-page/dreamcast-usb-coders-cable retroonyx cable], FTDI-based cable.&lt;br /&gt;
** (only mentioned for historical purposes - not sold anymore since long - &amp;quot;Lik-Sang coder&#039;s cable&amp;quot; - max speed of 781250)&lt;br /&gt;
* Build:&lt;br /&gt;
** DC serial connector:&lt;br /&gt;
*** best connector today is the one used by the [https://www.ebay.com/sch/i.html?_nkw=DC+SD+Adapter+V2 DC SD Adapter V2] (+- 16 USD)&lt;br /&gt;
{|&lt;br /&gt;
| [[File:DC SD Adapter V2.jpg|thumb|alt=DC SD Adapter V2|DC SD Adapter V2]]&lt;br /&gt;
|}&lt;br /&gt;
** select a usb-to-serial chip/cable (+- 10 USD)&lt;br /&gt;
*** [https://www.silabs.com/interface/usb-bridges/usbxpress Silicon Labs &#039;&#039;&#039;CP2102N&#039;&#039;&#039;]:&lt;br /&gt;
**** Supports 1600000, which is a 2,4% baudrate mismatch with the Dreamcast, which seems acceptable for high speeds. Best chip that can be recommended today. Tests give speeds of 170-190 kByte/sec and more thanks to compression.&lt;br /&gt;
**** eg [https://www.adafruit.com/product/5335 Adafruit CP2102N Friend (USB-C)]&lt;br /&gt;
**** eg [https://www.silabs.com/development-tools/interface/cp2102n-mini-development-kit?tab=overview Silicon Labs CP2102N-MINIEK (mini USB)]&lt;br /&gt;
**** eg [https://www.amazon.co.uk/DSD-TECH-SH-U09BL-Serial-CP2102N/dp/B08JLRP6YV DSD TECH SH-U09BL USB to TTL Serial Cable with CP2102N Chip]&lt;br /&gt;
**** eg [https://github.com/cepawiel/dc-serial Colton&#039;s custom PCB] - Kicad files to order a custom PCB with a CP2102N, to be soldered to the serial connector of a DC SD Adapter V2&lt;br /&gt;
&lt;br /&gt;
*** FDTI&#039;s &#039;&#039;&#039;FT232R&#039;&#039;&#039;-like chips:&lt;br /&gt;
**** &#039;&#039;&#039;good until 781250&#039;&#039;&#039;, does not support 1562500.&lt;br /&gt;
**** 500000 and 1500000 will not work with all chips/on all pc, because of a 4% baud rate mismatch with the baudrates of the Dreamcast.&lt;br /&gt;
***** Even if you&#039;re lucky, you won&#039;t really get 1500000-worthy speeds - more probably around 130-150 kByte/sec...&lt;br /&gt;
&lt;br /&gt;
** connect the following pins (cfr [[Serial_interface]]):&lt;br /&gt;
*** GND &amp;lt;-&amp;gt; GND&lt;br /&gt;
*** TXD &amp;lt;-&amp;gt; RXD&lt;br /&gt;
*** RXD &amp;lt;-&amp;gt; TXD&lt;br /&gt;
*** RTS &amp;lt;-&amp;gt; CTS&lt;br /&gt;
*** CTS &amp;lt;-&amp;gt; RTS&lt;br /&gt;
&lt;br /&gt;
== Software to use ==&lt;br /&gt;
[[Dcload-serial]]&lt;br /&gt;
&lt;br /&gt;
== Supported Baud Rates ==&lt;br /&gt;
&#039;&#039;&#039;Not all common baudrates work&#039;&#039;&#039;, so the recommendations are:&lt;br /&gt;
* &#039;&#039;&#039;up until 115200&#039;&#039;&#039;, you can use the common baudrates: 9600, 19200, 38400, 57600, 115200&lt;br /&gt;
** if 115200 does not work, you can add the &amp;quot;-e&amp;quot; speedhack option&lt;br /&gt;
* &#039;&#039;&#039;higher baudrates&#039;&#039;&#039;: &lt;br /&gt;
** try first with the &#039;&#039;&#039;dreamcast-specific baudrates&#039;&#039;&#039; (223214, 260416, 312500, 390625, &#039;&#039;&#039;520833, 781250, 1562500&#039;&#039;&#039;)&lt;br /&gt;
*** Disclaimer for Linux only: Requires a patch to support custom speeds that is not yet part of dc-load-ser 1.0.6.&lt;br /&gt;
** &#039;&#039;&#039;230400&#039;&#039;&#039;: use the -e speedhack option if you absolutely need 230400 at pc-side, but the DC will use 223214 or 260416 anyways.&lt;br /&gt;
** &#039;&#039;&#039;500000 and 1500000&#039;&#039;&#039;: you can try, but that will not work on all pc (the mismatch with the baudrate of the Dreamcast is sometimes too big (4%))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{DCWiki:Stub}}&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Coder%27s_cable&amp;diff=3162</id>
		<title>Coder&#039;s cable</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Coder%27s_cable&amp;diff=3162"/>
		<updated>2023-07-07T20:27:23Z</updated>

		<summary type="html">&lt;p&gt;Tchan: moved Linux disclaimer about custom speeds into the baudrate section&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;coder&#039;s cable&#039;&#039;&#039; is the name given to the serial-based cable some developers use to test and debug code during development. Originally, cables were connected to host devices via serial, but modern cable designs incorporate a USB controller instead. Coder&#039;s cables can also be used for other purpose&#039;s besides development, such as transferring VMU data back to a PC or dumping GD-ROMs (although quite slowly).&lt;br /&gt;
&lt;br /&gt;
== How to build/buy a cable ==&lt;br /&gt;
* Buy:&lt;br /&gt;
** eg [https://www.retroonyx.com/product-page/dreamcast-usb-coders-cable retroonyx cable], FTDI-based cable.&lt;br /&gt;
** (only mentioned for historical purposes - not sold anymore since long - &amp;quot;Lik-Sang coder&#039;s cable&amp;quot; - max speed of 781250)&lt;br /&gt;
* Build:&lt;br /&gt;
** DC serial connector:&lt;br /&gt;
*** best connector today is the one used by the [https://www.ebay.com/sch/i.html?_nkw=DC+SD+Adapter+V2 DC SD Adapter V2] (+- 16 USD)&lt;br /&gt;
{|&lt;br /&gt;
| [[File:DC SD Adapter V2.jpg|thumb|alt=DC SD Adapter V2|DC SD Adapter V2]]&lt;br /&gt;
|}&lt;br /&gt;
** select a usb-to-serial chip/cable (+- 10 USD)&lt;br /&gt;
*** [https://www.silabs.com/interface/usb-bridges/usbxpress Silicon Labs &#039;&#039;&#039;CP2102N&#039;&#039;&#039;]:&lt;br /&gt;
**** Supports 1600000, which is a 2,4% baudrate mismatch with the Dreamcast, which seems acceptable for high speeds. Best chip that can be recommended today. Tests give speeds of 170-190 kByte/sec and more thanks to compression.&lt;br /&gt;
**** eg [https://www.adafruit.com/product/5335 Adafruit CP2102N Friend (USB-C)]&lt;br /&gt;
**** eg [https://www.silabs.com/development-tools/interface/cp2102n-mini-development-kit?tab=overview Silicon Labs CP2102N-MINIEK (mini USB)]&lt;br /&gt;
**** eg [https://www.amazon.co.uk/DSD-TECH-SH-U09BL-Serial-CP2102N/dp/B08JLRP6YV DSD TECH SH-U09BL USB to TTL Serial Cable with CP2102N Chip]&lt;br /&gt;
*** FDTI&#039;s &#039;&#039;&#039;FT232R&#039;&#039;&#039;-like chips:&lt;br /&gt;
**** &#039;&#039;&#039;good until 781250&#039;&#039;&#039;, does not support 1562500.&lt;br /&gt;
**** 500000 and 1500000 will not work with all chips/on all pc, because of a 4% baud rate mismatch with the baudrates of the Dreamcast.&lt;br /&gt;
***** Even if you&#039;re lucky, you won&#039;t really get 1500000-worthy speeds - more probably around 130-150 kByte/sec...&lt;br /&gt;
&lt;br /&gt;
** connect the following pins (cfr [[Serial_interface]]):&lt;br /&gt;
*** GND &amp;lt;-&amp;gt; GND&lt;br /&gt;
*** TXD &amp;lt;-&amp;gt; RXD&lt;br /&gt;
*** RXD &amp;lt;-&amp;gt; TXD&lt;br /&gt;
*** RTS &amp;lt;-&amp;gt; CTS&lt;br /&gt;
*** CTS &amp;lt;-&amp;gt; RTS&lt;br /&gt;
&lt;br /&gt;
== Software to use ==&lt;br /&gt;
[[Dcload-serial]]&lt;br /&gt;
&lt;br /&gt;
== Supported Baud Rates ==&lt;br /&gt;
&#039;&#039;&#039;Not all common baudrates work&#039;&#039;&#039;, so the recommendations are:&lt;br /&gt;
* &#039;&#039;&#039;up until 115200&#039;&#039;&#039;, you can use the common baudrates: 9600, 19200, 38400, 57600, 115200&lt;br /&gt;
** if 115200 does not work, you can add the &amp;quot;-e&amp;quot; speedhack option&lt;br /&gt;
* &#039;&#039;&#039;higher baudrates&#039;&#039;&#039;: &lt;br /&gt;
** try first with the &#039;&#039;&#039;dreamcast-specific baudrates&#039;&#039;&#039; (223214, 260416, 312500, 390625, &#039;&#039;&#039;520833, 781250, 1562500&#039;&#039;&#039;)&lt;br /&gt;
*** Disclaimer for Linux only: Requires a patch to support custom speeds that is not yet part of dc-load-ser 1.0.6.&lt;br /&gt;
** &#039;&#039;&#039;230400&#039;&#039;&#039;: use the -e speedhack option if you absolutely need 230400 at pc-side, but the DC will use 223214 or 260416 anyways.&lt;br /&gt;
** &#039;&#039;&#039;500000 and 1500000&#039;&#039;&#039;: you can try, but that will not work on all pc (the mismatch with the baudrate of the Dreamcast is sometimes too big (4%))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{DCWiki:Stub}}&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Coder%27s_cable&amp;diff=3161</id>
		<title>Coder&#039;s cable</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Coder%27s_cable&amp;diff=3161"/>
		<updated>2023-07-06T17:34:06Z</updated>

		<summary type="html">&lt;p&gt;Tchan: corrected info about lik-sang cable&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;coder&#039;s cable&#039;&#039;&#039; is the name given to the serial-based cable some developers use to test and debug code during development. Originally, cables were connected to host devices via serial, but modern cable designs incorporate a USB controller instead. Coder&#039;s cables can also be used for other purpose&#039;s besides development, such as transferring VMU data back to a PC or dumping GD-ROMs (although quite slowly).&lt;br /&gt;
&lt;br /&gt;
== How to build/buy a cable ==&lt;br /&gt;
* Buy:&lt;br /&gt;
** eg [https://www.retroonyx.com/product-page/dreamcast-usb-coders-cable retroonyx cable], FTDI-based cable.&lt;br /&gt;
** (only mentioned for historical purposes - not sold anymore since long - &amp;quot;Lik-Sang coder&#039;s cable&amp;quot; - max speed of 781250)&lt;br /&gt;
* Build:&lt;br /&gt;
** DC serial connector:&lt;br /&gt;
*** best connector today is the one used by the [https://www.ebay.com/sch/i.html?_nkw=DC+SD+Adapter+V2 DC SD Adapter V2] (+- 16 USD)&lt;br /&gt;
{|&lt;br /&gt;
| [[File:DC SD Adapter V2.jpg|thumb|alt=DC SD Adapter V2|DC SD Adapter V2]]&lt;br /&gt;
|}&lt;br /&gt;
** select a usb-to-serial chip/cable (+- 10 USD)&lt;br /&gt;
*** [https://www.silabs.com/interface/usb-bridges/usbxpress Silicon Labs &#039;&#039;&#039;CP2102N&#039;&#039;&#039;]:&lt;br /&gt;
**** Supports 1600000, which is a 2,4% baudrate mismatch with the Dreamcast, which seems acceptable for high speeds. Best chip that can be recommended today. Tests give speeds of 170-190 kByte/sec and more thanks to compression.&lt;br /&gt;
**** Disclaimer for Linux only: Requires a patch to support custom speeds that is not yet part of dc-load-ser 1.0.6.&lt;br /&gt;
**** eg [https://www.adafruit.com/product/5335 Adafruit CP2102N Friend (USB-C)]&lt;br /&gt;
**** eg [https://www.silabs.com/development-tools/interface/cp2102n-mini-development-kit?tab=overview Silicon Labs CP2102N-MINIEK (mini USB)]&lt;br /&gt;
**** eg [https://www.amazon.co.uk/DSD-TECH-SH-U09BL-Serial-CP2102N/dp/B08JLRP6YV DSD TECH SH-U09BL USB to TTL Serial Cable with CP2102N Chip]&lt;br /&gt;
*** FDTI&#039;s &#039;&#039;&#039;FT232R&#039;&#039;&#039;-like chips:&lt;br /&gt;
**** &#039;&#039;&#039;good until 781250&#039;&#039;&#039;, does not support 1562500.&lt;br /&gt;
**** 500000 and 1500000 will not work with all chips/on all pc, because of a 4% baud rate mismatch with the baudrates of the Dreamcast.&lt;br /&gt;
***** Even if you&#039;re lucky, you won&#039;t really get 1500000-worthy speeds - more probably around 130-150 kByte/sec...&lt;br /&gt;
&lt;br /&gt;
** connect the following pins (cfr [[Serial_interface]]):&lt;br /&gt;
*** GND &amp;lt;-&amp;gt; GND&lt;br /&gt;
*** TXD &amp;lt;-&amp;gt; RXD&lt;br /&gt;
*** RXD &amp;lt;-&amp;gt; TXD&lt;br /&gt;
*** RTS &amp;lt;-&amp;gt; CTS&lt;br /&gt;
*** CTS &amp;lt;-&amp;gt; RTS&lt;br /&gt;
&lt;br /&gt;
== Software to use ==&lt;br /&gt;
[[Dcload-serial]]&lt;br /&gt;
&lt;br /&gt;
== Supported Baud Rates ==&lt;br /&gt;
&#039;&#039;&#039;Not all common baudrates work&#039;&#039;&#039;, so the recommendations are:&lt;br /&gt;
* &#039;&#039;&#039;up until 115200&#039;&#039;&#039;, you can use the common baudrates: 9600, 19200, 38400, 57600, 115200&lt;br /&gt;
** if 115200 does not work, you can add the &amp;quot;-e&amp;quot; speedhack option&lt;br /&gt;
* &#039;&#039;&#039;higher baudrates&#039;&#039;&#039;: &lt;br /&gt;
** try first with the &#039;&#039;&#039;dreamcast-specific baudrates&#039;&#039;&#039; (223214, 260416, 312500, 390625, &#039;&#039;&#039;520833, 781250, 1562500&#039;&#039;&#039;)&lt;br /&gt;
** &#039;&#039;&#039;230400&#039;&#039;&#039;: use the -e speedhack option if you absolutely need 230400 at pc-side, but the DC will use 223214 or 260416 anyways.&lt;br /&gt;
** &#039;&#039;&#039;500000 and 1500000&#039;&#039;&#039;: you can try, but that will not work on all pc (the mismatch with the baudrate of the Dreamcast is sometimes too big (4%))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{DCWiki:Stub}}&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
	<entry>
		<id>https://dreamcast.wiki/wiki/index.php?title=Coder%27s_cable&amp;diff=3160</id>
		<title>Coder&#039;s cable</title>
		<link rel="alternate" type="text/html" href="https://dreamcast.wiki/wiki/index.php?title=Coder%27s_cable&amp;diff=3160"/>
		<updated>2023-07-06T16:31:28Z</updated>

		<summary type="html">&lt;p&gt;Tchan: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The &#039;&#039;&#039;coder&#039;s cable&#039;&#039;&#039; is the name given to the serial-based cable some developers use to test and debug code during development. Originally, cables were connected to host devices via serial, but modern cable designs incorporate a USB controller instead. Coder&#039;s cables can also be used for other purpose&#039;s besides development, such as transferring VMU data back to a PC or dumping GD-ROMs (although quite slowly).&lt;br /&gt;
&lt;br /&gt;
== How to build/buy a cable ==&lt;br /&gt;
* Buy:&lt;br /&gt;
** eg [https://www.retroonyx.com/product-page/dreamcast-usb-coders-cable retroonyx cable], FTDI-based cable.&lt;br /&gt;
** (only mentioned for historical purposes - not sold anymore since long - &amp;quot;Lik-Sang coder&#039;s cable&amp;quot; - max speed of 781250 if combined with CP2102N-chip)&lt;br /&gt;
* Build:&lt;br /&gt;
** DC serial connector:&lt;br /&gt;
*** best connector today is the one used by the [https://www.ebay.com/sch/i.html?_nkw=DC+SD+Adapter+V2 DC SD Adapter V2] (+- 16 USD)&lt;br /&gt;
{|&lt;br /&gt;
| [[File:DC SD Adapter V2.jpg|thumb|alt=DC SD Adapter V2|DC SD Adapter V2]]&lt;br /&gt;
|}&lt;br /&gt;
** select a usb-to-serial chip/cable (+- 10 USD)&lt;br /&gt;
*** [https://www.silabs.com/interface/usb-bridges/usbxpress Silicon Labs &#039;&#039;&#039;CP2102N&#039;&#039;&#039;]:&lt;br /&gt;
**** Supports 1600000, which is a 2,4% baudrate mismatch with the Dreamcast, which seems acceptable for high speeds. Best chip that can be recommended today. Tests give speeds of 170-190 kByte/sec and more thanks to compression.&lt;br /&gt;
**** Disclaimer for Linux only: Requires a patch to support custom speeds that is not yet part of dc-load-ser 1.0.6.&lt;br /&gt;
**** eg [https://www.adafruit.com/product/5335 Adafruit CP2102N Friend (USB-C)]&lt;br /&gt;
**** eg [https://www.silabs.com/development-tools/interface/cp2102n-mini-development-kit?tab=overview Silicon Labs CP2102N-MINIEK (mini USB)]&lt;br /&gt;
**** eg [https://www.amazon.co.uk/DSD-TECH-SH-U09BL-Serial-CP2102N/dp/B08JLRP6YV DSD TECH SH-U09BL USB to TTL Serial Cable with CP2102N Chip]&lt;br /&gt;
*** FDTI&#039;s &#039;&#039;&#039;FT232R&#039;&#039;&#039;-like chips:&lt;br /&gt;
**** &#039;&#039;&#039;good until 781250&#039;&#039;&#039;, does not support 1562500.&lt;br /&gt;
**** 500000 and 1500000 will not work with all chips/on all pc, because of a 4% baud rate mismatch with the baudrates of the Dreamcast.&lt;br /&gt;
***** Even if you&#039;re lucky, you won&#039;t really get 1500000-worthy speeds - more probably around 130-150 kByte/sec...&lt;br /&gt;
&lt;br /&gt;
** connect the following pins (cfr [[Serial_interface]]):&lt;br /&gt;
*** GND &amp;lt;-&amp;gt; GND&lt;br /&gt;
*** TXD &amp;lt;-&amp;gt; RXD&lt;br /&gt;
*** RXD &amp;lt;-&amp;gt; TXD&lt;br /&gt;
*** RTS &amp;lt;-&amp;gt; CTS&lt;br /&gt;
*** CTS &amp;lt;-&amp;gt; RTS&lt;br /&gt;
&lt;br /&gt;
== Software to use ==&lt;br /&gt;
[[Dcload-serial]]&lt;br /&gt;
&lt;br /&gt;
== Supported Baud Rates ==&lt;br /&gt;
&#039;&#039;&#039;Not all common baudrates work&#039;&#039;&#039;, so the recommendations are:&lt;br /&gt;
* &#039;&#039;&#039;up until 115200&#039;&#039;&#039;, you can use the common baudrates: 9600, 19200, 38400, 57600, 115200&lt;br /&gt;
** if 115200 does not work, you can add the &amp;quot;-e&amp;quot; speedhack option&lt;br /&gt;
* &#039;&#039;&#039;higher baudrates&#039;&#039;&#039;: &lt;br /&gt;
** try first with the &#039;&#039;&#039;dreamcast-specific baudrates&#039;&#039;&#039; (223214, 260416, 312500, 390625, &#039;&#039;&#039;520833, 781250, 1562500&#039;&#039;&#039;)&lt;br /&gt;
** &#039;&#039;&#039;230400&#039;&#039;&#039;: use the -e speedhack option if you absolutely need 230400 at pc-side, but the DC will use 223214 or 260416 anyways.&lt;br /&gt;
** &#039;&#039;&#039;500000 and 1500000&#039;&#039;&#039;: you can try, but that will not work on all pc (the mismatch with the baudrate of the Dreamcast is sometimes too big (4%))&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{DCWiki:Stub}}&lt;/div&gt;</summary>
		<author><name>Tchan</name></author>
	</entry>
</feed>