PCE/macplus emulator

About Mini vMac and all other 68k emulators, including SoftMac, Executor, and MESS.

Moderators: Cat_7, Ronald P. Regensburg

Post Reply
mdanh2002
Space Cadet
Posts: 8
Joined: Sat Feb 18, 2017 2:57 pm

PCE/macplus emulator

Post by mdanh2002 »

Hi,

I have written a review of the PCE/macplus emulator:

http://www.toughdev.com/content/2016/11 ... -emulator/

This is a highly customizable emulator that can emulate many 68k compact Macintosh models from the Macintosh 128K/512K up to the Macintosh SE, supporting sound, serial port and Internet access via PPP.

The article contains the steps to compile PCE/macplus under Ubuntu Linux, setup PPP support and described the problems I have with the HD20 INIT on the Macintosh 512K emulated by PCE/macplus once the Sony driver support is enabled.

Let me know what you think. :)
User avatar
Cat_7
Expert User
Posts: 6145
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: PCE/macplus emulator

Post by Cat_7 »

Hi,

Thank you for that well written review/manual ;-)

Best,
Cat_7
mdanh2002
Space Cadet
Posts: 8
Joined: Sat Feb 18, 2017 2:57 pm

Re: PCE/macplus emulator

Post by mdanh2002 »

Cat_7 wrote:Hi,

Thank you for that well written review/manual ;-)

Best,
Cat_7
Thanks :) I just want to introduce everyone to this superb 68K Mac emulator. In terms of functionality, it is much better than Mini vMac which can't support PPP or serial port functionality. I am currently using it with Retro68K (https://github.com/autc04/Retro68) and Code Lite IDE (https://codelite.org/) on Ubuntu as the development environment to write 68K Mac apps. Soon I will write another article showing how to write 68K apps the modern way. Much better than using Macintosh's Programmer Workshop, in my opinion.
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: PCE/macplus emulator

Post by adespoton »

mdanh2002 wrote: I just want to introduce everyone to this superb 68K Mac emulator. In terms of functionality, it is much better than Mini vMac which can't support PPP or serial port functionality. I am currently using it with Retro68K (https://github.com/autc04/Retro68) and Code Lite IDE (https://codelite.org/) on Ubuntu as the development environment to write 68K Mac apps. Soon I will write another article showing how to write 68K apps the modern way. Much better than using Macintosh's Programmer Workshop, in my opinion.
Back in the day, my IDE of choice was Turbo Pascal. Then I moved to CodeWarrior. I kept trying to set up an MPW toolchain, but just never got enough bits configured to comfortably automate my workflow.

Of course, for a lot of stuff you can side-step development altogether and just write HyperCard stacks :D I did a lot of rapid prototyping that ended up just staying in stack form back in the day.
User avatar
ClockWise
Site Admin
Posts: 4397
Joined: Mon May 20, 2002 4:37 am
Location: Uiwang

Re: PCE/macplus emulator

Post by ClockWise »

Thanks for sharing that manual. I've added a link to the wiki, so hopefully it will be found by interested users.

http://emaculation.com/doku.php/pce_macplus
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: PCE/macplus emulator

Post by adespoton »

As a side note, I've had a "default" compile of PCE/Macplus for a while, but I've been attempting to compile in PPP/SLIP networking, and hitting a wall with compiling the tun headers.

Has anyone else got serial + networking to work on PCE on OS X?
mdanh2002
Space Cadet
Posts: 8
Joined: Sat Feb 18, 2017 2:57 pm

Re: PCE/macplus emulator

Post by mdanh2002 »

@adespoton - I think compiling pce/macplus with TUN/TAP support for OSX is quite tricky - I could not get it to work (missing headers) as Mac OS X is based on BSD. I believe you may need something like this http://tuntaposx.sourceforge.net/ to enable TUN/TAP support. Alternatively, maybe install brew and use it to compile pce/macplus with the OpenVPN development libraries for BSD - it has some TUN/TAP support I think. Either way, it will take some serious efforts to get it working.

