Atari Jaguar Breakout 2000 source compiling question

Started by Saturn, November 02, 2015, 21:18:03 PM

Previous topic - Next topic

Saturn

Was looking at the released source code here and wondering is there anyone who knows how to compile the 2 separate(d) source files into an .abs or rom file?
Says you need nmake.exe and it wasn't too hard to find but even with it it fails to compile.

The rom is already out there but I wanted to learn more about what it would take to make this happen since there's a lot of source available for other Jaguar games. I have the same setup used to compile Painter from source but the files are (obviously) different:

Quote from: "Saturn"Ok, went to Belboz's site and downloaded/installed jagdev_102.exe to the default C:/jaguar.

Extracted paintersrc.zip to C:jaguarpaintsrc

Edited the autoexec.bat file on C: as follows (this is from notes I had lying around, no idea if it's even necessary but I'm using Windows 7 Ultimate 32bit, btw):
@echo off
set PATH=%PATH%;C:JAGUARBIN
set RDBRC=C:JAGUARBINRDB.RC
set DBPATH=C:JAGUARBIN
set ALNPATH=C:JAGUARBIN
set MACPATH=C:JAGUARINCLUDE
set GCC_EXEC_PREFIX=C:/JAGUAR/BIN
set TEMP=C:
doskey


Copied cmd.exe from C:Windowssystem32 to C:jaguarpaintsrc and opened it.

ran smac -fb main.s
After a few seconds it finished then i ran sln -e -a 10000 x x main.o

Thanks 8)

rush6432

Quote from: "Saturn"Was looking at the released source code here and wondering is there anyone who knows how to compile the 2 separate(d) source files into an .abs or rom file?
Says you need nmake.exe and it wasn't too hard to find but even with it it fails to compile.

The rom is already out there but I wanted to learn more about what it would take to make this happen since there's a lot of source available for other Jaguar games. I have the same setup used to compile Painter from source but the files are (obviously) different:

Quote from: "Saturn"Ok, went to Belboz's site and downloaded/installed jagdev_102.exe to the default C:/jaguar.

Extracted paintersrc.zip to C:jaguarpaintsrc

Edited the autoexec.bat file on C: as follows (this is from notes I had lying around, no idea if it's even necessary but I'm using Windows 7 Ultimate 32bit, btw):
@echo off
set PATH=%PATH%;C:JAGUARBIN
set RDBRC=C:JAGUARBINRDB.RC
set DBPATH=C:JAGUARBIN
set ALNPATH=C:JAGUARBIN
set MACPATH=C:JAGUARINCLUDE
set GCC_EXEC_PREFIX=C:/JAGUAR/BIN
set TEMP=C:
doskey


Copied cmd.exe from C:Windowssystem32 to C:jaguarpaintsrc and opened it.

ran smac -fb main.s
After a few seconds it finished then i ran sln -e -a 10000 x x main.o

Thanks 8)

Painter is pure asm and breakout is in C, im sure you already knew this though.

Take a look at the supplied makefile and edit accordingly. make sure all paths are set to find the files in the right location and you should be able to just call "make" and it will build based on what the makefile says. its been a long while since ive bothered with breakout 2k but i did get it to compile at one point

Saturn

Thanks for the info! Honestly, I didn't know one was assembly and the other C (I'm not a programmer) but will look in the makefile and try to figure out where everything goes. I'm doing good just to familiarize myself with the compiling part of the process atm-so this is gold. Will explore it further when I get to a Windows machine. :67:

Saturn

Haven't had any luck getting this compiled.
Is there a standard process by chance (or is a C compiler necessary)? I dumped the B2K Music folder contents into the B2K folder and checked the makefile for paths. At the top it says:

#====================================================================
# Paths
#====================================================================

BINDIR = /jaguar/bin/
INC = /jaguar/include


so I added those to the autoexec.bat, (assuming that's what needed to be done) making it read as follows:

@echo off

set BINDIR=/jaguar/bin/
set INC=/jaguar/include
set PATH=%PATH%;C:JAGUARBIN
set RDBRC=C:JAGUARBINRDB.RC
set DBPATH=C:JAGUARBIN
set ALNPATH=C:JAGUARBIN
set MACPATH=C:JAGUARINCLUDE
set GCC_EXEC_PREFIX=C:/JAGUAR/BIN
set TEMP=C:
doskey


but it errored out. Any more insight to help a struggling learner? 8)

rush6432

