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: 276
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: 429
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: 276
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: 833
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: 1031
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: 833
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: 429
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: 276
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: 634
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: 1627
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
Slaxx/Q/HF/MYD!
csabanw
E$G/hOKUtO fOrcE
St0rmfr0nt/Quantum
4gentE/ΤRIΛD
syntaxerror
bugjam
Steveboy
jmin
Guests online: 136
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 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.055 sec.