Skip to content

Commit e09d16c

Browse files
committed
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()
1 parent b557e57 commit e09d16c

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

hardware/memory/cartridge/moviecart/moviecart.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,13 @@ func (s *state) Snapshot() *state {
248248
return &n
249249
}
250250

251+
// Plumb implements the mapper.CartMapper interface.
252+
func (s *state) Plumb() {
253+
s.state = stateMachineNewField
254+
s.paused = false
255+
s.fieldAdv = 1
256+
}
257+
251258
func (s *state) initialise() {
252259
if s.shortTitleCard {
253260
// shorten title card. we don't want to eliminate it entirely so say
@@ -257,6 +264,7 @@ func (s *state) initialise() {
257264
s.totalCycles = 0
258265
}
259266
copy(s.sram, coreData)
267+
260268
s.state = stateMachineNewField
261269
s.paused = false
262270
s.streamChunk = 0
@@ -341,6 +349,7 @@ func (cart *Moviecart) Snapshot() mapper.CartMapper {
341349
// Plumb implements the mapper.CartMapper interface.
342350
func (cart *Moviecart) Plumb(env *environment.Environment) {
343351
cart.env = env
352+
cart.state.Plumb()
344353
}
345354

346355
// Reset implements the mapper.CartMapper interface.

hardware/television/resizer.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,12 @@ func (sr *resizer) examine(tv *Television, sig signal.SignalAttributes) {
189189
// the resize top/bottom value) at that point
190190
//
191191
// the counter will be reset if the screen size changes in the interim.
192-
const framesUntilResize = 2
192+
//
193+
// (27/04/24) increased to 3 to accomodate MovieCart when being rewound using
194+
// the emulator's rewind system - the Moviecart rewind is unaffected by this
195+
// value. it's unclear if there are any adverse affects to this increase but I
196+
// don't believe there will be
197+
const framesUntilResize = 3
193198

194199
// commit resizing possibility found through examine() function.
195200
func (sr *resizer) commit(tv *Television) error {

0 commit comments

Comments
 (0)