Language…
10 users online: acd13141,  AmperSam, Cristian Cardoso, CroNo, fanfan21, Green Jerry, JezJitzu, Maw,  Nanako, tOaO - Guests: 240 - Bots: 361
Users: 64,795 (2,377 active)
Latest user: mathew

Official Hex/ASM/Etc. Help Thread

  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 418
  • 419
  • 420
Just a simple question about coding stuff:

Can I replace this:

LDA $19
CMP #$01
BEQ Return
LDA #$02
STA $1DF9
Return: RTS

With this:

LDA $19
BEQ Return
BRA Other_code

Return: RTS

Other_code:
LDA #$02
STA $1DF9
RTS?

I think LDA $19 BEQ xxx will compare directly #$01 and branch. Is that what it does?
My blog. I could post stuff now and then

My Assembly for the SNES tutorial (it's actually finished now!)
BEQ and BNE check the zero flag, wich is set when the result of an operation equal 0(cmp is actualy a substartion in wich the result isn't stored but flag related to the result are affected). Since lda is an operation, if the value loaded is zero then the zero flag will be set, if not then the zero flag willl be cleared
Sorry... But I didn't get any single thing (Not your fault, my Engrish is up). Could you please simplify it? >_<;;
My blog. I could post stuff now and then

My Assembly for the SNES tutorial (it's actually finished now!)
lda #$00
beq whatever ;beq will branch
lda #$01
beq whatever ;beq won't brach
Ah, thanks for explaining. That cleared up things alot. >.>
My blog. I could post stuff now and then

My Assembly for the SNES tutorial (it's actually finished now!)
Yeah, that used to confuse me too. If you have a Branch command without using CMP first, the comparason defaults to 00.

I had to figure that out by trial and error... No tutorial I ever read explained that one. >_<
It's me!!

High on life is the best high.
i need to divide something in assembler. can someone show me how to do the folowing...

divide this...

LDA $7E:007D
SEC
SBC $7E:00AA

...by this

LDA $7E:007B
SEC
SBC $7E:00B6

and yeah, i asked this forever ago but i didnt get an answer simple enough for retards. so yeah, please do that.
jesus: SNES has hardware divide.

Quote
4204 wl++++ WRDIVL - Dividend C low byte
4205 wh++++ WRDIVH - Dividend C high byte
dddddddd dddddddd
4206 wb++++ WRDIVB - Divisor B
bbbbbbbb

Write $4204/5, then $4206. 16 "machine cycles" (probably 96 master
cycles) after $4206 is set, the quotient may be read from $4214/5, and
the remainder from $4216/7. Presumably, $4204/5 are not altered by this
process, much like $4202.

The division is unsigned. Division by 0 gives a quotient of $FFFF and a
remainder of C.


So that gives you a 16bit dividend and an 8bit divisor. If it's not enough you could always use software, but this is an easy way to do it.

Code
LDA #DIVIDENDLO
STA $4204
LDA #DIVIDENDHI
STA $4305
LDA #DIVISOR
STA $4206

NOP
NOP
NOP
NOP
NOP
NOP
NOP
NOP

LDA $4216
STA RESULTLO
LDA $4217
STA RESULTHI


A quick example^.
o_O

I was wondering if it is possible to have a custom block that reacts to being bumped from below? I'm doing a revision of the early SMB games and it's been kinda nagging my brain that I can't get coins(block type) by bumping them from below.
Krakenskin Leather Works, my Etsy store.
LordVanya, my art page.
FundamentalEssence, my game development page.
That's something you set in BlockTool. There's an integer field that says "Below Offset". If it's -1, nothing will happen. Otherwise, the block code will start at the specified offset (in decimal; watch out). Type 0 to make the code start executing at the beginning of the custom block code, for example.

This has been your Tip of the Day with Schwa.

Now... you must cut down the mightiest tree in the forest... wiiiiiiiiith: a herring! DUNNNNNN!
It's me!!

High on life is the best high.
It, it, it!!! Now be quite! Or I shall have Sir Robin's minstrel sing!

However, I think you misunderstood. Let me explain better...

O=coin
[|]=turn/brick block
M=mario

1)
. O <-coin is on block
. [|]

. M <-Mario is below

-------------------------------------------------------
2)
. * <-Coin is triggered as if Mario grabbed it...
. # #
. # # <-...by bumping or busting the block from below.
. /M\

Can this be done?
Krakenskin Leather Works, my Etsy store.
LordVanya, my art page.
FundamentalEssence, my game development page.
Originally posted by smkdan



ummmm.... what? @_@

yeah, I am not good at asm. like, at all.

is "$4204" like how you divide or something? and wtf is "nop nop nop nop nop"?

also, I dont know what the quotient is going to be. i am doing this to get a slope, like this:



mario y position-sprite y position-------------------->=sprite y speed
__________________________

mario x position-sprite y position-------------------->=sprite x speed



thanks for trying to help and all, i just need an explination for someone who can barely write a block for blocktool.








EDIT: i just realized something. i dont have to divide don't i >_>?
OK. A few questions...

1]Is it possibly to have a block interact with sprites (other than Mario) from below, but not from above?

2]Are there any offset values other than 0 that might be useful towards this end?

