News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu

Preferred tool chain / setup

Started by MartinW, 13:32, 01 April 13

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MartinW

OK, so I've done a bunch of reading up lately and I'm edging toward something like SDCC / Pasmo, or something like that, but what's the generally accepted way to actually go about this? I guess I'm talking about cross development from a PC or Mac. Do people just use Notepad and the command line plus an emulator, or something else?

I have Windows 8 or Mac OS X 10.8.x available to me. I could go Linux but I already have 2 windows installs and an OS X install on my PC as it is so I don't really want to put a Linux partition on just for this (yes, I could do a VM but again, don't really want to).

I'm initially looking at running through a bunch of tutorials and just trying to learn some stuff specific to the CPC and Z80. I'm good for C and a little bit of 6502 so I think I need to start with the Z80 and CPC side first before I start worrying about wanting to write super awesome widget X. I suspect some people would disagree but I imagine as I go along I'll get an idea for something I want to do, and if the inspiration doesn't spark then it will be time to go back to fiddling with my arcade machines and flying my RC planes and heli's  :laugh:

arnoldemu

On Windows I use Notepad++. I have pasmo and sdcc downloaded.
I use bat batch scripts to compile and build the code and run it on an emulator.

On Linux I use scite. I have pasmo and sdcc too.
I use makefiles and shell scripts.

I also have my own tools for converting graphics and manipulating files.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

Go with C, use one of the existing sdcc libraries to link against, or follow other examples and put your asm inline.
I'd work from the existing examples for sprites and things like that until you get familiar and want to write your own.

C is good to work with on cpc (others call me mad to use c), but you do need some good library functions which are written in asm.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

MartinW

Funnily enough, It was your page I was looking at yesterday which made me think that C was indeed going to be a perfectly viable option  :D

I would prefer to go with C as there will be less I'm having to learn then. At least until such times as I find that I'm optimizing so much that it doesn't make sense any more, but I can't see that day coming for a very long time (if ever).

I've used Notepad++ for ages and ages now but only ever as a simple editor (though it's certainly not simple!). Can you run the batch files directly from Notepad++ ? I had a look the other night and couldn't spot anything that suggested you could so I was thinking of giving Sublime Text a trial. It's expensive (compared to free) but I do like the look of it and the licensing would allow me to make use of it for work as well so it wouldn't be so bad.

I think really I just wanted to ensure I wasn't missing some other glaringly obvious option - doesn't sound like I am though.

arnoldemu

I don't know if you can run batch files from it. I use it because we use it at work and has good syntax highlighting and editing.

I normally have either a command prompt open where I then run my batch file from, or I keep an explorer window open and double click it from there.

I have used Crimson in the past, this has a project view, so making it easier for many files, and you can configure it's tools to run a batch file. So this may be easier for you.

On linux (at home), I would like to use crimson or notepad++ but there is no native version. So I use scite and run it all from the command-line.

It's what I am used to.

I am beginning to lean towards a common build method that works under linux and windows, but I haven't tried it yet.


My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

MartinW

Quick update - I spent the evening yesterday setting up my environment. I found in the end I was able to do everything I wanted to do with Notepad++ which is great as it doesn't involve spending any money. My other candidate was "SublimeText" which looks great but is £70.

I found in the end that there is plugin for Notepad++ (I think) called NPPExec which has it's own command console and scripting engine. This allowed me to define a script file for compiling a file by it's extension, so for an asm file it runs compile@.asm.txt, for a C file it runs  compile@.c.txt and so on. I then defined another that does the same but for "run". So I have a compile action that literally compiles the current file and a run action that also compiles the current file but then does a hex2bin, creates a DSK image and then fires up WinAPE with the auto-run feature so the code runs in the emulator. I have been able to assign these to F5 for run and F7 to compile, just like any popular IDEs.

