Jump to content



1

CV development on a mac


6 replies to this topic

#1 evg2000 OFFLINE  

evg2000

    Moonsweeper

  • 359 posts
  • Location:N. Cal

Posted Wed Feb 8, 2012 9:20 PM

Are there any development tools for doing CV development on the mac? I know I can run windows on my mac, but I don't want to! I know SpiceWare is getting a assemble working on the mac, but anything for doing c development on the mac?

thanks,
Charles

#2 kingofcrusher OFFLINE  

kingofcrusher

    Space Invader

  • 33 posts

Posted Thu Feb 9, 2012 11:13 AM

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-




Quote

#########################################################################################
# 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....pic.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, Thu Feb 9, 2012 11:22 AM.


#3 kingofcrusher OFFLINE  

kingofcrusher

    Space Invader

  • 33 posts

Posted Thu Feb 9, 2012 11:16 AM

Attached File  objcopy.zip   296.96K   8 downloads

Oh yeah, I almost forgot, you need objcopy in the same folder as your source files or the makefile won't work. I'll attach that to this post.

Edited by kingofcrusher, Thu Feb 9, 2012 11:18 AM.


#4 SpiceWare OFFLINE  

SpiceWare

    Quadrunner

  • 5,993 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Thu Feb 9, 2012 1:43 PM

Snazzy, hadn't seen MEKA before.
cv_meka.png

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

Edited by SpiceWare, Thu Feb 9, 2012 1:44 PM.


#5 evg2000 OFFLINE  

evg2000

    Moonsweeper

  • 359 posts
  • Location:N. Cal

Posted Thu Feb 9, 2012 8:28 PM

View PostSpiceWare, on Thu Feb 9, 2012 1:43 PM, said:

Snazzy, hadn't seen MEKA before.
Attachment cv_meka.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.

#6 SpiceWare OFFLINE  

SpiceWare

    Quadrunner

  • 5,993 posts
  • Medieval Mayhem
  • Location:Planet Houston

Posted Thu Feb 9, 2012 10:32 PM

Thanks! Had to use 1920x1030 else the status bar was offscreen.

#7 kingofcrusher OFFLINE  

kingofcrusher

    Space Invader

  • 33 posts

Posted Wed Feb 15, 2012 5:43 PM

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.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users