I am new to D.C. development, and I'm requiring guidance.

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
User avatar
Brian.Washechek
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 29
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Wed Apr 16, 2014 6:36 pm
Location: My room.
Has thanked: 0
Been thanked: 0
Contact:

I am new to D.C. development, and I'm requiring guidance.

Post by Brian.Washechek »

I'm not new to programming, but I am new to D.C. development. How do I set up the D.C. development kit, and learn how to compile stuff?

I'd like to...
1. learn how to set up the D.C. development kit.
2. learn how to compile stuff.
3. learn by example by method of looking at the code for simple Dreamcast roms. Could you please provide me with links to such projects if they even exist? I'm looking for "Pacman", "Asteroids", "Burning Parachutes" or "Tetris" clones. I'm looking for something of this nature.
User avatar
bogglez
Moderator
Moderator
Posts: 578
Joined: Sun Apr 20, 2014 9:45 am
Has thanked: 0
Been thanked: 0

Re: I am new to D.C. development, and I'm requiring guidance

Post by bogglez »

Hello Brian.

I've made my installation script (for unix systems) newbie-friendly for you. Save it as kos_setup.sh and run sh kos_setup.sh.
It should build the compiler, install KOS and KOS ports, then put you in an example folder.

The example nehe02 shows you how to get something on screen using OpenGL and also shows you how to get controller input.
From then on you won't need Dreamcast-specific guides to learn how to make Tetris or other games, but can use all kinds of game programming guides from the internet.

If you have questions, please ask.

Code: Select all

#!/bin/sh

# Stop script on error
set -e

# Check for sudo
program_exists() { command -v "$1" >/dev/null 2>&1; }
program_exists sudo || { echo "Please install sudo."; exit 1; }

# Check for GCC 4.9, GCC 5 won't be able to compile the compiler.
if ! program_exists gcc-4.9 || ! program_exists g++-4.9; then
	echo "Please install gcc-4.9 and g++-4.9, since version 5 is buggy.";
	program_exists apt-get && sudo apt-get install gcc-4.9 g++-4.9 || exit 1
fi

# Create install directory
INSTALL_DIR="/opt/toolchains/dc"
KOS="$INSTALL_DIR/kos"
PORTS="$INSTALL_DIR/kos-ports"
echo "Creating directory $INSTALL_DIR as root, giving users access to it."
sudo mkdir -p    "$INSTALL_DIR"
sudo chmod o+rwx "$INSTALL_DIR"

# Download the code for KOS + KOS-ports
echo "Downloading KOS and KOS ports."
[ -d "$KOS" ]   || git clone              git://git.code.sf.net/p/cadcdev/kallistios "$KOS"
[ -d "$PORTS" ] || git clone  --recursive git://git.code.sf.net/p/cadcdev/kos-ports  "$PORTS"

# Build the compiler
# You need to change the Makefile if you want to install somewhere else.
if ! program_exists "$INSTALL_DIR/sh-elf/bin/sh-elf-gcc" || ! program_exists "$INSTALL_DIR/sh-elf/bin/sh-elf-g++"; then
	echo "Building the compiler."
	cd   "$KOS/utils/dc-chain"
	echo "Downloading.."; sh download.sh
	echo "Unpacking..";   sh unpack.sh
	echo "Compiling..";   CC=gcc-4.9 CXX=g++-4.9 make erase=1
fi

# Create environment
# You need to change environ.sh and environ_base.sh if you want to install somewhere else.
[ -f "$KOS/environ.sh" ] || cp "$KOS/doc/environ.sh.sample" "$KOS/environ.sh"
. "$KOS/environ.sh"

# Build KOS
echo "Compiling KOS."
cd   "$KOS"
make

# Build KOS ports
echo "Compiling KOS ports."
sh   "$PORTS/utils/build-all.sh"

# Examples
program_exists x-www-browser && x-www-browser 'http://gamedev.allusion.net/docs/kos-current/structcont__state__t.html'
echo ""
echo "Welcome to KOS!"
echo "Please check out the example in \`$KOS/examples/dreamcast/kgl/nehe/nehe02' to get started."
echo "After editing main.c, type \`make' to create an ELF executable. Run it using an emulator."
echo "KOS documentation is at http://gamedev.allusion.net/docs/kos-current."
echo "When you start a new shell, please type \`source $KOS/environ.sh' in order to set the environment variables."
Last edited by bogglez on Mon Dec 28, 2015 1:12 pm, edited 2 times in total.
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
User avatar
Brian.Washechek
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 29
Joined: Wed Apr 16, 2014 6:36 pm
Location: My room.
Has thanked: 0
Been thanked: 0
Contact:

Re: I am new to D.C. development, and I'm requiring guidance

