Mac <-> DC Programmer Thread

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.
hikikomori
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 33
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Thu May 22, 2003 3:48 pm
Has thanked: 0
Been thanked: 0

Post by hikikomori »

oookay! I just edited environ.sh and 'Hello World VMU' and 'Made on a Mac' compiled without errors via Xcode. The only point I see is that Xcode (I dunno about ProjectBuilder on Jaguar) puts the results in a folder named 'build', wich is more tidy... let's see if I can find on the doc how to do this.

Good work nobody_ :wink:

hkkm
hikikomori
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 33
Joined: Thu May 22, 2003 3:48 pm
Has thanked: 0
Been thanked: 0

Post by hikikomori »

Well, for those with Panther, I've located the Xcode project template folder:

Code: Select all

/Library/Application Support/Apple/Developer Tools/Project Templates

cheers

hkkm
User avatar
nobody in particular
DCEmu Freak
DCEmu Freak
Posts: 64
Joined: Tue Jul 01, 2003 3:48 pm
Location: Clemson, SC
Has thanked: 0
Been thanked: 0

Post by nobody in particular »

Oh, another thing I just ran accross... I forgot to take a bitmap out of the Dual-Platform SDL Romdisk template folder before I distributed it. I'll put up a new archive, but for those of you who already have it, empty the SDL template's Romdisk folder so your programs won't get unnecessarily large :D

And thanks, hikikomori, I was a little worried it wouldn't work in Xcode.
IPyRo
DCEmu Fast Newbie
DCEmu Fast Newbie
Posts: 22
Joined: Mon Nov 03, 2003 1:18 am
Location: Home
Has thanked: 0
Been thanked: 0
Contact:

Post by IPyRo »

where do you guys figure this stuff out like is there a place or a book I should buy because i would like to program like that i think thats realy cool :D so I was wondering if some one could give me a place to start as you can tell i'm new at this but Im willing wo learn so thanks in advance for any information
thanks
hikikomori
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 33
Joined: Thu May 22, 2003 3:48 pm
Has thanked: 0
Been thanked: 0

Post by hikikomori »

nobody in particular wrote:And thanks, hikikomori, I was a little worried it wouldn't work in Xcode.
thanks to you! :wink:

hkkm
hikikomori
DCEmu Crazy Poster
DCEmu Crazy Poster
Posts: 33
Joined: Thu May 22, 2003 3:48 pm
Has thanked: 0
Been thanked: 0

Post by hikikomori »

IPyRo wrote:where do you guys figure this stuff out like is there a place or a book I should buy because i would like to program like that i think thats realy cool :D so I was wondering if some one could give me a place to start as you can tell i'm new at this but Im willing wo learn so thanks in advance for any information
thanks
I'm starting also :wink:
You'll find a lot of information here http://www.boob.co.uk/tutorials/guide.html
Hope it helps!

hkkm
User avatar
I.M. Weasel
Iron Muskateer Weasel
Posts: 2780
Joined: Fri Jan 04, 2002 4:45 am
Location: The city of the future, Los Braingeles
Has thanked: 1 time
Been thanked: 3 times
Contact:

Post by I.M. Weasel »

what is a .sitx file exactly? :wink:
:arrow: http://tofuheavyindustries.com
Mac Dream Tool / Mac Dream Tool Services (released Sept. 2019)
Creator of Various awesome Video Games

"You don't have to be forgiven. Clint Eastwood taught us that."
User avatar
nobody in particular
DCEmu Freak
DCEmu Freak
Posts: 64
Joined: Tue Jul 01, 2003 3:48 pm
Location: Clemson, SC
Has thanked: 0
Been thanked: 0

Post by nobody in particular »

It's a newer version of the Stuffit .sit file. You can open it with recent versions of Stuffit Expander.
User avatar
greay
DCEmu Ultra Poster
DCEmu Ultra Poster
Posts: 1938
Joined: Wed Jan 21, 2004 10:59 am
Location: 24 hours from Tulsa
Has thanked: 0
Been thanked: 0
Contact:

Post by greay »

anyone tried to get sh-elf-gcc to do objective C yet? I've somehow gotten sh-elf-gcc and sh-elf-g++ and stuff built, but I haven't gotten as far as being able to test them, yet.
(ahh, using gcc-3.3.2, binutils 2.14, and newlib 1.9.0)

I've also been trying to compile kos-1.2.0...

Though, the jpeglib && pnglib .h files (whatever they're called, I can't remember) are somewhere in the kos/addons/ directory... Seems when the Makefile's trying to make vqenc it doesn't use the KOS_ALL_INCS variable from Makefile.rules. Got me as to why, or why when I tried "fixing" that it didn't do a damned thing.

*** seems I somehow missed the last page of posts - the one containing information about a patch. I'm gonna try that now. ***

-greay
User avatar
greay
DCEmu Ultra Poster
DCEmu Ultra Poster
Posts: 1938
Joined: Wed Jan 21, 2004 10:59 am
Location: 24 hours from Tulsa
Has thanked: 0
Been thanked: 0
Contact:

Post by greay »

gwahh!

cc -o vqenc vqenc.o get_image.o get_image_jpg.o get_image_png.o readpng.o -s -lpng -ljpeg
ld: Undefined symbols:
_zlibVersion
_crc32
_inflateReset
_inflate
_inflateEnd
_inflateInit_
make[2]: *** [vqenc] Error 1
make[1]: *** [all] Error 2
make: *** [build-utils] Error 2


I /know/ I have zlib. Somewhere.

-greay
User avatar
nobody in particular
DCEmu Freak
DCEmu Freak
Posts: 64
Joined: Tue Jul 01, 2003 3:48 pm
Location: Clemson, SC
Has thanked: 0
Been thanked: 0

Post by nobody in particular »

greay wrote:anyone tried to get sh-elf-gcc to do objective C yet? I've somehow gotten sh-elf-gcc and sh-elf-g++ and stuff built, but I haven't gotten as far as being able to test them, yet.
I've been writing Dreamcast programs in Objective-C (best language ever :wink: ). I've got a KOS version of libobjc avaliable at the same site as the previously mentioned Project Builder template.

In response to the zlib issue: add -lz to the linker flags in vqenc's Makefile.
User avatar
greay
DCEmu Ultra Poster
DCEmu Ultra Poster
Posts: 1938
Joined: Wed Jan 21, 2004 10:59 am
Location: 24 hours from Tulsa
Has thanked: 0
Been thanked: 0
Contact:

Post by greay »

cool, I'm gonna try that out, after I get this whole arm_elf thing worked out (seems the build failed last time I tried; not sure why). the kallistios build failed b/c I was reusing my old environ-dc script; I forgot to add KOS_MAC="true" in there. But then I get an error about the arm-elf thing. :/

Grr... seems some more work's ahead for me.
User avatar
greay
DCEmu Ultra Poster
DCEmu Ultra Poster
Posts: 1938
Joined: Wed Jan 21, 2004 10:59 am
Location: 24 hours from Tulsa
Has thanked: 0
Been thanked: 0
Contact:

Post by greay »

Okay. One would think that everything should work now. Got the compilers built and installed; got kallistios built, and am trying out the examples.

Now, the makefiles there do funny things, but I managed to compile one of the examples (2ndmix) by hand.

what happens is this: I want to test it, and don't have a cable yet, so I'm going to make a CD: first step is run "sh-elf-objcopy -O binary 2ndmix.elf 2ndmix.bin", right? I get this message:

sh-elf-objcopy: 2ndmix.bin: File truncated

and the file size of 2ndmix.bin is 0. any idea where I went wrong?
User avatar
nobody in particular
DCEmu Freak
DCEmu Freak
Posts: 64
Joined: Tue Jul 01, 2003 3:48 pm
Location: Clemson, SC
Has thanked: 0
Been thanked: 0

Post by nobody in particular »

Someone on the KOS mailing list had a similar problem, maybe this could help: http://sourceforge.net/mailarchive/mess ... id=6870495
User avatar
greay
DCEmu Ultra Poster
DCEmu Ultra Poster
Posts: 1938
Joined: Wed Jan 21, 2004 10:59 am
Location: 24 hours from Tulsa
Has thanked: 0
Been thanked: 0
Contact:

Post by greay »

cool. Ugh. I ended up getting around the problem by moving backwards in version - I'm using the precompiled toolchains posted earlier on in this forum, now. Maybe I can switch back, now, so all that hard work (using the most recent versions of all the tools) won't be for naught.

That's for another time, though... I don't want to have to go through all that again.
User avatar
greay
DCEmu Ultra Poster
DCEmu Ultra Poster
Posts: 1938
Joined: Wed Jan 21, 2004 10:59 am
Location: 24 hours from Tulsa
Has thanked: 0
Been thanked: 0
Contact:

