Page 1 of 1

Ghouls and Ghosts Copy Protection

Posted: Wed Jan 13, 2016 1:17 am
by mlynn1974
I hope this is the correct section.

Ghouls and Ghosts is available as 2 single-sided Pasti images. It works but I want to put the game in 1 Double Sided disk in plain .ST format. I know Automation hacked and packed this in Automation 199 but I thought I could do it for my own interest. The Automation version still has the annoying please insert disk B, press space to continue message which is easy to remove.

The problem is that when copied to one double sided disk the enemy sprites do not appear and when daggers are thrown they do not appear!

The 2 main files to change are: auto\boot.prg and ghouls.dat

This game uses an identical protection to Indiana Jones as described here:
http://www.markus-fritze.de/posts/2011/ ... t_crusade/
Does anyone know the proper name for this copy protection?

There is a CRC error on disk 1 track 79, sector 6.
I thought that the magic key might be read from track 78, stored in memory (dc.l) and then checked later in the game but that seems to not be the case.

I disassembled boot.prg using Easy Rider and put the key\magic value in the memory location and the old MOVE.L #0,D0 ; success.
I then reassembled boot.prg and put it on my double sided disk image, but that didn't work. I even merged the track buffer into the new boot.prg and that didn't work either. I'm stumped.

There is also a rather curious bit in this copy protection:

Code: Select all

0001888c: b0bc 0000 1784                 CMP.L    #$1784,D0         ;6020 bytes
00018892: 6e00 000a                      BGT      *+$C [$1889E]

This jumps to the fail case if the track is greater than 6020 bytes long, but a track would never be that length. Surely if the disk duplicator had written a long track which couldn't normally be written by an ST then this should be BLT fail.
Even 11 sectors would be 512*11=5632 bytes. I'm sorry if I'm missing something obvious here.

GHOULS.DAT doesn't read tracks 78 or 79 according to SteemDebug (Pasti Breakpoints). If we boot using the original disk 1, then insert the double sided copy as disk 2 and press space to continue the game works perfectly so all copy protection checks must have passed by that point.

Re: Ghouls and Ghosts Copy Protection

Posted: Wed Jan 13, 2016 9:08 am
by lotek_style
Did you try the D-Bug version?

Re: Ghouls and Ghosts Copy Protection

Posted: Wed Jan 13, 2016 10:21 am
by AtariZoll
I don't get what U did - is it now work perfectly or there is problem with daggers and sprites still ?
Since game uses own disk access code - so loads files not via TOS, problem is most likely that that code is done only for side A of floppy, and will not read from side B - what causes mentioned errors. So, you need to change floppy read code in game too.
Considering "annoying" floppy change requests and similar - that's just lazyness/rush of cracker, and not rare case.
Btw. Ghouls and Ghosts can be well packed, and then can fit even on 360KB floppy. That part is more interesting than copy protection removal.
And then you don't need to change floppy read code for both sides :-)

Re: Ghouls and Ghosts Copy Protection

Posted: Wed Jan 13, 2016 4:11 pm
by alien
He did a track read. Tracks don't just contain the data of sectors, but also synchronization information, sector headers and gaps. As Markus Fritze said, the type of track on the disk cannot be written with a standard Atari ST. Psygnosis used a similar protection some of their early games. IIRC the Amiga could copy that type of disk.

Re: Ghouls and Ghosts Copy Protection

Posted: Wed Jan 13, 2016 9:54 pm
by dlfrsilver
Ghouls'n'Ghosts 2 disks use a protection called EDC sector (aka Error Data Checksum Sector), if my memory serves me well.

But ppera is right, if the loader code is not modified to use both sides of the disk, it can't work.

Re: Ghouls and Ghosts Copy Protection

Posted: Wed Jan 13, 2016 10:24 pm
by mlynn1974
Thanks for the advice. I haven't tried the D-Bug version.
I still have problems with the daggers and enemy sprites.
It definitely loads weapons.spr and weapons1.spr but I understand about the sector\side loading mentioned.

The code doesn't seem to use fread trap #14 so it's not a normal or particularly easy loader. It's a little bit more difficult than Outrun!

Re: Ghouls and Ghosts Copy Protection

Posted: Thu Jan 14, 2016 9:11 am
by AtariZoll
mlynn1974 wrote:...
The code doesn't seem to use fread trap #14 so it's not a normal or particularly easy loader. It's a little bit more difficult than Outrun!

Indeed. Not rare case that game using own floppy code, and a must if uses very low RAM, so TOS is not usable.
it is not so hard to write such code: viewtopic.php?f=68&t=26253
I have 2 side update of it too - used with some game floppy versions, combined with packing. Was simpler for me to use own code instead understanding game's loader. There are some really overcomplicated ones with very silly solutions.
Example: http://atari.8bitchip.info/ASTGA/P/potswco.php
Org. game is on 2 floppies - here all on single, fast load, depacking.