@ClockWise - thanks for adding the link to the Wiki. Btw, the statement saying that PCE/macplus does not support sound is incorrect. Sound support was added some time ago and works fine using both OSS / SDL. Recording to WAV file is also supported. Maybe the wiki can be updated to reflect this.
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: PCE/macplus emulator

Post by adespoton »

mdanh2002 wrote:@adespoton - I think compiling pce/macplus with TUN/TAP support for OSX is quite tricky - I could not get it to work (missing headers) as Mac OS X is based on BSD. I believe you may need something like this http://tuntaposx.sourceforge.net/ to enable TUN/TAP support. Alternatively, maybe install brew and use it to compile pce/macplus with the OpenVPN development libraries for BSD - it has some TUN/TAP support I think. Either way, it will take some serious efforts to get it working.

@ClockWise - thanks for adding the link to the Wiki. Btw, the statement saying that PCE/macplus does not support sound is incorrect. Sound support was added some time ago and works fine using both OSS / SDL. Recording to WAV file is also supported. Maybe the wiki can be updated to reflect this.
I've already got TUN/TAP installed, including headers -- the tricky bit is getting the OS X libraries to be recognized correctly by the PCE source. I may have to resort to brew, but would like to do an encapsulated compile that doesn't depend on libraries.

Is PCE up to date in brew?
User avatar
ClockWise
Site Admin
Posts: 4397
Joined: Mon May 20, 2002 4:37 am
Location: Uiwang

Re: PCE/macplus emulator

Post by ClockWise »

Thanks for the update. I have edited the wiki re: sound. Do let me know if there is anything else that should be mentioned or linked to.
mdanh2002
Space Cadet
Posts: 8
Joined: Sat Feb 18, 2017 2:57 pm

Re: PCE/macplus emulator

Post by mdanh2002 »

adespoton wrote:
mdanh2002 wrote:@adespoton - I think compiling pce/macplus with TUN/TAP support for OSX is quite tricky - I could not get it to work (missing headers) as Mac OS X is based on BSD. I believe you may need something like this http://tuntaposx.sourceforge.net/ to enable TUN/TAP support. Alternatively, maybe install brew and use it to compile pce/macplus with the OpenVPN development libraries for BSD - it has some TUN/TAP support I think. Either way, it will take some serious efforts to get it working.

@ClockWise - thanks for adding the link to the Wiki. Btw, the statement saying that PCE/macplus does not support sound is incorrect. Sound support was added some time ago and works fine using both OSS / SDL. Recording to WAV file is also supported. Maybe the wiki can be updated to reflect this.
I've already got TUN/TAP installed, including headers -- the tricky bit is getting the OS X libraries to be recognized correctly by the PCE source. I may have to resort to brew, but would like to do an encapsulated compile that doesn't depend on libraries.

Is PCE up to date in brew?
I have not had the chance to try brew extensively yet. Let me spend some time next week on this and see if I could get it to work.
camateg
Space Cadet
Posts: 5
Joined: Wed Nov 22, 2017 5:23 am

Re: PCE/macplus emulator

Post by camateg »

Hello -

I know this is an old thread, but for some reason I hadn't heard of pce-macplus until very recently and wanted to try to contribute. The originally posted guide was excellent on its own, but even more so because it was the only documentation I could find. I've always been a fan of Basilisk II, but I sometimes have some stability issues on modern Mac OS. Also, I thought it'd be neat to emulate a compact Mac with serial support.

I was able to compile tun support for Mac OS X 10.11, at least on the surface, after a couple of hours of research. Granted, I haven't made an Internet connection yet, but I'm hoping that this could be because of my inexperience with tuntap on OS X. I wrote some quick notes in hopes that someone could make use of them and get some actual results. I'll just post the link because it got fairly lengthy:

