[stella] PPC Mac Dev Kit... It's alive, HE'S ALIVE!!!!

Subject: [stella] PPC Mac Dev Kit... It's alive, HE'S ALIVE!!!!
From: Ruffin Bailey <rufbo@xxxxxxxxxxx>
Date: Sat, 3 Jan 98 17:02:26 -0500
>>PS Quick Mac update:  I have put that on the back burner as I go back to 
>>work and order (the horror!  What a traitor!) Virtual PC!  I feel like 
>>I'm cheating, but this whole compilation thing has driven me crazy!
>
>Virtual PC? That's nothing.. I've always been a Mac user, but last summer
>I've bought a whole PC mainly to run all those emulators that aren't
>available for the Mac... :-)

Hey hey hey!!!  If it weren't for Privateer and some other games, I'd concel that order!  Actually, I've gotten so many letters saying I need PCAE, I wouldn't, but you get the point.

So here it is without further ado... the Macintosh PowerPC Atari 2600 Developement Kit.

First, the emulator.  MacStella 0.7 for the PowerPC.  This is great work.  I enjoy it, although many games must be run in a small screen to get 60 fps even on my StarMax 3000/180.  Thanks to Bradford W. Mott and Aaron Giles for this proverbial gem.

ftp://ftp.ncsu.edu/pub/eos/pub/bsvc/st/stella-0.7-mac.hqx

Next you need the compiler.  I want to thank Greg Troutman both for performing the search for this 6502 compiler and also finding and sending me a book on the Macintosh Programmer's Workshop or MPW.

This is a multi-part deal here.  You will be using MPW, which has recently been released by Apple to the general public, so to speak, for free.  A year or two ago, this would have cost us $200!  This is just a "shell", and requires "tools" and "libraries" to actually work.  It's a framework for a compiler, so we also grab the tools and such that are specificly designed for the 6502 (which is the good twin of the 6507, the processor in the 2600).  These tools are called RASM.

In the Apple Developement site, there is a file that reccomends:

To get started, you should download, at a minimum:
        About_Core_MacOS_Tools.sit
        :Documentation:Introduction_to_MPW.sit.hqx
        :MPW_Environment:Files.lst
        :MPW_Environment:Release_Notes.sit.hqx
        :MPW_Environment:MPW:MPW_Shell.sit.hqx
        :MPW_Environment:MPW:Scripts:

This file and these folders are found at this address:

ftp://dev.apple.com/devworld/Tool_Chest/Core_Mac_OS_Tools/

Just as a bonus there are other goodies here, specificly a C compiler (somebody want to make a MacDASM?), a Mac assembly compiler, and a Pascal compiler.  I don't dare mess with that now; my patience is gone for a while.  

Rasm, the actual tool for compiling is found at this address:

ftp://ftp.ind.net/pub/mac/dev/rasm-10.hqx
(I guess I'll thank ole "Michael? Hamel" here, though I can't find him.  Nor is rasm where rasm is supposed to be on the net according to the help files that come with it!  But lucky for us he put out version 1.0!)

RASM comes with fairly good directions of how to place its parts within MPW.

When I get a web page up, this will probably make more sense, but just quickly, here's what you do to compile some code.  I got a copy of Combat from Nick Bensema's site under this address:

http://www.primenet.com/~nickb/atari2.htm
(just click on Combat.  Thanks Nick!)

You'll need to take this, and all other 6507 source written with DASM in mind (that's the most popular PC compiler) and run it through a word processor.  You should be able to use MPW to edit it, but I've had some trouble.  Look for all instances of ".byte" and ".word" and change these to "byte" and "word" (simply removing the leading period).  I also had trouble with these two lines of Combat:

SPRLO   byte  #<TankShape, #<PlaneShape, #<JetShape
SPRHI   byte  #>TankShape, #>PlaneShape, #>JetShape

These can simply be changed to their constant values.  Whatever the above means to DASM, it means nothing to RASM!  Replace them with these lines below:

SPRLO   byte $4F, $CF, $8F
SPRHI   byte $F6, $F6, $F6
(thanks again Nick!)

One last step.  You need to add a "headers" file to your MPW folder, "vcs.h".  It must be named this (or you could change all the source you get to whatever you want... read: Giant pain in the butt).  I'll include that at the end of this file.  I got it from Nick Bensema's site again (ditto that thanks again) on the Homebrew page from Greg Troutman's Dark Mage, which Greg was nice enough to include with source!  (thanks to Greg again!)  I'd also like to thank Greg for telling me I needed to add these two lines to the vcs.h:

RESMP0  equ     $28
RESMP1  equ     $29

He didn't use players since Dark Mage is a text adventure [sic!] for the 2600!  I have included these lines in the vcs.h at the bottom of this post, so you don't need to add them again!  ;)

Finally, after Combat's text file and vcs.h have been placed in the MPW folder, start up MPW and simply type this:

rasm -p -l combat2.a >demo.lst

Where "combat2.a" is the name of the modified text file (see above for the two changed lines) you got from Nick's site.  Oh yeah, put ".a" at the end like you see here.

DON'T HIT RETURN AT THE END OF THE LINE!!!  To execute commands in MPW, you hit Enter over there on the right on your keypad.  Hopefully this is what will happen:

