Bloodwych Amiga Disassembly

Started by bruceuncle, May 10, 2014, 08:52:16 AM

Previous topic - Next topic

0 Members and 4 Guests are viewing this topic.

Hungry Horace

#75
Ok, so i added the crack to the game without WHDLoad (i.e. direct into the source code) and then recompiled it.

Mostly as a test to see if we had re-sizabel code yet.

There are a few graphical glitches - the bottom graphic for the shield, and the way the characters are being drawn (haywire colours) , but actually nothing major imho.

Hopefully i can locate the code for these two items and see if we still have any outstanding addresses as long-words etc.

Definate progress though :)


EDIT:

First graphical glitch fixed.... one of them-there long addresses!  (this one is for the Avatar/Shield graphic


;move.l #adrL_01000A,d7 ;2E3C0001000A
move.l #$0001000A,d5 ;2A3C00010008




I found a similar one, which appears to jump to the middle of the "level object data" , so i *think* this would need fixing also, but i admit, i don't know what it does (i couldnt see any change as a result of fixing it)

;add.l #adrL_010040,d5 ;068500010040
add.l #$00010040,d5 ;068500010040;



And one more...


;move.l #adrL_04080C,adrEA00B4C0.l ;23FC0004080C0000B4C0
move.l #04080C,adrEA00B4C0.l ;23FC0004080C0000B4C0



This one is an easy spot because #0004080C are the mask colours used throughout the game :)

(probably this one should be set up as a fixed number with EQU eventually - might help spot certain bits of code!)
Quote from: KillerGorillabecause winuae is made of code and your amiga is made of stuff


Hungry Horace

#76
nailed another one... definately at least part of the cause of the graphical glitches:

adrCd00AD2E:
add.l #$000396F0,a1 ;D3FC000396F0 ;Long Addr replaced with Symbol


This is erroneously replaced as a number, and *does* refer to a label :)


I think the label should be GFX_Bodies  (396F0 - $3A4 = $3934C, which appears to be that) ... however, it's not fixing it here, so maybe i've made some other fix above incorrectly, and i should probably revert back to 002 and add  each fix in turn!

edit : (again)

fixed code:

add.l #GFX_Bodies,a1 ;D3FC000396F0


:D

I have a modification to the main menu text which therefore affects the entire game (in terms of offsets) ....   i've also taken out the copy protection, using the above mentioned new code....  the fact that all the graphics now appear correctly, and the game seems to run, is a major breakthrough i think :)
Quote from: KillerGorillabecause winuae is made of code and your amiga is made of stuff


MadMunky

I don't know what any of this means but keep up the good work all, seems like your making good progress in understanding the source. :)

Hungry Horace

Quote from: MadMunky on March 22, 2016, 06:21:40 AM
I don't know what any of this means but keep up the good work all, seems like your making good progress in understanding the source. :)

In summary - fixing the above items, we can now re-compile the amiga BW disassembly.

All of this means more labels are getting put in, slowly building up a more readable source code :)

Quote from: KillerGorillabecause winuae is made of code and your amiga is made of stuff


Hungry Horace

#79
Quote from: Hungry Horace on March 20, 2016, 08:46:35 PM
nailed another one... definately at least part of the cause of the graphical glitches:

adrCd00AD2E:
add.l #$000396F0,a1 ;D3FC000396F0 ;Long Addr replaced with Symbol


This is erroneously replaced as a number, and *does* refer to a label :)


I think the label should be GFX_Bodies  (396F0 - $3A4 = $3934C, which appears to be that) ... however, it's not fixing it here, so maybe i've made some other fix above incorrectly, and i should probably revert back to 002 and add  each fix in turn!

edit : (again)

fixed code:

add.l #GFX_Bodies,a1 ;D3FC000396F0


:D

I have a modification to the main menu text which therefore affects the entire game (in terms of offsets) ....   i've also taken out the copy protection, using the above mentioned new code....  the fact that all the graphics now appear correctly, and the game seems to run, is a major breakthrough i think :)


having another look at tudying some code. Realised i lost the .rs file i had applied these fixes too (glad i posted them here!!)

Only problem is that i cant remember how to do the macro or keyboard shortcuts that let me fix it :S

EDIT: Found... thankfully just a matter of using [V]  ... found in a spereate thread that had been chopped out of this one!
Quote from: KillerGorillabecause winuae is made of code and your amiga is made of stuff


Hungry Horace

Anyone remember how to get the exact BW binary out of the last uploaded source code (v.002) ?!?  I am sure it must just be a DevPac setting i need to change!
Quote from: KillerGorillabecause winuae is made of code and your amiga is made of stuff


Hungry Horace

In order to keep this in an 'on topic' place, here is a link to the source on GitHub

https://github.com/HoraceAndTheSpider/Bloodwych-68k
Quote from: KillerGorillabecause winuae is made of code and your amiga is made of stuff


Hungry Horace

I’ve done a lot of today trying to understand the differences in my compile and the real compile today.

Most of this seems to come down to what ReSource calls “strict pneumonics” - which solves the CMP vs. CMPI problem mentioned by BruceUncle previously. Unfortunately with the option ON these instructions are right and others different. With them OFF it is the same - some differ again.

The good news is that I have a source which I can compile which is relocatable - I was able to add to the main menu text and the game still ran normally, despite clearly pushing everything else in the game (the menu is very early on) further up memory.

I still want us to be working from a “base” asm file which when compiled in DevPac is exactly the same as one of the original binaries, and without warnings etc. What I will likely do therefore is take the working source and manually make the fixes where the differences are. There’s a lot, but maybe I can script some of it.
Quote from: KillerGorillabecause winuae is made of code and your amiga is made of stuff


Hungry Horace

All done

I've just uploaded a version of the source to GitHub which is 100% recompilable to the original, and should be successfully relocatable.

Next job is to improve the labels and the INCBIN data blocks.

There's a few places where labels appear 'missing' - i'll also take a look at what they should be.
Quote from: KillerGorillabecause winuae is made of code and your amiga is made of stuff


Hungry Horace

I’ve moved this project over to GitHub.

I’ve made some great progress on the Standard Bloodwych code, but it’s a shame bit and BruceUncle aren’t around to answer some questions as I have a few issues with the Extended Levels recompiled binary
Quote from: KillerGorillabecause winuae is made of code and your amiga is made of stuff