(Link to AcmlmWiki) Offline: thank ||bass
Register | Login
Views: 13,040,846
Main | Memberlist | Active users | Calendar | Chat | Online users
Ranks | FAQ | ACS | Stats | Color Chart | Search | Photo album
05-08-24 01:35 PM
0 users currently in ROM Hacking.
Acmlm's Board - I3 Archive - ROM Hacking - Making Lightning flash in certain levels of Super Mario Bros. 3 New poll | |
Pages: 1 2 3Add to favorites | Next newer thread | Next older thread
User Post
Giga_Bowser_009

Red Paragoomba


 





Since: 04-16-06

Last post: 6507 days
Last view: 6507 days
Posted on 05-14-06 03:26 PM Link | Quote
Hi, I've done some simple ASM hacks for Super Mario Bros. 3 so I want to go ahead and do this one ASM hack I've been trying to do and I need help on it too.
I want to make some lightning flashes in certain levels, the levels I want them flashing are as follows:
Doomships 1-7
Tanks
Battleships
World 8-1
World 8-2
Bowser's Castle (It ends after you beat Bowser but there is no flashing background in the second part of the castle.)
And...
World 8 Dungeon
I really appreciate your help. I need to get it done.
never-obsolete

Paragoomba








Since: 05-14-06
From: AZ

Last post: 6290 days
Last view: 6290 days
Posted on 05-14-06 09:28 PM Link | Quote
if i understand correctly all you want to do is flash the screen like white or whatever then back to normal? or are you looking to have lightning bolts in the background as well?
Giga_Bowser_009

Red Paragoomba


 





Since: 04-16-06

Last post: 6507 days
Last view: 6507 days
Posted on 05-15-06 04:56 PM Link | Quote
Make the screen flash white for 10 seconds and back to normal.
C:/xkas bio.asm
Compiled ASM code








Since: 11-17-05

Last post: 6289 days
Last view: 6288 days
Posted on 05-15-06 05:03 PM Link | Quote
10 second is waaaaaaay too long to give a flash effect, make it so it change all color to white 1 or 2 frame each 128 frame


(edited by Bio on 05-15-06 04:03 PM)
never-obsolete

Paragoomba








Since: 05-14-06
From: AZ

Last post: 6290 days
Last view: 6290 days
Posted on 05-15-06 06:16 PM Link | Quote
well drop me an email and we can figure something out. how familiar are you with 6502 asm and the interworkings NES? what kind of asm hacks have you done before?
C:/xkas bio.asm
Compiled ASM code








Since: 11-17-05

Last post: 6289 days
Last view: 6288 days
Posted on 05-15-06 06:46 PM Link | Quote
enough to have 3 totally custom power-up in smb3
Giga_Bowser_009

Red Paragoomba


 





Since: 04-16-06

Last post: 6507 days
Last view: 6507 days
Posted on 05-15-06 07:42 PM Link | Quote
I have done an ASM hack where you can get the Kuriboh's shoe everytime you step on a P-switch. I've also done one where Mario gains a life everytime you die. BTW never-obsolete I have sent you an E-mail, did you get it?
never-obsolete

Paragoomba








Since: 05-14-06
From: AZ

Last post: 6290 days
Last view: 6290 days
Posted on 05-15-06 09:56 PM Link | Quote
yes i did receive it and bio are you interested on working on this as well? also is this the only hack you are looking to add or are there other things?
C:/xkas bio.asm
Compiled ASM code








Since: 11-17-05

Last post: 6289 days
Last view: 6288 days
Posted on 05-15-06 10:06 PM Link | Quote
I could provide some help, but first, how are you going to make it so the code only run in a specific level? I got a few idea:

