CPCWiki forum

General Category => Emulators => Topic started by: MaV on 13:49, 15 July 11

Title: Emulator - Disassembly to text files?
Post by: 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
Title: Re: Emulator - Disassembly to text files?
Post by: arnoldemu on 14:10, 15 July 11
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.

Title: Re: Emulator - Disassembly to text files?
Post by: arnoldemu on 14:12, 15 July 11
I believe both winape and javacpc allow you to save dissassembly to a file...
Title: Re: Emulator - Disassembly to text files?
Post by: Devilmarkus on 14:50, 15 July 11
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.
Title: Re: Emulator - Disassembly to text files?
Post by: Executioner on 05:07, 18 July 11
WinAPE is very similar to JavaCPC. Right click, Disassemble, which pops us a box with options for the output destination and format.
Title: Re: Emulator - Disassembly to text files?
Post by: MaV on 10:41, 19 July 11
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.


Title: Re: Emulator - Disassembly to text files?
Post by: Devilmarkus on 10:42, 19 July 11
Sure... But it's easy to remove the generated ORGs in a text file ;)
Title: Re: Emulator - Disassembly to text files?
Post by: arnoldemu on 10:46, 19 July 11
I am curious, what plans have you got?
making a new game?
patching an existing one?
world domination?
Title: Re: Emulator - Disassembly to text files?
Post by: MaV on 12:50, 19 July 11
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! ;)
Title: Re: Emulator - Disassembly to text files?
Post by: 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.

Bryce.
Title: Re: Emulator - Disassembly to text files?
Post by: arnoldemu on 13:02, 19 July 11
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!
Title: Re: Emulator - Disassembly to text files?
Post by: MaV on 13:15, 19 July 11
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. ;)
Title: Re: Emulator - Disassembly to text files?
Post by: redbox on 13:25, 19 July 11
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.
Title: Re: Emulator - Disassembly to text files?
Post by: Gryzor on 13:38, 19 July 11
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 (http://en.wikipedia.org/wiki/Antonio_Salieri)! :D
Btw, I don't like Mozart, but I'm an absolute sucker for his Requiem and a few more minor works.
Title: Re: Emulator - Disassembly to text files?
Post by: Bryce on 13:46, 19 July 11
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 )
Title: Re: Emulator - Disassembly to text files?
Post by: MaV on 14:44, 19 July 11
Back to topic.


@redbox: nice tip! Thanks!


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

Quote from: the page
Additionally worthy of note, but the Amstrad and Spectrum (http://www.worldofspectrum.org/infoseekid.cgi?id=0004867) versions actually surfaced...

Did I miss something?!? Was there actually an Amstrad version that made it to the public?
Title: Re: Emulator - Disassembly to text files?
Post by: 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:


edit: never saw a cpc version of starglider 2. perhaps it was finished but never released  :'(
Title: Re: Emulator - Disassembly to text files?
Post by: norecess on 20:23, 19 July 11
I enjoyed latest album from Mozart. Can't wait for next one  :)
Title: Re: Emulator - Disassembly to text files?
Post by: Gryzor on 09:32, 20 July 11
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?)
Title: Re: Emulator - Disassembly to text files?
Post by: MaV on 12:05, 20 July 11
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
Title: Re: Emulator - Disassembly to text files?
Post by: MaV on 12:57, 20 July 11
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).
Title: Re: Emulator - Disassembly to text files?
Post by: arnoldemu on 14:02, 20 July 11
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.
Powered by SMFPacks Menu Editor Mod