|
Subject: Re: [stella] New trick? From: Eckhard_Stolberg@xxxxxxxxxxxxxxxxxxxxx (Eckhard Stolberg) Date: Tue, 26 Aug 1997 16:13:57 +0200 |
>Eckhard, what you've discovered is very interesting, don't you have a piece
>of code to play with?
It was Erik, who discoverd it. I just took the code snippet, that he posted,
and wrote a loop around it.
Also his explaination is better than mine. You have to write something to
NUSIZx, but only once. And you don't have to write to RESPx before the last
copy has been drawn. You can do that at any time. So with self modifying
codein SC RAM, as Erik suggested, one could really create a Space Invaders
with more than 6 invaders per row.
VDELx doesn't have anything to do with this effect.
Here is my code anyway. I hope, that you can find through it, because it is
not commented at all. It's in A65 format.
If you replace the STA $86 with STA RESPx again, it would display 15 sprites
per line. The last sprite is a bit off though.
Ciao, Eckhard Stolberg
================================================================================
;
; ROM definitions
;
RomStart equ $F000
RomEnd equ $FFFF
IntVectors equ $FFFA
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Program initialization
;
ORG RomStart
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
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Main program loop
;
NewScreen:
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
LDA #0
STA GRP0
STA GRP1
STA $80
LDA #$10
STA $82
LDA #$F3
STA $81
LDA #$F3
STA $83
LDA #$06
STA ColuP0
LDA #$0a
STA ColuP1
VblankLoop:
LDA Intim
BNE VblankLoop ; wait for vblank timer
STA Wsync ; finish waiting for the current line
STA Vblank ; Turn off Vblank
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ScreenStart:
LDY #0
LDX #192
LDA #1
STA Nusiz0
STA Nusiz1
@1: STA WSYNC ;3
LDA ($80),Y ;5
STA GRP0 ;3
LDA ($82),Y ;5
STA GRP1 ;3
LDA $86 ;3
STA RESP0 ;3
STA RESP1 ;3
STA $86 ;RESP0 ;3
STA $86 ;RESP1 ;3
STA $86 ;RESP0 ;3
STA $86 ;RESP1 ;3
STA $86 ;RESP0 ;3
STA $86 ;RESP1 ;3
STA $86 ;RESP0 ;3
STA $86 ;RESP1 ;3
STA $86 ;RESP0 ;3
STA $86 ;RESP1 ;3
STA $86 ;RESP0 ;3
STA RESP1 ;3
STA RESP0 ;3
INY ;2
DEX ;2
BNE @1
LDA #2
STA Vblank
STA Wsync
STA Wsync
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
OverscanStart: LDA #35 ;skip 30 lines (overscan)
STA Tim64t
OverscanLoop:
LDA Intim
BNE OverscanLoop ; wait for Overscan timer
STA Wsync ; finish waiting for the current line
JMP NewScreen
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ORG $F300
GRAPHICS DB $81,$7e,$7e,$60,$60,$60,$60,$78
DB $78,$60,$60,$60,$60,$7e,$7e,$81
DB $81,$3c,$3c,$66,$66,$60,$60,$3c
DB $3c,$06,$06,$66,$66,$3c,$3c,$81
DB $81,$7e,$7e,$60,$60,$60,$60,$78
DB $78,$60,$60,$60,$60,$7e,$7e,$81
DB $81,$3c,$3c,$66,$66,$60,$60,$3c
DB $3c,$06,$06,$66,$66,$3c,$3c,$81
DB $81,$7e,$7e,$60,$60,$60,$60,$78
DB $78,$60,$60,$60,$60,$7e,$7e,$81
DB $81,$3c,$3c,$66,$66,$60,$60,$3c
DB $3c,$06,$06,$66,$66,$3c,$3c,$81
DB $81,$7e,$7e,$60,$60,$60,$60,$78
DB $78,$60,$60,$60,$60,$7e,$7e,$81
DB $81,$3c,$3c,$66,$66,$60,$60,$3c
DB $3c,$06,$06,$66,$66,$3c,$3c,$81
DB $81,$7e,$7e,$60,$60,$60,$60,$78
DB $78,$60,$60,$60,$60,$7e,$7e,$81
DB $81,$3c,$3c,$66,$66,$60,$60,$3c
DB $3c,$06,$06,$66,$66,$3c,$3c,$81
DB $81,$7e,$7e,$60,$60,$60,$60,$78
DB $78,$60,$60,$60,$60,$7e,$7e,$81
DB $81,$3c,$3c,$66,$66,$60,$60,$3c
DB $3c,$06,$06,$66,$66,$3c,$3c,$81
DB $81,$7e,$7e,$60,$60,$60,$60,$78
DB $78,$60,$60,$60,$60,$7e,$7e,$81
DB $81,$3c,$3c,$66,$66,$60,$60,$3c
DB $3c,$06,$06,$66,$66,$3c,$3c,$81
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Set up the 6502 interrupt vector table
;
ORG IntVectors
NMI dw Cart_Init
Reset dw Cart_Init
IRQ dw Cart_Init
END
--
Archives updated once/day at http://www.biglist.com/lists/stella/archives/
Unsubscribing and other info at http://www.biglist.com/lists/stella/stella.html
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [stella] New trick?, Piero Cavina | Thread | Re: [stella] New trick?, Chris Wilkson - MCD |
| Re: [stella] lots of things added t, Eckhard Stolberg | Date | Re: [stella] New trick?, Chris Wilkson - MCD |
| Month |