Language…
6 users online: Astrakitu, Lizard_433, RZRider, Saela, TheKazooBloccGosh, Xulon - Guests: 87 - Bots: 95
Users: 68,459 (2,270 active)
Latest user: GamersWorkshop

A Revolution in ExGFX- BG4+BG5, BG6+BG7, 8BPP BGs

  • Pages:
  • 1
  • 2
  • 3
  • 4
For my C3 project, I am releasing a few patches that will let you do things with ExGFX that you couldn't do before.

- LM1.7x Tilemap Remapper - Allows you to remap the layer 1 and 2 tilemaps on a per-level basis, as well as swap the tilemaps for specific levels (the main part of the release)
- Generic ExGFX File Uploader - I actually had this stored in My Files, but it was never officially released
- Transparency Restore Patch - Has one very specific use here

Now what can these be used for? Three things:

1. BG4 & BG5 - get two more ExGFX files in your level with very little sacrifice
- You can think of this as the "ExExGFX of LM1.7" (except you don't have to sacrifice tilemap size)
- You do NOT need Sprite Status Bar for this first option!!!

Examples of what you can do with this:
- Have a 512-tile BG and still have FG1, FG2, BG1, and FG3 free for a FG
- Use all of the LM1.7x slots (FG1-3 and BG1-3) for a FG and still have 256 tiles for a BG
- Have a BG that uses 768 tiles and still have plenty of room for a FG

Screenshots:

- the BG in the first screenshot uses 604 tiles.
- the BG in the second screenshot uses 645 tiles.
- the BG in the third screenshot uses 700 tiles.
- the BG in the fourth screenshot uses 677 tiles.

What you will need:
- LM1.71
- LM1.7x Tilemap Remapper
- Generic ExGFX File Uploader
- Ersanio's LevelASM+Init
- Roy's Layer 3 ExGFX (because it reloads the layer 3 GFX that's overwritten) **SEE FOOTNOTE**
- Online BG Ripper

