cc65 / cc65

cc65 - a freeware C compiler for 6502 based systems
https://cc65.github.io
zlib License
2.31k stars 432 forks source link

No function to retrieve off-page directory entries #1355

Open xlar54 opened 3 years ago

xlar54 commented 3 years ago

Get1stDirEntry() and GetNxtDirEntry() do not take into account the offpad directory entries. I can work on this. Relevant documentation for

GetOffPageTrSc: (C64, C128) mid-level $9036

Function: Get track and sector of off-page directory.

Parameters: none.

Uses:

Returns:

Destroys: a, y, r5.

Description: Commodore GEOS disks have an extra directory block somewhere on the disk called the offpage directory. The GEOS deskTop uses the off-page directory block to keep track of file icons that have been dragged off of the notepad and onto the border area of the deskTop. The off-page directory holds up to eight directory entries. GetOffPageTrSc reads the directory header into the buffer at curDirHead and calls ChkDkGEOS to ensure that the disk is a GEOS disk. If the disk is not a GEOS disk, it returns with $ff in the y register. Otherwise, GetOffPageTrSc copies the off-page track/sector from the OFF_OP_TR_SC word in the directory header to r1 and returns $00 in y.

Example: ; Put off-page block into diskBlkBuf jsr GetOffPageTrSc ; get off-page directory block txa ; check for error bne 99$ ; tya ; check for GEOS disk tax ; put in x in case error bne 99$ ; LoadW r4,diskBlkBuf ; get off-page block jsr ; return with error in x 99$ rts

xlar54 commented 3 years ago

Ill just create a wrapper for this function. Would be nice to be able to include it in the GetXXXDirEntry() functions somehow, but probably better to keep it separate in the spirit of the library wrapping concept. Additionally it is only a C64/128 function and not Apple.

oliverschmidt commented 3 years ago

[...] but probably better to keep it separate in the spirit of the library wrapping concept.

From what I understand that's indeed my opinion.

I can work on this. [...] Ill just create a wrapper for this function.

Thanks in advance :-)

Additionally it is only a C64/128 function and not Apple.

Then it belongs to https://github.com/cc65/cc65/tree/master/libsrc/geos-cbm/disk.

And it should be added below https://github.com/cc65/cc65/blob/master/libsrc/geos-common/symbols.txt#L326

Do you have an idea what https://github.com/cc65/cc65/blob/master/libsrc/geos-cbm/diskdrv.inc#L35 means? It claims that 9036 is GetBorder. Afaik you have/want to change that line...

And finally you'll have to add a line to https://github.com/cc65/cc65/blob/master/include/geos/gdisk.h

xlar54 commented 3 years ago

Do you have an idea what https://github.com/cc65/cc65/blob/master/libsrc/geos-cbm/diskdrv.inc#L35 means? It claims that 9036 is GetBorder. Afaik you have/want to change that line...

Yeah the official name is GetOffPageTrSc. Will plan on updating that.

xlar54 commented 3 years ago

btw, not a comment in regards to this, but wanted you guys to know Ill be presenting this work along with some other things at the virtual world of commodore event: https://www.tpug.ca/world-of-commodore/world-of-commodore-2020/ I intend on showing how cc65 is used being used to create this application, so would definitely enjoy having any of you there for a callout.

oliverschmidt commented 3 years ago

https://www.tpug.ca/world-of-commodore/world-of-commodore-2020/

Cool, always great if people talk about cc65 :-)

oliverschmidt commented 3 years ago

And I forgot to mention that it should have its section in https://github.com/cc65/cc65/blob/master/doc/geos.sgml showing up in https://cc65.github.io/doc/geos.html#ss3.5.