Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Apple2BuildPipeline v2.0 available now

107 views
Skip to first unread message

Jeremy Rand

unread,
Jun 25, 2018, 11:39:35 PM6/25/18
to
Leading up to this year’s KansasFest, I have been working on a significant
upgrade to the cc65 based Xcode project templates. As before, this is a
way to use Apple’s Xcode development environment to build software projects
in C or 6502 assembly for 8-bit Apple II’s. New in v2.0 is:

- Code completion works now in Xcode. You can even complete functions from
the cc65 standard library and jump to those function definitions in the
headers.
- Syntax colouring for ca65 assembly files is now supported.
- Build errors from the compiler, assembler or linker will be displayed
inline in your source code next to the problematic line.
- Upgraded to the latest versions of ProDOS and AppleCommander.
- In previous versions there was no distinction between builing the project
and running the project. Both would launch your code in the emulator. Now,
you can do a build without launching the project in an emulator or select
run and the emulator will be launched.
- You can easily add drivers from the cc65 project by uncommenting a single
line in the template Makefile. Drivers for lores graphics, hires graphics,
aux memory, joysticks, mouse and serial devices are supported.
- The Makefile template provides a gen phase which executes before all
compiles. If you want to generate code or other data files in your project,
this is now supported.
- You can specify one or more directories in your project which contain
files you want to copy to the disk image at the end of the build. So, if
you have files beyond the executable itself which need to be on the disk
image, you can use this feature to do so.

One feature I have not worked on is to upgrade the underlying cc65 version.
I am worried that may be a bit disruptive and have put it off. If you are
keen to get to a more recent version of cc65, let me know and encourage me
to do that work.

For more information about these project templates and installation
instructions, look here:

https://github.com/jeremysrand/Apple2BuildPipeline

If you want to see how to use these project templates, you can look at my
other repositories from here, most of which are based on this build engine:

https://github.com/jeremysrand


denisb...@gmail.com

unread,
Jun 28, 2018, 10:42:23 PM6/28/18
to
Hi Jeremy

Is this the best place to ask for help?

I followed the instructions for installing everything, selected Product->Build, and it just says 'Build Failed'. I don't see any clues as to what went wrong.

BTW the Apple C/Apple Asm project options are not listed under macOS but under Cross-platform.

Cheers

Denis

denisb...@gmail.com

unread,
Jun 28, 2018, 10:52:51 PM6/28/18
to
More info:

defaults write "/Users/denismolony/Library/Developer/Xcode/Plug-ins/cc65.ideplugin/Contents/Info.plist" DVTPlugInCompatibilityUUIDs -array `defaults read "/Applications/Xcode.app/Contents/Info.plist" DVTPlugInCompatibilityUUID`
2018-06-29 12:44:36.960 defaults[1377:82806] Could not write domain /Users/denismolony/Library/Developer/Xcode/Plug-ins/cc65.ideplugin/Contents/Info.plist; exiting
make[1]: *** [xcodefix] Error 1
make: *** [all] Error 2
Command /usr/bin/make failed with exit code 2

Should the Plug-ins folder have different permissions?

MBP3:~/Library/Developer/Xcode $ ll
total 0
drwxr-xr-x 8 denismolony staff 256 29 Jun 12:32 ./
drwxr-xr-x 4 denismolony staff 128 23 Sep 2016 ../
drwxr-xr-x 5 denismolony staff 160 29 Jun 12:35 DerivedData/
drwxr-xr-x 2 denismolony staff 64 30 Mar 17:38 DocumentationCache/
srwxr-xr-x 1 denismolony staff 0 29 Jun 12:32 GPUToolsAgent.sock=
drwx------ 3 root wheel 96 29 Jun 12:32 Plug-ins/
drwxr-xr-x 6 denismolony staff 192 28 May 10:58 UserData/
drwxr-xr-x 32 denismolony staff 1024 29 Jun 12:31 iOS Device Logs/

Jeremy Rand

unread,
Jun 28, 2018, 11:44:57 PM6/28/18
to
Well, that is embarrassing. Sorry you are having problems. First a
workaround.

This is part of the solution to Xcode marking the plugin as incompatible on
every upgrade. So I do something really dumb where I update the
compatibility of the plugin with every build, just in case. That is failing
here for some reason.

The workaround is to comment out the line in tail.mk around line 121. The
line is right after the one which says “xcodefix:” and says “defaults
write...”. Comment out the line by adding a # right at the beginning. I
think that should work as a temporary fix.

