No Cooper greetings screen

All about ST/STE demos

Moderators: lotek_style, Mug UK, Moderator Team

User avatar
Steven Seagal
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2018
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

No Cooper greetings screen

Postby Steven Seagal » Thu Sep 29, 2011 11:16 am

Hi again dudes,
I fixed this demo for Steem, using terrible hacks.
While doing this, I noticed a strange glitch, and I wonder if it appears on a real ST.

Here is the Hatari rendering:

Image

You see that one line is missing.

I had Steem display the line:

Image

[Edit: oh, and we notice it's ROB NORTHERN's name, so it's an important question!]

But then when the screen is cleared, I had this:

Image

Which I could remove, but with "tricks".

So I wonder what is real (I have no ST). Is the Hatari rendering faithful? Do you have one of the two glitches (either missing line in greetings or bit of line in the border while clearing)?

In any case, I intend to have Steem display the demo without glitch, I just hope to find a way more graceful than what I did.

Technical info: this is the first line of overscan (HblCounterVideo=264). For this one, and maybe other lines, the switch to MED RES happens at cycle 36 instead of 20, and I think Hatari interprets this a blank line trick.
Last edited by Steven Seagal on Fri Sep 30, 2011 7:30 am, edited 1 time in total.
In the CIA we learned that ST ruled
Steem SSE: http://sourceforge.net/projects/steemsse

Dio
Captain Atari
Captain Atari
Posts: 451
Joined: Thu Feb 28, 2008 3:51 pm

Re: No Cooper greetings screen

Postby Dio » Thu Sep 29, 2011 12:59 pm

I was going to give the demo a try here for you but I've just realised I don't have a simple way to burn MSA images to floppy :) . That Kryoflux is looking more tempting every day...

(edit) Aha, found a writer. I will try to give this a go later.

User avatar
npomarede
Atari God
Atari God
Posts: 1328
Joined: Sat Dec 01, 2007 7:38 pm
Location: France

Re: No Cooper greetings screen

Postby npomarede » Thu Sep 29, 2011 3:31 pm

As I worked on this demo, I think I have an explanation : when you remove left border with a hi/lo switch, the shifter will display black pixels during this 12 cycles.
So, the white part of the line is also drawn on a real ST, but it's not visible because those pixels are displayed at the place where shifter is in hi res.
On most tv monitors, you would also not see the leftmost pixels, because the image is often slightly cropped.

But Steem (as well as Hatari) don't emulate the exact shifter's behaviour (and the resulting pixels color) during this hi res switch, the border is removed but the pixels are still displayed as low res pixels.

So, I would say it's "normal", just some pixels which are not correctly turned to black and nobody noticed it while developping the demo on ST, because those pixels are always black in that case anyway (but as for Death Of The Left Border, doing this is in a truely generic way is a little more complicated)

Nicolas

edit : as for the shifted pixels around line 264, I would need to check on a real Atari, it's possible the error is present too (but it could also be wrong in Hatari)

User avatar
Steven Seagal
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2018
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: No Cooper greetings screen

Postby Steven Seagal » Sat Oct 15, 2011 9:47 pm

Adding some technical info:
There are 2 scanlines where the switch to MED RES is at 36 instead of 20: 183 & 200 (+64 in Hatari terms).
And in Steem I need to shift the display to the right +8 pixels from line 183 on, then +16 (8x2...) from line 200 on, or the alignment is bad (like it shows in the Steem development thread pic).
In the CIA we learned that ST ruled
Steem SSE: http://sourceforge.net/projects/steemsse

User avatar
npomarede
Atari God
Atari God
Posts: 1328
Joined: Sat Dec 01, 2007 7:38 pm
Location: France

Re: No Cooper greetings screen

Postby npomarede » Sun Oct 16, 2011 12:22 pm

Steven Seagal wrote:Adding some technical info:
There are 2 scanlines where the switch to MED RES is at 36 instead of 20: 183 & 200 (+64 in Hatari terms).

