11 March 2016 - Forum Rules
Started by ShadowOne333, October 10, 2019, 12:04:03 PM
Quote from: 51mmz0rz on February 18, 2020, 01:44:18 AMSo I was talking about the inventory screen, but I didn't know what to call it. It looks like you mostly fixed it, but I'm still getting a little bit off gibberish on the bottom of the screen: This is playable though, so thank you!
Quote from: aml435 on February 22, 2020, 12:25:52 AMWith the new stage colors/bosses patched, the enemies show up glitched in Level-3.
Quote from: Trax on December 18, 2019, 09:50:08 PMSee you next year, ShadowOne, and hopefully in good shape.As for the secrets, whether they appear in Quest 1 or 2 or both, yes, there is a separate flag for each quest. The bits are in Screen Attributes Table 5. The byte structure is as follows:.... .xxx Vertical Position Out of Caves (0 = second row from top).... x... Enemies appear from the sides of the screen..xx .... Stairs Position Code (when something is pushed).x.. .... Secret in 1st Questx... .... Secret in 2nd QuestAll pointers for Attributes Tables (both quests) are right at the beginning of Bank 6, starting at 0x18000. See my docs for Bank 6.
Quote from: Trax on March 03, 2020, 11:02:36 PMI'd think the first solution would be too much overkill to be practical. The 6 tables in Bank 6 are ubiquitous, they are used everywhere in the code. Also, most of the time, the tables are referred to directly, not through pointers.The relevant code is around $16ABF, bank 5. I'll have to revise my docs because it's been some since I worked with Zelda 1, but I have a fairly good idea on how to proceed. From the original Tile Codes in Column Definitions, Codes E5 to EA represent a secret tile (wall, tree, Armos, etc.), which should either be replaced by its "found" equivalent (staircase for tree, cave for wall, etc.) if the secret has been found already, or to the same tile visually, but with a different Tile Code, to finally be processed and mached to its Tile Mappings. The table at $16976 does that. What we need to do is to check whether we are currently in Quest 1 or 2, compare it to the relevant bits in Screen Attributes Table 5, and if it matches, select an alternate Tile Code (wall with crack, for example) from a custom table. If it doesn't match, use the regular Tile Code.I will conjure some code and let you know if I can find a solution. Do we have unused Tile Codes for the 6 new Secret Tiles? Because if we don't, we have a problem.
Quote from: ShadowOne333As for your question, you mean unused tile space, as in unused tiles and their IDs?If that so, then I have already added the tiles. I think I am currently using tiles 54 (or was it 56?) and onwards for the secret caves cracked walls.They can be seen by patching a ROM with the Redux.ips from the GitHub page on the OP, inside the /output/ folder, then opening the PPU Viewer while on the Overworld.
Quote from: Trax on March 04, 2020, 09:04:35 PMWell, obviously, we'll need the tiles, as in 8x8 pixels tiles. But we need "tile definitions" as in 2x2 tiles TSAs. One for each secret you want to be different. I figure it would be walls, but maybe also trees that are a bit different? The table at $16976 reads like this:16976: C8 D8 C4 BC C0 C0 Table for Secret Tiles Codes (6 bytes)Codes E5 to EAC8 Pushable Rock (C8 C9 CA CB)D8 Bombable Wall (D8 D9 DA DB)C4 Burnable Tree (C4 C5 C6 C7)BC Pushable Tomb (BC BD BE BF)C0 Armos Statue (C0 C1 C2 C3)C0 Armos Statue (C0 C1 C2 C3)I guess there's 2 Armos entries because one type reveals a stairway and another reveals an item (Bracelet). We need as many Tile Codes as we have different tiles for these secrets. It really depends on how many secret tiles we want to have slight differences for a more reasonable secret hunt.
Quote from: ShadowOne333 on November 04, 2019, 11:31:48 AMI still haven't found the collision data for the cracked walls on the overworld.However, I did do some tests and found some interesting stuff:By changing the value at 0x16987 (D8):Values below $70 are walk-through$70-$73 (ladder tiles) makes it so that you enter the cave immediately without even needing to blow the tile up$86-$89 (cascade tiles) do make the wall solid$8A (and onwards) seem to be mostly solidSo it seems like the game does have what tile values do what in a hardcoded manner, since putting the ladder tiles automatically makes Link enter the cave without even bombing it.Now the thing is trying to find exacty what routine is in charge of defining what tiles are solid, which can be walked through, and which can be entered, and modify said routine (or add an exception) for tiles $54-$57.
Quote from: Trax on March 06, 2020, 12:24:11 AMI tamed the beast. Here's the code:Zelda 1Alternate Secret Tiles--------16AD0: BD 76A9 LDA $A976,XReplace with :16AD0: 20 90AC JSR $AC90----Alternate Secret Tile Codes Table16C80: C8 D8 C4 BC C0 C0Replace with any Tile Code needed----16C90: A4 EB LDY $EB ; Current Location16C92: B9 FE6A LDA $6AFE,Y ; Screen Attributes - Table 5 (VRAM)16C95: 30 0E BMI $q2 ; Bit 7 - 2nd Quest16C97: 0A ASL16C98: 30 02 BMI $q1 ; Bit 6 - 1st Quest16C9A: 10 10 BPL $normalTileq116C9C: A4 16 LDY $16 ; Selected Save Slot (0-2)16C9E: B9 2D06 LDA $062D,Y ; 2nd Quest Flag (0 = 1st Quest, 1 = 2nd Quest)16CA1: F0 0D BEQ $altTile16CA3: D0 07 BNE $normalTileq216CA5: A4 16 LDY $16 ; Selected Save Slot (0-2)16CA7: B9 2D06 LDA $062D,Y ; 2nd Quest Flag (0 = 1st Quest, 1 = 2nd Quest)16CAA: D0 04 BNE $altTilenormalTile16CAC: BD 76A9 LDA $A976,X16CAF: 60 RTS----altTile16CB0: BD 80AC LDA $AC80,X ; Alternate Secret Tile Codes Table16CB3: 60 RTS----Feel free to move the code around if necessary. It doesn't solve the problem of tile collision, obviously.
org $AC40 // $16C50 - Free space ldy.b $EB // Current Location lda.w $6AFE,y // Screen Attributes - Table 5 (VRAM) bmi quest2 // Bit 7 - 2nd Quest asl bmi quest1 // Bit 6 - 1st Quest bpl altTile
Quote from: Trax on March 06, 2020, 08:09:45 PMOh, good catch. For some reason, I thought that in order to have a secret available in both quests, you had to have both bits set to 1, and I coded with that in mind. But no such screen exists. So, the bits 6-7 should be labeled "1st/2nd Quest Only" in the docs. Having both bits set to 0 simply means the secret is always there. I wonder what quest takes precedence if someone decided to set both bits to 1...As for the tile collision, I'm still in the dark on that one. I have at least two theories, but we'll have to take a look at the routines that control Link's movements and comb the code to find out how a tile is set to "blocked", "staircase" or "walk-through". One theory is that it's done arbitrarily in the code, and check for specific tile ranges, and assign collision accordingly. My second hunch is that there's a small table somewhere in the ROM that represents the tile codes where the type changes. Like in Contra. If we assume Zelda 1 has only three types of collision, then this table could be as small as 2 bytes. For example, first byte defines the limit between walk-through and staircase, and the second byte defines the limit between staircase and blocked. Are there any other tile type?I'll let you know if I find something. In the meantime, something that could help is to document precisely the type of each tile, especially the places where the type changes.
Quote from: Tiles test$00-$6F = Walk-through tiles$70-$73 = Ladder tiles, behaves as normal ladder, makes you enter the cave directly without bombing the entrance$74-$87 = Walk-through tiles$88-$DB = Solid tiles$DC-$DF = Lower half walk-through, upper half solid$E0-$FF = Solid tiles
Quote from: ShadowOne333 on March 09, 2020, 12:17:04 PMI went ahead and redid my previous test with the tiles, so far this is what I found changing the tile value.I ended up going up by 4 bytes each time, beginning in $00 all the way up to $FC.If I go up byte by byte, then I'll get combinations of like half-solid/half-passable tiles for some, but if just one of the 4 tiles is walked-through but the other 3 solid, then it will all be counted as solid due to Link being too wide to fit in one 8x8 pixels tile, so I wanted to make it consistent by going up 4 bytes by 4 bytes on each test.If there's any other thing you need me to test, I'll gladly do so, even if I still have to go byte by byte to test the tile collisions.
Page created in 0.083 seconds with 19 queries.