Language…
9 users online: Alex No,  Atari2.0, Brian94, Danik2343, Darolac, DixyNL, Shiki_Makiro, synthie_cat,  Tahixham - Guests: 233 - Bots: 362
Users: 64,795 (2,377 active)
Latest user: mathew

Official Hex/ASM/Etc. Help Thread

  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 418
  • 419
  • 420
How to make layer 3 scrools faster than layer 1 with this code?
Code
	REP #%00100000
        	LDA.w $1462             ; horz:
        	LSR #2                  ; the higher this number, the slower it will scroll. Remove for same speed as FG
        	CLC : ADC.w #$0000      ; (offset, change this to whatever you want, or remove it if you don't need it)
        	STA.b $22
        	LDA.w $1464             ;vert:
        	LSR #3                  ; the higher this number, the slower it will scroll. Remove for same speed as FG
        	CLC : ADC.w #$00B5      ; (offset, change this to whatever you want, or remove it if you don't need it)
        	STA.b $24
        	SEP #%00100000
	RTS
I would assume that changing the LSRs into ASLs would give the intended effect.
My YouTube channel
Get the official ASMT resource pack here!

What is WAI used for? According to my documents, it suspends all operations until an interrupt occurs. But when could that be useful? How do I know when the next interrupt will occur? (Or am I misunderstanding the definition of interrupts...) And didn't SMW use $10 for basically the same purpose? The following code shows this:

CODE_008069: E6 10 INC $10 ; Skip the following loop
CODE_00806B: A5 10 LDA $10 ; |Loop until the interrupt routine sets $10
CODE_00806D: F0 FC BEQ CODE_00806B ; / to a non-zero value.
CODE_00806F: 58 CLI ; Enable interrupts
CODE_008070: E6 13 INC RAM_FrameCounter ; Increase frame number
CODE_008072: 20 22 93 JSR.W GetGameMode ; The actual game
CODE_008075: 64 10 STZ $10 ; \ Wait for interrupt

