Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in - nap
CSDb User Forums


Forums > C64 Coding > Rasterbar + Scrolltext
2006-11-09 17:10
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
2006-11-09 17:19
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
2006-11-09 17:28
null
Account closed

Registered: Jun 2006
Posts: 645
hmm... expected something like that...

damn... ASM is waaay harder than everyone says... ;-)
2006-11-09 17:42
Danzig

Registered: Jun 2002
Posts: 440
finally: nice to see still some people trying to learn it in 2006 :)
2006-11-09 17:51
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)
2006-11-09 19:20
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?
2006-11-09 19:28
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.
2006-11-09 19:59
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
2006-11-09 22:04
Oswald

Registered: Apr 2002
Posts: 5094
also add lsr $d019 into the irq...
2006-11-10 02:09
The Phantom

Registered: Jan 2004
Posts: 360
Quote: also add lsr $d019 into the irq...

.....Forgive me... I am only NTSC....
2006-11-10 09:04
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.
RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Advanced
Users Online
psenough
Courage
Paladin/G★P
JLD/Finnish Gold
Felidae/Reflex
Knut Clausen/SHAPE/F..
Guests online: 126
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.6)
5 Edge of Disgrace  (9.6)
6 What Is The Matrix 2  (9.6)
7 The Demo Coder  (9.6)
8 Uncensored  (9.6)
9 Comaland 100%  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 No Listen  (9.6)
2 Layers  (9.6)
3 Cubic Dream  (9.6)
4 Party Elk 2  (9.6)
5 Copper Booze  (9.6)
6 X-Mas Demo 2024  (9.5)
7 Dawnfall V1.1  (9.5)
8 Rainbow Connection  (9.5)
9 Onscreen 5k  (9.5)
10 Morph  (9.5)
Top Groups
1 Performers  (9.3)
2 Booze Design  (9.3)
3 Oxyron  (9.3)
4 Censor Design  (9.3)
5 Triad  (9.3)
Top NTSC-Fixers
1 Pudwerx  (10)
2 Booze  (9.7)
3 Stormbringer  (9.7)
4 Fungus  (9.6)
5 Grim Reaper  (9.3)

Home - Disclaimer
Copyright © No Name 2001-2024
Page generated in: 0.061 sec.