Language…
8 users online: Daizo Dee Von, ezdeez85, GRIMMKIN,  Nanako,  Ringo,  Segment1Zone2,  Telinc1, toady - Guests: 233 - Bots: 289
Users: 64,795 (2,375 active)
Latest user: mathew

Official Hex/ASM/Etc. Help Thread

  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 418
  • 419
  • 420
Which level mode must I set to get the Layer 2 in FRONT of Layer 1? Level mode 01 and 02 don't work because then the Layer 2 is behind Layer 1.
If I remember right, Level Mode doesn't determine this sort of thing. Map16 Layer Priority does. A Layer 2 tile will show up in front of Layer 1 if its' Layer Priority is set to "Enabled" in the 16x16 editor. That's why you can have cool effects like rising and falling lava, which covers the terrain, but not the same effect with the actual terrain.

Unless you go and change all the basic terrain tiles to enable Layer Priority... but seriously, don't do that. You'll regret it if there are any spots at all in your hack featuring walk-through dirt, which is pretty darn common. :S

Why do you need Layer 2 in front of Layer 1?
It's me!!

High on life is the best high.
BTW, for layer priority to work on Layer 2, Layer 2 interaction must be enabled.
Why I needed Layer 2 in front of Layer 1: I ripped some tiles from a game with tiles that was in front of the FG. (I call them FGG) I know that I couldn't had a background, but I had many tiles that would fit with Layer 2 to replace it. The thing was, the tiles on Layer 2 went behind Layer 1 but when I used that tiles as Layer 1, the main FG which is on Layer 2 wouldn't scroll correctly and it would look like you run slowly. But I found something better, thanks for the answers, I can use it later.
This is kind of noob,but how do you make a patch that patches certain hex changes made to the rom or applies certain ASM? I dont want it to replace any gfx or anything, just asm or hex changes... Would it be the same as making a regular IPS patch?
Originally posted by TLMB
You know how some block can change into the next Map16 Block when touched, Is there a way to make block change into the previous Map16 block.


I would REALLY appreciate it if some would answer my questions, even if you say it's not possible w/ an explanation.
I wonder what a HFD opcode would do in ASM...
Wish I could help you TLMB, but it seems very few people know how to do that.

I could use some help of my own, again, except this time with sprite hacking. I've been having some fun with the graphics routine, and making animations of random tiles. However, I'm having a problem with 16x32 tiles. Here is my code - quote it to see.

Code
		SUB_GFX
		JSR GET_DRAW_INFO


		LDA $00
		STA $0300,y

		LDA $01
		STA $0301,y

		LDA $13 'frame counter
		CMP #$01 'checks value
		BPL LOAD
		LDA #$C0 'message box tile
		STA $0302,y
		JMP NEXT
LOAD		LDA #$C2 'smiley face tile
		STA $0302,y	
NEXT	        LDA $15F6,x
		PHX
		LDX $02
		BNE NO_FLIP_1
		ORA #$40
NO_FLIP_1	PLX
		ORA $64
		STA $0303,y

		INY
		INY
		INY
		INY

		LDA $00
		STA $0300,y

		LDA $01
		CLC
		ADC #$10
		STA $0301,y

		LDA $13 'frame counter
		CMP #$01 'checks value
		BPL LOAD2
		LDA #$C0 'message box tile
		STA $0302,y
		JMP NEXT2
LOAD2		LDA #$C2 'smiley face tile
		STA $0302,y	
NEXT2	        LDA $15F6,x
		PHX
		LDX $02
		BNE NO_FLIP_2
		ORA #$40
NO_FLIP_2	PLX
		ORA $64
		STA $0303,y

		INY
		INY
		INY
		INY

		LDY #$02		
		LDA #$00		
		JSL $01B7B3
		RTS


My problem is that only the top left 8x8 tile shows up for the second tile. The two underlined commands are where I shift the tile so it appears as a 16x32. I'm not sure how many people here have sprite hacking knowledge, but if anyone knows what's up with this and why the whole tile won't appear, that would be great.

(yes, when bosses corrupt in your hack, you have to revert to learning custom. should be really fun once I get the hang of it though)
What the hell!? I SWEAR I posted here half an hour ago... Dammit, I must've hit Preview instead of Submit. =__=

Well, SNN, it just so happens that I can help you. See the LDA #$00 right before the last JSL at the veeeeery end of your code? Make that an LDA #$01. That value in particular is supposed to say how many 16x16 tiles you're drawing per frame, minus 1. (So 1 tile would be 00, 2 tiles is 01, 4 tiles is 03, etc.) We're drawing 2 tiles, not 1, so that should say #$01, not #$00. If that doesn't work, well, damn, I dunno what's causing it...

Okay, my turn. Here's my latest custom block... She's a sassy young lass I like to call the Ice Slope, and she needs taming.

Originally posted by Ice Slope
LDA #$80 ; turn on slippery flag
STA $86

LDA #$04 ; hold the Down Button and disable other buttons
STA $15

RTS ; finish the code

So what does this do?

