Closed johnwayner closed 2 months ago
Ahhh it was removed in the big merge of stuff: https://github.com/MEGA65/mega65-rom/commit/8a3d24a9dc278cb6fd4413f4285d94376852088f
I found at least one other bug in that one (https://github.com/MEGA65/mega65-rom/pull/52). So maybe the docs aren't the bug, but the removed functionality in the ROM is the bug, @dansanderson ?
EDIT: This is strangely documented as such in the code (and the C64DX SYSTEM SPECIFICATION), but the code itself only works with "U0>"+CHR$(n):
* "U0>?"+chr$(n) ? = set device number 1571,1581,CBDOS *
I'm not really sure what the original intention was, but it does seem that the old way was implemented even by the original code -- even if they were trying to introduce a couple of new ways:
The DOS change was slightly before my time, so I don't have context on what was intended. Certainly that change's description does not imply that a feature would be removed. I'm also surprised by the "9" vs CHR$(9) thing, seems like most DOS commands accept drive and unit numbers as PETSCII.
The docs here are just trying to give an example of a disk command that isn't an explicit BASIC command, so perhaps the best fix for now is to either come up with another example or just remove this one. Separately we can figure out if CBDOS should be doing something differently. We recently noticed that when the Freezer changes the unit number assigned to a virtual drive, it's actually just poking a CBDOS variable, so a DOS command to do this should be feasible—and we should try to nail down that variable location in code so it doesn't accidentally move and break the Freezer feature (and/or get the Freezer to issue the DOS command instead of just poke a variable).
That discord link I provided is to a discussion about the freezer and locking down the variable location to $10113. That location is locked down already. Are you suggesting an explicit command (or maybe an option to an existing command) to change the device number? I'd like that. Perhaps part of MOUNT?
I'll close this PR as well.
I hadn't looked at the code yet to see whether poking the location is a robust enough API for the purposes of supporting the Freezer. If it looks good to you, then I'm satisfied. It sounds like, separately, there's potential and precedent for a CBDOS command that could perform this function, which isn't otherwise available to programs as far as I know. Sounds like a good feature request for the ROM!
Hmmm I wonder if this petscii numeric version was once supported? There's this snippet mentioned here: https://discord.com/channels/719326990221574164/791383472853614593/877489126113411093
that looks like it converts "9" -> $09. But none of this code is currently in dos.src.