News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

Editing Title BG layer 1 Mode 7

Started by A_red_monk_called_Key, July 15, 2011, 03:59:44 PM

Previous topic - Next topic

A_red_monk_called_Key

Beginners[spoiler]open SMILE the goto Tools/graphics editor/special GFX and rip title A6000.
open fatilety file/open change file type to all files and find your A6000 GFX. then goto format 8BPP SNES Mode 7
[/spoiler]

Next level[spoiler]Open your Rom in HEX Goto offset B7C04

you will see this code
2A 03 00 3F 62 00 05 18 80 66 67 10 74 2A 03 E4 5F FF
2A 03 C2 80 06 12 18 80 76 67 10 74 2A 03 E4 5F FF
2A 03 00 3F 62 00 85 0F 00 2A 03 E4 5F FF
2A 4F 00 5F 87 8C 00 00 13 2A 4F E4 5F FF

62 50 62 98 62 50 62 98 62 00 84 0F 01 62 50 62 98 62 50 62 98 E4 60 FF
01 61 62 62 A8 02 FF 61 62 62 A8 87 8C 01 02 FF 61 62 62 A8 02 FF 61 62 62 A8 E4 5F FF
05 89 79 53 54 88 89 C5 06 63 20 63 45 CB 14 E4 5F FF
03 89 79 63 64 C3 6C C3 06 63 30 63 55 CB 14 E4 5F FF

22 86 01 87 85 23 86 02 87 FF FF 63 05 63 70 02 FF FF 85 23 86 01 87 85 22 86 E4 5F FF
22 A6 01 97 95 23 A6 01 97 FF 64 14 64 80 01 FF 95 23 A6 01 97 95 22 A6 E4 5F FF
22 A6 01 97 95 23 A6 01 97 FF 63 24 01 18 80 63 91 01 FF 95 23 A6 01 97 95 22 A6 E4 5F FF
22 A6 01 97 95 23 A6 01 97 FF 64 34 64 A0 01 FF 95 23 A6 01 97 95 22 A6 E4 5F FF
22 A6 01 A7 A5 23 A6 00 A7 22 FF 05 11 0A 0B B0 B1 77 22 FF 00 A5 23 A6 01 A7 A5 22 A6 E4 5F FF
22 A6 01 A7 B5 23 B6 00 B7 23 FF 03 1A 1B C0 C1 23 FF 00 B5 23 B6 01 B7 A5 22 A6 E4 5F FF
22 A6 00 A7 29 FF 03 09 FF FF 19 29 FF 00 A5 22 A6 E4 5F FF
22 A6 00 A7 29 FF C3 80 29 FF 00 A5 22 A6 E4 5F FF
22 A6 00 A7 29 FF 03 09 BA BB 19 29 FF 00 A5 22 A6 E4 5F FF
22 B6 00 B7 29 FF 03 09 E0 E1 19 22 FF 63 AC 03 49 FF FF B5 22 B6 E4 65 FF

64 4A 22 FF 03 09 E2 E3 19 22 FF 63 BC 00 59 E4 6B FF
64 5A 22 FF 03 09 B8 B9 19 22 FF 63 CC 00 9D E4 6B FF
65 6A 07 FF FF 0E 0F B2 B3 FF FF 64 C6 00 69 E4 6C FF
64 7B 03 2E 2F 1E 1F 63 C2 64 D6 E4 6D FF
64 8B 63 20 63 45 00 CB 63 DC E4 70 FF
01 9E 9F 63 30 63 55 01 DB AB E4 75 FF
87 8C 02 27 FF 00 D5 E4 67 FF
64 D0 01 FF FF 62 00 84 0F 02 01 FF FF 63 E4 03 75 65 7A 8A E4 61 FF

2A 3E 00 3D 87 0C 0C 00 90 2A 3E E4 5F FF
2A 03 00 3F 62 00 85 0F 01 2A 03 E4 5F FF

how it works[spoiler]The red is the repeating tiles (most likely has 2X before it. the X is how many to repeat. the red is YX on the GFX set) (if your new to this i recommend making these all FF)

The Green are the sets of tiles(most likely has 6X before it. X is the number of tiles in a group from the GFX set. the green number that follows is the YX on the GFX set) or one tile at a time(always 0X before it. X is how many numbers that follow 0X. the green is YX from the GFX set)

