snapmod.py¶
SYNOPSIS¶
snapmod.py [options] in.z80 [out.z80]
DESCRIPTION¶
snapmod.py modifies the registers and RAM in a 48K Z80 snapshot.
OPTIONS¶
- -f, --force
Overwrite an existing snapshot.
- -m, –move src,size,dest
Move a block of bytes of the given size from ‘src’ to ‘dest’. This option may be used multiple times. ‘src’, ‘size’ and ‘dest’ must each be a decimal number, or a hexadecimal number prefixed by ‘0x’.
- -p, –poke a[-b[-c]],[^+]v
POKE N,v for N in {a, a+c, a+2c…, b}. Prefix ‘v’ with ‘^’ to perform an XOR operation, or ‘+’ to perform an ADD operation. This option may be used multiple times. ‘a’, ‘b’, ‘c’ and ‘v’ must each be a decimal number, or a hexadecimal number prefixed by ‘0x’.
- -r, –reg name=value
Set the value of a register. Do
--reg helpfor more information, or see the section onREGISTERSbelow. This option may be used multiple times.- -s, –state name=value
Set a hardware state attribute. Do
--state helpfor more information, or see the section onHARDWARE STATEbelow. This option may be used multiple times.
- -V, --version
Show the SkoolKit version number and exit.
REGISTERS¶
The --reg option sets the value of a register in the snapshot.
--reg name=valueFor example:
--reg hl=32768--reg b=0x1fTo set the value of an alternate (shadow) register, use the ‘^’ prefix:
--reg ^hl=10072Recognised register names are:
^a, ^b, ^bc, ^c, ^d, ^de, ^e, ^f, ^h, ^hl, ^l,a, b, bc, c, d, de, e, f, h, hl, l,i, ix, iy, pc, r, spHARDWARE STATE¶
The --state option sets a hardware state attribute.
--state name=valueRecognised attribute names and their default values are:
border - border colour (default=0)iff - interrupt flip-flop: 0=disabled, 1=enabled (default=1)im - interrupt mode (default=1)tstates - T-states elapsed since start of frame (default=0)EXAMPLES¶
Set the value of the HL register pair to 0 in
game.z80:snapmod.py -f -r hl=0 game.z80POKE the value 23 into address 32768 in
game.z80, and write the resultant snapshot topoked.z80:snapmod.py -p 32768,23 game.z80 poked.z80