http:/kb3tix.net/pce-macplus-macosx-tun/

The original guide game me another idea after I re-read it and I actually had a little bit more success with that. Although tty0tty relies on a Linux kernel module, another utility called "socat" runs on a wider range of platforms and is available through homebrew for OS X.

Code: Select all

iMac:~ matt$ socat -d -d pty,raw,ignoreeof,echo=0,link=/tmp/modem1 pty,raw,ignoreeof,echo=0,link=/tmp/modem2
2017/11/22 18:56:55 socat[1708] N PTY is /dev/ttys007
2017/11/22 18:56:55 socat[1708] N PTY is /dev/ttys008
The above basically creates a fake null modem cable as originally suggested. The "link" parameter allowed me to maintain some degree of consistency between calling socat; the ttys are allocated numbers at random, but you can link a filename to put in your .cfg. I chose /tmp instead of /dev because even after disabling SIP on the Mac, I couldn't easily write to /dev. On a side note, you'll have to disable SIP eventually to write the pppd options in /etc because apparently /etc/ppp/options is hardcoded into pppd. Here's the snippet of my config when I configure the serial port:

Code: Select all

serial {
        port = 0

        multichar = 1

        driver = "stdio:file=/tmp/modem1"
        #driver = "ppp:if=tap0:host-ip=10.10.10.2:guest-ip=10.10.10.3"
}
In true form, I got ahead of myself and immediately tried to fire up FreePPP on Mac TCP. I ran pppd as described on the guide with the exception of the device name which is the second generated device from above, /dev/ttys008. pppd gets angry if you specify a "device" file outside of /dev, so that's necessary. You can use the following commands to monitor the two sides of the "cable:"

Code: Select all

cat < /tmp/modem1
cat < /tmp/modem2
After I had introduced way too many variable into my "equation," I stepped back and tried ZTerm on System 7 and minicom on Mac OS X through the "cable". I chose minicom because it's much more agnostic about allowing non-standard device names compared to something more GUI friendly and it's also available on homebrew. I chose the modem port on System 7, which the .cfg pointed to /tmp/modem1 and /tmp/modem2 in minicom. When I typed on the emulator I could see appropriate characters on minicom, but the reverse wasn't true (I saw nothing on the Mac Plus). I had the cat commands running in two other terminals and they produced output as expected for the corresponding cable ends.

Hopefully, someone can take this and run with it to make something usable. I hope it helps.
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: PCE/macplus emulator

Post by adespoton »

Wow! That’s great! And the socat solution should also work for other emulators like QEMU. You may even be able to get Mini vMac talking to the Linux AppleShare VM using that method, as it supports writing serial out to dev.
camateg
Space Cadet
Posts: 5
Joined: Wed Nov 22, 2017 5:23 am

Re: PCE/macplus emulator

Post by camateg »

That sounds interesting, too. I didn't know vMac could emulate anything except an unattached serial port. I looked it up and found your post about it, actually:

viewtopic.php?t=6674

I'm not sure about emulating LocalTalk to use with netatalk for that VM; I get the impression that a serial port is a lot different than emulating LocalTalk hardware, but a Mac Plus can run up to 7.5.5, which I think if you upgrade the Appleshare Client can connect to afp shares through TCP/IP.

Also, I'm pretty sure I didn't set up the tun device correctly on the Mac OS X computer, so maybe there's hope. I had trouble manipulating /dev/tun0 even apart from pce...
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: PCE/macplus emulator

Post by adespoton »

/dev/tun0 needs to be attached to something to bring the interface up... but most software wants the interface up before it establishes a connection.

So you need to do some fancy footwork to get everything up in the correct order.

As for Mini vMac, there's an outdated fork that enables LocalTalk, and Paul rolled most of that code back into the main branch in 2.3 or 2.4. As a result, you'll see the option available in the compile settings now, but up until this point, I've had no clue how to actually use it.

