Author Topic: Compiling Jaguar Source Code: C & ASM examples  (Read 500 times)

Offline Saturn

  • Global Moderator
  • Hero Member
  • *
  • Posts: 3047
  • Country: us
  • Karma: 21
    • View Profile
    • http://jaysmith2000.ipbhost.com/index.php?s=c827a7b611daaaf555722b332b1b9a2c&act=idx
Compiling Jaguar Source Code: C & ASM examples
« on: August 22, 2016, 21:18:38 PM »
Recently, through the help of fellow (& more knowledgeable) Atari enthusiasts, I was able to (finally) acquire the steps necessary to compile two different types of source code for various games. The following outlines the steps used to accomplish this in each but lacks technical info or explanations as to how it works. For that, please track down and read the official Atari Documentation on the subject as the following is more of a compilation of info so it's in one place instead of multiple threads with titles not indicative to the content, making a search on the topic cumbersome and wasteful, at best.


*****************************ASM-one method: (huge thanks to @avick )
This method was successful in compiling the source for Painter which was written in Assembly. The original thread starts here and the basic steps to compile this source code are as follows:

Download jagdev_102.exe from Belboz's site and install it (defaults to C:\jaguar)
https://www.hillsoftware.com/files/atari/jaguar/ (in case the link gets corrupt)

Download the Painter Source from Sinister Developments
http://www.kewlplace.com/sinister/painter_source.htm (in case the link gets corrupt)
Extract the zip file into a folder named paintsrc and move it into C:\jaguar (full path will now be C:\jaguar\paintsrc)

Navigate to C:\ and change folder settings to show hidden/system files and right click on autoexec.bat
Choose edit
Paste in the following (not overwriting any important settings etc.):
Code: [Select]
@echo off
set PATH=%PATH%;C:\JAGUAR\BIN
set RDBRC=C:\JAGUAR\BIN\RDB.RC
set DBPATH=C:\JAGUAR\BIN
set ALNPATH=C:\JAGUAR\BIN
set MACPATH=C:\JAGUAR\INCLUDE
set GCC_EXEC_PREFIX=C:/JAGUAR/BIN
set TEMP=C:
doskey

Quicksave and close autoexec.bat

The Makefile in C:\jaguar\paintsrc should look like this:
Code: [Select]
#====================================================================
#       Macro & Assembler flags
#====================================================================

STADDR = 10000

MACFLAGS = -fb -g

ALNFLAGS = -v -v -e -g -rd -a $(STADDR) x B000

#====================================================================
#       Default Rules
#====================================================================
.SUFFIXES: .o .s

.s.o:
        mac $(MACFLAGS) $*

#====================================================================
#       EXECUTABLES
#====================================================================

OBJ = main.o

painter.cof: $(OBJ)
        aln $(ALNFLAGS) -o painter.cof $(OBJ)


main.o:     main.s
If not, copy the above and paste it in, then quicksave and exit the Makefile/editor

Copy cmd.exe from C:/Windows/system32 to C:/jaguar/paintsrc and open it
Paste and run: smac -fb main.s
Paste and run: sln -e -a 10000 x x main.o

A 1.70MB file should appear named .cof
Change it to Painter.cof and run it through JiFFI to get the Painter_jiffi.cdi file that can be burned to a CDR for encrypted Painter.
(Here is a guide on how to use JiFFI and burn CDRs in Linux)


******************************C-1st of 2 methods: (huge thanks to @rush6432 )
1st method, using autoexec.bat
Like the above, this method uses editing the autoexec.bat file and was successful in compiling the source for DOOM which was written in C. The original thread starts here and the basic steps to compile this source code are as follows:
Download the new installer I made, unzip & double click it.
or
Download jagdev.zip from Belboz's site and unzip the contents into a folder named jaguar Copy the jaguar folder to C:\
https://www.hillsoftware.com/files/atari/jaguar/ (in case the link gets corrupt)

Download the DOOM Source from AtariAge
https://www.atariage.com/Jaguar/archives/DoomSource/ (in case the link gets corrupt)
Extract the zip file into a folder named JagDoomSource and move it into C:\jaguar (full path will now be C:\jaguar\JagDoomSource)

Navigate to C:\ and change folder settings to show hidden/system files and right click on autoexec.bat
Choose edit
Paste in the following (not overwriting any important settings etc.):
Code: [Select]
@echo off
cls
set PATH=%PATH%;C:\JAGUAR\BIN
set RDBRC=C:\JAGUAR\BIN\RDB.RC
set DBPATH=C:\JAGUAR\BIN
set ALNPATH=C:\JAGUAR\BIN
set MACPATH=C:\JAGUAR\INCLUDE
set GCC_EXEC_PREFIX=C:/JAGUAR/BIN
set TEMP=C:
doskey

