X-Button-Secret of Parallel Worlds

Page 1 of 2 1, 2  Next

Go down

X-Button-Secret of Parallel Worlds Empty X-Button-Secret of Parallel Worlds

Post by XaserLE on Fri 5 Jul 2013 - 7:59

Because i couldn't find any resources on this trick but needed it for tests in my modified Gates of Darkness ROM, i wrote an own asm code for that this morning :-).
Pressing X and R together causes the BG2 (ZSNES, MathOnNapkins calls this BG1 in his Doc's) to disappear. Releasing the buttons enables BG2 (BG1). I made sure that it only works in dungeons. The normal function of the X button (view map) is disabled.

Here we go:


;this is for making BG2 disappear when pressing X and R together (parallel worlds x button secret), i use bank 0x3F for the whole code
;WRITTEN: by XaserLE
;THANKS TO: -MathOnNapkins' Zelda Doc's
; -wiiqwertyuiop for his Zelda Disassembly

; Layer Flags: xxxsabcd (i count BG from 1 to 4 - MathOnNapkins RAM-Map counts from 0 to 3)
; s - Sprite layer enabled
; a - (BG4 enabled)??
; b - BG3 enabled
; c - BG2 enabled
; d - (BG1 enabled)??


;header
lorom

ORG $0288FD ; go to the code that branches behin the dungeon map load if player didn't press X
BRA $1C ; make it always branch, so map isn't loaded anymore

ORG $068365 ; go to a originally JSL that is executed every frame
JSL $3FA600 ; overwrite it (originally JSL $099F91)

ORG $03FA600 ; go to expanded space to write our routine

LDA $1B ; load data that tells us whether we are in a building or not
AND #$01 ; are we in a building?
BEQ $12 ; if not, don't use the x-button-secret
LDA $F2 ; load unfiltered joypad 1 register (AXLR|????)
CMP #$50 ; X and R buttons pressed?
BNE $06 ; if not, go to enable BG2
LDA $1C ; load layer flags
AND #$FD ; disable BG2 (0xFD = 11111101)
BRA $04 ; go to store layer flags
LDA $1C ; load layer flags
ORA #$02 ; enable BG2 (0x02 = 00000010)
STA $1C ; store layer flags

JSL $099F91 ; at first execute original code

RTL

XaserLE

X-Button-Secret of Parallel Worlds Image111

Since : 2013-01-22

Back to top Go down

The author of this message was banned from the forum - See the message

X-Button-Secret of Parallel Worlds Empty Re: X-Button-Secret of Parallel Worlds

Post by XaserLE on Fri 5 Jul 2013 - 17:23

Yeah i knew. There is a funny story about that. Because in normal dungeons, nothing happens, when you press X+R, but something happens if you press X+L, i thought, X+L is the secret combination for a long time. And in rooms that make use of BG2, i used X+L and the only thing i saw was the object on BG2 that i can walk through. But it didn't look well, so i was a little disappointed. Making the Hard Optional Puzzle and getting the second mushroom in PW was really hard that way. And then i saw a Let's Play from someone who had the same problem. He played PW normal, than the second quest, all the time without realizing, that he is pressing the wrong buttons :-D. In the last two parts he said: "Possibly i have a corrupted ROM, the BG2 should disappear, not BG1" :-D :-D
It needed a while till i noticed that X+R is the right combination.

MathOnNapkins only calls it BG1 because he counts from 0-3, not 1-4 like ZNES.
I can implement the X+L secret too, if this is wanted :-)

XaserLE

X-Button-Secret of Parallel Worlds Image111

Since : 2013-01-22

Back to top Go down

The author of this message was banned from the forum - See the message

X-Button-Secret of Parallel Worlds Empty Re: X-Button-Secret of Parallel Worlds

Post by XaserLE on Fri 5 Jul 2013 - 18:58

This should be no problem. I am sure the slot for mirror is documented in MathOnNapkins RAM map and with this, it's only an LDA $MirrorSlot, CMP #$01, BNE $xx.
I take a look at this and reply if found it.

XaserLE

