-
Notifications
You must be signed in to change notification settings - Fork 425
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
GEOSLib - CalcBlksFree issue #1318
Comments
this is such a hard one to categorize as any kind of defect.. geos uses all these zero page pseudo registers that you still kind of have to know a little about whats going on in these functions. I dunno.. if you guys decided to nix this one, it wouldnt bother me. |
At least from my POV it's the very purpose of the cc65 GEOS API wrappers to keep the C programmer from having to deal with (or in fact even know about) the GEOS pseudo registers. So if a wrapper only works with additional pseudo register access from C then at least I personally consider this a bug. |
yeah, i saw it that way too...back and forth. But if the team agrees, than so shall it be. Ill put together a PR and submit soon |
Fixed with 79bdc2d. |
Either the documentation isnt completely clear, or there is a bug in this function. According to the docs, calling GetDirHead() before calling this is all that is needed. But under my project, it continually returned an odd value.
Checking some other documentation, you must first set r5 to the address of curDirHead (which for CBM, is 0x8200). Upon doing this manually, the CalcBlksFree function returns the proper number of blocks free.
So instead of:
GetDirHead();
x = GetBlksFree();
it is:
GetDirHead();
r5 = 0x8200; // or constant curDirHead
x = GetBlksFree();
I didnt know if this was a documentation issue, or if a code issue. (or neither? Perhaps it is assumed that a geos developer would know this?) If a code issue, then adding:
LoadW r5, curDirHead (or ca65 equivalent)
...before the jsr to _CalcBlksFree should take care of it (in calcblksfree.s)
The text was updated successfully, but these errors were encountered: