Megatron-uk
Experienced Member
Hey there,
I picked up a very clean PET 2001N-32 a couple of weeks ago from an electronics disposal (it was bound for the trash!)... And it has turned out to be perfectly working.
Anyway, I thought I'd had a go writing something for it, so have turned to CC65 which is working reasonably well (testing so far on VICE as I'm lacking any tape, disk or sd card reader yet).
I have a main binary/prg running, linked from several objects and pet.lib... one thing I'm trying to do is limit memory use by storing long strings, data etc in external files and loading only when needed... So I've had to turn to the cbm_k_* functions (which I think I am starting to get my head around - though I've not successfully managed to read any data yet!).
Anyway, my main question is how to define the device you open using cbm_k_setlfs... In VICE the d64 image I have my compiled app.prg on is loaded at 8,1... But if my application runs from somewhere else, how can I know where it is running from and adjust the device and drive numbers to suit the location of where the accompanying datafiles are? Hardcoding device numbers feels wrong.
Are there any kernal calls or CC65 wrappers to return the equivalent of 'current device number'?
I picked up a very clean PET 2001N-32 a couple of weeks ago from an electronics disposal (it was bound for the trash!)... And it has turned out to be perfectly working.
Anyway, I thought I'd had a go writing something for it, so have turned to CC65 which is working reasonably well (testing so far on VICE as I'm lacking any tape, disk or sd card reader yet).
I have a main binary/prg running, linked from several objects and pet.lib... one thing I'm trying to do is limit memory use by storing long strings, data etc in external files and loading only when needed... So I've had to turn to the cbm_k_* functions (which I think I am starting to get my head around - though I've not successfully managed to read any data yet!).
Anyway, my main question is how to define the device you open using cbm_k_setlfs... In VICE the d64 image I have my compiled app.prg on is loaded at 8,1... But if my application runs from somewhere else, how can I know where it is running from and adjust the device and drive numbers to suit the location of where the accompanying datafiles are? Hardcoding device numbers feels wrong.
Are there any kernal calls or CC65 wrappers to return the equivalent of 'current device number'?