3]Is there a document or a list of the known offset values anywhere?

Thanks. =)
Krakenskin Leather Works, my Etsy store.
LordVanya, my art page.
FundamentalEssence, my game development page.
I need a little help.

I needed more letters to edit MARIO START!. I recreated the whole alphabet for that style of letter in an ExGFX file and I want HEX to load the new file so I can use the graphics. I have it saved as ExGFX81.bin. It inserted into the rom just fine, but I can't seem to get HEX to work with it.

The original HEX values are at 02A2E (the value there is 0F originally, which loads GFX0F.bin, obviously). So in order to use my new graphics, do I set 02A2E to 81, or something else?

Thanks!

[?]
I've removed my NoFades patch until I can find the brightness code for Star Road warps.
Originally posted by koala_knight
OK. A few questions...

1]Is it possibly to have a block interact with sprites (other than Mario) from below, but not from above?
no
2]Are there any offset values other than 0 that might be useful towards this end?
the value is the starting adress

3]Is there a document or a list of the known offset values anywhere?
ROM map
Thanks. =)

Dude! Of COURSE you can get the sprite to interact with a block from only one direction! Just have the block code check the sprite's y speed, and RTS if it's past 00 in a certain direction. (Remember, 00 to 7F is down, FF to 80 is up. Use BMI and BPL to help.)

Shame on you, Bio. XD

There is only one punishment we can give Bio for this.

We must spank him! Oh yes, give him a good spanking! And then, spank me as well! And me! And me!

...Geez, what is up with me and the Monty Python? XD
It's me!!

High on life is the best high.
meh, I thought he was mostly asking for an easy way, wich is just no
Originally posted by Schwa
Yeah, that used to confuse me too. If you have a Branch command without using CMP first, the comparason defaults to 00.

I had to figure that out by trial and error... No tutorial I ever read explained that one. >_<

like I previously said, this is done by checking the zero flag, the branch itself make no comparaison and the zero flag is set if the result of any opcode is zero, here some example:
Code
Lda #$00
ldx #$01
BEQ whatever ;won't branch, since the result of ldx #$01 is $01

Lda #$00
ldx #$01
cmp #$00
BEQ whatever ;will branch, since the result of cmp #$00 is $00($00 - $00)

;It's also important to renember that CMP is actualy a disgused 
;substraction in wich the result isn't stored but flag are 
;affacted(BIT is the same except that a AND is performed insted of a
;substraction)

lda #$90
cmp #$11
bpl whatever ;Will branch, since $90 - $11 = $7F, since $7F is under 
;$80, the negative flag isn't set

;the result would be exactly the same if you replaced the CMP by SEC 
;and SBC, execpt that A would've became $7F

Tag (pre) was not closed.
Tag (div) was not closed.
Originally posted by Schwa
Dude! Of COURSE you can get the sprite to interact with a block from only one direction! Just have the block code check the sprite's y speed, and RTS if it's past 00 in a certain direction. (Remember, 00 to 7F is down, FF to 80 is up. Use BMI and BPL to help.)

The problem with this is that a sprite doesn't have to be moving upward to touch the bottom of a block.
Well, true, if the block is not solid... I assumed he was making a solid block though. Maybe I was mistaken. ^_^
It's me!!

High on life is the best high.
Thanks for all the help guys!
I didn't think it would spark a debate.
Before it goes on any further, let me explain myself.
What I ultimately want is coins that work just like in SMB 1 & 3. I haven't found any custom blocks that work the way I want; where Mario can get them by bumping them from below with a turn/brick block. That's why I was asking about how certain things work. =)
Krakenskin Leather Works, my Etsy store.
LordVanya, my art page.
FundamentalEssence, my game development page.
  • Pages:
  • 1
  • 2
  • 3
  • 4
  • 5
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 418
  • 419
  • 420