mirror of
https://github.com/ivanizag/izapple2.git
synced 2024-09-27 06:54:35 +00:00
Change A, X, Y and P externally
This commit is contained in:
parent
b1d4d53869
commit
612adbc11f
@ -132,16 +132,17 @@ func (s *State) GetCarryAndAcc() (bool, uint8) {
|
|||||||
return s.reg.getFlag(flagC), s.reg.getA()
|
return s.reg.getFlag(flagC), s.reg.getA()
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetAXY returns the value of the A, X and Y registers
|
// GetAXYP returns the value of the A, X, Y and P registers
|
||||||
func (s *State) GetAXY() (uint8, uint8, uint8) {
|
func (s *State) GetAXYP() (uint8, uint8, uint8, uint8) {
|
||||||
return s.reg.getA(), s.reg.getX(), s.reg.getY()
|
return s.reg.getA(), s.reg.getX(), s.reg.getY(), s.reg.getP()
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetAXY changes the value of the A, X and Y registers
|
// SetAXYP changes the value of the A, X, Y and P registers
|
||||||
func (s *State) SetAXY(regA uint8, regX uint8, regY uint8) {
|
func (s *State) SetAXYP(regA uint8, regX uint8, regY uint8, regP uint8) {
|
||||||
s.reg.setA(regA)
|
s.reg.setA(regA)
|
||||||
s.reg.setX(regX)
|
s.reg.setX(regX)
|
||||||
s.reg.setY(regY)
|
s.reg.setY(regY)
|
||||||
|
s.reg.setP(regP)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Save saves the CPU state (registers and cycle counter)
|
// Save saves the CPU state (registers and cycle counter)
|
||||||
|
Loading…
Reference in New Issue
Block a user