Language…
5 users online: Artery, GatoSlashFish,  Lazy, MegaMarioMan9, Zavok - Guests: 79 - Bots: 96
Users: 68,954 (2,364 active)
Latest user: Alma

Official Hex/ASM/Etc. Help Thread

  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 407
  • 408
  • 409
  • 410
  • 411
  • 412
  • 413
  • 414
  • 415
  • 416
  • 417
  • 418
  • 419
  • 420
Does anybody know how to get the "Yoshi Expansion Kit" up and working with lunar Magic 3.3.1?#tb{^V^}
asar will not do anything for me. :(


i need some help with the 32x32 patch i used the quick guide for sa1 (which i think i need to use the 32x32 patch) but i got stuck trying to insert my sprites into SMW, please help
Is it possible to let Mario run without needing to hold the X or Y Button?
Hey! I'm looking for a way to get SMW's Bowser to use custom sprites for Mechakoopa's, Big Steely, and maybe even dropping Peach. I am not savvy with ASM at all. That said, I tried editing the Activate Bowser Scene disassembly by yoshicookiezeus (very crudely). I borrowed code from a few custom sprite generators. I got Bowser to spawn the custom Mechakoopa sprites, however, this freezes bowser and ends the fight. I'd be grateful for any assistance!

Here is what my customized disassembly currently looks like:
Custom Bowser ASM

Where I've been working mostly (lines 1457 to 1479)
Code
+   LDA #$08                        ;\ set new sprite status (normal)
    STA !14C8,y                     ;/
    LDA #!MechakoopaNumber		;\ set new sprite number (Mechakoopa)
if !SpriteExtraBit < 2
		STA !9E,x
else
		STA !7FAB9E,x
		JSL $0187A7|!bank
endif
	JSL $07F7D2|!bank
	LDA #!SpriteExtraBit<<2
	STA !7FAB10,x
	LDA #$01
	STA !14C8,x
	
if !SpriteExtraBit >= 2
		LDA #!SpriteExtraByte1
		STA !extra_byte_1,x
		LDA #!SpriteExtraByte2
		STA !extra_byte_2,x
		LDA #!SpriteExtraByte3
		STA !extra_byte_3,x
		LDA #!SpriteExtraByte4
		STA !extra_byte_4,x
endif

Projects:
- Game Night - Mario Party 3 Game Board
- 3+World (Cancelled - Download Available)
- Super Mario World Beta (2009)
Hi all!
I’m working on a hack that involves the patch titled: Lives to Health Points by “MarioFanGamer”, but whenever Mario gets hit, he takes damage AND loses his powerup status.

I’ve looked through the code in the patch, but wasn’t able to find anything in there that seemed to address this.

Basically, I want to make it so the only way to change powerup states is by picking up a new powerup, or using the item box, not from taking damage.

I’ve looked all over for a patch that does this, but can’t seem to find one. Does anyone have any idea where I should start looking in the memory map for the subroutine that handles Mario getting hurt? I felt like this wouldn’t take me all night to figure out, but dang I’m lost…

Any help is appreciated, thank you!
It depends on whether you have knockback enabled or not. If you have it enabled, all you have to do is to remove all the code within the !UsePowerdown conditional. If you don't have it enabled, look for the following block
Code
	LDA $19
	BEQ +
JML $00F5F3|!bank

+	LDA #!SFX
	STA !SFXPort
	LDA #$7F
	STA $1497|!addr
JML $00F622|!bank

and replace it with
Code
	LDA #!SFX
	STA !SFXPort
	LDA #$7F
	STA $1497|!addr
JML $00F622|!bank
Awesome! That should be exactly the info I need. I should’ve mentioned I tried changing values in/related to the !UsePowerdown conditional, and wasn’t getting the expected result. Pretty sure it’s conflicting with another patch I’m using, so I’ll do a little trial-and-error.

Thank you!
Would anyone happen to know if its possible to have the file select cursor be rendered as two tiles instead of just one?
Don't eat the sandwich


Possible, yes, but it'll take some ASM recoding if you want to do that. The original routine for drawing the cursor only accounts for one tile, so you'd have to modify the routine to draw a second as well. You can find said routine at $009EA4, which I have a commented version of here.

If you want it on all of the menus (not just specifically the file select), I believe this will work:

Code
; YXPCCTT (first two digits) and tile number (second two digits) of the two tiles to use.
!tile1  =   $3D2E   ; left tile
!tile2  =   $3D2E   ; right tile

org $009EB4
    db ($02*2)-1    ; number of tiles to write

org $009E74         ;-- adjust the X position of the cursor in each menu
    dw $51CB-1      ; (unused)
    dw $51E8-1      ; File select
    dw $5208-1      ; Player select
    dw $51C4-1      ; (unused)
    dw $51E5-1      ; File erase

org $009EB9
    autoclean JML WriteTiles

org $009EC5
Return:
    INX #2

freecode
WriteTiles:
    LSR $00
    BCC .blank
    LDA #!tile1 : STA $7F8381,x
    LDA #!tile2 : STA $7F8383,x
    BRA .done
  .blank:
    LDA #$38FC      ; blank tile
    STA $7F8381,x
    STA $7F8383,x
  .done:
    JML Return


Professional frame-by-frame time wizard. YouTube - Bluesky - SMW Glitch List - SMW Randomizer
That worked perfectly, thanks!
Don't eat the sandwich
Can someone point me in the right direction to figure out how to get specific bit values within Bytes? Using this method one could store 8 separate booleans in a single byte (instead of how SMW does it with entire Bytes dedicated to True/False values). I've definitely looked around but I can't find exactly what I'm looking for, or I can't wrap my brain around it if I see it lol.

E.g. something like:
Code
;pseudocode
  !Address = $someaddress
  !FLAG1 = 0x00000001
  !FLAG2 = 0x00000010
if !FLAG1 do something
if !FLAG2 do something also


There's actually quite a few places SMW still uses binary packing, such as in the controller inputs. To help with these kinds of formats, ASM has several binary operands, with the most notable ones being the AND, ORA, and EOR operations. They perform the AND, OR, and XOR operations with the current value of A and some argument (either a constant or an address). If you're not familiar with those operations, you can find more details on their results here.

A common way of doing what you're thinking of is to use AND with a bitmask. A bitmask is just a constant number used to isolate the value of a particular bit. For instance, to check whether bit 4 is set in A, you would do it like this:
Code
	LDA $00		; load some value
	AND #%00010000	; apply a mask to isolate bit 4 (the % symbol dictates a binary value)
	BEQ .notSet	; the result will either be #$00 (bit clear) or #$10 (bit set). BEQ/BNE can be used to branch based on this
	; code to run when bit is set

  .notSet:
	; code to run with bit is clear

For changing the state of a particular bit, you can use AND to clear the bit and ORA to set it. Alternatively, you can use EOR to always flip the state of a bit. Like so:
Code
	LDA $00
	AND #%00000001	; always clear bit 0
	STA $00

	ORA #%00000001	; always set bit 0
	STA $00

	EOR #%00000001	; always flip the state of bit 0
	STA $00

There is also some shorthand opcodes for this sort of action, in the form of TRB and TSB. These two are always used on an address (not a constant) and will either clear (TRB) or set (TSB) the bits specified by the value in A. So the AND/ORA examples above could instead be done like so:

Code
	LDA #%00000001	; indicate bit 0
	TRB $00		; clear bit 0 in $00
	TSB $00		; set bit 0 in $00

The one downside with TRB/TSB, though, is they can only be used with 8-bit ($00) and 16-bit ($0000) addresses, not 24-bit ($7E0000). If you want to support 24-bit addresses, you need to use the AND/ORA approach.

There's a few other quirks with bitwise operations in ASM, but this much will get you through like 80% of coding for it.
(if you want some pointers on where to look for additional details, look into the ASL/LSR/ROL/ROR and BIT opcodes)

Professional frame-by-frame time wizard. YouTube - Bluesky - SMW Glitch List - SMW Randomizer
Ah, exactly what I was looking for. Thank you very much, your explanation was very clear.
  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 407
  • 408
  • 409
  • 410
  • 411
  • 412
  • 413
  • 414
  • 415
  • 416
  • 417
  • 418
  • 419
  • 420