Apple II Emulator


I've been away from my Pandora for a long time, but have now gotten back to it.  I was running Zaxxon hot fix 6 and tried linapple 1.7.0.0, but it doesn't get recognized.  I upgraded y firmware to Super Zaxxon 1.60 and it still doesn't get recognized.  I put the pnd in my SD card's pandora/apps folder, along with many other pnds.  They all show up in minimenu and under xfce, except for linapple.  

Any ideas?

thanks,

Pete
 
Well, maybe this isn't a linapple issue.  Lineapple is not recognized for me on:

Zaxxon HF6

Super Zaxxon 1.60

Super Zaxxon 1.61

I just tried adding ScummVM, also to my SD card's pandora/apps folder, and it isn't recognized either.  It appears my pandora is only recognizing things I installed a long time ago, and nothing new.
 
Ironically, PNDManager doesn't get recognized either.  But I just tried installing Super Geometry Dust, and it was recognized just fine.

So, Linapple, ScummVM and PNDManager are not recognized, but Super Geometry Dust and everything I installed ages ago are. Hmmm.
 
i had that problem too... i did nit really find the root of the problem, but i ended in reflashing the pandora and creating clean pandora/menu pandora/apps and pandora/ desktop folders on my sd card. from that point it was working again.


i think the reason was some corrupted or so pnd, but i was too lazy too look deeper.
 
Well, I got it working.  Turns out I was using the lightweight2 web browser to download from the repo, and it wasn't downloading the entire file.  No errors, just incomplete files... multiple times.  Done with that piece of $#!* browser.

Anyway, linapple on Pandora rocks!  Thanks.
 
Hmmm... how do you type control characters into the emulator?  The Apple II had a control key, but the Pandora's select/ctrl key is mapped to toggle full speed mode.  Some games use control keys to switch between keyboard and joystick modes.  Lode Runner uses a bunch of control keys for different things.

Thanks,
Pete
 
Well, I got it working.  Turns out I was using the lightweight2 web browser to download from the repo, and it wasn't downloading the entire file.  No errors, just incomplete files... multiple times.  Done with that piece of $#!* browser.
Issues like this seem to pop up with all the browsers that don't get regular updates.  Right now it seems like the best working browsers are Qupzilla and Firefox, but Firefox tends to be slow on the Pandora (it always seems to work correctly though, so I always keep it ready).  Of course there is also elinks, which is dependable though not exactly full featured.
 
Hey, new poster here. I was trying to use the OpenPandora version of linapple and I found a few bugs:

  1. The config file claims setting the ASCII character for ABXYLR to 0 will disable any ASCII input from it. Unfortunately this is wrong. It actually sends an ASCII 0, aka NUL. This becomes 128 in the keyboard buffer because Apple reasons, and most software checks for a keypress by checking that the bufffer is >127. So if you want to use the buttons for open/closed apple keys (since those are the same as button 0 and 1 on Apple) you actually send Open-Apple-NUL. Some programs ignore the NUL and work fine, but others interpret it in funny ways. For example, MouseDesk interprets any ABXYLR as "Show 'About' box".
  2. If you enable the mouse and try to use it in fullscreen, it generally works, but goes absolutely nuts when you accidentally move the stylus outside the screen area. It generally flings the Apple mouse pointer to one corner, and then when you tap somewhere else with the stylus, the pointer appears at a position significantly offset from where you tapped. You can work around this by flinging the cursor back to the corner again, without going outside the screen, then moving the pointer back to where you want it, but it's finicky and you'll generally still end up with an offset of a few pixels.

Both these issues could be corrected at the source level, but I don't have an ARM dev kit handy to properly fix this myself. So, behold: Version 1.7.0.1, in which I creatively hacked in some workarounds to these problems without touching the C++ source at all.


For problem #1, I have changed the ABXYLR values from 0 to negative values. Weirdly, this still puts a value in the keyboard buffer, but it's a value less than 128, so programs don't detect it as an actual keypress. Open and closed apple now function in every program I've tried (but I haven't tried many).


