 |
|
 |
|
| Posts by ASM |
|
|
|
|
|
|
|
|
Is the dino torch flame part of the dino torch sprite, or is it another sprite/extended sprite? I'd like to use it in a custom sprite I'm making.
Also, I could have sworn there was a disassembly of that sprite here, but I can't find it.
|
|
|
|
Can't edit. I had to wait for someone to reply to post. lol.
I found a workaround (an SMB3 burner sprite I found on teh internetz a long time ago). Shame your dis isn't working. It would be fun to play around with.
How's your dis of the boo buddies coming along? I saw you had documented a bunch of stuff related to that sprite in the RAM map.
|
|
|
|
Ok. I've been working on this for three hours and can't figure it out.
This is supposed to be a graphics routine for a 48x32 sprite, but after the frame index ($1602,x) increases as with any other sprite, things are all out of place. So far, I'm just trying to make it walk correctly. Two frames. Then I'll move on to the other stuff, but for now, I just need help with this.
Code
HORIZ_DISP: db $00,$10,$20 ;facing left
db $00,$10,$20
db $10,$00,$F0 ;facing right
db $10,$00,$F0
VERT_DISP:
db $F0,$F0,$F0
db $00,$00,$00
TILEMAP: db $80,$82,$84 ;frame 1
db $A0,$A2,$A4
db $86,$88,$8A ;frame 2
db $A6,$A8,$AA
SUBGFX
JSR GetDrawInfo ; sets y = OAM offset
LDA $157C,x ; \ $02 = direction
STA $02 ; /
LDA $1602,x ;\ frame index. This is handled in the sprite code.
STA $03 ; /
PHX
LDX #$05 ; Run the loop six times for six tiles
LOOP_START: PHX ; push, current tile
LDA $02 ; \
BNE FACING_LEFT ; | if facing right, index to frame end +=
INX
INX
INX
INX
INX
INX
FACING_LEFT:
LDA $00 ; \ tile x position = sprite x location ($00) + tile displacement
CLC ; |
ADC HORIZ_DISP,x ; |
STA $0300,y ; /
PLX ; \ pull, X = index to frame end
LDA $01 ; |
CLC ; | tile y position = sprite y location ($01) + tile displacement
ADC VERT_DISP,x ; |
STA $0301,y ; /
PHX ; \ set current tile
TXA ; | X = index of frame start + current tile
CLC ; |
ADC $03 ; |
TAX ; |
LDA TILEMAP,x ; |
STA $0302,y ; /
LDA #$01 ; tile properties xyppccct, format
LDX $02 ; \ if direction == 0...
BNE NO_FLIP ; |
ORA #$40 ; / ...flip tile
NO_FLIP: ORA $64 ; add in tile priority of level
STA $0303,y ; store tile properties
PLX ; \ pull, current tile
INY ; | increase index to sprite tile map ($300)...
INY ; | ...we wrote 1 16x16 tile...
INY ; | ...sprite OAM is 8x8...
INY ; | ...so increment 4 times
DEX ; | go to next tile of frame and loop
BPL LOOP_START ; /
PLX ; pull, X = sprite index
LDY #$02 ; \ why 02? (460 = 2) all 16x16 tiles
LDA #$05 ; | A = number of tiles drawn - 1
JSL $01B7B3 ; / don't draw if offscreen
RTS ; return
|
|
|
|
Ok. That worked for flipping the tiles (Clipping's off a little facing left, but I can shift the tiles)
The main problem I'm having is the frames.
Frame one is fine.
Frame two (Where $1602,x is increased) is not what is written in the code. Changing the value of the index to anything else makes it worse, and I even start getting tiles from SP1. lol.
|
|
|
|
At this point, the pointer table doesn't sound like a bad idea. This thing will have 5 different frames total. Two walking, two attacking, and one hurt. It all fits in one GFX file (with a projectile), but since it's a boss, it won't be sharing the screen with any other major sprites.
The rest of the code works perfectly. I just need the GFX to work or it's an epic fail.
|
|
|
|
Jimmy, epic. Just epic.
I was watching your other video. Is that yoshi tongue a custom sprite?
|
|
|
|
|
Right clicking to select a tile in the status bar area would be nice. Keeps you from having to search the GFX area for the tile you're looking for if you want to copy a tile that's already up there.
|
|
|
|
|
I got it working. JeRRy86 sent me the basic GFX code for his 48x32 bullet bill, which was much more simple than what I had, and it allowed me to index the frames better. Thanks for the help, guys!
|
|
|
|
Shellface,
The code that handles that can be found at $00E308.
However, to make it slow down, you would need to add more LSR opcodes. There are two now. So you would need to hijack this routine. Try this code.
Code
lorom
header
org $00E2E3 ;\Point Star Palette Control to new patch, also
JML StarPal ;/To keep the game from crashing.
NOP #4
org $00E308
JML Firepal
; -------------------------------------------
org $0FFA01 ; address to put code;;FIND FREESPACE IF NEEDED!!
; -------------------------------------------
db "STAR" ; Write RATS tag
dw Endcodeblock-Startcodeblock
dw Endcodeblock-Startcodeblock^#$FFFF
; -------------------------------------------
Startcodeblock: ; code starts here
; -------------------------------------------
Firepal:
LDA $13 ;\ Frame Counter
LSR ;| These two LSRs
LSR ;| are default in SMW
StarStuff: ;;;;|Break in to restore star code.
LSR ;/ So let's add one to slow it down, (Add More to slow it down even more)
AND #$03 ;\Every three frames
INC A ;|Let's
INC A ;|Increase
INC A ;|Mario's
INC A ;/Palette
JML $00E31A ; Jump Back
StarPal: ;\This is to restore star palette stuff
LDA $13 ;| Or else the game would crash when
CPY #$1E ;/ When star power runs out.
BCC StarStuff
BNE StarOut
JML $00E2EB
StarOut:
JML $00E30C
; -------------------------------------------
Endcodeblock: ; code ends here
; -------------------------------------------
|
|
|
|
I like the new system. I don't thin I will ever use the drop down menu since I only really care about what's on the first and last page of a thread unless I'm actually in the thread reading through it. Even with the old system, I only ever clicked the last number in the thread page index, and now I just click the red arrow (Which I wish was a bit bigger). BUT I love how it unclutters everything! Now the screenshot thread doesn't take up half the screen. lol. Really makes it nice when browsing on my Droid.
This isn't necessarily related to the forums, but I think it would further improve the site, and I mentioned it in one of the mews posts. On the main page, it would be great if the numbers under the "Waiting" columns in the File Statistics table were clickable and took you to their respective "Waiting to be Moderated" pages. This would remove one step from the process if users wanted to test out the latest sprites or whatever that are waiting in the queue.
|
|
|
|
|
You don't upload the ROM. Never upload the ROM because it's illegal. Make an .ips patch with Lunar IPS and upload that in a .Zip file.
|
|
|
|
Oh, well, that's MUCH easier then! lol. Just one byte to change, and no freespace needed.
Code
lorom
header
org $00E2EA ;Branch to different frame count for star speed
db $1F ;change this to $20 for slightly faster speed.
|
|
|
|
|
iRhyiku, you got the status bar all fixed up! Looks great!
|
|
|
|
|
Looks great. I suggest zeroing their X speed while they are hurt because it looks odd for them to be moving while their animation is frozen. And maybe flash through the palette, too.
|
|
|
|
When coding sprites that have more than one action, it helps to index the actions with a sprite status RAM. For example, your sprite has three actions. Walk, throw, and hurt. Separating them with subroutines keeps code from getting mixed up, which is probably what happened somewhere in your sprite.
We will be using $C2,x for the state index in this example.
First, at the top of your code under all the JSR SUB_GFX and SUB_OFFSCREEN and whatnot, create an index to check the timers. It should be the first thing that runs.
Code
LDA Invuln_Timer,x ;if the hurt timer is set
BEQ NOHURT ;the sprite can't be hurt
JSR CheckContact ;if you have a sprite contact routine for
;rocks, then JSR to it here, and when you INC
;the HP also set the hurt timer, which will DEC
;below in the hurt subroutine.
NOHURT:
LDA ThrowTimer,x ;\If the throw timer
CMP #TimeToThrow ;|is not set
BEQ CHECK_HURT ;/then move on.
LDA #$01 ;\otherwise, set the status to #$01
STA $C2,x ;/the throw status
LDA #$10 ;\Set the initial timer for how long to stay
STA $151C,x ;/in the throw state. Can be another RAM if needed
CHECK_HURT: ;Check the hurt timer here
LDA Invuln_Timer,x ;\If the hurt timer
BEQ NORMAL ;/is zero then move on.
LDA #$02 ;\otherwise, set the status to #$02
STA $C2,x ;/the hurt status
STZ $B6,x ;set initial X speed to zero.
LDA #OUCHSOUND ;\Play a hurt sound
STA $1DFC ;/if desired
NORMAL: ;continue code
Now just below this, check the statuses to send you to their respective routines.
Code
LDA $C2,x ;\ Sprite Status RAM.
BEQ WALKING ;/ If it's zero, walk. CMP #$00 is implied.
CMP #$01 ;\ If it's 01
BEQ THROWING ;/ Then throw a rock.
CMP #$02 ;\ If he's hurt
BEQ HURT ;/ Then go to the hurt routine.
RTS ;Return here.
Next, make the routine list.
Code
WALKING:
JSR WALK
RTS
THROWING:
JSR THROW
RTS
HURT:
JSR OUCH
RTS
Finally, we do our routines.
Code
WALK: ;Walking Routine
INC ThrowTimer,x ;Inc the throw timer so that we know when to
;change to its status.
OTHER WALKING STUFF, speed, JSL $01802A, etc.
RTS ;We're done here
THROW: ;Throwing Routine
JSL $01802A ;speed crap
STZ $B6,x ;stop to chuck a rock
STZ ThrowTimer,x ;Zero the throw timer while throwing. It will set
;itself again once we start walking.
LDA $151C,x ;If the time for throwing status
BEQ WALK_AGAIN ;is zero, then branch to reset the status
DEC $151C,x ;otherwise, decrement it.
LDA $151C,x ;Throw Status Timer
CMP #$03 ;is some number below what we set above
BNE NoThrow ;if not, don't throw so that we only throw one rock at a time.
JSR ROCK ;Throw a RAWWWK!
LDA #THROWSOUND ;\Play a Throw sound
STA $1DFC ;/if desired
NoThrow:
RTS ;End of Throw Routine
WALK_AGAIN: ;reset routine
STZ C2,x ;just resets the status to zero, so we walk
RTS
OUCH: ;Hurt Routine
LDA Invuln_Timer,x ;if the hurt timer is zero
BEQ WALK_AGAIN ;Branch to the reset code
DEC Invuln_Timer,x ;otherwise, decrease it every frame.
JSL $01802A ;speed crap
STZ $B6,x ;stop because we're hurt. Ouch, dude!
FLASHING PALETTES IF YOU WANT.
RTS ; End of Hurt Routine.
Hope that all makes sense.
|
|
|
|
|
What knight of time said. That would be great for underground areas.
|
|
|
|
|
Yeah. I've seen it done in some hacks, but no one has ever released a public version.
|
|
|
|
I guess you could check if the level is loading (aka, MARIO START!)
LDA $0100 ;If the Game Mode
CMP #$11 ;Isn't Mario Start
BNE NoZero ;Don't Zero it out.
STZ $YoshiCoinRam (too lazy to look at the patch)
NoZero:
|
|
|
|
|
I've seen much more complex things released. Strange everyone seems to want to keep that one to themselves.
|
|
|
|
How in the world do I keep a regular Magikoopa from spawning after I've killed off the custom version? I can't seem to find it anywhere in the code.
Thanks.
|
|
|
|
|
|
|
|
|
|
 |
|
 |
The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.
Copyright © 2005 - 2013 - SMW Central Legal Information - Link To UsTotal queries: 27
|
|
|
|