Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,563,437
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 05-08-24 10:37 PM
Guest: Register | Login

0 users currently in SMW Hacking | 1 guest | 1 bot

Main - SMW Hacking - Problems with block New thread | New reply


Buu-Huu
Posted on 01-20-08 08:39 PM Link | Quote | ID: 74334


Level: 26

Posts: 40/113
EXP: 93303
Next: 8972

Since: 11-01-07

Last post: 5423 days
Last view: 5349 days
I have a problem with this block:

LDA $7E0019
CMP #$01
BNE
LDA #$03
STA $7E0019
RTS

It should make you Fire mario if you are just big Mario but it makes you Fire Mario if you're small Mario too. I hope somebody can help me with this code.

GreyMaria
Posted on 01-20-08 08:40 PM Link | Quote | ID: 74335

>implying even the Japanese understand the Japanese
Level: 105

Posts: 850/2851
EXP: 11932941
Next: 329319

Since: 07-13-07

Last post: 4510 days
Last view: 4479 days
Don't you like, have to specify a branch-ahead in bytes for a BNE?

____________________
we're currently experiencing some technical difficulties

Buu-Huu
Posted on 01-20-08 08:44 PM Link | Quote | ID: 74337


Level: 26

Posts: 41/113
EXP: 93303
Next: 8972

Since: 11-01-07

Last post: 5423 days
Last view: 5349 days
I don't think so, wait, here is the part of the tutorial I got it from:

LDA $7E0019 ;At compare you must always load the ram address first, the indirect value.
CMP #$01 ; Big Mario
BNE Return ;If you are NOT big Mario, the opcode will finish by branching to the label Retur
LDA #$xx ;Do stuff here when big Mario
STA $xxxxxx ;Do stuff here when big Mario
*Insert more stuff*
Return:
RTS

See? I copied the whole code and changed it at the second LDA to have the effect I want but somehow it don't works.

GreyMaria
Posted on 01-20-08 08:45 PM Link | Quote | ID: 74338

>implying even the Japanese understand the Japanese
Level: 105

Posts: 851/2851
EXP: 11932941
Next: 329319

Since: 07-13-07

Last post: 4510 days
Last view: 4479 days
The code you pasted does not BNE to Return, nor is there a Return label.

____________________
we're currently experiencing some technical difficulties

Buu-Huu
Posted on 01-20-08 08:49 PM Link | Quote | ID: 74339


Level: 26

Posts: 42/113
EXP: 93303
Next: 8972

Since: 11-01-07

Last post: 5423 days
Last view: 5349 days
So what should I do? Sorry if I'm sounding like a newbie but I'm a newbie. I just started learning ASM today and I don't understand what you mean. Can you paste the correct code?

GreyMaria
Posted on 01-20-08 08:52 PM (rev. 2 of 01-20-08 08:57 PM) Link | Quote | ID: 74342

>implying even the Japanese understand the Japanese
Level: 105

Posts: 852/2851
EXP: 11932941
Next: 329319

Since: 07-13-07

Last post: 4510 days
Last view: 4479 days
I'm a bit rusty with my ASM knowledge, lemme go pull up the help file for ASM.

edit: Here's the ASM code, and then the raw hex for it.

LDA $7E0019
CMP #$01
BNE Return
LDA #$03
STA $7E0019
Return:
RTS

and according to 65c816ref.hlp, this is the raw hex:

AF 19 00 7E C9 01 D0 06 A9 03 8F 19 00 7E 60

If the raw hex doesn't work, try changing D0 06 to D0 05. I still don't quite remember how branches work.

____________________
we're currently experiencing some technical difficulties

Buu-Huu
Posted on 01-20-08 08:52 PM Link | Quote | ID: 74343


Level: 26

Posts: 43/113
EXP: 93303
Next: 8972

Since: 11-01-07

Last post: 5423 days
Last view: 5349 days
OK, thanks.

boingboingsplat
Posted on 01-20-08 11:03 PM Link | Quote | ID: 74363


Giant Koopa
[PREFSTRING:wonderful bounciness]
Level: 74

Posts: 154/1292
EXP: 3637422
Next: 16122

Since: 07-23-07
From: Michicola

Last post: 4854 days
Last view: 4817 days
Posted by Grey Megatron
I'm a bit rusty with my ASM knowledge, lemme go pull up the help file for ASM.

edit: Here's the ASM code, and then the raw hex for it.

LDA $7E0019
CMP #$01
BNE Return
LDA #$03
STA $7E0019
Return:
RTS

and according to 65c816ref.hlp, this is the raw hex:

AF 19 00 7E C9 01 D0 06 A9 03 8F 19 00 7E 60

If the raw hex doesn't work, try changing D0 06 to D0 05. I still don't quite remember how branches work.

Why didn't you just use a compiler to make it into machine code?

____________________
 

Smallhacker
Posted on 01-21-08 01:04 AM Link | Quote | ID: 74404


Panser
Swedish weirdo times eleven

Level: 42

Posts: 303/339
EXP: 494967
Next: 26395

Since: 02-19-07
From: Stockholm, Sweden

Last post: 5197 days
Last view: 5196 days
Posted by boingboingsplat
Why didn't you just use a compiler to make it into machine code?

Because compilers translates high-level languages (such as C) into machine code, while assemblers translates ASM into machine code?

____________________
SMW Central

pieguy1732
Posted on 01-21-08 03:02 AM Link | Quote | ID: 74471


Ptooie
Note: I wasn't here because I wasn't here, not because someone switched the 7 and the 3.
Level: 84

Posts: 267/1711
EXP: 5468276
Next: 193676

Since: 01-04-08

Last post: 5029 days
Last view: 4959 days
If what is up there doesn't work, try taking the 7E off of all the numbers. I've had problems with CMP before when using long addresses. :O

____________________
"There are 3 types of people in this world: Those who can count and those who can't."
Neritic Net

Buu-Huu
Posted on 01-21-08 06:37 AM Link | Quote | ID: 74583


Level: 26

Posts: 44/113
EXP: 93303
Next: 8972

Since: 11-01-07

Last post: 5423 days
Last view: 5349 days
Cool, it worked now, thank you all guys. I didn't knew that I have to insert "Return" in the ASM file too, I thought, in the tutorial it says, I should press return. ^^ Thanks again.

Main - SMW Hacking - Problems with block New thread | New reply

Acmlmboard 2.1+4δ (2023-01-15)
© 2005-2023 Acmlm, blackhole89, Xkeeper et al.

Page rendered in 0.158 seconds. (339KB of memory used)
MySQL - queries: 47, rows: 78/78, time: 0.149 seconds.