DTRAP

request software or documentation that you can't find online
Post Reply
Michael Brown
Posts: 2330
Joined: Sat Apr 03, 2010 1:54 pm
Location: Nottingham
Contact:

DTRAP

Post by Michael Brown » Fri Apr 03, 2020 8:14 am

Hi All,
There are a few games that reactivate the disc drive and therefore require DTRAP on BBCs with Datacentres fitted, but are all the games that reactivate the disc drive necessary?
One game, the disc version of Breakthrough by ASL has a routine that the tape version does not, yet that version (with a slightly different loading screen as the only obvious diffrence) also runs from disc as it is without the need for DTRAP.
The routine is in the disc copy of PART2 at &2E16

LDA#&7F
JSR&FFF1

what does this actually do?
Is is necessary and can it be NOP'd out?
regards,
Mick.

User avatar
davidb
Posts: 2906
Joined: Sun Nov 11, 2007 10:11 pm
Contact:

Re: DTRAP

Post by davidb » Fri Apr 03, 2020 9:16 am

Looks like OSWORD &7F (127) - Perform floppy disk operation. I guess it depends on what the X and Y registers point to.

Michael Brown
Posts: 2330
Joined: Sat Apr 03, 2010 1:54 pm
Location: Nottingham
Contact:

Re: DTRAP

Post by Michael Brown » Fri Apr 03, 2020 10:49 am

HI,
Looks like X = 0

Y = 33 but I think this looks up at table at &3300

Stored there is 00 00 30 00 00 03 53 00 00 23

so not sure whats happening.

Mick.

User avatar
jgharston
Posts: 4178
Joined: Thu Sep 24, 2009 12:22 pm
Location: Whitby/Sheffield
Contact:

Re: DTRAP

Post by jgharston » Fri Apr 03, 2020 12:48 pm

Michael Brown wrote:
Fri Apr 03, 2020 10:49 am
HI,
Looks like X = 0

Y = 33 but I think this looks up at table at &3300

Stored there is 00 00 30 00 00 03 53 00 00 23

so not sure whats happening.

Mick.
As per the link to the Wiki:

Code: Select all

Stored there is 00 00 30 00 00 03 53 00 00 23
                |  |         | |  |  |  |  |
drive 0 --------+  +----+----+ |  |  |  |  |
                        |      |  |  |  |  |
address &00003000 ------+      |  |  |  |  |
                               |  |  |  |  |
three parameters --------------+  |  |  |  |
                                  |  |  |  |
command &53 = read sectors -------+  |  |  |
                                     |  |  |
track &00 ---------------------------+  |  |
                                        |  |
sector &00 -----------------------------+  |
                                           |
3 sectors of 2^(2/2+7)=256 bytes ----------+

Loads three sectors starting at track 0 sector 0.
That will be the DFS catalog and the first sector after the catalog.

Code: Select all

$ bbcbasic
PDP11 BBC BASIC IV Version 0.32
(C) Copyright J.G.Harston 1989,2005-2020
>_

Michael Brown
Posts: 2330
Joined: Sat Apr 03, 2010 1:54 pm
Location: Nottingham
Contact:

Re: DTRAP

Post by Michael Brown » Fri Apr 03, 2020 2:17 pm

Thanks for that.
I have NOP'd the JSR&FFF1 as this seemed redundant to the game running and just causes the need for DTRAP when it may not be needed.
So far, the game seems to work ok.

Mick.

User avatar
leenew
Posts: 4239
Joined: Wed Jul 04, 2012 4:27 pm
Location: Doncaster, Yorkshire
Contact:

Re: DTRAP

Post by leenew » Fri Apr 03, 2020 4:09 pm

Was it protection, just checking the catalogue was correct?

Lee

Michael Brown
Posts: 2330
Joined: Sat Apr 03, 2010 1:54 pm
Location: Nottingham
Contact:

Re: DTRAP

Post by Michael Brown » Fri Apr 03, 2020 5:01 pm

Not sure, but there were other NOPs just after that code, so may need to see the original disc to check if something else was changed. The tape version does not have this code, so it may be something added just for the disc version, but I don't know what unless it is just a check that the catalog is there. I did have a nasty feeling it was going to either format or write data over code if disc was unprotected as some sort of copy protection, but who knows!

Mick.

User avatar
billcarr2005
Posts: 1605
Joined: Fri Sep 09, 2005 4:01 pm
Location: UK
Contact:

Re: DTRAP

Post by billcarr2005 » Fri Apr 03, 2020 8:01 pm

leenew wrote:
Fri Apr 03, 2020 4:09 pm
Was it protection, just checking the catalogue was correct?
The NOPs were to remove the conditional branches... it's a partial protection removal... taking away the checks without realising the data they were checking is no longer necessary :roll:
The code at &2E1B and &2E22 is checking that the size of the disk is set to 0 sectors, rather than &190/&320 on 40/80 track disks
The code at &2E29 is checking some data which was part of a superfluous / uncopyable file on the original disk which would've ordinarily been missed when copying the other files.
If they would've used some of the data read with the OSWORD &7F to decode the block at &2000, instead of simply using EOR #&FF it would've been slightly less easy to remove :cry:
Michael Brown wrote:
Fri Apr 03, 2020 5:01 pm
The tape version does not have this code, so it may be something added just for the disc version, but I don't know what unless it is just a check that the catalog is there.
It wouldn't be in the tape version, since it's a disk operation!

Michael Brown
Posts: 2330
Joined: Sat Apr 03, 2010 1:54 pm
Location: Nottingham
Contact:

Re: DTRAP

Post by Michael Brown » Sat Apr 04, 2020 9:10 am

Thanks Bill for that.
I take it NOPing out the JSR&FFF1 won't break the game in anyway, but should end the need for DTRAP.

Mick.

Post Reply

Return to “archive requests”