Post by Brian.Washechek »

How do I run kos_setup.sh? I haven't heard of the *.sh extension. Will it possibly just run like *.exe files?

(Just as a side question: what does "sh" stand for?)
User avatar
bogglez
Moderator
Moderator
Posts: 578
Joined: Sun Apr 20, 2014 9:45 am
Has thanked: 0
Been thanked: 0

Re: I am new to D.C. development, and I'm requiring guidance

Post by bogglez »

It seems like you're a Windows user. Sorry, but I'm a Unix user.
Maybe this guide by Ph3nom can help you?
viewtopic.php?f=29&t=102800#p1041492
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
User avatar
Brian.Washechek
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 29
Joined: Wed Apr 16, 2014 6:36 pm
Location: My room.
Has thanked: 0
Been thanked: 0
Contact:

Re: I am new to D.C. development, and I'm requiring guidance

Post by Brian.Washechek »

Someone has linked me to that exact page before. Going over it was on my "to do" list. When I finish practicing piano then I'll take a shower and then I'll go over it.

P.S. Somewhere I have a Linux laptop. Is it THAT superior to Windows? (I consider Linux and Unix BASICALLY the same. Am I wrong to do so?)
User avatar
bogglez
Moderator
Moderator
Posts: 578
Joined: Sun Apr 20, 2014 9:45 am
Has thanked: 0
Been thanked: 0

Re: I am new to D.C. development, and I'm requiring guidance

Post by bogglez »

Brian.Washechek wrote:Somewhere I have a Linux laptop. Is it THAT superior to Windows? (I consider Linux and Unix BASICALLY the same. Am I wrong to do so?)
Linux is a clone of Unix. They're very similar, so most people will refer to Linux as a Unix system. Mac OS X and FreeBSD etc are also Unix-like.
Whether Linux is better than Windows.. many people have fought dozens of flamewars about this on the internet, I won't join. Try both and use whatever works for you :-)

You could try running my script on your Linux laptop and see whether that works for you: copy the script I posted earlier into a file "kos_setup.sh", open a terminal and run "sh kos_setup.sh".
Installation of KOS is easier on a Unix-like system than Windows, due to the way it was developed. So maybe it will be easier for you this way. Otherwise work through Ph3nom's guide on Windows.
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
User avatar
Brian.Washechek
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 29
Joined: Wed Apr 16, 2014 6:36 pm
Location: My room.
Has thanked: 0
Been thanked: 0
Contact:

Re: I am new to D.C. development, and I'm requiring guidance

Post by Brian.Washechek »

I have a spare laptop lying here. Loading Unix on it would consist of me learning a new operating system, while programming my first Dreamcast game. Here is the question I have: Do you think that today, I should format it's hard drive and load Unix on it?

Do you think that's a good plan for today?

