whscullin / apple2js

An Apple II emulator originally written in Javascript, now being converted to TypeScript
http://www.scullinsteel.com/apple2/
MIT License
438 stars 57 forks source link

Apple II DeskTop's triggering DHR Mono mode fails #153

Open inexorabletash opened 2 years ago

inexorabletash commented 2 years ago

Per https://github.com/whscullin/apple2js/#updates-2017-08-31 and looking at the monoDHRMode flag in the code, DHR mono should be supported. But Apple II DeskTop fails to trigger it in apple2js, although it works on real hardware, MAME, and AppleWin.

Repro:

(1) Use an Incognito/Private Browsing window to ensure you don't have saved mono color settings (2) Launch: https://www.scullinsteel.com/apple//e?accelerator_toggle=true#https://a2desktop.s3.amazonaws.com/lkg.2mg

Expected:

Actual:

Additional repro:

If it helps, the triggering sequence used to enter DHR mono is:

    sta $C00C ; CLR80VID - set register to 0
    sta $C05E ; AN3 off
    sta $C05F ; AN3 on - shift 0 in as first bit
    sta $C05E ; AN3 off
    sta $C05F ; AN3 on - shift 0 in as second bit
    sta $C00D ; SET80VID - enable 80-column hardware
    sta $C05E ; AN3 off - enable DHIRES

And the toggle to DHR color is:

    sta $C00D ; SET80VID - set register to 1
    sta $C05E ; AN3 off
    sta $C05F ; AN3 on - shift 1 in as first bit
    sta $C05E ; AN3 off
    sta $C05F ; AN3 on - shift 1 in as second bit
    sta $C05E ; AN3 off - enable DHIRES

I see the code handling an3 toggles and shifting in the mode bit, but I didn't debug.

whscullin commented 2 years ago

So... this is complicated. There are two renderers - the original, currently not default renderer, handles modes supported by the AppleColor 100 card, like 560x192 B&W mode and the whacky 160x192 16 color mode. The current default is the GL NTSC shader from Open Emulator, which replicates what comes out of the back of the machine's RCA video connector, which did not support DHGR B&W mode. You can switch between the two with the gl_canvas=true|false URL parameter.

I could make the NTSC shader replicate the DHR mono mode, emulating manually clicking the mono button on an Apple NTSC monitor and probably nobody would cry foul.

inexorabletash commented 2 years ago

Ah, thanks. Well, as you note I can tweak the URL I'm using (and have done so). The "real fix" would probably be to allow the user to select the monitor type (RGB or NTSC), but that's feature creep and incredibly niche - and also basically what turning off the GL renderer does; just rebrand the feature? I kinda like the "mono button" idea as that's how I experienced B&W mode back-in-the-day or today with my Laser 128, but I don't want you do do it on my account, as long as the alternate renderer sticks around. I'm fine with you closing this issue out - or at least renaming something more specific if you want it as a tracking bug.

Thanks again!