Banner
Views: 755,035,272
Time:
11 users online: chineesmw, ggamer77,  idol, JonTheGamer 360, JP32,  Noivern, OEOTeam, sinseiga,  Sonikku, Yorch, Yung Gotenks - Guests: 24 - Bots: 177Users: 39,693 (1,818 active)
Latest: Yorch
Tip: Use palettes that don't burn the eyes. A blazing bright yellow and a night-black are not pleasant.Not logged in.
.
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - .
Pages: « 1 »
.
In that code, the picture file 'mode7.bin' should include info about both character and tile map, not just character info.

This file include both of them. (In fact, it is also in smkden's demo rom file)

This file is a smkden's demo rom file. Actually, it is a demo for dsp-1 especially raster operation, but I think it also can be a demo for mode 7 (Because it uses mode7.).


--------------------
I'm working on SMWS (Super Mario World Sunshine).

Please tolerate my poor English skills :D


Using that setup (slightly altered to make the room mode 7) and that graphics file, on a normal level (level mode is 00) 106 with the background blank and only two screens of regular, one row blocks, I get this:


So I don't think that's right. Apparently the circumstances that smkd used to make that code do not apply here.
It seems BG mode is forcedly changed by SMW.
I don't know how to apply mode7 in normal level. (except level mode 10)

As SMW codes, fighting mode C1 (included in level mode 10) change BG mode to 7, and do other things (such like change music to 04?, and mirroring for mode 7).
If you didn't set fighting mode to C1, SMW will forcedly change BG mode to 1 and overlap tilemap, character info.

I try to find a way not to use level mode 10, but I can't. What I found was NMI routine for C1 which delete status bar, changing music routine, and few more. SMW uses fighting mode in various purposes. It makes me confusing.

--------------------
I'm working on SMWS (Super Mario World Sunshine).

Please tolerate my poor English skills :D


A-ha, thanks a ton peaceful house. When I made it C1, the screen finally cleared...although it just makes a blank screen. I'll look into that NMI routine.
I already make a patch for erasing the blank.
Here!


I don't know why this routine exist, too. |-O

--------------------
I'm working on SMWS (Super Mario World Sunshine).

Please tolerate my poor English skills :D


Originally posted by me?
This file include both of them.


Yes, the file pwvram.bin include both tilemap and character data, so you can input them easily with DMA.

The shape of binary of the file is like this:

tile/cha/tile/cha/tile/cha/tile/cha/
tile/cha/tile/cha/tile/cha/tile/cha/
tile/cha/tile/cha/tile/cha/tile/cha/
....

when 'tile' or 'cha' means one byte.

So, if you collect each 'odd' bytes and open that, you can see a picture.
If you want to input tilemap and character data seperately, you should do those work by yourself.

Code
clear bit7 of $2115 (*-------, clear bit *)
set $2116, 7 to 0
lda tilemap     ; loop until you input all the data
sta $2118       ; loop (..)

set bit7 of $2115
set $2116, 7 to 0
lda character     ; loop until you input all the data
sta $2119         ; loop (..)


It will be a great lesson, but not efficient. :D

--------------------
I'm working on SMWS (Super Mario World Sunshine).

Please tolerate my poor English skills :D


peaceful house and anyone else who can contribute, thanks so much for your help. This is the first time I have gotten anywhere, EVER, with this, and now I finally see results.

Here's the rub.

Here's my code:
level106:
PHP
LDA #$C1
STA $0D9B
SEP #$20
REP #$10

LDA #$80 ;regular upload
STA $2115
LDX #$0000 ;set initial VRAM address
STX $2116
LDA #$01
STA $4300 ;set mode to '2regs WR 1'
;You can see info about modes of HDMA in a tutorial.
LDA #$18 ;destination : $2118
STA $4301
LDX.w #pwvram ;where your data is
STX $4302
LDA.b #pwvram>>16 ;bank where your data is
STA $4304
LDX #$8000 ;size of your data
STX $4305
LDA #$01 ;...Put it!
STA $420B

PLP
RTS


pwvram:
incbin pwvram.bin

When I put this in a regular level, I get a plain, totally white, no statusbar, nothing screen, with only the sprites + mario displaying. Even after applying the patch, it stayed this way.

Afterward, I got rid of the LDA #$C1 STA $0D9B and then set the header to 09,0B,and 10. These were, obviously, messed up, but:


(This is in the iggy's room mode.)
These graphics are completely different from the ones that display without that code running! So, the graphics are totally uploading, but something is making them not display.

Thanks again for any help, if you want to give any help at all. (And sorry Koops for hijacking your thread a little bit. :P)



Check the top left, I did mostly the same thing and opened in VSNES. It looks like the graphics are fine except I don't have those glitches on the yellow strips. Didn't bother with palette here but it'd look like expected if you uploaded pwcg too. Use vsnes to check stuff when in doubt

Ideally you'd reserve an otherwise useless level mode you can use anywhere that doesn't force a boss fight. It'll setup a mode7 display and upload whatever is necessary at start.
Make bosses with Mode 7 it's hard??




ALL
RIGHT!

Thanks Peaceful House and smkd. I'm totally psyched to finally have this working. :3
The graphics themselves - so not the tilemap - could be created by making graphics in a blank file in Tile Molester - 8bpp linear codec -, and saving and incbin'ing it.
You have to use DMA to transport those graphics to the VRAM. Instead of storing #$18 to $43x1 and #$01 to $43x0, you have to store #$19 and #$00. So, something such as this:

Code
LDA #$80 ; \ Increase on $2119 write.
STA $2115 ; /
STZ $2116 ; \ VRAM addr = $0000
STZ $2117 ; /
LDX #$06

DMALoop:
LDA.l DMATbl,x
STA $4300,x ; Channel
DEX
BPL DMALoop
LDA #$01
STA $420B
; whatever code goes here

DMATbl:
db $00,$19
dl pwvram ; note: ONLY CHARACTER DATA
dw $4000 ; all bytes. If you have a file smaller than 16kb, choose that. You can also put beginning and end labels and use that, such as pwvramend-pwvrambegin


After that - at least, this is what I'd do -, change all tiles to zero with the following DMA routine:

Code
STZ $2115 ; Increase on $2118 write.
STZ $2116 ; \ VRAM addr = $0000.
STZ $2117 ; /
LDX #$06

DMALoop2:
LDA.l DMATbl2,x
STA $4300,x
DEX
BPL DMALoop2
LDA #$01
STA $420B
; whatever code goes here

Zero:
db $00 ; note: you don't have to make a seperate table, you can choose whichever zero in the routine you want. But make sure that value remains zero.

DMATbl2:
db $08,$18
dl Zero
dw $4000 ; affects all tiles


Then, upload the tilemap. You could do this with another tilemap file - I myself created a small sort of 'Mode 7 specific' stripe image code that does that, though.

This was pretty much what peaceful house mentioned, but put into a routine. Sure, it's probably a bit slower, but the extra lag is minimal and not noticable when put into an area with force blank (and if you hijack the level load routine, you're doing just that).

I do not know if Tile Molester has any option to select only odd or even bytes. If it does, then you could include character data and tilemap in the same file and edit the graphics easily.

--------------------
--------> Don't follow "Find Roy's Dignity", my hack. Because it's pretty outdated. <--------
Originally posted by Koops
I made two files, mode7.mp7 and mode7.pc7. How to interleave them into one file?



BTW, how to upload palette?

Palette:

PHP
SEP #$20
REP #$10

STZ $2121
STZ $4300
LDA #$22
STA $4301
LDX.w #pwcg
STX $4302
LDA.b #pwcg>>16
STA $4304
LDX #$0200
STX $4305
LDA #$01
STA $420B

PLP
Copy -> paste. The trick is you have to have
pwcg:
incbin palettedata.bin

somewhere too.

Also, how'd you make two files? :S Using tile molester, you only get one.

Roy, if I understand you, you use tile molester, make something, save as 8bpp linear. Then, upload using the method used earlier in the thread. Then, do the codes you have in your post- replcae dl pwvram with the tile numbers, from left to right, top to bottom rows.
Yes?

Also, I'm having trouble making mode7 work in something outside the boss room levels. It keeps making that blankish screen. The graphics are uploaded, they're just...only displaying on sprites. It's all completely wrong. :\
Originally posted by Maxx
Roy, if I understand you, you use tile molester, make something, save as 8bpp linear. Then, upload using the method used earlier in the thread. Then, do the codes you have in your post- replcae dl pwvram with the tile numbers, from left to right, top to bottom rows.
Yes?</pre>


I'm not completely sure if we mean the same thing, since the method which was used earlier in the thread was for uploading both tilemap AND graphics at the same time. I only upload graphics (dl pwvram.bin), then I clear uit the tilemap (dl Zero), and then I put the few stripes I have (I coded my own Mode 7 stripe routine, would it be relevant to post some of it here?)

Quote
Also, I'm having trouble making mode7 work in something outside the boss room levels. It keeps making that blankish screen. The graphics are uploaded, they're just...only displaying on sprites. It's all completely wrong. :\


Did you try setting $211B and $211E to #$0100? This should at least get rid of the solid green colour (or whichever colour you're getting).

Unexpected end tag (</pre>) at 368, expected </div>
Tag (div) was not closed.

--------------------
--------> Don't follow "Find Roy's Dignity", my hack. Because it's pretty outdated. <--------
He said outside the Mode 7 rooms, not inside.
Anyway, you just use this code in levelASM:

level105:
LDA #$01
STZ $211B
STZ $211E
STA $211B
STA $211E

And IIRC, levelINIT runs during F-blank, so you can load the tilemap and graphics there, like I did:

Code
levelinit105:
	LDA #$80
	STA $2115
	STZ $2116
	STZ $2117
	LDX #$06

	DMALoop1:
	LDA.l DMATbl,x
	STA $4300,x
	DEX
	BPL DMALoop1
	LDA #$01
	STA $420B
	STZ $2115
	STZ $2116
	STZ $2117
	LDX #$06

	DMALoop2:
	LDA.l DMATbl2,x
	STA $4300,x
	DEX
	BPL DMALoop2
	LDA #$01
	STA $420B

REP #$10
LDX.w #PalEnd-PalBeg-1
LDY.w #$00FF

PalLoop:
STY $2121
LDA.l PalBeg,x
STA $2122
LDA.l PalBeg+1,x
STA $2122
DEX
DEX
DEY
CPY #$FFFF
BNE PalLoop
SEP #$10
RTS

DMATbl:
db $00,$19
dl Pwvram
dw Pwend-Pwvram

Pwvram:
incbin chars.bin
Pwend:

Zero:
db $00

DMATbl2:
db $08,$18 ; same byte is written
dl Zero
dw $4000

PalBeg:
incbin palette.bin
PalEnd:


palette.bin is the file with all 256 slot values, chars.bin is the graphics file.
This does not get rid of the $24 scanlines above the screen, neither does it get rid of the animation.

Edit:
Use this patch to do just that (get rid of the statusbar + animation + layer 1&2 updating). In order to activate it, make $7C a non-zero value (or another RAM address if you'd like).
Also, I noted that BSNES doesn't really like the way I upload my palettes. Hm... I guess I'll try and fix that.
Also, one flickering line appears on the top of the screen and I can't really recall where it's coming from. I'll try my best to fix that too.

If you ever want to know how I upload the tiles themselves (we have different methods), just tell me.

--------------------
--------> Don't follow "Find Roy's Dignity", my hack. Because it's pretty outdated. <--------
Okay..after a while of work, I've got an update.


1. This works utterly fantastically when using smkd's method. Everything is perfect...while running.
2. I got the graphics to upload via Roy's method. Also, the tilemap is all 00s. (VSNES <3)
3. Roy's method, using the same ROM that used smkd's method, doesn't work. I get the black box flickering as usual. All the patches in this thread are used. In fact, the two ROMs are exactly the same aside from the code in levelinit, which is different for each. Yes, $7C = 01.
4. smkd's messes up layer 3 after running.

So the problem now.. either A. I figure out how to make a workable mode 7 gfx file like pwvram.bin and fix layer 3, or B. Roy's code is fixed and then I stripe it up.
Originally posted by Roy
blah


Yeah, you're code doesn't work too well. :( I apply loser.asm, store 01 to 7C, set my graphics file, and all it gives me is a glitched layer 1 and 2 for the rest of the game when it's on. :( Plus, the palettes don't even come out right. Dang, this could've been awesome for me to use.

Edit: Wait, it's Layer 3, not 1 and 2.
I have no idea what to change my layout it to...
Anything from the original mode7 demo I posted was made with homebrew in mind so I don't expect it to work with copy/paste into SMW. I might get around to making a regular non-boss level mode7 demo level and post whatever the result is. It'll be a quick one I just have to get few other things out of the way first.
Hm. The reason of the glitched Layer 3 is probably because you're overwriting the Layer 3 character data area. That area is uploaded only once, so don't do that.

Same goes for every Layer 3 mess-up anyone will encounter. Don't affect $4000-$4FFF ($8000-$9FFF), guys.

Anyway yeah, as I said, the code I posted wasn't optimal yet. I need to improve on that - I was just too lazy I guess. The palette code was also a bit messed up, I guess DMAing is better either way.

...unless smkdan, you're done with it really fast. In that case, go ahead.

--------------------
--------> Don't follow "Find Roy's Dignity", my hack. Because it's pretty outdated. <--------
Pages: « 1 »
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - .

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2019 - SMW Central
Legal Information - Privacy Policy - Link To Us


Total queries: 23

Menu

Follow Us On

  • Facebook
  • Twitter
  • YouTube

Affiliates

  • Talkhaus
  • SMBX Community
  • GTx0
  • Super Luigi Bros
  • ROMhacking.net
  • MFGG
  • Gaming Reinvented