I've got machine code that is loaded after a basic stub of 0 BANK0:SYS8209 that I ported from c64.
The first thing it does is try to read the directory, but whatever I've tried crashes in the call to OPEN ($0xffc0) & I have no idea why.
The code is basically the same as what is in c128 basic directory command & I've successfully run the same code on c16 & c128, I can't spot any relevant difference between c128 & c65 directory command. The c65 directory command works from a basic prompt.
I've tried various ways of paging the kernal back in, which often works for CHROUT ($ffd2) but fails when doing disk i/o
Currently I've stashed some code <$2000 that sets to kernal bank and calls the kernal and restores bank 0 afterwards.
I'm calling SETBANK ($ff6b) with A/X = 0 like when I call $ff68 on the c128.
I'm struggling to find examples whether it's even possible, most people seem to be writing a lot of their code in BASIC.
I'm using xemu (tried xmega65 & xc65) with rom V0.9B.911001, I don't know if the problem is caused by either of these.
Any help is greatly appreciated.