For the full fix, the directory listing you sent looks weird to me. The
Plug-ins directory is owned by root and that seems wrong to me. It isn’t on
my machine but maybe my machine is the weird one. Anyone else out there
having the same problem?

To fix it, execute this from the ~/Library/Developer/Xcode directory:

sudo chown denismolony:staff Plug-ins

Let me know how these suggestions work for you. In the meantime, I have a
clean install of Mac OSX on a VM which I can test with (and should have
done so before shipping this). I’ll check to see if I can reproduce the
problem from a clean machine. I appreciate your patience with this
problem.

denisb...@gmail.com

unread,
Jun 29, 2018, 12:25:06 AM6/29/18
to


Hi Jeremy

The full fix worked, although I used:

sudo chown -R denismolony:staff Plug-ins

in order to change all the sub-folders too.

Next question, why does it start two instances of Virtual II?

Jeremy Rand

unread,
Jun 29, 2018, 12:53:00 AM6/29/18
to
Ok, I have word from someone else that they had the same permission problem
as you. I have a bug to fix. Hopefully I can reproduce it on my VM.

I think Virtual II launches a default machine and then the machine that I
have asked to be launched. I think that is why two machines start. It isn’t
ideal but I haven’t spent much time trying to avoid it.

As long as you don’t get more instances launched on each execution which
might lead to a huge number of Apple //s running, it isn’t great but
shouldn’t be to much of a problem.

denisb...@gmail.com

unread,
Jun 29, 2018, 1:19:02 AM6/29/18
to
Hopefully Gerard Putter has some ideas for how to stop it happening. Luckily it only happens on the first invocation.

denisb...@gmail.com

unread,
Jun 29, 2018, 2:10:48 AM6/29/18
to
Are these warnings important?

osascript make/V2Make.scpt "/Users/denismolony/Documents/TestAppleAsm/TestAppleAsm" "TestAppleAsm" "/Users/denismolony/Documents/TestAppleAsm/TestAppleAsm/make/DevApple.vii" "BRUN TESTAPPLEASM"
2018-06-29 15:17:11.128284+1000 osascript[1967:127370] AppleEvents: received mach msg which wasn't complex type as expected in getMemoryReference.
2018-06-29 15:17:11.279929+1000 osascript[1967:127370] AppleEvents: received mach msg which wasn't complex type as expected in getMemoryReference.
2018-06-29 15:17:11.317634+1000 osascript[1967:127370] AppleEvents: received mach msg which wasn't complex type as expected in getMemoryReference.
2018-06-29 15:17:11.343630+1000 osascript[1967:127370] AppleEvents: received mach msg which wasn't complex type as expected in getMemoryReference.
2018-06-29 15:17:12.081361+1000 osascript[1967:127370] AppleEvents: received mach msg which wasn't complex type as expected in getMemoryReference.
2018-06-29 15:17:12.336902+1000 osascript[1967:127370] AppleEvents: received mach msg which wasn't complex type as expected in getMemoryReference.
Program ended with exit code: 0

denisb...@gmail.com

unread,
Jun 29, 2018, 2:16:16 AM6/29/18
to
I made the following change to the make file, expecting it to boot a DOS3.3 disk, but it's still using a prodos disk.

# Uncomment the one you want below (the first one is the default):
# MACHINE = apple2
# MACHINE = apple2-dos33
# MACHINE = apple2-system
# MACHINE = apple2-loader
# MACHINE = apple2-reboot
# MACHINE = apple2enh
MACHINE = apple2enh-dos33
# MACHINE = apple2enh-system
# MACHINE = apple2enh-loader
# MACHINE = apple2enh-reboot

denisb...@gmail.com

unread,
Jun 29, 2018, 3:26:17 AM6/29/18
to
I tried to RTFM at http://cc65.github.io/cc65/doc/apple2enh.html#s4, but it gave me a 404.

Jeremy Rand

unread,
Jun 29, 2018, 8:36:52 AM6/29/18
to
Well, that should work. Can you try doing a a clean build? I think I have
a dependency which causes a full rebuild if the makefile changes but maybe
that isn’t working. I’ll test it also.

If it still boots ProDOS after a clean build, can you email me a build log
of a clean build. Maybe send me the whole project actually. Zip it up and
email it to me.

Jeremy Rand

unread,
Jun 29, 2018, 8:36:52 AM6/29/18
to
Those errors should be fine. I get them too on the Xcode console output and
they come from a bit of AppleScript which drives the emulator to do what I
want. The AppleScript interpreter is emitting these errors for some reason
but things do work regardless.

Jeremy Rand

unread,
Jun 29, 2018, 8:36:53 AM6/29/18
to
The cc65 project changed homes a while ago and I guess I have a reference
to the old URL lingering the Makefile. I’ll clean that up. Note that I have
updated the README already with your previous suggested edits.

denisb...@gmail.com

unread,
Jun 29, 2018, 6:43:43 PM6/29/18
to
The clean/build steps worked. I have tried going back and forth a few times now, and it never picks up the change unless I do a clean/build.

Incidentally, what is V2Make.scpt? It mostly looks like gibberish, as if it is displaying a binary file as text. It's not the raw disk image is it?

denisb...@gmail.com

unread,
Jun 29, 2018, 7:17:16 PM6/29/18
to
This is getting weird. When I run the helloworld program, it works. But when I touch a key to exit, it prints 'ELLO, WORLD' immediately after the first 'HELLO, WORLD'.

If I go into the monitor and run it from there, it works as expected. See screen shot below.

https://www.dropbox.com/s/d3xsk1lg50nj2s2/TESTAPPLEASM.png?dl=0

Jeremy Rand

unread,
Jun 29, 2018, 11:08:45 PM6/29/18
to
Weird. I am not seeing that. I have installed everything on a brand new VM
from scratch. I didn’t see the permission problem that you and at least
one other person had. For sure that is a real problem but I am not sure
where it is coming from. I’ll see what I can do to find that issue.

Also, I cannot reproduce the problem with changing the machine type. If I
change the machine type in Makefile, hit command S to save the changes and
command R to build and run, it always seems to use the latest for me.
Another test you can do is go to the same directory as the Makefile in a
terminal and type:

touch Makefile
make

You should see the project recompiled. If not, something is wrong with the
make rules.

The V2Make.scpt file is an AppleScript file for launching Virtual ][ with
the disk image. You can open it in “Script Editor” if you want to take a
look at it.

Jeremy Rand

unread,
Jun 29, 2018, 11:08:46 PM6/29/18
to
Looks like this is a DOS 3.3 project. I am not seeing the “ELLO, WORLD”
being printed after the initial print out. I am not sure what to
recommend. What kind of Apple // are you emulating? What ROM version?

Note that I have the same machine code in memory as what you show in your
screenshot. So, what is different? I am not sure.

denisb...@gmail.com

unread,
Jun 30, 2018, 1:00:20 AM6/30/18
to
I followed your instructions (touch Makefile, make) and the project recompiled. So far so good. Then I went back into xcode and changed the makefile. Back to the terminal and typed 'make'. The output indicates that it is picking up different options. But it still executes a DOS disk.

Also typing BLOAD TESTAPPLEASM followed by CALL 2051 gives a different (correct) result than BRUN TESTAPPLEASM.

MBP3:~/Documents/TestAppleAsm/TestAppleAsm $ touch Makefile

MBP3:~/Documents/TestAppleAsm/TestAppleAsm $ make
defaults write "/Users/denismolony/Library/Developer/Xcode/Plug-ins/cc65.ideplugin/Contents/Info.plist" DVTPlugInCompatibilityUUIDs -array `defaults read "/Applications/Xcode.app/Contents/Info.plist" DVTPlugInCompatibilityUUID`
make/errorFilter.sh /usr/local/bin/cl65 -t apple2 -C apple2enh-dos33.cfg --cpu 6502 -l -c -o main.o main.s
make/errorFilter.sh /usr/local/bin/cl65 -t apple2 -C apple2enh-dos33.cfg --mapfile TestAppleAsm.map --start-addr 0x803 -o "TestAppleAsm" main.o
make/createDiskImage make/AppleCommander.jar apple2enh-dos33 "TestAppleAsm.dsk" "TestAppleAsm" "803"

MBP3:~/Documents/TestAppleAsm/TestAppleAsm $ make
defaults write "/Users/denismolony/Library/Developer/Xcode/Plug-ins/cc65.ideplugin/Contents/Info.plist" DVTPlugInCompatibilityUUIDs -array `defaults read "/Applications/Xcode.app/Contents/Info.plist" DVTPlugInCompatibilityUUID`
make/errorFilter.sh /usr/local/bin/cl65 -t apple2 --cpu 6502 -l -c -o main.o main.s
make/errorFilter.sh /usr/local/bin/cl65 -t apple2 --mapfile TestAppleAsm.map --start-addr 0x803 -o "TestAppleAsm" main.o
make/createDiskImage make/AppleCommander.jar apple2 "TestAppleAsm.dsk" "TestAppleAsm" "803"
0 new messages