Points of Required Attention™
Friendly reminder: Please don't respond to spammers! Their posts inevitably get memory-holed when staff get around to, leaving behind an inexplicable tableau of you shouting at nothing and (if they otherwise would have been alone in a thread) dangling posts and wrong postcounts.
Views: 47,654,568
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 06-19-18 01:59 PM
Guest: Register | Login

0 users currently in ROM Hacking | 1 guest | 2 bots

Main - ROM Hacking - Zelda - The Legend of Link (v10-23-17) Released New thread | New reply

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52

infidelity
Posted on 02-28-18 12:15 AM (rev. 2 of 02-28-18 12:03 PM) Link | Quote | ID: 166245


Boo
Level: 61

Posts: 945/947
EXP: 1853355
Next: 23241

Since: 05-24-07

Last post: 85 days
Last view: 76 days
ExRAM is not battery backed. I use ExRAM for various functions.

The way I'm able to load the different roms, is by having code loaded into ExRAM that sets up the various banks for whichever game, so that when I'm in $5C00-$5FFF, I can swap out all of the NES's RAM, then I jump to the reset vector which then kicks on the selected rom.

Once within whichever game, I use the ExRAM for whatever I need it to. It's a main function for Super Mario Bros. 2 JPN, because I had to restore the missing PRG-RAM the game uses originally in the famicom.

The ExRAM also includes registers near the end of it, to determine if certain actions were performed by the user.

As for the header, yeah it's a mess. Both my mmc5 games only use 32kb sram. I use CHR-ROM because I swap out swaths of pages to perform animation.

Both All-Stars, & Legend of Link, use 1024kb for CHR-ROM. I'm dependant on mmc5's $5130 function, which allows me to determine which section through the entire CHR-ROM to load the graphics from.

Dracula X
Posted on 03-31-18 06:18 AM (rev. 2 of 03-31-18 05:09 PM) Link | Quote | ID: 166293


Red Paragoomba
Level: 16

Posts: 60/61
EXP: 18820
Next: 1436

Since: 03-11-14
From: Dracula's Castle

Last post: 79 days
Last view: 20 hours
Try this code to see if it will fix most of the problem:


ASL
PHA
ORA #$80
STA $5114
PLA
ORA #$80
STA $5115
ORA #$01
PHP ;replace PHA with PHP here.
STA $5114
PLP ;replace PLA with PLP here.
STA $5115
LDA #$80
STA $A001
RTS

NetSplit
Posted on 03-31-18 11:00 AM Link | Quote | ID: 166294


Level: 30

Posts: 177/178
EXP: 152639
Next: 13230

Since: 02-26-07

Last post: 79 days
Last view: 4 days
When you're doing a code dump on the forums, can you explain where in the ROM you intend the code to go and how the code is different from what you're replacing? Your code has no comments and little context, so even for technical people like myself, it's not clear what its purpose is supposed to be or if it's even at all correct.

Dracula X
Posted on 03-31-18 03:44 PM (rev. 4 of 03-31-18 05:11 PM) Link | Quote | ID: 166295


Red Paragoomba
Level: 16

Posts: 61/61
EXP: 18820
Next: 1436

Since: 03-11-14
From: Dracula's Castle

Last post: 79 days
Last view: 20 hours
This is a bankswitch bugfix. The code fixes some of the problems like if something happened in the original game but not the mapper converter hack that's because something was wrong with the original code. This code should fix some of the problems.

This code is for this ROM hack.

NetSplit
Posted on 04-01-18 12:21 AM (rev. 2 of 04-01-18 10:56 AM) Link | Quote | ID: 166297


Level: 30

Posts: 178/178
EXP: 152639
Next: 13230

Since: 02-26-07

Last post: 79 days
Last view: 4 days
Your update helped enough that I was able to look into this now, but I should probably be more specific about what I was looking for. In particular, things you should probably include when posting a block of code are what game it's for (we're talking about both SMB and Zelda here. Is it both?), what it is (bankswitching routine), where it's located ($FFAC in several banks for Zelda, or give the actual file address if relevant), what bug you're fixing, what's wrong with the original code, and what your fix does to solve that. I haven't been able to figure out the answers to those last 3 points yet.

This code looks pretty crazy to me in general, so I decided to look into it. First, I don't know what you think your change fixes, but it should have no effect. STA doesn't change processor flags, so there's no reason to PHP before and PLP after. Second, the pushes originally present in this function are all totally unnecessary. One can have a fully equivalent function without them:

ASL
; PHA
ORA #$80
STA $5114
; PLA
; ORA #$80
STA $5115
ORA #$01
; PHA
STA $5114
; PLA
STA $5115
LDA #$80
STA $A001
RTS


The register writes also seemed a little strange to me, so I looked up the MMC5 documentation. Looking at Legend of Link, this game runs in PRG mode 1 ($5100 == 1), which has two 16 KB banks. These are configured through registers $5115 (PRG bank 1) and $5117 (PRG bank 3). In mode 1, register $5114 is completely ignored, so there's no reason to be writing it in this function. These registers also only take one write, but this function writes to each twice, so the effect of the first write is lost. Finally, in mode 1, the lowest bit of the write is ignored, so there's no reason to be OR'ing by 1. That means this is a totally equivalent function:

ASL
ORA #$80
STA $5115
LDA #$80
STA $A001
RTS


Further still, I can't find any reference to a register $A001 in the documentation. I have no clue what this is intended to do, and removing the write to it doesn't seem to cause any noticeable problems in the emulators I've tried. This function should probably just be:

ASL
ORA #$80
STA $5115
RTS


All-Stars is probably similar, but could be more complex because the different games it has to run may have different requirements.


Edit: Assuming the value being passed in is always a constant, that constant could be changed to already be shifted left by 1 and OR'ed by #$80. Then the JSR to this function could be replaced with just the STA $5115. No need to call a bankswitch function at all.
Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52


Main - ROM Hacking - Zelda - The Legend of Link (v10-23-17) Released New thread | New reply

Acmlmboard 2.1+3δ (2016-01-08)
© 2005-2016 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.122 seconds. (346KB of memory used)
MySQL - queries: 46, rows: 72/0, time: 0.107 seconds.