The white numbers: 0X, 2X, 6X tell how the next number will show up in Mode 7
The underline stuff. i have no idea what is(worthless code when it comes to editing)
The pink is the end of each row 5F XX FF (XX tell how far from the center of the screen 5F is full screen)[/spoiler][/spoiler]

Level 2
[spoiler]don't go pasted offset B7E38(i think thats the start of the Mode 7 rooms)

Lesson 2

the first set
0X = one tile at a time (x = how many of the following numbers are YX's)
2X = repeating (X = how may times)
6X = group (X = how many to pull from GFX in a horizontal row)

the next set
XX = is the YX on the GFX set

the best way to start is with a notepad like this, and a box at E7
[spoiler][/spoiler]
you need 29 rows in your text (the 29th row should be open 2F FF 2F FF E4 5F FF. this removes a line at the bottom of the title screen)

save the mode 7 GFX to your rom and change the colors to something you can work with.
make a screen shot. and add your graphic in a paint program.(photoshop is used in the pic)
[spoiler][/spoiler]
then add your graphic to the mode 7 GFX in fatilety row by row(keep as much together as you can by row)then save to your rom
(like i did)[spoiler][/spoiler]

time to get started 

2F E7(repeat 16 of E7)      2F E7(repeat 16 of E7)    E4 5F FF(5F tells it to use the whole screen for that row)

it best to start at the bottom (the 28th row) and work your way up

first change 2F (10 boxes between, make it 29 FF)(FF is a blank tile) then the graphic (if 1 tile use 00 XX. if 2 use 61 XX or 01 XX XX)
then the empty space (4 or 5 boxes 2X  X = 4 or 5) each row must equal a total of 32 tiles
[spoiler][/spoiler]

EXE: 29 FF 61 XX 2F FF E5 5F FF

copy all the text and paste at offset B7C04. load your rom to cheack(if you have blue boxes glitch they will start were you made a mastake)
repeat prosses for each line.[/spoiler]

if you have questions this topic is unlocked. good luck editing

A_red_monk_called_Key

#1
I need testers to play the original Super metroid to see if they can find a glitch.
There is only a mod on the title Mode 7 BG. (I gave it maxum free space.)

If you find something out of the ordinary PM me.

this patch will also free space were needed

JAM

#2
Layer 1 of title screen is located at B7C04, as you said. But it is in compressed format. I know how compression format for level data works and stuff like [E4 5F FF] is extended byte fill command. And [2A]:[03] is Byte Fill command. Read this doc to gain more info.
http://www.romhacking.net/docs/243/

Editing tiles in compressed format is hard. But I thought, what is the difference between Layer 1 BG of title screen and regular BG of any room? What do you think?

THERE ARE NO DIFFERENCE AT ALL!!!! It means, that you can rip BG of the title screen edit it in uncompressed format in hex editor and then save it back! Fucking shit! It's so simple and easy! Why no one have got it yet?

The only problem is that you must use tiles in mode 7. To use new tiles you should draw them.

How it works:
0. First of all, find a space in the ROM where new BG will be placed. It uses $1000 bytes in uncompressed format, so approx. $800 bytes will be enough to store the BG in compressed format. $57800 dounds good for me.
1. Make a copy of your hack.
2. Open it in hex editor.
3. At $59BB9 there are the bank of background of title BG. Change 96 to 8B.
4. At $59BBD there are the address of background title BG inside the bank. Change 04 FC to 00 F8.
5. Repointing is done. New Layer BG will be stored at $57800 in future.
6. Open your hack in SMILE.
7. Select any room that have regular BG, not Layer 2. I'm using the room 7DF8D as example.
8. Select Tools => Backgound Editor => Edit BG
9. Replace address 1D422A with B7C04 (original Title 1 BG locations).
A. Click "Save Background file".
B. You'll see message "Background data (tile map) saved as Name_of_your_ROM_B7C04.bg". Close SMILE.
C. Open A6000.gfx with FaTILEty.
D. Open Name_of_your_ROM_B7C04.bg with hex editor.
E. You'll see $20 bytes, gap of $60 FF's, another $20 bytes, another gap of $60 bytes and so on. Each number means number of tile of GFX $A6000 used.
F. Edit this file as you want. Don't touch FF's. I mean, edit data between x00 and x1F and between x80 and x9F.
10. Close hex editor when you finish.
11. Open your hack with SMILE.
12. Select any room that have regular BG, not Layer 2. I'm using the room 7DF8D as example
13. Select Tools => Backgound Editor => Edit BG
14. Replace address 1D422A with 57800. It's the new location of BG.
15. Click "Open Background file".
16. Select Name_of_your_ROM_B7C04.bg and click "Open"
17. You'll see that BG in the right side of the window is turned into garbage. It's OK, because we are using another graphic format.
18. Click "Save Background to the ROM".
19. Close SMILE.
1A. Open test ROM with emulator and see result.

Robstar360

excellent information - thanks Red =)

