|
Subject: [stella] code incompatible with stella emulator From: Jim Crawford <pfister@xxxxxxxxxxxxxx> Date: Wed, 15 Oct 1997 07:54:54 -0700 (PDT) |
i just learned to code for the 2600 a few hours ago and wrote this (or
rather, modified it slightly from howtodrw.s (which, incidentally,
doesn't work under stella 0.7 at all -- it says there's a bad opcode but
rudely refuses to tell me which opcode or memory location))
this seems odd to me... the following code works fine under PCAE, but not
under Stella. i can't test it on a real atari myself, so i can't tell
which is right :)
can someone tell me what's going on?
(assembled under DASM v2.02)
processor 6502
org $f000
vsync equ $00 ;wait for vertical retrace
vblank equ $01 ;vertical blank
wsync equ $02 ;wait for horizontal retrace
colubk equ $09 ;background color
intim equ $284 ;timer read
tim64t equ $296 ;timer write
beginy equ $80
start
sei ;disable interrupts
cld ;clear bcd math bit
ldx #$ff ;set stack pointer
txs
lda #0 ;clear memory
clearloop
sta 0,x
dex
bne clearloop
mainloop
jsr vertblank
inc beginy
jsr drawscreen
jmp mainloop
vertblank
sta vsync ;wait for vsync
sta wsync ;wait for 3 scanlines
sta wsync
sta wsync
lda #44 ;set timer for 37 blank scanlines.
sta tim64t ;why 44? i didn't calculate it :)
rts
drawscreen
lda intim ;wait for vblank period to end
bne drawscreen
sta wsync ;first scanline
sta vblank ;turn blanking off
ldx #191 ;191 scanlines left...
ldy beginy ;start of color cycle
scanloop
sty colubk ;update background color
sta wsync ;wait for vsync
dey ;next color
dex
bne scanloop
lda #$ff
sta wsync ;last one
sta vblank ;turn blanking on for overscan
rts
org $f7fc
.word start ;entry point
.word start ;int vector
--
pf / green grapes / xantis
"The PowerPC is something that should be shown to small children when
they have been very bad." --Linus Torvalds
--
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 -> |
|---|---|---|
| [stella] Stella-Graph V1.1, Chris Pepin | Thread | [stella] re: problem with Stella em, Jim Nitchals |
| [stella] Stella-Graph V1.1, Chris Pepin | Date | [stella] re: problem with Stella em, Jim Nitchals |
| Month |