Page 1 of 2

Basic Raster

Posted: Fri Mar 27, 2009 3:00 am
by Legacy
Who says you cant write raster routine in Basic ?

Works with VICE 2.1 PAL unexpanded :D

Code: Select all

10 a=240:y=4:x=6
20 poke36865,a
25 fort=1to200
30 poke36879,y
40 poke36879,a
50 poke36879,x
60 poke36879,y
70 poke36879,a
80 poke36879,x
81 nextt
100 poke36879,27:poke36865,38
run
works also if you omit lines 60,70,80

Ok so it's not a real raster routine, but it looks like one!

Posted: Fri Mar 27, 2009 7:52 am
by Leeeeee
This makes it a proper raster routine..

Code: Select all

10 A=240:Y=4:X=6
15 P=36879
16 W=36868
17 V=128
18 U=32
20 POKE36865,A
25 FORT=1TO200
27 WAITW,V
28 WAITW,U
30 POKEP,Y
40 POKEP,A
50 POKEP,X
60 POKEP,Y
70 POKEP,A
80 POKEP,X
90 NEXT
100 POKEP,27
110 POKE36865,38
Lee

Posted: Fri Mar 27, 2009 9:22 am
by DELETED
DELETED

Posted: Fri Mar 27, 2009 11:53 am
by amramsey
MRaider wrote:Sadly upper-case, and I can't be bothered to type it in manually. :D

Code: Select all

10 a=240:y=4:x=6
15 p=36879
16 w=36868
17 v=128
18 u=32
20 poke36865,a
25 fort=1to200
27 waitw,v
28 waitw,u
30 pokep,y
40 pokep,a
50 pokep,x
60 pokep,y
70 pokep,a
80 pokep,x
90 next
100 pokep,27
110 poke36865,38
And also for Vice:

http://www.aaronramsey.com/commodore/misc/RASTRPRG.P00
:D

Posted: Fri Mar 27, 2009 8:47 pm
by Legacy
How do I load a .P00 file into Vice?

Posted: Sat Mar 28, 2009 4:43 am
by amramsey
Well, I'm no VICE expert... what I did was have device 8 pointed to a directory on my PC (in the peripheral settings for drive 8). When I do something like a load"$",8, it shows the programs that I have on my PC in that directory. I pasted that program in and saved it 'save "raster.prg",8' and it stuck that RASTRPRG.P00 on my hard drive.

So you can either point drive 8 at a directory on your PC and use it that way, or you can can use 'Smart Attach Disk/Tape" and just point it at that file. It will automatigally load the .prg and wait for you to type run.

I have no idea why it made a .P00 file instead of a .prg file on my drive.

Posted: Sat Mar 28, 2009 4:51 am
by tlr
In Vice:
1. Go to Settings/Peripheral Settings/Drive 8(tab)
2. Untick the Write P00 files box.

Posted: Sat Mar 28, 2009 4:53 am
by tlr
Legacy wrote:How do I load a .P00 file into Vice?
Open it using File/Autostart disk/tape image...

Posted: Sun Mar 29, 2009 5:09 am
by Legacy
That's not workin TLR

Posted: Sun Mar 29, 2009 5:48 am
by amramsey
Thanks tlr.... P00 files are disabled on my machine now.

Legacy, try this .d64 image instead: http://www.aaronramsey.com/commodore/misc/raster.d64. Not sure why the autostart isn't working for you. Are you using the latest version of VICE?

Posted: Sun Mar 29, 2009 6:25 am
by Legacy
no go on that one

Code: Select all

**** cbm basic v2 ****

3583 bytes free

ready.
load"raster.prg",8,1:

searching for raster.p
rg
loading
ready.
run

ready.


Posted: Sun Mar 29, 2009 7:09 am
by amramsey
Legacy wrote:no go on that one
Ah... maybe I see the problem. I've got my VICE vic-20 set to max memory. I wonder if the ,8,1 is screwing up the basic load?

Try loading it with just load"raster",8 and see if that works.

Posted: Sun Mar 29, 2009 1:41 pm
by Legacy
LOAD"RASTER",8

That worked, I don't know much about the 8,1 options I know 8 is device disk drive like a 1541 5 1/4" floppy drive, not sure about the 1 parameter, I just assumed it was always supposed to be there.
I really should invest in a uIEC drive and run everything from the real deal but Im not working now so money is tight. Luckily I got IBM thinkcenter on newegg for $100 complete system!
Thanks for the help I was starting to wonder if my vice had a bad processor :D

Posted: Mon Mar 30, 2009 4:46 am
by nippur72
exactly what's the reason for:

Code: Select all

27 WAITW,V
isn't enough the WAIT in line 28?

Posted: Mon Mar 30, 2009 5:21 am
by carlsson
The first WAIT synchronizes the raster line, the second waits for a particular line to make the effect happen.

NTSC = 261 lines, PAL = 312 lines.

Unless I'm totally confused, it means $9004 will become 0..4 twice per frame in NTSC, 0..55 in PAL. Waiting for raster line 128 then 32 means in NTSC the effect will end up on line 32, on PAL on line 288. Somebody please correct me if I'm getting this wrong.