Skip to navigation

Elite on the BBC Micro

Ship hanger: UNWISE [Elite-A, I/O processor]

Name: UNWISE [Show more] Type: Subroutine Category: Ship hanger Summary: Switch the main line-drawing routine between EOR and OR logic
Context: See this subroutine in context in the source code References: This subroutine is called as follows: * tube_table calls UNWISE

This routine is run when the parasite sends a draw_mode command. It toggles the main line-drawing routine between EOR and OR logic, for use when drawing the ship hanger. It does this by modifying the instructions in the main line-drawing routine at LOIN/LL30, flipping the drawing logic between the default EOR logic (which merges with whatever is already on screen, allowing us to erase anything we draw for animation purposes) and OR logic (which overwrites the screen, ignoring anything that's already there). We want to use OR logic for drawing the ship hanger, as it looks better and we don't need to animate it). The routine name, UNWISE, sums up this approach - if anything goes wrong, the results would be messy. Other entry points: HA1 Contains an RTS
.UNWISE LDA LIL2+2 \ Flip bit 6 of LIL2+2 to change the EOR (SC),Y in LIL2 EOR #%01000000 \ to an ORA (SC),Y (or back again) STA LIL2+2 STA LIL3+2 \ Change the EOR (SC),Y in LIL3 to an ORA (SC),Y (or \ back again) STA LIL5+2 \ Change the EOR (SC),Y in LIL5 to an ORA (SC),Y (or \ back again) STA LIL6+2 \ Change the EOR (SC),Y in LIL6 to an ORA (SC),Y (or \ back again) .HA1 RTS \ Return from the subroutine