News:

Printed Amstrad Addict magazine announced, check it out here!

Main Menu
avatar_MaV

Emulator - Disassembly to text files?

Started by MaV, 13:49, 15 July 11

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MaV

Is there a way to copy parts of the disassembly in the debug mode of any emulator?

I'd like to have a functionality where I can mark part of the disassembly in debug mode, then press CTRL-C and paste the text into an editor. The output should preferrably be in a standard assembler format, so that I'll be able to assemble it with little effort. Labels and the like are not necessary, partly because they'd be named incorrectly (label1, label2, ...) partly because the adresses will still have to be identified if the binary has not been programmed by myself.

I can't seem to find an emulator that does that. :/

PS: Yep, call me a lazy bastard, but I don't like the idea of retyping every single instruction. :P
Black Mesa Transit Announcement System:
"Work safe, work smart. Your future depends on it."

arnoldemu

Quote from: MaV on 13:49, 15 July 11
Is there a way to copy parts of the disassembly in the debug mode of any emulator?

I'd like to have a functionality where I can mark part of the disassembly in debug mode, then press CTRL-C and paste the text into an editor. The output should preferrably be in a standard assembler format, so that I'll be able to assemble it with little effort. Labels and the like are not necessary, partly because they'd be named incorrectly (label1, label2, ...) partly because the adresses will still have to be identified if the binary has not been programmed by myself.

I can't seem to find an emulator that does that. :/

PS: Yep, call me a lazy bastard, but I don't like the idea of retyping every single instruction. :P
I will add this to arnold's debugger.

My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

arnoldemu

I believe both winape and javacpc allow you to save dissassembly to a file...
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Devilmarkus

#3
In JavaCPC's debugger you just mark the area of disassembly, do a right click into the disassembly and select "Save..."

It also adds the "ORG ....." to the stored disassembly...

You can also disassemble RAM contents or Files with the built-in Z80 assembler.
These files you can store as .asm files, too, of course.
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

Executioner

WinAPE is very similar to JavaCPC. Right click, Disassemble, which pops us a box with options for the output destination and format.

MaV

Thank you, guys!

The solution for WinAPE is exactly what I was looking for. :)

One suggestion: Since I'm normally copying more than one part of code, I tend to delete the "ORG" statements. They usually get in the way. Once I've disassembled the code completely, I also usually set the code to another part of memory.
Now, I don't know if I'm the exception rather than the rule but I could happily live without the automatic "ORG" insertion.


Black Mesa Transit Announcement System:
"Work safe, work smart. Your future depends on it."

Devilmarkus

Sure... But it's easy to remove the generated ORGs in a text file ;)
When you put your ear on a hot stove, you can smell how stupid you are ...

Amstrad CPC games in your webbrowser

JavaCPC Desktop Full Release

arnoldemu

I am curious, what plans have you got?
making a new game?
patching an existing one?
world domination?
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

MaV

Quote from: Devilmarkus on 10:42, 19 July 11
Sure... But it's easy to remove the generated ORGs in a text file ;)

No, it gets very tedious. And I don't want to use text files, when I want to copy more than one disassembled part of code. That also gets very tedious, having to open the saved disassembly only to copy it to another code.

I'd simply like to copy/paste the code to an editor, just like in WinAPE.


@arnoldemu: research *cough* *cough* I'm starting with Starglider. Hm, world domination. I like that! ;)
Black Mesa Transit Announcement System:
"Work safe, work smart. Your future depends on it."

Bryce

Previous Austrian attempts at world domination didn't go too well :D I think you should stick to research.

Bryce.

arnoldemu

Quote from: MaV on 12:50, 19 July 11
@arnoldemu: research *cough* *cough* I'm starting with Starglider. Hm, world domination. I like that! ;)

you're converting starglider 2 to the cpc?

Nice!
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

MaV

Quote from: Bryce on 12:58, 19 July 11
Previous Austrian attempts at world domination didn't go too well :D I think you should stick to research.

