Skip to content

Better RNG #432

Open
Open

Description

@Entroper

I want to implement a LCG with 3 or 4 bytes of state. I found a whitepaper with some good parameters we can use.

We need to find 2 or 3 bytes of RAM (the vanilla RNG uses one, which will be replaced). And we can set the initial state randomly, as well.

Activity

  1. Entroper commented on Aug 29, 2020

    @Entroper
    MemberAuthor

    Recommending we "reappropriate" the following variables:

    btl8x8spr_x
    btl8x8spr_y
    btl8x8spr_a
    btl8x8spr_t
    btl8x8spr_i
    

    These can share space with btl_attacker_strength, btl_attacker_category, and so on, because their use doesn't overlap. That gives us all the space we need for 4 bytes of RNG state.

    These btl8x8 variables are only used in a few functions, all in bank 0C, between 0x317E9 and 0x31A2C. It's probably easiest to do a search and replace in the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions