Login
Username:

Password:

Remember me



Lost Password?

Register now!

Sections

Who's Online
104 user(s) are online (77 user(s) are browsing Forums)

Members: 0
Guests: 104

more...

Headlines

Forum Index


Board index » All Posts (LordArt)




Re: Visual Studio 2005 and cross compiling to OS4
Just popping in
Just popping in


If you ever wanted to use the Visual Studio IDE to write Amiga programs, that is what this document is about. This document uses Visual Studio 2005 as it's baseline since it has a very nice IDE, especially with plug-ins like Visual Assist (I think you can use the same directions for VS 2008 but since I don't have that I can't guarantee it).

Getting started:

-Download/acquire Visual Studio 2005. You may already have this, or you can get Visual Studio 2005 Express which is free. Install it.
-Download cygwin from http://www.cygwin.com . It will just give you a setup.exe file. Install it, and make sure you select "make" to be installed for the setup (it's under the development heading). (I'm sure gcc experts out there will have a bunch of other recommendations, but I'm use to VS not gcc, so I'm unfamiliar with all the gcc tools).
-Download the Cross compiler(s) you want from http://cross.zerohero.se . I've tried both the OS4 and OS3.x and they both work, and they can co-exist side by side. (If you are like me and like to compile on the go on your laptop, testing things out under OS3 via WinUAE can be useful!) Grab all the i686-cygwin for the compiler you want (or both) and any supporting files (including the SDK if OS4). The documentation on the particular webpage describes what you want to do with them. Install the ones you want to use, using the paths created by Cygwin that look like Unix. (ie. most of the stuff wants to be uncompressed to /usr/local which in my case is D:/cygwin/usr/local)

