Igor Posted October 31, 2022 Share Posted October 31, 2022 Hi All, I'm stuck on a cart access issue with the current git version of CC65 and was wondering if anyone else was able to get cart access working. I have code like this... lseek(1, 0, SEEK_SET); read(1, &buffer[0], 1024*16); What seems to happen is that the first 1024 bytes are read ok, but then the remaining 15k is just junk. When I try to put this into a loop to read 1024 bytes 16 times into my buffer, it still gives me the same result as if I was trying to read all 16k in one go. I have __BLOCKSIZE__ set to 1024 in lynx.cfg Any ideas what's wrong or is there a different way to read cart memory starting at a particular offset and reading a number of bytes? Quote Link to comment Share on other sites More sharing options...
Igor Posted October 31, 2022 Author Share Posted October 31, 2022 Figured out the issue 😅 Looks like I didn't think and set the block sizes incorrectly... I had __BANK0BLOCKSIZE__ set to 2048 and __BLOCKSIZE__ set to 1024, which in retrospect should have been obvious! The git version seems to have not ported all of the code to use the correct symbols, which is a little annoying. SYMBOLS { __STACKSIZE__: type = export, value = 128; # stack size in bytes __STARTOFDIRECTORY__: type = export, value = 203; # start just after loader __BANK0BLOCKSIZE__: type = export, value = 2048; # Bank 0 cart block size (2048=512k ROM, 1024=256k ROM) __BANK1BLOCKSIZE__: type = export, value = 0; # Bank 1 block size __BLOCKSIZE__: type = export, value = 2048; # __BANK0BLOCKSIZE__; # backwards compatibility for older code __EXEHDRUSR__: type = import; # LNX file header, see lnxhdr.s to customise __BOOTLDR__: type = import; # Lynx boot loader __DEFDIR__: type = import; # Lynx file system directory } 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.