How to use it:
1. Rip a BG with the BG ripper like you would normally do, except use the tiles in TM1 and TM2 (4th GFX page) as BG4 and BG5.
2. Insert the BG into your level like normal, ignoring TM1 and TM2 for now.
3. Open the .asm file for the Generic ExGFX File Uploader patch, and add in two entries for your level: (omit the entries you don't need though)
 - the first one should have VRAM address $3000, and have the ExGFX file number set to BG4's
- the second one should have the VRAM address $3800, and the ExGFX file number set to BG5's
Example:
Code
dw $0105 : dw $3000 : dw $0203	; Level 105 - BG4 - ExGFX203
dw $0105 : dw $3800 : dw $0204	; Level 105 - BG5 - ExGFX204
4. Open the .asm file for the Tilemap Remapper patch, and (for your level) set Layer 1 to $48 and Layer 2 to $58
5. Open levelinitcode.asm that comes with LevelASM+Init and add this code to your level number's entry:
 
Code
LDA.b #$51		; \ layer 3 tilemap
STA.w $2109		; / 64x32
STZ $24			; \ reset layer 3
STZ $25			; / scroll values
6. In Layer 3 ExGFX, set slot 3 (GFX2A) and slot 4 (GFX2B) for your level to $007F to prevent them from overwriting the Layer 1 tilemap. **SEE FOOTNOTE or the tilemap will be overwritten anyway!**

What's really going on here:
- Layer 1's tilemap is being remapped to overwrite the second two GFX files used by layer 3 - clearing up space for BG4
- Layer 2's tilemap is being remapped to overwrite the bottom half of the layer 3 tilemap, and that part of the layer 3 tilemap is cut off - clearing up space for BG5

Limitations/Incompatibilities: (they're all very minor)
- The parts of the BG that use BG4 and BG5 will show up as sprite GFX in LM
- Can't use message boxes
- Can't use SMW's default layer 3 BGs the way they are configured
- Can't use any layer 3 BG that uses GFX in slots 3 and 4
- Layer 3 BGs cannot use the bottom half of the tilemap

I'm hoping that BGs using this first technique will be allowed into the ExGFX section since this VRAM-rearrangement trick is so low-impact

2. BG6 & BG7 - A bit trickier than the last method, but you get four more ExGFX files that can be used for the BG (you just can't use FG1 and FG2 for the BG)
- I don't reccomend using this if you can fit the BG in using the previous method with enough space for a FG (see limitations)

Examples of what you can do with this:
- Have a 768-tile BG and still have FG1, FG2, BG1, and FG3 free for a FG
- Use all of the LM1.7x slots (FG1-3 and BG1-3) for a FG and still have 512 tiles for a BG
- Have a BG that fills the screen with no repeats - 896 tiles - and still have FG1-3 for a FG
- Have a fully-tessellating 256x256 BG that uses 1024 tiles and still have some room for a FG in FG1-2

Screenshots:

- the first screenshot is from back when I used a similar VRAM technique in LM1.6x. The BG uses 860 tiles
- the BG in the second screenshot uses 847 tiles.
- the third BG is 256x256, scrolls both H and V, and uses almost 1024 tiles (994 to be exact, I had 30 tiles left over so I left some parts of FG3 un-overwritten such as ledge tiles)

What you will need:
- LM1.71
- LM1.7x Tilemap Remapper
- Generic ExGFX File Uploader
- Sprite Status Bar ***take note of its limitations***
- Transparency Restore Patch
- Ersanio's LevelASM+Init
- Roy's Layer 3 ExGFX (because it reloads the layer 3 GFX that's overwritten)
- Online BG Ripper

How to use it:
1. Rip a BG in the BG ripper, but not how you would normally.
 - pretend the first page is BG1 and FG3 rather than FG1 and FG2 (so you'd leave FG2 blank if you want to use a FG in FG3)
- pretend the second page is BG2 and BG3 rather than BG1 and FG3
- pretend the third page is BG4 and BG5 rather than BG2 and BG3
- pretend the fourth page is BG6 and BG7 rather than BG4/TM1 and BG5/TM2

2. Insert the BG into your level, but make sure you insert FG1 into BG1, FG2 into FG3, etc. (two GFX files back)
3. open the .asm for the Generic ExGFX File Uploader patch, and add in four entries for your level: (omit the entries you don't need though)
 - the first one, BG4 (bg2.bin) should have VRAM address $3000
- the second one, BG5 (bg3.bin) should have VRAM address $3800
- the third one, BG6 (tm1.bin) should have VRAM address $4000
- the fourth one, BG7 (tm2.bin) should have VRAM address $4800
Example:
Code
dw $0106 : dw $3000 : dw $0303	; Level 105 - BG4 - ExGFX303
dw $0106 : dw $3800 : dw $0304	; Level 105 - BG5 - ExGFX304
dw $0106 : dw $4000 : dw $0305	; Level 105 - BG6 - ExGFX305
dw $0106 : dw $4800 : dw $0306	; Level 105 - BG7 - ExGFX306
4. Open the .asm file for the Tilemap Remapper patch, and (for your level) set Layer 1 to $50 and Layer 2 to $58
5. Open levelinitcode.asm that comes with LevelASM.Init and add this code to your level number's entry:
 
Code
LDA.b #$10		; \ layer 1 tile-
STA.w $210B		; / start address
LDA.b #%00010001	; \  layer 1 & Sprites
STA.w $212C		;  | on Mainscreen
STA.w $212E		; /
LDA.b #%00000010	; \  layer 2
STA.w $212D		;  | on subscreen
STA.w $212F		; /
6. Make sure the Transparency Restore Patch is patched to your ROM.
7. Enable Sprite Status Bar for your level (read ssb.asm's readme for this)

What's really going on here:
- Layer 1's tilemap is being remapped to overwrite the top half of layer 3's tilemap, clearing up space for BG4
- Layer 2's tilemap is being remapped to overwrite the bottom half of the layer 3 tilemap, clearing up space for BG5
- BG6 & BG7 -> GFX normally used by layer 3 is now being used for layer 2
- To access the space used for BG6 and BG7 we have to shift up the initial tile VRAM address for layer 2
      - which is why we can't use FG1 and FG2, and why you have to shift back the pages in the BG ripper

Limitations/Incompatibilities:
- None of the BG will show up correctly in LM
- **Any of Sprite Status Bar's limitations** Here are some examples, see Sprite Status Bar's readme for more info
      - No goal points (use a pipe to exit to another level with a goalpoint)
      - No message boxes or anything that uses layer 3
      - Keyholes make the status bar disappear (might be fixed in the future)
      - Limited amount of extended sprites onscreen
      - Limited amount coinblock animations that can be shown at one time (the jumping coin, not the brick bounce)

3. 8BPP BGs - BGs that can use up to 256 colors per tile rather than just 16 colors, but use twice as much tile space and require Sprite Status Bar

Examples of what you can do with this:
- Have a 512-tile 8BPP BG and still have room for a FG
- Have a 384-tile 8BPP BG and have FG1, FG2, BG1, and FG3 free
- Have a 256-tile 8BPP BG and have all FG1-3 and BG1-3 free
- You can also choose to overwrite sprite GFX if you want to leave more FG space

Screenshots:

- the first one is actually shorter than 224 pixels, but there are some forest FGs out there that will cover up enough of the top and bottom of the screen (64 colors, ~500 tiles)
- the second one uses about 100 colors, and about 500 tiles
- the third one doesn't exactly look 8BPP, but it was 8BPP in the game I got it from. Uses around 470 tiles. It shows that not all 8BPP BGs have to be über-realistic styled.
- the fourth BG is the same Desert Mountain BG in the ExGFX section, but in its full 8BPP glory. (326 tiles, 78 colors)

What you will need:
- LM1.71
- LM1.7x Tilemap Remapper
- Generic ExGFX File Uploader
- Sprite Status Bar ***take note of its limitations***
- Transparency Restore Patch
- Ersanio's LevelASM+Init
- Roy's Layer 3 ExGFX (because it reloads the layer 3 GFX that's overwritten)
- Online BG Ripper - 8BPP Edition **NEW** (only supports PNGs, but that shouldn't be problem. Just use Racing Stripe to export the images)

How to use it:
1. Get a PNG file of the BG you want to rip, and rip it with the 8BPP BG ripper
      - In the color selector, it is safe to overwrite the statusbar palette since you have to use Sprite Status Bar anyway
      - Sprite palettes can be overwritten as well as FG palettes
      - You can also overwrite all 16 transparency colors and they'll show up differently.
      - In the 8x8 tile selector, each tile is actually two 4bpp tiles combined into one.
      - The first square is FG1,FG2,BG1,FG3 combined. You can overwrite GFX in FG1 and FG2 (top half) if you know what you're overwriting. Look at a 4BPP version side-by-side for reference.
      - The top half of the second square is BG2 and BG3, feel free to overwrite it. (but not the bottom half, that's where the tilemaps are stored)
      - The third square is where layer 3's GFX and tilemaps are normally stored. Feel free to overwrite it.
      - The fourth square is sprite GFX. You can overwrite some of it if you know what you're overwriting. Again, look at a 4BPP version for reference.
2. Insert the BG as you normally would, with FG1-3 and BG1-3.
3. open the .asm for the Generic ExGFX File Uploader patch, and add in four entries for your level: (omit the entries you don't need though)
 - the first one, L3-1&2 (l3_1_2.bin) should have VRAM address $4000
- the second one, L3-3&4 (l3_3_4.bin) should have VRAM address $4800
- the third one, TM3-1 (tm3_1.bin) should have VRAM address $5000
- the fourth one, TM3-2 (tm3_2.bin) should have VRAM address $5800
Example:
Code
dw $0103 : dw $4000 : dw $0C03	; Level 103 - L3-1&2 - ExGFXC03
dw $0103 : dw $4800 : dw $0C04	; Level 103 - L3-3&4 - ExGFXC04
dw $0103 : dw $5000 : dw $0C05	; Level 103 - TM3-1 - ExGFXC05
dw $0103 : dw $5800 : dw $0C06	; Level 103 - TM3-2 - ExGFXC06
4. Open the .asm file for the Tilemap Remapper patch, and (for your level) set the Extra Flags to %01 - this swaps layers 1 and 2 (because only layer 1 is 8BPP)
5. Open levelinitcode.asm that comes with LevelASM.Init and add this code to your level number's entry:
 
Code
LDA.b #$03		; \ mode 3
STA.b $3E		; /
LDA.b #%00010010	; \  sprites & layer 2
STA.w $212C		;  | on MainScreen
STA.w $212E		; /
LDA.b #%00000001	; \  layer 1
STA.w $212D		;  | on SubScreen
STA.w $212F		; /
6. Make sure the Transparency Restore Patch is patched to your ROM.
7. Enable Sprite Status Bar for your level (read ssb.asm's readme for this)

What's really going on here:
- We're changing the screen mode from mode 1 to mode 3, enabling 8BPP on layer 1 (and sacrificing layer 3)
- Switching layers 1 and 2, because in mode 3, layer 1 is 8BPP and layer 2 is 4BPP
- Moving layer 1 to the subscreen and layer 2 to the mainscreen, so layer 1 shows up behind everything and layer 2 shows up in front

Limitations/Incompatibilities:
- None of the BG will show up correctly in LM
- **Any of Sprite Status Bar's limitations** Here are some examples, see Sprite Status Bar's readme for more info
      - No goal points (use a pipe to exit to another level with a goalpoint)
      - No message boxes or anything that uses layer 3
      - Keyholes make the status bar disappear (might be fixed in the future)
      - Limited amount of extended sprites onscreen
      - Limited amount coinblock animations that can be shown at one time (the jumping coin, not the brick bounce)
- You will have to make copies of the pipes and give them layer priority, or mario will show up in front of them while going down them
- You will have to make copies of the question blocks w/ items and give them layer priority
- Layer priority won't work the normal way. Turning on layer priority won't allow things to appear above Mario under normal circumstances



Please report whatever glitches you find. The reason Sprite Status Bar remained buggy for a long time is because nobody reported the bugs, they just said "it's buggy and I'm waiting for it to get less buggy before I use it"



Layer 3 ExGFX -- IMPORTANT, READ!
Layer 3 ExGFX in its current form needs a few modifications to be compatible with the BG4&BG5 technique. (so value $007F will cancel uploading completely)
This only works with v2.1, and a new version of Layer 3 ExGFX is going to be released soon that already has these modifications done (as well as... some other changes)
I will update this post if the new version is released by the time C3 is over.

Find:
Code
Label2:
JSR LoadNormalSlots
and remove the "JSR LoadNormalSlots" (or comment it out)

then find:
Code
TheGeneralRoutine:
PHP
JSL $0FF900
SEP #$30
LDA #$80
STA $2115
LDA #$40
CLC
ADC $03,x
STA $2117
STZ $2116
LDX #$06

OWLoop:
LDA.l DMATable2,x
STA $4310,x
DEX
BPL OWLoop
LDA #$02
STA $420B
LDA $04
PLP
RTS
and replace it with
Code
TheGeneralRoutine:
PHP
REP #$20
PHA
STZ $00
LDA #$7EB9
STA $01
PLA
CMP #$007F
BEQ UploadReturn
JSL $0FF900
SEP #$30
LDA #$80
STA $2115
LDA #$40
CLC
ADC $03,x
STA $2117
STZ $2116
LDX #$06

OWLoop:
LDA.l DMATable2,x
STA $4310,x
DEX
BPL OWLoop
LDA #$02
STA $420B
LDA $04

UploadReturn:
PLP
RTS





BG Ripper Links: (and mirrors in case the main ones are down)
http://edit1754.co.cc/bgripper.php
http://edit1754.000space.com/bgripper.php (Mirror)
http://edit1754.co.cc/bgripper_8bpp.php
http://edit1754.000space.com/bgripper_8bpp.php (Mirror)
I LOVE YOU.
Holy crap this is sexy. Nice job!
Oh, my god. Those look so astounding. I will try later go. Having a little go at ASMT.

WOW!

That's just amazing!
With this you should be able to make the most epic backgrounds EVER!
Anime List
Manga List
D³ Releases: RL1, [RL2], [RL3], RiS
SMWHacking? I rest my case.
SMWCentral? I leave it to rest.

This is just...beyond. Wow.
One question: Does this work with FGs?-

Originally posted by Ripperon-X
Does this work with FGs?

BG4 and BG5 can be used for the FG, but they won't show up properly in LM unless you temporarily load BG4 and BG5 into SP1 and SP2

and you could have an 8BPP FG and 4BPP BG if you really wanted to, but an 8BPP BG is far easier to come by (or make) than an 8BPP FG
@Ripperon-X: I think, you can just make your BGs use BG4/5/6/7 and have the left space for FGs. (FG1/2/3 BG1/2/3)
Your layout has been removed.
Some day, we will have HD-Backgrounds in SMW.
Until then, this is the most amazing thing you can do with the BG!
Thanks for taking the time and working on such an amazing project, I might even learn ASM just to be able to insert this.

Work in progress:
Mario's Search For The Golden Feather:
My entry for C3
Holy shit Edit...this is fucking amazing! o_o
You are right, this is a revolution in ExGFX indeed. I'd use it but unfortunately this looks too complicated for me to use. However, I can see that this must have taken a lot of effort and I know many people will appreciate this. Awesome job!
You just love ExGFX, don't you edit? :P

N0ice job anyways. Definately... epic.
wow edit you are weasome,.. i love your BG's
Do all of these only work with rips? Because i was thinking i could make some pretty awesome graphics that aren't rips if i could use these for custom made graphics.
There is but one word for this:

hax
Wow, this is really awesome edit1754.

Also:
Originally posted by Jimmy52905
You are right, this is a revolution in ExGFX indeed.

Quoted for awesome truth. This is just...words seemed to have failed me now.
Where I am found.
/blinks

...Wow. This is way beyond awesome!

Originally posted by Aposke
I might even learn ASM just to be able to insert this.

Technically you don't even need to know ASM. All you need to know how to do is copy+paste those codes I posted into the correct place
Man... I have no words to express how amazed I was when I saw those BG!!

This is really useful!
Hello There
Wow, based on the screenshot examples and the clearly explained explanations, I can easily see this becoming widely used in many hacks. If I find proper ExGFX to use for these patches I will easily be implementing this into my hack. If not, well then, I'm going to love seeing it used in other peoples hacks.
AnimeList | MangaList
  • Pages:
  • 1
  • 2
  • 3
  • 4