X-Button-Secret of Parallel Worlds Image111

Since : 2013-01-22

Back to top Go down

X-Button-Secret of Parallel Worlds Empty Re: X-Button-Secret of Parallel Worlds

Post by XaserLE on Fri 5 Jul 2013 - 19:10

Possibly, but therefore i need the slot that holds the actual item and the problem is, which items should be changed? Maybe save the last used item and toggle these two, but this were a lot more complicated i think.

XaserLE

X-Button-Secret of Parallel Worlds Image111

Since : 2013-01-22

Back to top Go down

X-Button-Secret of Parallel Worlds Empty Re: X-Button-Secret of Parallel Worlds

Post by XaserLE on Fri 5 Jul 2013 - 19:27

Long time i didn't mention that in PW all rooms have bg2 on top. I created a room in Gates of Darkness with this feature and that was quite hard. So it would be easier to make a synthesis between the asm and editing. The asm should contain in which rooms it work. This prevents graphical mistakes.

XaserLE

X-Button-Secret of Parallel Worlds Image111

Since : 2013-01-22

Back to top Go down

X-Button-Secret of Parallel Worlds Empty Re: X-Button-Secret of Parallel Worlds

Post by Euclid on Fri 5 Jul 2013 - 21:56

Item being currently assigned to Y is held in $202, so I'd increment that value to the next available item. You might be able to use the same code as the game does when you use the last bomb (it automatically switches to the next item)

I believe in PW the code to do the X+L/R trick is around $0288FD, can't give any docs from PW since apparently it was too easy to document lol.
Euclid
Euclid

X-Button-Secret of Parallel Worlds Image212

Since : 2012-06-21

Back to top Go down

X-Button-Secret of Parallel Worlds Empty Re: X-Button-Secret of Parallel Worlds

Post by XaserLE on Sat 6 Jul 2013 - 3:58

Thank you, really good advice, i will try this tomorrow :-).

"To easy to document" :-D

XaserLE

X-Button-Secret of Parallel Worlds Image111

Since : 2013-01-22

Back to top Go down

The author of this message was banned from the forum - See the message

X-Button-Secret of Parallel Worlds Empty Re: X-Button-Secret of Parallel Worlds

Post by XaserLE on Sun 7 Jul 2013 - 4:08

Oh no, to make it work in certain rooms is quite easy. The actual room you are is saved in a slot (like all other values of the game are), so there is only a little piece of code to paste and copy in the asm.

LDA $RoomSlot ;load actual room
CMP #$xx ;compare with room xx
BNE $.... ;go for next room test

and so on. If a room is equals one of them, you can exectute the code, otherwise return from the subroutine.

XaserLE

X-Button-Secret of Parallel Worlds Image111

Since : 2013-01-22

Back to top Go down

The author of this message was banned from the forum - See the message

X-Button-Secret of Parallel Worlds Empty Re: X-Button-Secret of Parallel Worlds

Post by XaserLE on Tue 9 Jul 2013 - 10:00

Do you want the X+L secret? I could try to figure out which bits must be set.

XaserLE

X-Button-Secret of Parallel Worlds Image111

Since : 2013-01-22

Back to top Go down

The author of this message was banned from the forum - See the message

X-Button-Secret of Parallel Worlds Empty Re: X-Button-Secret of Parallel Worlds

Post by XaserLE on Tue 9 Jul 2013 - 10:28

Ok i try to figure this out :-)

XaserLE

X-Button-Secret of Parallel Worlds Image111

Since : 2013-01-22

Back to top Go down

X-Button-Secret of Parallel Worlds Empty Re: X-Button-Secret of Parallel Worlds

Post by XaserLE on Tue 9 Jul 2013 - 12:57

I am not sure, i get strange results with bg1, but all others work fine, can't explain this. It seems that the bg1 bit is reversed. 1 if disabled, 0 if enabled or so.

Try this code, by pressing X+R, bg2 is disappears. On X+L i toggle the last bit that should control bg1 and see what happens. Not sure if this is a problem of my special room where i tested it, maybe this works with normal rooms:


;this is for making BG2 disappear when pressing X and R together (parallel worlds x button secret), i use bank 0x3F for the whole code
;WRITTEN: by XaserLE
;THANKS TO: -MathOnNapkins' Zelda Doc's
; -wiiqwertyuiop for his Zelda Disassembly

; Layer Flags: xxxsabcd (i count BG from 1 to 4 - MathOnNapkins RAM-Map counts from 0 to 3)
; s - Sprite layer enabled
; a - BG4 enabled
; b - BG3 enabled
; c - BG2 enabled
; d - BG1 disabled


;header
lorom

ORG $0288FD ; go to the code that branches behind the dungeon map load if player didn't press X
BRA $1C ; make it always branch, so map isn't loaded anymore

ORG $068365 ; go to an originally JSL that is executed every frame
JSL $3FA600 ; overwrite it (originally JSL $099F91)

ORG $03FA600 ; go to expanded space to write our routine

LDA $1B ; load data that tells us whether we are in a building or not
AND #$01 ; are we in a building?
BEQ $24 ; if not, don't use the x-button-secret
;BG1 disable on pressing X+L
LDA $F2 ; load unfiltered joypad 1 register (AXLR|????)
CMP #$60 ; X and L buttons pressed?
BNE $06 ; if not, go to enable BG1
LDA $1C ; load layer flags
ORA #$01 ; disable BG1 (0x01 = 00000001)
BRA $04 ; go to store layer flags
LDA $1C ; load layer flags
AND #$FE ; enable BG1 (0xFE = 11111110)
STA $1C ; store layer flags
;BG2 disable on pressing X+R
LDA $F2 ; load unfiltered joypad 1 register (AXLR|????)
CMP #$50 ; X and R buttons pressed?
BNE $06 ; if not, go to enable BG2
LDA $1C ; load layer flags
AND #$FD ; disable BG2 (0xFD = 11111101)
BRA $04 ; go to store layer flags
LDA $1C ; load layer flags
ORA #$02 ; enable BG2 (0x02 = 00000010)
STA $1C ; store layer flags

JSL $099F91 ; at least execute original code

RTL

XaserLE

X-Button-Secret of Parallel Worlds Image111

Since : 2013-01-22

Back to top Go down

The author of this message was banned from the forum - See the message

X-Button-Secret of Parallel Worlds Empty Re: X-Button-Secret of Parallel Worlds

Post by XaserLE on Tue 9 Jul 2013 - 16:08

I keep trying to make it work on bg1. Really strange.

XaserLE

X-Button-Secret of Parallel Worlds Image111

Since : 2013-01-22

Back to top Go down

The author of this message was banned from the forum - See the message

X-Button-Secret of Parallel Worlds Empty Re: X-Button-Secret of Parallel Worlds

Post by XaserLE on Tue 9 Jul 2013 - 17:05

You need to increase the first BEQ $12 to BEQ $1A cause you've added 8 Bytes of code.

XaserLE

X-Button-Secret of Parallel Worlds Image111

Since : 2013-01-22

Back to top Go down

The author of this message was banned from the forum - See the message

X-Button-Secret of Parallel Worlds Empty Re: X-Button-Secret of Parallel Worlds

Post by XaserLE on Tue 9 Jul 2013 - 17:18

Glad to see this works for you :-)

XaserLE

X-Button-Secret of Parallel Worlds Image111

Since : 2013-01-22

Back to top Go down

The author of this message was banned from the forum - See the message

X-Button-Secret of Parallel Worlds Empty Re: X-Button-Secret of Parallel Worlds

Post by XaserLE on Wed 10 Jul 2013 - 10:20

Yeah, it is only bitwise. I should change this $50 to a binary digit so everyone can see what happens.
The register is:
AXLR|????
0101|0000 for example means that only A and L are pressed. In Hex this is 0x50.

XaserLE

X-Button-Secret of Parallel Worlds Image111

Since : 2013-01-22

Back to top Go down

The author of this message was banned from the forum - See the message

Page 1 of 2 1, 2  Next

Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum