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 > why not 39 column mode ?
2006-10-30 11:24
Oswald

Registered: Apr 2002
Posts: 5031
why not 39 column mode ?

if hiding 1 row is enough for doing vertical scrolling why do we have 38 column mode for horizontal scrollin, why not 39 ?

(and besides anyone can give me a simple random generator ? register readouts doesnt count)
2006-10-30 11:30
algorithm

Registered: May 2002
Posts: 702
Probably how the hardware was designed. Any way on having 39 rows? closing the top border and opening the bottom etc etc has been done etc
2006-10-30 11:56
JackAsser

Registered: Jun 2002
Posts: 1995
Quote: if hiding 1 row is enough for doing vertical scrolling why do we have 38 column mode for horizontal scrollin, why not 39 ?

(and besides anyone can give me a simple random generator ? register readouts doesnt count)


39 column mode: I've asked myself the very same question... :D

Random numbers:
getrnd:
        lda seed
        beq doEor
        asl
        beq noEor ;if the input was $80, skip the EOR
        bcc noEor
doEor:  eor #$1d
noEor:  sta seed
        rts

;0<=x<=15 (initial seed value)
initrnd:
        ldx seedv,x
        sta seed
        rts

;Seed values you may use.
seedv:
    .byte $1d,$2b,$2d,$4d,$5f,$63,$65,$69
    .byte $71,$87,$8d,$a9,$c3,$cf,$e7,$f5

seed:
    .byte $00


Based on the 16 different values of the seed this will give you a series of 256 numbers where each number is picked only once, then it repeats.

2006-10-30 12:30
Oswald

Registered: Apr 2002
Posts: 5031
jack, wow awe routine! thx a lot ! :)
2006-10-30 12:37
JackAsser

Registered: Jun 2002
Posts: 1995
@ozzie: Don't thank me, it was someone with a big mathematical beard who figured it out. There was some site about it, however I've forgotten the URL. On that site was the full explanation + details how to extend to 16 bits, 32 bits etc..
2006-10-30 12:42
Oswald

Registered: Apr 2002
Posts: 5031
jack, guess the routine goes through 256 possibilities then start over ?
2006-10-30 12:50
JackAsser

Registered: Jun 2002
Posts: 1995
Yes, exactly.
2006-10-30 12:56
Devia

Registered: Oct 2004
Posts: 401
So in essence you're just using 39 bytes to represent a fixed set of 256 values?
2006-10-30 12:58
JackAsser

Registered: Jun 2002
Posts: 1995
@devia: uhm, yes. But in even fewer bytes:

ldx #$00
txa
inx
bne *-1


Got my point? :D

Anyways, iopop just reminded me that it was WhiteFlame who explained this method.
2006-10-30 13:03
MRT
Account closed

Registered: Sep 2005
Posts: 149
about 39 column mode... ;-)

I guess you can't have 39 column mode, because of the length of a clockcycle...

One cc takes as long as the width of one character. To enable 39 column mode (to draw the borders in place) you would have the VIC interrupt inside of one cc (half cc timing) to turn on and off the border...

I guess that wouldn't go well with the timing of the 6510.
:)

Or am I just stoned again? :-D
2006-10-30 13:32
Devia

Registered: Oct 2004
Posts: 401
@JackAsser: Which was exactly my point. How do you apply this routine in real-world applications where you need a series of 8bit random numbers that is longer than 256 and where you do not wish to repeat the series? By randomizing the seed or what?
 
... 40 posts hidden. Click here to view all posts....
 
Previous - 1 | 2 | 3 | 4 | 5 - Next
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
Sentinel/Excess/TREX
Six/G★P
iceout/Avatar/HF
sailor/Triad
Hok/Remember
Guests online: 133
Top Demos
1 Next Level  (9.7)
2 13:37  (9.7)
3 Mojo  (9.7)
4 Coma Light 13  (9.7)
5 Edge of Disgrace  (9.7)
6 Aliens in Wonderland  (9.6)
7 Comaland 100%  (9.6)
8 No Bounds  (9.6)
9 Uncensored  (9.6)
10 Wonderland XIV  (9.6)
Top onefile Demos
1 Layers  (9.6)
2 Cubic Dream  (9.6)
3 Party Elk 2  (9.6)
4 Copper Booze  (9.6)
5 HNY2023  (9.6)
6 Rainbow Connection  (9.5)
7 It's More Fun to Com..  (9.5)
8 Dawnfall V1.1  (9.5)
9 Daah, Those Acid Pil..  (9.5)
10 Birth of a Flower  (9.5)
Top Groups
1 Nostalgia  (9.4)
2 Oxyron  (9.3)
3 Booze Design  (9.3)
4 Censor Design  (9.3)
5 SHAPE  (9.3)
Top Crackers
1 Mr. Z  (9.9)
2 Antitrack  (9.8)
3 OTD  (9.8)
4 S!R  (9.7)
5 Fungus  (9.7)

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