| |
null Account closed
Registered: Jun 2006 Posts: 645 |
Rasterbar + Scrolltext
Hi everyone,
Djinn showed me some ASM routines, for a rasterbar and for a sroller... now I wanted to combine them (for learning purposes), but It doesn't seem to work.. =(
I already changed the rasterbar-routine so it shows the whole screen, instead of only the border...:
(Original rasterbar routine: http://stolendata.ath.cx/~djinn/raster.s)
*= $0810
sei
main2
ldy #$a3
lda #3
cpy $d012
bne *-3
sta $d020
sta $d021
ldy #$b1
lda #6
cpy $d012
bne *-3
sta $d020
sta $d021
(Now, if I would insert a 'jmp main2' here, it displays the rasterbar, else, it continues with the scroller below)
*= $0810
SEI
LDA #$37
STA $01
LDX #0
STX $D020
STX $D021
INX
STX $0286
JSR $E544
LOOP LDY #$80
LDX #7
SMOOTH STX $D016
CPY $D012
BNE *-3
DEY
DEX
BPL SMOOTH
LDX #218
SCROLL LDA $0799-218,X
STA $0798-218,X
INX
BNE SCROLL
WRITE LDX #0
LDA TEXT,X
BEQ WRAP
STA $07BE
INX
TXA
WRAP STA WRITE+1
JMP LOOP
TEXT .TEXT "SIMPLE SMOOTH SCROLLER"
.TEXT " - NOT TOO IMPRESSIVE "
.TEXT "AFTER ALL, IS IT? :-) "
.TEXT " SO, LET'S WRAP... "
.TEXT " "
.BYTE 0
now what I want, is that the scroller and the rasterbar are being displayed at the same time... the problem will probably have something to do with using the same registers or something... but you guys are the experts, so I'll let you laugh about me doing silly code mering =)
/knoeki |
|
| |
Zyron
Registered: Jan 2002 Posts: 2381 |
You can't just combine the two programs without moving some stuff around, like this:
*= $0810
SEI
LDA #$37
STA $01
LDX #0
STX $D020
STX $D021
INX
STX $0286
JSR $E544
main2
ldy #$a3
lda #3
cpy $d012
bne *-3
sta $d020
sta $d021
ldy #$b1
lda #6
cpy $d012
bne *-3
sta $d020
sta $d021
LOOP LDY #$80
LDX #7
SMOOTH STX $D016
CPY $D012
BNE *-3
DEY
DEX
BPL SMOOTH
LDX #218
SCROLL LDA $0799-218,X
STA $0798-218,X
INX
BNE SCROLL
WRITE LDX #0
LDA TEXT,X
BEQ WRAP
STA $07BE
INX
TXA
WRAP STA WRITE+1
JMP main2
TEXT .TEXT "SIMPLE SMOOTH SCROLLER"
.TEXT " - NOT TOO IMPRESSIVE "
.TEXT "AFTER ALL, IS IT? :-) "
.TEXT " SO, LET'S WRAP... "
.TEXT " "
.BYTE 0 |
| |
null Account closed
Registered: Jun 2006 Posts: 645 |
hmm... expected something like that...
damn... ASM is waaay harder than everyone says... ;-) |
| |
Danzig
Registered: Jun 2002 Posts: 440 |
finally: nice to see still some people trying to learn it in 2006 :) |
| |
Tch Account closed
Registered: Sep 2004 Posts: 512 |
Quote: hmm... expected something like that...
damn... ASM is waaay harder than everyone says... ;-)
It really isn´t Knoeki.
Once you see the logic of it,you´ll find it quite easy.
(For normal stuff that is..) ;)
Effe doorbijten,when you know the basics,you can do lots of nice tricks! 8) |
| |
The Phantom
Registered: Jan 2004 Posts: 360 |
Why not just JSR to the scroll routine while the raster bars are being displayed?
(Now, if I would insert a 'jmp main2' here, it displays the rasterbar, else, it continues with the scroller below)
So..
jsr scroll (or loop according to your code)
jmp main2
Would that not work the same? |
| |
The Phantom
Registered: Jan 2004 Posts: 360 |
Also, looking at the code a little harder this time around. Your IRQ doesn't look right to me. Try this...
sei
lda #$01
ldx #$7f
ldy #$1b
sta $d01a
stx $dc0d
sty $d011
lda #<irq1
ldx #>irq1
sta $314
stx $315
clc
cli
jmp nowhere
nowhere
jmp nowhere (endless loop)
irq1
lda #$32
sta $d012
Insert your raster code..
jsr LOOP for scroll
clc
jmp $ea81 or jmp $ea31
If you need help with coding, would like to look at some pretty basic source code, I can help out. I always like helping new people, regardless where they're located. |
| |
Danzig
Registered: Jun 2002 Posts: 440 |
@Phantom: doesn't uses "irq" at all! face the SEI at the beginning :)
edit: and better use $ea7e instead of $ea81! there are enuff threads here about $dc0d :D
edit2: @phantom again: as i guess you use turboassembler, use jmp * instead of nowhere jmp nowhere |
| |
Oswald
Registered: Apr 2002 Posts: 5094 |
also add lsr $d019 into the irq... |
| |
The Phantom
Registered: Jan 2004 Posts: 360 |
Quote: also add lsr $d019 into the irq...
.....Forgive me... I am only NTSC.... |
| |
Skate
Registered: Jul 2003 Posts: 494 |
@Knoeki: Try to understand how things work in interrupt routines and out of them. This will help you a lot of getting the main logic of 6052 ASM programming. If you have enough cycles, do everything in the interrupt routine (in most cases). But if you exceed the cycle limit, then you may want to place your code out of interrupt routines. And if you use that way, you'll learn where to place your raster interrupts and/or double buffering etc.
For example try to make 25 scrollers scrolling at the same time, then you'll understand what I mean. |