[hatari-devel] Mahabharata demo problem ?
Laurent Sallafranque
laurent.sallafranque at free.fr
Sat Jan 15 21:57:56 CET 2011
I've given a try to the patch.
No regression found.
Is it me, or is the screen between to screens in a demo are better with
the patch ?
(I mean, between each demo screen, when resolution of screen size
change, it always took a little time (but visible and now, it seems to
have disapeared).
For Videl, shouldn't horizontal size be read in
$FF8288 (word) : HDB - Horizontal Display Begin
$FF828A (word) : HDE - Horizontal Display End
instead of $FF8210 (word) : VWRAP - line width ?
For vertical size, we read
$FF82A8 (word) : VDB - Vertical Display Begin
$FF82AA (word) : VDE - Vertical Display End
I had compiled all the videl registers for when I would work on it.
Here it is, perhaps it could be included as comment at top of the videl
file ?
/*
It can run at 2 frequencies : 25 Mhz or 32 MHz
Hardware I/O registers:
$FF8006 (byte) : monitor type
$FF820E (word) : offset to next line
$FF8210 (word) : VWRAP - line width
$FF8260 (byte) : ST shift mode
$FF8265 (byte) : Horizontal scroll register
$FF8266 (word) : Falcon shift mode
$FF8280 (word) : HHC - Horizontal Hold Counter
$FF8282 (word) : HHT - Horizontal Hold Timer
$FF8284 (word) : HBB - Horizontal Border Begin
$FF8286 (word) : HBE - Horizontal Border End
$FF8288 (word) : HDB - Horizontal Display Begin
$FF828A (word) : HDE - Horizontal Display End
$FF828C (word) : HSS - Horizontal SS
$FF828E (word) : HFS - Horizontal FS
$FF8290 (word) : HEE - Horizontal EE
$FF82A0 (word) : VFC - Vertical Frequency Counter
$FF82A2 (word) : VFT - Vertical Frequency Timer
$FF82A4 (word) : VBB - Vertical Border Begin
$FF82A6 (word) : VBE - Vertical Border End
$FF82A8 (word) : VDB - Vertical Display Begin
$FF82AA (word) : VDE - Vertical Display End
$FF82AC (word) : VSS - Vertical SS
$FF82C0 (word) : VCO - Video control
$FF82C2 (word) : VMD - Video mode
*/
Regards
Laurent
Le 15/01/2011 21:30, Eero Tamminen a écrit :
> Hi,
>
> On lauantai 15 tammikuu 2011, Eero Tamminen wrote:
>> Not unbounded sizes. During the demo, 5120x200 and 5120x240
>> sized resolutions are requested several times.
>>
>> I think there could be some corner-case that Hatari Videl code isn't
>> emulating. Maybe the real HW clips large resolutions and like ST/STE
>> does something "unexpected" when being requested funny resolution
>> changes.
> Videl code does following:
>
> get width (register is scanline size in words):
> (handleReadW(HW + 0x10)& 0x03ff) * 16 / VIDEL_getScreenBpp();
>
> get bpp:
> ---------------------
> int f_shift = handleReadW(HW + 0x66);
> int st_shift = handleRead(HW + 0x60);
> /* to get bpp, we must examine f_shift and st_shift.
> * f_shift is valid if any of bits no. 10, 8 or 4
> * is set. Priority in f_shift is: 10 ">" 8">" 4, i.e.
> * if bit 10 set then bit 8 and bit 4 don't care...
> ...
> if (f_shift& 0x400) /* Falcon: 2 colors */
> bits_per_pixel = 1;
> else if (f_shift& 0x100) /* Falcon: hicolor */
> bits_per_pixel = 16;
> ---------------------
>
> If scanline register value is 320, and bpp gets set to 1 instead of 16:
> -> width = 5120
>
> And indeed when I traced changes in all of these registers:
> b (0xff8210).w ! (0xff8210).w :trace
> b (0xff8266).w ! (0xff8266).w :trace
> b (0xff8260).b ! (0xff8260).b :trace
>
> Whenever the window goes too wide, I see:
> $ff8266 = $400
> 2. CPU breakpoint condition(s) matched 1 times.
> WARNING: too large screen size 5120x240 -> divided by 4x1!
> $ff8266 = $100
>
> I.e. Falcon shifter control register 2-color mode bit is toggled, but
> nothing else.
>
>
> I remember that monochrome toggling on color resolutions did something
> special on ST(e), maybe something similar should happen on Falcon's Videl?
>
>
> There's also this suspicious stuff in VIDEL_renderScreen():
> if (since_last_change> 2) {
> if (vw> 0&& vw != width) {
> Dprintf(("CH width %d\n", width));
> width = vw;
> since_last_change = 0;
> ...
> if (since_last_change == 3) {
> HostScreen_setWindowSize(width, height, bpp == 16 ? 16 : ...
> }
> if (since_last_change< 4) {
> since_last_change++;
> return false;
> }
>
> This function is called from Video_DrawScreen() which is called from
> Video_InterruptHandler_VBL() and on fullscreen switches.
>
> -> The resolution is changed 3 VBLs later than it actually happens and
> rendering of Falcon screen content to the Hatari window is skipped
> during this time.
>
> Everything seems to work fine if I remove that (see the attached patch).
>
> Thomas?
>
>
> - Eero
>
>
> _______________________________________________
> hatari-devel mailing list
> hatari-devel at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/hatari-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.berlios.de/pipermail/hatari-devel/attachments/20110115/a6923551/attachment.html>
More information about the hatari-devel
mailing list