| |
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.... |
| |
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?
|
| |
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.
|
| |
Richard
Registered: Dec 2001 Posts: 621 |
Then try making the scroll smoother using $D011
RicHARD/CiViTaS
|
| |
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. |
| |
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
|
| |
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
|
| |
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? |
| |
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 ;-) |
| |
T.M.R Account closed
Registered: Dec 2001 Posts: 749 |
Me...? Nah, must be confusing me with someone else. =-) |
| |
TDJ
Registered: Dec 2001 Posts: 1879 |
Down scroll, down!
Baaaaad scroll! |
Previous - 1 | 2 - Next |