Just a quick update. I haven't forgotten about this, just been a bit busy. Plus, I found another couple of bugs when I was play testing it recently. I noticed an issue related only to true tape images (.tap's). If you load one, it would work fine. But if you loaded another tape, then another and so on, with each successive tape, the emulator would take longer and longer to detect the game name during the initial loading sequence (ie. the part where you press the 'C=' key after the name appears). Eventually it could take up to 2 minutes to detect the game name. Slightly odd bug, but definitely an annoying one. I checked the v3.x.x releases and the bug wasn't present. So I looked at the v3 sources and discovered DelayedQuasar fixed this in v3.2.3. So I've used that fix in v2 and it works fine. I've credited him on the main screen.
The other bug I found was that the 'Restore' key didn't work at all on both the virtual keyboard and in button mapping in the 'Control' tab. I discovered this when I was playing Speed King. I always remember when I was a kid hitting the 'Restore' key to get back to main game screen when the demo was running, or I was a mile behind in a race. After nothing happened I tested 'POKE 792,226: POKE 793,252', which should trigger a CPU reset when the 'Restore' key is pressed. Again, this failed. It turns out this key has never worked in any of Akop's Vice PSP releases, and it also doesn't work in the v3.x.x PSP releases either as the bug got carried over. I'm guessing no-one noticed it and told Akop. Probably as it's not really a commonly used key, and it only works in certain situations. The 'Restore' key code looked absolutely fine in the Vice specific part of the source, but it just wouldn't trigger from the PSP virtual keyboard or being mapped to a button. I even added the 'Restore' key function to the Vice menu to test it. This worked, so I knew there was a bug somewhere specific to the virtual keyboard/button mapping on the PSP side of things. I eventually found the offending routine tagged onto the bottom of the PSP specific 'video.c' source file with a comment from Akop:
Code: Select all
if (CODE_MASK(code) == 0xff)
{
keyboard_set_keyarr(-3, 0, on); /* TODO: better */
return;
}
He used '0xff' as the key identifier for the virtual keyboard, and the same in control mapping: '0xf, 0xf, 8' ('8' being the key can be shifted or unshifted). The actual 'Restore' key is on a negative row (-3), and column '0', so everything looks good. The trouble is, this doesn't check that the 'Restore' key is actually pressed, so it never worked. I've modified this slightly and added a small routine after it so that it now checks for a simulated key press of the 'Restore' key. I've tested it working fine on the virtual keyboard and in button mapping (in a RunStop/Restore combo). Also tested it on Speed King and a couple of C64 keyboard checker programs. I'm not sure how many games actually make use of the 'Restore' key. I know Speed King, Cauldron II (some scene releases) and the premium version of Joe Gunn Gold use it to return to the main menu. Well at least we have it working now. I've also corrected some characters in button mapping in the 'Control' tab. The following characters were listed as the shifted versions instead of the non-shifted. '[', ']', '<', '>' and '?' are now correctly listed as ':', ';', ',', '.' and '/' respectively. I also removed some C128 specific code while I was at it.
I've made a new look virtual keyboard based on the 'Bread Bin' C64 colours. The keyboard is now opaque, so it's much easier to see. Also moved the keyboard flush to the bottom of the screen.
Disks, tapes and cartridges now ask if you want to 'eject/remove' rather than just doing it without a prompt when you press the 'triangle' button. This prevents accidental removal. I've also implemented a check if you try to remove a disk/tape/cartridge and there isn't one inserted.
I've changed the menu text in the 'Options' tab 'Show system indicators' to 'Show disk/tape indicators', plus it's explanation along the bottom of the screen from 'Show/hide system status indicators (LED's, etc...)' to 'Show/hide disk/tape activity icons (*true drive emulation/true tape images only)'. I did this as this is it's sole function and better explained. I also previously fixed this so the icons only work with true drive emulation and true tape images (.tap's) as they do not work correctly otherwise.
A couple of months back I added a few more external palettes, so there's now a choice of 20 palettes (19 external (including a 'user' palette), and the internal). Also fixed some various compiler warnings which came as a result of fixing the disk/tape image contents bug. I'll do a bit more play testing this week, but hopefully now this is done.