Fadest Posted May 1, 2020 Share Posted May 1, 2020 Generated the ROM with lynxdir1.91, the lyx bank2 is different, there is now a header and a directory structure. But values differs from directory in the 2 banks. Directory from bank1 seems to be accurate, if we consider bank 2 starts from block 0. Higher bit of offset is zeroed if file is in second bank (this is how to define if a file is in bank 0 or 1 I guess ?) So directory informations for a file should be read from bank0, and data from bank1 (this means switching AUDIN between reading of directory and data), right ? Quote Link to comment Share on other sites More sharing options...
sage Posted May 1, 2020 Author Share Posted May 1, 2020 The boot loader needs to be in both AUDIN switchable banks, as the power up state is undefined or better, differs between different lynx versions. Thus the first thing the bootloader code has to do is to bring the bit to a defined state. Where you put your directory is then up to you. I decided to have it in bank0 only, and switch AUDIN back and forth each time I access it. the bank is encoded in the upper bits of the offset as the block number is already using 8 bits. Quote Link to comment Share on other sites More sharing options...
Fadest Posted May 1, 2020 Share Posted May 1, 2020 Thanks, this confims what I saw/understood. Do you confirm that AUDIN to use is bit 5 of IODAT and not AUDIN ? Quote Link to comment Share on other sites More sharing options...
sage Posted May 1, 2020 Author Share Posted May 1, 2020 35 minutes ago, Fadest said: Thanks, this confims what I saw/understood. Do you confirm that AUDIN to use is bit 5 of IODAT and not AUDIN ? some old code i found. maybe this explains how i do it file_test.inc Quote Link to comment Share on other sites More sharing options...
Fadest Posted May 1, 2020 Share Posted May 1, 2020 You're not using the same method than me (I'm no expert in 6502 ASM, so I guess my code was not optimal), but basically, you set the bit with the same result I did. But whatever value I put in iodat, $FC8B,... with my code or your code (event with just trying to force read on second bank, without managing the directory information), it still reads from bank0. I feel stupid... I have probably spent more time on this problem than on some games prototype, and I get nothing... Quote Link to comment Share on other sites More sharing options...
sage Posted May 1, 2020 Author Share Posted May 1, 2020 i know that feeling Quote Link to comment Share on other sites More sharing options...
+karri Posted May 1, 2020 Share Posted May 1, 2020 I am not an expert here. But basically setting AUDIN is like: and #$10 ora #$b sta IODAT So the bit to set corresponds to the mask $10 Quote Link to comment Share on other sites More sharing options...
sage Posted May 1, 2020 Author Share Posted May 1, 2020 12 minutes ago, karri said: I am not an expert here. But basically setting AUDIN is like: and #$10 ora #$b sta IODAT So the bit to set corresponds to the mask $10 I think this is teh reason that not the register, but a shadow variable is set 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.