Language…
15 users online:  AmperSam, CroNo, Golden Yoshi, Hammerer, Isikoro, JezJitzu, JPhanto, Mario's GameBase, MorrieTheMagpie, RPG Hacker, signature_steve, sofy lumi, Sparkz314, timothy726, webzinn - Guests: 262 - Bots: 265
Users: 64,795 (2,377 active)
Latest user: mathew

Official Hex/ASM/Etc. Help Thread

  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 404
  • 405
  • 406
  • 407
  • 408
  • 409
  • 410
  • 411
  • 412
  • 413
  • 414
  • 415
  • 416
  • 417
  • 418
  • 419
  • 420
niche questions part 523:
im messing around with fishin' boo's gfx routine, so i decided to hijack it for freedom of length. i ported it to freespace and it works correctly, although it's still reading SMW's tables. you can see the very next step i did here if that helps.

i made a new table for the flame x-flip around line 72 (which is just a duplicate of the smw table for now) and changed line 103 to point to my new table, but smw just does not read it properly for some reason. the flame flashes different colors and spins around. the rest of the sprite is fine, so im not sure what's wrong with my table, setup, or anything else i might have overlooked. i appreciate any second looks at this
and any contributions/corrections to my notes

~<3
Originally posted by chillyfox
i made a new table for the flame x-flip around line 72 (which is just a duplicate of the smw table for now) and changed line 103 to point to my new table, but smw just does not read it properly for some reason.

Hm, I can't seem to reproduce this behavior after applying your patch. That said, educated guess is that you're issue is related to the data bank.

Quick version: change

Code
LDA flamexflip,X
to
Code
LDA.l flamexflip,X

I don't know how familiar you are with data bank hi-jinks, so just in case:



Alternatively, I'm dead wrong and something else is up. Worth a shot, though.



