Basic Raster

Basic and Machine Language

Moderator: Moderators

Legacy
Vic 20 Enthusiast
Posts: 154
Joined: Wed Dec 31, 2008 4:01 pm

Basic Raster

Post 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!
The only way to program better is to find a better programmer. - Legacy 2009
Leeeeee
soldering master
Posts: 396
Joined: Fri Apr 23, 2004 8:14 am

Post 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
DELETED

Post by DELETED »

DELETED
User avatar
amramsey
Vic 20 Hobbyist
Posts: 117
Joined: Sat Apr 14, 2007 9:38 pm

Post 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
Legacy
Vic 20 Enthusiast
Posts: 154
Joined: Wed Dec 31, 2008 4:01 pm

Post by Legacy »

How do I load a .P00 file into Vice?
The only way to program better is to find a better programmer. - Legacy 2009
User avatar
amramsey
Vic 20 Hobbyist
Posts: 117
Joined: Sat Apr 14, 2007 9:38 pm

Post 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.
tlr
Vic 20 Nerd
Posts: 567
Joined: Mon Oct 04, 2004 10:53 am

Post by tlr »

In Vice:
1. Go to Settings/Peripheral Settings/Drive 8(tab)
2. Untick the Write P00 files box.
tlr
Vic 20 Nerd
Posts: 567
Joined: Mon Oct 04, 2004 10:53 am

Post by tlr »

Legacy wrote:How do I load a .P00 file into Vice?
Open it using File/Autostart disk/tape image...
Legacy
Vic 20 Enthusiast
Posts: 154
Joined: Wed Dec 31, 2008 4:01 pm

Post by Legacy »

That's not workin TLR
The only way to program better is to find a better programmer. - Legacy 2009
User avatar
amramsey
Vic 20 Hobbyist
Posts: 117
Joined: Sat Apr 14, 2007 9:38 pm

Post 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?
Legacy
Vic 20 Enthusiast
Posts: 154
Joined: Wed Dec 31, 2008 4:01 pm

Post 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.

The only way to program better is to find a better programmer. - Legacy 2009
User avatar
amramsey
Vic 20 Hobbyist
Posts: 117
Joined: Sat Apr 14, 2007 9:38 pm

Post 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.
Legacy
Vic 20 Enthusiast
Posts: 154
Joined: Wed Dec 31, 2008 4:01 pm

Post 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
The only way to program better is to find a better programmer. - Legacy 2009
nippur72
de Lagash
Posts: 574
Joined: Thu Sep 07, 2006 8:35 am

Post by nippur72 »

exactly what's the reason for:

Code: Select all

27 WAITW,V
isn't enough the WAIT in line 28?
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post 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.
Anders Carlsson

Image Image Image Image Image
Post Reply