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?
2003-05-18 17:20
fermhg
Account closed

Registered: Oct 2002
Posts: 43
Sorry, sorry
The code is this
LDA #$13
JSR $FFD2
LDA #$11
JSR $FFD2
LDA #$9D
JSR $FFD2
LDA #$94
JSR $FFD2
LDA #$80
STA $DA
RTS
2003-05-19 00:53
CyberBrain
Administrator

Posts: 392
I don't know much about the (fucked up) kernal, but is there a reason you want to use the kernal for making your downscroll?
2003-05-19 08:00
Testicle
Account closed

Registered: Sep 2002
Posts: 131
if you want to scroll the screen down in machine-language, i'd suggest this way. it's more bytes, but therefor more elegant. ;-)


;copy lines

ldx #39
.loop
lda $0798,x
sta $07c0,x
lda $0770,x
sta $0798,x
lda $0748,x
sta $0770,x
...
lda $0400,x
sta $0428,x
dex
bpl .loop

;clear first line

ldx #39
lda #$20
.loop2
sta $0400,x
dex
bpl .loop2



but for upscrolling the screen you can use the kernel. jsr $e8ea scrolls the screen up by 1 line.


i didn't get, what you meant with your problems according to use a loop. but probably this problem won't happen, when using the code above?!?

good luck.

regards,
daniel.
2003-05-19 12:38
fermhg
Account closed

Registered: Oct 2002
Posts: 43
Thank you,
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: 619
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: 619
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: 343
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!
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
Juzdie/Artline Designs
fieserWolF/Abyss-Con..
www.gb64.com
Krill/Plush
Docster/Megastyle
t0m3000/ibex-crew
Slator/Arsenic/Stone..
Holy Moses/Role
Apollyon/ALD
psych
syntaxerror
Guests online: 138
Top Demos
1 Next Level  (9.8)
2 Mojo  (9.7)
3 Coma Light 13  (9.7)
4 Edge of Disgrace  (9.6)
5 Comaland 100%  (9.6)
6 No Bounds  (9.6)
7 Uncensored  (9.6)
8 Wonderland XIV  (9.6)
9 Memento Mori  (9.6)
10 Bromance  (9.5)
Top onefile Demos
1 It's More Fun to Com..  (9.7)
2 Party Elk 2  (9.7)
3 Cubic Dream  (9.6)
4 Copper Booze  (9.5)
5 TRSAC, Gabber & Pebe..  (9.5)
6 Rainbow Connection  (9.5)
7 Wafer Demo  (9.5)
8 Dawnfall V1.1  (9.5)
9 Quadrants  (9.5)
10 Daah, Those Acid Pil..  (9.5)
Top Groups
1 Nostalgia  (9.3)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 Crest  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 S!R  (9.7)
5 Faayd  (9.7)

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