An added bonus is that I can have filtering and highlighting in my console output window so errors appear in red, warnings in blue and so on. Click on an error and it will take you to the line in the file. So far I can see only one downside. The output from the compile isn't kept in strict order. STDOUT comes first, then STDERR. I haven't found any way round this yet. For the simple hello world example I was testing against last night that didn't seem too much of an issue but i'll have to see how we go in the real world.

SO, now all I've got to do is DO something. I'm starting to get some ideas pinging about in my head :)

Oh, finally, it also looks like Notepad++ now has a limited concept of workspaces and projects already built in so it's looking better and better. I didn't get to explore that too much though as it was 2am by then.

redbox

Nice to hear Notepad++ is so popular as it's what I use too.

I'd like to build some of my own tools in Linux for CPC development, but I find that would take me away from the Z80 as I'd spend all day writing PC tools instead.  So Windows and WinApe it still is.

Wasn't there a collection of CPC Linux tools somewhere on the web?  Remember seeing it, but can't find it now...

MartinW

Just going through some tutorials on norecess.net - any idea where I can get the latest version of sdcc2pasmo? Google seems to suggest the latest version (last version?) was / is v1.7 but all links seem to point back to the "productions" page on norecess.net, and for the life of me I can't see it there so it looks like it's gone.

Bryce

Send Arnaud an e-mail. I'm sure he'll point you to the latest version.

Bryce.

ralferoo

Quote from: redbox on 21:11, 04 April 13
Wasn't there a collection of CPC Linux tools somewhere on the web?  Remember seeing it, but can't find it now...
I use WinCPC, pasmo and a couple of slightly modified tools: ralferoo/cpctools · GitHub

The following in a Makefile will convert from WinCPC syntax to pasmo (might be missing a few cases):

build/%.bin: build/%.compat build/.dummy
        pasmo $< build/$*.bin build/$*.sym

build/%.compat: test/%.asm
        @echo Making $@

%.compat: %.asm
        @echo Making $@
        @perl -pe '{s/readbin\s\"([^"]*)\"/incbin "$$1"/;s/read\s\"([^"]*)\.asm\"/include "$$1.compat"/;s/([xy][lh])/i$$1/g;s/(add\s+)(i)?([xy][lh])/$$1a,i$$3/g;s/(ex\s+)hl\s*,\s*de/$$1de,hl/g;s/ld\s+pc,(i[xy])/jp ($$1)/;s/rst\s+5/rst #28/g;s/;DATE;/incbin "date.bin"/;s/(add\s+)(\(i[xy])/$$1a,$$2/;}' <$< >$@


I also find the following very helpful if I'm using included source:

ASMS = $(wildcard *.asm)
COMPATS = $(patsubst %.asm,%.d,$(ASMS))
-include $(COMPATS)

%.d: %.asm
        @echo Making $@
        @(perl -ne '{if (/read\s"([^"]*)\.asm\"/) {print "$*.bin: $$1.compat\n";}}' <$< | uniq ; echo $*.d: $*.asm ) >$@

MartinW

Quote from: Bryce on 21:25, 04 April 13
Send Arnaud an e-mail. I'm sure he'll point you to the latest version.

Bryce.

Assuming Arnaud is the owner of norecess.net then I'll ping him a mail - on further inspection though there is a comment at the bottom of the last news item where he says all the demo stuff has been moved to scene.org and sdcc2pasmo is no longer available so I guess I can only really expect to be ignored!

In the meantime I've found v1.5 which would appear to be compatible with sdcc v3.0.0 so I've downgraded sdcc accordingly. It's not ideal but let's face it, until I'm WAY further down the line it will be fine for now. It's a bit of a shame that the wayback machine is incomplete as the v1.5 download when it was there also had the source. all the sdcc downloads on the archive are gone now though.

I'm not even sure at the moment if it's something I even need or want!

Gryzor

Arnaud is a great guy really, just taking a break from the scene (hopefully). never hurts to try.

Powered by SMFPacks Menu Editor Mod