I checked the demo, and the line 263 and 247 were not correctly rendered in medres, which created the error you saw in the capture.
This is corrected in Hatari now.
And in Steem I need to shift the display to the right +8 pixels from line 183 on, then +16 (8x2...) from line 200 on, or the alignment is bad (like it shows in the Steem development thread pic).

There should be no reason for that, all overscan lines are 230 bytes, even those when bottom border is removed, no shifting should be needed (from the ST's point of view, the gfx are not shifted in RAM).
I guess this is more a side effect / conflict between the way Steen handles bottom border removal and the patch you added with timings from Hatari.

PS : when posting screen captures, you should use png instead of jpeg, the compression in later case really alters too much the image quality to see pixels details.

Nicolas

User avatar
Steven Seagal
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2018
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: No Cooper greetings screen

Postby Steven Seagal » Tue Oct 18, 2011 7:29 pm

Hi,

First, I faced a damn bug with No Cooper, I lost time on it thinking it had to do with video complications, timings, etc, it crashed all the time at the first '1984', an ugly crash with the screen full of garbage. I finally tracked it down to a simple modification that I had made to give the option 'keyboard click' on/off!
It did something like that:

Code: Select all

    if(sound_keyboard_click)
      PEEK(0x484) = PEEK(0x484) |  0x01;
    else
      PEEK(0x484) = PEEK(0x484)  &  0xFE;

All ST experts know the internal variable $484, that's the one for keyboard options.
Well, when the bit 0 is set, the demo crashes! Just to say bugs hide at the least likely places... I changed this option:

Code: Select all

    if(mute_keyboard_click && ( PEEK(0x484)&1 ))
    {
      PEEK(0x484) = PEEK(0x484)  &  0xFE;
    }

That way No Cooper passes. I guess users won't want the click back once it's been turned off by a program anyway.


npomarede wrote:There should be no reason for that, all overscan lines are 230 bytes, even those when bottom border is removed, no shifting should be needed (from the ST's point of view, the gfx are not shifted in RAM).
I guess this is more a side effect / conflict between the way Steen handles bottom border removal and the patch you added with timings from Hatari.

Yeah, I found the cause now. In Steem, lines are not rendered in one time like in Hatari (correct?). Each time there's some "shifter" event, the line up to that cycle is rendered. I think it's quite smart and should make Spectrum-like graphics easier for example. It's all fine but in this case, Steem has started rendering what it thinks is a "no left border" low res line, and moved the shifter pointer accordingly. So all I have to do is correct this pointer for those lines with a strange 16 cycles delay compared with the others (that is, this screen works without ugly hack now). It also takes care of the glitch I mentionned when the screen is being cleared: it was due to the lines being shifted.

230 bytes is quite large... isn't it 920 pixels? Max for Steem is 800, so the lines are cropped, but we lose nothing useful. In Best Part of the Creation, I think it's more visible that it's cropped, but it's still better than before.
In the CIA we learned that ST ruled
Steem SSE: http://sourceforge.net/projects/steemsse

Dio
Captain Atari
Captain Atari
Posts: 451
Joined: Thu Feb 28, 2008 3:51 pm

Re: No Cooper greetings screen

Postby Dio » Tue Oct 18, 2011 7:41 pm

Steven Seagal wrote:Hi,

First, I faced a damn bug with No Cooper, I lost time on it thinking it had to do with video complications, timings, etc, it crashed all the time at the first '1984', an ugly crash with the screen full of garbage. I finally tracked it down to a simple modification that I had made to give the option 'keyboard click' on/off!
It did something like that:

Code: Select all

    if(sound_keyboard_click)
      PEEK(0x484) = PEEK(0x484) |  0x01;
    else
      PEEK(0x484) = PEEK(0x484)  &  0xFE;

All ST experts know the internal variable $484, that's the one for keyboard options.

At what point do you execute this code? Plenty of games replace the system variables...

User avatar
Steven Seagal
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2018
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: No Cooper greetings screen

Postby Steven Seagal » Tue Oct 18, 2011 8:12 pm

Dio wrote:At what point do you execute this code? Plenty of games replace the system variables...


Each time you press a key! If you know a better way...
In the CIA we learned that ST ruled
Steem SSE: http://sourceforge.net/projects/steemsse

User avatar
npomarede
Atari God
Atari God
Posts: 1328
Joined: Sat Dec 01, 2007 7:38 pm
Location: France

Re: No Cooper greetings screen

Postby npomarede » Tue Oct 18, 2011 9:08 pm

I agree with Dio, this is a rather ugly hack, quite likely to make crash a lot of games/demos.
I would recommend you to remove it asap :)

The point is that you want to know if the program is still running under TOS/GEM (in that case you can change $484) or if it's not (which is the case for 95% of all games/demos).
There's no real easy way to guess that, but one possible safeguard could be to check that the VBL vector stored in $70 is still pointing inside the ROM region (you can also check $110, $114, $120, those vectors are often replaced by custom interrupt handlers when running under games/demos).
But even so, it's very risky to do this kind of change (for example, it would not work with earlier ST model where the TOS was loaded from a disk and stored in RAM)

Nicolas

User avatar
Steven Seagal
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2018
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: No Cooper greetings screen

Postby Steven Seagal » Tue Oct 18, 2011 9:50 pm

Well, that's new to me. I thought these variables were preserved, but obviously they aren't. It's not civilised.
One solution would be a trigger button where the keyboard is muted only once on demand and user knows he gets clicks, for example while playing The Pawn. A kind of Control Panel for when you have none.
In the CIA we learned that ST ruled
Steem SSE: http://sourceforge.net/projects/steemsse

Dio
Captain Atari
Captain Atari
Posts: 451
Joined: Thu Feb 28, 2008 3:51 pm

Re: No Cooper greetings screen

Postby Dio » Tue Oct 18, 2011 9:55 pm

Yeah, that's absolutely horrible. Any supervisor mode app is free to use that memory for whatever on earth it wants.

If you're going to do this, I suggest you do it in the very first trap #1 call (I presume STeem intercepts all those in order to implement it's hard disk support). And then don't do it again :) .

