| |
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 |
|
| |
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. |
| |
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?
|
| |
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. ;) |
| |
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 ;) |
| |
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! |
| |
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* |
| |
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.. |
| |
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..
|
| |
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. :)
|
| |
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 |