DC Dev ISO R4

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.
BB Hood
Insane DCEmu
Insane DCEmu
Posts: 165
Joined: Fri Mar 30, 2007 12:09 am

Re: DC Dev ISO R4

Post by BB Hood » Thu Mar 27, 2008 2:02 am

I found more bugs that havent been fixed in the last release that I fixed but forgot to post about:

Change line 15 in kmgenc.h in this directory: C:\cygwin\usr\local\dc\kos\kos\utils\kmgenc
From:#include "../../addons/include/kmg/kmg.h"
To: #include "../../addons/include/kos/kmg.h"

Add: -lz to makefile for kmgenc.
Dreamcast
DCEmu Freak
DCEmu Freak
Posts: 71
Joined: Fri Jul 27, 2007 2:23 am

Re: DC Dev ISO R4

Post by Dreamcast » Mon Jun 23, 2008 8:04 am

Testing your installation (compiling a sample):

Once you have DC Dev ISO R4 installed, navigate to your root installation directory (c:\cygwin) and double click on cygwin.bat to enter the bash console. If you set the source/environment during the third part of the installation, you should be in the KOS directory (usr/local/dc/kos/kos)

Type "cd examples/dreamcast/hello" to change the directory to the hello world example. Here, type "make -f makefile" and the example should compile, adding the .ELF to the example's root directory (usr/local/dc/kos/kos/examples/dreamcast/hello).

For those who aren't familiar with the bash console / compiling.
Last edited by Dreamcast on Thu Jun 26, 2008 3:36 am, edited 1 time in total.
Dreamcast
DCEmu Freak
DCEmu Freak
Posts: 71
Joined: Fri Jul 27, 2007 2:23 am

Re: DC Dev ISO R4

Post by Dreamcast » Thu Jun 26, 2008 3:33 am

How is DCTOOL_IP / DCTOOL_SERIAL supposed to work in the makefile?

I tried changing the "run" section to this:

Code: Select all

run: $(TARGET)
	$(DCTOOL_IP) -t 192.168.1.137 -x $(TARGET)
