Language…
12 users online: abhinavkrishna123, DPBOX, Green, Guido_Keller, I'm Poppy, KoJi, l44l, manuel10105, pakkie, ShadowMistressYuko,  Telinc1, The_Uber_Camper - Guests: 163 - Bots: 226
Users: 64,667 (2,405 active)
Latest user: DarthHylian

Official Hex/ASM/Etc. Help Thread

  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 316
  • 317
  • 318
  • 319
  • 320
  • 321
  • 322
  • 323
  • 324
  • 325
  • 326
  • 418
  • 419
  • 420
That's why I don't really like this thread.
Poeple hardly ever look at it.

Anyway, the code I previous code I posted, didn't work.
I figured out the correct way of doing it and just thought it'd be so nice as to share it with anybody who wants to do something similiar.

Here is the code to check if Mario is withing 5 Blocks (X only) of the sprite

Code
	LDA $14E0,x
	XBA
	LDA $E4,x
	REP #$20
	CLC
	ADC.w #$0050 ;The radius times 10
	CMP $94
	BCS Within_1
	BRA Not_Within

Within_1:

	SEC
	SBC.w #$00A0 ;The radius times 20
	CMP $94
	BCC Within
	BRA Not_Within

Within:
	SEP #$20
	;Code for what to do if Mario is within a 5 block radius of the sprite
	
	LDA #$F8
	STA $AA,x
	STZ $B6,x
	JSL $01802A
	RTS

Not_Within:
	SEP #$20


Also, sorry for double posting

Mod edit: Fixed table stretch.


For the record, there's also this (it's written as a subroutine, so if you're only using it once, just edit the branches a bit).

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer
Originally posted by JackTheSpades
Wait, how now?
Do you mean it like this?

Code
LDY #$FF
PHY
TYA
LSR
LSR
TAY
LDA [insert tile size here; use a table if necessary]
	;#$00 for 8x8
	;#$02 for 16x16
STA $0460,y
PLY
JSL $01B7B3		; Call the routine that draws the sprite.


Actually, I meant like this:

Code
; assuming that you haven't changed Y in between GetDrawInfo and here
PHY
TYA
LSR
LSR
TAY
LDA [insert tile size here; use a table if necessary]
	;#$00 for 8x8
	;#$02 for 16x16
STA $0460,y
PLY
LDY #$FF
LDA [insert number of tiles drawn here]
JSL $01B7B3		; Call the routine that draws the sprite.

I guess I should have clarified that.

----------------

I'm working on a hack! Check it out here. Progress: 64/95 levels.
How can I change the YXPPCCCT of Mario (I need it for my block) and what should I use, $7E or $7F (for the same custom block) and are there any mistakes? Yes there are, so what's wrong?
http://pastebay.com/1246432
Warning: Code will be deleted after one month and I it's incomplet.
according to the oam map, mario's top and bottom properties are at $0313 and $0317 respectively. i suggest you not directly store to the addresses; modify only the parts you need via bitstuffing.

2 lazy 2 check code, sorry #smw{x_x}
About the first an the third question: O.k.
About the second question: It's not answered.

BTW: Epic fail with the YXPPCCCT properties (you can usually forget it). I want to look Mario at the direction to left or to right I forget, that can change the direction of Mario too. #w{xD} But good to know.
Would it be safe to use 14A4 (Time until the player advances a diving stage, while flying and holding forward, and time until the player pulls back up a stage, while flying and holding backward.) for a different jump related timer, if flying is no longer being used?
jesus (the user, not the hippie) wanted to ask this question but he had me do it instead because he keeps getting warned for bad posts

