Skip to navigation

Elite on the BBC Micro

Copy protection: OSBmod (Disc version)

Name: OSBmod [View in context] Type: Subroutine Category: Copy protection Summary: Calculate a checksum on &0F00 to &0FFF (the test is disabled in this version)
.OSBmod SEC \ Set the C flag so the checksum we calculate in A \ starts with an initial value of 16 (15 plus carry) LDY #&00 \ Set ZP(1 0) = &0F00 STY ZP \ LDA #&0F \ and at the same time set a byte counter in Y and set STA ZP+1 \ the intial value of the checksum to 16 (15 plus carry) .osb1 ADC (ZP),Y \ Set A = A + the Y-th byte of ZP(1 0) INY \ Increment the byte pointer BNE osb1 \ Loop back to add the next byte until we have added the \ whole page CMP #&CF \ The checksum test has been disabled NOP NOP LDA #219 \ Store 219 in location &9F. This gets checked by the STA &9F \ TITLE routine in the main docked code as part of the \ copy protection (the game hangs if it doesn't match) RTS