Quote from: "Saturn"Thanks for the info! Honestly, I didn't know one was assembly and the other C (I'm not a programmer) but will look in the makefile and try to figure out where everything goes. I'm doing good just to familiarize myself with the compiling part of the process atm-so this is gold. Will explore it further when I get to a Windows machine. :67:

So what is it you're trying to do? Is your goal to ultimately make a small mini game or program on the jaguar?

I used a windows machine when i did jag dev stuff and some linux here or there but ultimately at the end of the day it wasn't about one OS having more features than another, windows was just quicker to get things done when it came to using other programs to edit or resize art, sfx, shuffle files around, ect.

Honestly ill just PM you a compiled example of how to startup the machine and display a bitmap object if you want but it'll be in all assembly. No better way to learn than to code on the lowest level and get your hands dirty.

Saturn

That would be great. Long term is familiarity with Assembly. Maybe some small programs that could be motivation to learn more and proceed to bigger things.
I've used Windows exclusively for 15 years but switched over to Ubuntu a couple of months ago. Windows is easier, has more software and I'm used to it but I don't know the first thing about compiling source code into files. When the Painter source code compiled so easily, I wanted to know how to compile the B2K as well. Then move on to some of the many other sources available.
Was looking for the necessary steps to put in a list that I could refer to later if/when interested in compiling it again years from now. Plus, if other sources had similarities, maybe I could figure out on my own what to do to compile them as well. I have no boundaries as to what's required (as I have nil knowledge of the process) so it's all one big open chasm of infinite possibilities and unknown requirements. You pros know what's needed for this stuff but I'm in the dark with it-besides what someone can guide me through.
That's why I was saying I'm doing good just to familiarize myself with the compiling part of the process atm. I'm way out of my element here but attempting to pick up some info I can use to create a usable file (rom) from source code. No one else has posted that they compiled it but I'd like to. Heck, when I compiled Virtual Jaguar 2.1.2 for Linux, it was amazing just watching what was flying by in Terminal. I compiled Virtual Jaguar 2.1.0 earlier today and that was really something. Tried the latest GIT version but errored out saying this at the end:
In file included from src/gui/about.cpp:20:0:
src/gui/about.h:11:21: fatal error: QtWidgets: No such file or directory
 #include <QtWidgets>
                     ^