The subroutine seems to set $10 to a non-zero value, and then the next part checks $10 and loops infinitely if it is zero. Then $10 is later set to zero. I take it that $10 is set to a nonzero value during an interrupt...but this code comes before the CLI. (Yeah, the ROM map says that NMI sets $10 to a nonzero value, and the I flag, I've heard, does not disable NMI.) But wouldn't WAI serve the same purpose, but use fewer bytes? I have never seen WAI used in a code, not a single one, but I did notice that Smallhacker did not include it in his list of useless opcodes. Is it just such an obscure opcode, or its uses are so limited, that very few people ever use it? Heck, in fact, I'd like to know more about interrupts in general, what exactly they are, how, when, and where they occur, and how to use them to my advantage.

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

I'm working on a hack! Check it out here. Progress: 64/95 levels.
Where is the GAME OVER tilemap loated in the ROM?
How do you use 2 RAM values in conjunction? Do I have to do something like this:

Code
LDA #$INSERTVALUEHERE
STA $0701
STA $2132
Yes, that syntax looks fine.
Not so much a question about me struggling with ASM or whatnot, I've actually succeeded in my first ASM code to use with levelASM but I want it to be in-sinc with the spinning log dynamic sprite by smkdan.

I had a look at through the ASM code but couldn't find how many frames each interval lested for. It may also be in the cfg file but I'm still learning how to use them.

If some-one could take a look at the code (It's a little too long to post) and tell me how many frames each interval lasted for or how to properly find it myself (I seriously have found nothing, the speed at the top of the code is too longa interval) I'd greatly appreciate it.

Thanks.

Disarray!
Your layout has been removed.
Check if it uses the frame counter anywhere ($13 or $14).
Right, thanks for that. *Sigh, I feel so n00bish, ah well, atleast I managed to get the levelASM code to work

Thanks again.

Disarray!
Your layout has been removed.
How i can change the pallete of MAD Wiggler?

NOTE: I can change the pallete of normal Wiggler by Tweaker,but i can't change the pallete of Mad Wiggler.
EDIT: yoshicookiezeus: The code works fine. Thnaks!
Also, where i can find a Turn Block Custom Blcok whre i can add any sprite inside?
@logup, have you tried sprite paint? Also, there's probably another ROM address to change in order to make the mad wiggler change pallette.

Anyway... onto my question... I have been trying to make my levelASM code work in sync with smkdan's spinning log dynamic sprite. In order to do this I need to find out how many frames the interval lasts, I was told to check if it used a frame counter, which it does... sorta.

Here is the code realting to the bit I'm looking for... (not in a code box since that screws up the lines)

';$14 bit 7 set when spinning

Run
JSR SUB_OFF_SCREEN_X0
JSR GET_DRAW_INFO
JSR GFX ;draw sprite

LDA $14C8,x
CMP #$08
BNE Return
LDA $9D ;locked sprites?
BNE Return
LDA $15D0,x ;yoshi eating?
BNE Return

LDA $7FAB10,x ;load extra bit
AND #$04
BEQ Even

;odd
BIT $14 ;frame counter test...
BMI Still
BRA Throw

Even
BIT $14 ;bit 7 clr = staying still
BPL Still

Throw
JSL $01A7DC ;touching Mario?
BCC Return ;nothing if it's not

JSR SUB_VERT_POS
BNE NoInvert

LDA $14 ;low 3 bits designate entry to load
AND #$07
TAY ;as index

LDA XTHROW,y
EOR #$FF
STA $7B ;xspd
LDA YTHROW,y
EOR #$FF ;invert loaded throw byte
STA $7D ;yspd

BRA SkipI ;done inverting

NoInvert
LDA $14 ;low 3 bits designate entry to load
AND #$07
TAY

LDA XTHROW,y
STA $7B ;xspd
LDA YTHROW,y
STA $7D ;yspd

SkipI
RTS'

Anyway, the $14 is the sprite frame rate counter, after that there is a CMP for #$08, I'm guessing this is the frame counter too, I'm not sure, then there are several AND commands which I think relate to the frame counter, I'm not really sure. Could some-one please take a look at this and tell me if my assumptions are correct and if you feel like being really helpful telling me how many frames it lasts for. I'm still new to ASM and to be honest most of that code is gibberish to me.

Any help would be greatly appreciated.

Thanks.

Disarray!
Your layout has been removed.
Originally posted by lolcats439
Where is the GAME OVER tilemap loated in the ROM?


Nevermind, I think I found it in the data table at x012D1, starting at x012EA. It's mixed in with the MARIO/LUIGI START tiles. The top half of the word GAME is there in reverse order, using tiles $05,$04,$03,$02.

Edit: simply changing the tile numbers to a different one while having YY-CHR open with GFX0F as a reference does not work, it loads a completely different tile. If I change the 02 to 0D, it should load the top of the E which is 0D, but it doesn't, it just loads a glitched tile. If I change it to 12, it uses the bottom of the G, when 12 in YY-CHR is the bottom of the V. Strange.

Edit: It seems the GAME OVER tiles get loaded into GFX00 before being displayed. Most of them don't get loaded into the same tile number as they are in GFX0F.

Edit: Some googling shows the entire tilemap has already been discovered.

In the $0090D1 table, the top half of the GAME OVER text is at the PC address x012E5, and are the bytes 4C 4B 4A 03 5F 05 04 03 02. These are in reverse (REVO EMAG). The bottom half is in the next table ($009105) at PC address x01319, and are the bytes 5C 4B 5A 03 5F 05 14 13 12.
I have heard a lot about the FastROM patch being incompatible with quite a bit of other patches and tools, but does anyone have some sort of list of exactly what doesn't work with it?
My YouTube channel
Get the official ASMT resource pack here!

Well, since my last question seemed to be completely ignored (it's only 2 posts up if you wanna read it) I have a new one.

To sharpen my ASM skills I enlisted in the BTSD renovation of the forums to make the original 350 blocks from blocktool to ASM for BTSD.

Anyway, I'm currently coding the instant kill block, I looked about on the RAM map but couldn't find the adress or well anything of how to make Mario die, it could be done by setting the block to act like a muncher or lava but I'm not sure.

If anyone could tell me what to do to activate the mario death action or whether setting the block to act like lava or whatever'd help it'd be greatly appreciated.

Thanks.

Disarray!
Your layout has been removed.
This simple line kills Mario:
JSL $00F606
<blm> zsnes users are the flatearthers of emulation
Sorry, but (S)WYE, I don't really see what else you need added to the code. It feels like the code is finished or something. It doesn't freeze the game now, but it acts as if I never applied the patch.

Code
LDA $02BAC6
PHA
STA $148F
PLA
RTS


Does this code change anything? If not, what am I missing?

Sorry if I bother you, I use Schwa's tutorial. But as you know, I'm just a beginner with ASM.
Current hack:
Super Mario Adventure-5% completed
Demo-96% completed
Quick question:


Do the new block corner offsets only run on the top two corners of the block, or the bottom ones too? IE will it trigger on the top left and right, AND the bottom left and right, or just the top?
Minor question:

Is the Y-position of stuff measured on a per pixel basis?
If not, what?

I'm planning to make layer 2 stop on a certain place.
aran - Graces of Heaven
Outside of some weird modes (5 and 7, I think), yes, it goes pixels.
I'd like to put a spotlight effect on Mario for a gimmick. I know it requires HDMA, but how much knowledge would it take to make something like that, just to know what I'm getting myself into?
  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 418
  • 419
  • 420