| |
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) |
|
| |
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 |
| |
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.
|
| |
Oswald
Registered: Apr 2002 Posts: 5031 |
jack, wow awe routine! thx a lot ! :) |
| |
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.. |
| |
Oswald
Registered: Apr 2002 Posts: 5031 |
jack, guess the routine goes through 256 possibilities then start over ? |
| |
JackAsser
Registered: Jun 2002 Posts: 1995 |
Yes, exactly. |
| |
Devia
Registered: Oct 2004 Posts: 401 |
So in essence you're just using 39 bytes to represent a fixed set of 256 values? |
| |
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.
|
| |
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 |
| |
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 |