from pathlib import Path


def find_rom(program):
    """Find ROM in current directory or in ROMs directory."""
    rom = Path(program)
    if rom.is_file():
        return rom
    rom = Path(__file__).parent.joinpath("roms", program)
    if rom.is_file():
        return rom