Language…
18 users online: Alex No, ben15420, DanMario24YT, GiraffeKiller, Gmario37, Gorry, Green, Hidincuzimsmokin, JudithPrietht, Metal-Yoshi94, MorrieTheMagpie, rafaelfutbal, Ray Hamilton, Sniwott, VoidCrypt, wayht, WhenUnique, xhsdf - Guests: 296 - Bots: 477
Users: 64,795 (2,371 active)
Latest user: mathew

Official Hex/ASM/Etc. Help Thread

  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 418
  • 419
  • 420
Simple:

levelinitA1:
levelinitA2:
levelinitA3:
levelinitA4:
levelinitA5:
levelinitA6:
levelinitA7:
levelinitA8:
*your code here*



 
This is easier than I thought. Thanks to WhiteYoshiEgg and Kaijyuu, because Kaijyuu helped me in my thread.
Also, WhiteYoshiEgg is a ninja. XD
I'm having trouble setting smkdan's spiritetele block (the one that came with bstd) to the X/Y value that I want

It is still teleporting spirits to tile X=1 Y=1 and I'M TIRED OF THE HASSLE (its also 9:05 PM where I am)
I'm having a bizarre problem that has me totally stumped. I'm trying to use the SNES RBG values from the palette to make certain choices with my sprite, like how the NPC V 3 sprite uses the palette to determine which level to display a message from. I'm trying to get the RBG value based on my sprites initial X position the exact same way as in the NPC 3 sprite. Though when I take the code the gets this value from that sprite, it doesn't work in my sprite. Here's the part that should get the first byte of the RBG value I want in A:

LDA #!MessagePalette ; \
CLC ; | Figure out which palette to use for level
ADC !X_Position,x ; /
STA $2121 ;
LDA $213B ; \ palette to read data
LDA $213B

Where !MessagePalette = $E0 ;read from palette E
and !X_Position = $1504

I have no idea why it needs to LDA $213B twice. But some experimenting showed that if I took one of those lines out in the NPC sprite it wouldn't work properly.

In my sprites init routine I took the following from the npc sprite's init routine to setup X_Position:

LDA $E4,x ; \ Grab X position
LSR A ; |
LSR A ; |
LSR A ; |
LSR A ; |
STA !X_Position,x

I've been experimenting with this a lot. The part of the code I don't understand is the last 3 lines:

STA $2121 ;
LDA $213B ; \ palette to read data
LDA $213B

Looking those up in the RAM map tells me those are part of a large chunk of bytes that are GFX 32 decompressed. I'm writing the palette number I want to read from to $2121 for some reason. I've determined through experimenting that I am writing the correct number there. I'm writing the same value that the NPC sprite code writes there. The problem is when I LDA $213B twice, I always have the value 00, regardless of what the RBG value is for the palette I'm trying to read from. Somehow this code works in the NPC sprite but not in mine. I'm running this code at the start of the main routine just before the tilemap routines are called. I discovered that if I run this code in that spot on the NPC sprite I get the same result: 00. Does anyone know how the palette RBG values work and how you can read them? Help would be greatly appreciated.

EDIT: Problem solved. It was really really weird. Apparantly, only for certain initial sprite x positions, it won't read the proper value only the first time if it is executed during the first call to that sprite's main routine. No idea why. I was reading it every call to main to see if the sprite had been collected or not (if it's collected, erase the sprite). I fixed it by checking to see if this was the first call to main and not doing anything if it was.
Current Project: Puzzleshmup             Links: Twitter | YouTube | Mario Maker
Okay, besides what I said in my earlier post, I have a new question to add: Which areas of pre-existing freespace (i.e. unused data in banks 00-0F) is already used by Lunar Magic or some other tool? For one thing, I notice that the ROM map doesn't list all empty space, but some of it seems to be used while some of it isn't. Lunar Magic, once it has installed all necessary ASM hacks, puts all extra data in banks above 0F, doesn't it? I'm pretty sure that the empty space at the end of banks 0B, 0E, and 0F don't stay empty for long, once Lunar Magic and company have gotten through with them...but then, $01FFBF, $02FFE2, and $04FFB1 aren't even listed. Is there any documentation of this anywhere, of which tools use which empty space? If so, I think it should be easily accessible and expandable, so that if anyone else makes a tool or something, they can add to it.

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

I'm working on a hack! Check it out here. Progress: 64/95 levels.
Is there any easy way change Mario's Palettes (Mario, MFire, Luigi, LFire) (for one frame) simply by storing a value into an adress, or do you have to call a routine or something?
Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
Originally posted by ROM Map
$7E:0D82 2 bytes Pointer Pointer to Mario/Luigi pallete. B2C8=Mario B2DC=Luigi, B2F0=Fire Mario, B304=Fire Luigi
in order to use this, your code should look like this (for making fire mario):
Originally posted by code
REP #$20 ;enter 16 bit mode
LDA #$B2F0 ;Load the palette you want here
STA $0D82 ;Store it to the palette being used
SEP #$20 ; exit 16 bit mode
If you want a different palette, just put a different value where it loads the palette as described above
Originally posted by macks2008
I'm having trouble setting smkdan's spiritetele block (the one that came with BTSD) to the X/Y value that I want

It is still teleporting spirits to tile X=1 Y=1 and I'M TIRED OF THE HASSLE (its also 9:05 PM where I am)

just restating this since it hasn't been answered yet (and so it doesn't get overlooked by a person who only look at the five most recent posts)
If you want to use a completely new palette, one outside of the original ones, you might have to use Roy's Custom Player Palette patch in some form. For instance, you could change it so that it uses a different RAM address, something other than the level numer, to determine which pointer should be used.

