jsbeeb icon indicating copy to clipboard operation
jsbeeb copied to clipboard

Debug screen is black "in front of" the beam

Open mattgodbolt opened this issue 6 years ago • 5 comments

Hitting a breakpoint or ctrl-HOME now yields a black screen post-the virtual CRTC beam. To repro:

  • MODE 2
  • ctrl-s 0 4 0 0 0
  • hit ctrl-home
  • notice the screen post the beam location is black.

I think this is probably a result of the improvements to the CRTC emulation, but it's convenient to see the screen when debugging :)

Screenshot from 2019-10-04 07-48-38

mattgodbolt avatar Oct 04 '19 12:10 mattgodbolt

@richtw1 quite likes this: maybe it should be configurable? or the "remaining" screen should be like 30% faded out or something?

mattgodbolt avatar Oct 04 '19 12:10 mattgodbolt

I don't think I'd bother keeping it TBH. If it's more useful to see the entire screen then that's what it should do. Sometimes a million configurable options just needlessly complicates!

richtw1 avatar Oct 04 '19 12:10 richtw1

That said, this isn't obviously easy to fix, because it's an inevitable consequence of clearing the texture at the start, instead of blanking scanlines as they're rasterised. This gave a reasonable performance gain, so it would be a shame to put it back.

Other possibilities:

  • always pause when raster at the bottom of the screen (might lead to stopping in the same point in execution each time?)
  • separate pause / screenshot button (which doesn't enter the debugger, just waits until the bottom of the screen and then stops until you press Go again)

richtw1 avatar Oct 04 '19 13:10 richtw1

Agreed it's not an easy fix. Just taking these comments:

  1. Not really an option as "pause" is the same as breakpoint, and when debugging things it's also useful to know what's on the screen. In particular I use this a lot when I do presentations on jsbeeb (e.g. https://mattgodbolt.github.io/bbc-micro-emulation/avast/#/18 which I run on purpose to crash on the "undefined" opcode).
  2. This is cool for screenshots so :+1: but less useful in general for debugging.

Keeping the "old" screen around in a debug mode might be an option. I already have some (expensive) debugging things knocking around that are disabled by default, and so "keep old screen around when debugging" might be an option. So long as I can put ?debug or something in the URL I'll be happy :)

mattgodbolt avatar Oct 04 '19 15:10 mattgodbolt

(that said the "old" screen around could be used to e.g. do phosphor simulation)

mattgodbolt avatar Oct 04 '19 15:10 mattgodbolt