Deja IIx: AppleWorks Classic on Mac OS X

Saturday, August 26, 2006

A Gentle Reminder

While the visual progress seems tremendous, this is in a very, very alpha state. Sometimes the visual progress can be deceptive. Folks that are joining on need to realize this fact.

Lots of things are bound not to work. I'm using someone else's 65c02 emulator, which seems to be doing a good job, there are are definitely bugs in it. I found a major one already that caused AW to crash. One of the tasks it to set up a way to log and track the issues that do come up to insure they aren't dropped.

Also a reminder. This is a (non-commercial) side project for me -- the time spent from this point forward will be just a few hours a week, maximum. As fun as it might be to focus all my time on it, it won't pay the bills. So progress will definitely slow from what you've seen recently, as my focus returns to "my day job", as it were.

Still, I do appreciate all the encouragement and I hope that progress will continue at a more slow, but steady pace.

This project allows me to experiment in coding areas as well as development techniques and ideas that I don't get a chance to explore with my existing projects -- which is one of the reasons I'm drawn to it.

Again, I do appreciate the support.

And if you want to tell more of your friends about TextSoap, I won't stop you.

Thursday, August 24, 2006

Fab Five

I've made a few more changes. See if you can spot the difference.

Deja IIx (Version 2.0a5)

Here's a hint:

Tuesday, August 22, 2006

Alpha x 4

I've posted an update that should address a bad display problem under Panther (the text was all garbled). This should no longer happen. I also added Debug preference to determine if Prodos OPEN is tracked. This can be useful when debugging the initial load sequence.

Deja IIx (Version 2.0a4)

Sunday, August 20, 2006

Moonbase Alpha

Well, here is your first chance to see Deja IIx for yourself. You can download the Alpha version at this link:

Deja IIx (version 2.0a1)

Be sure the read the notes that come with it. There are definitely issues that aren't addressed, but it does generally run and is completely OS X native.

My goal was to spend this week giving Deja IIx enough attention so that folks could start playing with it and most things worked.

While it won't get as much attention after this week, the issues left can be addressed in smaller chunks of time. So progress will slow down from the pace of this week, but it will continue.

Saturday, August 19, 2006

WE HAVE LIFTOFF!

After an attack of the most subtle bugs in the JMP (Addr,x) command, which AppleWorks happens to use, we have success. The emulator was calculating the address incorrectly and so the program kept crashing. This is more than just launching. It is running.



But it's not quite ready for prime time. There are a couple outstanding issues that I want to address before I let it out into the wild (even as an alpha).


  1. Uppercase Inverse text issue. This is related to the MouseText issue. The result is inverted uppercases in menus, etc.

  2. Cursor. The cursor is not blinking at all right now.

  3. Performance. I need to make some adjustments to make the program more usable and responsive to the user. Also, I want to reduce the CPU load when possible. This is especially true while waiting for the user to input text. The emulator is going full bore waiting for you to hit a key.

Friday, August 18, 2006

Keys, Keys everywhere and not a Key to press!

Keyboard handling is one of the last main pieces of code that I would like to get working this week. Unfortunately, it is not a straightforward process.

I'm hoping that some of the bits I've learned on that series of tubes known as the internet (thank goodness it didn't get clogged up) will help in most of cases. I definitely don't want to have to write m own USB keyboard driver! Regardless, the keyboard handling will have to be all new code.

I would also like to be able to put some throttling on the emulator so that it doesn't run at full speed (cpu cycles) while it waits for you to type something. Deja ][ could suck up 95% of the CPU cycles waiting for you to press a key. Even though the non-debug emulation will eventually be in a thread, it will still need to hang out in a less intense way when waiting for user input.

Some other key items of note:

  1. If anyone ever wrote a Mac plug-in, be warned that it will not work with Deja IIx. I am working on a more modern replacement of the plug-in design.

  2. MouseText isn't working quite right yet. Still tracking down the specifics on when it is supposed to be used when dealing with Assembly programs. I found the tech note when using BASIC though.

  3. Serial Port native commands will simply be ignored.



Finally, work on Deja IIx will slow down after this week. My focus returns to several ongoing projects that are designed to pay the bills. That's not to say it won't get attention. I'm hoping that it won't necessarily need as much attention.

AppleWorks Forever!

Deja IIx was choking on me right at the loading of AW.INITS. That seems extremely strange. I ran the original Deja ][, worked like a charm. OK, so it must be something in the creation of the prodos directory (the code is all new to use modern OS X routines). After looking at the same code over and over again (and walking the same piece of Apple II code that scans the directory) I finally spot the problem. The storage type of the entry is looked at. What was 0x10 originally was changed to 0x1 (very subtle indeed). Bingo!!

OK, the emulator was no longer choking, but it wasn't loading AW.INITs either (It was loading TimeOut code though). Hmm, very strange indeed. More coffee!! I need more coffee!! So I thought -- hey, I haven't run this on a PPC in a while (and theoretically it should just work). So I run it on the PPC machine and guess what, AW.INITs load up. The light bulb goes off!! There is a endian issue here (PPC stores words and longs in Big-Endian, Intel, and Apple IIs use Little-Endian). After more digging, I managed to find two very different byte swap issues dealing with the filetypes and auxtypes.

So I present to you, your first trip to the Main Menu:



Yes, inverse uppercase isn't drawing correctly (and keyboard input doesn't work yet), but we're going from launch to the Main Menu on Intel AND PPC. That's a lot of code that has to execute.

