Apple iiPod
From wikiPodLinux
I just finished up an acceptable first release of an Apple II emulator that will work in iPodLinux. The Apple II emulator is called Appleblossom. The iPodLinux version is called Apple iiPod.
Appleblossom Home Page (http://kreativekorp.cjb.net/apple2/appleblossom.html)
The file you're interested in is the ipl executable 'iiPod.' You can compile it from source from the Appleblossom folder with the command ./build.sh ipodlinux .
Appleblossom is my own open-source Apple II emulator. Initially I just wanted to port an Apple II emulator to iPodLinux, but while there are quite a few open-source emulators out there, most of the ones I found were hard to read, written in C++, tied to a specific platform, incomplete, or a combination of the four. So Appleblossom is my effort to create an Apple II emulator that is readable, portable, and as complete as I can make it.
Appleblossom currently emulates a typical 128K Apple IIe with 80-columns, Disk II, and hard drive. All graphics modes are supported. Sound is not. Provisions are in place for serial support, but the hardware is not implemented.
Appleblossom is open-source under GPL, so feel free to hack at it. If you have any useful changes, send them back to me and I'll see if I can fold them back in. Any help with the following would be greatly appreciated:
- Bug fixes and general improvements to emulation accuracy
- Faster Disk II support
- Sound support
- Serial ports
- Mockingboard, mouse card, Echo II, SmartPort, other peripheral cards
- Locating ROMs for the above
- X-Window interface
Building
You will need to copy, move, or symbolically link two directories to the if-ipodlinux directory, a build of microwindows/nano-X and a build of the libjpeg library (which microwindows apparently uses no matter what you're doing).
The directory structure should look like:
if-ipodlinux
build.sh
buildphoto.sh
buildx11.sh
font.c
ifvars.h
iipod.c
keyboard.c
libjpeg
ipod
ipod-x11
microwindows
ipod
ipod-x11
mini-x11
photo-x11
video.c
To compile iiPod for iPodLinux, execute the following command inside the Appleblossom directory:
./build.sh ipodlinux
This will generate the executable file 'iiPod' which you can copy to your iPod along with ROM files, disk images, etc.
To build for X11, execute one of the following:
./if-ipodlinux/buildx11.sh ./if-ipodlinux/buildphoto.sh
The first builds with a 4-gray, 160x128 screen, the second with a 16-bit, 220x176 screen. Both generate the executable 'iiPodX11' which will run on your host machine.
Running
In order to run Apple II software, Appleblossom needs images of the ROMs from actual Apple II hardware. All ROM files must reside in the same directory as the executable program. Other interfaces may use different directories or file names for these files, but the ones included use these names.
- APPLE2E.ROM - The Apple IIe's internal $C000-$FFFF ROM. This file is not supplied with the emulator, as the ROM is copyrighted software. It must be obtained through other means.
- DISK2.ROM - The Disk II controller's $C600 ROM. This file is not supplied with the emulator, as the ROM is copyrighted software. It must be obtained through other means.
- HDDRVR.ROM - The hard disk controller $C700 ROM. This file IS included, as it is an open-source driver originally written for the AppleWin emulator.
- SERIAL.ROM and SERIALX.ROM - The Super Serial Card's $Cx00 and $C800 ROMs, respectively. Used to emulate the serial ports. SERIAL.ROM is necessary for the Apple II to recognize the serial "card." SERIALX.ROM is only needed for compatibility with some programs that may use it; otherwise it is not required. I have actually been unable to locate these ROMs, so I couldn't include them even if I wanted to.
iiPod is currently hard-coded to use a 160x128 window, regardless of screen size. Graphics will display grayscaled on a B&W iPod, in color on an iPod photo.
All graphics modes are supported, with the following considerations:
- The "lo-res graphics with hi-res bit patterns" modes display like regular lo-res graphics. This is no big deal since I know of nothing which uses this mode as it's kinda useless anyway.
- In hi-res graphics modes, 3 out of every 8 rows are skipped to make the screen fit in 160x120 pixels. These are rows 1, 3, and 6 out of every 8 (rows 0, 2, 4, 5, and 7 are displayed).
- 80-column text is supported but since the characters are 2x5 pixels, they may appear unreadable, particularly with inverse text.
The command line arguments to iiPod are the same as the arguments to the ncurses interface for Appleblossom:
-d1 <file> loads .dsk or .nib disk image into slot 6 drive 1. -d2 <file> loads .dsk or .nib disk image into slot 6 drive 2. -d1do specifies DOS 3.3 order for drive 1. Must come after -d1. -d2do specifies DOS 3.3 order for drive 2. Must come after -d2. -d1po specifies ProDOS order for drive 1. Must come after -d1. -d2po specifies ProDOS order for drive 2. Must come after -d2. -d1n specifies nibble image for drive 1. Must come after -d1. -d2n specifies nibble image for drive 2. Must come after -d2. -h1 <file> loads .hdv disk image into slot 7 drive 1. -h2 <file> loads .hdv disk image into slot 7 drive 2. -s1 <file> connects a file to the Apple II's serial port in slot 1. -s2 <file> connects a file to the Apple II's serial port in slot 2.
The buttons are as follows: Rewind: Backspace, Forward: Space, Play: Ctrl-Reset, Menu: Exit, Wheel: Select Character, Center: Enter Character. The buttons will be configurable in a future release.
I VERY STRONGLY RECOMMEND that you only use ProDOS .hdv images with iiPod. Disk II emulation is hideously slow. A third-generation iPod running iiPod took about half an hour to boot DOS 3.3.
