News:

11 March 2016 - Forum Rules

Main Menu

Bankswitching in UNROM

Started by Dracula X, August 26, 2016, 10:19:40 PM

Previous topic - Next topic

Dracula X

So I finally know how to bankswitch in UNROM but the tricky part is where to put the code in a new location. It could be reprogram the whole code or some. How I found out where to put the new code is to use the code/data/logger to find out where to put the code at that's highlited in "Dark-yellow - the byte is code" in Hex Viewer while the code is finished logging.
Back to Thunder Force II hacking again.

KingMike

So you know about the "bus conflicts" thing?
Where you must always write the ROM bank to a ROM address with the same value you want to write?
"My watch says 30 chickens" Google, 2018

Dracula X

Not yet but I'll give it a try!

I'm using this methood: http://wiki.nesdev.com/w/index.php/Programming_UNROM
I had the ROM expanded to 256kb.
Back to Thunder Force II hacking again.

KingMike

Yeah, typically games would do something like putting a list of bank numbers (00, 01, 02, etc.) at, say $C000.

Then a bankswap function would be like
(say A was the desired bank number)
TAY
LDA $C000,Y
STA $C000,Y
"My watch says 30 chickens" Google, 2018

Dracula X

OK! Now I understand how this works! I use Bus Conflict this time and now I know where to put the new code.

Example:


$9000 ; Bank 03
Test:
        lda #$07
        jsr bankswitch
------------------------------------------------------
$9005 ; Bank 07
newcode:
        ldy #51
        newcode2,y
------------------------------------------------------
.org $8000 ; Bank 07
newcode2:
        .byte $03,$03
------------------------------------------------------

That's it!

The code is from "The Guardian Legend".
Back to Thunder Force II hacking again.