Unrelated observation, but it looks like your code will return from the JSL, then proceed to waste time running 140 NOP commands for no reason. Throw an RTS right after the JSL to return more expediently (JML's in place of JSL : RTL would be even quicker).
LDA.l did the trick. data banks would have been my first guess, but i didnt know how they were influencing this. thanks a lot!

Originally posted by Maarfy
Unrelated observation, but it looks like your code will return from the JSL, then proceed to waste time running 140 NOP commands for no reason. Throw an RTS right after the JSL to return more expediently (JML's in place of JSL : RTL would be even quicker).

oh yeah, actually running the NOPs is completely unnecessary, good catch. i'll move those outside the code. in this particular instance, is it better to JML to my new code and then JML back to a lone RTS? i did JSL, because it was a bit faster to write
~<3
Originally posted by chillyfox
LDA.l did the trick. data banks would have been my first guess, but i didnt know how they were influencing this. thanks a lot!

My pleasure! If you're anything like me, this is a misstep that will be made many more times in the future.

Originally posted by chillyfox
in this particular instance, is it better to JML to my new code and then JML back to a lone RTS? i did JSL, because it was a bit faster to write

"Better" becomes something of a tradeoff, at this stage. If my math is correct, JSL : RTL is 5 bytes, 14 cycles as opposed to JML x 2 at 8 bytes, 8 cycles - one is optimal for space, the other for speed. Subroutines accessed from (and returning to) different spots generally want JSL : RTL, but for stuff that runs in one specific context (say, a Fishin' Boo graphics routine), JML x 2 is arguably superior as space is typically abundant.
By the way, "freecode" is only necessary when you change the data bank to the current bank and access RAM through absolute/16-bit addressing. Since you don't change the data bank to the current one, you can just use "freedata" instead.
Originally posted by Maarfy
Subroutines accessed from (and returning to) different spots generally want JSL : RTL, but for stuff that runs in one specific context (say, a Fishin' Boo graphics routine), JML x 2 is arguably superior as space is typically abundant.

oh right of course, JMLs are inconvenient for shared code, but i'll be more inclined to use faster code otherwise then

Originally posted by MarioFanGamer
By the way, "freecode" is only necessary when you change the data bank to the current bank and access RAM through absolute/16-bit addressing.

this was something else i was wondering about, but i feel like i'll be running into these kind of situations the more complex my coding gets. for now, i feel like im learning a lot, so thank you both!
~<3
hello again lol

im trying to convert the Mode 7 Game Over Screen patch to sa-1 (despite the patch's tags telling you otherwise) and it works, but i ran into a problem described in the comments there. when it fades to OW/title, it shows a white strip of garbage gfx in the center of screen. here's my code, although it shouldnt be too different from the source

i was wondering if there was something i did wrong in my conversion or if sa-1 doesnt like this patch for some other reason
~<3
Hello everybody,

I am trying to make the "Nintendo Presents" screen stay on for approximately 16 seconds.

I have edited the hex code at
Code
$0093C6 1 byte Timer How long "Nintendo Presents" stays on the screen before disappearing. 


I changed the value to FF because I thought that was the maximum for a 1 byte entry, but it doesn't equate to enough time.

However, when I set the next value; $0093C7 to FF as well, the screen stays on for the right amount of time but I get the logo blinking.

Does anyone know if it's possible to simply have the "Nintendo Presents" screen set for 16 seconds? Or another way to do it?

As always, any input is greatly appreciated :)
Hey so I'm trying to make a replication of Bunny Mario from Super Mario Land 2 and as of now I have the basics down, those being the hex edits to the cape powerup (Tapping to glide, removal of spin attack, cape tiles removal, etc.) and the button tap sound effect patched in.

My only issues currently is that Mario's head tile doesn't change upon tapping the button to float, causing it to look strange and unprofessional. Is there a way to implement the animation frames in?

Additionally, would it be possible to disable the floating while ducking? I think that would help reduce the amount of frames required to pull this off.
Don't eat the sandwich
I've consulted the Memory Map and found a few RAM addresses that seem to correspond to what I'm trying to accomplish, but I need a bit of guidance from there.

Originally posted by RAM Map
$7E1B9C 1 byte Overworld Player is entering a warp pipe/star flag.
#$00 = No; #$01 = Yes.

Originally posted by RAM Map
$7E1DE8 1 byte Overworld This is a pointer index used for various tasks during the submap switching scene ($7E:13D9 is #$0A), possible values are:
#$00 = Commence with handling windowing HDMA.
#$01-04 = Update layer 1 on the overworld.
#$05 = Handle palette loading.
#$06 = End with windowing HDMA.
#$07 = Terminate submap switching phase by storing #$04 to $7E:13D9, make eventual submap changes (for example, what music to play).


What I am trying to do is make the red exit tiles act like a warp pipe or star. I want to skip the windowing HDMA that the red tiles do, and as Mario leaves the screen via the tile, run the code that a pipe tile would do so I force the overworld to reload the next map I am entering. My reason for doing this, is I can't get my Overworld Border palettes and tilemap to refresh correctly when using the red exit tiles, but stars/pipes work perfectly.

So does anyone know how to accomplish this task?
Hi

I'm trying to do something with teh ultimate noob boss, and I'm lacking at least one pointers.
You can make it shoot custom sprite aimed at Mario. You can change the speed of the sprites.
But you can't change the frequency of the shooting. And that's a big problem for me.

In the end, I want to set a speed and frequency, and then have to increase at each state of the sprite. The increasing, I think I can make it by duplicating the pointers and just changing a couple of values.
I don't need speed and frequency to be changeable in the options at the top of the files, if I can change the values directly in the pointers, it's ok.

But I don't know how to make that pointer...

Anyone knows?

PS:
the original pointer, shooting a custom sprite at a speed that I can change in the options:
Code
GenCSpr:
	LDA $14
	AND #$7F
	BNE NoSpawn

	STZ $00 : STZ $01	;no XY offset
	STZ $02 : STZ $03	;no XY speed

	LDA #!CustomSprite
	SEC			;set carry - spawn custom sprite
	BRA SpawnDaSpr

I have to then call the pointer to make the sprite aimed at Mario
Super Mario Pants World
Luigi's Lost Levels
New Super Mario Pants World
Luigi's Lost Levels 2 - Back With A Revenge
Luigi's Lost Levels 3 - Electrik Boogaloo
VLDC12 - 72HoKaizo#1
I used wolf fencing to *find* the problem. And made an educated guess to fix it, but I don't think I understand what *is* the problem:

Code
REP #$20
LDA $7F0000
STA $400F34
CLC
SBC #$08
STA $04
SEP #$20


M flag makes SBC 16-bit. Logically the rest of the line #$08 should be read by ASAR as #$0008, (which fixes the crash), but instead I'm assuming it pulls the missing byte from STA and executes db $04 as an opcode? Is this a bug in ASAR or am I just being too lazy for the tool? (Or am I blind to something else that's happening and it's an assembly mistake?)

Edit: on a side note SBC #$00000000000008 also compiles just fine....


It could be the assembler doing this, since you provided only two bytes of SBC's operand in a 16-bit mode. You could always just do SBC #$0008 or SBC.w #$0008 to avoid the issue.





Dream team (feed them, please):








Asar generally assumes the way you wrote it is the way you want it; it's not really possible for it to accurately guess just based on the current context (note: LDA #$xx and LDA #$xxxx are the same opcode in the ROM; the length just depends on whether A is 8- or 16-bit at the time).
Asar will truncate stuff like LDA #$00000008 down to just LDA #$0008 though, since a 16-bit value is the maximum length for that opcode anyway.
(worth noting it also almost always assumes that assembler math should result in a 16-bit value, e.g. "LDA #!val*2" would assemble to LDA #$xxxx)

Like Major said though, you can use the actual opcode size specifiers (.b for $xx, .w for $xxxx, .l for $xxxxxx) to tell Asar the exact size you want to assemble to.

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer
Originally posted by Romano338
Hi

I'm trying to do something with teh ultimate noob boss, and I'm lacking at least one pointers.
You can make it shoot custom sprite aimed at Mario. You can change the speed of the sprites.
But you can't change the frequency of the shooting. And that's a big problem for me.

In the end, I want to set a speed and frequency, and then have to increase at each state of the sprite. The increasing, I think I can make it by duplicating the pointers and just changing a couple of values.
I don't need speed and frequency to be changeable in the options at the top of the files, if I can change the values directly in the pointers, it's ok.

But I don't know how to make that pointer...

Anyone knows?

PS:
the original pointer, shooting a custom sprite at a speed that I can change in the options:
Code
GenCSpr:
	LDA $14
	AND #$7F
	BNE NoSpawn

	STZ $00 : STZ $01	;no XY offset
	STZ $02 : STZ $03	;no XY speed

	LDA #!CustomSprite
	SEC			;set carry - spawn custom sprite
	BRA SpawnDaSpr

I have to then call the pointer to make the sprite aimed at Mario

I thought changing 7F might do it, but instead it changes how many it shot at once. :(
Super Mario Pants World
Luigi's Lost Levels
New Super Mario Pants World
Luigi's Lost Levels 2 - Back With A Revenge
Luigi's Lost Levels 3 - Electrik Boogaloo
VLDC12 - 72HoKaizo#1
Without looking in-deep in the code of the sprite,changing the 7F to a multiple of 2 - 1 might work (3F,1F,07,03...)
Originally posted by Darolac
Without looking in-deep in the code of the sprite,changing the 7F to a multiple of 2 - 1 might work (3F,1F,07,03...)

Indeed I tried with 3F and 1F and it works.
But what do you call "multiple of 2 - 1"?
Hopefully having to use multiples of something won't make me to restricted in possibilities
Super Mario Pants World
Luigi's Lost Levels
New Super Mario Pants World
Luigi's Lost Levels 2 - Back With A Revenge
Luigi's Lost Levels 3 - Electrik Boogaloo
VLDC12 - 72HoKaizo#1
Dunno how it would help but they're called Mersenne Numbers?
Originally posted by Runic_Rain
Dunno how it would help but they're called Mersenne Numbers?

Maths in SMW #smw{-_-2}
Ok I don't think I had heard of it. Prime numbers yes, but Mersenne, nope
Thanks, I'll look into that (well, try, because it doesn't seem too easy)
Super Mario Pants World
Luigi's Lost Levels
New Super Mario Pants World
Luigi's Lost Levels 2 - Back With A Revenge
Luigi's Lost Levels 3 - Electrik Boogaloo
VLDC12 - 72HoKaizo#1
  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 404
  • 405
  • 406
  • 407
  • 408
  • 409
  • 410
  • 411
  • 412
  • 413
  • 414
  • 415
  • 416
  • 417
  • 418
  • 419
  • 420