(The IP address is the one the R4 disc's IPLOAD is configured to).

Side note: I think there might be a typo in some of the example makefiles. Under "clean" and "rm-elf", it starts off with a hyphen, however under "dist" it's just "rm." Is it supposed to be "-rm" or "rm" ? Either way, the files romdisk.o and romdisk.img aren't being removed for some reason. I think the reason DCTOOL_IP isn't running is because the make file is stopping before it for some reason.

Here is my makefile:

Code: Select all

TARGET = build.elf
OBJS = build.o romdisk.o
KOS_ROMDISK_DIR = romdisk
all: rm-elf $(TARGET)
include $(KOS_BASE)/Makefile.rules
clean:
	-rm -f $(TARGET) $(OBJS) romdisk.*
rm-elf:
	-rm -f $(TARGET) romdisk.*
$(TARGET): $(OBJS)
	$(KOS_CC) $(KOS_CFLAGS) $(KOS_LDFLAGS) -o $(TARGET) $(KOS_START) \
	$(OBJS) $(OBJEXTRA) $(KOS_LIBS)
run: $(TARGET)
	$(DCTOOL_IP) -t 192.168.1.137 -x $(TARGET)
	#$(KOS_LOADER) $(TARGET)
dist:
	-rm -f $(OBJS) romdisk.o romdisk.img
	$(KOS_STRIP) $(TARGET)
User avatar
emptythought
DC Developer
DC Developer
Posts: 2015
Joined: Wed Jan 30, 2002 9:14 am
Location: UNITED STATES NRN
Contact:

Re: DC Dev ISO R4

Post by emptythought » Thu Jun 26, 2008 12:53 pm

"make run" should run dc-tool.

Here are some examples on how I used it.

Code: Select all

##############################################################################
#dc-tool IP commands for BBA\LAN owners.
#
#It enables uploading binaries directly to your Dreamcast from your PC and
#also allows for remote debugging.
#
#You'll have to change the IP to your BBA\LAN's IP and also the MAC address,
#if your dc-tool IP needs ARP.
##############################################################################

#arp:
#	arp.exe -s 192.168.1.137 00-d0-f1-02-8a-f9

run: Wolf4SDL.elf
	$(DCTOOL_IP) -t 192.168.1.137 -i data.iso -x Wolf4SDL.elf

debug: Wolf4SDL.elf
	$(DCTOOL_IP) -g -t 192.168.1.137 -i data.iso -x Wolf4SDL.elf & sh-elf-insight.exe Wolf4SDL.elf

reset:
	$(DCTOOL_IP) -r -t 192.168.1.137
Dreamcast
DCEmu Freak
DCEmu Freak
Posts: 71
Joined: Fri Jul 27, 2007 2:23 am

Re: DC Dev ISO R4

Post by Dreamcast » Thu Jun 26, 2008 4:58 pm

Thanks, Fackue. I was just typing "make," thinking a makefile is run all the way through. That explains why the files weren't being erased. :lol: I can probably just add "run" as a dependency of "all" so I can still just use "make."

Is anyone else having trouble with $(KOS_OBJCOPY)? I tell it to operate in binary mode and pass along the ELF and output file name, but it outputs a file reporting a size of 2GB. When I try to scramble it, I get an out of memory error.
User avatar
emptythought
DC Developer
DC Developer
Posts: 2015
Joined: Wed Jan 30, 2002 9:14 am
Location: UNITED STATES NRN
Contact:

Re: DC Dev ISO R4

Post by emptythought » Thu Jun 26, 2008 5:11 pm

Use this instead.

Code: Select all

Wolf4SDL.bin: Wolf4SDL.elf
	kos-objcopy -O binary -R .stack Wolf4SDL.elf Wolf4SDL.bin
Dreamcast
DCEmu Freak
DCEmu Freak
Posts: 71
Joined: Fri Jul 27, 2007 2:23 am

Re: DC Dev ISO R4

Post by Dreamcast » Thu Jun 26, 2008 5:18 pm

Thanks again, Fackue. I found that $(KOS_OBJCOPY) can still be used as long as it includes "-R .stack" like your example does. I'll make references in the appropriate thread so as to not clutter up this one anymore.
User avatar
dir egal
DCEmu Newbie
DCEmu Newbie
Posts: 3
Joined: Sun Jul 27, 2008 6:37 pm

Re: DC Dev ISO R4

Post by dir egal » Sun Jul 27, 2008 6:54 pm

see, i registered just to say thank you fackue :wink:

i was looking for sth like this for weeks .. or even months
AmonX
DCEmu Freak
DCEmu Freak
Posts: 80
Joined: Tue Sep 09, 2008 12:49 pm

Re: DC Dev ISO R4

Post by AmonX » Wed Sep 10, 2008 1:38 am

Hi I am new here and would just like to say hi.
I reg'd because I was having trouble downloading DC Dev ISO R4 from the link fackue posted. IE
I asked around in some irc channels in EFnet I frequent and someone linked me this
http://rapidshare.com/files/125101963/DDEr4.rar So for those of you also having trouble.
User avatar
Maturion
Moderator
Moderator
Posts: 617
Joined: Fri Oct 12, 2007 1:52 pm
Location: Munich, Germany
Contact:

Re: DC Dev ISO R4

Post by Maturion » Wed Sep 10, 2008 3:09 pm

Oh thank you for that link, I hope fackue will fix his download soon.
User avatar
emptythought
DC Developer
DC Developer
Posts: 2015
Joined: Wed Jan 30, 2002 9:14 am
Location: UNITED STATES NRN
Contact:

Re: DC Dev ISO R4

Post by emptythought » Wed Sep 10, 2008 4:07 pm

Oh shit! Some hacker deleted all my files in the download folder :o. I don't have any backup CD's with me so... it's just going to have to stay like that for awhile.
1magus
DCEmu Newbie
DCEmu Newbie
Posts: 5
Joined: Wed Aug 27, 2008 10:52 pm

Re: DC Dev ISO R4

Post by 1magus » Sat Sep 27, 2008 12:03 am

I keep getting the following errors when I try to compile anything:
C C:\cygwin\usr\local\dc\kos\kos\examples\dreamcast\hello\sh-elf-gcc C:\cygwin\usr\local\dc\kos\kos\kernel\arch\dreamca: No such file or directory.
C:\cygwin\usr\local\dc\kos\kos\examples\dreamcast\hello\sh-elf-gcc st\kernel\startup.o: No such file or directory.

Any advice here?
User avatar
emptythought
DC Developer
DC Developer
Posts: 2015
Joined: Wed Jan 30, 2002 9:14 am
Location: UNITED STATES NRN
Contact:

Re: DC Dev ISO R4

Post by emptythought » Sat Sep 27, 2008 12:13 am

Code: Select all

cd /usr/local/dc/kos/kos/examples/dreamcast/hello
make
?
1magus
DCEmu Newbie
DCEmu Newbie
Posts: 5
Joined: Wed Aug 27, 2008 10:52 pm

Re: DC Dev ISO R4

Post by 1magus » Sat Sep 27, 2008 1:09 pm

fackue wrote:

Code: Select all

cd /usr/local/dc/kos/kos/examples/dreamcast/hello
make
?
Yeah ummmmm any advice? Cause it wont compile anything due to that error!
User avatar
emptythought
DC Developer
DC Developer
Posts: 2015
Joined: Wed Jan 30, 2002 9:14 am
Location: UNITED STATES NRN
Contact:

Re: DC Dev ISO R4

Post by emptythought » Sat Sep 27, 2008 2:25 pm

I've never seen that error before. It seems like the path to startup.o is broken in one of KOS' environment scripts - I'd look around there or even grab PowerSeek by SiZiOUS. You should then be able to search C:\cygwin\usr\local\dc\kos for "startup.o" in human-readable files (you'll have to add extensions for .sh - and it won't search in files without an extension).

Other than that, delete C:\cygwin and reinstall the Dev Environment.
User avatar
stevenh
DCEmu Newbie
DCEmu Newbie
Posts: 2
Joined: Sun Nov 30, 2008 8:28 pm

Re: DC Dev ISO R4

Post by stevenh » Sun Nov 30, 2008 8:40 pm

Are there any known issues with SDL in the current DEV ISO?
I've just built the examples and then turned them into CDIs with BootDreams and I can get the /kos/examples/png to work with nullDC and DEmul but nothing in the SDL folder will run... it all compiles fine but just shows a blank screen in all emulators.

Instead of creating coaster after coaster (as I did with OpenTTD DC) I got into the habit of just making images and slapping into an emulator... seems that it all used to work with R3 (or whatever I was using back then) but a fresh install of R4 with no mods will not allow me to run any SDL demos...

Is this an emulator issue?

And, fackue, your work is awesome!
User avatar
emptythought
DC Developer
DC Developer
Posts: 2015
Joined: Wed Jan 30, 2002 9:14 am
Location: UNITED STATES NRN
Contact:

Re: DC Dev ISO R4

Post by emptythought » Mon Dec 08, 2008 6:41 pm

No known issues that I know of.
Stryfe
Psychotic DCEmu
Psychotic DCEmu
Posts: 577
Joined: Mon Aug 11, 2008 9:34 am
Location: Nowhere U.S.A.

Re: DC Dev ISO R4

Post by Stryfe » Mon Jan 19, 2009 2:37 pm

I'm not sure if this is the right place to ask this..., but does this allow you to compile source files in a Windows environment? Or, is it for a DC with a coders cable?
ImageImageImageImage
Dreamcast
DCEmu Freak
DCEmu Freak
Posts: 71
Joined: Fri Jul 27, 2007 2:23 am

Re: DC Dev ISO R4

Post by Dreamcast » Mon Jan 19, 2009 3:28 pm

It's both. You can compile your code into a binary and then you can either use that to create a bootable CD or you can send it over to the Dreamcast with a coder's cable / BBA. Once you install the development environment, the installation disc doubles as a bootable disc in your Dreamcast that can run DC-LOAD-SERIAL or DC-LOAD-IP (software used to retrieve / boot your compiled software).
User avatar
emptythought
DC Developer
DC Developer
Posts: 2015
Joined: Wed Jan 30, 2002 9:14 am
Location: UNITED STATES NRN
Contact:

Re: DC Dev ISO R4

Post by emptythought » Wed Jan 21, 2009 7:55 am

...or use one of the few Dreamcast emulators in /cd/Extras/Emulators.
Post Reply