<jesus> would ketchup go well on my cheddar-salmon wrap?
Still not helped. (http://pastebay.com/1247003)
EDIT: Managed to resolve the problem myself #ab{:D} I'll make a new post if I need help again.
I've seen some ASM code use square bracket like
Code
STA [$6B],y

or whatnot.
Can someone explain to me, why this is done?
Anime statistic on MyAnimeList:
400 animes completed ✓
6000 episodes completed ✓
100 Days completed ✓
... what even am I doing with my life?
The square brackets indicate long indirect addressing. Basically, it takes the 24-bit value of the RAM address in the brackets, and uses that as the address.

For example, suppose that I have
Code
	LDA #$37
	STA $00
	LDA #$42
	STA $01
	LDA #$7F
	STA $02

Then
Code
	STA [$00],y

would act the same as
Code
	STA $7F4237,y

ignoring the fact that there is no such addressing mode like that.
I see, so it's like a pointer than.
Thanks.
Anime statistic on MyAnimeList:
400 animes completed ✓
6000 episodes completed ✓
100 Days completed ✓
... what even am I doing with my life?
I'm wondering if I could get some help with some asm that was shared with me. I'm trying to put together some levelasm that will change some of the configurable properties of a specific sprite number. At the moment, the code is not working. Here is the code:

Code
	LDX #$0B
CheckNextSprite:
	LDA $14C8,x	; Sprite Status Table...
	CMP #$08	;
	BCC Skip	; try BNE?
	LDA $9E,x	; Sprite Number (or Acts Like Sprite Number)
	CMP #$75	; Which Sprite Number should be checked?
	BNE Skip
	
	; Put code that affects the sprite here!

	LDA $166E,x	; Sprite Properties, Third Byte
			;(Layer 2 interaction, water splash, cape/fire vulnerability,
			;palette, graphics page)
	AND #$F1	; retain all non-palette bits (since $F1 is 11110001 in binary).
	ORA #$0A	; enter (new pallete-8)*2 here
	STA $166E,x	; 

Skip:
	DEX
	BPL CheckNextSprite

	RTS


[?] Miscellaneous Helpful Hints
If I moderated your hack, there was apparently a 90 percent chance it was rejected.
if you want to change the palette of a sprite you may want to change
$15F6
Why would writing to the status bar cause parts of objects to display the wrong image?

I'm running a loop to change the middle part of the status bar into a health meter, but when I modify the tiles in the lower half, parts of the midway point, or the yoshi coin load the wrong tiles. This is my loop

Code
	LDX #$07
	HealthBarFillLoop:
		TXA
		LSR A
		CMP !Health
		BPL Empty
		Full:
			LDA #$B8
			STA $0F03,x
			LDA #$BA
			STA $0F1E,x
			DEX
			LDA #$B7
			STA $0F03,x
			LDA #$B9
			STA $0F1E,x
			DEX
			BPL HealthBarFillLoop

		Empty:
			LDA #$BC
			STA $0F03,x
			LDA #$BE
			STA $0F1E,x
			DEX
			LDA #$BB
			STA $0F03,x
			LDA #$00
			STA $0F1E,x
			DEX
			BPL HealthBarFillLoop

You are running into the map16 tile image table with that loop because after failing the first BPL HealthBarFillLoop, it continues on into the next section. Try this:
Code
	LDX #$07
	HealthBarFillLoop:
		TXA
		LSR A
		CMP !Health
		BPL Empty
		Full:
			LDA #$B8
			STA $0F03,x
			LDA #$BA
			STA $0F1E,x
			DEX
			LDA #$B7
			STA $0F03,x
			LDA #$B9
			STA $0F1E,x
			DEX
			BPL HealthBarFillLoop
			BRA Done

		Empty:
			LDA #$BC
			STA $0F03,x
			LDA #$BE
			STA $0F1E,x
			DEX
			LDA #$BB
			STA $0F03,x
			LDA #$BD
			STA $0F1E,x
			DEX
			BPL HealthBarFillLoop
	Done:
Oh jeeze, how did I miss that?

Thanks a lot for the help!
Does anybody know how I get the Map16 vlaue of the block next to the one I'm touching?
I did find this routine, but I don't know what !X_High stands for. I assume !X_pos and !YPos are the 16-bit position I'm interested in.

btw. With "next" I neam the block to it's left or right.
Anime statistic on MyAnimeList:
400 animes completed ✓
6000 episodes completed ✓
100 Days completed ✓
... what even am I doing with my life?
Is there a template code for spawning bounce sprites? I'm trying to make a line guided noteblock but I can't seem to figure that part out.
  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 316
  • 317
  • 318
  • 319
  • 320
  • 321
  • 322
  • 323
  • 324
  • 325
  • 326
  • 418
  • 419
  • 420