Speaking of execution. The emulation is running in debug mode, which basically checks various conditions with each instruction and uses a timer to execute on a regular basis. It does have internal loop that allows it to process a variable number of instructions with each "timer hit". I cranked this puppy up (from 50 to 5000) and BAM!, not even 0.5 seconds from launch to Main Menu. It was literally so fast that some of the startup screens (AW.INITS, TimeOut) weren't drawn before they were overwritten with the Main Menu. That was cool!!

Wednesday, August 16, 2006

Hey, I recognize you!

With the debugger generally working (in read-only mode, no writing), progress has continued. In fact, the pace has moved considerably. The debugger helped me track down some subtle changes in the emulation that affected native calls.

Reading a directory does not currently work. Keyboard events aren't handled. There are some performance issues with the screen display and the emulation. Lots of little things. Most of the bugs are now falling into the subtle category. Subtle changes with the emulation, native code handling, etc.

This screen shot is a sign of progress, not a declaration of success. There is plenty more left to do.

Tuesday, August 15, 2006

Da bug is in da house!

After a week at WWDC, I wasn't quite ready to dive into the latest and greatest technologies (my brain is still processing all that information), so I decided to spend a little time on Deja IIx. You can click to see the full-sized images.

For fun, I thought I would show off some pics of the Debugger, which is pretty much complete. The console shows disassembled code, memory dumps and such.



Breakpoints can be set on when the program counter, when a memory address is read or written to.



Trace History allows you to actually watch every change made while the CPU is running, each execution of an OPCODE includes the current registers, CPU status. You can literally watch as loops unfold and data is accessed.



With the completion of the Debugger, the next step is adding the 65c02 opcodes needed to continue emulation.

Finally, note the subtle change in name (you did catch it in the first paragraph, right?). Due to the pathname issue, I decided to go with Deja IIx instead of Deja //x.

Saturday, August 12, 2006

ProDOS Prefixes

One of the changes that I think needs to be introduced with Deja IIx is some additional prefix specifiers.

Currently, the APLWORKS.SYSTEM is set to most likely live at somethng like:
/Volumes/Users//Library/Application Support/Deja IIx/

As you can tell, that is a very, very log pathname -- and that's just the starting point. Obviously , we have already have a special specifier for this location "*/".

What this points out, however, is that files are likely to sit fairly deep in theĀ hierarchicalĀ file structure on your Mac drive. This gets more complicated when you take into account that ProDOS name limitations are a fraction of the Mac's.

So what to do. Well, I'm looking at adding additional special prefixes which can be set in the Mac environment. On the Mac side, these are always expanded out to their specified location, so matter where it sits on the hard drive.

So, you'll be able to specify a path with something like "#01/filename.awp" and it will read the "filename.awp" from the location specified for "#01/" which will reduce a 60-70 character path down to 4 characters. Not all the details are worked out, but it should help mitigate some of the Mac HFS+ <-> ProDOS path issues.

Friday, August 11, 2006

Our own Time Machine?

This week there was a lot of talk about Time Machine. Of course, we're doing our own variation of "time machine" with Deja IIx.

Unfortunately, while at WWDC, I had a hard drive mishap which wiped out my drive. I didn't lose any critical data (it is all sitting backuped up at home), but it left me without code to play with during the week. Such is life. As they say in the world of physics when talking about theoretical time machines, you can only travel back as far in time as when the time machine was created.

Before all my data was wiped, I did manage to find the compiler problem that kept causing weirdnesses with the endianness (are there enoungh ness's now?) with the emulator. And I managed to retain that info (it is a one line fix).

And theoretically, if all we saw at the Keynote is true, not only could Deja IIx due some fancy, very unnecessary graphical animations, but it could be a 64-bit app. Imagine your AppleWorks desktop reading 40GB of free space. Of course, I'm kidding - there is no benefit to the Deja IIx project to use 64-bit, but it is a big step for OS X (it is one of those things that requires a huge amount of engineering, is perfect for a relatively small group of people, but the majority won't notice any difference).