compilation terminated.
make[1]: *** [obj/about.o] Error 1
make[1]: Leaving directory `/home/cylon12/Downloads/virtualjaguar'
make: *** [virtualjaguar] Error 2
I don't know where the QtWidgets file or folder is or goes but I'm stuck. I want to install this version so I can test the save state patch but have no idea where that goes either.

Back to B2K though, just having the steps for the process is my present goal. Time constraints hold back committing to anything as major as learning to code (in any language.) I'd like to take on some easier tasks and go from there. (I have disks full of source that I want to mess with when opportunity allows) But if you have an example I'd like to see it. If I can't do anything more than read through it and/or try some things, it's still worth it.
Thanks for the help :)

Saturn

Took another crack at compiling the source. Changes made are:

Edited two lines at the top of makefile from;
BINDIR = /jaguar/bin/
INC = /jaguar/include

To;
BINDIR = C:/jaguar/bin/
INC = C:/jaguar/include

and quick saved it.


Edited C:/Autoexec.bat to read;
@echo off
set BINDIR=C:jaguarbin
set INC=C:jaguarinclude
set PATH=%PATH%;C:JAGUARBIN
set RDBRC=C:JAGUARBINRDB.RC
set DBPATH=C:JAGUARBIN
set ALNPATH=C:JAGUARBIN
set MACPATH=C:JAGUARINCLUDE
set GCC_EXEC_PREFIX=C:/JAGUAR/BIN
set TEMP=C:
doskey

note that BINDIR & INC at the top match the makefile. The rest of the entries were from compiling Painter and not sure if they're relevant, necessary or could cause an error.


After opening a command prompt inside the B2K folder and entering make, this error appears;
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:B2K>make

Microsoft (R) Program Maintenance Utility   Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

        mac     -fb -g -rl -i   startup
'mac' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: 'C:Windowssystem32cmd.exe' : return code '0x1'
Stop.

C:B2K>


Anyone know how the mac or namke errors can be resolved? 8)

cmonkey

'mac' is the filename of MADMAC 68k macro assembler binary executable.  You should be able to substitute 'smac' for 'mac' although the 'smac' macro assembler doesn't appear to support the '-g' switch of 'mac' (although that switch only seems to output source level information when the assembler is invoked, so it's not really necessary, but you'll need to modify the makefile to remove that switch if you're going to use 'smac' instead of 'mac').  You should already have the 'smac' assembler in your BIN directory if you've installed the Jaguar developer tools from jagdev_102.exe.

If you want to use smac then replace the word 'mac' with the word 'smac' at lines 36, 50 and 71 in the makefile.

Then change the MACFLAGS on line 16 of the makefile from :-

  MACFLAGS = -fb -g -rl -i$(MACPATH)

to :-

  MACFLAGS = -fb -rl -i$(MACPATH)


If you'd rather use the 'mac' assembler then you'll find it in the jaddev.zip archive on this page :-

https://www.hillsoftware.com/files/atari/jaguar/

Simply extract it from the BIN folder in that archive and drop it into your c:jaguarBIN directory.

I'll help you as much as I can in order that you can get this game built :-)

Good luck!

Saturn

Thank you cmonkey! I've edited the makefile and will try this out asap 8)



Edit
I ran make again and it went further but ended with the following:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:B2K>make

Microsoft (R) Program Maintenance Utility   Version 1.50
Copyright (c) Microsoft Corp 1988-94. All rights reserved.

        smac    -fb -rl -iC:JAGUARINCLUDE     startup
startup.s[112]: Warning: GPU/DSP code outside of absolute section
        smac    -fb -rl -iC:JAGUARINCLUDE     b2k_strt
        gcc     -BC:/jaguar/bin/ -O2 -Wall -fomit-frame-pointer -b m68k -V2.6
-c main.c -o main.o
'gcc' is not recognized as an internal or external command,
operable program or batch file.
NMAKE : fatal error U1077: 'C:Windowssystem32cmd.exe' : return code '0x1'
Stop.

C:B2K>

Idk what gcc is but a quick search associates it with a compiler or something. Any ideas on how to get gcc where it needs to be?


Edit
Found these 4 hits in the makefile:
  C:B2Kmakefile (4 hits)
Line 21: GCCFLAGS = -B$(BINDIR) -O2 -Wall -fomit-frame-pointer -b m68k -V2.6
Line 22: #GCCFLAGS = -M -b m68k -V2.6
Line 29: gcc $(GCCFLAGS) -c $< -o $*.o
Line 29: gcc $(GCCFLAGS) -c $< -o $*.o

cmonkey

Ok, good news and bad news.

The good news - I've finally managed to build Breakout 2000 from the released source  :2:

It would really help if I could actually manage to find a dumped rom of this game to compare my build with the released game to see roughly where the differences start but it would appear that the retail version of Breakout 2000 is perhaps undumped.  I've scoured the 4 corners of the net in a vain attempt to find it at a reasonable price but the best I've managed so far is eBay for £100 ($150) which I'm not prepared to drop on a game that I can't even play due to not owning a Jaguar!

So we may be stabbing in the dark a little bit with this one.

I did notice that early on in this thread rush6432 mentions that he managed to get it to compile but he doesn't mention if he actually managed to get it to run on either an emulator or an Alpine board/Skunkboard.  @rush6432 - If you're checking in on this thread then maybe you could expand on that?

If you're still hell bent on building the game from source then there's a fair chunk of work ahead of you yet!

1) there appears to be a single file missing from the source archives, namely images/score.lzj    This file is referenced in the makefile and would have been created by processing an image file called score.tga through the TGA2CRY utility and then compressed by the LZJAG utility, but as score.tga source image is missing then I've had to remove references to it from the makefile.  The end result of this is unknown as obviously I can't get the resulting binary to run under emulation.  The lack of this file is NOT the cause of the game failing to run but I'd imagine either graphical corruption or, more likely, a game crash will eventually be caused by its absence, should we be able to get the binary to run one day.

2) there are about 25 of the TGA images in the IMAGES directory that need converting from 24 bit + alpha channel to 24 bit images.  This is because the developers of this game used their own replacement tool for TGA2CRY called TGA__CRY which supports alpha channels in the source image.  TGA2CRY ONLY supports 24 bit (no alpha channel) TGA input files.  Removing the alpha channel from the images is easy but there will definitely be graphical artefacts as a result of doing this, should we ever get the resulting binary to run one day.  Ideally we'd need to get hold of the TGA__CRY tool used by the original dev team, although I'd imagine that will be all but impossible now.  There may be another open source/freeware Jaguar image conversion tool out there somewhere that supports 24 bit + alpha input files, let's keep our fingers crossed for that!

3) there are lots of changes to be made to the makefile before you'll get a successful build.  I can share my makefile to make that part of the build easier.  In fact I could share my entire B2K source folder if that makes it any easier for you!

Bearing in mind I've only been doing Jaguar development for about 8 hours now so I'm still pretty much wet behind the ears.  I've had mixed success with getting the SDK samples to run under emulation, most of them work, some of them don't (3D sample doesn't).  This may be because of incompatibilities with the emulators I've tried or it may be something more sinister.  I've come to realise that Jag software either runs the game code from ram (starting from 0x4000) or from rom cartridge (starting from 0x802000).  The makefile for B2K has options for building to either ram or rom.  By default it builds to ram with the code going at 0x4000, the data going at 0x802000 and the BSS section (uninitialised memory) at 0x19000.  I presume they built to ram for testing on the Alpine dev board and then built to rom for the final cart build to submit to Atari for mastering.  I've tried build the ram and rom builds and had the tiniest bit of success with the rom build and Project Tempest.  By loading the binary to 0x802000 and setting the entry point to 0x801536a I managed to get some kind of tune (start-up tune maybe?) to play before the emulator crashed horribly.

The build system is definitely a bit strange and not at all what I'm used to seeing.  It seems to be including the code section twice in the final binary and I really can't figure out why.  It would help so much if I had a retail dump of the game cart to compare to!

I think you've picked quiet a tough challenge here but sometimes it's good to throw yourself in at the deep end, you tend to learn stuff faster when you approach life in that fashion.

A guy named belboz (you've mentioned him in your first post on this thread) also seems to have successfully built B2K but he also had graphical artefacts due to the wrong TGA2CRY.  He doesn't say whether he ran it on hardware or under emulation :-

http://atariage.com/forums/topic/121141-b2k-and-cf-coders-challenge/page-2


So, armed with this new knowledge, do you still wish to continue on your quest....  :39:

Saturn

HOLY CRAP! That is so much more in-depth than I even fathomed this could be ???
Originally, when seeing the label "Source code" I assumed that everything needed was present. Why the heck would the TGA__CRY tool not be available (more stuff a commoner like me wouldn't know) or inside the package if it's needed?

Yeah, if no one can actually build this from the source to have a working file, there's no real point. I mean, I was interested in building it so I could learn about it all but without being able to verify it at the end, I think an easier project would be more suitable. Honestly though, I didn't even know missing files/tools was a possibility and I feel bad after the amount of work you did to come to that conclusion and display all the information. Thank you for that but all in all this may go nowhere after any more effort we put into it.

The rom I found online works fine in VJ 210 and 212 except for the sound. It's kinda scratchy.

cmonkey

There's no need to feel bad, I always enjoy playing with source and build scripts and I enjoyed learning a little bit about Jaguar development too. :-)

The omission of TGA__CRY could purely have been an oversight from Mario Perdue when he was creating the source archive.  Or maybe the tool was written by one of the other members of the dev team and they didn't want him to release the tool with the source archive.  There could be a whole manner of reasons as to why it was left out of the archive.  The missing score.tga image hurts though, although that *could* potentially be extracted from a dump of the retail cart, wouldn't be easy but should be possible.  Same goes for the other images which are 24 bit + alpha.  The rules have changed now that you've said that the rom can be found somewhere.

If you've managed to find the B2K rom online then you're doing better than me!  It's good to know that it does work in VJ 2.1.2, that gives me hope that I might be able to get my build to work eventually.  Oh well, better go off and keep looking for that elusive rom.....

EDIT: finally managed to hunt down the elusive B2K rom on a Russian site.  Tested and working in MESS 0.154.  Now I can compare my build with the rom and hopefully get my build working :-)  Might take a few days but the odds are stacked in my favour now.

Saturn

Awesome man! That's where I found it too
Looking forward to hearing about what you discover!


On a sidenote, I'd love to know how to set up MESS. All the times I've tried over the years have come up failed. Even searching, "How to set up MESS" has never led anywhere conclusive for me. If you have time or interest, perhaps you could detail a quick guide to getting it running (on Windows) or slip me a folder structure list so I can mimic it and attempt to finally get moving forward with it.
I know, for some it's a cinch and "what's not to understand?" but for me it's been a no-go. Even my last attempt earlier this year. (2 months ago from the time of this post)
Anyway, just a thought :)

Great info about the B2K source! At least now I can stop the OCD from making me return to this topic