Jump to content
IGNORED

CV development on a mac


evg2000

Recommended Posts

Use Xcode (best developer environment of all time) with SDCC installed, http://sdcc.sourceforge.net/

 

Also, download Daniel Bienvenu's windows C package from this forum, his library files are invaluable even if you don't use them directly and just reference them on how to get a game up and running in C. I couldn't have gotten started without his amazingly helpful work.

 

Finally, use a makefile like this in Xcode (probably not the most elegant makefile, but it works for me just fine) and you can build just like any other Xcode project-

 

 

 

 

#########################################################################################

# Place pre-compiled .rel (object) files into the <object> folder so that they are #

# not removed when calling clean. #

# Place library files in the <lib> folder. #

# FUNCTIONS: build, all, copy, cleanup, clean #

#########################################################################################

 

# COMPILER VARIABLES #

CC = "/Developer/sdcc/bin/sdcc"

CCASM = "/Developer/sdcc/bin/sdasz80"

 

# FLAGS FOR COMPILING, LINKING, AND ASSEMBLY COMPILING #

#FLAGSC = -mz80 -c -V --std-c99 --all-callee-saves

FLAGSC = -mz80 -c -V --std-sdcc89 --main-return

FLAGSL = -mz80 --code-loc 0x8021 --data-loc 0x7000 --no-std-crt0

FLAGSA = -o

 

# LIST .S ASSEMBLY FILES HERE #

OBJLIB1 = crt0.rel decompress.rel

OBJLIB2 = spritesASM.rel soundASM.rel collisionASM.rel pointers.rel enemyAI.rel collisionHandler.rel menu.rel

 

# LIST .C SOURCE FILES HERE #

OBJ1 = main.rel input.rel graphic_data.rel sound_data.rel

OBJ2 = collision.rel sprites.rel

OBJS1 = screen00.rel

OBJS2 = screen09.rel

 

# BUILDS THE ROM, THEN CLEANS UP ALL FILES PRODUCED #

build : clean all copy cleanup

 

# THE TARGET IS RESULT.IHX, WHICH IS THEN COPIED INTO A BINARY #

all : result.ihx

 

# BUILD INSTRUCTIONS FOR COMPILING THE ROM #

result.ihx : $(OBJLIB1) $(OBJLIB2) $(OBJ1) $(OBJ2) $(OBJS1) $(OBJS2)

$(CC) $(FLAGSL) $(OBJLIB1) $(OBJLIB2) $(OBJ1) $(OBJ2) $(OBJS1) $(OBJS2) -o result.ihx

 

# SCANS FOR ALL .C SOURCE FILES USING $< OPERATOR #

%.rel : %.c

$(CC) $(FLAGSC) $<

 

# RULE TO BUILD .S ASSEMBLY FILES

%.rel : %.s

$(CCASM) $(FLAGSA) $<

 

# CONVERTS INTEL HEX FORMAT TO BINARY USING OBJCOPY AND DUMPS TO RESULT.ROM #

copy : result.ihx

objcopy --input-target=ihex --output-target=binary result.ihx result.rom

 

# CLEANS UP ALL FILES EXCEPT FOR RESULT.IHX #

.PHONY : cleanup

cleanup :

-rm -f *.rel *.lst *.sym *.lnk *.map *.noi *.asm *.ihx

 

# REMOVES RESULT.IHX #

.PHONY : removeihx

removeihx :

-rm -f *.ihx

 

# CLEANS UP EVERY SINGLE FILE IN FOLDER EXCEPT SOURCE FILES #

.PHONY : clean

clean :

-rm -f *.rel *.lst *.sym *.lnk *.map *.noi *.ihx *.asm *.rom

 

 

 

To debug I took the Mac Meka port and made an .app out of it so you don't have to install allegro- http://www.smspower.org/forums/viewtopic.php?t=13308 it's around the middle of the posts, the file you want is MekaOSX.dmg (2.38 MB).

 

Meka has the best debugger I've ever seen, it'll seriously make your life 100 times easier. You can watch RAM, VRAM, and registers all in real time.

Edited by kingofcrusher
  • Like 1
Link to comment
Share on other sites

Snazzy, hadn't seen MEKA before.

post-3056-0-43168700-1328816561_thumb.png

 

Is there a way to make the window larger? That takes up hardly any space on my monitor.

in the meka.cfg file in system directory you can change the main window size: video_gui_resolution = 1920x1200. You can also full-size the game screen under video hit escape to go back to normal size.

Link to comment
Share on other sites

If you hit Alt + Enter (at least on PC, I think it's the same on Mac) it'll stay windowed but use the entire window for the game screen, and from there you can hit ESC to toggle between full-screen and windowed like evg2000 said. The Mac version only runs well in full-screen mode (either full-screen windowed within Meka or actual full-screen) though, for some reason it doesn't update correctly all the time when in windowed (within Meka windowed mode I mean). I think Brock is working on it for the next update, but it's a minor problem unless you're using the debugger (and even then it's only just slightly annoying sometimes). It runs perfectly when full-screen so it's fine for playing games, but if you're just gonna play Coleco games I'd use MugRat instead since it seems to be flawless as far as I can tell.

 

The debugger in Meka will make your life infinitely easier though, it's amazing.

Link to comment
Share on other sites

  • 4 months later...

I've definitely had some good success on the Mac with Daniel's libraries getput and cv. But I have never gotten into using XCode myself. So I use TextWrangler as my programing text editor and I've been testing with Mugrat. I'll have to check out the debugger in Meka. I've used the one in BlueMSX on Windows quite a bit but it's been a while since I tried Meka.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji 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.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...