![]() |
![]() |
#1 |
Registered User
Join Date: Jun 2012
Location: mt meru / hyberborea
Posts: 33
|
Dogs of War remake
hi friends, a couple years ago i started a remake of Dogs of War, which is 95% complete. all gameplay, maps and sprites are there, and the original soundtrack is being played via a david whittaker tracker engine specifically made for this purpose (no lame mp3 recordings used here
![]() what kept me from finishing it is the huge amount of work required to manually recreate the "spawnmaps" and routes taken by enemy soldiers. since nobody ever showed up offering help in that task i finally came to the conclusion that the only way forward is to actually use the original gamedata for this case, which basically means attaching a debugger to the game on the amiga and figure out from where it takes the data and how to decode it. since i'm an utter noob when it comes to m68k disassembly, amiga debugging tools and even executable format i was hoping someone here in this forum might be able to help out so i don't have to dig into this myself, which will probably take quite some time, so this project can finally be completed. the source is available here: https://github.com/rofl0r/OpenDOW ![]() |
![]() |
![]() |
#2 | |
This cat is no more
![]() Join Date: Dec 2004
Location: FRANCE
Age: 51
Posts: 7,131
|
you don't always have to do that: you can figure the data out by looking at the leveldata itself (possibly changing it to see what happens). I did that for Magic Pockets and Cadaver and that worked great (except for some details where the disassembly can be required).
Then write a python script to decode level data and convert it to whatever format you want. Quote:
|
|
![]() |
![]() |
#3 | |
Registered User
Join Date: Jun 2012
Location: mt meru / hyberborea
Posts: 33
|
Quote:
the plan is to port it to SDL2 at some point and maybe to some retro consoles like NEC PC engine or NeoGeo. it should also work on the PSP with minor changes since an SDL2 port is available. adding an amiga port is also within reach due to existence of modern gcc toolchains (i will leave this task for someone experienced with amiga development though). |
|
![]() |
![]() |
#4 | |
This cat is no more
![]() Join Date: Dec 2004
Location: FRANCE
Age: 51
Posts: 7,131
|
Quote:
|
|
![]() |
![]() |
#5 |
Registered User
Join Date: Jun 2012
Location: mt meru / hyberborea
Posts: 33
|
right. there would need to be some work done like running a script over the sprite resources to turn them back into bitplane format and changing the scroll and draw code to something more suitable for the amiga.
|
![]() |
![]() |
#6 |
This cat is no more
![]() Join Date: Dec 2004
Location: FRANCE
Age: 51
Posts: 7,131
|
yeah, rewrite it completely
![]() |
![]() |
![]() |
#7 |
Registered User
![]() Join Date: May 2017
Location: AmigaLand
Posts: 394
|
I wonder and not sure at all, but I'd bet the map datas and ennemies waves could be compressed and decompressed on the fly.
|
![]() |
![]() |
#8 | |
research
Join Date: May 2018
Location: Germany
Posts: 21
|
Quote:
Attaching a debugger is another option to answer specific questions, but requires a strong background in assembly. There is a danger that many information/details are lost if the findings are not written down somewhere (e.g. in a wiki/doc/code of the remake). Another option would static code analysis with a disassembler. With Ghidra there is an open source project, that can be extended with custom plug-ins, like the ghidra_amiga_ldr, that allows you to import and analyze executable Amiga hunk files. Well, you can also 'analyze' any binary raw file, e.g. data files, by adding structures, constants, and comments. Furthermore, Ghidra can be run as a service on a server, which gives multiple users the possibility to work on a project in parallel. I already setup a Ghidra server for collaborative analysis of Ambermoon. Therefore, if you want to go that route - even if the static analysis most of the time takes longer than the other options, and some open issues still to solve with AmigaOS m68k analysis in Ghidra - I could create a project on my server for you. I'll be away during the Easter holidays, but I can certainly create a new project and new user accounts via my mobile phone. Links: https://ghidra-sre.org/ https://github.com/lab313ru/ghidra_amiga_ldr https://ghidra.nicode.net/ https://gitlab.com/ambermoon/research/-/wikis/ghidra ps: I created an 'openDOW' project on the server and committed an initial analysis of the loader - but I do not have the original disk to load the code/data tracks (go to 0x000080fa in the loader)... Last edited by NicoDE; 09 April 2022 at 08:25. |
|
![]() |
![]() |
#9 | |||
Registered User
Join Date: Jun 2012
Location: mt meru / hyberborea
Posts: 33
|
Quote:
and it appears the data is saved on raw disk tracks instead. this makes the approach a whole lot more painful. Quote:
otoh i suspect the main in-map loop isn't that much code and it'll probably look at a limited set of mapped tables each time you move the character, so someone well versed in e.g. winuae debugger and m68k will probably find the tables and corresponding code in no time. Quote:
|
|||
![]() |
![]() |
#10 |
This cat is no more
![]() Join Date: Dec 2004
Location: FRANCE
Age: 51
Posts: 7,131
|
diskimages often contain crunched files. wrip from whdload may be used to find them in the image. Then you unpack them and try to figure out what they are
one thing we agree on: this whole java stuff sucks |
![]() |
![]() |
#11 |
research
Join Date: May 2018
Location: Germany
Posts: 21
|
I spent some hours to analyze and document the loader. Something that does not have to be done a second time, because it is still on the server and could be read/corrected/extended by someone... Seems like the tools I'm using are not cool enough for you.
|
![]() |
![]() |
#12 | ||
Registered User
Join Date: Jun 2012
Location: mt meru / hyberborea
Posts: 33
|
Quote:
it's not about cool or not, it's about what i can run on my custom build-from-source distro. to use ghidra i'd have to install a VM with java toolchain in it to build/install ghidra and the custom plugins, which likely requires at least 5 GB of hdd space, which i currently don't have available. Quote:
|
||
![]() |
![]() |
#13 |
This cat is no more
![]() Join Date: Dec 2004
Location: FRANCE
Age: 51
Posts: 7,131
|
you don't need a licence. The tools are free, whdload is free now too.
|
![]() |
![]() |
#14 | |
research
Join Date: May 2018
Location: Germany
Posts: 21
|
Quote:
I'm on the road and cannot do this right now - maybe you could ask a friend who has Java 11+ on his/her machine or you could boot one of the many Linux live systems from a stick. Even better, the latest DOW slave has been released with source code. Last edited by NicoDE; 13 April 2022 at 10:45. |
|
![]() |
![]() |
#15 | |
research
Join Date: May 2018
Location: Germany
Posts: 21
|
Quote:
I don't want to repeat your analysis to make any progress... In the meantime I got my hands on an original disk image. Seems the original has a minimal number of Amiga MFM tracks with OFS to boot the loader, and the rest of the tracks are in IBM MFM format with 10 sectors. The cracked versions obviously converted them to AMFM and hacked the loader. So I analyzed the hacked loader ![]() Last edited by NicoDE; 27 April 2022 at 14:21. Reason: removed obsolete LdrZero structure header |
|
![]() |
![]() |
#16 | |||
Registered User
Join Date: Jun 2012
Location: mt meru / hyberborea
Posts: 33
|
Quote:
Quote:
Quote:
|
|||
![]() |
![]() |
#17 | |
research
Join Date: May 2018
Location: Germany
Posts: 21
|
Quote:
![]() As previously mentioned, the disk includes a mix of standard Amiga MFM 11-sector tracks (standard boot block and minimal OFS file system to run the game loader) and standard IBM MFM 10-sector tracks with the game content (the hacked releases obviously converted them to Amiga MFM tracks and modified the track loader code). I dumped all the track data from the SPS release (attached). The track loader code does not really care about sector headers, numbers, or checksums - it just reads 1A00 aligned words on sync-word 4489, decodes the MFM data in IBM style; (ten times) scans for A1FE, skips some bytes, scans for A1FB, and copies the sector data. The basic disk layout is (the track loader code thinks in single-sided track sequences): Code:
h0c00-00: (Amiga MFM) boot block h0c01-38: (IBM MFM) game data h0c39-41: (Amiga MFM) OFS, startup and loader h0c42-79: (IBM MFM) game data h1c00-00: (unknown, unformatted?) h1c01-38: (IBM MFM) game data h1c39-41: (Amiga MFM) OFS, startup and loader h1c42-79: (IBM MFM) game data Code:
[00008000,00008A9C): loader (relocated) OFS "d.o.w." # copy [0024,0FC4) to 00008000, jmp 00008062 [00020000,0002F000): game main code [00002C00,00011660): game main code (relocated) MFM h0c01-12 # jmp 0002001C, copy [001C,EA7C) to 00002C00, jmp 00002C24 Code:
[00029880,0002AC80): MFM h0c79-79 # highscore [00036E82,00049A82): MFM h1c01-15 [0004B91E,00051D1E): MFM h1c62-66 # cipher: [001C,5E44).b xor 80 [00051762,00061B62): MFM h0c42-54 [0006154C,0007694C): MFM h0c13-29 MFM h0c66-78 # [0006154C,0007194C) [0006AAF8,0006D2F8): MFM h1c59-59, # [0006AAF8,0006BEF8) h1c60-60, # [0006AAF8,0006BEF8) h1c61-61 # [0006AAF8,0006BEF8) MFM h1c33-34, h1c35-36, h1c42-42, # [0006AAF8,0006BEF8) h1c37-38, h1c43-44, h1c45-46, h1c47-48, h1c49-50, h1c51-52, h1c53-54, h1c55-56, h1c57-58 [0006AB5C,0007235C): MFM h1c22-27, h1c16-21, h1c28-32 # [0006AB5C,00070F5C) Or to see it from the other side, as list of disk blocks: Code:
h0c00-00: # Amiga boot block h0c01-12: [00020000,0002F000), [00002C00,00011660) h0c13-29: [0006154C,0007694C) h0c30-38: # ? h0c39-41: # Amiga file system h0c42-54: [00051762,00061B62) h0c55-65: # ? h0c66-78: [0006154C,0007194C) h0c79-79: [00029880,0002AC80) h1c00-00: # unknown, unformatted? h1c01-15: [00036E82,00049A82) h1c16-21: [0006AB5C,0007235C) h1c22-27: [0006AB5C,0007235C) h1c28-32: [0006AB5C,00070F5C) h1c33-34: [0006AAF8,0006D2F8) h1c35-36: [0006AAF8,0006D2F8) h1c37-38: [0006AAF8,0006D2F8) h1c39-41: # Amiga file system h1c42-42: [0006AAF8,0006BEF8) h1c43-44: [0006AAF8,0006D2F8) h1c45-46: [0006AAF8,0006D2F8) h1c47-48: [0006AAF8,0006D2F8) h1c49-50: [0006AAF8,0006D2F8) h1c51-52: [0006AAF8,0006D2F8) h1c53-54: [0006AAF8,0006D2F8) h1c55-56: [0006AAF8,0006D2F8) h1c57-58: [0006AAF8,0006D2F8) h1c59-59: [0006AAF8,0006BEF8) h1c60-60: [0006AAF8,0006BEF8) h1c61-61: [0006AAF8,0006BEF8) h1c62-66: [0004B91E,00051D1E) # cipher: [0004B93A,00051762).b xor 80 h1c67-79: # ? The Ghidra project has been updated with a basic analysis of the game main code block. Last edited by NicoDE; 28 April 2022 at 16:43. |
|
![]() |
![]() |
#18 |
Registered User
Join Date: Jun 2012
Location: mt meru / hyberborea
Posts: 33
|
thanks for looking into this. do you think you might be able to identify the main game loop while playing a mission (e.g. by looking at opcodes in winuae debugger and searching for those bytes in the game "executable"), so we can focus on the subroutines used by it and the data it accesses ?
otherwise this looks as if it would result in a full decompilation project, which is certainly a very nice thing to have by itself, educative etc, though of much greater scale than what's needed for the quite limited set of data i'm after. |
![]() |
![]() |
#19 | |
research
Join Date: May 2018
Location: Germany
Posts: 21
|
Quote:
![]() There is a list of 12 track blocks that are loaded at 0006AAF8 (h1c33-34, h1c35-36, h1c42-42, h1c37-38, h1c43-44, h1c45-46, h1c47-48, h1c49-50, h1c51-52, h1c53-54, h1c55-56, h1c57-58). Since there are 12 missions, this is very likely the mission data you are searching for... analysis pending. |
|
![]() |
![]() |
#20 | |
research
Join Date: May 2018
Location: Germany
Posts: 21
|
Quote:
Data loading for the selected mission happens in the function at 00010ABE. If you want to know which track block are used for what mission: Code:
/* misson map info (map pos, reward, first line) */ [ 1 - 1] 178,72 13000 "SEVERAL MISSILES HAVE BEEN TAKEN" [ 2 - 1] 159,75 10000 "MY YOUNG SON HAS BEEN KIDNAPPED" [ 3 - 1] 163,82 13000 "A TERRORIST GROUP HAS THREATENED" [ 4 - 1] 114,83 7000 "OUR ORGANISATION HAS DISCOVERED" [ 5 - 1] 169,89 6000 "THE SENIOR MEMBER OF OUR FAMILY" [ 6 - 1] 89,99 12000 "PLEASE HELP! MY GIRLFRIEND WHO" [ 7 - 1] 101,100 15000 "A DRUG BARON HAS RECENTLY CAUSED" [ 8 - 1] 205,101 6000 "A GROUP OF TERRORISTS THREATENS" [ 9 - 1] 243,110 14000 "CAN YOU HELP ME? MY SON IS A" [10 - 1] 104,135 5000 "AN INVALUABLE INCA STATUE HAS" [11 - 1] 246,147 5000 "CRIMINALS HAVE STOLEN A CRATE OF" [12 - 1] 175,154 9000 "OUR POLITICAL LEADER HAS BEEN" /* 00010B2A */ struct { uint16_t read_1_index, /* 0-based */ uint16_t read_2_index, /* 0-based */ uint16_t read_3_number, /* 1-based */ uint16_t color } const dow_mis_read_info = { [ 0] = {1, 2, 5, 0x025}, [ 1] = {1, 1, 6, 0x233}, [ 2] = {2, 1, 9, 0x421}, [ 3] = {2, 0, 12, 0x430}, [ 4] = {2, 0, 11, 0x034}, [ 5] = {0, 1, 1, 0x333}, [ 6] = {1, 1, 7, 0x133}, [ 7] = {0, 2, 3, 0x131}, [ 8] = {0, 2, 4, 0x331}, [ 9] = {1, 0, 8, 0x234}, [10] = {0, 2, 2, 0x330}, [11] = {2, 0, 10, 0x410} }; struct DowDiskRead { uint16_t track; uint16_t side; uint16_t count; }; /* 00010BE0 */ struct { struct DowDiskRead read; /* load at 0006AB5C */ uint32_t data; } const dow_mis_read_info_1 = { [0] = {{22, 1, 6}, 0x6501}, [1] = {{16, 1, 6}, 0x6B9F}, [2] = {{28, 1, 5}, 0x593D} }; /* 00010C46 */ struct DowDiskRead /* load at 0006AAF8 */ const dow_mis_read_info_2[3] = { [0] = {59, 1, 1}, [1] = {60, 1, 1}, [2] = {61, 1, 1} }; /* 00010CAC */ struct DowDiskRead /* load at 0006AAF8 */ const dow_mis_read_info_3[12] = { [ 1 - 1] = {33, 1, 2}, [ 2 - 1] = {35, 1, 2}, [ 3 - 1] = {42, 1, 1}, [ 4 - 1] = {37, 1, 2}, [ 5 - 1] = {43, 1, 2}, [ 6 - 1] = {45, 1, 2}, [ 7 - 1] = {47, 1, 2}, [ 8 - 1] = {49, 1, 2}, [ 9 - 1] = {51, 1, 2}, [10 - 1] = {53, 1, 2}, [11 - 1] = {55, 1, 2}, [12 - 1] = {57, 1, 2} }; Last edited by NicoDE; 13 May 2022 at 08:57. |
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dogs of War -like game | Firestone | Looking for a game name ? | 19 | 06 January 2016 16:50 |
Comment from Dogs of War coder on Youtube | laffer | Retrogaming General Discussion | 7 | 29 September 2009 00:16 |
Dogs of War longplay | laffer | Retrogaming General Discussion | 3 | 22 March 2008 00:43 |
Dogs Of War | Macdilla | New to Emulation or Amiga scene | 3 | 25 January 2008 19:16 |
Dogs of War | lhate56k | support.Games | 0 | 28 August 2004 16:33 |
|
|