Jump to content
Jagware
Sign in to follow this  
Starcat

Getting started using C on the Jaguar

Recommended Posts

SebRmv    2

Ok, great news.

 

I will try to continue the tutorial quickly.

However, I may not have time until next monday...

 

By the way, where can I get windows version of aln/madmac ?

 

 

Share this post


Link to post
Share on other sites
Fadest    0

IIRC, they do not work on XP, until you use DOSBOX or similar program.

I tried to setup this long ago on a Win XP, but had some problems with aln and/or madmac and wait following AC to go on Linux.

Now that there are sln/smac, I guess this may be the best option.

Share this post


Link to post
Share on other sites
Starcat    0

Thanks :)

 

There is no windows version, just the dos version that atari provided. I attached them to this message.

Other than that, there only is SMAC and SLN.

MAC.zip

ALN.zip

Share this post


Link to post
Share on other sites
SebRmv    2

Hi,

 

I quickly tested on my windows this evening.

Unfortunately aln cannot be run on Windows 64 bits.

I then tried with sln 0.1.4 (not the latest version, because I didn't managed to get it from Subqmod website).

Unfortunately, this version of sln is not able to understand the archive files (*.a).

 

I'll try with dosbox and cross the fingers.

 

Share this post


Link to post
Share on other sites
SebRmv    2

Ok, the right command line (on DOSBOX) is

 

aln.exe -a 4000 x x -rq -v -v -v -w -e -o example4.cof crt0.o example4.o data.o display.o interrupt.o sound.o rmvlib.a jlibc.a libgcc.a

 

(I assume that everything is in the same path for simplicity... next step will be to indicate the different paths to ALN)

 

one issue with dosbox is that the size of the command line is limited (the line above is too big!)

 

Share this post


Link to post
Share on other sites
Starcat    0

I just tried it and I could compile it after a few changes. However the gcc doesn't support dos.

Which means using dosbox for linking and windows for compiling and at the same time keeping all library files in the project folder, which is kind of annoying at the moment.

 

I hope we find a better way to do it, maybe support for the .a file could be added to sln? No idea how much effort it would take though.

 

Also, keep in mind that dos only supports 8 symbols + 3 symbols extensions. in other words files like interrupt.o need to be renamed.

 

Share this post


Link to post
Share on other sites
ggn    1
I just tried it and I could compile it after a few changes. However the gcc doesn't support dos.

Which means using dosbox for linking and windows for compiling and at the same time keeping all library files in the project folder, which is kind of annoying at the moment.

 

I hope we find a better way to do it, maybe support for the .a file could be added to sln? No idea how much effort it would take though.

 

Also, keep in mind that dos only supports 8 symbols + 3 symbols extensions. in other words files like interrupt.o need to be renamed.

 

IIRC you can run dosbox with a different .conf file. So, after typing "make" on windows, you can have a .conf file in your project directory that does the linking (i.e. call aln with the right params) and then exits dosbox. Then start dosbox using that config.

 

Although CJ codes in pure asm using that principle, it's mostly the same thing.

 

(another thing would be a .bat file that calls 'make' and then bring up dosbox with the pre-made config file).

 

 

Hope this helps.

Share this post


Link to post
Share on other sites
Although CJ codes in pure asm using that principle, it's mostly the same thing.

 

At the bottom of the dosbox.conf file theres the AUTOEXEC section, where I add:

 

[autoexec]
# Lines in this section will be run at startup.

mount c d:\dosbox\dosbox-c
mount d y:\ -t cdrom
path=C:\JAGLAW\BIN
SET MACPATH=C:\JAGLAW\INCLUDE
c:
cd \JAGLAW\TRIS
ajag

 

"ajag" is a batch file that does:

 

@echo off
nmake /a > errors.txt
copy *.cof c:\VJAG\ROMS\TEST.ABS
EXIT

 

I keep the source open in notepad++ and set up a hotkey macro (Like ctrl-a) with the following:

 

"D:\DOSBox\dosbox.exe" -conf d:\dosbox\dosbox.conf

 

Note: You can have multiple named .conf files all references with different hotkeys.

 

This way, all the source can be open at once in a fantastic editor (Notepad++) and a single key-combo (in the case CTRL-A) runs DOSBOX, assembles, links and moves the binary to the Virtual Jaguar\ROMS folder for testing. If there are errors, they are redirected to ERRORS.TXT (for which you can put a shortcut on the desktop!). It then closes DOSBox (Which prevents the bug where multiple runs of MADMAC will crash DOSBox!).

 

If you set the cyclecount to somethign stupidly high you can have your source assembled, linked and running in under a second!

 

Hope this helps.

 

CJ.

 

Share this post


Link to post
Share on other sites
Starcat    0

Cyrano, when I try to run Make or Nmake using dosbox, it says the program can not run in dos mode. Which is kind of weird.

No matter if I use a version of make from 94 or a current one.

How did you get make to work in dosbox?

Share this post


Link to post
Share on other sites
ggn    1
Cyrano, when I try to run Make or Nmake using dosbox, it says the program can not run in dos mode. Which is kind of weird.

No matter if I use a version of make from 94 or a current one.

How did you get make to work in dosbox?

 

This sounds like it's confusing make versions. Try typing PATH and see which directories are included. The scan each directory for make.exe or nmake.exe. There may be other versions that are being ran instead of the old make/nmake from the Atari devkit.

 

Hope this helps.

Share this post


Link to post
Share on other sites
Starcat    0

This is really confusing. It's pointing to the right location and the make file is from 1994. So it HAS to run in dos, as nothing else was there at that time.

Dosbox just doesn't seem to like it for whatever reason.

Cyrano what version of dosbox are you using?

Share this post


Link to post
Share on other sites
SebRmv    2

In theory, aln uses the environment variable ALNPATH to look for libraries.

However, I can't manage to define/read environment variable in dosbox.

 

I tried:

 

set ALNPATH=c:\jlibc\lib

echo %ALNPATH%

 

and the "echo" says "%ALNPATH%" instead of the expected result.

Share this post


Link to post
Share on other sites
SebRmv    2
I just tried it and I could compile it after a few changes. However the gcc doesn't support dos.

Which means using dosbox for linking and windows for compiling and at the same time keeping all library files in the project folder, which is kind of annoying at the moment.

 

I hope we find a better way to do it, maybe support for the .a file could be added to sln? No idea how much effort it would take though.

 

Also, keep in mind that dos only supports 8 symbols + 3 symbols extensions. in other words files like interrupt.o need to be renamed.

 

Yes, for the moment, it is not really usable, but it is the fault of aln.

How the hell can you use these tools on Windows?

 

Has someone managed to get the latest sln version from Subqmod website?

Maybe the support of *.a files has been added.

Share this post


Link to post
Share on other sites
Zerosquare    10

SebRmv : maybe you could try running the COMMAND.COM shell from a MS-DOS or Windows 9x disk inside DOSBOX, instead of the integrated shell in DOSBOX.

That should fix the problem with environment variables.

Share this post


Link to post
Share on other sites
Has someone managed to get the latest sln version from Subqmod website?

 

Every time I use SLN I find errors in its assembly. Subqmod fixes them really quickly, but I'd rather just use the original tools and know something is crashing because of my code, and not some random assembly error.

 

Share this post


Link to post
Share on other sites
SebRmv    2

Good point CyranoJ regarding the original tools (I am a very conservative guy by the way... I tend to use original tools or config whenever I can)

 

I'll have a look at your setup in the next days.

Share this post


Link to post
Share on other sites
Starcat    0

Thanks Cyrano!

The problem was my nmake.exe which was not the original provided by atari. Make doesn't work in dosbox for me, but your nmake file does. :)

Share this post


Link to post
Share on other sites
Thanks Cyrano!

The problem was my nmake.exe which was not the original provided by atari. Make doesn't work in dosbox for me, but your nmake file does. :)

 

I think it came with the SNASM2 assembler/linker - but I'm not 100% sure about that.

Share this post


Link to post
Share on other sites
Starcat    0

Did the SNASM2 kit actually have their own assembler/linker? If so, can those also be used with the atari kit?

Would be really interesting to get my hands on them. :)

 

Do you have a SNASM2 kit? If so, how is it compared to the alpine?

I recently found out that cross products, the developers of the snasm2 kit actually developed the official dreamcast dev kit, too.

 

Share this post


Link to post
Share on other sites
Did the SNASM2 kit actually have their own assembler/linker? If so, can those also be used with the atari kit?

Would be really interesting to get my hands on them. :)

 

Do you have a SNASM2 kit? If so, how is it compared to the alpine?

I recently found out that cross products, the developers of the snasm2 kit actually developed the official dreamcast dev kit, too.

 

I honestly can't remember, sorry! I use a skunkboard now ;-)

Share this post


Link to post
Share on other sites
Guest
You are commenting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoticons maximum are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×