TAxxOUTBR3AKxx

Quote from: JAM on July 17, 2011, 05:52:49 PM
Layer 1 of title screen is located at B7C04, as you said. But it is in compressed format. I know how compression format for level data works and stuff like [E4 5F FF] is extended byte fill command. And [2A]:[03] is Byte Fill command. Read this doc to gain more info.
http://www.romhacking.net/docs/243/

Editing tiles in compressed format is hard. But I thought, what is the difference between Layer 1 BG of title screen and regular BG of any room? What do you think?

THERE ARE NO DIFFERENCE AT ALL!!!! It means, that you can rip BG of the title screen edit it in uncompressed format in hex editor and then save it back! Fucking shit! It's so simple and easy! Why no one have got it yet?

The only problem is that you must use tiles in mode 7. To use new tiles you should draw them.

How it works:
0. First of all, find a space in the ROM where new BG will be placed. It uses $1000 bytes in uncompressed format, so approx. $800 bytes will be enough to store the BG in compressed format. $57800 dounds good for me.
1. Make a copy of your hack.
2. Open it in hex editor.
3. At $59BB9 there are the bank of background of title BG. Change 96 to 8B.
4. At $59BBD there are the address of background title BG inside the bank. Change 04 FC to 00 F8.
5. Repointing is done. New Layer BG will be stored at $57800 in future.
6. Open your hack in SMILE.
7. Select any room that have regular BG, not Layer 2. I'm using the room 7DF8D as example.
8. Select Tools => Backgound Editor => Edit BG
9. Replace address 1D422A with B7C04 (original Title 1 BG locations).
A. Click "Save Background file".
B. You'll see message "Background data (tile map) saved as Name_of_your_ROM_B7C04.bg". Close SMILE.
C. Open A6000.gfx with FaTILEty.
D. Open Name_of_your_ROM_B7C04.bg with hex editor.
E. You'll see $20 bytes, gap of $60 FF's, another $20 bytes, another gap of $60 bytes and so on. Each number means number of tile of GFX $A6000 used.
F. Edit this file as you want. Don't touch FF's. I mean, edit data between x00 and x1F and between x80 and x9F.
10. Close hex editor when you finish.
11. Open your hack with SMILE.
12. Select any room that have regular BG, not Layer 2. I'm using the room 7DF8D as example
13. Select Tools => Backgound Editor => Edit BG
14. Replace address 1D422A with 57800. It's the new location of BG.
15. Click "Open Background file".
16. Select Name_of_your_ROM_B7C04.bg and click "Open"
17. You'll see that BG in the right side of the window is turned into garbage. It's OK, because we are using another graphic format.
18. Click "Save Background to the ROM".
19. Close SMILE.
1A. Open test ROM with emulator and see result.

JAM, what in the HELL are you talking about? Are you saying I can use a BG from in-game as my Title Screen BG?

JAM

#5
Not exactly. Because title screen is in Mode 7 format it's tilemap is different. You can't set palette row (because any tile already can use all 128 colors) of tile and set flipping. But both of them are compressed similarity.

Let's say, Level Layout is a GIF file, Room BG tilemap is a JPG file and Title BG tilemap is a PNG file, but all of them are stored in the ROM as ZIP archives, which can be packed/unpacked by SMILE.

So it's just a way to extract the tilemap of title screen using SMILE functions, edit it manually in hex editor and store back. And extracting of title BG graphics was already possible by SMILE but it was useless since you won't be able to edit the tilemap.

I'm afraid, you'll have to redraw tileset that you wanna use for BG manually in Mode 7 format if you want use title BG based on it. At least tiles you want to use in title, but since you can't flip tiles, draw mirrored versions too (for tiles you want to flip).