Login  •  Register


The time is now: Tue Jul 23, 2019 4:48 am

Emaculation wiki  •  Delete all board cookies



Post new topic  Reply to topic Page 1 of 1 [ 20 posts ]
Print view Previous topic  |  Next topic
Author Message
 Post subject: PCE/macplus emulator
PostPosted: Thu Apr 06, 2017 4:10 am 
Offline
Space Cadet

Joined: Sat Feb 18, 2017 2:57 pm
Posts: 8
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. :)


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: PCE/macplus emulator
PostPosted: Thu Apr 06, 2017 6:12 am 
Offline
Expert User
User avatar

Joined: Fri Feb 13, 2004 8:59 am
Posts: 4610
Location: Sittard, The Netherlands
Hi,

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

Best,
Cat_7


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: PCE/macplus emulator
PostPosted: Thu Apr 06, 2017 9:08 am 
Offline
Space Cadet

Joined: Sat Feb 18, 2017 2:57 pm
Posts: 8
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.


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: PCE/macplus emulator
PostPosted: Thu Apr 06, 2017 4:15 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2645
Location: Emaculation.com
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.


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: PCE/macplus emulator
PostPosted: Sat Apr 08, 2017 3:22 am 
Offline
Site Admin
User avatar

Joined: Mon May 20, 2002 4:37 am
Posts: 3721
Location: Uiwang
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


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: PCE/macplus emulator
PostPosted: Sat Apr 08, 2017 4:31 am 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2645
Location: Emaculation.com
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?


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: PCE/macplus emulator
PostPosted: Sat Apr 08, 2017 12:50 pm 
Offline
Space Cadet

Joined: Sat Feb 18, 2017 2:57 pm
Posts: 8
@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.


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: PCE/macplus emulator
PostPosted: Sun Apr 09, 2017 10:26 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2645
Location: Emaculation.com
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?


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: PCE/macplus emulator
PostPosted: Mon Apr 10, 2017 11:19 am 
Offline
Site Admin
User avatar

Joined: Mon May 20, 2002 4:37 am
Posts: 3721
Location: Uiwang
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.


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: PCE/macplus emulator
PostPosted: Tue Apr 11, 2017 9:59 am 
Offline
Space Cadet

Joined: Sat Feb 18, 2017 2:57 pm
Posts: 8
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.


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: PCE/macplus emulator
PostPosted: Thu Nov 23, 2017 4:02 am 
Offline
Space Cadet

Joined: Wed Nov 22, 2017 5:23 am
Posts: 5
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:
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:
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:
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.


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: PCE/macplus emulator
PostPosted: Thu Nov 23, 2017 6:09 am 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2645
Location: Emaculation.com
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.


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: PCE/macplus emulator
PostPosted: Thu Nov 23, 2017 1:53 pm 
Offline
Space Cadet

Joined: Wed Nov 22, 2017 5:23 am
Posts: 5
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...


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: PCE/macplus emulator
PostPosted: Thu Nov 23, 2017 10:33 pm 
Offline
Forum All-Star
User avatar

Joined: Fri Nov 27, 2009 5:11 am
Posts: 2645
Location: Emaculation.com
/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.


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: PCE/macplus emulator
PostPosted: Fri Nov 24, 2017 12:38 am 
Offline
Space Cadet

Joined: Wed Nov 22, 2017 5:23 am
Posts: 5
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.


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: PCE/macplus emulator
PostPosted: Fri Nov 24, 2017 1:46 am 
Offline
Apple Corer
User avatar

Joined: Wed Apr 10, 2013 9:32 am
Posts: 271
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).


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: PCE/macplus emulator
PostPosted: Fri Nov 24, 2017 5:01 am 
Offline
Space Cadet

Joined: Wed Nov 22, 2017 5:23 am
Posts: 5
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:
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:
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. :-/


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: PCE/macplus emulator
PostPosted: Fri Nov 24, 2017 9:42 pm 
Offline
Space Cadet

Joined: Wed Nov 22, 2017 5:23 am
Posts: 5
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.


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: PCE/macplus emulator
PostPosted: Sat Nov 25, 2017 2:23 am 
Offline
Apple Corer
User avatar

Joined: Wed Apr 10, 2013 9:32 am
Posts: 271
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


Top
 Profile  
Reply with quote Post a reply  
 Post subject: Re: PCE/macplus emulator
PostPosted: Fri Jun 14, 2019 2:36 pm 
Offline
Space Cadet

Joined: Sat Feb 18, 2017 2:57 pm
Posts: 8
See my latest article here http://www.toughdev.com/content/2018/12/developing-68k-mac-apps-with-codelite-ide-retro68-and-pce-macplus-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.


Top
 Profile  
Reply with quote Post a reply  
Display posts from previous:  Sort by  
Post new topic  Reply to topic Page 1 of 1 [ 20 posts ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
 

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group