The Great Program Collage

Basic and Machine Language

Moderator: Moderators

English Invader
Vic 20 Scientist
Posts: 1193
Joined: Tue Apr 28, 2009 3:51 pm

Post by English Invader »

I could use a summary.
User avatar
Jeff-20
Denial Founder
Posts: 5759
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

Code: Select all

0 dim a(32), b(12), c, d, a$: s=36878: poke s,15: x=7680: q=8: rem denial collage 2009 
5 data169,127,141,34,145,173,32,145,10,173,17,145,73,255,41,60,176,2,105,2,74,133,254,96 
10 poke36879,8:print"{clr home}":forc=200to250:poke36875,c:poke36875,400-c: next:poke36875,0 
15 fort=1to1000:printmid$("{blk,wht,red,cyn,pur,grn,blu,yel}",int(rnd(1)*8)+1,1)"{shift-u,shift-q,shift-i,shift-j,shift-q,shift-k}";:next 
20 for t=0to23: read v: poke7168+t,v: next: sys 7168: gosub 40: if e=3 then10
22 d=c+sgn(eand1)-sgn(eand2)*22+sgn(eand4)*22-sgn(eand8):if d>=0 and d<506 then c=d 
27 pokes-2,200:pokes-2,0:ifpeek(x+c)<>81thenpokex+c,36:onint(rnd(1)*3)gosub100,200
40 ifq=8thenpoke37154,255:e=peek(254):q=0:return
200 d=c-int(c/22)*22:fori=0to22:pokex+d+i*22,160:next

30 print"{home}{red}waffles:{white}"w;tab(10)"{red}cowboys:{white}"cb: r=(r+1)and7

[insert your line here]
I just couldn't figure out what to do after user input had been established. :lol:
High Scores, Links, and Jeff's Basic Games page.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Code: Select all

0 dim a(32), b(12), c, d, a$: s=36878: poke s,15: x=7680: q=8: rem denial collage 2009 
5 data169,127,141,34,145,173,32,145,10,173,17,145,73,255,41,60,176,2,105,2,74,133,254,96 
10 poke36879,8:print"{clr home}":forc=200to250:poke36875,c:poke36875,400-c: next:poke36875,0 
15 fort=1to1000:printmid$("{blk,wht,red,cyn,pur,grn,blu,yel}",int(rnd(1)*8)+1,1)"{shift-u,shift-q,shift-i,shift-j,shift-q,shift-k}";:next 
20 for t=0to23: read v: poke7168+t,v: next: sys 7168: gosub 40: if e=3 then10
22 d=c+sgn(eand1)-sgn(eand2)*22+sgn(eand4)*22-sgn(eand8):if d>=0 and d<506 then c=d 
27 pokes-2,200:pokes-2,0:ifpeek(x+c)<>81thenpokex+c,36:onint(rnd(1)*3)gosub100,200
30 print"{home}{red}waffles:{white}"w;tab(10)"{red}cowboys:{white}"cb: r=(r+1)and7
40 ifq=8thenpoke37154,255:e=peek(254):q=0:return
200 d=c-int(c/22)*22:fori=0to22:pokex+d+i*22,160:next

205 a(d)=1:if a(d+1)=1 or a(d-1)=1 then 225
[insert your line here]
Anders Carlsson

Image Image Image Image Image
User avatar
Mike
Herr VC
Posts: 4841
Joined: Wed Dec 01, 2004 1:57 pm
Location: Munich, Germany
Occupation: electrical engineer

Post by Mike »

Code: Select all

0 dim a(32), b(12), c, d, a$: s=36878: poke s,15: x=7680: q=8: rem denial collage 2009 
5 data169,127,141,34,145,173,32,145,10,173,17,145,73,255,41,60,176,2,105,2,74,133,254,96 
10 poke36879,8:print"{clr home}":forc=200to250:poke36875,c:poke36875,400-c: next:poke36875,0 
15 fort=1to1000:printmid$("{blk,wht,red,cyn,pur,grn,blu,yel}",int(rnd(1)*8)+1,1)"{shift-u,shift-q,shift-i,shift-j,shift-q,shift-k}";:next 
20 for t=0to23: read v: poke7168+t,v: next: sys 7168: gosub 40: if e=3 then10
22 d=c+sgn(eand1)-sgn(eand2)*22+sgn(eand4)*22-sgn(eand8):if d>=0 and d<506 then c=d 
27 pokes-2,200:pokes-2,0:ifpeek(x+c)<>81thenpokex+c,36:onint(rnd(1)*3)gosub100,200
30 print"{home}{red}waffles:{white}"w;tab(10)"{red}cowboys:{white}"cb: r=(r+1)and7
40 ifq=8thenpoke37154,255:e=peek(254):q=0:return
200 d=c-int(c/22)*22:fori=0to22:pokex+d+i*22,160:next
205 a(d)=1:if a(d+1)=1 or a(d-1)=1 then 225

