Jump to content
Sign in to follow this  
sage

AUDIN - reality and emulators

Recommended Posts

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 ?

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Thanks, this confims what I saw/understood.

Do you confirm that AUDIN to use is bit 5 of IODAT and not AUDIN ?

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

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...

Share this post


Link to post
Share on other sites

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


 

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...