(P.S. I've used Linux before. Is Unix that different?)
User avatar
bogglez
Moderator
Moderator
Posts: 578
Joined: Sun Apr 20, 2014 9:45 am
Has thanked: 0
Been thanked: 0

Re: I am new to D.C. development, and I'm requiring guidance

Post by bogglez »

It seems I confused you a bit. I'm also on Linux. There's no need to format your laptop. The script should also work on Mac OS X and FreeBSD etc, is what I tried to say.
Perhaps you want to upgrade your system if it's old, though. :-)
What distribution are you running? Debian, fedora, Ubuntu..?
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
User avatar
Brian.Washechek
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 29
Joined: Wed Apr 16, 2014 6:36 pm
Location: My room.
Has thanked: 0
Been thanked: 0
Contact:

Re: I am new to D.C. development, and I'm requiring guidance

Post by Brian.Washechek »

Ummmmmm.... Ha-ha. I'm only finding half of it's power supply. I think I'm going to develop games for the Dreamcast on the laptop that I'm currently using. It has a 64 bit Windows 10.

My laptop O.S. list goes

- Dell with Windows 10 which I'm currently using.
- Toshiba with Windows version 6.3 (but a free upgrade to 10 has just been offered)
- IBM that doesn't work and I quit caring about a long time ago.

I have the Toshiba with Windows lying here and I'm all about learning new operating systems, so what do you think I should do?

1. Should I just use my Windows 10 machine to develop on?
2. Do I load another O.S. on my Toshiba?
Last edited by Brian.Washechek on Mon Dec 28, 2015 1:16 pm, edited 1 time in total.
User avatar
bogglez
Moderator
Moderator
Posts: 578
Joined: Sun Apr 20, 2014 9:45 am
Has thanked: 0
Been thanked: 0

Re: I am new to D.C. development, and I'm requiring guidance

Post by bogglez »

No idea, just try Ph3nom's guide.
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
User avatar
Brian.Washechek
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 29
Joined: Wed Apr 16, 2014 6:36 pm
Location: My room.
Has thanked: 0
Been thanked: 0
Contact:

Re: I am new to D.C. development, and I'm requiring guidance

Post by Brian.Washechek »

I just found out that loading another O.S. on my Toshiba isn't happening. So, l'm stuck with Windows 10.
User avatar
Brian.Washechek
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 29
Joined: Wed Apr 16, 2014 6:36 pm
Location: My room.
Has thanked: 0
Been thanked: 0
Contact:

Re: I am new to D.C. development, and I'm requiring guidance

Post by Brian.Washechek »

Can you help me with this?
Attachments
Problem at 13-13 PM 12-28-2015 on DC forum.gif
User avatar
bogglez
Moderator
Moderator
Posts: 578
Joined: Sun Apr 20, 2014 9:45 am
Has thanked: 0
Been thanked: 0

Re: I am new to D.C. development, and I'm requiring guidance

Post by bogglez »

Isn't 4) just the title of what you're going to do in steps 4a, 4b etc? Just do what 4a tells you to.
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
User avatar
Brian.Washechek
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 29
Joined: Wed Apr 16, 2014 6:36 pm
Location: My room.
Has thanked: 0
Been thanked: 0
Contact:

Re: I am new to D.C. development, and I'm requiring guidance

Post by Brian.Washechek »

It's probably asking me to install dc-chain-kos-2.0.zip...
Ha-ha-ha.... Let me take my stupid pants off!
.
...
.......
.......zip.......
.......
...
.
...
...slide....
...
.
Alright, now that I'm no longer wearing my stupid pants, let me try again. Thanks for your patience!
User avatar
Brian.Washechek
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 29
Joined: Wed Apr 16, 2014 6:36 pm
Location: My room.
Has thanked: 0
Been thanked: 0
Contact:

Re: I am new to D.C. development, and I'm requiring guidance

Post by Brian.Washechek »

Could you post that link to the website in this picture?
Attachments
Problem on 12-28-2015 at 13-13 PM.gif
User avatar
bogglez
Moderator
Moderator
Posts: 578
Joined: Sun Apr 20, 2014 9:45 am
Has thanked: 0
Been thanked: 0

Re: I am new to D.C. development, and I'm requiring guidance

Post by bogglez »

Sorry, what website? I don't see any.
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
User avatar
BlueCrab
The Crabby Overlord
The Crabby Overlord
Posts: 5664
Joined: Mon May 27, 2002 11:31 am
Location: Sailing the Skies of Arcadia
Has thanked: 9 times
Been thanked: 69 times
Contact:

Re: I am new to D.C. development, and I'm requiring guidance

Post by BlueCrab »

I think he's referring to the Cygwin path in the picture. That's not a website... It is a path on your computer.

If you installed things with the normal settings, it's probably at C:\Cygwin\usr\local\dc\kos.
User avatar
Brian.Washechek
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 29
Joined: Wed Apr 16, 2014 6:36 pm
Location: My room.
Has thanked: 0
Been thanked: 0
Contact:

Re: I am new to D.C. development, and I'm requiring guidance

Post by Brian.Washechek »

Correct. Heh-heh. It's on my computer! It was because it was in an Opera window so I mindlessly thought it was an Internet window. Thanks AGAIN for your patience! I really need to stop being so thoughtless.
User avatar
Brian.Washechek
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 29
Joined: Wed Apr 16, 2014 6:36 pm
Location: My room.
Has thanked: 0
Been thanked: 0
Contact:

Re: I am new to D.C. development, and I'm requiring guidance

Post by Brian.Washechek »

At "C:\Cygwin\usr\local\dc\kos\", I have this...
Problem on 12-28-2015 at 10-35 PM.gif
Problem on 12-28-2015 at 10-35 PM.gif (10.07 KiB) Viewed 3845 times
I take it I'm supposed to open the kos-2.0.0-src.tar. If I'm correct, what should I do with the contents?
User avatar
bogglez
Moderator
Moderator
Posts: 578
Joined: Sun Apr 20, 2014 9:45 am
Has thanked: 0
Been thanked: 0

Re: I am new to D.C. development, and I'm requiring guidance

Post by bogglez »

It tells you in the guide. Extract the tar, put the contents in util/dc-chain, go to the next step
Wiki & tutorials: http://dcemulation.org/?title=Development
Wiki feedback: viewtopic.php?f=29&t=103940
My libgl playground (not for production): https://bitbucket.org/bogglez/libgl15
My lxdream fork (with small fixes): https://bitbucket.org/bogglez/lxdream
Post Reply