204 ifd=0then206
[insert your line here]
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Ok, a brief summary what seems to be happening:

First a sound effect, then 1000 birds are drawn on the screen. The nifty little machine code routine reads the joystick and stores a value in address 254:

0 = no move
1 = right
2 = up
4 = down
8 = left
16 = fire

I suppose one just as well could've read the joystick from Basic but since Jeff-20 set up a promise for a ML routine it seemed somehow appropriate.

Since Q at the moment is 8 when we get to line 40, the joystick will be read, Q reset and back to the main program. If the joystick at that moment is pulled up-right (NE position), the program will more or less restart. The 1000 birds get redrawn, with the exception that on line 40 the Q=8 check no longer is true so only God knows what will happen then.

If the joystick was moved in another direction or not at all, the variable C which is a left-over from the sound effect, is used as player index on screen. If the player has moved to a square that is not populated with a ball (bird head), a dollar sign is placed on screen to indicate the player's position. Then randomly it will jump to line 100, 200 or not at all.

The routine at 200 paints a line across the screen at the column where the player is. Unless the player is in the leftmost column, a flag is set in the array A().

Of course a lot of this may change in the next few lines, depending on who adds what and where. How all of this is supposed to wrap up and work is a different question.

Good luck with your additions!
Anders Carlsson

Image Image Image Image Image
User avatar
Jeff-20
Denial Founder
Posts: 5759
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

You forgot to mention waffles and cowboys!
High Scores, Links, and Jeff's Basic Games page.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

I thought those would be a surprise for the reader. :-D

Now I'm only trying to think of a way how to make waffles out of seagulls. Or perhaps the birds are the ones which later on will evolve into cowboys. The sky is the limit!
Anders Carlsson

Image Image Image Image Image
User avatar
nbla000
Salmon Run
Posts: 2582
Joined: Thu Oct 13, 2005 8:58 am
Location: Italy

Post by nbla000 »

nice idea Jeff-20 :D
Mega-Cart: the cartridge you plug in once and for all.
carlsson
Class of '6502
Posts: 5516
Joined: Wed Mar 10, 2004 1:41 am

Post by carlsson »

Did this program stop growing?

Actually I have a different idea. Instead of making a mish-mash of spaghetti code, if Jeff allows we could group together to create Game Theory III, or if it is IV. A bunch of small games in the same style as the first two but where input from more people may result in even greater variety of minigames.
Anders Carlsson

Image Image Image Image Image
User avatar
Pedro Lambrini
Vic 20 Scientist
Posts: 1132
Joined: Mon Dec 01, 2008 11:36 am

Post by Pedro Lambrini »

carlsson wrote:Did this program stop growing?

Actually I have a different idea. Instead of making a mish-mash of spaghetti code, if Jeff allows we could group together to create Game Theory III, or if it is IV. A bunch of small games in the same style as the first two but where input from more people may result in even greater variety of minigames.
That is genius. You could call the collection A Theory In Denial! :)
"...That of the Eastern tribe being like a multitude of colours as if a rainbow had settled upon its brow..." Daniels 1:3
User avatar
Jeff-20
Denial Founder
Posts: 5759
Joined: Wed Dec 31, 1969 6:00 pm

Post by Jeff-20 »

carlsson wrote:Did this program stop growing?

Actually I have a different idea. Instead of making a mish-mash of spaghetti code, if Jeff allows we could group together to create Game Theory III, or if it is IV. A bunch of small games in the same style as the first two but where input from more people may result in even greater variety of minigames.
Yes! That may be what I had hoped would happen naturally. I like your idea! Figuring out the shared routines first would be best. Then we have to keep an active list of variables... etc. etc.
High Scores, Links, and Jeff's Basic Games page.
Post Reply