Well, I have a question that I already mentioned: Where is the cutoff point for the HeadInside and BodyInside offsets? How many pixels inside the block does the player's head or body have to be to qualify as inside and therefore trigger that offset (but not one of the regular ones like MarioSide or MarioBelow)?

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

I'm working on a hack! Check it out here. Progress: 64/95 levels.
How i can disable the Black Box HDMA when message box appears? This is possible without screwing anything in the game?
If it's HDMA, then I don't think there's an "easy" way to do it. I know HDMA goes away when you do hit a message box, however you probably already knew this and used the HDMA-fix hex edit. HDMA is not one of my strong points so I may be wrong.

You can disable the windowing sure, but layer 3 will still be moved (making tides and whatnot "disappear" still).
Can you put a custom sprite in the item box with a custom block somehow?
Use the Item Box special patch. It let's you do that kinda stuff.
I own a community of TF2 servers!

ASMT - A new revolutionary ASM system, aka 65c816 ASseMbly Thing
SMWCP - SMW Central Presents a Product- tion long name

frog

http://esolangs.org/wiki/MarioLANG
I'm working on a patch that changes mario's palette to Fire Mario no matter what, IF a ram adress flag is set.

Everything is fine except for the fact that the colors are incorrect.

Here's the code:

Code
MARIO_OR_LUIGI:		db $F0,$B2,$04,$B3

MARIO_OR_LUIGI_NORMAL:	db $C8,$B2,$DC,$B2,$C8,$B2,$DC,$B2
                        db $C8,$B2,$DC,$B2,$F0,$B2,$04,$B3



COLOR_ROUTINE:
LDA $79			;checks if the flag is raised.
BEQ NORMAL		;if not, then use the normal routine (which doesn't work either)
LDY $0DB2		;set player 2 flag into Y
REP #$20		;16-bit mode
LDA MARIO_OR_LUIGI,y	;loads fire pallete depending on player 
STA $0D82		;and store it.
SEP #$20		;8-bit mode
BRA END			;end the routine 

NORMAL:
LDA $19				;loads player status into y. 
ASL				;doubles the value (0=small 2=big 4=cape 6=fire)
ORA $0DB3			;get player 2 flag into bit 1.
ASL				;double again.     (0=small 2=player_2 4=big 8=cape 12=fire)
TAY				;store it into Y
REP #$20			;16-bit mode.
LDA MARIO_OR_LUIGI_NORMAL,y	;load palette indexed by status and player 2 flag.
STA $0D82			;and store it
SEP #$20			;8-bit mode
END:		
JML $00E326			;continue on with normal routines.


Also, the NORMAL routine is directly taken from all.log. so I can't understand it...

Waluigi needs his own game, he doesn't even have character!
...
Currently working on Waluigi's Treasure Hunt.
well... there is a slightly easier way to go about this... it looks a little something like this:
Originally posted by Code
LDA $79
BEQ skip
REP #$20
LDA #$B2F0
STA $0D82
SEP #$20
skip:
RTL

If you want it to use Luigi's fire palette if you are luigi, would would look a little something like this:
Originally posted by other code
LDA $79
BEQ skip
LDA $0DB3
BEQ Mario
REP #$20
LDA #$B304
STA $0D82
SEP #$20
BRA skip
Mario:
REP #$20
LDA #$B2F0
STA $0D82
SEP #$20
skip:
RTL

And then JSL to this code somewhere that is run every frame, but NOT $8DC4.
Yes, hi. I have a question regarding the ASM code of the Metroid custom sprite. I know that there are some hacks that incoporate the HP patch and use of the Metroid sprite that drains Mario's HP (0 killing him).

Is it possible to tweak the ASM coding of the Metroid sprite in a non-HP patched hack to perform its routine code in the ASM to drain any and all coins Mario ha sin possession? But, after the coins have been drained to zero, then kill Mario (if he is Small Mario; otherwise first he loses Fire or Cape power if he holds it, and then kill him after)?

I have been thinking of doing this, but I wouldn't know firsthand on what I could do to edit the code in the ASM file without first messing it up. If someone could be of help, would be appriciated, otherwise I'll have to see and figure this out on my own.

Hey, does anyone know of any nuances of code that would cause something to crash the game when put in LevelASM (after a certain section of code runs) but work fine when used as a generator? I'm having this very problem, and I'm stumped. Even the debugger didn't turn up anything that looked odd.

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

I'm working on a hack! Check it out here. Progress: 64/95 levels.
IIRC levelasm doesn't set the bank correctly by default. Check if PHK PLB is being done.
Well, it looks like you're right, the bank isn't changed...but adding the PHB PHK PLB ... PLB wrapper didn't seem to make any difference; the code still crashed. Dang...I really thought that would work, too. Should I post the code?

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

I'm working on a hack! Check it out here. Progress: 64/95 levels.
  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 418
  • 419
  • 420