User avatar
Steven Seagal
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2018
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: No Cooper greetings screen

Postby Steven Seagal » Wed Oct 19, 2011 6:02 pm

No, it becomes too complicated, and like you mentionned, too risky.
But I want to keep this option.
The current solution is to reflect the state of the bit in the option box, and when player changes it, it is changed only at this time. Of course you still can crash No Cooper this way, but it's unlikely and obvious.
Problem is that you must do it each time you need it, it's like a Control Panel in your emulator. An honest trade off. And fewer tests when you press a key (not that it matters to me).
In the CIA we learned that ST ruled
Steem SSE: http://sourceforge.net/projects/steemsse

punkrulesok
Captain Atari
Captain Atari
Posts: 234
Joined: Tue Aug 05, 2003 7:34 pm

Re: No Cooper greetings screen

Postby punkrulesok » Sat Oct 22, 2011 8:54 am

Isn't SainT really good at doing the more technical stuff like this? Wonder how that renders it?

User avatar
Steven Seagal
Fuji Shaped Bastard
Fuji Shaped Bastard
Posts: 2018
Joined: Sun Dec 04, 2005 9:12 am
Location: Undisclosed
Contact:

Re: No Cooper greetings screen

Postby Steven Seagal » Mon Nov 21, 2011 7:42 pm

I think it doesn't work in SainT, but I only tried once.

npomarede wrote:PS : when posting screen captures, you should use png instead of jpeg, the compression in later case really alters too much the image quality to see pixels details.

Nicolas


You're right about this. Screenshots in PNG are smaller and crisper, I'll use them for my site now. Downside is it takes much time (in IrfanView at 6x).
In the CIA we learned that ST ruled
Steem SSE: http://sourceforge.net/projects/steemsse


Social Media

     

Return to “Demos - General”

Who is online

Users browsing this forum: No registered users and 11 guests