Skip to content

addCheat

Add a cheat.

The parameter can be a cheat code, or an object with a code property, an optional description, and an optional enabled.

Cheats are added disabled, so enabled needs to be set for the cheat to be applied right away, or enableCheat needs to be called later.

0.23.0

const nostalgist = await Nostalgist.nes('contra.nes')
// added, but not applied yet
nostalgist.addCheat('SXIOPO')
nostalgist.addCheat({ code: '00AE:41', description: 'Totally Invincible P1' })
// added and applied
nostalgist.addCheat({ code: '0033:09', description: 'Infinite Lives P2', enabled: true })

A boolean for whether the cheats could be applied. It’s false when the core does not support cheats.