Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - WLA DX for Mac?

Reply to topic
Author Message
  • Joined: 23 Mar 2013
  • Posts: 611
  • Location: Copenhagen, Denmark
Reply with quote
WLA DX for Mac?
Post Posted: Tue Mar 26, 2013 11:15 pm
Hello,

Thank you Maxim et al. for all the resources on programming etc. It makes me want to... well, experiment a little :)

Maybe this is a stupid request, but could somebody please provide me with a Mac-version of WLA DX? I have wasted some hours now trying to compile from the source etc.

In Maxim's lessons on basics of SMS-programming he mentions ConText as a good editor. Can someone recommend a Mac alternative?

I just want to build the hello-world.sms rom and marvel at its greatness - and then maybe tinker with the fonts etc.

Thank you all for a great forum!! I have been lurking for some time now :)
  View user's profile Send private message Visit poster's website
  • Joined: 26 Jan 2013
  • Posts: 5
Reply with quote
Post Posted: Tue Mar 26, 2013 11:59 pm
I haven't tested them myself and I'm not sure if they represent the newest version of WLA DX (9.5a), but there are some Mac OS X binaries at the end of the "WLA DX binaries" topic here.

With regards to text editors, I've used and liked TextWrangler.
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14745
  • Location: London
Reply with quote
Post Posted: Wed Mar 27, 2013 1:13 am
I'm sure someone has made a cross platform graphics converter, in Python or similar, but I can't tell you where. You'll want that for your font changes...
  View user's profile Send private message Visit poster's website
  • Joined: 23 Mar 2013
  • Posts: 611
  • Location: Copenhagen, Denmark
Reply with quote
Post Posted: Wed Mar 27, 2013 6:53 am
Thank you both! Now I'm all set.
  View user's profile Send private message Visit poster's website
  • Joined: 23 Mar 2013
  • Posts: 611
  • Location: Copenhagen, Denmark
Reply with quote
WLA DX in the terminal...
Post Posted: Wed Mar 27, 2013 9:10 am
I'm working on an Applescript or Automator version of Maxim's compile.bat. For now I'm just working out how to handle WLA DX in Mac terminal.

In terminal I navigate to a certain directory that contains both the wla-z80 file and hw.asm which is the file to be compiled.

Following the workflow laid out in the original compile.bat, I first want to create an object file. When I type
"open wla-z80 --args -o hw.asm object.o" nothing happens? Or more precisely it seems that the assembler was invoked all right, but that I might be feeding it the wrong arguments or something. (I tried to provide the output, but the forum think it is a link and won't let me post it...)
  View user's profile Send private message Visit poster's website
  • Joined: 29 Dec 2010
  • Posts: 6
  • Location: Columbus, Ohio
Reply with quote
Post Posted: Wed Mar 27, 2013 12:18 pm
I'd recommend using a Makefile, rather than some proprietary thing like that which isn't exactly suited for development in the first place.

Here's my "typical" Makefile:
PREFIX    =
AS        = $(PREFIX)wla-z80
LD        = $(PREFIX)wlalink
SOURCES     = \
  top.S main.S \
  mapper.S vdp.S \
  mem.i

OUTPUT    = hellow.sms
SFLAGS    = -xo
LDFLAGS   = -vds Linkfile
SRCS      = $(addprefix src/,$(SOURCES))

.PHONY: all clean

all: obj/top.o $(OUTPUT)

obj/top.o: $(SRCS)
   $(AS) $(SFLAGS) $< $@
$(OUTPUT): obj/top.o
   $(LD) $(LDFLAGS) $@
clean:
   $(RM) $(OUTPUT) obj/top.o hellow.sym


And my Linkfile:
[objects]
obj/top.o
  View user's profile Send private message Visit poster's website
  • Joined: 23 Mar 2013
  • Posts: 611
  • Location: Copenhagen, Denmark
Reply with quote
Post Posted: Wed Mar 27, 2013 1:16 pm
... oh, I'm sorry, but I do not understand this tip about makefile. I can see that it has something to do with c (?), but I do not have c on my MacBook. I was hoping for a quick way to use the WLA DX files for compiling just as it is explained by Maxim - but on OSX.
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 14745
  • Location: London
Reply with quote
Post Posted: Wed Mar 27, 2013 1:43 pm
WLA DX is really expecting you to use a makefile, and especially with the separate assembler and a linker that demands a linkfile; but on Windows, there is no make tool available by default, so I made a simple batch file to do the job. On Linux I expect people to make it work with some kind of make system (make, cmake, scons, etc). Mac users would probably prefer something a bit more friendly.

Nevertheless, and if we assume a single source file called "source.asm", can someone produce a makefile and link file that can be dropped in to let "make" do the work?
  View user's profile Send private message Visit poster's website
  • Joined: 29 Dec 2010
  • Posts: 6
  • Location: Columbus, Ohio
Reply with quote
Post Posted: Wed Mar 27, 2013 9:00 pm
That's precisely what mine does; the source file is in src/top.S rather than source.asm, but it should be fairly trivial to change. The additional files in SOURCES is just to make sure that make will rebuild if any of those files change.
  View user's profile Send private message Visit poster's website
  • Joined: 23 Mar 2013
  • Posts: 611
  • Location: Copenhagen, Denmark
Reply with quote
Post Posted: Wed Mar 27, 2013 11:40 pm
- okay, thank you both. I think I need to study the assembler basics a little more, in order to know my way around makefile etc.
  View user's profile Send private message Visit poster's website
  • Joined: 26 Jan 2013
  • Posts: 5
Reply with quote
Post Posted: Thu Mar 28, 2013 12:15 am
I get a bit confused myself when dealing with makefiles, so I ended up doing things the less correct but still useable way.

I believe you have the right idea with what you are doing, but I'm not sure why you have "open" in your command.
These are the commands that work for me under Linux, and I think they'd probably work for you:
./wla-z80 -o 'hw.asm' object.o
echo [objects]>linkfile
echo object.o>>linkfile
./wlalink -drvs linkfile output.sms
rm linkfile
rm object.o
  View user's profile Send private message
  • Joined: 23 Mar 2013
  • Posts: 611
  • Location: Copenhagen, Denmark
Reply with quote
Post Posted: Thu Mar 28, 2013 9:06 pm
OK - thank you VectorKiwi. I have to type open to run a program from the terminal. If I don't, I get an error.

I have downloaded Virtualbox and installed Windows XP on it. For the sole purpose of running MEKA etc. on Windows. When I run MEKA, it goes all black screen and hangs up the system. Pressing esc switches to the screen view all right, but I have to terminate the whole thing by sending ctrl+alt+delete and then manually ending the mekaw.exe process.

I know this has to do with Virtual Box; has anyone experienced this problem?

EDIT: I got it fixed (installed a fresh Windows 7 on Virtualbox). Now I can proceed with the baby asm-steps... Wow - I have changed the text and colors of your hello world example, Maxim. Thank you for providing this great resource.
  View user's profile Send private message Visit poster's website
Reply to topic



Back to the top of this page

Back to SMS Power!