The beta version on the NES originally had keys on the interface screen that could be used in any dungeon. How difficult would it be to have it set up like Zelda 1 where keys can be used from other dungeons?

This was also the way in the release version of Zelda, NES, since you could also buy keys from the merchant.You surely do not want to have this feature in ALTTP; this would result in more chaos like play. The riddles are concepted that you need to explore all rooms to get all keys. If you can use keys from other dungeons (or even buy them) you loose a lot of fun.

The asm would be not as hard, just disable the safe/load to/from the specific dungeon reserved slots to one slot only.

Maximum is 9 keys - that is obvious if you look at the number of digits reserved for the keys in the hud..

The dungeon value is loaded into the x register and from there the specific sram address with 7ef3xxx,X loaded. You only need to replace the lda,X opcode with a normal one... but I guess you do not have the experience to that

The beta version on the NES originally had keys on the interface screen that could be used in any dungeon.

That's not happening in ALTTP. Every dungeon is defined and once you collect a key this goes to RAM and then SRAM - for every specific item (small key, big key, compass, map). Trying to make a small key usable in any dungeon would severely mess up things, specially SRAM, which basically would have a problem on how to save this before the key is used on a door.

Despite the fact that this could be done, it simply is not recommended to do, and also is not something that we would need.

What is the maximum key capacity?

9 small keys.

What is the hex code or do I need to rewrite the asm?

Another of them dislectic questions.Hex code for what? You don't rewrite the ASM, you write ASM and make a "hook" in the code to rather go to custom code. All your strange idas are basically ASM based, as you want to make "new" things, which the original game did not do.

Like said above - bad idea for the "neutral key". Increasing the capacity of 9 small keys to more than 9... Another bad idea, as the game can go to a bugged value of 0 or -1 instead of going to 10 small keys, similar to health if you put in a value above 20 heart containers. Further problem is HUD, which will not allow 2 digits for small keys.

A 2 digit key counter is probably doable, as was the 9999 for rupees, but like said, not recomended, as you would have to mess with the HUD. I believe Euclid once said he had tons of work to redo the HUD in PW. (Of course in PW the entire HUD was overhauled, which allowed for the rupee increase).

He could rewrite the ASM to read and write all of the normal key values to the same RAM address. It would probably break the vanilla version of the game but were someone to use it in a complete hack of the game it would be an interesting way to spice things up.

He could rewrite the ASM to read and write all of the normal key values to the same RAM address.

I would have to look into it, but I believe this is what the game is doing already.

This actually happens uppon entering. So cronologically it should be like this:enter dungeon, define dungeon, obtain key, goes to RAM, then save - goes to SRAM in the location meant for specific dungeon. The game then searches the SRAM for each key in each dungeon (since this is how the SRAM is made).

The RAM location for the small key of any other dungeon should be the same, but it saves in a different location. Since you see, you can not be in 2 dungeons at once. That's why this is working.

To use 1 small key in (for instance) 5 dungeons, would mean all 5 should be defined as same dungeon. Thus this is 1 dungeon with 5 entrances.

Having 1 small key working in 5 dungeons, while preserving big key, map, compass to not, sounds undoable, or at least some heavy programing needs to be done.

On the other hand a brand new small key should thus be programed (aside regular small keys) which would be able to work in all dungeons (and would look like the regular small key). And obviously such a key can not be obtained in any dungeon, but outside of it. I'm guessing this is how the NES version is doing it. Since basically you need a new SRAM location to tell the game how many of these "super" keys that work everywhere you have. But like said: not recomended.

You have the current key ram/sram address which is 7ef36f. Then you have one ram/sram slot for every of the 11? Dungeons. I do not know the exact locations, I'm on my mobile. It is documented e.g. in Mon's log. Let's say it is 7ef370-b. Then you enter a dungeon, say desert which has the index a.

The code upon entering is:Lda indexTaX (transfer index to X)Lda $7ef370, X (which then would be in this example 7ef37a)Sta $7ef36f (store to current key ram)

On leaving the dungeon, the opposite happens.

But discussing or even creating an asm is obsolete, since wizz will not be able to create a patch out of this information, and the patch itself is nonsense. Furthermore, you'll be able to collect theoretical more than 9 keys, which will bug, unless you do hud modifications.

Merging sewer with Hyrule castle keys is much easier, you only need to change the index of both having the same. But this can have side effects if e.g. the big key or whatever uses this same index table

Distilling down the previous answers into something short and sweet: yes, it is possible to do, however the side effects might be problematic. The issue of getting more than 9 would just need to be handled the same way as any other consumable with a max capacity, like hearts or rupees, picking up another one when you're full just wastes it. If the key is available for purchase in the shop, then it wouldn't be an issue because you can always buy another one.

However, this would require custom programming. If you come up with a compelling design that could utilize the idea, then maybe somebody might be willing to help out more, but unless there's some actual guarantee of it being useful, you're unlikely to convince somebody to do that work.