For problem #2, I added 2 new icons to the desktop to manually switch the nubs between mouse and joystick mode. Just hit F6 to leave fullscreen and choose the mode you want. This way you can switch to whichever mode is appropriate for the programs you are running without needing to quit the emulator. Navigate to your game folder in MouseDesk with the mouse mode, then instantly change to Joystick mode for Sabotage! (It still starts up in Joystick mode as normal).


Also note that since mouse and sound card are mutually incompatible, this version doesn't have the sound card enabled. 


I've also enabled hard drives in Slot 7 (this is very confusing since by default the interface lets you select a hard drive image, but then you get a disk error if you try to use it).


Please test with all your favourite programs and give me some feedback. Thanks!


Alternate download link:  https://mega.nz/#!WhkShYia

View attachment linapple_1.1b-v1.7.0.1.pnd
 
Hah, I like your style, hacking away at the configs to workaround some issues. Cool stuff!
 
  • Like
Reactions: fx
Let me look into it - Shouldn't be hard to fix. I still have my VM Dev environment :)


Thanks for finding this!


Jerry
 
Last edited by a moderator:
  • Like
Reactions: fx
Thanks for the feedback so far. I noticed that my trick of using negative numbers has actually caused issues in some other programs. BUT!


Using 257 instead works correctly everywhere! Yay! I'm guessing some C programmer put in an upper bound check but not a lower one :)  


So if you want your open/closed apple to be 100% perfect, change the numbers in the config file for any button you don't want to input ASCII to 257.


New version coming soon.


One problem I am having, though: Since I have multiple applications in one package, and each has its own icon, the .desktop files created are using absolute paths to icon files which happen to be in the right place in my system, which means some of your icons might now work.


If I use the --icon option to pnd_make, it copies the icon to the proper place (/tmp/cache/icons or something, I forget) but then it assigns the same (apple logo) icon to all three desktop files. Is there a way around this? Can I use --icon more than once? Actually, lemme try that now. BRB.


ps Thanks for the comment Gunrock, that's definitely the kind of hacker I am. :)
 
Last edited by a moderator:
OK, new update, new version number!


So the catch-22 with icon files is that if you use an absolute path, you can't see the icon when the squashfs isn't mounted. If you use icon names, you can select from the available system icons, but there's no Apple icon there. So what I've done in the latest package is just used a generic floppy for the emulator.


The way it was done before was with the --icon flag to pnd_make, but if you do that, it appends one icon to the PND and ignores the icon settings in the file. So, all your programs inside the PND get the same icon. Obviously this won't do.


I also discovered after a few unfortunate segfaults that all files in the squashfs/unionfs need to be world writeable(!) or things go badly wrong. This is because the files are are all owned by root, but the program is actually running as your user, so you need to make sure these extremely insecure permissions are intact.


Is there a know workaround or solution to this? IMHO the files inside the squasfs/unionfs ought to be owned by the currently logged-in user and have appropriate permissions, 0644 or 0755 or whatever is most suited to the situation. Any user being able to write any file in the squasfs is a big security hole, and while this doesn't sound like a big deal for a game console, imagine a mischievous older sibling deleting their younger sib's Tetris highscore... tears would ensue.


Directories in /home should probably be mode 0700 too, to help discourage such tampering.


Anyway, the latest file is attached and here is an alternate download link in case the board borks: https://mega.nz/#!oURywByZ!qrLUiP0AxvuVRl7wD8GmvDkss5--dK5XaGFCLDmYfr8


If you want to return to the classic Apple icon, it's possible, just takes a few steps. I tried to automate it somehow so that the icon would install on its own but I never got it working. I think the fact that I had the permissions set the "right" way instead of the above "pandora" way when I was testing that feature were part of the problem. Sadly, I have to give the Pandora back now (it was only a loan) so I don't have more time to fix the automation.


Here's how to restore the apple icon manually:

  1. Start the Apple II program to make sure the squashfs is mounted.
  2. Hit fn-6 to take it out of fullscreen
  3. Open a terminal and type the following commands. Enter your password as necessary.

    sudo xdg-icon-resource install --size 32 /mnt/utmp/linapple/linapple-apple2.png
  4. sudo exo-desktop-item-edit ~/Desktop/linapple#0.desktop

