increase TV frame resize threshold from 2 to 3 frames

this fixes abberant resizing when using the emulation rewind with
moviecarts - the moviecart rewind system is unaffected by this

moviecart resets the frame state on Plumb()
This commit is contained in:
JetSetIlly 2024-04-27 18:51:51 +01:00
parent 38690397c2
commit 344b92e8f3
2 changed files with 15 additions and 1 deletions

View file

@ -248,6 +248,13 @@ func (s *state) Snapshot() *state {
return &n
}
// Plumb implements the mapper.CartMapper interface.
func (s *state) Plumb() {
s.state = stateMachineNewField
s.paused = false
s.fieldAdv = 1
}
func (s *state) initialise() {
if s.shortTitleCard {
// shorten title card. we don't want to eliminate it entirely so say
@ -257,6 +264,7 @@ func (s *state) initialise() {
s.totalCycles = 0
}
copy(s.sram, coreData)
s.state = stateMachineNewField
s.paused = false
s.streamChunk = 0
@ -341,6 +349,7 @@ func (cart *Moviecart) Snapshot() mapper.CartMapper {
// Plumb implements the mapper.CartMapper interface.
func (cart *Moviecart) Plumb(env *environment.Environment) {
cart.env = env
cart.state.Plumb()
}
// Reset implements the mapper.CartMapper interface.

View file

@ -189,7 +189,12 @@ func (sr *resizer) examine(tv *Television, sig signal.SignalAttributes) {
// the resize top/bottom value) at that point
//
// the counter will be reset if the screen size changes in the interim.
const framesUntilResize = 2
//
// (27/04/24) increased to 3 to accomodate MovieCart when being rewound using
// the emulator's rewind system - the Moviecart rewind is unaffected by this
// value. it's unclear if there are any adverse affects to this increase but I
// don't believe there will be
const framesUntilResize = 3
// commit resizing possibility found through examine() function.
func (sr *resizer) commit(tv *Television) error {