oopsallbeans

by nambona

Game:

Description:

!statustile = $0F0D

main:
	LDA $0100
	EOR #$14
	ORA $9D
	BEQ +
	RTL
	+
	LDA $14
	BEQ .changeall
	CMP #$C0
	BEQ .1left
	CMP #$90
	BEQ .2left
	CMP #$60
	BEQ .3left
	RTL
.1left
	LDA #$01
	STA !statustile
	LDA #$23
	STA $1DFC
	RTL
.2left
	LDA #$02
	STA !statustile
	LDA #$23
	STA $1DFC
	RTL
.3left
	LDA #$03
	STA !statustile
	LDA #$23
	STA $1DFC
	RTL
.changeall
	LDA #$00
	STA !statustile
	LDA #$29
	STA $1DFC
	
	LDX #$0B
	-
	LDA $14C8,x
	CMP #$08
	BCC ..next
	LDA $9E,x
	CMP #$7B
	BEQ ..next
	CMP #$4A
	BEQ ..next
	
	LDA #$01
	STA $14C8,x
	
	JSR RNG
	LDA $148D
	AND #$01
	CLC
	ADC #$6B
	STA $9E,x
	
	..next
	DEX
	BPL -
	
	RTL


RNG:
  REP #$20
; If you know you will be coming here from the SNES side, you can make Accumulator 16-bit, and then jump here to save some time
  LDA $2137		;\ PPU registers
  LDA $213C   ;/
  ADC $13
  ADC $148D   ; 36
  ADC $14
  XBA
  STA $148D
  SEP #$20
  RTS
back to listings