Error and Good Sector Check: Difference between revisions

From Software Archive
Jump to navigation Jump to search
More Activision titles, variants
Activision form only; the three-read forms moved to Ocean Protection
 
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
= Error and Good Sector Check =
= Error and Good Sector Check =


This analysis is based on the state of the wiki from 24 Nov 2026.
This analysis is based on the state of the wiki from 25 Nov 2026.


'''Error and Good Sector Check''' is the name used on this wiki for a check routine on disk releases of several publishers from 1984 to 1986: Activision (track 18 sector 9), Epyx, Sydney Development,
'''Error and Good Sector Check''' is the name used on this wiki for the check routine on disk releases of Activision from 1984 and 1985. The disk is a normal CBM DOS disk on which one sector has a data block with a wrong checksum.
Data East and others with other sectors. The disk is a normal CBM DOS disk on which one sector has a data block with a wrong checksum.


In short: '''the program reads the faulty sector with the DOS command U1 and needs a read error, then reads a good sector of
In short: '''the program reads the faulty sector with the DOS command U1 and needs a read error, then reads a good sector of
Line 11: Line 10:
== The check ==
== The check ==


The routine is the same on all titles listed below, apart from the address and the two sectors. Pitfall! (Source 1):
The routine is the same on all titles listed below, apart from the address. Pitfall! (Source 1):


<pre>
<pre>
Line 94: Line 93:
|-
|-
| Track 2 sector 15 and track 3 sector 16 || Track 1 sector 11 || Ghostbusters (Sources 1, 2, 4 to 7, 9, 11 and 12) - Activision
| Track 2 sector 15 and track 3 sector 16 || Track 1 sector 11 || Ghostbusters (Sources 1, 2, 4 to 7, 9, 11 and 12) - Activision
|-
| Track 2 sector 10 || Track 2 sector 5 || Summer Games II (Sources 4, 6, 7, 8 and 10) - Epyx
|-
| Track 35 sector 10 || Track 35 sector 5 || Fight Night (Sources 1, 2, 4 and 5) - Sydney Development
|-
| Track 29 sector 10 || Track 29 sector 5 || Desert Fox (Source 2) - Sydney Development, U.S. Gold
|-
| Track 1 sector 10 || Track 1 sector 5 || Kung-Fu Master (Sources 2 and 3) - Data East
|-
| Track 18 sector 14 || Track 18 sector 5 || Asylum (Source 4) - All American Adventures
|}
|}


Line 109: Line 98:


* The routine was found in the memory of the C64 at the moment the drive reported the read error (the sources whose Protection field names one error sector were run with a breakpoint in the drive). The Activision titles whose check comes late were run a second time with a longer limit.
* The routine was found in the memory of the C64 at the moment the drive reported the read error (the sources whose Protection field names one error sector were run with a breakpoint in the drive). The Activision titles whose check comes late were run a second time with a longer limit.
* Kung-Fu Master: the Protection field of these sources notes that the error on track 1 sector 10 alone is not enough for a copy.
* Each source of the table was run against a copy in which the data block of the faulty sector has the correct checksum: the copy shows a black screen or the BASIC start screen, the original starts.
* Each source of the table was run against a copy in which the data block of the faulty sector has the correct checksum: the copy shows a black screen or the BASIC start screen, the original starts.
== Relation to the Ocean Protection ==
The [[Ocean Protection]] has the longer form of this routine: it reads a good sector, the faulty sector and the good sector again (answers 0, 2 and 0), on track 22 with the sectors 15, 10 and 15. The same three reads on other tracks (Summer Games II, Fight Night, Desert Fox, Kung-Fu Master, Asylum, Dream House, Fleet Feet, Moonsweeper) are listed there.
The Activision form described here has only the read of the faulty sector and one read of a good sector after it.
The texts <code>I0:</code>, <code>#</code> and <code>U1:2,0,</code> alone are also on disks with other loaders (for example the Electronic Arts titles with [[XEMAG 2.0]]); they are no sign of this routine.


== Variants ==
== Variants ==
Line 120: Line 114:
== Not covered ==
== Not covered ==


* Summer Games II (Source 11) names track 2 sector 10 in its Protection field; it has no G64.
 
* The Music Studio (Source 4): the routine was captured, but the copy test did not start the program.
* The Music Studio (Source 4): the routine was captured, but the copy test did not start the program.



Latest revision as of 22:35, 24 November 2026

Error and Good Sector Check

This analysis is based on the state of the wiki from 25 Nov 2026.

Error and Good Sector Check is the name used on this wiki for the check routine on disk releases of Activision from 1984 and 1985. The disk is a normal CBM DOS disk on which one sector has a data block with a wrong checksum.

In short: the program reads the faulty sector with the DOS command U1 and needs a read error, then reads a good sector of the same track and needs the answer without error. After the check the routine erases itself.

The check

The routine is the same on all titles listed below, apart from the address. Pitfall! (Source 1):

$488B  20 E7 FF  JSR $FFE7
$488E  A2 1B     LDX #$1B         ; open the command channel with the command I0:
$4890  A0 49     LDY #$49
$4892  A9 03     LDA #$03
$4894  20 BD FF  JSR $FFBD
$4897  A9 0F     LDA #$0F
$4899  A8        TAY
$489A  A2 08     LDX #$08
$489C  20 BA FF  JSR $FFBA
$489F  20 C0 FF  JSR $FFC0
$48A2  A9 02     LDA #$02         ; open channel 2 with the name "#"
$48A4  A8        TAY
$48A5  A2 08     LDX #$08
$48A7  20 BA FF  JSR $FFBA
$48AA  A9 01     LDA #$01
$48AC  A2 1E     LDX #$1E
$48AE  A0 49     LDY #$49
$48B0  20 BD FF  JSR $FFBD
$48B3  20 C0 FF  JSR $FFC0
$48B6  A9 39     LDA #$39         ; sector 9: read track 18 sector 9
$48B8  20 F8 48  JSR $48F8
$48BB  20 EA 48  JSR $48EA        ; first character of the answer
$48BE  C9 0D     CMP #$0D
$48C0  F0 F9     BEQ $48BB
$48C2  C9 32     CMP #$32         ; must be "2": an error 20 to 29
$48C4  D0 1E     BNE $48E4
$48C6  A9 32     LDA #$32         ; sector 2: read track 18 sector 2
$48C8  20 F8 48  JSR $48F8
$48CB  20 EA 48  JSR $48EA
$48CE  C9 0D     CMP #$0D
$48D0  F0 F9     BEQ $48CB
$48D2  C9 30     CMP #$30         ; must be "0": no error
$48D4  D0 0E     BNE $48E4
$48D6  A9 02     LDA #$02         ; passed: close the channels
$48D8  20 C3 FF  JSR $FFC3
$48DB  A9 0F     LDA #$0F
$48DD  20 C3 FF  JSR $FFC3
$48E0  20 30 49  JSR $4930        ; erase this routine
$48E3  60        RTS
$48E4  20 30 49  JSR $4930        ; failed: erase this routine
$48E7  4C 00 40  JMP $4000        ; and jump away
$48EA  A2 0F     LDX #$0F
$48EC  20 C6 FF  JSR $FFC6
$48EF  20 E4 FF  JSR $FFE4
$48F2  48        PHA
$48F3  20 CC FF  JSR $FFCC
$48F6  68        PLA
$48F7  60        RTS
$48F8  8D 29 49  STA $4929        ; put the sector digit into the command
$48FB  A9 08     LDA #$08
$48FD  20 B1 FF  JSR $FFB1
$4900  A9 6F     LDA #$6F
$4902  20 93 FF  JSR $FF93
$4905  A2 00     LDX #$00
$4907  8A        TXA
$4908  48        PHA
$4909  BD 1F 49  LDA $491F,X      ; send U1:2,0,18,9
$490C  F0 08     BEQ $4916
$490E  20 A8 FF  JSR $FFA8
$4911  68        PLA
$4912  AA        TAX
$4913  E8        INX
$4914  D0 F1     BNE $4907
$4916  68        PLA
$4917  20 AE FF  JSR $FFAE
$491A  60        RTS
  • The text of the commands is I0:, # and U1:2,0,18,9.
  • The first read must give an answer that starts with 2 (every error code from 20 to 29 passes). The second read, of a good sector of the same track, must give an answer that starts with 0. A drive that reports an error for every sector does not pass.
  • After the check the routine at $4930 fills the code with NOP. The command is not found as plain text in the sectors of the disks.

Titles on this wiki

Faulty sector Good sector Titles
Track 18 sector 9 Track 18 sector 2 Fast Tracks, Ghostbusters (Sources 3, 8, 10 and 13), H.E.R.O., Park Patrol, Pastfinder, Pitfall!, Pitfall II: Lost Caverns, River Raid, The Activision Decathlon, The Designer's Pencil, The Music Studio (Source 4), Toy Bizarre, Zenji, Zone Ranger - all Activision
Track 2 sector 15 and track 3 sector 16 Track 1 sector 11 Ghostbusters (Sources 1, 2, 4 to 7, 9, 11 and 12) - Activision

Verification on this wiki

  • The routine was found in the memory of the C64 at the moment the drive reported the read error (the sources whose Protection field names one error sector were run with a breakpoint in the drive). The Activision titles whose check comes late were run a second time with a longer limit.
  • Each source of the table was run against a copy in which the data block of the faulty sector has the correct checksum: the copy shows a black screen or the BASIC start screen, the original starts.

Relation to the Ocean Protection

The Ocean Protection has the longer form of this routine: it reads a good sector, the faulty sector and the good sector again (answers 0, 2 and 0), on track 22 with the sectors 15, 10 and 15. The same three reads on other tracks (Summer Games II, Fight Night, Desert Fox, Kung-Fu Master, Asylum, Dream House, Fleet Feet, Moonsweeper) are listed there. The Activision form described here has only the read of the faulty sector and one read of a good sector after it. The texts I0:, # and U1:2,0, alone are also on disks with other loaders (for example the Electronic Arts titles with XEMAG 2.0); they are no sign of this routine.

Variants

  • Ghostbusters: between the two reads the routine sends B-P:2,160 and takes three bytes of the faulty sector from the buffer of the drive. The form with track 2 sector 15 is called a second time for track 3 sector 16 and keeps the result in a flag instead of branching.
  • The Music Studio, Park Patrol, Pitfall II and The Designer's Pencil have the two reads and the two tests in a changed order of instructions; The Music Studio adds the two results up and uses them later.
  • Mindshadow (Activision) has the same faulty sector, track 18 sector 9, but another routine: after the error it compares 13 bytes of the faulty sector with a table and reads no good sector. It is not counted here.

Not covered

  • The Music Studio (Source 4): the routine was captured, but the copy test did not start the program.

Pages that refer to this protection