Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAGE1/2 select occurring 1 cycle early #656

Closed
tomcw opened this issue Jun 23, 2019 · 11 comments
Closed

PAGE1/2 select occurring 1 cycle early #656

tomcw opened this issue Jun 23, 2019 · 11 comments
Labels
bug
Milestone

Comments

@tomcw
Copy link
Contributor

@tomcw tomcw commented Jun 23, 2019

Now that #654 delays the GR/TEXT ($C050/C051) mode switch by 1 cycle, @Archange427 noticed that PAGE1/2 ($C054/55) is wrong:

AppleWin 1.28.7.0:
test-line(AppleWin)

Real Apple IIe (PAL):
DSC00042

@tomcw tomcw added the bug label Jun 23, 2019
@tomcw

This comment has been minimized.

Copy link
Contributor Author

@tomcw tomcw commented Jun 23, 2019

Based on Sather's precise VBL sync (UTA2e, 3-26), I wrote 3 similar tests:

Each test does a "Sather precise VBL sync"; waits 17 (or 18 or 19) cycles, then:

  • line-0: LDA C055, LDA C054 (= 8 cycles)
  • delay 7*65-8 cycles = 447 cycles
  • line-7: LDA C050, LDA C051 (= 8 cycles)
  • delay 20280-(8+447+8) = 19817 cycles
    TOTAL = 20280 cycles

Test-1:

AppleWin-branch-GH648-50Hz

DSC00052

Test-2:

AppleWin-branch-GH648-50Hz

DSC00053

Test-3:

AppleWin-branch-GH648-50Hz

DSC00058

@tomcw

This comment has been minimized.

Copy link
Contributor Author

@tomcw tomcw commented Jun 23, 2019

So it appears that there's no delay for the PAGE1/PAGE2 switch!

Side-note: Is this the same behaviour on an Apple II+? And what about DGR/TEXT80? (eg. Ansi Story) And LORES/HIRES?


btw. that glitch (on line-7) switching from GR back to TEXT is explained in Don Lancaster's "Enhancing your Apple II & IIe, Volume 2", on page 221 it says:

"Glitches are far simpler to manage on the lIe. Just exit from text on a space and exit from LORES black, and all lIe glitches should be invisible."

And also see Volume 1, page 244:

"Usually, there is no problem in going from TEXT to HIRES, from HIRES to TEXT, from LORES to HIRES, or from HIRES to LORES. But you can get glitches on a TEXT to LORES or a LORES to TEXT transition. Here's the rule to stomp these glitches ..."

@tomcw

This comment has been minimized.

Copy link
Contributor Author

@tomcw tomcw commented Jun 23, 2019

Actually credit goes to @Archange427 for suggesting that PAGE1/PAGE2 doesn't have the 1 cycle delay, and for all his test dsk images & code he sent me to try and get to the bottom of this weird behaviour. Thanks!

@Archange427

This comment has been minimized.

Copy link

@Archange427 Archange427 commented Jun 23, 2019

Thank you @tomcw but you had to sort through all the emails I sent you filled with crazy ideas and unclear theories ;)
Very good job, as usual!

@sicklittlemonkey

This comment has been minimized.

Copy link
Contributor

@sicklittlemonkey sicklittlemonkey commented Jun 24, 2019

@tomcw tomcw changed the title PAGE1/2 select occurring 1 cycle late PAGE1/2 select occurring 1 cycle early Jun 24, 2019
@tomcw

This comment has been minimized.

Copy link
Contributor Author

@tomcw tomcw commented Jun 24, 2019

Hi Nick - my suspicion about this extra cycle for switching between TEXT and LORES is something funky going on with 7M and 14M clocks (maybe?).

  • LORES->TEXT: If you look at the images above for the LORES line, there are 3 cycles of 14M, and then the last one looks like 7M (ie. each pixel is 2x 14M pixels).
  • TEXT->LORES: If you look at the images here, the "*" is ~1.5 6502 cycles wide, and is TEXT80.

So maybe 1 extra cycle for 7M/14M change?

Anyway, I don't think emulation of this "glitch" is important, but clearly the timing of it is.

@tomcw

This comment has been minimized.

Copy link
Contributor Author

@tomcw tomcw commented Jun 28, 2019

Fixed in AppleWin 1.28.8.0 (here).

@tomcw tomcw closed this Jun 28, 2019
@tomcw tomcw added this to the 1.28.8 milestone Jun 28, 2019
@tomcw

This comment has been minimized.

Copy link
Contributor Author

@tomcw tomcw commented Sep 30, 2019

btw, I spoke to John Brooks last week, and he knew about this, and it was already implemented in his VidHD HDMI video card!

@sicklittlemonkey

This comment has been minimized.

Copy link
Contributor

@sicklittlemonkey sicklittlemonkey commented Oct 2, 2019

@tomcw

This comment has been minimized.

Copy link
Contributor Author

@tomcw tomcw commented Nov 16, 2019

Update:

There is no delay except TXTCLR, TXTSET, MIXEDCLR, MIXEDSET

@sosaria7 explains this here sosaria7/appleinpc#9 (comment).

tomcw added a commit that referenced this issue Nov 16, 2019
. 6502 interrupt delays 1 opcode when interrupt occurs on last cycle of opcode (#724).
. Only 1-cycle delay for VF_TEXT & VF_MIXED mode changes (#656).
NB. Mad Effect 1 still has a bit of flicker on Space Invader (left edge)
@tomcw

This comment has been minimized.

Copy link
Contributor Author

@tomcw tomcw commented Nov 18, 2019

This commit also fixes Deater's "Cycle-count Megademo" (here), where the vertical GR grey line shouldn't be visible between GR & HGR split video.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.