Mouse & Shared folder

About Qemu-system-ppc, a PPC Mac emulator for Windows, macOS and Linux that can run Mac OS 9.0 up to Mac OS X 10.5

Moderators: Cat_7, Ronald P. Regensburg

marciot42
Inquisitive Elf
Posts: 39
Joined: Wed Feb 26, 2014 2:21 pm

Re: Mouse & Shared folder

Post by marciot42 »

mabam wrote: Sun Jan 02, 2022 1:36 pm The icon shows when the extensions are loaded during boot. It does not appear in the System Extensions folder though, there “USB Tablet INIT” shows a blank icon as before.
In order for the icon to show up on the desktop, you need to set a unique creator for the file, then add a BNDL, FREF, and creator resource to the file, as described in the "Using the Finder Interface" chapter of Inside Macintosh Toolbox Essentials.
marciot42
Inquisitive Elf
Posts: 39
Joined: Wed Feb 26, 2014 2:21 pm

Re: Mouse & Shared folder

Post by marciot42 »

It doesn't seem like I can attach files here, but I was able to get the desktop icon to show up by making the following changes in ResEdit:

- Created a new BNDL resource (I did this in the INIT, but it should be done in the resource used for the build)
- Set the Signature field to USBT
- Selected "Create New File Type"
- Typed "INIT" in the "Type" field
- Double clicked the icons and selected the appropriate icon family
- Optional: Edit the newly created "USBT" resource using "Open using Template" for "STR " and type in the version info. This will show up under the Get Info box in the Finder.
- Selected "Get Info for USB Table Init"
- Checked "Has BNDL" (this might be an option in the compiler IDE, under build settings, so you don't need to manually change it every time)
- Copied the file to a new disk so the Finder would update the icon (alternatively, you could rebuild the desktop on the disk by holding Command and Option at startup)
kanjitalk755
Apple Corer
Posts: 213
Joined: Thu Nov 09, 2017 12:06 pm

Re: Mouse & Shared folder

Post by kanjitalk755 »

Thank you for the detailed explanation :smile:
I completely forgot about the BNDL resource :oops:

I have released a new version.
User avatar
mabam
Master Emulator
Posts: 459
Joined: Wed Apr 10, 2013 9:32 am

Re: Mouse & Shared folder

Post by mabam »

Works as advertised. Thank you again!
User avatar
mabam
Master Emulator
Posts: 459
Joined: Wed Apr 10, 2013 9:32 am

Re: Mouse & Shared folder

Post by mabam »

mabam wrote: Sat Jan 01, 2022 10:52 pm I’ve created an icon for the INIT. Find “USB Tablet INIT icon.zip” at https://c.web.de/@337526389169198226/Yi ... XaxP0sxWmw and extract it. It contains the resources icl4, icl8, ICN#, icns, ics#, ics4, and ics8.

As the icon is now integrated to kanjitalk755’s GitHub repository, I’ve deleted it from the above link.
mcayland
Granny Smith
Posts: 131
Joined: Sun Nov 01, 2015 10:33 pm

Re: Mouse & Shared folder

Post by mcayland »

adespoton wrote: Fri Dec 17, 2021 12:41 am Mark, on item two, is there any interest in adding video breakout code to qemu-m68k like Mini vMac and BII use? It allows the actual emulator to be content with shared RAM/VRAM but support a real screen of arbitrary size and depth. A bit outside what qemu usually supports though.
The QEMU generic framebuffer code quite happily supports arbitrary VRAM and screen sizes/depth - the issue is how to communicate the settings from MacOS to the emulator. Currently this is done by analysing the writes done to the display control registers by MacOS when changing screen size/depth using the in-built driver as on a real Q800. Hence why QEMU is (currently) limited to these resolutions.

If you want more flexibility then you'll need to write a corresponding MacOS driver and emulated framebuffer hardware: probably the best way to do this is to define a custom Nubus framebuffer card and Declaration ROM which allows plenty of space for larger framebuffers, up to 256M if the Nubus super-slot area is used.

Alas my TODO list is getting longer all the time so it is unlikely I will get around to this in the short term, but I am certainly willing to advise on the QEMU side for other people who are interested enough to work on this.
elliotnunn
Student Driver
Posts: 15
Joined: Sun Sep 11, 2016 6:35 am

Re: Mouse & Shared folder

Post by elliotnunn »

I have refactored kanjitalk's excellent USB Tablet INIT into a command line argument to QEMU.

When this is added to your QEMU command line, absolute mouse positioning works without installing an INIT. Right click is emulated as control-click.

Code: Select all

-device usb-tablet -prom-env 'use-nvramrc?=true' -prom-env nvramrc=\
': b64 do 0 4 0 do 6 lshift i j + c@ 2e - dup b > 7 and - dup 25 > 6 and - or'\
' loop 3 0 do dup c, 8 rshift loop drop 4 +loop ; variable lzd variable lzi :'\
' lzp c@ dup c, lzd @ lzi @ + c! lzi @ 1+ fff and lzi ! ; : lz lzd ! fee lzi '\
'! 1 -rot do dup 1 = if drop i c@ 100 + 1 else dup 2 / swap 1 and if i lzp 1 '\
'else i 1+ c@ i c@ over f0 and 4 lshift + swap f and -3 do dup lzd @ + lzp 1+'\
' fff and loop drop 2 then then +loop drop ; 20 parse PofzQ03tNaNZRr1z.4Bk.E.'\
'.YfHbwDfo.kU/oU6.zk2/.E.K5ik2.6.6.U4fA.YJ4EEuQD1v.E8b0FI1Y.I/YD1v.EHvT.A/dU6'\
'6cTyzYDHz0../6TyICv1zzzz.TzxwgrUPbUj.MDwsC4FWpOu.MzwwG5BpZE..ETy.U/E.fU6.Thx'\
'wULUP.4mSzk.AU2/.C.k.zTxU.7PCM1VUClU..81L.7MM.Ne/zk6tTkk.dUCdzmAtCTzzzzw6zkW'\
'Ab.2..E.7zk/0UTXz2..zzk.tDG3tPoc6zsa2T.E..2.2zs7.YzXz0U11zmCFU/6.e.KUjuCEY.E'\
'.e.JUU.4m..5z6HVMT3...kXjQviaU2s.68g..Di/.NiE.0gAx5tA.kY.U2ua2GY29jHh6.ET0k2'\
'/zlUV/ME5M.k/zos4gG9t/6HwDqM/j0.4ua.W3UE/Nu66TV./.F2QN.3bPD1uwDd0138A2EI/3A2'\
'0./2BW/HR...G.E22zk3YG.38.2M.zqt7QaJoMq3azolZ.47dRqJCzrFEFk/mIbFZ5rBZQbJj.KJ'\
'Xzys0NUw..UgG7nts.Eog6/d24i039JcU1ogWZW2OmEA./KNU..0uPV2azo20RiXxUu.2vDzW4zk'\
't.CMUEXgM9/k/..bzUXg.Clk..Q7zUY2AhWU..JwU.C.s.9s06A61hYGJkU6UhaUU6R2UGDZciU/'\
'5B2U.zDxXb5nzT0sM9VaT.Dfyc1XoTk2.yqzXjt/s.E5..NeR6COqunh2SnQUq05k6DJu6jbN.Dy'\
'EAE6M5t5zamk.D.0z6CPu.de35..TjlmEU/k.2./z21.K.mnr.DY.WAU..DySzcU/W.A..Dxy5cY'\
'0I.E.FDxYc8.iIG.AFDw5682iT06A8Tz2FrrKJBN7Wzz4GpLyT/s6KvzAU73sXWU6zmkk0607U7b'\
'Djws6./u6acY.0k/gB.1r6/cj.6/xJTwoThZgqE/IejdykU..E4.U1.0O61ajZc..lUU.zk.k.G0'\
'NcHVmvXU..1/WP6.s.4A.JDwoThZX.4AsJ8w/DUFXtE0KWE4O.1tz63I.kfo54DwU.64/P8.s31w'\
'.24BU0v..ATd.CdavG19Qw6EorvkUT0sUyG4z.A6X.flxtcUlYk..zn.5.ByHTtAUfmE..Dyk.7M'\
'o.deV..g/2/dc2VtUYW0P/5MZCQ1vU00vzDzWnDyEW/k..U0YdzqMMU.fGynz8Tvz6Ms7G/.KE/.'\
'O7V2St2YIE/x4ei.G2Y/DHw9Q2Y1WHxfc6FBM6FAVUazc.Ek0.E1s6a.k..Vr6/cYr.2Yzp2UG..'\
'X.Ms/zWU1Um.PRE22N47n.c5T7kM2.k7b8Dw0FJ25J3JBMjxV.GAO.c...Ty02EU0A020Ulw2C.6'\
'//4QkPUIKaWVR2RoIV.3ba0.OAm.Pk6VE466P40IVgmcY3AtI2Ocb2HQ.pYo.rUcIrkAIU.F0L2M'\
'1.E2UZM1h.I6.I/fezqxEFLFnPaJqzk/oEZBJQaJHtqZqQqJX5V5nOINUNDxiS4JCOJ/oNTpkEq2'\
'RNatjlqRdNL7p5FPe2CdVjqJG.4FVNKVIF4.SOL9zQaJqQqJ2QaDzR5/dPaxdM3uyMKl1N5Bnzp/'\
'XNrJgF4tdrrBdR43kI4VXNKlEI/vy3k...CFHvugV.4R.6/dMIDq6.1g.6/dj.E16 over + swa'\
'p here >r 2000 allot here >r b64 here r> here r@ here! lz here r> tuck - dev'\
' / " pef,AAPL,MacOS,PowerPC,prepare" property " Tab" encode-string " code,AA'\
'PL,MacOS,name" property'
User avatar
Cat_7
Expert User
Posts: 5690
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Mouse & Shared folder

Post by Cat_7 »

Hi Elliot,

Lovely, I just tried this on Linux host. I'm not sure, but Windows host might not be able to parse the command line.

I can´t seem to get the mouse to move in Mac OS 9.2. The driver does something as the mouse moves out of the Qemu window without first releasing it.
Mac OS 10.3 seems to work. Would you care to share the rest of your command line?

Best,
Cat_7
elliotnunn
Student Driver
Posts: 15
Joined: Sun Sep 11, 2016 6:35 am

Re: Mouse & Shared folder

Post by elliotnunn »

Excluding the drive arguments, my command line is otherwise "qemu-system-ppc -L pc-bios -M mac99 -m 512 -boot c"

Did you ensure that the line preceding "-device usb-tablet" ended with a backslash? And did you ensure that no whitespace was added at the start of any of the lines?

If you are still having trouble, then please send me a copy of your QEMU script in full.

BTW, I have just posted a new version to the GitHub page that removes a delay from the cursor redrawing.

EDIT: typo that inverted the meaning of a sentence
elliotnunn
Student Driver
Posts: 15
Joined: Sun Sep 11, 2016 6:35 am

Re: Mouse & Shared folder

Post by elliotnunn »

Oh dear! I have identified an unfortunate incompatibility with the USB Device Extension, which I removed for my testing. I will fix it ASAP. In the meantime, removing all "USB" extensions might make things work for you.
User avatar
Cat_7
Expert User
Posts: 5690
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Mouse & Shared folder

Post by Cat_7 »

Hi,

Once you fixed that incompatibility is there any chance this could be converted into an ndrv ?

Best,
Cat_7
elliotnunn
Student Driver
Posts: 15
Joined: Sun Sep 11, 2016 6:35 am

Re: Mouse & Shared folder

Post by elliotnunn »

Fixed: https://github.com/elliotnunn/macos9-usb-tablet

(Don't use the code that I posted here a few days ago.)

A Mac OS USB driver (type usbd) has a different structure and runtime environment from an ndrv. But if you want to know whether the driver can be installed via a device tree property – yes, it can!

The problem requires code to run before USB comes up, and install a driver for the USB Expert to use later in the boot process. Details in DevTreeLoader.c.
User avatar
Cat_7
Expert User
Posts: 5690
Joined: Fri Feb 13, 2004 8:59 am
Location: Sittard, The Netherlands

Re: Mouse & Shared folder

Post by Cat_7 »

Hi,

Thanks, that new code does indeed work with Mac OS 9.1 and 9.2 when running -M mac99, so when the tablet is the only USB device.
Adding an additional USB device such as -device usb-kbd will hang boot.

Mac OS 9.0 has always had issues with more than one usb device. It seems the order in which usb devices are added to the command line determines which one will initially work ;-)
Moreover, there are issues with OHCI when e.g. passing through usb devices from the host. Particularly when multiple endpoints need to be active. Qemu only supports one active endpoint per device

Best,
Cat_7
Post Reply