-
Notifications
You must be signed in to change notification settings - Fork 458
Fixed #1970 (Missing definition for ST on cbm610 with getdevice) #1972
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Please remove the name of other authors from those files (and put your own there instead, if you want) |
okie-dokie |
This "fix" is broken. It will make the code compile but not work. Please have a look at libsrc/cbm610/kreadst.s for enlightenment. To fix #1970, libsrc/cbm/getdevice.s has to be changed. It is not portable and will not work as is for the CBM-II machines. |
Indeed, I didn't take care of bank switching. |
Are you saying you didn't even bother testing your patch? /o\ |
A simple test will work. The code clears ST and later checks ST against zero. If - as in the given case - the variable ST is not the one used by the kernal, the code will always return "success". So if you test this with existing devices, it seems to work. |
Well, I was using BASIC which implies bank switching. I'll do better testing. |
No idea really. I also sometimes wish certain design decisions would have been documented :) |
ST is dead, long live the STATUS!
So is this working correctly now? :) |
The output of enumdevdir for c64 and cbm610 is not the same,
maybe this is a VICE issue?
|
Different how? :) And did you try with a single-drive (eg SFD)? The dual-drives may work slightly different. But yes, it could be a VICE issue. The cbm2 emulation isnt really tested well (nor are the tank drives) |
Thanks for fix. I can confirm it worked for me, in the sense that the error has gone away on link. Not sure where to ask this, but are getfirstdevice() and getnextdevice() and getdevicedir() expected to work on the cbm610 in VICE? I haven't come across any combination that works with drive 8 & 9 in VICE on this machine. The legacy cbm_xxxx functions do work for drive 9. |
First thing to do would be testing on the real thing :) Generally the cbm2 machines in VICE aren't very well tested, so i wouldn't be surprised if there is something wrong, especially with the disk drives. Does the same program work correctly in VICE when you compile it for the PET target and use it in xpet? |
Amen to testing on the real thing. Unfortunately, the last working b128 blew its PSU just this morning :( and that curtailed my testing. I haven't compiled for PET, but can try that and see what happens with xpet.
so... better? I mean, at least it starts with 8 and stops at 30? It does not actually recognize the disk in either drive, so that's not good. And the fact it can't be run again is also not good. |
That is normal for cc65 compiled programs though (at least on the CBM targets) - since they use the DATA section in-place. I always found it an odd design decision to even exit to basic for that matter. |
One more test, for c64 this time. Setup is similar: 2 d64s in device 8 and 9. I think it should be giving listing of drive 8, then go find drive 9, and list it out too. |
Do you have true drive emulation disabled or something like that? C64 emu should work :) |
Sorry, dumb: I don't really use the 64 emulator much. I hadn't enabled drive 9 in settings. With it enabled, I get: So I think that means it's just failing on line 38's chdir()? But having never played with chdir etc until this week, I'm not 100% sure what it's supposed to do. |
I'd expect chdir to be either a no-op (since CBM drives do not have subdirs) or to send a CMD style chdir DOS command (like open1,8,15,"cd:foo"), which should give a syntax error on drives that do not support it. |
Am I thinking about chdir() wrong? I thought it was the replacement for setting _curunit, which let you (I gather) say "I want to use posix disk commands now with device 9 (etc)"? Goodbye _curunit, Hello chdir() |
I wouldnt have expected it to work like this. I also find it VERY disturbing that setting _curunit isnt equivalent. sigh edit: ok at least the latter is not the case, the cbm function sets curunit. using chdir basically sets curunit and calls diskinit, which then sends DOS cmd "I" to find out if there is a disk in the drive. Which is .... questionable, unless you like machine gun rattling when there is no disk =P It should work though. I think. |
Been poking around a bit - and i wonder how/if this ever worked. The problem is that the call to getdevicedir() returns "80" instead of "08". |
Indeed! |
cbm/initcwd.s
this is the offending code. |
8ac5e2f fixes that code - please check if its now working correctly on cbm2 (it works for c64 with drive 8-11 in VICE now) |
Thank you fixing my 18 years old bug, finally enumdevdir works. |
yeah, perhaps it can be moved up before the branch. I'd try to get rid of the division call first though :) |
In any case, please check if this works on cbm2 machines now (i guess if it works in VICE thats enough of a proof) so i can merge this |
Right now it doesn't work, getfirstdevice() is broken. |
so fix it! :) |
I'd really like to merge this - is there a way to test only the things that this fixes? |
So whats the status of this now? |
So what is even a good test case for this? One of the sample programs? We should get this into the lib now :) |
@polluks ping? how can i test this? :) |
Also added cbm510 support.