libFoundation

Post by greay »

I'm in the midst of porting libFoundation to the dreamcast/KOS. It's causing me hell, but I'm sparing no expense in mangling things, and I've gotten this far: it does build; that is, I have libFoundation.a

Unfortunately, it does this producing a /whole lot/ of warnings; I've gotten rid of most of them, but now I'm going through all the "implicit declaration of function `foo'"s...

As a sample of these implicitly declared functions, there's open, fstat, read, close, chmod, utime... A whole bunch of others. I've been looking at the KOS documentation, and it seems a lot of these fns have equivalents (although I can't seem to find one for fstat).

Hmm, what else... Ahh, yes. Though fairly sure it wdn't work, I made a quick "Hello, world" program to test the library (using NSObject)... It failed miserably during linking - the first of the errors was

libFoundation/NSObject.m:260: undefined reference to `___objc_class_name_ObjcRuntimeException'

Now, the code segment for this is:

+ (oneway void)release
{
}

... I'm a bit lost as to where the reference is.
So, my question is, anyone interested in help out in this endeavor? I don't really have anywhere to host the stuff, but the .tar.gz file's only 280K.
User avatar
nobody in particular
DCEmu Freak
DCEmu Freak
Posts: 64
Joined: Tue Jul 01, 2003 3:48 pm
Location: Clemson, SC
Has thanked: 0
Been thanked: 0

Post by nobody in particular »

Send it to me, I'll take a look at it.
User avatar
greay
DCEmu Ultra Poster
DCEmu Ultra Poster
Posts: 1938
Joined: Wed Jan 21, 2004 10:59 am
Location: 24 hours from Tulsa
Has thanked: 0
Been thanked: 0
Contact:

Post by greay »

gahh.. My SMTP server's not working right now.

gotta run to work now, but I managed to get quite a bit done yesterday/today: I've narrowed the problems (i.e., errors while linking) to a couple fns:

select()
vfprintf() // haven't looked at it, printf() might work?
lseek() // kos seems to have an equivalent, but I haven't found it
ftruncate() // same, maybe just comment it out?
dlopen()
dlerror()
User avatar
greay
DCEmu Ultra Poster
DCEmu Ultra Poster
Posts: 1938
Joined: Wed Jan 21, 2004 10:59 am
Location: 24 hours from Tulsa
Has thanked: 0
Been thanked: 0
Contact:

Post by greay »

hey, anybody here had any luck using the coder's cable? I finally got my USB->Serial adapter, and I'm running into trouble compiling dc-tool.

(i.e., syscalls.c: In function `dc_dreaddir': .. error: structure has no member named `d_off')

EDIT:... Why does the "search" never work for me? I had to find the post on this board through google. grr.... anyway, it seems someone has, but the page is down. I'll keep looking.
User avatar
I.M. Weasel
Iron Muskateer Weasel
Posts: 2780
Joined: Fri Jan 04, 2002 4:45 am
Location: The city of the future, Los Braingeles
Has thanked: 1 time
Been thanked: 3 times
Contact:

Post by I.M. Weasel »

greay wrote: I've also been trying to compile kos-1.2.0...

Though, the jpeglib && pnglib .h files (whatever they're called, I can't remember) are somewhere in the kos/addons/ directory... Seems when the Makefile's trying to make vqenc it doesn't use the KOS_ALL_INCS variable from Makefile.rules. Got me as to why, or why when I tried "fixing" that it didn't do a damned thing.

*** seems I somehow missed the last page of posts - the one containing information about a patch. I'm gonna try that now. ***

-greay
Where you able to get kos working using the jpeg and png libraries included with it? And did you use matts patch?
greay wrote:hey, anybody here had any luck using the coder's cable? I finally got my USB->Serial adapter, and I'm running into trouble compiling dc-tool.

(i.e., syscalls.c: In function `dc_dreaddir': .. error: structure has no member named `d_off')
What brand & model usb<-> serial adapter are you using?

if syscalls.c is in the dc's 'side' then i bet something before it didnt get defined in a previous header file.

dc_dreaddir.d_off = dc d ? read directory
the member "d_off" is just probably an int ( 1-on,0-off).
:arrow: http://tofuheavyindustries.com
Mac Dream Tool / Mac Dream Tool Services (released Sept. 2019)
Creator of Various awesome Video Games

"You don't have to be forgiven. Clint Eastwood taught us that."
Post Reply