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 > Down Scroll
2003-05-18 11:12
fermhg
Account closed

Registered: Oct 2002
Posts: 43
Down Scroll

According to Mark Greenshields in his book "Mastering Machine Code on your Commodore 64" we can do a down scroll using this routine:

LDA #$13
STA $FFD2
LDA #$11
STA $FFD2
LDA #$9D
STA $FFD2
LDA #$94
STA $FFD2
LDA #$80
STA $DA
RTS

This routine is like this in Basic:

10 PRINT "{HOME}{CRSR DOWN}{CRSR LEFT}{INST}"
20 POKE 218,128

I need to do a loop introducing, in the opportune moment some letters so that these go down according to the scroll. However I have problems to use a loop using the code machine but it works well using the Basic. Why does this happen? Can I make a down scroll down using this routine as I want?
 
... 4 posts hidden. Click here to view all posts....
 
2003-05-21 13:11
fermhg
Account closed

Registered: Oct 2002
Posts: 43
HERE YOU ARE AN EXAMPLE OF MY QUESTION:

My code is this but it doesn't work, then I tried it using basic and it works perfect.

*=$1000

JSR $E544
INICIO LDY #$00
SCROLL LDA TEXTO,Y
CMP #$00
BEQ INICIO
STA $0450
LDA #$13
JSR $FFD2
LDA #$11
JSR $FFD2
LDA #$9D
JSR $FFD2
LDA #$94
JSR $FFD2
LDA #$80
STA $DA
INY
BNE RETARDO
JMP INICIO
RETARDO LDA #$1E
STA $F9
LDX #$00
LDA #$FE
RASTER CMP $D012
BNE RASTER
DEC $F9
BNE RASTER
JMP SCROLL
TEXTO .BYTE $08,$05,$0C,$0C,$0F,$20
.BYTE $17,$0F,$12,$0C,$04,$20
.BYTE $20,$20,$20,$20,$00

In Basic:

0 PRINT CHR$(147)
5 FOR A=0 TO 15:READ F$
8 PRINT"{HOME}{CRSR DOWN X 2}";F$
10 PRINT"{HOME}{CRSR DOWN}{CRSR LEFT}{INST}"
20 POKE 218,128
23 FOR T=1 TO 100:NEXT T
25 NEXT A:RESTORE:GOTO 5
30 DATA H,E,L,L,O, ,W,O,R,L,D
40 DATA ,,,,,

What's the problem? Can I get a downscroll using Mark Greenshield's ML routine?

2003-05-21 19:42
Testicle
Account closed

Registered: Sep 2002
Posts: 131
why are you so fixated at mark greenshields routine? you should think about alternativ ways of realizing it in machine-language, it's quite easy.
2003-05-22 16:38
Richard

Registered: Dec 2001
Posts: 621
Then try making the scroll smoother using $D011

RicHARD/CiViTaS
2003-05-22 21:06
fermhg
Account closed

Registered: Oct 2002
Posts: 43
Ok Richard, but my question is this: why it work in basic but doesn't work in Code Machine? What's the problem? Only this. I know there is many ways to do a down scroll, and I know using $D011 but I need to know why this routine doesn't work using Code Machine and works using Basic.

Thank you very much.
2003-05-23 22:15
White Flame

Registered: Sep 2002
Posts: 136
I must agree that using that kernal scroll and relying on the line link tables is the slowest and problematic way I've seen a scroll done.

Your "FOR A=0 TO 15" loop doesn't exist in the asm version.

If the first LDA reads a zero, it'll inifinitely loop to "INICIO", since it'll just read the same zero over and over again.

Why are you using address $F9 at all?

Some hints about using branching better:

LDA texto,Y; CMP #$00; BEQ label -> LDA texto,Y; BEQ label

BNE retardo; JMP inicio; retardo -> BEQ inicio
2003-05-28 11:52
Unifier
Account closed

Registered: May 2003
Posts: 1
Testicle: You can put both loops together, and have the value #$20 stored permanently in the Y register. This will execute slightly faster.

// Ulf Harnhammar
2003-07-05 10:14
Richard

Registered: Dec 2001
Posts: 621
Yes, I'm back after a short rest from the CSDB forum. But now a question regarding this subject.

I have learned from TMR about map scrolling background using $D016, but now, say I have done a map which is quite big like SEUCK and I want to use $D011. How would I read the map?
2004-03-09 10:49
chancer

Registered: Apr 2003
Posts: 347
ah tmr. he's a good chap (well i would say that.hehehe) and are the rest of u coder lot. how about just moving the vertical hold on your monitor. same thing little effort ;-)
2004-03-09 18:59
T.M.R
Account closed

Registered: Dec 2001
Posts: 749
Me...? Nah, must be confusing me with someone else. =-)
2004-03-09 19:08
TDJ

Registered: Dec 2001
Posts: 1879
Down scroll, down!

Baaaaad scroll!
Previous - 1 | 2 - Next
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
goerp/F4CG/HF
lA-sTYLe/Quantum
ΛΛdZ
Francesco Sblendorio
crayon/Hokuto Force
radius75
algorithm
Lord Crucifier/SCS*TRC
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 The Demo Coder  (9.6)
6 Edge of Disgrace  (9.6)
7 What Is The Matrix 2  (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 Coders
1 Axis  (9.8)
2 Graham  (9.8)
3 Lft  (9.8)
4 Crossbow  (9.8)
5 HCL  (9.8)

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