Skip to navigation

Revs on the BBC Micro

Extra tracks: ModifyGameCode (Part 2 of 3)

Name: ModifyGameCode (Part 2 of 3) [Show more] Type: Subroutine Category: Extra tracks Summary: Modify the game code to support the extra track data
Context: See this subroutine in context in the source code References: No direct references to this subroutine in this source file

The code modifications are done in three parts. This is also where the zTrackSegmentO table is built, once the modifications have been done. The routine is exactly 40 bytes long, so there's one byte for each outer segment z-coordinate.
.mods2 LDA #&20 \ ?&1248 = &20 (opcode for a JSR instruction) STA &1248 STA &12FB \ ?&12FB = &20 (opcode for a JSR instruction) STA &2538 \ ?&2538 = &20 (opcode for a JSR instruction) STA &45CB \ ?&45CB = &20 (opcode for a JSR instruction) LDA #&EA \ ?&2545 = &EA (opcode for a NOP instruction) STA &2545 LDA #22 \ ?&4F55 = 22 (argument in a CMP #22 instruction) STA &4F55 STA &4F59 \ ?&4F59 = 22 (argument in a CMP #22 instruction) LDA #13 \ ?&24EA = 13 (argument in a CMP #13 instruction) STA &24EA LDA #&A2 \ ?&1FE9 = &A2 (opcode for a LDX # instruction) STA &1FE9 JMP mods3 \ Jump to part 3