With your tips, we may have something functional that can use that code. Or not, if a null modem link isn't enough to tunnel LocalTalk. That partially depends on how much of the lifting the netatalk VM can do, I think. We wouldn't be able to use PPP or SLIrP here, unless we use 7.5.5's AFP over TCP.
camateg
Space Cadet
Posts: 5
Joined: Wed Nov 22, 2017 5:23 am

Re: PCE/macplus emulator

Post by camateg »

adespoton wrote:/dev/tun0 needs to be attached to something to bring the interface up... but most software wants the interface up before it establishes a connection.

So you need to do some fancy footwork to get everything up in the correct order.

As for Mini vMac, there's an outdated fork that enables LocalTalk, and Paul rolled most of that code back into the main branch in 2.3 or 2.4. As a result, you'll see the option available in the compile settings now, but up until this point, I've had no clue how to actually use it.

With your tips, we may have something functional that can use that code. Or not, if a null modem link isn't enough to tunnel LocalTalk. That partially depends on how much of the lifting the netatalk VM can do, I think. We wouldn't be able to use PPP or SLIrP here, unless we use 7.5.5's AFP over TCP.
You're definitely right about doing things in the right order. PCE is sensitive to the tty being present and working and still dies at times. I might try a different comm software on the emulator too, just to rule out some possibilities. The outbound traffic from the emulator was more consistent than the inbound, at least with zterm. I just remembered something else, though, that makes me optimistic. When I tried to invoke the PPP session I was monitoring both ttys and I saw traffic in both directions but a link was never established, so there was definitely an attempt at a two way exchange. I'll try again tonight.

I just came across an asantetalk bridge and found the macipgw VM that you're talking about, which looked cool too, but I'm better acquainted with netatalk on freebsd and my hypervisor is just on my old iMac. I was disappointed that DDP isn't supported in netatalk 3, but it makes sense. The proxy service for old browsers that uses webkit is a really amazing idea too.

Thanks for the feedback. Hopefully I'll have something to report soon.
User avatar
mabam
Master Emulator
Posts: 497
Joined: Wed Apr 10, 2013 9:32 am

Re: PCE/macplus emulator

Post by mabam »

camateg wrote:I was disappointed that DDP isn't supported in netatalk 3, but it makes sense.
You might want to have a look at A2Server (though I don't think it runs on FreeBSD).
camateg
Space Cadet
Posts: 5
Joined: Wed Nov 22, 2017 5:23 am

Re: PCE/macplus emulator

Post by camateg »

I guess some time away from this little exercise was helpful. When I came back, I rethought my config file and wondered why I was using stdio. I guess it was just the first thing I tried and I stuck with it for no apparent reason.

I ended up substituting this config line for the serial section:

Code: Select all

driver = "posix:file=/tmp/modem1"
This allowed me to invoke a comm terminal on the "Plus" and communicate as expected. I haven't gotten pppd quite working yet. They begin to communicate and the Plus / FreePPP gives me a success message, but the connection times out before it's fully established. I'm thinking / hoping that there are some nuances between the original guide's Linux pppd and OS X as well as the fact that I'm using a different approach. The following is some console output from pppd:

Code: Select all

Thu Nov 23 23:45:05 2017 : ipcp: returning Configure-ACK
Thu Nov 23 23:45:05 2017 : sent [IPCP ConfAck id=0xc <compress VJ 0f 01> <addr 192.168.2.245>]
Thu Nov 23 23:45:08 2017 : sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 192.168.2.244>]
Thu Nov 23 23:45:08 2017 : rcvd [IPCP ConfReq id=0xd <compress VJ 0f 01> <addr 192.168.2.245>]
Thu Nov 23 23:45:08 2017 : ipcp: returning Configure-ACK
Thu Nov 23 23:45:08 2017 : sent [IPCP ConfAck id=0xd <compress VJ 0f 01> <addr 192.168.2.245>]
Thu Nov 23 23:45:11 2017 : IPCP: timeout sending Config-Requests
Thu Nov 23 23:45:11 2017 : sent [LCP TermReq id=0x2 "No network protocols running"]
Thu Nov 23 23:45:11 2017 : Connection terminated.
If anyone would care to try, here are the steps, in order so far:
  • call socat as described above
    note the second ttys device's number
    start pce
    initiate the ppp connection on the emulated Mac
    initiate a yet to be determined pppd command on the OS X host that includes the tty generated from the socat output
