The Marvelous Multi-tile!

Bucket Mouse

Active member
During the development of Pandora's Blocks I set out to create a new type of tile. The reason being I needed specific things to happen on specific screens. The easiest way to introduce custom code into NESMaker is through a tile, but you only get a handful of extra tiles, and wasting an entire tile (or two) just for one screen....it wasn't ideal for the kind of cutscenes I dreamed of making.

I needed a Multi-tile. You step on it, it cycles through a list of commands. "If you're on X screen, make this happen, if not, ignore this.....now if you're on Y screen, make THIS happen, if not, ignore this....now if you're on Z screen...."

The crucial thing I needed, the missing piece of the puzzle, was a way to specifically name the screens where certain things were to happen. What was the variable that stored the specific screen address when you were at it? What are specific screens CALLED? I had no idea.

After some experimentation, the variable newScreen seemed to work. This is part of what I wrote for the first few screens of action:

Code:
	LDA #$03
    CMP newScreen
    BNE trainstop1
	
    ChangeObjectState #$03, #$02
	JSR autotext
	JMP dontdoanything
	
		trainstop1:
	LDA #$04
	CMP newScreen
    BNE trainstop2
	
		LDX player1_object
	DeactivateCurrentObject
	;	LDA Object_x_hi,x
	;STA temp
	;LDA Object_y_hi,x
	;STA temp1
	;CreateObject temp, temp1, #$11, #$00, currentNametable
	;padLoop:
	;	LDA gamepad
	 ;   AND #%00000010
	;	BEQ padLoop
	  ;  INC padPound
	;	LDA #$20
	;	CMP padPound
	;	BEQ autotext
	;JMP padLoop
	
		trainstop2:
	LDA #$05
	CMP newScreen
    BNE trainstop3
"Trainstop" was my way of dealing with the annoying, extremely limited amount of space you have to branch something before it goes "out of range." It has the "range" of a Radio Shack walkie-talkie from 1983.

You can see a lot of commented-out material here. Originally, when Pandora slept, she would only wake after the player pressed random NES buttons exactly twenty times. I could not figure out how to get the ASM to sense more than one button at a time so the abandoned version you see up above looked for B. But even this didn't work, and I had zero time to mess around any further, so I just faked it by putting the sleep animation on a timer. Then her sprite had to change from a horizontal sprite to a vertical one, which is impossible in NESMaker natively. So the timer had to be an invisible monster sprite traveling across the screen until it hit a special tile that would erase that sprite and put the new one in its place.

newScreen worked for a few screens, but then with no explanation it did not work for the later ones. I had to quickly add a new variable called screenNumber, add a tally per screen load, and put it in the place where newScreen was. This fix would only work for the kind of "game" I was making. If I wanted cutscenes like this in an actual game that had open-world roaming, I would have to find the magic variable that named each screen.

After Pandora's Blocks was done, I had the time again to search. The macro for "GoToScreen" provided a BIG hint:

Code:
MACRO GoToScreen arg0, arg1, arg2
	; arg 0 = screen to warp to.
	; arg 1 = map
	; arg 2 = transition type

What was argument zero, usually? In almost every instance of GoToScreen, it's warpToScreen.

Code:
GoToScreen warpToScreen, temp, #$02

"Temp" is either #$01 or #$02 depending on if you're in the overworld or the underworld map.

I tested out my theory by replacing warpToScreen with a specific number. I quickly built something on the twentieth screen in the grid and commanded a tile to do this from another screen:

Code:
GoToScreen #$20, #$01, #$02

it went someplace completely random. I thought "maybe the screen names are in hex." But $13 didn't work either.

Fortunately I was nearly there. My next lark was to just enter a hex number with the regular number symbols in front of it. Obviously wrong and against the rules, but it....worked??

Code:
GoToScreen #$13, #$01, #$02

I don't get it either. But as far as I can tell, writing the hex number for the specific screen in the grid, AS A NUMBER, is the correct name for that screen. Shrug.
I've now come to realize newScreen, currentScreen and warpToScreen all essentially hold the same value and any of them would have worked, if I had just known about the hex thing before.

So this is the Multi-tile. VERY UNTESTED at this time, so use with caution. If you find quirks and bugs I don't, maybe you can help by ironing them out.

Code:
LDA currentScreen
    CMP #$01 ;; or whatever screen you want stuff to happen on...MUST BE IN HEX!!
    BNE trainstop1
    
    ;; enter your screen-specific shenanigans here
    
    trainstop1:
    LDA currentScreen
    CMP #$02 ;; or whatever screen you want stuff to happen on
    BNE trainstop2
    ; and on and on like this....

It might not even have to be a tile. Conceivably this could go in HandleScreenLoads, but i wouldn't know where. Dale might.

Keep in mind if you end up making the same commands for five screens or more, you might be better served creating an actual TILE for it, rather than repeating yourself. This is best used for limited actions.
But I'm psyched that I figured this out. An entire world of possibilities just opened up.
 

