lorom header !contnull = $00 ; should not be loaded, not ram !cont_mode = $06FF ; free ram !max_mode = #$05 ; highest mode plus 1 org $0086C1 ; contoller handler routine JSL controutine NOP org $178000 ; freespace ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; db "STAR" ; RATS tag used to protect data from other programs dw Endcont-Startcont dw Endcont-Startcont^#$FFFF ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Startcont: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; controutine: LDA $0DA8 STA $18 ; restored code JSR cont_main RTL cont_main: LDA !cont_mode CMP !max_mode BCC cont_okay RTS cont_okay: JSL $0086DF ; execute ptr dw set_00,set_01,set_02,set_03,set_04 ; rountines for each RAM set_00: REP #$20 LDA $010B CMP #$01C5 SEP #$20 BNE retur set_01: STZ $15 ; clear contoller ram STZ $16 STZ $17 STZ $18 retur: RTS set_02: STZ $15 ; clear contoller ram STZ $16 STZ $17 STZ $18 RTS ; will clear it again next frame unless otherwise set_03: PHX LDA $15 AND #$0F TAX LDA $15 AND #$F0 CLC ADC invertdir,x STA $15 LDA $16 AND #$F0 CLC ADC invertdir,x STA $16 PLX RTS ; repeat unless otherwise invertdir: db $00,$02,$01,!contnull ; nulls are not achievable db $08,$0A,$09,!contnull db $04,$06,$05,!contnull db !contnull,!contnull,!contnull,!contnull set_04: RTS ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Endcont: ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;