The last two items could be interchangeable or I might have them backwards, but the "fake success" message was kind of neat to see, even it was a lie. Also, the guide I linked to about tun is going to be inactive until December because I apparently used up all my free Heroku time editing it. :-/
camateg
Space Cadet
Posts: 5
Joined: Wed Nov 22, 2017 5:23 am

Re: PCE/macplus emulator

Post by camateg »

mabam wrote:
camateg wrote:I was disappointed that DDP isn't supported in netatalk 3, but it makes sense.
You might want to have a look at A2Server (though I don't think it runs on FreeBSD).
Thanks for sharing that. It looks like a2server and a2cloud are customized Linux/ARM images that use netatalk 2.x, so that's a possibility. I just realized that FreeBSD 11.1 no longer supports AppleTalk in the kernel either. I ended up just throwing together an Ubuntu 16 VM on Virtual Box for now because my Raspberry Pi is missing.
User avatar
mabam
Master Emulator
Posts: 497
Joined: Wed Apr 10, 2013 9:32 am

Re: PCE/macplus emulator

Post by mabam »

A while ago I've written a guide for building an AppleTalk NAS based on a Banana Pi running Debian. Maybe there's some information in it that is useful to you (the A2Server website is a little outdated): https://www.emaculation.com/doku.php/ap ... os_and_osx
mdanh2002
Space Cadet
Posts: 8
Joined: Sat Feb 18, 2017 2:57 pm

Re: PCE/macplus emulator

Post by mdanh2002 »

See my latest article here http://www.toughdev.com/content/2018/12 ... -emulator/ that explains how CodeLite can be setup exactly for use with Retro68 and pce/macplus as a 68k development environment. Mac apps can be run on various emulators on different Macintosh System software just by changing the project configuration dropdown. CodeLite can also be configured to tail the serial port output file and this can used for debugging purposes. Autocomplete is also supported as well. The article also contains a YouTube demo video as well as the link to download the VirtualBox image with everything set up and ready for you to try out.
nsputnik
Student Driver
Posts: 23
Joined: Mon Apr 30, 2012 6:52 pm

Re: PCE/macplus emulator

Post by nsputnik »

This looks like a really neat project. I want to try to use it to connect to physical hardware via an FT232RL to use apps that communicate over the modem and printer ports, but I can't even figure out how to mount a floppy or hard disk image. I add a disk but name to the config file but it will not mount. The only thing I can do is delete the entry of the HD and then get the disk icon with the question mark.
nsputnik
Student Driver
Posts: 23
Joined: Mon Apr 30, 2012 6:52 pm

Re: PCE/macplus emulator

Post by nsputnik »

Could someone write installation instructions on the wiki for running on MacOS? Right now I can get it to work in Wine but I know it is possible to install it with Brew but the documentation is so lacking.
User avatar
adespoton
Forum All-Star
Posts: 4227
Joined: Fri Nov 27, 2009 5:11 am
Location: Emaculation.com
Contact:

Re: PCE/macplus emulator

Post by adespoton »

I totally forgot about this thread. If I find the time and nobody beats me to it, I'll try to put something together that can go on the Wiki (and get a thread stickied for PCE/macplus) :)

I've had success with PCE/macplus, PCE/classic and a few of the other configurations. It involved pulling a few resources from the Windows build and mixing them with the Mac binaries.
Post Reply