[stella] WSYNC and RESPx questions

Subject: [stella] WSYNC and RESPx questions
From: Thomas Jentzsch <tjentzsch@xxxxxxxx>
Date: Sat, 21 Aug 1999 10:55:42 +0200 (CEST)
Hello,
i've been following this list for a while and also searched
the archives. I'm trying to make my own kernel and still
have some questions:

There was some discussion about WSYNC, where some people
said, that it has to start not later than cycle 72 to catch
the end of the line. This means to me, that WSYNC needs >=5
cycles. I used distella to disassemble riveraid.bin, where
i found this piece of code:

LF258: STA    WSYNC   ;3

       STA    HMOVE   ;3|
       STA    ENAM0   ;3|
       STY    GRP0    ;3|
       LDA    $94,X   ;4|           a = 0..10
       BEQ    LF277   ;2|(15)
       TAX            ;2|
       CPX    #$07    ;2|
       BCS    LF288   ;2|(21)
       ...
LF277: NOP            ;2|(18)
       NOP            ;2|
       LDA    #$60    ;2|
       STA    RESP1   ;3|(25)       position player 1
       STA    HMP1    ;3|           shift left 6 pixel
       BNE    LF26E   ;2|(30)
       ...
LF288: SBC    #$04    ;2|(24)       a = 3..6
       TAX            ;2|
       DEC    $FD     ;5|
       LDY    $FD     ;3|
       BEQ    LF274   ;2|(36)
LF291: DEX            ;2|
       BPL    LF291   ;2|(55-70)
       STA    RESP1   ;3|(58-73)    position player 1
LF296: STA    WSYNC   ;3|(61-76)    <- ???

You can see, that WSYNC sometimes ($94,X == #$0a) starts at
cycle 74. This happens when the planes are flying on the
very right side. I've checked the possible values of $94,X
not only by looking at the code, but also by patching the
binary (cpx #$07 -> cpx #$0a, sbc #$04 -> brk).  This
caused Z26 (v1.32) to stop when the first plane enters from
the right.

I have no access to hardware, therefore i'm testing
everything on different emulators. They all allow WSYNC to
start at cylce 74, but i'm not shure if this emulation is
correct.

My second question is: what is the earliest usefull cycle
for RESPx?
If you look at riveraid.asm again, you find a special
routine for players on the very left side. The RESP1
doesn't end at cycle 23, which would be correct in relation
to the other possible values. It ends at cycle 25 and an
extra HMOVE for 6 pixel to the left is done to correct
this. I've no explanation why this is done that way, maybe
on a real VCS lower values have no effect? Z26 reacts on
values down to 22, lower values have the same effect as 22.

I hope some of you VCS-experts can help me.

===
Thomas Jentzsch           | *** Every bit is sacred ! ***
tjentzsch at yahoo dot de |
_______________________________________________
Do you yahoo!?
Gesendet von Yahoo! Mail - http://mail.yahoo.de
Yahoo! Auktionen - gleich ausprobieren - http://auktionen.yahoo.de


--
Archives (includes files) at http://www.biglist.com/lists/stella/archives/
Unsub & more at http://www.biglist.com/lists/stella/

Current Thread