Jump to content
IGNORED

Preferred game disassembly/reconstruction toolchain?


Recommended Posts

For stuff I've converted from other systems, IDA Pro (The Interactive Disassembler) comes in really handy.

From memory I've done at least one conversion by just using a memory dump from when the game had finished loading and initialized.

There's other, free disassemblers around which can do a good job.

 

The way I like to approach such a task is to generate initial source that will just reproduce the program near enough to identical to the original software on it's original system.

Once you have that you know you're starting with good code, then start modifying to run on the target system.

Much the same applies is it's just a modification of a game on the original system.  Though with Stellar Shuttle 480i, I implemented that as a bunch of patches.  It's something I'd like to try and tidy up once I find the notes I took about it.

Link to comment
Share on other sites

6 hours ago, Rybags said:

For stuff I've converted from other systems, IDA Pro (The Interactive Disassembler) comes in really handy.

From memory I've done at least one conversion by just using a memory dump from when the game had finished loading and initialized.

There's other, free disassemblers around which can do a good job.

 

The way I like to approach such a task is to generate initial source that will just reproduce the program near enough to identical to the original software on it's original system.

Once you have that you know you're starting with good code, then start modifying to run on the target system.

Much the same applies is it's just a modification of a game on the original system.  Though with Stellar Shuttle 480i, I implemented that as a bunch of patches.  It's something I'd like to try and tidy up once I find the notes I took about it.

Yup, I've been trying to do precisely this, using the available disassemblers I can find.

 

The one that's given me the closest to work from is @ebiguy / @JAC!'s DIS6502 package, but the issues I am having with it, have more to do with the fact that the program itself doesn't render very well on Hi-DPI displays (and the 4.0 test version is very much a rework in progress).

 

-Thom

Link to comment
Share on other sites