Configuring:
-You'll need to put the bin for the compilers in the Windows path. To do that you go to Start->Settings->Control Panel->System.
Click on the Advanced Tab and clock on Environment Variables. Find the path variable. Tack on where you installed your compiler and cygwin's bin path. (Ie. for me it is D:\cygwin\bin;D:\cygwin\usr\local\amiga\bin ) This will allow VS to call your gcc compiler.
-Open up VS, make a new project. Use Visual C++->General->Makefile Project. It will bring up a "wizard" to set certain configurations. Click "next" to go to the debug configuration. Under "Build Command line" put "make -f makefile.mak 2>&1 | sed -e 's/\(\w\+\):\([0-9]\+\):/\1(\2):/'" (Remove the double quotes, but leave the single quotes). Put the same for the rebuild. Under Clean, put "make -f makefile.mak clean". (Keep in mind that it's specifying the makefile as makefile.mak, so change that if you want it a different name)

And you are all done! You can start importing your C/C++ files into the project (and your makefile!). If you don't have a make file yet, you'll have to make one, but there is plenty on the net about that (although, honestly, I wouldn't mind a tutorial about that myself). A sample REALLY basic one would be:


CC=ppc-amigaos-gcc {This can either be m68k-amigaos-gcc or ppc-amigaos-gcc depending if you are trying for OS3.X or OS4 respectively)

CFLAGS= {compiler flags go here such as -ggdb}

CPPFLAGS = {preprocessor stuff goes here such as -D __USE_INLINE__}

objects = {your final object files, such as main.o. It assumes that if there is a main.o there is a main.c that compiles into it. This objects variable is here to make things easier}

{EXE name}: ${objects}

clean:
{tab which won't show up on a webpage}rm -f ${objects}

Here is a REAL example...take this as literal:

CC=ppc-amigaos-gcc

CFLAGS= -ggdb

CPPFLAGS = -D GOWSP

objects= GLTest.o

GLTest: ${objects}

clean:
rm -f ${objects}


A couple things to keep in mind, the debugger won't work with your new program. You'll have to use an Amiga debugger such a gdb under OS4. I heard that it is possible to setup remote GDB to work with VS, but I haven't even attempted that yet. Another thing is that while VS keeps around preprocessor information, it ends up being only for itself, and won't change your compile at all. Everything that you change MUST be in your make file. I wish VS would export the preprocessor directives in an environment variable like it does everything else, but I couldn't find it. Otherwise, it could pass it to the make file! (Perhaps someone wiser than me knows the answer).

Have fun coding!

Go to top


Re: Visual Studio 2005 and cross compiling to OS4
Just popping in
Just popping in


As silly as this might seem, I actually got this running finally last night. Personal time is at a premium as I'm sure it is for many of you.

Stay tuned for an official write up of how to do it...

From what I understand, one can get the remote GDB going through VS, but that's a different monster and far nastier to try...But one that may have to be tackled....

P.S. Should I do the write up on this thread or somehow submit it somewhere?

Go to top


Re: Status of OpenGL (or compatible) for OS4
Just popping in
Just popping in


@Hans
Quote:

Out of curiosity, how are things progressing with porting your game to OS4?

Hans


Stalled. Considering I JUST noticed your question, that should give you an indication of how busy my life has been of late! Once my life calms down again, I hope to give it more of a shot. I bought Cubic IDE to do OS4 Development, but while I've installed it, I haven't even compiled a program yet on it successfully. I DID get an answer about how to do cross compiling via Visual Studio 2005, so I hope to be attempting that soon!

(Between work, and starting another business, I just have no time, unfortunately!) But I appreciate the inquery!

Go to top


Re: Visual Studio 2005 and cross compiling to OS4
Just popping in
Just popping in


@Hans

Excellent! It's a place to start at least. I figuired it was too esoteric for people to do outside the Amiga community to be googled. Silly me. :)

If/When I get it running, I'll try to post something up about it on Utility base and here (if people are interested in such things).

Thanks!

Arthur

Go to top


Re: Visual Studio 2005 and cross compiling to OS4
Just popping in
Just popping in


@LordArt

*BUMP*

I know SG2 has been able to do what I ask, but I don't know if he is still around. I PMed him, but I haven't gotten a response. Anyone know?

Thanks!

Go to top


Re: Status of OpenGL (or compatible) for OS4
Just popping in
Just popping in


@Hans

Quote:
I'm having a look at adding display-lists right now. Like Rogue said, it's a little tedious, but shouldn't be hard.


It would be greatly appreciated! Thanks!

Now to figuire out the compiler issue... :) (I'm trying not to have divergent trees because of compiler differences. I know that is impossible, but I want to keep it minimal.)

Go to top


Visual Studio 2005 and cross compiling to OS4
Just popping in
Just popping in


I've asked this before a while ago and while it was confirmed that someone had done it, it was never explained how.

I know somehow you can switch out which compilier Visual Studio 2005 uses to compile. I'd like to continue using the IDE interface for what I'm use to to make OS4 programs. If someone actually tells me how to do this, I will do a step-by-step write up for others to do the same. I would think the easier it was to compile OS4 programs the more would be inclined to do so.

Any help would be appreciated! Thanks!

Arthur

P.S. Please don't turn this thread into a "You shouldn't be using Visual Studio as your IDE and should be using X" thread. I'm asking a serious question.

Go to top


Re: Status of OpenGL (or compatible) for OS4
Just popping in
Just popping in


@Rogue

Thanks for the reply!

Quote:
If you need speed, forget about StormMESA. It doesn't work on AmigaOS 4.0 anyway, since it requires the obsolteted indirect mode.


I've heard that, but I figuired I'd mention it. :)

<Snip long list of GL functions>

To determine the list, I swapped out the gl.h include with the gl.h in the MiniGL archive I got from Aminet. Barring a few hacks of the includes, I got it to compile and waited for the error list, then double checked the missing functions against the gl.h include file with MiniGL to verify if they were there or not. Is the one on AmiNet not the most up to date (which wouldn't surprise me at all considering when it was dated)? And if not, where would one get a newer one? (I logged into Hyperion's site but I didn't see anything there via the website).

It's a pity that the Lists aren't there, but I've known that for a while. I'd still like to see my project running on OS4, and I can always dummy out those calls since the whole thing doesn't use lists. Wouldn't one be able to grab the list functions from a version of Mesa to integrate in MiniGL? (I'm not saying for you, I mean just in general)

Thanks again!

Arthur

P.S. Now to start an annoying thread about cross-compiling!


P.P.S. As far as using Doubles for certain things over floats, the majority of my program uses floats, but for certain things it does use doubles. Mostly because of the scales involved...The further from the origin, the more the imprecision is noticed and makes things "shakey". I already use "sectors" to compensate for that however, so I guess I can shrink the sectors. I don't remember at this point which part uses the doubles precisely, so I'll have to look into that. Using the f versions will do for now for a port to get it running (even if I just do a wrapper).

Go to top


Status of OpenGL (or compatible) for OS4
Just popping in
Just popping in


I've been writting for a LONG time a game using OpenGL, and I'd like to have it run on OS4.

I know the standard answer is "use MiniGL", but I've already done a lot of work and there are things lacking in MiniGL. So I was wondering if StormMesa or some other OpenGL implementation was more complete yet for OS4?

Arthur

P.S. Since I know the next question will be "what are you using that isn't in MiniGL?", here is the list:

glPopAttrib
glPushAttrib
gluOrtho2D (I can just use glOrtho)
glNormalPointer
glLightfv
glMaterialfv
glCallList
glEndList
glNewList
glGenlists
glLineWidth
gluSphere (I can get around this)
gluNewQuadric (I can get around this as well)
glClipPlane
gluBuild2DMipmaps
glRasterPos2i
glDrawPixels
glVertex2d (I CAN reduce this to f's but it makes things shake too much)
glVertex3d (I CAN reduce this to f's but it makes things shake too much)

Go to top



TopTop




Powered by XOOPS 2.0 © 2001-2023 The XOOPS Project