orthogon wrote:Thanks - it would take some patience to work out why the colours were different to a normal SAVE, and also why it doesn't seem to return of its own accord (even if it were saving all of ROM and RAM, you'd think it would finish eventually). I can't remember whether USR made any commitment about the contents of the registers on entry, but perhaps they were always the same.
I still love the idea that you could hope to understand every single thing about the ZX Spectrum right down to the hardware. Maybe Pfhorrest should get hold of one - it might help with the discussion over at "Functional".
From the ROM code, I think the blue is a fixed value, and the other colour is from whatever's in register C. Must normally be initialised to 6 (yellow) somewhere I guess?
To find out what C is when we call USR 1331, I suppose we can look at the USR function in that ROM disassembly; it's at 34B3. So, for it to call the address you've supplied, it puts it into BC, pushes that onto the stack and does a RET. That means that the value of C will be the lower byte of 1331, which is 33 hex - so the relevant lowest 3 colour bits will indeed be magenta!
[after lunch edit...]
Yes it does terminate after several minutes. And I think I'm right about the second colour effectively coming from the address you call. You can replace 1331 with 1333 or 1334 and get cyan or yellow. Marvellous
Emulator at http://jsspeccy.zxdemo.org/
Can you remember the keyboard layout?
ctrl+shift for extended mode, then L: "USR"