Quicksave and close autoexec.bat

Navigate to C:/jaguar/JagDoomSource and find a file named Makefile
Right click on it and choose edit
Double check lines 71 & 72 to ensure they say:
Code: [Select]
GAS2OBJ = mac -fb $?
Cx2OBJ = gcc -x c++ -m68000 -Wall -DJAGUAR -O2  -c -o $@ $<
Change line 74 from:
Code: [Select]
C2OBJ = gcc -B/prog/jaguar/bin/ -b m68k -V2.6 -Wall -DJAGUAR -O2 -c -o $@ $?to
Code: [Select]
C2OBJ = gcc -B/jaguar/bin/ -b m68k -V2.6 -Wall -DJAGUAR -O2 -c -o $@ $?Quicksave and exit the Makefile/editor

Copy cmd.exe from C:/Windows/system32 to C:/jaguar/JagDoomSource and open it
Type make and hit Enter to compile the source
A 244kb file named doom.abs should appear in the folder. This can be opened in a hex editor, copied and pasted into the DOOM ROM overwriting everything up to offset 40000 (where the wad starts) and run on a Skunkboard. (there are other/better ways and I may update once I learn how but for now this will work.. in theory)


******************************C-2nd of 2 methods: (huge thanks to @rush6432 )
Using DOSBox & setpath.bat (instead of autoexec.bat)
Unlike the above, this method uses DOSBox along with creating a file named setpath.bat on C:\ and was successful in compiling the source for DOOM which was written in C. The original thread starts here and the basic steps to compile this source code are as follows:
Download the latest version of DOSBox for Windows
Install to defaults and close out of the app
Download the new installer I made, unzip & double click it.
or
Download jagdev.zip from Belboz's site and unzip the contents into a folder named jaguar Copy the jaguar folder to C:\
https://www.hillsoftware.com/files/atari/jaguar/ (in case the link gets corrupt)

Download the DOOM Source from AtariAge
https://www.atariage.com/Jaguar/archives/DoomSource/ (in case the link gets corrupt)
Extract the zip file into a folder named JagDoomSource and move it into C:\jaguar (full path will now be C:\jaguar\JagDoomSource)

Navigate to C:\ and create a file named setpath.bat, right click on it and choose edit
Paste in the following:
Code: [Select]
@echo off
cls
set PATH=%PATH%;C:\JAGUAR\BIN
set RDBRC=C:\JAGUAR\BIN\RDB.RC
set DBPATH=C:\JAGUAR\BIN
set ALNPATH=C:\JAGUAR\BIN
set MACPATH=C:\JAGUAR\INCLUDE
set GCC_EXEC_PREFIX=C:/JAGUAR/BIN
set TEMP=C:
cd jaguar\doom
@echo.
@echo Paths Set!

Quicksave and close setpath.bat

Navigate to C:/jaguar/JagDoomSource and find a file named Makefile
Right click on it and choose edit
Double check lines 71 & 72 to ensure they say:
Code: [Select]
GAS2OBJ = mac -fb $?
Cx2OBJ = gcc -x c++ -m68000 -Wall -DJAGUAR -O2  -c -o $@ $<
Change line 74 from:
Code: [Select]
C2OBJ = gcc -B/prog/jaguar/bin/ -b m68k -V2.6 -Wall -DJAGUAR -O2 -c -o $@ $?to
Code: [Select]
C2OBJ = gcc -B/jaguar/bin/ -b m68k -V2.6 -Wall -DJAGUAR -O2 -c -o $@ $?Quicksave and exit the Makefile/editor

Open DOSBox and type in the following one at a time: (there will be a warning when you mount C. Ignore it)
mount c c:\
c:
setpath


At the end you should see 2 lines on the black screen:
Paths Set!
c:\jaguar\doom>


Type make at the c:\jaguar\doom> prompt and hit Enter to compile the source
A 244kb file named doom.abs should appear in the folder. This can be opened in a hex editor, copied and pasted into the DOOM ROM overwriting everything up to offset 40000 (where the wad starts) and run on a Skunkboard. (there are other/better ways and I may update once I learn how but for now this will work.. in theory)
« Last Edit: September 07, 2016, 19:50:35 PM by Saturn »

 

SMF spam blocked by CleanTalk
SimplePortal 2.3.7 © 2008-2021, SimplePortal