RandomGenerator

by circlefriendo

Game: SMW

Description: Select a random generator per level

  LDA $0100|!addr
  CMP #$13
  BEQ RandomGenerator
  CMP #$14
  BEQ SetGenerator
  RTL


RandomGenerator:
  JSR RNG
  AND #$0F
  STA $18b9|!addr
  STA $7f9e07
Return:
  RTL

SetGenerator:
  LDA $7f9e07
  AND #$0F
  STA $18b9|!addr
  RTL

RNG:
  REP #$20

  LDA $2137		;\ PPU registers
  LDA $213C   ;/
  ADC $13
  ADC $148D   ; 36
  ADC $14
  XBA
  STA $148D
  SEP #$20
  RTS
back to listings