Points of Required Attention™
Please chime in on a proposed restructuring of the ROM hacking sections.
Views: 88,497,082
Main | FAQ | Uploader | IRC chat | Radio | Memberlist | Active users | Latest posts | Calendar | Stats | Online users | Search 04-28-24 06:12 PM
Guest: Register | Login

0 users currently in SMW Hacking | 1 guest

Main - SMW Hacking - ASM to Hex New thread | New reply


boingboingsplat
Posted on 09-08-07 07:10 PM Link | Quote | ID: 65026


Giant Koopa
[PREFSTRING:wonderful bounciness]
Level: 74

Posts: 28/1292
EXP: 3634402
Next: 19142

Since: 07-23-07
From: Michicola

Last post: 4844 days
Last view: 4807 days
I've just started learning ASM and I've coded a block that when touched will set the On/Off Flag to Off if one Dragon Coin has been collected. How do I convert it to hex for use with Block Tool?

Here is the code if it helps:
PHA
LDA $1422
CMP #$01
BEQ OnOffFlag
LDA #$01
STA $14AF
OnOffFlag:
PLA
RTS

____________________
 

GreyMaria
Posted on 09-08-07 07:31 PM (rev. 2 of 09-08-07 07:35 PM) Link | Quote | ID: 65027

>implying even the Japanese understand the Japanese
Level: 105

Posts: 403/2851
EXP: 11923048
Next: 339212

Since: 07-13-07

Last post: 4499 days
Last view: 4469 days
65816ref.hlp


That's all you'll need to convert 65816 ASM to hex and back.

No, I don't know where it is.

And don't you want BNE or BPL $#00 (Branch if Plus [Higher than 00]) instead of BEQ? As your current code stands, it would always set the switch to OFF unless you had exactly one dragon coin.

____________________
we're currently experiencing some technical difficulties

blackhole89
Posted on 09-08-07 09:42 PM (rev. 2 of 09-08-07 09:42 PM) Link | Quote | ID: 65031


The Guardian
Moloch whose eyes are a thousand blind windows!
Level: 124

Posts: 526/4196
EXP: 21536893
Next: 299708

Since: 02-19-07
From: Ithaca, NY, US

Last post: 473 days
Last view: 86 days



I uploaded it for good measure.

____________________



boingboingsplat
Posted on 09-08-07 10:05 PM Link | Quote | ID: 65032


Giant Koopa
[PREFSTRING:wonderful bounciness]
Level: 74

Posts: 29/1292
EXP: 3634402
Next: 19142

Since: 07-23-07
From: Michicola

Last post: 4844 days
Last view: 4807 days
So I have to convert it by hand? I was hoping there'd be an easier way. But how do I convert labels to hex? Also, thanks for the tip about BEQ Grey Mario.

____________________
 

Skreeny
Posted on 09-08-07 10:31 PM Link | Quote | ID: 65037


Cobrat
Level: 56

Posts: 534/653
EXP: 1321991
Next: 76185

Since: 02-21-07

Last post: 5343 days
Last view: 4844 days
For BEQs, if I understand properly, you have to calculate how far it'd have to jump and put that in the instruction.

If you don't want to do that, it looks like they have some stuff in the Utilities section of Romhacking.net.

boingboingsplat
Posted on 09-08-07 10:49 PM Link | Quote | ID: 65038


Giant Koopa
[PREFSTRING:wonderful bounciness]
Level: 74

Posts: 30/1292
EXP: 3634402
Next: 19142

Since: 07-23-07
From: Michicola

Last post: 4844 days
Last view: 4807 days
One of those is Xkas, which I already have. How can I use it to convert ASM to Hex?

____________________
 

cory21391
Posted on 09-09-07 06:51 PM Link | Quote | ID: 65080


Flurry
Level: 37

Posts: 101/260
EXP: 331928
Next: 6325

Since: 03-01-07
From: NC, US

Last post: 5131 days
Last view: 5130 days
some assemblers output binary files (like TRASM). Addressing labels are affected when inserted into smw though...

ex.)
jsl label1
lda #$45
sta $2100
rtl
label1:
rtl

if compiled into a bin file, that would be:

0000: 22 0A 80 00 A9 45 8D 00 21 6B 6B

the code would jump to: 00 80 0A; which is more than likely NOT where your code is inserted into SMW.... you're best bet is to just bra and not jump (unless you add code in manually and know where you're going and stuff )

____________________




smkdan
Posted on 09-10-07 11:14 AM (rev. 2 of 09-10-07 11:16 AM) Link | Quote | ID: 65145


Ninji
Level: 36

Posts: 76/238
EXP: 288703
Next: 19407

Since: 05-26-07

Last post: 4065 days
Last view: 4014 days
in.asm contains:

PHA
LDA $1422
CMP #$01
BEQ OnOffFlag
LDA #$01
STA $14AF
OnOffFlag:
PLA
RTS


Then to assemble, first parameter is source, second is output or ROM to patch.

xkas in.asm out.bin


out.bin contains:

48 AD 22 14 C9 01 F0 05 A9 01 8D AF 14 68 60

The ASM file is pretty bare but it's all you need there.

Ailure
Posted on 09-10-07 11:57 AM Link | Quote | ID: 65147

Hats
Steam Board2 group
Level: 121

Posts: 1518/3965
EXP: 19782743
Next: 273953

Since: 02-19-07
From: Sweden, Skåne

Last post: 3303 days
Last view: 2054 days
I'm having a rising urge to rename this thread to "ASM to Machine code". Since that would be the proper term...

____________________
AIM: gamefreak1337, MSN: Emil_sim@spray.se, XMPP: ailure@xmpp.kafuka.org


boingboingsplat
Posted on 09-10-07 01:44 PM Link | Quote | ID: 65150


Giant Koopa
[PREFSTRING:wonderful bounciness]
Level: 74

Posts: 33/1292
EXP: 3634402
Next: 19142

Since: 07-23-07
From: Michicola

Last post: 4844 days
Last view: 4807 days
Well yeah, I've made the block and then I realized it would be more effecient as a generator. So I made it into one. At least I learned how to do this.

____________________
 

Main - SMW Hacking - ASM to Hex New thread | New reply

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

Page rendered in 0.025 seconds. (341KB of memory used)
MySQL - queries: 67, rows: 96/97, time: 0.016 seconds.