[*]The first command should run silently, except for the password prompt.

[*]The second command will pop up a window where you can edit the properties of the desktop icon. Click on the floppy drive icon next to the word "Icon:"

[*]Drop down the "Select icon from:" menu and make sure "Applications" is selected.

[*]Scroll down until you find the linapple-apple2 icon. Click it. Click OK.

[*]Click Save.


Good luck! Please provide feedback, although I may not be able to do much until I buy my own Pandora. It's a great little unit! My only gripe is that the modifier key and certain punctuation key locations leave something to be desired from a programmer's perspective. To do any serious work on it you have to SSH into it. (I tried attaching a USB keyboard but it failed to enumerate. I have a BT keyboard but it's at home and I'm on vacation.)


View attachment linapple_1.1b-v1.7.0.2.pnd
 
Last edited by a moderator:
Beware plugging slow USB1 devices like keyboards and mice into the big USB port - thanks to a gotcha in the way USB chips work, that port only supports USB2 (so called 'full speed') devices natively.  But you can plug in a USB2 hub in between the keyboard and the socket, and that will work fine.


I've never actually built my own PND, but my understanding is the PND file's icon is that selected by the -i option, or by appending to the archive, while the ones used for menu items are the ones specified in the PXML.  The ones in the PXML are the most important, as that's the only way to run multiple apps from the same PND.
 
Beware plugging slow USB1 devices like keyboards and mice into the big USB port - thanks to a gotcha in the way USB chips work, that port only supports USB2 (so called 'full speed') devices natively.  But you can plug in a USB2 hub in between the keyboard and the socket, and that will work fine.

Yeah it's a  bit of a bummer how this works, alternately you could use the small OTG port for mouse and/or keyboard assuming it doesn't draw more than 100mA. I use this adapter to use a mouse in my Pandora travel kit: http://www.amazon.com/gp/product/B00JK1OFOM?psc=1&redirect=true&ref_=oh_aui_detailpage_o03_s00
 
Beware plugging slow USB1 devices like keyboards and mice into the big USB port - thanks to a gotcha in the way USB chips work, that port only supports USB2 (so called 'full speed') devices natively.  But you can plug in a USB2 hub in between the keyboard and the socket, and that will work fine.



If I'm not mistaken "Full Speed" is for USB 1 devices and "High Speed"  is USB 2 Devices.


-Neelix
 
Beware plugging slow USB1 devices like keyboards and mice into the big USB port - thanks to a gotcha in the way USB chips work, that port only supports USB2 (so called 'full speed') devices natively.  But you can plug in a USB2 hub in between the keyboard and the socket, and that will work fine.


I've never actually built my own PND, but my understanding is the PND file's icon is that selected by the -i option, or by appending to the archive, while the ones used for menu items are the ones specified in the PXML.  The ones in the PXML are the most important, as that's the only way to run multiple apps from the same PND.

I described how it worked in an earlier post already, and it's not exactly what you say.


Here's how it works if you have multiple programs inside a PND file:


If you use the -i flag or append the icon, every single desktop item from the PND gets that icon. All icon info inside the PXML is completely ignored.


If you use the PXML without the -i flag, you can specify different icons for different apps in the PXML and they will get used. However, there are only two ways to specify an icon inside the PXML (well, technically, inside the .desktop files automatically created by the PXML, but who's counting?):


1) as a name of an already-installed system icon


2) as a path to an image file on the filesystem.


To do #1 you have to install the apple logo as a system icon and then edit the .desktop file, which is what that list of instructions in my post #115 does. I was trying to figure out some hack to make #2 work, but since the squashfs isn't mounted until you run the PND, there's no way to extract the icon beforehand and have it display. 


My best idea was to have the script inside the squashfs tht runs when you click the icon check to see if the icon was installed and install it if not, so that you'd only get the generic icon the first time you ran the PND and get the proper logo ever after. I couldn't get that to work, due to permission issues I think. Sadly I don't have the OpenPandora any more so it's not getting fixed, at least not by me.
 
Back
Top