Ouch!
Well, actually Mozart conquered the world with music! ;)


@arnoldemu: Well, actually ... I mean I didn't ... 2 ... is good ... not sure ... wait, what's that bug doing in my ear. ;)
Black Mesa Transit Announcement System:
"Work safe, work smart. Your future depends on it."

redbox

Another thing worth bearing in mind with the WinApe disassembler is that also when you right click you can choose "Mark as Data" before you disassemble.


This way, if you find some data (such as a sprite) you can turn it into DEFB statements which makes it much easier to understand (and of course re-assemble) later.

Gryzor

Quote from: MaV on 13:15, 19 July 11
Ouch!
Well, actually Mozart conquered the world with music! ;)

And see how it all ended for him! :D
Btw, I don't like Mozart, but I'm an absolute sucker for his Requiem and a few more minor works.

Bryce

I'm a big fan of his Reqium too, but only when it's done with a Choir :)

Bryce.

(I think that's the most off topic we've ever got :D )

MaV

Back to topic.


@redbox: nice tip! Thanks!


http://www.gtw64.co.uk/Pages/s/Review_Starglider2.php

Quote from: the page
Additionally worthy of note, but the Amstrad and Spectrum versions actually surfaced...

Did I miss something?!? Was there actually an Amstrad version that made it to the public?
Black Mesa Transit Announcement System:
"Work safe, work smart. Your future depends on it."

arnoldemu

reminds me of my idea to get pentagram to the cpc.

take the cpc version of knightlore and the spectrum version. diff them.

( I actually partially attempted this and the code is in different locations, not much is actually different ;) )

now take the spectrum version of pentagram and try and merge the code back in until we get a cpc version.

once done, make a huge patch/poke (over the spectrum version + special loader) to avoid copyright problems  :laugh:


edit: never saw a cpc version of starglider 2. perhaps it was finished but never released  :'(
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

norecess

I enjoyed latest album from Mozart. Can't wait for next one  :)

Gryzor

Quote from: norecess on 20:23, 19 July 11
I enjoyed latest album from Mozart. Can't wait for next one  :)

I doubt his career will bounce after his drug addiction.

(wait - what?)

MaV

Quote from: norecess on 20:23, 19 July 11
I enjoyed latest album from Mozart. Can't wait for next one  :)

I'll try to get you a master copy of the next album for a weekly shipment of poutine and a few barrels of sirop d'erable. :P
Black Mesa Transit Announcement System:
"Work safe, work smart. Your future depends on it."

MaV

Quote from: arnoldemu on 14:54, 19 July 11
reminds me of my idea to get pentagram to the cpc.

take the cpc version of knightlore and the spectrum version. diff them.

( I actually partially attempted this and the code is in different locations, not much is actually different ;) )

now take the spectrum version of pentagram and try and merge the code back in until we get a cpc version.

once done, make a huge patch/poke (over the spectrum version + special loader) to avoid copyright problems  :laugh:

I take it that you stopped for some reason...


Hm, copyright. I didn't think of that... might that pose a problem for Starglider?

My process will be similar: compare SG1 CPC with Spectrum then look at SG2 Spectrum and port (hopefully).
Black Mesa Transit Announcement System:
"Work safe, work smart. Your future depends on it."

arnoldemu

#21
Quote from: MaV on 12:57, 20 July 11
I take it that you stopped for some reason...


Hm, copyright. I didn't think of that... might that pose a problem for Starglider?

My process will be similar: compare SG1 CPC with Spectrum then look at SG2 Spectrum and port (hopefully).
I didn't have much time for it and there were other things I needed to do.
Yes copyright would be an issue.
I would be less of an issue if I released a patch that worked on the existing spectrum version.
The patch would load the Spectrum version, then patch it to make cpc version.

EDIT: I already attempted a similar thing a few years back to make a cpc version of atic atac.
It shows the menu, starts the game and crashes.
of course the gfx were converted at run-time in this one.
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

Powered by SMFPacks Menu Editor Mod