Skip to navigation

Elite on the BBC Micro

Dashboard: BULB [Electron version]

Name: BULB [Show more] Type: Subroutine Category: Dashboard Summary: Draw an indicator bulb on the dashboard
Context: See this subroutine in context in the source code Variations: See code variations for this subroutine in the different versions References: This subroutine is called as follows: * ECBLB calls BULB

Arguments: A The low byte of the screen address of the bulb to show X The low byte of the address of the character definition of the bulb to be drawn, i.e. #LO(ECBT) for the E.C.M. bulb, or #LO(SPBT) for the space station bulb Y The high byte of the screen address of the bulb to show Other entry points: BULB-2 Set the Y screen address
.BULB STA SC \ Store the low byte of the screen address in SC STX P+1 \ Set P(2 1) to the address of the character definition LDX #HI(ECBT) \ of the bulb to be drawn (this assumes that ECBT and STX P+2 \ SPBT are in the same page and have the same high byte) TYA \ Set A to Y, the high byte of the screen address we \ want to write to, so now (A SC) points to the specific \ bulb's screen address JMP RREN \ Call RREN to print the character definition pointed to \ by P(2 1) at the screen address pointed to by (A SC), \ returning from the subroutine using a tail call