The first part sets the Slippery Level Flag to "ON". The reason I need this is because I have icey ground and normal ground in the same level; the icey ground changes the Slippery flag to ON when touched, and the normal ground changes it to Off. It takes some setting up, but now I can have slippery and normal floors in the same level. :) Since this block is ice, it needs to turn it to On when touched.

The second part takes the Controller data and changes it to "holding the Down button". Now keep in mind that this block has "Acts Like" set to 1AA and 1AF, which are left and right slopes respectively. So when the Down button is held, Mario won't duck... he'll slide. So this block makes Mario slide as long as he's standing on it... resulting in an icey slope too slippery to walk on without Mario sliding out of control! Yarr!

So, if this block works so well, what's the problem? Well...

When you press the Jump button when standing on this, Mario still jumps. And I don't want him to do that. What makes things hard is that I have no idea what code to write to disable the buttons while this block is being touched. And THAT... is what I need help with.

If possible, I want to disable A, B, X and Y while Mario's touching this block. That way, Mario can't jump, spin-jump, run or shoot while sliding. Now according to some documents I found on another site, Ram Address $15, which handles various button presses on the controller, is binary-operated... Bitwise 40 means either X or Y is being pressed, and Bitwise 80 means either A or B is pressed. This means Bitwise C0 is a combination of X or Y plus A or B. I need to get it so when 40, 80 or C0 is written to $15 at any time while Mario is touching the block, it counts as 00, but I STILL have to make sure $15 stays at a consistant value of 04 (for the Down button being held).

What do I do?


Edit: HA. I got it to work. Once again I was thinking too hard. Wanna know what I did? Here.

Originally posted by "Improved Ice Slope"

LDA #$80 ; turn on slippery flag
STA $86

LDA #$04 ; hold the Down Button and disable other buttons
STA $15

LDA $14 ; check the frame number
AND #$03
BNE NoSound
LDA #$04 ; play a slipping sound effect every 4th frame
STA $1DFA
NoSound:
LDA $7D ; check to see if Y speed is upward
BMI MovingUp
RTS ; finish the code if it's not
MovingUp:
STZ $7D ; otherwise, stop Mario from moving upward
RTS


See? I added quite a bit of new bits. First we have the slippery flag, as before... Then we have the Down Button code, as before... The third piece, which is new, plays a slipping sound effect every 4 animation frames. I had to do that, hehe... The fourth piece, also new, each frame checks to see if Mario's Y speed is upwards even the slightest bit. If it's not, nothing extra happens; slipping continues as normal. If it IS, it sets Mario's Y speed to zero, preventing the jump from ever happening.

The effect I get in the game is more than satisfactory. While it doesn't prevent Mario from jumping in the first place, it does manage to make his jumps absolutely worthless; he'll get one pixel off the ground and land again. It still plays the jump sound effect, which is annoying, but I think I can actually fix that too by adding the "play sound effect" code to the end of STZ $7D also. I'll test it out now. :)

Edit2: Okay, finally I perfected it. I noticed something seriously wrong earlier... Sometimes Mario could become trapped in a ducking state at the foot of the slope. This fixes that.

Originally posted by Finalized Ice Slope
LDA #$80 ; turn on slippery flag
STA $86

LDA #$04 ; hold the Down Button and disable other buttons
STA $15

LDA $14 ; check the frame number
AND #$03
BNE NoSound
LDA #$04 ; play a slipping sound effect every 4th frame
STA $1DFA
NoSound:
LDA $7D ; check to see if Y speed is upward
BMI MovingUp
RTS ; do nothing if it's not
MovingUp:
LDA $73 ; if Mario's at the bottom of the slope, allow him to jump
BEQ NotDucking
RTS
NotDucking:
STZ $7D ; otherwise, make jumps useless
RTS

The last bit of code I added won't nerf Mario's jump if he's in a ducking state. Since he's NOT in a ducking state while sliding-- just while at the foot of the slope, his jumps will be nerf'd while actually sliding on the slope, but not if he's at the foot of the slope. He'll still be ducking, though, but that's not a MAJOR problem. :)

Man! This code fits together like a perfect jigsaw puzzle!! :DDD

Whaddya think? Should I submit this to the database or what?
It's me!!

High on life is the best high.
I thought of a different method, but your code is much neater. I did something similar to make an invisible block that's completely passable from all directions except below. Your block's pretty cool, though.

On another note, I need some help with a modification. I want to make aversion of Mikeyk's crab that flops over and can be carried after the second hit instead of dying. I'm sure the code I need is in the disassembly of the SMW goomba but I don't know how to identify it or where I'd insert it into the crab code. Any ideas?
Krakenskin Leather Works, my Etsy store.
LordVanya, my art page.
FundamentalEssence, my game development page.
Thanks. :)

I have two possible methods thought out to your idea. The first is to take the Crab sprite, and set up some code that, when stomped, checks to see if it's the second stomp... and if it is, transform the sprite into a Goomba and set it's Status to 09 (stunned). The problem there is that you can't have Goombas in the same level as the Crab, 'cause you'd have to change the Goomba sprite to a Crab sprite to make the carry-graphics look right.

