March 7, 2012

First time real calc!

I've been hesitant, until now, to install Punix on a real calculator, but I have finally done so. Here is a photo of my first test on a real TI-92+:


I was pleasantly surprised that it booted and functioned very much as it does in TiEmu. The grayscale is very slightly flickery, but it's tolerable. However, there are a few differences or glitches:

  • Address error exceptions do not work. This exception works flawlessly in the emulator. All other exceptions work fine (eg, illegal instruction, division by zero, etc), so I have to figure out what's wrong with this one exception.
  • LCD does not shut off with ctrl- or alt-ON. A single dark blue or black row of pixels stays on the screen, every time in a different row. The screen also fades back in weird when I turn the calc back on. I probably just didn't write to the LCD register(s) properly.
  • Last, and perhaps the most worrisome difference, the clock speed is way off. A short timing indicates the calculator is about 33% too slow. The interrupt that should fire once per second (int 3) fires about 2 times in a 3-second period. The supposed 256-Hz (int 1) and programmable timer (int 5) also run proportionally slower, ie about 170 Hz and 5461 Hz (this should be 8192 Hz for audio). My batteries are fresh, and I'm fairly sure that I have a HW2 92+; Punix crashed badly in HW1 mode in TiEmu, so it'd probably crash on my real 92+ if it were HW1. Grayscale also wouldn't work correctly either.

This is a good start, but now I have a good sense of what needs to be fixed.

Update 2012-03-09: I have fixed all issues but the address error exception. Turns out I incorrectly wrote to the screen's hardware registers to shut it off, and the register that controls the OSC2 rate was set incorrectly. Grayscale is also less flickery as a result of fixing the rate, and audio output sounds just as good as it does in TiEmu (that is, like garbage :)).

March 6, 2012

Floating point, grayscale, scheduler, audio, and PS/2 keyboard?

While I haven't posted any updates lately, I've been working on Punix and occasionally posting my progress on the Cemetech forums.
I have also had family issues for the past few months now that have taken much of my free time.
Here's a summary of what I've done since last time:
  • M68881 FPU emulator is still under development, but a few instructions work well so far: fmove, fadd, fmul, fsub, fabs, and fneg. Execution speeds for fadd/fsub and fmul are faster than the equivalent operations in PedroM (which uses a slower BCD floating-point format to be compatible with TI-AMS).
  • Four-level grayscale! Currently only HW2 is supported, but that's probably more common than HW1 anyway. Text glyphs are also anti-aliased to take advantage of grayscale.
  • The scheduler has been tested quite thoroughly by now. I recently stress-tested it by running a few dozen busy processes at various "nice" levels, while also playing audio. Surprisingly, playing audio at the base nice level (zero) with 43 busy processes resulted in smooth, skip-free sound.
  • I'm playing with the idea of adding a PS/2 driver which will allow a user to plug a regular keyboard into the link port (with an appropriate adapter) and start typing away on it. This is a low-priority feature, but I'm the most excited about it at the moment.