Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TestEnemyScriptA:
- .call(LFSR)
- .shoot(r0)
- .pause
- .jump(TestEnemyScriptA)
- LFSR: ; outputs random value in a
- ;Input: HL = ptr to seed
- ;Output: A = Random 8bit Number
- ;Destroys AF , HL (HL remains as the pointer)
- ;Has a period of 255
- ;Each number will only show up once
- ;39/57 cycles
- .runasm(LFSR_)
- ld hl,lfsrseed
- ld a,(hl)
- rrca
- ld (hl),a
- jp nc,r.runasm.ret
- xor %00111000
- ld (hl),a
- ld (ix+r0),a
- jp r.runasm.ret
- LFSR_:
- .return
Advertisement
Add Comment
Please, Sign In to add comment