The other method is to forget the Crab code and try to do this from scratch based totally off the SHYGUY code, of all things (specifically, the normal, Non-Rideable Shyguy). The way I'd do it is change the sprite death routine around, so when stomped, it checks some random sprite variable (I'd use $C2,x if it's not already in use), and if it's 00 (hasn't been stomped yet), it changes to 01. If it's 01 (already been stomped once), it takes the Sprite Status and sets it to 09 (stunned). Then I'd go up to the X Speed routine and change it so that the sprite gets its X Speed from a Table depending on that "Hit Points Variable" (the one I said was $C2,x), instead of from the Extra Property 1. From there, if I wanted, I could add bits to make the sprite get back up if enough time has passed, and I could build on THAT to make the sprite take either one or two hits again after getting back up. But if I added that timer I'd have to add in something ELSE to give a visual warning when it was about to get up again (increasing the animation speed is actually kinda tricky, so I'd probably make it bounce up and down or something).

So you see, it's actually not that complicated. XD

I could try to make a sprite like that, but don't blame me if I start running into problems with it before it's finished. That's been happening more often than not with my sprites lately, and it just goes to show you that I'm no mikeyk. >_<
It's me!!

High on life is the best high.
I'd appreciate it if you could try. In the mean time I'll have a look at the shyguy sprite myself and see if I can't figure something out.
And I just thought of something, can't the sprite be set up to use the same timer as the goomba/bob-omb?


Edit:
@Bio: Apologies for posting my OAM question out there. I didn't even notice where I was posting. My bad. =(

All I found on the subject of the OAM at the wiki was that it is where a sprite's data is stored. The OAM page is non-existent and the RAM map only tells me it's address, so... I'm looking for some more in-depth info on it. Thanks.
Krakenskin Leather Works, my Etsy store.
LordVanya, my art page.
FundamentalEssence, my game development page.

Hey guys,

I lost my ASM thread on Nightfall so thought I'd join y'all here ;)

I got a couple of projects planned, but until I get a better grip of what I'm doing I think it's best to just start basic and get a bit of help along the way. I more or less know what I'm doing in terms of getting the file type right and turning it into a block, it's just bits of the code really...

My first question would be:

How can I get an item to appear in the item box ($7E:0DC2, apparently)?

Thanks,

- Danjb
Super Mario World - Moon Edition

This code add an item to your item box:
LDA #$xx (replace with values, see below)
STA $0DC2
RTS

xx = Powerup in box.
01 = Mushroom
02 = Cape (?)
03 = Flower (?)
04 = Star
Others are random stuff I think.
My blog. I could post stuff now and then

My Assembly for the SNES tutorial (it's actually finished now!)

Cheers man! :D

I didn't have anything firmly in my mind but I was thinking maybe a spring board or something, if that's possible? And then there's the shells...

I'll just mess around with it, unless anyone knows a bunch of values that I can put in?



EDIT: Here are my discoveries so far:

LDA #$03
STA $0DC2
RTS

;The brackets describe the image that appears in the item box.
;All were tested on Yoshi's Island 1 (Banzai Bill sprite list).
;00 = Takes away reserve item
;01 = Mushroom
;02 = Flower
;03 = Star
;04 = Cape
;05 = 1-UP (Upside-Down Blue Yoshi Egg)
;06 = Vine sprouts from item box (Upside-Down Cracked Grey Yoshi Egg)
;07 = Firework (Glitchy Graphics)
;08 = Goal Point Bar - does nothing (Upside-Down Cracked Red Yoshi Egg)
;09 = Freezes Mario (Glitchy Graphics)
;10 = Left-Flying Coin Block with Backwards GFX and Glitchy Wings (Glitchy GFX)
;11 = Same as above but goes to and fro (above maybe needs re-examination?)
;12 = Does nothing (Glitchy Graphics)
;13 = A Wiggler! (Glitchy Graphics on YI - different on Forest?)
;14 = Lakitu's Cloud, doesn't run out (Glitchy Graphics)
;15 = Creates an invisible floor and zooms you along, resulting in death (Glitchy GFX)
;16 = Makes crushers appear - these were invisible for me (Glitchy Graphics)
;17 = A bird from Yoshi's house (Glitchy Graphics)
;18 = Puff of smoke from Yoshi's house (Glitchy Graphics)
;19 = Generates smoke and fireplace from Yoshi's house, enables side exit! (Glitchy Graphics)
;20 = It's a Chargin' Chuck! (Glitchy Graphics)
;The block also gives a coin when hit.
Super Mario World - Moon Edition

Just so you know, it's hex so you can store values like 1B and 2D etc. :P
I'm pretty sure that smallhacker said that those value were simply the sprite number to generate - $73
Originally posted by Danjb
....items that appear in the item box.

Look through the old smwcentral bored if it is still up. It has a complete list
Here is the link: SMWC Archive.

Thanks guys.
And just so I understand better, what do LDA and STA mean exactly?

Ok, time for an onslaught of questions! :P

1) How do I make an object play a sound when hit?
2) How do I determine whether an object is reusable or turns into a brown block?
3) How do I make a sprite come out of a block, like a 1-UP?

Cheers,

- Danjb
Super Mario World - Moon Edition

  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 418
  • 419
  • 420