No object file specified: will use "combat2.a.ao"
RAsm assembler/disassembler v1.0, by Michael? Hamel 1995 : michael@xxxxxxxxxxx
First pass:
 Reading from "combat2.a"
 Reading from "6502"
 Reading from "combat2.a"
 Reading from "vcs.h"
 Reading from "combat2.a"
 Reading from "combat2.a"
Second pass:
 Reading from "6502"
 Reading from "combat2.a"
 Reading from "vcs.h"
 Reading from "combat2.a"
Writing combat2.a.ao
Finished, in 4.7 seconds

Sorry, I haven't bothered to find out why MPW can't figure out why the object file shoulda been called "demo.lst"...  Take "combat2.a.ao" and move it to your Stella 0.7 folder.  Then drag and drop it on the cart typer.  Then drag and drop it on the Stella icon.  Voila!!!  Thank heavens!  Now you can play your favorite game, Combat!  Btw, just as a disclaimer, you probably oughta own a 2600 and Combat to do this on the up and up...

Hope this helps.  When I get a web page up, I'll let y'all know.  I haven't edited this for clarity, but I was excited.  Forgive me.  ;)  If you have any problems or questions, email me!  I've only tried Combat with this so far, so let me know if you use this method and how succesful it is.

Ruffin Bailey
rufbo@xxxxxxxxxxx

cut here for vcs.h
-----------------------------------------------------------------------------------

;==========================
; Equates for TIA Registers
;==========================
;----------------------
; Write Address Summary
;----------------------
VSYNC	equ	$00	;Vertical sync set-clear
VBLANK	equ	$01	;Vertical blank set-clear
WSYNC	equ	$02	;Wait for leading edge of horizontal blank
RSYNC	equ	$03	;Reset horizontal sync counter
NUSIZ0	equ	$04	;Number size Player Missile 0
NUSIZ1	equ	$05	;Number size Player Missile 1
COLUP0	equ	$06	;Color-lum Player 0
COLUP1	equ	$07	;Color-lum Player 1
COLUPF	equ	$08	;Color-lum playfield
COLUBK	equ	$09	;Color-lum background
CTRLPF	equ	$0A	;Ctrol playfield ball size & collisions
REFP0	equ	$0B	;Reflect player #0
REFP1	equ	$0C	;Reflect player #1
PF0	equ	$0D	;First 4 bits of playfield
PF1	equ	$0E	;Middle 8 bits of playfield
PF2	equ	$0F	;Last 8 bits of playfield
RESP0	equ	$10	;Reset player #0 X coord
RESP1	equ	$11	;Reset player #1 X coord
RESM0	equ	$12	;Reset missile #0 X coord
RESM1	equ	$13	;Reset missile #1 X coord
RESBL	equ	$14	;Reset ball
AUDC0	equ	$15	;Audio control 0
AUDC1	equ	$16	;Audio control 1
AUDF0	equ	$17	;Audio frequency 0
AUDF1	equ	$18	;Audio frequency 1
AUDV0	equ	$19	;Audio volume 0
AUDV1	equ	$1A	;Audio volume 1
GRP0	equ	$1B	;Pixel data player #0
GRP1	equ	$1C	;Pixel data player #1
ENAM0	equ	$1D	;Missile 0 enable register
ENAM1	equ	$1E	;Missile 1 enable register
ENABL	equ	$1F	;Ball enable register
HMP0	equ	$20	;Horizontal motion Player #0
HMP1	equ	$21	;Horizontal motion Player #1
HMBL	equ	$24	;Horizontal motion Ball
VDELP0	equ	$25
VDELP1	equ	$26
RESMP0	equ	$28
RESMP1	equ	$29
HMOVE	equ	$2A	;Add horizontal motion to registers
HMCLR	equ	$2B	;Clear horizontal motion registers
CXCLR	equ	$2C	;Clear collision registers

;---------------------
; Read Address Summary
;---------------------

CXM0P	equ	$00	;Read collision M0-P1/M0-P0
CXM1P	equ	$01	;Read collision M1-P0/M1-P1
CXP0FB	equ	$02	;Read collision P0-PF/P0-BL
CXP1FB	equ	$03	;Read collision P1-PF/P1-BL
CXM0FB	equ	$04	;Read collision M0-PF/M0-BL
CXM1FB	equ	$05	;Read collision M1-PF/M1-BL
CXBLPF	equ	$06	;Read collision BL-PF/-----
CXPPMM	equ	$07	;Read collision P0-P1/M0-M1
INPT0	equ	$08	;Paddle #0
INPT1	equ	$09	;Paddle #1
INPT2	equ	$0A	;Paddle #2
INPT3	equ	$0B	;Paddle #3
INPT4	equ	$0C	;Misc input #0
INPT5	equ	$0D	;Misc input #1

;======================
; Equates for PIA Ports
;======================
SWCHA	equ	$280
SWACNT	equ	$281
SWCHB	equ	$282
SWBCNT	equ	$283
INTIM	equ	$284
TIM1T	equ	$294
TIM8T	equ	$295
TIM64T	equ	$296
T1024T	equ	$297


--
Stella list is Administered by krishna@xxxxxxxxxxxx <Glenn Saunders>
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/stella.html
+-shameless plugs-------------------------------------------------------+
| Stella documentary at http://www.primenet.com/~krishna                |
| Nick's VCS links via http://www.primenet.com/~nickb/atariprg.htm      |
| Write the best game, win framed autographs of famous Atari alumni!!   |
+-----------------------------------------------------------------------+

Current Thread