Bucket Mouse

Active member
TolerantX said:
Is there a way to have a trigger for every overworld screen, but not any underworld screen?

That one's rather simple, assuming we can find the variable that tells you which type of screen you're on.
After some searching I think it's update_screen_details....this is listed in System Variables:
; update_screen_details .dsb 1
; ;;10 = screen type, 00 = special, 01 = map1, 02 = map2

So you would put this before anything you wanted to only happen on the overworld....

Code:
LDA update_screen_details
CMP #$01
BNE +

And for the underworld, that number would be #$02.
 

Bucket Mouse

Active member
The basic concept, sure. What I've done here can be done to pretty much anything; I just posted a script that can play different sounds depending on which screen you're on:
http://www.nesmakers.com/viewtopic.php?f=40&t=5567
 

Pauldalyjr

Active member
I don't think people realize how powerful this tile is, you can literally have hundreds of different tile types. I made a code that covers the entire overworld(have not tested with underworld) with the exception of the far right column (column 16), I cannot figure out how to access that, the screen count starts at #$01 not #$00. This works in 4.5.6

Code:
;;Original concept for this was from Bucket Mouse
;
;Screen Layout Example, screens start at 01 not 00 f. just replace ";;do stuff" with what you want that screen to do.
;
;  ___________________________________________________________________________________________
;  |  01 |  02 |  03 |  04 |  05 |  06 |  07 |  08 |  09 |  0A |  0B |  0C |  0D |  0E |  0F |  
;  ___________________________________________________________________________________________
;  |  11 |  12 |  13 |  14 |  15 |  16 |  17 |  18 |  19 |  1A |  1B |  1C |  1D |  1E |  1F |
;  ___________________________________________________________________________________________
;  |  21 |  22 |  23 |  24 |  25 |  26 |  27 |  28 |  29 |  2A |  2B |  2C |  2D |  2E |  2F | 
;  /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
;  |  E1 |  E2 |  E3 |  E4 |  E5 |  E6 |  E7 |  E8 |  E9 |  EA |  EB |  EC |  ED |  EE |  EF |  
;  ___________________________________________________________________________________________
;  |  F1 |  F2 |  F3 |  F4 |  F5 |  F6 |  F7 |  F8 |  F9 |  FA |  FB |  FC |  FD |  FE |  FF |
;  ___________________________________________________________________________________________


LDA screenType

;;;;;;;;;;;;;;;;;;;;
;;;;;;; ROW ONE
;;;;;;;;;;;;;;;;;;;;

	CMP #$01
	BNE notScreenOne
		;;do stuff
		JMP doneWithMultiTile
	notScreenOne

	CMP #$02
	BNE notScreenTwo
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwo

	CMP #$03
	BNE notScreenThree
		;;do stuff
		JMP doneWithMultiTile
	notScreenThree

	CMP #$04
	BNE notScreenFour
		;;do stuff
		JMP doneWithMultiTile
	notScreenFour

	CMP #$05
	BNE notScreenFive
		;;do stuff
		JMP doneWithMultiTile
	notScreenFive

	CMP #$06
	BNE notScreenSix
		;;do stuff
		JMP doneWithMultiTile
	notScreenSix

	CMP #$07
	BNE notScreenSeven
		;;do stuff
		JMP doneWithMultiTile
	notScreenSeven

	CMP #$08
	BNE notScreenEight
		;;do stuff
		JMP doneWithMultiTile
	notScreenEight

	CMP #$09
	BNE notScreenNine
		;;do stuff
		JMP doneWithMultiTile
	notScreenNine

	CMP #$0A
	BNE notScreenTen
		;;do stuff
		JMP doneWithMultiTile
	notScreenTen

	CMP #$0B
	BNE notScreenEleven
		;;do stuff
		JMP doneWithMultiTile
	notScreenEleven

	CMP #$0C
	BNE notScreenTwelve
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwelve

	CMP #$0D
	BNE notScreenThirteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenThirteen

	CMP #$0E
	BNE notScreenFourteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourteen

	CMP #$0F
	BNE notScreenFifteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenFifteen

;;;;;;;;;;;;;;;;;;;;
;;;;;;; ROW TWO
;;;;;;;;;;;;;;;;;;;;

	CMP #$11
	BNE notScreenOneOne
		;;do stuff
		JMP doneWithMultiTile
	notScreenOneOne

	CMP #$12
	BNE notScreenOneTwo
		;;do stuff
		JMP doneWithMultiTile
	notScreenOneTwo

	CMP #$13
	BNE notScreenOneThree
		;;do stuff
		JMP doneWithMultiTile
	notScreenOneThree

	CMP #$14
	BNE notScreenOneFour
		;;do stuff
		JMP doneWithMultiTile
	notScreenOneFour

	CMP #$15
	BNE notScreenOneFive
		;;do stuff
		JMP doneWithMultiTile
	notScreenOneFive

	CMP #$16
	BNE notScreenOneSix
		;;do stuff
		JMP doneWithMultiTile
	notScreenOneSix

	CMP #$17
	BNE notScreenOneSeven
		;;do stuff
		JMP doneWithMultiTile
	notScreenOneSeven

	CMP #$18
	BNE notScreenOneEight
		;;do stuff
		JMP doneWithMultiTile
	notScreenOneEight

	CMP #$19
	BNE notScreenOneNine
		;;do stuff
		JMP doneWithMultiTile
	notScreenOneNine

	CMP #$1A
	BNE notScreenOneTen
		;;do stuff
		JMP doneWithMultiTile
	notScreenOneTen

	CMP #$1B
	BNE notScreenOneEleven
		;;do stuff
		JMP doneWithMultiTile
	notScreenOneEleven

	CMP #$1C
	BNE notScreenOneTwelve
		;;do stuff
		JMP doneWithMultiTile
	notScreenOneTwelve

	CMP #$1D
	BNE notScreenOneThirteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenOneThirteen

	CMP #$1E
	BNE notScreenOneFourteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenOneFourteen

	CMP #$1F
	BNE notScreenOneFifteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenOneFifteen

;;;;;;;;;;;;;;;;;;;;
;;;;;;; ROW THREE
;;;;;;;;;;;;;;;;;;;;

	CMP #$21
	BNE notScreenTwoOne
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwoOne

	CMP #$22
	BNE notScreenTwoTwo
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwoTwo

	CMP #$23
	BNE notScreenTwoThree
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwoThree

	CMP #$24
	BNE notScreenTwoFour
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwoFour

	CMP #$25
	BNE notScreenTwoFive
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwoFive

	CMP #$26
	BNE notScreenTwoSix
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwoSix

	CMP #$27
	BNE notScreenTwoSeven
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwoSeven

	CMP #$28
	BNE notScreenTwoEight
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwoEight

	CMP #$29
	BNE notScreenTwoNine
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwoNine

	CMP #$2A
	BNE notScreenTwoTen
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwoTen

	CMP #$2B
	BNE notScreenTwoEleven
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwoEleven

	CMP #$2C
	BNE notScreenTwoTwelve
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwoTwelve

	CMP #$2D
	BNE notScreenTwoThirteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwoThirteen

	CMP #$2E
	BNE notScreenTwoFourteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwoFourteen

	CMP #$2F
	BNE notScreenTwoFifteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwoFifteen

;;;;;;;;;;;;;;;;;;;;
;;;;;;; ROW FOUR
;;;;;;;;;;;;;;;;;;;;

	CMP #$31
	BNE notScreenThreeOne
		;;do stuff
		JMP doneWithMultiTile
	notScreenThreeOne

	CMP #$32
	BNE notScreenThreeTwo
		;;do stuff
		JMP doneWithMultiTile
	notScreenThreeTwo

	CMP #$33
	BNE notScreenThreeThree
		;;do stuff
		JMP doneWithMultiTile
	notScreenThreeThree

	CMP #$34
	BNE notScreenThreeFour
		;;do stuff
		JMP doneWithMultiTile
	notScreenThreeFour

	CMP #$35
	BNE notScreenThreeFive
		;;do stuff
		JMP doneWithMultiTile
	notScreenThreeFive

	CMP #$36
	BNE notScreenThreeSix
		;;do stuff
		JMP doneWithMultiTile
	notScreenThreeSix

	CMP #$37
	BNE notScreenThreeSeven
		;;do stuff
		JMP doneWithMultiTile
	notScreenThreeSeven

	CMP #$38
	BNE notScreenThreeEight
		;;do stuff
		JMP doneWithMultiTile
	notScreenThreeEight

	CMP #$39
	BNE notScreenThreeNine
		;;do stuff
		JMP doneWithMultiTile
	notScreenThreeNine

	CMP #$3A
	BNE notScreenThreeTen
		;;do stuff
		JMP doneWithMultiTile
	notScreenThreeTen

	CMP #$3B
	BNE notScreenThreeEleven  ;; good band
		;;do stuff
		JMP doneWithMultiTile
	notScreenThreeEleven

	CMP #$3C
	BNE notScreenThreeTwelve
		;;do stuff
		JMP doneWithMultiTile
	notScreenThreeTwelve

	CMP #$3D
	BNE notScreenThreeThirteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenThreeThirteen

	CMP #$3E
	BNE notScreenThreeFourteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenThreeFourteen

	CMP #$3F
	BNE notScreenThreeFifteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenThreeFifteen

;;;;;;;;;;;;;;;;;;;;
;;;;;;; ROW FIVE
;;;;;;;;;;;;;;;;;;;;

	CMP #$41
	BNE notScreenFourOne
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourOne

	CMP #$42
	BNE notScreenFourTwo
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourTwo

	CMP #$43
	BNE notScreenFourThree
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourThree

	CMP #$44
	BNE notScreenFourFour
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourFour

	CMP #$45
	BNE notScreenFourFive
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourFive

	CMP #$46
	BNE notScreenFourSix
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourSix

	CMP #$47
	BNE notScreenFourSeven
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourSeven

	CMP #$48
	BNE notScreenFourEight
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourEight

	CMP #$49
	BNE notScreenFourNine
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourNine

	CMP #$4A
	BNE notScreenFourTen
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourTen

	CMP #$4B
	BNE notScreenFourEleven
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourEleven

	CMP #$4C
	BNE notScreenFourTwelve
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourTwelve

	CMP #$4D
	BNE notScreenFourThirteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourThirteen

	CMP #$4E
	BNE notScreenFourFourteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourFourteen

	CMP #$4F
	BNE notScreenFourFifteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourFifteen

;;;;;;;;;;;;;;;;;;;;
;;;;;;; ROW SIX
;;;;;;;;;;;;;;;;;;;;

	CMP #$51
	BNE notScreenFiveOne
		;;do stuff
		JMP doneWithMultiTile
	notScreenFiveOne

	CMP #$52
	BNE notScreenFiveTwo
		;;do stuff
		JMP doneWithMultiTile
	notScreenFiveTwo

	CMP #$53
	BNE notScreenFiveThree
		;;do stuff
		JMP doneWithMultiTile
	notScreenFiveThree

	CMP #$54
	BNE notScreenFiveFour
		;;do stuff
		JMP doneWithMultiTile
	notScreenFiveFour

	CMP #$55
	BNE notScreenFiveFive
		;;do stuff
		JMP doneWithMultiTile
	notScreenFiveFive

	CMP #$56
	BNE notScreenFiveSix
		;;do stuff
		JMP doneWithMultiTile
	notScreenFiveSix

	CMP #$57
	BNE notScreenFiveSeven
		;;do stuff
		JMP doneWithMultiTile
	notScreenFiveSeven

	CMP #$58
	BNE notScreenFiveEight
		;;do stuff
		JMP doneWithMultiTile
	notScreenFiveEight

	CMP #$59
	BNE notScreenFiveNine
		;;do stuff
		JMP doneWithMultiTile
	notScreenFiveNine

	CMP #$5A
	BNE notScreenFiveTen
		;;do stuff
		JMP doneWithMultiTile
	notScreenFiveTen

	CMP #$5B
	BNE notScreenFiveEleven
		;;do stuff
		JMP doneWithMultiTile
	notScreenFiveEleven

	CMP #$5C
	BNE notScreenFiveTwelve
		;;do stuff
		JMP doneWithMultiTile
	notScreenFiveTwelve

	CMP #$5D
	BNE notScreenFiveThirteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenFiveThirteen

	CMP #$5E
	BNE notScreenFiveFourteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenFiveFourteen

	CMP #$5F
	BNE notScreenFiveFifteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenFiveFifteen

;;;;;;;;;;;;;;;;;;;;
;;;;;;; ROW SEVEN
;;;;;;;;;;;;;;;;;;;;

	CMP #$61
	BNE notScreenSixOne
		;;do stuff
		JMP doneWithMultiTile
	notScreenSixOne

	CMP #$62
	BNE notScreenSixTwo
		;;do stuff
		JMP doneWithMultiTile
	notScreenSixTwo

	CMP #$63
	BNE notScreenSixThree
		;;do stuff
		JMP doneWithMultiTile
	notScreenSixThree

	CMP #$64
	BNE notScreenSixFour
		;;do stuff
		JMP doneWithMultiTile
	notScreenSixFour

	CMP #$65
	BNE notScreenSixFive
		;;do stuff
		JMP doneWithMultiTile
	notScreenSixFive

	CMP #$66
	BNE notScreenSixSix
		;;do stuff
		JMP doneWithMultiTile
	notScreenSixSix

	CMP #$67
	BNE notScreenSixSeven
		;;do stuff
		JMP doneWithMultiTile
	notScreenSixSeven

	CMP #$68
	BNE notScreenSixEight
		;;do stuff
		JMP doneWithMultiTile
	notScreenSixEight

	CMP #$69
	BNE notScreenSixNine
		;;do stuff
		JMP doneWithMultiTile
	notScreenSixNine

	CMP #$6A
	BNE notScreenSixTen
		;;do stuff
		JMP doneWithMultiTile
	notScreenSixTen

	CMP #$6B
	BNE notScreenSixEleven
		;;do stuff
		JMP doneWithMultiTile
	notScreenSixEleven

	CMP #$6C
	BNE notScreenSixTwelve
		;;do stuff
		JMP doneWithMultiTile
	notScreenSixTwelve

	CMP #$6D
	BNE notScreenSixThirteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenSixThirteen

	CMP #$6E
	BNE notScreenSixFourteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenSixFourteen

	CMP #$6F
	BNE notScreenSixFifteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenSixFifteen

;;;;;;;;;;;;;;;;;;;;
;;;;;;; ROW EIGHT
;;;;;;;;;;;;;;;;;;;;

	CMP #$71
	BNE notScreenSevenOne
		;;do stuff
		JMP doneWithMultiTile
	notScreenSevenOne

	CMP #$72
	BNE notScreenSevenTwo
		;;do stuff
		JMP doneWithMultiTile
	notScreenSevenTwo

	CMP #$73
	BNE notScreenSevenThree
		;;do stuff
		JMP doneWithMultiTile
	notScreenSevenThree

	CMP #$74
	BNE notScreenSevenFour
		;;do stuff
		JMP doneWithMultiTile
	notScreenSevenFour

	CMP #$75
	BNE notScreenSevenFive
		;;do stuff
		JMP doneWithMultiTile
	notScreenSevenFive

	CMP #$76
	BNE notScreenSevenSix
		;;do stuff
		JMP doneWithMultiTile
	notScreenSevenSix

	CMP #$77
	BNE notScreenSevenSeven
		;;do stuff
		JMP doneWithMultiTile
	notScreenSevenSeven

	CMP #$78
	BNE notScreenSevenEight
		;;do stuff
		JMP doneWithMultiTile
	notScreenSevenEight

	CMP #$79
	BNE notScreenSevenNine
		;;do stuff
		JMP doneWithMultiTile
	notScreenSevenNine

	CMP #$7A
	BNE notScreenSevenTen
		;;do stuff
		JMP doneWithMultiTile
	notScreenSevenTen

	CMP #$7B
	BNE notScreenSevenEleven
		;;do stuff
		JMP doneWithMultiTile
	notScreenSevenEleven

	CMP #$7C
	BNE notScreenSevenTwelve
		;;do stuff
		JMP doneWithMultiTile
	notScreenSevenTwelve

	CMP #$7D
	BNE notScreenSevenThirteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenSevenThirteen

	CMP #$7E
	BNE notScreenSevenFourteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenSevenFourteen

	CMP #$7F
	BNE notScreenSevenFifteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenSevenFifteen

;;;;;;;;;;;;;;;;;;;;
;;;;;;; ROW NINE
;;;;;;;;;;;;;;;;;;;;

	CMP #$81
	BNE notScreenEightOne
		;;do stuff
		JMP doneWithMultiTile
	notScreenEightOne

	CMP #$82
	BNE notScreenEightTwo
		;;do stuff
		JMP doneWithMultiTile
	notScreenEightTwo

	CMP #$83
	BNE notScreenEightThree
		;;do stuff
		JMP doneWithMultiTile
	notScreenEightThree

	CMP #$84
	BNE notScreenEightFour
		;;do stuff
		JMP doneWithMultiTile
	notScreenEightFour

	CMP #$85
	BNE notScreenEightFive
		;;do stuff
		JMP doneWithMultiTile
	notScreenEightFive

	CMP #$86
	BNE notScreenEightSix
		;;do stuff
		JMP doneWithMultiTile
	notScreenEightSix

	CMP #$87
	BNE notScreenEightSeven
		;;do stuff
		JMP doneWithMultiTile
	notScreenEightSeven

	CMP #$88
	BNE notScreenEightEight
		;;do stuff
		JMP doneWithMultiTile
	notScreenEightEight

	CMP #$89
	BNE notScreenEightNine
		;;do stuff
		JMP doneWithMultiTile
	notScreenEightNine

	CMP #$8A
	BNE notScreenEightTen
		;;do stuff
		JMP doneWithMultiTile
	notScreenEightTen

	CMP #$8B
	BNE notScreenEightEleven
		;;do stuff
		JMP doneWithMultiTile
	notScreenEightEleven

	CMP #$8C
	BNE notScreenEightTwelve
		;;do stuff
		JMP doneWithMultiTile
	notScreenEightTwelve

	CMP #$8D
	BNE notScreenEightThirteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenEightThirteen

	CMP #$8E
	BNE notScreenEightFourteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenEightFourteen

	CMP #$8F
	BNE notScreenEightFifteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenEightFifteen

;;;;;;;;;;;;;;;;;;;;
;;;;;;; ROW TEN
;;;;;;;;;;;;;;;;;;;;

	CMP #$91
	BNE notScreenNineOne
		;;do stuff
		JMP doneWithMultiTile
	notScreenNineOne

	CMP #$92
	BNE notScreenNineTwo
		;;do stuff
		JMP doneWithMultiTile
	notScreenNineTwo

	CMP #$93
	BNE notScreenNineThree
		;;do stuff
		JMP doneWithMultiTile
	notScreenNineThree

	CMP #$94
	BNE notScreenNineFour
		;;do stuff
		JMP doneWithMultiTile
	notScreenNineFour

	CMP #$95
	BNE notScreenNineFive
		;;do stuff
		JMP doneWithMultiTile
	notScreenNineFive

	CMP #$96
	BNE notScreenNineSix
		;;do stuff
		JMP doneWithMultiTile
	notScreenNineSix

	CMP #$97
	BNE notScreenNineSeven
		;;do stuff
		JMP doneWithMultiTile
	notScreenNineSeven

	CMP #$98
	BNE notScreenNineEight
		;;do stuff
		JMP doneWithMultiTile
	notScreenNineEight

	CMP #$99
	BNE notScreenNineNine
		;;do stuff
		JMP doneWithMultiTile
	notScreenNineNine

	CMP #$9A
	BNE notScreenNineTen
		;;do stuff
		JMP doneWithMultiTile
	notScreenNineTen

	CMP #$9B
	BNE notScreenNineEleven
		;;do stuff
		JMP doneWithMultiTile
	notScreenNineEleven

	CMP #$9C
	BNE notScreenNineTwelve
		;;do stuff
		JMP doneWithMultiTile
	notScreenNineTwelve

	CMP #$9D
	BNE notScreenNineThirteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenNineThirteen

	CMP #$9E
	BNE notScreenNineFourteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenNineFourteen

	CMP #$9F
	BNE notScreenNineFifteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenNineFifteen

;;;;;;;;;;;;;;;;;;;;
;;;;;;; ROW ELEVEN
;;;;;;;;;;;;;;;;;;;;

	CMP #$A1
	BNE notScreenTenOne
		;;do stuff
		JMP doneWithMultiTile
	notScreenTenOne

	CMP #$A2
	BNE notScreenTenTwo
		;;do stuff
		JMP doneWithMultiTile
	notScreenTenTwo

	CMP #$A3
	BNE notScreenTenThree
		;;do stuff
		JMP doneWithMultiTile
	notScreenTenThree

	CMP #$A4
	BNE notScreenTenFour ;;Good Buddy
		;;do stuff
		JMP doneWithMultiTile
	notScreenTenFour

	CMP #$A5
	BNE notScreenTenFive
		;;do stuff
		JMP doneWithMultiTile
	notScreenTenFive

	CMP #$A6
	BNE notScreenTenSix
		;;do stuff
		JMP doneWithMultiTile
	notScreenTenSix

	CMP #$A7
	BNE notScreenTenSeven
		;;do stuff
		JMP doneWithMultiTile
	notScreenTenSeven

	CMP #$A8
	BNE notScreenTenEight
		;;do stuff
		JMP doneWithMultiTile
	notScreenTenEight

	CMP #$A9
	BNE notScreenTenNine
		;;do stuff
		JMP doneWithMultiTile
	notScreenTenNine

	CMP #$AA
	BNE notScreenTenTen
		;;do stuff
		JMP doneWithMultiTile
	notScreenTenTen

	CMP #$AB
	BNE notScreenTenEleven
		;;do stuff
		JMP doneWithMultiTile
	notScreenTenEleven

	CMP #$AC
	BNE notScreenTenTwelve
		;;do stuff
		JMP doneWithMultiTile
	notScreenTenTwelve

	CMP #$AD
	BNE notScreenTenThirteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenTenThirteen

	CMP #$AE
	BNE notScreenTenFourteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenTenFourteen

	CMP #$AF
	BNE notScreenTenFifteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenTenFifteen

;;;;;;;;;;;;;;;;;;;;
;;;;;;; ROW TWELVE
;;;;;;;;;;;;;;;;;;;;

	CMP #$B1
	BNE notScreenElevenOne
		;;do stuff
		JMP doneWithMultiTile
	notScreenElevenOne

	CMP #$B2
	BNE notScreenElevenTwo
		;;do stuff
		JMP doneWithMultiTile
	notScreenElevenTwo

	CMP #$B3
	BNE notScreenElevenThree
		;;do stuff
		JMP doneWithMultiTile
	notScreenElevenThree

	CMP #$B4
	BNE notScreenElevenFour
		;;do stuff
		JMP doneWithMultiTile
	notScreenElevenFour

	CMP #$B5
	BNE notScreenElevenFive
		;;do stuff
		JMP doneWithMultiTile
	notScreenElevenFive

	CMP #$B6
	BNE notScreenElevenSix
		;;do stuff
		JMP doneWithMultiTile
	notScreenElevenSix

	CMP #$B7
	BNE notScreenElevenSeven
		;;do stuff
		JMP doneWithMultiTile
	notScreenElevenSeven

	CMP #$B8
	BNE notScreenElevenEight
		;;do stuff
		JMP doneWithMultiTile
	notScreenElevenEight

	CMP #$B9
	BNE notScreenElevenNine
		;;do stuff
		JMP doneWithMultiTile
	notScreenElevenNine

	CMP #$BA
	BNE notScreenElevenTen
		;;do stuff
		JMP doneWithMultiTile
	notScreenElevenTen

	CMP #$BB
	BNE notScreenElevenEleven
		;;do stuff
		JMP doneWithMultiTile
	notScreenElevenEleven

	CMP #$BC
	BNE notScreenElevenTwelve
		;;do stuff
		JMP doneWithMultiTile
	notScreenElevenTwelve

	CMP #$BD
	BNE notScreenElevenThirteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenElevenThirteen

	CMP #$BE
	BNE notScreenElevenFourteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenElevenFourteen

	CMP #$BF
	BNE notScreenElevenFifteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenElevenFifteen

;;;;;;;;;;;;;;;;;;;;
;;;;;;; ROW THIRTEEN
;;;;;;;;;;;;;;;;;;;;

	CMP #$C1
	BNE notScreenTwelveOne
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwelveOne

	CMP #$C2
	BNE notScreenTwelveTwo
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwelveTwo

	CMP #$C3
	BNE notScreenTwelveThree
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwelveThree

	CMP #$C4
	BNE notScreenTwelveFour
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwelveFour

	CMP #$C5
	BNE notScreenTwelveFive
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwelveFive

	CMP #$C6
	BNE notScreenTwelveSix
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwelveSix

	CMP #$C7
	BNE notScreenTwelveSeven
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwelveSeven

	CMP #$C8
	BNE notScreenTwelveEight
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwelveEight

	CMP #$C9
	BNE notScreenTwelveNine
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwelveNine

	CMP #$CA
	BNE notScreenTwelveTen
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwelveTen

	CMP #$CB
	BNE notScreenTwelveEleven
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwelveEleven

	CMP #$CC
	BNE notScreenTwelveTwelve
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwelveTwelve

	CMP #$CD
	BNE notScreenTwelveThirteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwelveThirteen

	CMP #$CE
	BNE notScreenTwelveFourteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwelveFourteen

	CMP #$CF
	BNE notScreenTwelveFifteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenTwelveFifteen

;;;;;;;;;;;;;;;;;;;;
;;;;;;; ROW FOURTEEN
;;;;;;;;;;;;;;;;;;;;

	CMP #$D1
	BNE notScreenThirteenOne
		;;do stuff
		JMP doneWithMultiTile
	notScreenThirteenOne

	CMP #$D2
	BNE notScreenThirteenTwo
		;;do stuff
		JMP doneWithMultiTile
	notScreenThirteenTwo

	CMP #$D3
	BNE notScreenThirteenThree
		;;do stuff
		JMP doneWithMultiTile
	notScreenThirteenThree

	CMP #$D4
	BNE notScreenThirteenFour
		;;do stuff
		JMP doneWithMultiTile
	notScreenThirteenFour

	CMP #$D5
	BNE notScreenThirteenFive
		;;do stuff
		JMP doneWithMultiTile
	notScreenThirteenFive

	CMP #$D6
	BNE notScreenThirteenSix
		;;do stuff
		JMP doneWithMultiTile
	notScreenThirteenSix

	CMP #$D7
	BNE notScreenThirteenSeven
		;;do stuff
		JMP doneWithMultiTile
	notScreenThirteenSeven

	CMP #$D8
	BNE notScreenThirteenEight
		;;do stuff
		JMP doneWithMultiTile
	notScreenThirteenEight

	CMP #$D9
	BNE notScreenThirteenNine
		;;do stuff
		JMP doneWithMultiTile
	notScreenThirteenNine

	CMP #$DA
	BNE notScreenThirteenTen
		;;do stuff
		JMP doneWithMultiTile
	notScreenThirteenTen

	CMP #$DB
	BNE notScreenThirteenEleven
		;;do stuff
		JMP doneWithMultiTile
	notScreenThirteenEleven

	CMP #$DC
	BNE notScreenThirteenTwelve
		;;do stuff
		JMP doneWithMultiTile
	notScreenThirteenTwelve

	CMP #$DD
	BNE notScreenThirteenThirteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenThirteenThirteen

	CMP #$DE
	BNE notScreenThirteenFourteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenThirteenFourteen

	CMP #$DF
	BNE notScreenThirteenFifteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenThirteenFifteen

;;;;;;;;;;;;;;;;;;;;
;;;;;;; ROW FIFTEEN
;;;;;;;;;;;;;;;;;;;;

	CMP #$E1
	BNE notScreenFourteenOne
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourteenOne

	CMP #$E2
	BNE notScreenFourteenTwo
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourteenTwo

	CMP #$E3
	BNE notScreenFourteenThree
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourteenThree

	CMP #$E4
	BNE notScreenFourteenFour
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourteenFour

	CMP #$E5
	BNE notScreenFourteenFive
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourteenFive

	CMP #$E6
	BNE notScreenFourteenSix
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourteenSix

	CMP #$E7
	BNE notScreenFourteenSeven
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourteenSeven

	CMP #$E8
	BNE notScreenFourteenEight
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourteenEight

	CMP #$E9
	BNE notScreenFourteenNine
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourteenNine

	CMP #$EA
	BNE notScreenFourteenTen
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourteenTen

	CMP #$EB
	BNE notScreenFourteenEleven
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourteenEleven

	CMP #$EC
	BNE notScreenFourteenTwelve
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourteenTwelve

	CMP #$ED
	BNE notScreenFourteenThirteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourteenThirteen

	CMP #$EE
	BNE notScreenFourteenFourteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourteenFourteen

	CMP #$EF
	BNE notScreenFourteenFifteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenFourteenFifteen

;;;;;;;;;;;;;;;;;;;;
;;;;;;; ROW SIXTEEN
;;;;;;;;;;;;;;;;;;;;

	CMP #$F1
	BNE notScreenFifteenOne
		;;do stuff
		JMP doneWithMultiTile
	notScreenFifteenOne

	CMP #$F2
	BNE notScreenFifteenTwo
		;;do stuff
		JMP doneWithMultiTile
	notScreenFifteenTwo

	CMP #$53
	BNE notScreenFifteenThree
		;;do stuff
		JMP doneWithMultiTile
	notScreenFifteenThree

	CMP #$F4
	BNE notScreenFifteenFour
		;;do stuff
		JMP doneWithMultiTile
	notScreenFifteenFour

	CMP #$F5
	BNE notScreenFifteenFive
		;;do stuff
		JMP doneWithMultiTile
	notScreenFifteenFive

	CMP #$56
	BNE notScreenFifteenSix
		;;do stuff
		JMP doneWithMultiTile
	notScreenFifteenSix

	CMP #$F7
	BNE notScreenFifteenSeven
		;;do stuff
		JMP doneWithMultiTile
	notScreenFifteenSeven

	CMP #$F8
	BNE notScreenFifteenEight
		;;do stuff
		JMP doneWithMultiTile
	notScreenFifteenEight

	CMP #$59
	BNE notScreenFifteenNine
		;;do stuff
		JMP doneWithMultiTile
	notScreenFifteenNine

	CMP #$FA
	BNE notScreenFifteenTen
		;;do stuff
		JMP doneWithMultiTile
	notScreenFifteenTen

	CMP #$FB
	BNE notScreenFifteenEleven
		;;do stuff
		JMP doneWithMultiTile
	notScreenFifteenEleven

	CMP #$FC
	BNE notScreenFifteenTwelve
		;;do stuff
		JMP doneWithMultiTile
	notScreenFifteenTwelve

	CMP #$FD
	BNE notScreenFifteenThirteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenFifteenThirteen

	CMP #$FE
	BNE notScreenFifteenFourteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenFifteenFourteen

	CMP #$FF
	BNE notScreenFifteenFifteen
		;;do stuff
		JMP doneWithMultiTile
	notScreenFifteenFifteen

doneWithMultiTile
 

Pauldalyjr

Active member
UPDATE: ok so the code above only works through screen 3,2. After that every screen will do whatever 3,2 did. I think it needs to switch banks maybe to continue but I am not sure.
 

Pauldalyjr

Active member
Update again.... the code is fixed, this now works for every screen of the overworld, this example covers the first 3 screens, just add code in the same manner for any screen you want checked.....

Code:
;;Original concept for this was from Bucket Mouse
;
;Screen Layout Example, screens start at 00 not 00 f. just replace ";;do stuff" with what you want that screen to do.
;
;  ___________________________________________________________________________________________
;  |  00 |  01 |  02 |  03 |  04 |  05 |  06 |  07 |  08 |  09 |  0A |  0B |  0C |  0D |  0E |  0F |  
;  ___________________________________________________________________________________________
;  |  01 |  11 |  12 |  13 |  14 |  15 |  16 |  17 |  18 |  19 |  1A |  1B |  1C |  1D |  1E |  1F |
;  ___________________________________________________________________________________________
;  |  21 |  21 |  22 |  23 |  24 |  25 |  26 |  27 |  28 |  29 |  2A |  2B |  2C |  2D |  2E |  2F | 
;  /\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
;  |  31 |  E1 |  E2 |  E3 |  E4 |  E5 |  E6 |  E7 |  E8 |  E9 |  EA |  EB |  EC |  ED |  EE |  EF |  
;  ___________________________________________________________________________________________
;  |  41 |  F1 |  F2 |  F3 |  F4 |  F5 |  F6 |  F7 |  F8 |  F9 |  FA |  FB |  FC |  FD |  FE |  FF |
;  ___________________________________________________________________________________________


;LDA screenType

;;;;;;;;;;;;;;;;;;;;
;;;;;;; ROW ONE
;;;;;;;;;;;;;;;;;;;;
LDA camScreen
	CMP #$00
    BEQ fixingBranchOne
	JMP notScreenOne
	fixingBranchOne
	INC myItem
	UpdateHudElement #$03
	JMP endMultiTile
	notScreenOne
	
	CMP #$01
    BEQ fixingBranchTwo
	JMP notScreenTwo
	fixingBranchTwo
	INC myItem2
	UpdateHudElement #$05
	JMP endMultiTile
	notScreenTwo
	
	CMP #$02
    BEQ fixingBranchThree
	JMP notScreenThree
	fixingBranchThree
	INC myItem3
	UpdateHudElement #$07
	JMP endMultiTile
	notScreenThree
	
endMultiTile
 
Top Bottom