Re: [stella] Games that do bad things to HMOVE...

Subject: Re: [stella] Games that do bad things to HMOVE...
From: bwmott@xxxxxxxxxxxx
Date: Fri, 24 Apr 1998 15:45:14 -0400 (EDT)
> > Or it might move the objects 30 or 40 pixels one direction. :)  experiment
> > :)
> 
> Yes, it looks like a lot of experimenting is needed :-) 

Well, I had some time to play around with the HMOVE stuff today
and I've got all the data for moving P0 and P1.  The problem I wrote
about P0 not being moved right was all wrong.  There was a bug in my 
program I loaded $0f into HMPX instead of $f0 :-)

So here's a table which summaries the information I gathered by hitting
HMOVE at various cycles after WSYNC.  The table starts at cycle ten 
since that was the smallest delay my program allowed, however, by
wrapping around to 86 I end up with all of the values :-)

I'm also including the program I used to gather the data.  If anyone
has some free time feel free to build a table for the missles and
balls (hopefully it'll be the same).

Man, this was fun!  Now I just need to look over the data to see if it
makes any sense.  It looks like hitting HMOVE at cycle 73 or cycle 74
should be fairly useful in creating a playfield where no HMOVE blanks
occur.

Have Fun!
Brad

     HMPx values
     0   1   2   3   4   5   6   7   8   9   a   b   c   d   e   f     
Cyc
10   0  -1  -2  -2  -2  -2  -2  -2   8   7   6   5   4   3   2   1  ** HBLANK
11   0  -1  -1  -1  -1  -1  -1  -1   8   7   6   5   4   3   2   1     HBLANK
12   0   0   0   0   0   0   0   0   8   7   6   5   4   3   2   1     HBLANK
13   1   1   1   1   1   1   1   1   8   7   6   5   4   3   2   1     HBLANK
14   1   1   1   1   1   1   1   1   8   7   6   5   4   3   2   1  ** HBLANK
15   2   2   2   2   2   2   2   2   8   7   6   5   4   3   2   2     HBLANK
16   3   3   3   3   3   3   3   3   8   7   6   5   4   3   3   3     HBLANK
17   4   4   4   4   4   4   4   4   8   7   6   5   4   4   4   4     HBLANK
18   4   4   4   4   4   4   4   4   8   7   6   5   4   4   4   4  ** HBLANK
19   5   5   5   5   5   5   5   5   8   7   6   5   5   5   5   5     HBLANK
20   6   6   6   6   6   6   6   6   8   7   6   6   6   6   6   6     HBLANK
21   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0     
22   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0     
 .
 .
53   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0     
54   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0     
55   0   0   0   0   0   0   0  -1   0   0   0   0   0   0   0   0     
56   0   0   0   0   0   0  -1  -2   0   0   0   0   0   0   0   0     
57   0   0   0   0   0  -1  -2  -3   0   0   0   0   0   0   0   0     
58   0   0   0   0   0  -1  -2  -3   0   0   0   0   0   0   0   0   **
59   0   0   0   0  -1  -2  -3  -4   0   0   0   0   0   0   0   0  
60   0   0   0  -1  -2  -3  -4  -5   0   0   0   0   0   0   0   0
61   0   0  -1  -2  -3  -4  -5  -6   0   0   0   0   0   0   0   0
62   0   0  -1  -2  -3  -4  -5  -6   0   0   0   0   0   0   0   0  **
63   0  -1  -2  -3  -4  -5  -6  -7   0   0   0   0   0   0   0   0
64  -1  -2  -3  -4  -5  -6  -7  -8   0   0   0   0   0   0   0   0
65  -2  -3  -4  -5  -6  -7  -8  -9   0   0   0   0   0   0   0  -1
66  -2  -3  -4  -5  -6  -7  -8  -9   0   0   0   0   0   0   0  -1  **
67  -3  -4  -5  -6  -7  -8  -9 -10   0   0   0   0   0   0  -1  -2 
68  -4  -5  -6  -7  -8  -9 -10 -11   0   0   0   0   0  -1  -2  -3
69  -5  -6  -7  -8  -9 -10 -11 -12   0   0   0   0  -1  -2  -3  -4
70  -5  -6  -7  -8  -9 -10 -11 -12   0   0   0   0  -1  -2  -3  -4  **
71  -6  -7  -8  -9 -10 -11 -12 -13   0   0   0  -1  -2  -3  -4  -5
72  -7  -8  -9 -10 -11 -12 -13 -14   0   0  -1  -2  -3  -4  -5  -6 
73  -8  -9 -10 -11 -12 -13 -14 -15   0  -1  -2  -3  -4  -5  -6  -7
74  -8  -9 -10 -11 -12 -13 -14 -15   0  -1  -2  -3  -4  -5  -6  -7  **
75   0  -1  -2  -3  -4  -5  -6  -7   8   7   6   5   4   3   2   1     HBLANK
76   0  -1  -2  -3  -4  -5  -6  -7   8   7   6   5   4   3   2   1     HBLANK
77   0  -1  -2  -3  -4  -5  -6  -7   8   7   6   5   4   3   2   1     HBLANK
78   0  -1  -2  -3  -4  -5  -6  -7   8   7   6   5   4   3   2   1     HBLANK
79   0  -1  -2  -3  -4  -5  -6  -7   8   7   6   5   4   3   2   1     HBLANK
80   0  -1  -2  -3  -4  -5  -6  -6   8   7   6   5   4   3   2   1     HBLANK
81   0  -1  -2  -3  -4  -5  -5  -5   8   7   6   5   4   3   2   1     HBLANK
82   0  -1  -2  -3  -4  -5  -5  -5   8   7   6   5   4   3   2   1  ** HBLANK
83   0  -1  -2  -3  -4  -4  -4  -4   8   7   6   5   4   3   2   1     HBLANK
84   0  -1  -2  -3  -3  -3  -3  -3   8   7   6   5   4   3   2   1     HBLANK
85   0  -1  -2  -2  -2  -2  -2  -2   8   7   6   5   4   3   2   1     HBLANK
86   0  -1  -2  -2  -2  -2  -2  -2   8   7   6   5   4   3   2   1  ** HBLANK
87   0  -1  -1  -1  -1  -1  -1  -1   8   7   6   5   4   3   2   1     HBLANK
88   0   0   0   0   0   0   0   0   8   7   6   5   4   3   2   1     HBLANK
89   1   1   1   1   1   1   1   1   8   7   6   5   4   3   2   1     HBLANK
90   1   1   1   1   1   1   1   1   8   7   6   5   4   3   2   1  ** HBLANK
91   2   2   2   2   2   2   2   2   8   7   6   5   4   3   2   2     HBLANK
92   3   3   3   3   3   3   3   3   8   7   6   5   4   3   3   3     HBLANK
93   4   4   4   4   4   4   4   4   8   7   6   5   4   4   4   4     HBLANK

Notice that 10 + 76 = 86 and the table is repeating...

10   0  -1  -2  -2  -2  -2  -2  -2   8   7   6   5   4   3   2   1  ** HBLANK
11   0  -1  -1  -1  -1  -1  -1  -1   8   7   6   5   4   3   2   1     HBLANK
12   0   0   0   0   0   0   0   0   8   7   6   5   4   3   2   1     HBLANK
13   1   1   1   1   1   1   1   1   8   7   6   5   4   3   2   1     HBLANK
14   1   1   1   1   1   1   1   1   8   7   6   5   4   3   2   1  ** HBLANK
15   2   2   2   2   2   2   2   2   8   7   6   5   4   3   2   2     HBLANK
16   3   3   3   3   3   3   3   3   8   7   6   5   4   3   3   3     HBLANK
17   4   4   4   4   4   4   4   4   8   7   6   5   4   4   4   4     HBLANK




        processor 6502

;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;; TIA (Stella) write-only registers
;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Vsync		equ	$00
Vblank		equ	$01
Wsync		equ	$02
Nusiz0		equ	$04
Nusiz1		equ	$05
ColuP0          equ     $06
ColuP1          equ     $07
ColuBK          equ     $09
Ctrlpf		equ	$0A
Resp0           equ     $10
Resp1           equ     $11
Grp0		equ	$1b
Grp1		equ	$1c
Hmp0		equ	$20
Hmp1		equ	$21
Hmove           equ     $2A
Hmclr		equ	$2B

;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;; 6532 (RIOT) registers
;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Swcha           equ     $0280
Swacnt          equ     $0281
Swchb           equ     $0282
Swbcnt          equ     $0283
Intim		equ	$0284
Tim64t		equ	$0296

;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;; ROM definitions
;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
RomStart        equ     $F000
RomEnd          equ     $FFFF
IntVectors      equ     $FFFA


delay		equ	$a0
oldjoy		equ	$a1

;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
;; Program initialisation
;; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
		org 	$F000
MotionTable:	dc.b	$00, $10, $20, $30, $40, $50, $60, $70
                dc.b    $80, $90, $a0, $b0, $c0, $d0, $e0, $f0

Ziffern         dc.b    $77,$22,$77,$77,$55,$77,$44,$77,$77,$77,$77,$77,$77,$66,$77,$77
                dc.b    $55,$66,$11,$11,$55,$44,$44,$11,$55,$55,$55,$55,$44,$55,$44,$44
                dc.b    $55,$22,$77,$33,$77,$77,$77,$11,$77,$77,$77,$66,$44,$55,$66,$66
                dc.b    $55,$22,$44,$11,$11,$11,$55,$11,$55,$11,$55,$55,$44,$55,$44,$44
                dc.b    $77,$77,$77,$77,$11,$77,$77,$11,$77,$77,$55,$77,$77,$66,$77,$44
                ;       0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F

		org	$F400
NUMDATA:
        dc.b $77, $55, $55, $55, $77
        dc.b $72, $56, $52, $52, $77
        dc.b $77, $51, $57, $54, $77
        dc.b $77, $51, $53, $51, $77
        dc.b $75, $55, $57, $51, $71
        dc.b $77, $54, $57, $51, $77
        dc.b $74, $54, $57, $55, $77
        dc.b $77, $51, $51, $51, $71
        dc.b $77, $55, $57, $55, $77
        dc.b $77, $55, $57, $51, $77
        dc.b $77, $55, $57, $55, $75
        dc.b $77, $55, $56, $55, $77
        dc.b $77, $54, $54, $54, $77
        dc.b $76, $55, $55, $55, $76
        dc.b $77, $54, $56, $54, $77
        dc.b $77, $54, $56, $54, $74
        dc.b $27, $65, $25, $25, $77
        dc.b $22, $66, $22, $22, $77
        dc.b $27, $61, $27, $24, $77
        dc.b $27, $61, $23, $21, $77
        dc.b $25, $65, $27, $21, $71
        dc.b $27, $64, $27, $21, $77
        dc.b $24, $64, $27, $25, $77
        dc.b $27, $61, $21, $21, $71
        dc.b $27, $65, $27, $25, $77
        dc.b $27, $65, $27, $21, $77
        dc.b $27, $65, $27, $25, $75
        dc.b $27, $65, $26, $25, $77
        dc.b $27, $64, $24, $24, $77
        dc.b $26, $65, $25, $25, $76
        dc.b $27, $64, $26, $24, $77
        dc.b $27, $64, $26, $24, $74
        dc.b $77, $15, $75, $45, $77
        dc.b $72, $16, $72, $42, $77
        dc.b $77, $11, $77, $44, $77
        dc.b $77, $11, $73, $41, $77
        dc.b $75, $15, $77, $41, $71
        dc.b $77, $14, $77, $41, $77
        dc.b $74, $14, $77, $45, $77
        dc.b $77, $11, $71, $41, $71
        dc.b $77, $15, $77, $45, $77
        dc.b $77, $15, $77, $41, $77
        dc.b $77, $15, $77, $45, $75
        dc.b $77, $15, $76, $45, $77
        dc.b $77, $14, $74, $44, $77
        dc.b $76, $15, $75, $45, $76
        dc.b $77, $14, $76, $44, $77
        dc.b $77, $14, $76, $44, $74
        dc.b $77, $15, $35, $15, $77
        dc.b $72, $16, $32, $12, $77
        dc.b $77, $11, $37, $14, $77
        dc.b $77, $11, $33, $11, $77
        dc.b $75, $15, $37, $11, $71
        dc.b $77, $14, $37, $11, $77
        dc.b $74, $14, $37, $15, $77
        dc.b $77, $11, $31, $11, $71
        dc.b $77, $15, $37, $15, $77
        dc.b $77, $15, $37, $11, $77
        dc.b $77, $15, $37, $15, $75
        dc.b $77, $15, $36, $15, $77
        dc.b $77, $14, $34, $14, $77
        dc.b $76, $15, $35, $15, $76
        dc.b $77, $14, $36, $14, $77
        dc.b $77, $14, $36, $14, $74
        dc.b $57, $55, $75, $15, $17
        dc.b $52, $56, $72, $12, $17
        dc.b $57, $51, $77, $14, $17
        dc.b $57, $51, $73, $11, $17
        dc.b $55, $55, $77, $11, $11
        dc.b $57, $54, $77, $11, $17
        dc.b $54, $54, $77, $15, $17
        dc.b $57, $51, $71, $11, $11
        dc.b $57, $55, $77, $15, $17
        dc.b $57, $55, $77, $11, $17
        dc.b $57, $55, $77, $15, $15
        dc.b $57, $55, $76, $15, $17
        dc.b $57, $54, $74, $14, $17
        dc.b $56, $55, $75, $15, $16
        dc.b $57, $54, $76, $14, $17
        dc.b $57, $54, $76, $14, $14
        dc.b $77, $45, $75, $15, $77
        dc.b $72, $46, $72, $12, $77
        dc.b $77, $41, $77, $14, $77
        dc.b $77, $41, $73, $11, $77
        dc.b $75, $45, $77, $11, $71
        dc.b $77, $44, $77, $11, $77
        dc.b $74, $44, $77, $15, $77
        dc.b $77, $41, $71, $11, $71
        dc.b $77, $45, $77, $15, $77
        dc.b $77, $45, $77, $11, $77
        dc.b $77, $45, $77, $15, $75
        dc.b $77, $45, $76, $15, $77
        dc.b $77, $44, $74, $14, $77
        dc.b $76, $45, $75, $15, $76
        dc.b $77, $44, $76, $14, $77
        dc.b $77, $44, $76, $14, $74
        dc.b $47, $45, $75, $55, $77
        dc.b $42, $46, $72, $52, $77
        dc.b $47, $41, $77, $54, $77
        dc.b $47, $41, $73, $51, $77
        dc.b $45, $45, $77, $51, $71
        dc.b $47, $44, $77, $51, $77
        dc.b $44, $44, $77, $55, $77
        dc.b $47, $41, $71, $51, $71
        dc.b $47, $45, $77, $55, $77
        dc.b $47, $45, $77, $51, $77
        dc.b $47, $45, $77, $55, $75
        dc.b $47, $45, $76, $55, $77
        dc.b $47, $44, $74, $54, $77
        dc.b $46, $45, $75, $55, $76
        dc.b $47, $44, $76, $54, $77
        dc.b $47, $44, $76, $54, $74
        dc.b $77, $15, $15, $15, $17
        dc.b $72, $16, $12, $12, $17
        dc.b $77, $11, $17, $14, $17
        dc.b $77, $11, $13, $11, $17
        dc.b $75, $15, $17, $11, $11
        dc.b $77, $14, $17, $11, $17
        dc.b $74, $14, $17, $15, $17
        dc.b $77, $11, $11, $11, $11
        dc.b $77, $15, $17, $15, $17
        dc.b $77, $15, $17, $11, $17
        dc.b $77, $15, $17, $15, $15
        dc.b $77, $15, $16, $15, $17
        dc.b $77, $14, $14, $14, $17
        dc.b $76, $15, $15, $15, $16
        dc.b $77, $14, $16, $14, $17
        dc.b $77, $14, $16, $14, $14
        dc.b $77, $55, $75, $55, $77
        dc.b $72, $56, $72, $52, $77
        dc.b $77, $51, $77, $54, $77
        dc.b $77, $51, $73, $51, $77
        dc.b $75, $55, $77, $51, $71
        dc.b $77, $54, $77, $51, $77
        dc.b $74, $54, $77, $55, $77
        dc.b $77, $51, $71, $51, $71
        dc.b $77, $55, $77, $55, $77
        dc.b $77, $55, $77, $51, $77
        dc.b $77, $55, $77, $55, $75
        dc.b $77, $55, $76, $55, $77
        dc.b $77, $54, $74, $54, $77
        dc.b $76, $55, $75, $55, $76
        dc.b $77, $54, $76, $54, $77
        dc.b $77, $54, $76, $54, $74
        dc.b $77, $55, $75, $15, $77
        dc.b $72, $56, $72, $12, $77
        dc.b $77, $51, $77, $14, $77
        dc.b $77, $51, $73, $11, $77
        dc.b $75, $55, $77, $11, $71
        dc.b $77, $54, $77, $11, $77
        dc.b $74, $54, $77, $15, $77
        dc.b $77, $51, $71, $11, $71
        dc.b $77, $55, $77, $15, $77
        dc.b $77, $55, $77, $11, $77
        dc.b $77, $55, $77, $15, $75
        dc.b $77, $55, $76, $15, $77
        dc.b $77, $54, $74, $14, $77
        dc.b $76, $55, $75, $15, $76
        dc.b $77, $54, $76, $14, $77
        dc.b $77, $54, $76, $14, $74
        dc.b $77, $55, $75, $55, $57
        dc.b $72, $56, $72, $52, $57
        dc.b $77, $51, $77, $54, $57
        dc.b $77, $51, $73, $51, $57
        dc.b $75, $55, $77, $51, $51
        dc.b $77, $54, $77, $51, $57
        dc.b $74, $54, $77, $55, $57
        dc.b $77, $51, $71, $51, $51
        dc.b $77, $55, $77, $55, $57
        dc.b $77, $55, $77, $51, $57
        dc.b $77, $55, $77, $55, $55
        dc.b $77, $55, $76, $55, $57
        dc.b $77, $54, $74, $54, $57
        dc.b $76, $55, $75, $55, $56
        dc.b $77, $54, $76, $54, $57
        dc.b $77, $54, $76, $54, $54
        dc.b $77, $55, $65, $55, $77
        dc.b $72, $56, $62, $52, $77
        dc.b $77, $51, $67, $54, $77
        dc.b $77, $51, $63, $51, $77
        dc.b $75, $55, $67, $51, $71
        dc.b $77, $54, $67, $51, $77
        dc.b $74, $54, $67, $55, $77
        dc.b $77, $51, $61, $51, $71
        dc.b $77, $55, $67, $55, $77
        dc.b $77, $55, $67, $51, $77
        dc.b $77, $55, $67, $55, $75
        dc.b $77, $55, $66, $55, $77
        dc.b $77, $54, $64, $54, $77
        dc.b $76, $55, $65, $55, $76
        dc.b $77, $54, $66, $54, $77
        dc.b $77, $54, $66, $54, $74
        dc.b $77, $45, $45, $45, $77
        dc.b $72, $46, $42, $42, $77
        dc.b $77, $41, $47, $44, $77
        dc.b $77, $41, $43, $41, $77
        dc.b $75, $45, $47, $41, $71
        dc.b $77, $44, $47, $41, $77
        dc.b $74, $44, $47, $45, $77
        dc.b $77, $41, $41, $41, $71
        dc.b $77, $45, $47, $45, $77
        dc.b $77, $45, $47, $41, $77
        dc.b $77, $45, $47, $45, $75
        dc.b $77, $45, $46, $45, $77
        dc.b $77, $44, $44, $44, $77
        dc.b $76, $45, $45, $45, $76
        dc.b $77, $44, $46, $44, $77
        dc.b $77, $44, $46, $44, $74
        dc.b $67, $55, $55, $55, $67
        dc.b $62, $56, $52, $52, $67
        dc.b $67, $51, $57, $54, $67
        dc.b $67, $51, $53, $51, $67
        dc.b $65, $55, $57, $51, $61
        dc.b $67, $54, $57, $51, $67
        dc.b $64, $54, $57, $55, $67
        dc.b $67, $51, $51, $51, $61
        dc.b $67, $55, $57, $55, $67
        dc.b $67, $55, $57, $51, $67
        dc.b $67, $55, $57, $55, $65
        dc.b $67, $55, $56, $55, $67
        dc.b $67, $54, $54, $54, $67
        dc.b $66, $55, $55, $55, $66
        dc.b $67, $54, $56, $54, $67
        dc.b $67, $54, $56, $54, $64
        dc.b $77, $45, $65, $45, $77
        dc.b $72, $46, $62, $42, $77
        dc.b $77, $41, $67, $44, $77
        dc.b $77, $41, $63, $41, $77
        dc.b $75, $45, $67, $41, $71
        dc.b $77, $44, $67, $41, $77
        dc.b $74, $44, $67, $45, $77
        dc.b $77, $41, $61, $41, $71
        dc.b $77, $45, $67, $45, $77
        dc.b $77, $45, $67, $41, $77
        dc.b $77, $45, $67, $45, $75
        dc.b $77, $45, $66, $45, $77
        dc.b $77, $44, $64, $44, $77
        dc.b $76, $45, $65, $45, $76
        dc.b $77, $44, $66, $44, $77
        dc.b $77, $44, $66, $44, $74
        dc.b $77, $45, $65, $45, $47
        dc.b $72, $46, $62, $42, $47
        dc.b $77, $41, $67, $44, $47
        dc.b $77, $41, $63, $41, $47
        dc.b $75, $45, $67, $41, $41
        dc.b $77, $44, $67, $41, $47
        dc.b $74, $44, $67, $45, $47
        dc.b $77, $41, $61, $41, $41
        dc.b $77, $45, $67, $45, $47
        dc.b $77, $45, $67, $41, $47
        dc.b $77, $45, $67, $45, $45
        dc.b $77, $45, $66, $45, $47
        dc.b $77, $44, $64, $44, $47
        dc.b $76, $45, $65, $45, $46
        dc.b $77, $44, $66, $44, $47
        dc.b $77, $44, $66, $44, $44

Cart_Init:      SEI				; Disable interrupts.:
		CLD				; Clear "decimal" mode.

		LDX	#$FF
		TXS				; Clear the stack

Common_Init:
		LDX	#$28		; Clear the TIA registers ($04-$2C)
		LDA	#$00
TIAClear:
		STA	$04,X
		DEX
                BPL     TIAClear        ; loop exits with X=$FF
	
		LDX	#$FF
RAMClear:
		STA	$00,X		; Clear the RAM ($FF-$80)
		DEX
                BMI     RAMClear        ; loop exits with X=$7F
	
		LDX	#$FF
		TXS				; Reset the stack
 
IOClear:
		STA	Swbcnt		; console I/O always set to INPUT
		STA	Swacnt		; set controller I/O to INPUT

		LDA	$280
		sta	oldjoy

		LDA	#0
		STA	delay 

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Main program loop
;
Start:
                LDA     #$02
		STA	Wsync		; Wait for horizontal sync
		STA	Vblank		; Turn on Vblank
                STA	Vsync		; Turn on Vsync
		STA	Wsync		; Leave Vsync on for 3 lines
		STA	Wsync
		STA	Wsync
                LDA     #$00
		STA	Vsync		; Turn Vsync off

                LDA     #43             ; Vblank for 37 lines
		STA	Tim64t		; 43*64intvls=2752=8256colclks=36.2lines


;; Look at joystick here and change delay value

		LDA	$280
		EOR	oldjoy
		BEQ	next

		LDA	$280
		AND	#$40
		BNE	right

		dec	delay
		jmp	out

right:		LDA	$280
		AND	#$80
		BNE	out
		inc	delay

out:		lda	$280
		STA	oldjoy

next:
		lda	#$00
		sta	$81
		lda	delay
		clc
		adc	#10
		sta	$80	

		clc
		rol	$80
		rol	$81
		rol	$80
		rol	$81

		adc	$80
		sta	$80
		lda	$81
		adc	#0
		sta	$81

		lda	#<NUMDATA
		adc	$80
		sta	$80
		lda 	#>NUMDATA
		adc	$81
		sta	$81

            	LDA 	#0
		STA	Nusiz0
		STA	Nusiz1
		STA	Grp0
		STA	Grp1

VblankLoop:
		LDA	Intim
                BNE     VblankLoop      ; wait for vblank timer
		STA	Wsync		; finish waiting for the current line
                STA     Vblank          ; turn off Vblank

                LDA     #$00            ;black
                STA     ColuBK
                LDA     #$0e            ;white
                STA     ColuP0
                STA     ColuP1

                LDA     #$AA            ; playfield color
                STA	$8

                LDA 	#1        	; reflected playfield
         	STA   	Ctrlpf
		LDA     #$ff
                STA     $d

		STA	Wsync
		LDY	#$00
DigitLoop:	LDA	($80),y
		STA	Grp0
		sta	Wsync
		iny
		cpy	#$05
		BNE	DigitLoop

            	LDA 	#1
		STA	Nusiz0
		STA	Nusiz1

		LDX	#$00
MotionLoop:	STA	Wsync
		LDA 	#0
		STA	Grp0
		STA	Grp1

		LDA	#$80
		STA	Hmp0
		LDA	MotionTable,X	
		STA	Hmp1

		LDA	#$07
             	STA	Wsync		; waste the rest of the line
		NOP
		TAY
pause1:		DEY
		BNE	pause1
		STA	Resp0
		STA	Resp1

; The following loop does the HMOVE at ??

;		STA	Wsync
;		STA	Hmove
;		JMP	return

		SEC
		LDA	#<delaybranch
		SBC	delay
		STA	$82
		LDA	#>delaybranch
		SBC	#0
		STA	$83
		TXA

		STA	Wsync           ; 
		JMP	($82)           ; +5  5

return:		TAX
		LDA 	#$AA		; Turn graphics on
		STA	Grp0
		STA	Grp1


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Screen:         LDY     #6
B3:             STA     Wsync 
                DEY
                BNE     B3

		INX
		CPX	#$10
		BNE 	MotionLoop

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
		STA  	Wsync

		LDA	#$80
		STA	Hmp0
		LDA	#$90
		STA	Hmp1

		LDA	#$07
             	STA	Wsync		; waste the rest of the line
		NOP
		TAY
pause3:		DEY
		BNE	pause3
		STA	Resp0
		STA	Resp1

		STA	Wsync
		STA	Hmove

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

                LDY     #40
B4:             STA     Wsync 
                DEY
                BNE     B4

                LDA     #$02
                STA     Vblank          ;turn on Vblank
                LDX     #16
END:           	STA     Wsync
                DEX
                BNE     END
                JMP     Start

		org 	$FD00
dodelay:	
		dc.b	$c9
		dc.b	$c9
		dc.b	$c9
		dc.b	$c9
		dc.b	$c9
		dc.b	$c9
		dc.b	$c9
		dc.b	$c9
		dc.b	$c9
		dc.b	$c9
		dc.b	$c9
		dc.b	$c9
		dc.b	$c9
		dc.b	$c9
		dc.b	$c9
		dc.b	$c9
		dc.b	$c9
		dc.b	$c9
		dc.b	$c9
		dc.b	$c9             ; +2  2
		dc.b	$c9             
		dc.b	$c9             ; +2  2
		dc.b	$c9
		dc.b	$c9             ; +2  4
		dc.b	$c9
		dc.b	$c9             ; +2  6
		dc.b	$c9
		dc.b	$c9             ; +2  8
		dc.b	$c9
		dc.b	$c9             ; +2  10
		dc.b	$c9
		dc.b	$c9             ; +2  12
		dc.b	$c9
		dc.b	$c9             ; +2  14
		dc.b	$c9
		dc.b	$c9             ; +2  16
		dc.b	$c9
		dc.b	$c9             ; +2  18
		dc.b	$c9
		dc.b	$c9             ; +2  20
		dc.b	$c9
		dc.b	$c9             ; +2  22
		dc.b	$c9
		dc.b	$c9             ; +2  24
		dc.b	$c9
		dc.b	$c9             ; +2  26
		dc.b	$c9
		dc.b	$c9             ; +2  28
		dc.b	$c9
		dc.b	$c9             ; +2  30
		dc.b	$c9
		dc.b	$c9             ; +2  32
		dc.b	$c9
		dc.b	$c9             ; +2  34
		dc.b	$c9
		dc.b	$c9             ; +2  36
		dc.b	$c9
		dc.b	$c9             ; +2  38
		dc.b	$c9
		dc.b	$c9             ; +2  40
		dc.b	$c9
		dc.b	$c9             ; +2  42
		dc.b	$c9
		dc.b	$c9             ; +2  44
		dc.b	$c9
		dc.b	$c9             ; +2  46
		dc.b	$c9
		dc.b	$c9             ; +2  48
		dc.b	$c9
		dc.b	$c9             ; +2  50
		dc.b	$c9
		dc.b	$c9             ; +2  52
		dc.b	$c9
		dc.b	$c9             ; +2  54
		dc.b	$c9
		dc.b	$c9             ; +2  56
		dc.b	$c9
		dc.b	$c9             ; +2  58
		dc.b	$c9
		dc.b	$c9             ; +2  60
		dc.b	$c9
		dc.b	$c9             ; +2  62
		dc.b	$c9
		dc.b	$c9             ; +2  64
		dc.b	$c9
		dc.b	$c9             ; +2  66
		dc.b	$c9
		dc.b	$c9             ; +2  68
		dc.b	$c9
		dc.b	$c9             ; +2  70
		dc.b	$c5
delaybranch:    dc.b    $ea   
		STA	Hmove           ; +3  73
		JMP	return

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Set up the 6502 interrupt vector table
;
		ORG	IntVectors
NMI             dc.w      Cart_Init
Reset           dc.w      Cart_Init
IRQ             dc.w      Cart_Init
        
;                END

--------------------------------------------------------------------------
Bradford W. Mott (bwmott@xxxxxxx)          Computer Science Department
http://www4.ncsu.edu/~bwmott/www           North Carolina State University
--------------------------------------------------------------------------

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

Current Thread