1. use the pointer to next level to detect current level
2. use a special pallete for these level, and make code read pallete before running(much like BMF's PALASM)
3. use an ASM hack to save current level offfset in RAM and use it for the code
never-obsolete

Paragoomba








Since: 05-14-06
From: AZ

Last post: 6290 days
Last view: 6290 days
Posted on 05-15-06 10:29 PM Link | Quote
exaclty what i was thinking and said in the email i sent to giga.

i thought we could hack in a ram value to keep track of how many frames have gone by since the last flash, which would also be used to keep track of how many frames the screen has been white.

as for flashing the background just hack into the NMI a:

    jmp $abs


which would jump to our own routine that would be stored in some blank space somewhere in the rom. though i dont think we would need to hack the whole palette just do something along the following:


ThunderRoutine:

    lda #$3F ;prepare for writing to VRAM
    sta $2006
    lda #$00
    sta $2006

    lda flashTimer ;figure out what to do
    cmp #128
    bcc NoFlash
    cmp #138
    beq TurnOffFlash

    lda #$00 ;set new pallete color for flashing background
    sta $2007 ;for example i used color entry 0, but in game it would be different

NoFlash:

    inc flashTimer
    rts

TurnOffFlash:

    lda #0 ;reset the counter
    sta flashTimer
    lda oldPalVal ;restore old palette value
    sta $2007
    rts



thats just my idea. of course we would have to do a check for levels and all that other nonsense but you get what im sayin? the code would be a little more complex because lightning does just turn the sky white, it flickers, but thats a rough idea.


(edited by never-obsolete on 05-15-06 09:30 PM)
(edited by never-obsolete on 05-15-06 09:38 PM)
C:/xkas bio.asm
Compiled ASM code








Since: 11-17-05

Last post: 6289 days
Last view: 6288 days
Posted on 05-15-06 11:03 PM Link | Quote
for the counter, just use the original frame counter ($15) and remove the last bit

LDA $15
AND #$80
BNE no flash

tada, a code only run one frame each 128 frame

BTW since it is for smb3, I suggest using the PPU buffer(located at 300+) since it tend to be less buggy than manual PPU write


(edited by Bio on 05-15-06 10:05 PM)
never-obsolete

Paragoomba








Since: 05-14-06
From: AZ

Last post: 6290 days
Last view: 6290 days
Posted on 05-15-06 11:13 PM Link | Quote
is the PPU buffer for sprite dma or for what kinda of information? i have not ever looked at the smb3 rom and how it works, so i was gonna rely on you two to fill me in on what you know about it. as for the frame counter, are you refering to the mmc3 irq counter. or is it something the game manually increments in code?
C:/xkas bio.asm
Compiled ASM code








Since: 11-17-05

Last post: 6289 days
Last view: 6288 days
Posted on 05-15-06 11:19 PM Link | Quote
I think the game code increment it(I've never hacked other NES game) but about the PPU buffer, here how I explained it to Rockman(throught PM)

Originally posted by Bio
Originally posted by DarhkDiaz note
$300~$350 = PPU Buffer. The buffer works as follows. $300 is the current size of the
buffer. $301 and beyond is data for the PPU in the following format: AA AA SS XX XX XX 00
AA = address of PPU to write to, this is written in big endian format.
SS = Size of the data to write.
XX = The actual data itself
00 = End of the PPU Buffer.

basically a subroutine that use the PPU buffer look like this
LDX $300
LDA #$high byte of PPU adress to write to
STA $301,X
LDA #$low byte of PPU adress to write to
STA $302, X
LDA #$size of the data to write
STA $303, X
...then write the data to 304 and above and end the code with this
LDA #$00
STA $last adress you writed to+1,X
LDA $300
CLC
ADC #$number of byte you have written to $3XX
STA $300
RTS

I hope you will get it to work
never-obsolete

Paragoomba








Since: 05-14-06
From: AZ

Last post: 6290 days
Last view: 6290 days
Posted on 05-15-06 11:27 PM Link | Quote
is there a routine that writes and clears the buffer?

i dont think there is a way to write palette data to VRAM without using $2006 and $2007. with a buffer i assume the game waits untill vblank and in the NMI it does all the writing. my suggestion would be to insert a jmp in the NMI so any writes to VRAM would be stable because no rendering would be occuring. though either way would work, its up to you guys im just here to help with the coding.
C:/xkas bio.asm
Compiled ASM code








Since: 11-17-05

Last post: 6289 days
Last view: 6288 days
Posted on 05-15-06 11:37 PM Link | Quote
well, you probably know the NES more that I do, but for a more lazy way, you could use the game Flash timer located at $7CFB , this will make the bg flash through rainbow colors. If it's above 80, it flash the 9th palette instead.


(edited by Bio on 05-15-06 10:39 PM)
never-obsolete

Paragoomba








Since: 05-14-06
From: AZ

Last post: 6290 days
Last view: 6290 days
Posted on 05-15-06 11:43 PM Link | Quote
yeah but you know the game better than i do so we gotta find a middle ground. what does the flash timer do, alter palettes? and if so, does it accomplish the flash we want? and this msgboard crap is annoying we need find a faster way to communicate in real time.
C:/xkas bio.asm
Compiled ASM code








Since: 11-17-05

Last post: 6289 days
Last view: 6288 days
Posted on 05-15-06 11:53 PM Link | Quote
what the flash time basicaly do is change the BG pallete depending of the value in it, and then decrease that value, the original value is restored when the value reach 00, in the original game, it used when you collect a ? sphere(after beating a boom-boom) and when bob-bomb explode
Originally posted by never-obsolete
msgboard crap is annoying we need find a faster way to communicate in real time.

we could use AIM, MSN or another instant messenger


(edited by Bio on 05-15-06 10:54 PM)
never-obsolete

Paragoomba








Since: 05-14-06
From: AZ

Last post: 6290 days
Last view: 6290 days
Posted on 05-15-06 11:55 PM Link | Quote
the only thing i have is irc but i can get one of the other which would u prefer? and have you heard from giga this was his original idea?
HyperHacker

Star Mario
Finally being paid to code in VB! If only I still enjoyed that. <_<
Wii #7182 6487 4198 1828


 





Since: 11-18-05
From: Canada, w00t!
My computer's specs, if anyone gives a damn.
STOP TRUNCATING THIS >8^(

Last post: 6289 days
Last view: 6289 days
Posted on 05-16-06 12:31 AM Link | Quote
You know, having it flash exactly once every 128 frames will probably look like crap. You need to look into random number generation.
never-obsolete

Paragoomba








Since: 05-14-06
From: AZ

Last post: 6290 days
Last view: 6290 days
Posted on 05-16-06 12:38 AM Link | Quote
i was thinking that but this is just a general outline of things to come and with the limitations of the nes i would probably just choose some address in chr data and use that value for the length timer. i dont wanna have to insert a pseudo random number generator because of space issues.
Pages: 1 2 3Add to favorites | Next newer thread | Next older thread
Acmlm's Board - I3 Archive - ROM Hacking - Making Lightning flash in certain levels of Super Mario Bros. 3 |


ABII

Acmlmboard 1.92.999, 9/17/2006
©2000-2006 Acmlm, Emuz, Blades, Xkeeper

Page rendered in 0.081 seconds; used 434.35 kB (max 560.93 kB)