For Shamus+, the (sadly never used) Shamus+ HSC edition and my Apshai life meter hack I just used the Altirra debugger to find those parts of the loaded code where the things I were interested in happened and WUDSN to write patch routines that inserted JSRs, etc. to my code (which then duplicated the stuff my JSR replaced before doing its own stuff. 
 

That‘s probably suitable for very small projects and non time-critical code only and would not work with larger programs that don‘t leave as much room for patch code. I think it should be suitable for something like HSC patches that are not time critical. 
 

I found it convenient because it saved me from correctly disassembling most of the game. The source of the patching code is available in the Shamus+ package 
 

(Using this method I never managed to understand or even locate the code that Shamus uses to convert map data to screen data.)

Link to comment
Share on other sites

23 minutes ago, Rybags said:

Shamus rooms are pretty simple, it wouldn't surprise me if it's just a few bytes each for the layout at least.

That‘s right. It uses less than 5 bytes per room. For a detailed description check here. It‘s the code that draws rooms based on these few bytes that eluded me (or which I lacked assembly knowledge and patience to decipher). 

Link to comment
Share on other sites

1 hour ago, DjayBee said:

Did you submit these for Thom's high-score enabled FujiNet images?

The HSC edition wasn‘t FujiNet enabled. It was meant for the High Score Club andjust contains a special scoring algorithm that measures progress within the game so you can‘t rack up points by moving back and forth between two rooms and shooting the re-spawning baddies. 
 

But I should have a look at a FujiNet-enabled edition. 

Link to comment
Share on other sites

17 minutes ago, slx said:

The HSC edition wasn‘t FujiNet enabled. It was meant for the High Score Club andjust contains a special scoring algorithm that measures progress within the game so you can‘t rack up points by moving back and forth between two rooms and shooting the re-spawning baddies. 
 

But I should have a look at a FujiNet-enabled edition. 

If you have something writing to disk, all you need to do is alter the ATR header to allow it to be mounted read-only, and automatically switch to read-write when the high-score sectors are written to:

https://github.com/FujiNetWIFI/fujinet-platformio/wiki/High-Score-storage-for-Legacy-Games

 

The fujinet-high-scores repo contains a high-score-enable utility which can do the patch:

https://github.com/FujiNetWIFI/fujinet-high-scores/tree/main/atari/high-score-enable

 

-Thom

  • Like 1
Link to comment
Share on other sites

13 hours ago, tschak909 said:

If you have something writing to disk, all you need to do is alter the ATR header to allow it to be mounted read-only, and automatically switch to read-write when the high-score sectors are written to:

https://github.com/FujiNetWIFI/fujinet-platformio/wiki/High-Score-storage-for-Legacy-Games

 

The fujinet-high-scores repo contains a high-score-enable utility which can do the patch:

https://github.com/FujiNetWIFI/fujinet-high-scores/tree/main/atari/high-score-enable

 

-Thom

Shamus only keeps a single high score without initials, so I suppose it would need a whole new high score section that communicates with FujiNet. The upside of such a module would be that it could be used with various programs that don’t keep high scores and/or write high scores to disc. Are changed sectors on an ATR the only way to perform entries or would that work through the Network device as well?

 

Edit: I suppose HISCORE.ASM is such a module so I’d just have to convert Shamus to ATR and add that.

Link to comment
Share on other sites

7 hours ago, slx said:

Shamus only keeps a single high score without initials, so I suppose it would need a whole new high score section that communicates with FujiNet. The upside of such a module would be that it could be used with various programs that don’t keep high scores and/or write high scores to disc. Are changed sectors on an ATR the only way to perform entries or would that work through the Network device as well?

 

Edit: I suppose HISCORE.ASM is such a module so I’d just have to convert Shamus to ATR and add that.

The high score enabled bits only use the "Disk" subsystem. I did this to keep the amount of changes and depedencies to a minimum. With the way I came up with, anyone can decide e.g. to deploy the games + web hiscore table at a private party with minimal effort.

-Thom

  • Like 1
Link to comment
Share on other sites

about 10 years ago I also started with saving hiscore in a separate file on disk in old games but in retrospect I see that this was not a good idea.... fujinet can improve this by downloading the saved hiscore in a shared file on the network.

 

ps. tokens counted how many extra lives the player gained in all sessions - game launches were also counted.

  • Like 3
  • Thanks 1
Link to comment
Share on other sites

2 hours ago, xxl said:

about 10 years ago I also started with saving hiscore in a separate file on disk in old games but in retrospect I see that this was not a good idea.... fujinet can improve this by downloading the saved hiscore in a shared file on the network.

Thom's approach combines both.
For easy implementation and to keep independent from the network, high-scores are saved to the disk (image). It is advisable to re-read the high-score data from disk after each game to catch other players' entries in the table.

 

If (and only if) one wants a webpage which shows these high-scores, then a server based process grabs the high-score data and writes it to per-game webpages. This process is based on small per-game "scrapers" which interpret the high-score data from the disk.

 

Perhaps you can contribute your patched/modified games for FujiNet's servers.

Edited by DjayBee
Link to comment
Share on other sites

20 minutes ago, DjayBee said:

Thom's approach combines both.
For easy implementation and to keep independent from the network, high-scores are saved to the disk (image). It is advisable to re-read the high-score data from disk after each game to catch other players' entries in the table.

 

If (and only if) one wants a webpage which shows these high-scores, then a server based process grabs the high-score data and writes it to per-game webpages. This process is based on small per-game "scrapers" which interpret the high-score data from the disk.

 

Perhaps you can contribute your patched/modified games for FujiNet's servers.

Yeah, I run a set of high score enabled games on apps.irata.online tnfs, and store the scores here:

http://scores.irata.online/

 

The source code of the various scrapers are here:

https://github.com/FujiNetWIFI/fujinet-high-scores/tree/main/atari

 

and they're all written in very plain C, no dependencies other than relying on inotify to notify for file changes (the same can be done in win32, I am just not familiar with the API)

 

There is tons of potential here to take all the classic games and bolt high score tables onto them, and have something we can all share and use.

 

-Thom

Link to comment
Share on other sites

If you want something free, there's the NSA's open source Ghidra. It's Java based and apparently supports the 6502. I haven't tried it yet, just reading about it now. I imagine 6502 support to be pretty low on the food chain for it, though.

 

[Edit 1]

Here's one recommendation I found for it here on AtariAge (this forum, actually), from a couple of years ago. Not sure how much it's progressed (6502 support) since then.

 

[Edit 2]

Found this on Github: Ghidra6502

 

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...