Author Topic: Emulator - Disassembly to text files?  (Read 4235 times)

0 Members and 1 Guest are viewing this topic.

Offline MaV

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.097
  • Country: at
  • Ius summum saepe summa est malitia.
  • Liked: 388
  • Likes Given: 822
Emulator - Disassembly to text files?
« on: 15: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
« Last Edit: 15:52, 15 July 11 by MaV »
Black Mesa Transit Announcement System:
"Work safe, work smart. Your future depends on it."

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.335
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2262
  • Likes Given: 3478
Re: Emulator - Disassembly to text files?
« Reply #1 on: 16:10, 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

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.335
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2262
  • Likes Given: 3478
Re: Emulator - Disassembly to text files?
« Reply #2 on: 16:12, 15 July 11 »
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

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Emulator - Disassembly to text files?
« Reply #3 on: 16: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.
« Last Edit: 16:56, 15 July 11 by Devilmarkus »
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

Offline Executioner

  • Supporter
  • 6128 Plus
  • *
  • Posts: 783
  • Country: au
  • WinAPE Developer
    • WinAPE
  • Liked: 391
  • Likes Given: 60
Re: Emulator - Disassembly to text files?
« Reply #4 on: 07: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.

Offline MaV

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.097
  • Country: at
  • Ius summum saepe summa est malitia.
  • Liked: 388
  • Likes Given: 822
Re: Emulator - Disassembly to text files?
« Reply #5 on: 12: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.


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

Offline Devilmarkus

  • Vivid source of indefiniteness
  • 6128 Plus
  • ******
  • Posts: 4.035
  • Country: de
  • WebCPC / JavaCPC developer
    • index.php?action=treasury
    • CPC-Live website
  • Liked: 1014
  • Likes Given: 926
Re: Emulator - Disassembly to text files?
« Reply #6 on: 12:42, 19 July 11 »
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

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.335
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2262
  • Likes Given: 3478
Re: Emulator - Disassembly to text files?
« Reply #7 on: 12:46, 19 July 11 »
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

Offline MaV

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.097
  • Country: at
  • Ius summum saepe summa est malitia.
  • Liked: 388
  • Likes Given: 822
Re: Emulator - Disassembly to text files?
« Reply #8 on: 14:50, 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."

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.335
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4016
  • Likes Given: 419
Re: Emulator - Disassembly to text files?
« Reply #9 on: 14:58, 19 July 11 »
Previous Austrian attempts at world domination didn't go too well :D I think you should stick to research.

Bryce.

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.335
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2262
  • Likes Given: 3478
Re: Emulator - Disassembly to text files?
« Reply #10 on: 15:02, 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

Offline MaV

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.097
  • Country: at
  • Ius summum saepe summa est malitia.
  • Liked: 388
  • Likes Given: 822
Re: Emulator - Disassembly to text files?
« Reply #11 on: 15:15, 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."

Offline redbox

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.751
  • Country: gb
    • redbox
  • Liked: 326
  • Likes Given: 267
Re: Emulator - Disassembly to text files?
« Reply #12 on: 15: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.

Online Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.476
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3089
  • Likes Given: 5685
Re: Emulator - Disassembly to text files?
« Reply #13 on: 15:38, 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.

Offline Bryce

  • The Hardware Guy.
  • Supporter
  • 6128 Plus
  • *
  • Posts: 11.335
  • Country: wf
  • It's not broken, it just hasn't been fixed yet.
    • index.php?action=treasury
  • Liked: 4016
  • Likes Given: 419
Re: Emulator - Disassembly to text files?
« Reply #14 on: 15: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 )

Offline MaV

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.097
  • Country: at
  • Ius summum saepe summa est malitia.
  • Liked: 388
  • Likes Given: 822
Re: Emulator - Disassembly to text files?
« Reply #15 on: 16:44, 19 July 11 »
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."

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.335
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2262
  • Likes Given: 3478
Re: Emulator - Disassembly to text files?
« Reply #16 on: 16: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  :'(
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource

norecess

  • Guest
Re: Emulator - Disassembly to text files?
« Reply #17 on: 22:23, 19 July 11 »
I enjoyed latest album from Mozart. Can't wait for next one  :)

Online Gryzor

  • Administrator
  • 6128 Plus
  • *****
  • Posts: 15.476
  • Country: gr
  • CPC-Wiki maintainer
    • CPCWiki
  • Liked: 3089
  • Likes Given: 5685
Re: Emulator - Disassembly to text files?
« Reply #18 on: 11:32, 20 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?)

Offline MaV

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.097
  • Country: at
  • Ius summum saepe summa est malitia.
  • Liked: 388
  • Likes Given: 822
Re: Emulator - Disassembly to text files?
« Reply #19 on: 14:05, 20 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."

Offline MaV

  • Supporter
  • 6128 Plus
  • *
  • Posts: 1.097
  • Country: at
  • Ius summum saepe summa est malitia.
  • Liked: 388
  • Likes Given: 822
Re: Emulator - Disassembly to text files?
« Reply #20 on: 14:57, 20 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."

Offline arnoldemu

  • Supporter
  • 6128 Plus
  • *
  • Posts: 5.335
  • Country: gb
    • Unofficial Amstrad WWW Resource
  • Liked: 2262
  • Likes Given: 3478
Re: Emulator - Disassembly to text files?
« Reply #21 on: 16:02, 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.
« Last Edit: 16:06, 20 July 11 by arnoldemu »
My games. My Games
My website with coding examples: Unofficial Amstrad WWW Resource