macro RATS_start(id) db "STAR" dw RATS_Endcode-RATS_Startcode dw RATS_Endcode-RATS_Startcode^#$FFFF RATS_Startcode: endmacro macro RATS_end(id) RATS_Endcode: endmacro lorom ;\ ROM is LoRom header ;/ and has a header. org $05E003 db $00,$C1,$7E org $0485CF JSL Random ORG $258000 ;| POINT TO FREE SPACE!!! %RATS_start(0) Random: PHB PHK PLB LDX #$00 loop: CPX #$05 BCS leveldata CPX #$01 BEQ Header1 CPX #$02 BEQ Header2 CPX #$03 BEQ Header3 CPX #$04 BEQ Header4 LDA #$2E JMP Store Header1: LDA #$40 JMP Store Header2: LDA #$08 JMP Store Header3: LDA #$80 JMP Store Header4: LDA #$27 JMP Store leveldata: CPX #$0B BCS skipcement LDA #$19 STA $7EC100,x INX LDA #$D0 STA $7EC100,x INX LDA #$0F STA $7EC100,x INX LDA #$99 STA $7EC100,x INX LDA #$D0 STA $7EC100,x INX LDA #$00 STA $7EC100,x INX skipcement: LDA #$19 JSR RANDOM PHX TAX LDA TwoTable,x TAX REP #$20 LDA Objects,x PHA SEP #$20 LDA #$FF JSR RANDOM AND #$9F STA $0E REP #$20 PLA SEP #$20 ORA $0E PLX STA $7EC100,x INX XBA PHA LDA #$0F JSR RANDOM STA $0E PLA ORA $0E STA $7EC100,x INX LDA #$FE JSR RANDOM STA $7EC100,x INX JMP stord Store: STA $7EC100,x INX stord: CPX #$DF BCS notloop JMP loop notloop: LDA #$19 STA $7EC100,x INX LDA #$D0 STA $7EC100,x INX LDA #$0F STA $7EC100,x INX LDA #$FF STA $7EC100,x skip: PLB JSL $00E2BD RTL RANDOM: PHX PHP SEP #$30 PHA JSL $01ACF9 PLX CPX #$FF BNE NORMALRT LDA $148B BRA ENDRANDOM NORMALRT: INX LDA $148B STA $4202 STX $4203 NOP NOP NOP NOP LDA $4217 ENDRANDOM: PLP PLX RTS Objects: Water1: db $00,$10 ICB: db $00,$20 IJNB: db $00,$30 IPC: db $00,$40 CoinsL: db $00,$50 Dirt: db $00,$60 Water2: db $00,$70 NoteBlocks: db $00,$80 TurnBlocks: db $00,$90 CQB: db $00,$A0 Throw: db $00,$B0 Munch: db $00,$C0 CementBlocks: db $00,$D0 BrownBlocks: db $00,$E0 Bullet: db $02,$10 Ledge: db $02,$40 Pcoins: db $02,$60 AnimatedWater: db $02,$80 NonAnimatedWater: db $02,$90 LavaAnimated: db $02,$A0 ClimbingNetTop: db $02,$B0 DonutBridge: db $02,$C0 ClimbingNetBottom: db $02,$D0 VertPipeSkinny: db $02,$F0 HorzPipeSkinny: db $04,$00 WideScaleGround: db $04,$10 TwoTable: db $00,$02,$04,$06,$08,$0A,$0C,$0E,$10,$12,$14,$16,$18,$1A,$1C,$1E,$20,$22,$24,$26,$28,$2A,$2C,$2E,$30,$32,$34 %RATS_end(0)