English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 17 March 2011, 12:10   #1
Hewitson
Registered User
 
Hewitson's Avatar
 
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,772
Fixing Classic BRAT cracktro for more than 512k chip

Hi guys,

I thought trying to fix a small problem with one of my favourite intros would be a good learning experience. With 1mb chip, the scroller becomes invisible for about 50% of the time.

If anyone could give me some tips on why this is happening and the best way to go about fixing it, they'd be very greatly appreciated!

I have attempted to decrunch it with XFDDecrunch but it results in an unexecutable file, which when disassembled crashes the Amiga when I try to reassemble it.

Disassembling the original packed executable and reassembling it works perfectly.

It can be downloaded from here if anyone would be willing to take a quick look at it for me: http://ftp.amigascne.org/pub/amiga/G...Classic-CrBrat

I have also uploaded the disassembly of both the crunched and decrunched executables to the zone.

Thanks in advance

Last edited by Hewitson; 17 March 2011 at 14:53.
Hewitson is offline  
Old 17 March 2011, 15:19   #2
Hewitson
Registered User
 
Hewitson's Avatar
 
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,772
I'm pleased to report I've made some slight progress, adding the option "LP" to xfddecrunch resulted in a decrunched executable that works perfectly.

Unfortunately trying to disassemble this with IRA says "Hunk: 0000fffe - Not Supported" and quits.

I get the same error with the addresses "00000130 48E7FFFE" from D68k.

Last edited by Hewitson; 17 March 2011 at 15:25.
Hewitson is offline  
Old 17 March 2011, 23:07   #3
BippyM
Global Moderator
 
BippyM's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
All that line is doing is the following and there are only 2 instances of this within the code.

Code:
Movem.l d0-d7/a0-a6,-(a7)
BippyM is offline  
Old 18 March 2011, 08:38   #4
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Morning Hewitson

I had a quick look at the two disassemblies.

If you look at the crunched version, what you're seeing is the disassembled decrunch header for the Defjam packer that was used to crunch the cracktro. The data in that file is the crunched cracktro that gets decrunched by the header.

What you can see in the decrunch code is a jmp ext_0000. Which translates as, from looking at the equates, to jmp $48000. This is the absolute address in memory that the cracktro is decrunched to. Ideally you want to make the code relocatable again.

What you could try doing is disassembling the uncrunched executable but setting the origin (this is a Resource disassembler term, sorry I've never used IRA) for the code as $48000. That would then let the disassembler work out how to offset all the branches in the code to the correct places as relative offsets.

If you then add a: section cracktro,code_c to the very top of the code and then try running it you might find it works OK.

I used this exact same method when I disassembled Phenomena's Flight Of Dreams II demo and managed to get it to run OK as a relocatable reassembled executable.

Hope that helps
pmc is offline  
Old 18 March 2011, 09:52   #5
Hewitson
Registered User
 
Hewitson's Avatar
 
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,772
I gave IRA the -OFFSET=$48000 option and the code now reassembles and runs perfectly! However all this does is add an ".ORG $48000" to the start of the source. I commented this out and the intro still ran fine but the music was very high pitched for some reason.

I'd like to use Resource so I can do exactly as you suggested. I set the origin to $48000 and disassembled and it has hundreds of question marks in it! eg:

btst ????$14,a2

How can I get it to produce a usable disassembly?

Thanks
Hewitson is offline  
Old 18 March 2011, 10:24   #6
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
Quote:
Originally Posted by Hewitson
I gave IRA the -OFFSET=$48000 option and the code now reassembles and runs perfectly!
\o/

Quote:
Originally Posted by Hewitson
However all this does is add an ".ORG $48000"
org is just a way of getting the assembler to set the code to be run from an absolute location.

Quote:
Originally Posted by Hewitson
How can I get it to produce a usable disassembly?
I don't have huge experience with Resource so maybe someone else here can give a better answer but in my limited experience, you sometimes have to set sections of the disassembly as code or data and re run the disassemble option.

Not a very techincal or detailed desciption that I'm afraid. Someone else here will be able to elaborate I'm sure.
pmc is offline  
Old 18 March 2011, 10:43   #7
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
Quote:
Originally Posted by pmc View Post
If you then add a: section cracktro,code_c to the very top of the code and then try running it you might find it works OK.

I used this exact same method when I disassembled Phenomena's Flight Of Dreams II demo and managed to get it to run OK as a relocatable reassembled executable.
Flight of Dreams II works that way because all necessary buffers etc. were allocated in the executable, i.e. there was no reason to let it run at an absolute address at all.

In this case however screens etc are located at absolute addresses ($70000 etc) so you can't just add a "SECTION CODE,CODE_c" and hope for the best. In the best case it might run by luck, in the worst case your code has been loaded to the screenmem area and what happens then should be obvious.


Quote:
Originally Posted by Hewitson View Post
I gave IRA the -OFFSET=$48000 option and the code now reassembles and runs perfectly! However all this does is add an ".ORG $48000" to the start of the source. I commented this out and the intro still ran fine but the music was very high pitched for some reason.
The module needs to be at $50000, if you remove the ORG $48000 the module is not at $50000 any longer and thus it won't be played correctly.


Quote:
Originally Posted by Hewitson View Post
I'd like to use Resource so I can do exactly as you suggested. I set the origin to $48000 and disassembled and it has hundreds of question marks in it! eg:

btst ????$14,a2
That ReSource complains is correct since btst is byte only when the destination is a memory address.

Anyway, you can check this thread, I explained how to disassemble absolute address code there.

However, this is no beginner's stuff in my opinion, learn to walk before you try to run!

Last edited by StingRay; 18 March 2011 at 10:59. Reason: typo
StingRay is offline  
Old 18 March 2011, 10:50   #8
pmc
gone
 
pmc's Avatar
 
Join Date: Apr 2007
Location: completely gone
Posts: 1,596
OK thanks Stinger.

As I say, I have no great experience at this stuff.

Hewitson: best bow to Stinger's superior knowledge in my opinion.
pmc is offline  
Old 18 March 2011, 11:22   #9
Hewitson
Registered User
 
Hewitson's Avatar
 
Join Date: Feb 2007
Location: Melbourne, Australia
Age: 41
Posts: 3,772
Well, stuff trying to make it relocatable. I'd rather put up with it crashing the system every time I exit it than get as frustrated as I am right now.

I would absolutely love to fix the issue with the scroller though.

Quote:
Originally Posted by StingRay
That ReSource complains is correct since btst is byte only when the destination is a memory address.
Fair enough.

Quote:
Originally Posted by StingRay
However, this is no beginner's stuff in my opinion, learn to walk before you try to run!
Jumping in at the deep end is how I learn best
Hewitson is offline  
Old 18 March 2011, 17:51   #10
BippyM
Global Moderator
 
BippyM's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
Fix it using WHDload
BippyM is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Brat BippyM project.Maptapper 16 13 July 2013 19:54
Virus by D. Braben working with 512k chip Photon Games images which need to be WHDified 3 09 January 2011 22:40
Classic cracktro, but where is the tune from? Leffmann Nostalgia & memories 16 09 October 2009 21:42
Fixing a "leg" of 68010 chip mk1 support.Hardware 33 04 April 2009 18:10
BRAT docs andreas support.Games 0 27 November 2004 01:58

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 18:36.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.07891 seconds with 13 queries