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 > trying to understand this scroll routine
2008-06-27 19:26
Dr.j

Registered: Feb 2003
Posts: 277
trying to understand this scroll routine

hey there..lately i am studying from this website

The New Dimension
and i saw this scroll routine
there.. need some clear up.
.pc = $0801 "Basic Upstart"
:BasicUpstart($0810) // 10 sys$0810
.pc =$0810 "Program"


				//;clean screen
				ldx #$00
				stx $d020
				stx $d021
				lda #$20
!loop:
				sta $0400,x
				sta $0500,x
				sta $0600,x
				sta $0700,x
				inx
				bne !loop- 
				//;put charset
				lda #$1a
				sta $d018
main:
				sei
                lda #<irq 
                ldx #>irq 
                sta $0314 
                stx $0315 
                lda #$00 
                sta $d012 
                lda #$7f 
                sta $dc0d
                sta $dd0d
                lda #$01 
                sta $d01a 
                lda #$1b   //;as there are more than 256 rasterlines, the topmost bit of $d011 serves as
				sta $d011 
            	cli	    
			
				jmp *                

irq:			
			
			
				asl $d019
				
				
				jsr scroll
											
				jmp $ea31    
				rti     
				




scroll:
			lda smooth
			sec
			sbc #$02
			and #$07
			sta smooth
			bcs endscr
			ldx #$00
wrap:
			lda $0799,x
			sta $0798,x
			inx
			cpx #$28
			bne wrap
			
read:			lda $07b0 //;0798+$27
			
			
			cmp #$00
			bne setpt
			   
			lda #<msg  //;if got here 0
			sta read+1
			
			lda #>msg
			sta read+2
			
			jmp read
setpt:
			sta $07bf
			inc read+1
			lda read+1
			
			cmp #$00
			bne endscr
			inc read+2
endscr:
			rts						
									



.pc = $3c00 "text"
msg:
	.text "   simply scroll text!!!          alex is here    "
	.text "dsdfksldjsdfds                              @"
i try to figure out how lda $07b0 get our message
text memory? don't have any clue..and what does it mean
to do
 lda #>msg
sta read+2
can we do such a thing?? need comments to the
read label. thanks
2008-06-27 19:35
Danzig

Registered: Jun 2002
Posts: 440
hello dr.j

in true short honestly words: that routine is bullshit :D

first: $0798+$27 is not $07b0 :D
second: that lda $07b0 should be initalized
in the setuproutine to point to msg ($3c00 in this example).
third: its semioptimized even for a 1x1 scrollroutine.

so you better get your ass to that dozens of times mentioned c64-coding-wiki (dozens of times and i still can't remember the url ;) ) and get your hands OFF any explanations done by tnd-members. it's just halfwise informations... sorry, richard.
2008-06-27 21:01
Dr.j

Registered: Feb 2003
Posts: 277
hey Danzig
i thought like you but this scroll really works
and that $07b0 not initalized nowhere..really weird to me.
i know how to write scrolls (also 2*2 charsets) but this
code was weird how is works?
2008-06-27 21:22
Conrad

Registered: Nov 2006
Posts: 849
For the $07b0 question, it seems to just increase on its own (via the code under "setpt:" label) until it eventually reaches $0800, where usually on a reset computer, the value at $0800 equals to #$00, hence reset the "read:" address to the right location of the scroll-text.

As $0800-$07b0 = $50 chars, you probably won't notice too much delay of when the scroller restarts.

Anyway, stick to what Danzig said. ;)
2008-06-27 21:26
Burglar

Registered: Dec 2004
Posts: 1101
really, if you want to learn coding, dont use the tnd tutorials. they are written by ppl who still need to learn *a lot* themselves.

for example, no coder would ever do:

lda bla
cmp #$00
bne whatever

you do:

lda bla
bne whatever

also the 07b0/07bf stuff is weird, but danzig already mentioned that.

check out www.codebase64.org for better examples.
edit: argh, just checked codebase, has the bayliss example... sorry... seems you made most errors yourself btw ;)
2008-06-27 21:36
Conrad

Registered: Nov 2006
Posts: 849
Quote:
edit: argh, just checked codebase, has the bayliss example... sorry... seems you made most errors yourself btw ;)

There's no escape!! HEELP!
2008-06-27 21:59
Danzig

Registered: Jun 2002
Posts: 440
Quote:
edit: argh, just checked codebase, has the bayliss example... sorry...


maybe that is why i can't remember that codebase-url *LOL*
2008-06-28 04:42
The Phantom

Registered: Jan 2004
Posts: 360
You know..

This code looks really familiar to me.. Not sure why, but it does.

Your best bet is to stop looking at it and stop going to that website to learn stuff. No offense to whomever wrote the code, of coz!

Read Coders World :D
Or any of the other fine coding related magazines from that time period.

The best "bet" would be C=hacking.. Amazing magazine on how to code, very detailed and in depth. Coders world wasn't bad either, hehe..
2008-06-28 08:08
Dr.j

Registered: Feb 2003
Posts: 277
ok guyz..got you.
Danzig i guess you ment this good website
c64 code base
and i going to read C=hacking in the near future.
thanks 2 all of you..

2008-06-28 14:10
Martin Piper

Registered: Nov 2007
Posts: 722
Quote: really, if you want to learn coding, dont use the tnd tutorials. they are written by ppl who still need to learn *a lot* themselves.

for example, no coder would ever do:

lda bla
cmp #$00
bne whatever

you do:

lda bla
bne whatever

also the 07b0/07bf stuff is weird, but danzig already mentioned that.

check out www.codebase64.org for better examples.
edit: argh, just checked codebase, has the bayliss example... sorry... seems you made most errors yourself btw ;)


I found one of my old old notebooks (1985) recently and it has hand written asm with the hex numbers for each opcode looked up from a book with branch offsets worked out by hand and still that code is better than the TND tutorials. :)
2008-06-28 19:39
Frantic

Registered: Mar 2003
Posts: 1648
In case people find code on Codebase which is clearly faulty. Please let me know. Even though I am the maintainer of the codebase site, my time is limited, so help from other's in this regard is highly welcome.

http://codebase64.org
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
Holy Moses/Role
𝘁𝗡𝗚/FairLight
rexbeng
tlr
Mike
MCM/ONSLAUGHT
iAN CooG/HVSC
Dr.Science/Atlantis
LKP/CFN
Guests online: 107
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 Dawnfall V1.1  (9.5)
7 Rainbow Connection  (9.5)
8 Onscreen 5k  (9.5)
9 Morph  (9.5)
10 Libertongo  (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 Graphicians
1 Mirage  (9.8)
2 Archmage  (9.7)
3 Pal  (9.6)
4 Carrion  (9.6)
5 Sulevi  (9.6)

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