Skip to content

Conversation

@gm-matthew
Copy link
Contributor

  • I have moved geo_parse() and the frame number update to the start of vblank; this fixes high score scrolling in segawski, 2D palette in dynamcopc, and 3D graphics in bel not displaying after first booting up.
  • Z-Sort mode value uses an exponent point to adjust the z-value scale. Without adjustment, some of the background objects in srallyc exceed the maximum exponent and so are not displayed properly.
  • I have merged model2_3d_process_quad() and model2_3d_process_triangle() into a single template function, since most of the code was identical.
  • Original Model 2 does have FIFO control; it uses the same 315-5673 buffer controller as Model 2A and 2C.
  • Burst stall must be cleared when resetting the i960, otherwise games can potentially hang on soft reset.

- Moved geo_parse() and frame number update to start of vblank; fixes high score scrolling in segawski, 2D palette in dynamcopc, and 3D graphics in bel not displaying after first booting up
- Z-Sort mode value uses an exponent point to adjust the z-value scale
- Merged model2_3d_process_quad() and model2_3d_process_triangle() into a single template function, since most of the code was identical
- Original Model 2 does have FIFO control; it uses the same 315-5673 buffer controller as Model 2A and 2C
- Clear burst stall when resetting the i960; prevents games hanging on soft reset
@happppp
Copy link
Member

happppp commented Nov 28, 2025

Note that moving geo_parse to the start of scanline 384 means it's after screen_update. So 1 frame delay compared to before, is that something you intended?

@angelosa
Copy link
Member

Generally speaking a renderer displays the previously prepared framebuffer and swaps drawing at vblank time, it's pretty much settled that at least one frame of lag should happen (in this case there's also a 30 Hz setting that iirc most games uses).

@gm-matthew
Copy link
Contributor Author

Note that moving geo_parse to the start of scanline 384 means it's after screen_update. So 1 frame delay compared to before, is that something you intended?

The emulated screen for Model 2 uses the attribute VIDEO_UPDATE_AFTER_VBLANK so screen_update_model2() runs after scanline 424, not scanline 384.

When we eventually emulate the geometry DSP to get Last Bronx and Top Skater working properly it will involve the geometry DSP processing the T&L for frame N while the i960 and copro are processing the game logic for frame N+1, so an extra frame of latency will be inevitable.

@angelosa
Copy link
Member

The emulated screen for Model 2 uses the attribute VIDEO_UPDATE_AFTER_VBLANK so screen_update_model2() runs after scanline 424, not scanline 384.

That should be renamed to just screen_update, if you don't mind :)

@gm-matthew
Copy link
Contributor Author

That should be renamed to just screen_update, if you don't mind :)

Done :-)

I also renamed screen_vblank_model2() while I was at it; I considered just removing it since it is unused, but then again perhaps we could migrate the code from model2_interrupt() over to screen_vblank() and hook it up accordingly.

@angelosa
Copy link
Member

That should be renamed to just screen_update, if you don't mind :)

Done :-)

I also renamed screen_vblank_model2() while I was at it; I considered just removing it since it is unused, but then again perhaps we could migrate the code from model2_interrupt() over to screen_vblank() and hook it up accordingly.

Believe it was made that way to mimic what segas24_state does, however Model 2 shouldn't use horizontal sync events and configure_scanline is pretty much a bad abstraction anyway (namely it doesn't really control the scanline composition, throws line events at the start of the display period), and if it happens it would need a custom emu_timer.

So yes for the conversion but make sure that nothing breaks in the process.

- Use static_assert for model2_3d_process_polygon()
- Remove all excess spaces inside parentheses in model2_v.cpp
@gm-matthew
Copy link
Contributor Author

Believe it was made that way to mimic what segas24_state does, however Model 2 shouldn't use horizontal sync events and configure_scanline is pretty much a bad abstraction anyway (namely it doesn't really control the scanline composition, throws line events at the start of the display period), and if it happens it would need a custom emu_timer.

So yes for the conversion but make sure that nothing breaks in the process.

I left it with VIDEO_UPDATE_AFTER_VBLANK since the System 24 tilemap generator latches the scroll registers during the last scanline before active display, or just before vertical blanking ends.

I've tested with the vblank code moved from model2_interrupt() to screen_vblank() and it works as expected; vblank IRQs are asserted at the correct time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants