Jump to content
IGNORED

Devastator


Willsy

Recommended Posts

Those old guys certainly knew how to squeeze XB... I wonder if the Buck Rogers style of land movement could be done in XB by rotating the color sets?

 


10 CALL CLEAR :: CALL SCREEN(4):: PRINT "         DEVASTATOR" :: PRINT :: PRINT
20 PRINT "     by David R. Arnold" :: PRINT :: PRINT "   translated for the TI         by Patrick Parrish"
30 PRINT :: PRINT " adapted and programmed for     the Win994a Simulator       by Guy Matthew Babin"
40 PRINT :: PRINT
45 PRINT "    requires a joystick." :: PRINT
60 PRINT "       please select          'Map Keyboard/Joystick'"
70 PRINT "   under FILE-PREFERENCES."
75 PRINT
77 PRINT "      use NUMERIC KEYPAD           to use JOYSTICK."
80 PRINT
89 INPUT "PRESS <ENTER> TO CONTINUE..":GUY$
90 REM TI EXTENDED BASIC
99 REM DEVASTATOR
100 GOTO 150
110 FOR F=12 TO 14 :: CALL COLOR(F,2,1):: NEXT F :: RETURN
120 FOR F=10 TO 16 :: CALL SCREEN(F):: NEXT F :: CALL SCREEN(2):: RETURN
130 FOR V=1 TO 30 :: CALL SOUND(D1,F1,V,F2,V):: NEXT V :: RETURN
140 FOR ROW=2 TO 7 :: CALL HCHAR(ROW,22,32,7):: NEXT ROW :: RETURN
150 RANDOMIZE
160 DIM E$(13)
170 CALL CLEAR :: CALL SCREEN(2)
180 GOSUB 530
190 GOSUB 1030 :: CALL CLEAR :: CALL SCREEN(2)
200 FOR H=2 TO 14 :: CALL COLOR(H,2,2):: NEXT H
210 FOR J=1 TO 4 :: FOR I=1 TO 11 :: CALL HCHAR(I,INT(RND*28)+3,46):: NEXT I :: NEXT J
220 DISPLAY AT(13,1):"``````````a      b``````````"
230 DISPLAY AT(14,1):"hhhhhhhhhi`      `jhhhhhhhhh"
240 DISPLAY AT(15,1):"ppppppppqh`      `hrpppppppp"
250 DISPLAY AT(16,1):"pppppppqpha``````bhprppppppp"
260 DISPLAY AT(17,1):"``````appihhhhhhhhjppb``````"
270 DISPLAY AT(18,1):"`````a`pqpppppppppprp`b`````"
280 DISPLAY AT(19,1):"hhhhi``qppppppppppppr``jhhhh"
290 DISPLAY AT(20,1):"hhhih`a``````````````b`hjhhh"
300 DISPLAY AT(21,1):"hhihha````````````````bhhjhh"
310 DISPLAY AT(22,1):"pqhhihhhhhhhhhhhhhhhhhhjhhrp"
320 DISPLAY AT(23,1):"qphihhhhhhhhhhhhhhhhhhhhjhpr" :: DISPLAY AT(24,1):"ppihhhhhhhhhhhhhhhhhhhhhhjpp"
330 FOR J=1 TO 2 :: FOR I=12 TO 14 :: CALL HCHAR(I,INT(RND*6)+14,46):: NEXT I :: NEXT J
340 DISPLAY AT(2,24):CHR$(120)&CHR$(121):: DISPLAY AT(3,23):CHR$(122)&CHR$(136)&CHR$(137)&CHR$(123)
350 DISPLAY AT(4,22):CHR$(124)&CHR$(125)&CHR$(138)&CHR$(139)&CHR$(125)&CHR$(126)
360 DISPLAY AT(5,22):CHR$(127)&CHR$(125)&CHR$(140)&CHR$(141)&CHR$(125)&CHR$(128)
370 DISPLAY AT(6,23):CHR$(129)&CHR$(142)&CHR$(143)&CHR$(130)
380 DISPLAY AT(7,24):CHR$(131)&CHR$(132)
390 CALL COLOR(12,6,1):: CALL COLOR(13,6,1):: CALL COLOR(14,3,6)
400 FOR F=2 TO 8 :: CALL COLOR(F,16,1):: NEXT F
410 CALL SPRITE(#2,108,11,80,80)
420 CALL MAGNIFY(LEVEL):: SPEED=8 :: TOL=30 :: IF LEVEL=3 THEN TOL=15
430 CALL SPRITE(#1,100,16,100,110)
440 A=9 :: B=10 :: C=11
450 T=A :: A=B :: B=C :: C=T
460 CALL COLOR(A,2,5):: CALL COLOR(5,2,14):: CALL COLOR(C,2,7)
470 CALL MOTION(#2,INT(RND*40-20),INT(RND*40-20))
480 CALL JOYST(1,X1,Y1):: CALL MOTION(#1,-Y1*SPEED,X1*SPEED)
490 CALL COINC(#1,#2,TOL,G):: IF G THEN GOSUB 700
500 W=W+1 :: IF W>150 THEN 770
510 GOTO 450
520 REM DEFINE CHARS
530 A$="" :: B$="0102040810204080" :: C$="8040201008040201"
540 CALL CHAR(95,B$)
550 FOR I=96 TO 112 STEP 8 :: CALL CHAR(I,A$):: CALL CHAR(I+1,B$)
560 CALL CHAR(I+2,C$):: NEXT I
570 FOR I=0 TO 13 :: READ E$(I):: CALL CHAR(120+I,E$(I)):: NEXT I
580 FOR I=0 TO 7 :: READ E$(I):: CALL CHAR(I+136,E$(I)):: NEXT I
590 DATA 0000000000000F7F,000000000000F0FE,01030F1F3F7FFFFF
600 DATA 80C0F0F8FCFEFFFF,0001010103030303,FFFFFFFFFFFFFFFF
610 DATA 00808080C0C0C0C0,0303030301010100,C0C0C0C080808000
620 DATA FF7F3F3F1F0F0703,FFFEFCFCF8F0E0C0,7F0F000000000000
630 DATA FEF0000000000000,0800667C18666810
640 DATA E0F07F7F7FFFFFFF,0818F8F8F0F8F0F0,7F7F7F3D1C0E0201
650 DATA F0F0908800180000,03070F0F0F070703,F0FFFFFEFCFCF8F0
660 DATA 0303010101010101,E0C0C0C080808000
670 CALL CHAR(108,"00073FE2E2E2FFFF667F0C1C0000000000E0FC474747FFFF66FE303800000000")
680 CALL CHAR(100,"0000000003040808FF0808040300000080808080E0908888FF888890E0808080")
690 RETURN
700 REM ALIEN SHIP DESTROYED
710 CALL DELSPRITE(#2):: CALL MOTION(#1,0,0)
720 CALL SCREEN(15):: CALL SCREEN(10)
730 CALL SCREEN(2):: FOR DVOL=1 TO 24 STEP 4 :: CALL SOUND(100,-7,DVOL):: NEXT DVOL
740 CALL SCREEN(2)
750 D=D+1 :: CALL SPRITE(#2,108,11,INT(RND*192)+1,INT(RND*256)+1)
760 RETURN
770 IF D<20 THEN 810
775 FOR GUY=2 TO 8 :: CALL COLOR(GUY,11,1):: NEXT GUY
780 GOTO 950
790 FOR I=30 TO 1 STEP -2 :: CALL SOUND(-1000,-5,I):: NEXT I :: RETURN
800 REM EARTH DESTROYED
810 GOSUB 790 :: FOR I=8 TO 0 STEP -1 :: CALL HCHAR(7+I,25-I,95):: CALL COLOR(8,INT(RND*+9,1):: NEXT I
820 FOR J=1 TO 40 :: NEXT J
830 FOR I=8 TO 0 STEP -1 :: CALL HCHAR(7+I,25-I,32):: NEXT I
840 GOSUB 120 :: D1=-100 :: F1=-6 :: F2=110 :: GOSUB 130 :: GOSUB 120 :: GOSUB 110 :: GOSUB 140
850 J=0 :: I=0
860 DISPLAY AT(1,23+I):CHR$(133):: DISPLAY AT(1,26+J):CHR$(133)
870 DISPLAY AT(2,22+I):CHR$(133)&CHR$(133):: DISPLAY AT(2,26+J):CHR$(133)&CHR$(133)
880 DISPLAY AT(3,21+I):CHR$(133)&CHR$(133)&CHR$(133):: DISPLAY AT(4,25+J):CHR$(133)&CHR$(133)&CHR$(133)
890 DISPLAY AT(5,22+I):CHR$(133)&CHR$(133):: DISPLAY AT(5,25+J):CHR$(133)&CHR$(133)&CHR$(133):: GOSUB 120
900 DISPLAY AT(6,25+J):CHR$(133):: DISPLAY AT(7,23+I):CHR$(133):: DISPLAY AT(7,27+J):CHR$(133)
910 DISPLAY AT(8,22+I):CHR$(133)&CHR$(133):: DISPLAY AT(9+J,24):CHR$(133)&CHR$(133)
920 CALL COLOR(13,9,1):: GOSUB 120 :: D1=30 :: F1=-6 :: F2=110 :: GOSUB 130 :: IF J=1 THEN 940
930 I=-1 :: J=1 :: GOSUB 110 :: GOSUB 120 :: GOTO 860
940 FOR F=1 TO 100 :: NEXT F
945 FOR GUY=2 TO 8 :: CALL COLOR(GUY,7,1):: NEXT GUY
950 CALL DELSPRITE(ALL):: W=0
960 CALL CLEAR :: CALL SCREEN(2):: DISPLAY AT(8,1):"ALIEN SHIPS DESTROYED: ";D
970 IF D>HD THEN HD=D
980 DISPLAY AT(13,6):"BEST ROUND: ";HD
990 D=0 :: DISPLAY AT(17,1):"PLAY AGAIN, CAPTAIN (Y/N)?"
1000 CALL KEY(0,KEY,ST):: IF ST=0 THEN 1000
1010 IF (KEY=89)+(KEY=121)THEN CALL CLEAR :: GOTO 200
1015 IF (KEY=78)+(KEY=110)THEN 1020
1017 GOTO 1000
1020 DISPLAY AT(21,6):"SO LONG" :: FOR I=1 TO 500 :: NEXT I :: STOP
1030 FOR J=2 TO 8 :: CALL COLOR(J,1,1):: NEXT J
1040 PRINT "    D E V A S T A T O R" :: PRINT :: PRINT
1050 PRINT "YOUR MISSION IS TO PROTECT" :: PRINT "EARTH FROM THE APPROACHING"
1060 PRINT "DEVASTATOR. SHOOT DOWN AT" :: PRINT "LEAST 20 GUARDIAN SHIPS TO"
1070 PRINT "ENABLE YOUR COMRADES TO" :: PRINT "DESTROY THE DEVASTATOR."
1080 PRINT :: PRINT "YOU HAVE ONLY LIMITED TIME" :: PRINT "IN WHICH TO COMPLETE YOUR"
1090 PRINT "MISSION. POSITION YOUR" :: PRINT "CROSSHAIR WITH THE JOYSTICK."
1100 FOR J=2 TO 8 :: CALL COLOR(J,15,1):: NEXT J
1110 PRINT :: PRINT "ENTER YOUR SKILL LEVEL" :: PRINT
1113 PRINT " EASY (1)   OR   NORMAL (2)" :: PRINT :: PRINT "CAPTAIN?"
1115 ACCEPT AT(23,10)BEEP VALIDATE("12")SIZE(1):LEVEL$
1120 LEVEL=5-VAL(LEVEL$)
1130 GOSUB 790
1140 PRINT :: PRINT :: PRINT "THE DEVASTATOR IS APPROACH-"
1150 PRINT "ING. GRAB YOUR JOYSTICK," :: PRINT "AND PREPARE TO DO BATTLE."
1160 FOR I=1 TO 750 :: NEXT I
1170 RETURN

Link to comment
Share on other sites

I wonder if the Buck Rogers style of land movement could be done in XB by rotating the color sets?

It would be nice to try if the effect could be done by rotating colors. Another approach is manipulating the character patterns. Yet another is displaying strings like Stardust does.

 

http://www.youtube.com/watch?v=2vxq6av3Tms

 

Oh, Buck Rogers has speech !?

 

:)

Link to comment
Share on other sites

Here's the idea about manipulating character patterns. We'll take 4 characters stacked vertically and repeated horizontally. 4 characters can easily be loaded with a single command, so maybe it won't be too slow. Let's go for 4 frames. 4 commands then to do all the animation.

 

The horizontal lines are put in there using a very simple algorithm. I'll start out in the first frame with a line at position 2, add 1, go to next frame, add 2, go to next frame, add 3 and so on. I'll end up with horizontal stripes at 2, 3, 5, 8, 12, 17, 23 and 30.

 

100 CALL CLEAR::CALL SCREEN(2)::CALL COLOR(2,4,13)
110 FOR A=0 TO 3::CALL HCHAR(10+A,1,40+A,32)::NEXT A
120 CALL CHAR(40,"00FF000000000000000000FF0000000000000000000000000")
130 CALL CHAR(40,"0000FF00000000000000000000000000FF000000000000000")
140 CALL CHAR(40,"00000000FF0000000000000000000000000000000000FF000")
150 CALL CHAR(40,"00000000000000FF000000000000000000000000000000000000000000FF")
160 GOTO 120

:)

Edited by sometimes99er
Link to comment
Share on other sites

  • 3 weeks later...

Basically just double up. :)

 

100 CALL CLEAR::CALL SCREEN(2)::CALL COLOR(2,4,13)
110 FOR A=0 TO 7::CALL HCHAR(10+A,1,40+A,32)::NEXT A
120 CALL CHAR(40,"FF000000000000000000FF000000000000000000000000000")
121 CALL CHAR(44,"00000000FF000000000000000000000000000000000000000")
130 CALL CHAR(40,"00FF00000000000000000000000000FF00000000000000000")
131 CALL CHAR(44,"00000000000000000000000000FF000000000000000000000")
140 CALL CHAR(40,"000000FF0000000000000000000000000000000000FF00000")
141 CALL CHAR(44,"0000000000000000000000000000000000000000000000FF0")
150 CALL CHAR(40,"000000000000FF000000000000000000000000000000000000000000FF")
151 CALL CHAR(44,"0000000000000000000000000000000000000000000000000")
160 GOTO 120
RUN

Link to comment
Share on other sites

Much the same. Also try CPU Overdrive.

 

:)

 

100 CALL CLEAR::CALL SCREEN(2)::CALL COLOR(2,4,13)
110 FOR A=0 TO 7::CALL HCHAR(10+A,1,40+A,32)::NEXT A
120 CALL CHAR(40,"FF00000000FF000000000000000000FF000000000000000000000000FF000000")
121 CALL CHAR(44,"0000000000000000000000000000FF0000000000000000000")
130 CALL CHAR(40,"00FF0000000000FF00000000000000000000FF00000000000000000000000000")
131 CALL CHAR(44,"FF000000000000000000000000000000000000FF")
140 CALL CHAR(40,"0000FF000000000000FF0000000000000000000000FF")
141 CALL CHAR(44,"00000000FF00000000000000000000000000000000000000FF")
150 CALL CHAR(40,"000000FF0000000000000000FF0000000000000000000000FF")
151 CALL CHAR(44,"000000000000000000FF00000000000000000000000000000000000000FF")
160 GOTO 120
RUN

Edited by sometimes99er
Link to comment
Share on other sites

: TEST  1 GMODE  1 SCREEN  5 3 12 COLOR
7 0 DO  I 11 +  0  I 40 +  32 HCHAR LOOP
BEGIN  HEX
 DATA 10 FF00 0 00FF 0 0 0 0 00FF 0 0 0 0 0 0 FF00 0  28 DCHAR
 DATA D 0 0 0 0 0 0 0 FF00 0 0 0 0 0         2C DCHAR
 DATA 10 00FF 0 0 00FF 0 0 0 0 0 FF00 0 0 0 0 0 0  28 DCHAR
 DATA A FF00 0 0 0 0 0 0 0 0 00FF            2C DCHAR
 DATA B 0 FF00 0 0 00FF 0 0 0 0 0 00FF       28 DCHAR
 DATA D 0 0 FF00 0 0 0 0 0 0 0 0 0 FF00      2C DCHAR
 DATA D 0 00FF 0 0 0 0 FF00 0 0 0 0 0 FF00   28 DCHAR
 DATA F 0 0 0 0 00FF 0 0 0 0 0 0 0 0 0 00FF  2C DCHAR
 BREAK?
AGAIN ;
TEST

 

It's a bit quick. Still, plenty of cycles left for other processing I suppose!

Link to comment
Share on other sites

Nice, and yes, a bit quick. Can you demonstrate how to do a pattern update and then wait for the next frame update ?

 

I did start work on a (few) XB Assembler support routines. Hooking a fluid update of patterns on that user definable interrupt vector. Was thinking about adding a few other routines and maybe come up with a standard shooter - with probably the usual slogginess of XB. Well, gotta go move the lawn now.

 

:)

Link to comment
Share on other sites

This is how I do it ... :)

	limi	0		; no CPU interrupt
wait	movb	@>8802,r0	; get VDP status
andi	r0,>8000	; isolate end of frame bit
jeq	wait

 

Ah! Ok... Don't think I've seen that before! Here you go...

: WAIT BEGIN $8802 C@ $80 AND UNTIL ;
: TEST  1 GMODE  1 SCREEN  5 3 12 COLOR
7 0 DO  I 11 +  0  I 40 +  32 HCHAR LOOP
BEGIN  HEX
 DATA 10 FF00 0 00FF 0 0 0 0 00FF 0 0 0 0 0 0 FF00 0  28 DCHAR WAIT
 DATA D 0 0 0 0 0 0 0 FF00 0 0 0 0 0         2C DCHAR WAIT
 DATA 10 00FF 0 0 00FF 0 0 0 0 0 FF00 0 0 0 0 0 0  28 DCHAR WAIT
 DATA A FF00 0 0 0 0 0 0 0 0 00FF            2C DCHAR WAIT
 DATA B 0 FF00 0 0 00FF 0 0 0 0 0 00FF       28 DCHAR WAIT
 DATA D 0 0 FF00 0 0 0 0 0 0 0 0 0 FF00      2C DCHAR WAIT
 DATA D 0 00FF 0 0 0 0 FF00 0 0 0 0 0 FF00   28 DCHAR WAIT 
 DATA F 0 0 0 0 00FF 0 0 0 0 0 0 0 0 0 00FF  2C DCHAR WAIT
 BREAK?
AGAIN ;
TEST

:-D

Link to comment
Share on other sites

Hehe, looks so easy. Must say it would be essential, now we have the speed, for games to sync with the frame update. That's why I asked you way back about a VWAIT command. Think VWAIT was just that in Blitz Basic (or was it AMOS) or whatever it was called back on the Amiga.

 

Still this kind of animation is a bit too fast for the human eye. One or two extra skips of frames will probably make it look better.

 

;)

 

: WAIT 3 1 DO BEGIN $8802 C@ $80 AND UNTIL LOOP ;
: TEST  1 GMODE  1 SCREEN  5 3 12 COLOR
7 0 DO  I 11 +  0  I 40 +  32 HCHAR LOOP
BEGIN  HEX
 DATA 10 FF00 0 00FF 0 0 0 0 00FF 0 0 0 0 0 0 FF00 0  28 DCHAR WAIT
 DATA D 0 0 0 0 0 0 0 FF00 0 0 0 0 0         2C DCHAR WAIT
 DATA 10 00FF 0 0 00FF 0 0 0 0 0 FF00 0 0 0 0 0 0  28 DCHAR WAIT
 DATA A FF00 0 0 0 0 0 0 0 0 00FF            2C DCHAR WAIT
 DATA B 0 FF00 0 0 00FF 0 0 0 0 0 00FF       28 DCHAR WAIT
 DATA D 0 0 FF00 0 0 0 0 0 0 0 0 0 FF00      2C DCHAR WAIT
 DATA D 0 00FF 0 0 0 0 FF00 0 0 0 0 0 FF00   28 DCHAR WAIT 
 DATA F 0 0 0 0 00FF 0 0 0 0 0 0 0 0 0 00FF  2C DCHAR WAIT
 BREAK?
AGAIN ;
TEST

Edited by sometimes99er
Link to comment
Share on other sites

or VSYNC in GFA ;) talking about screen sync, i have 1 questions :

 

Is it possible to change the background every line ? i tryed in turbo forth, it looks only possible every 8 lines.

 

Conceptually, maybe possible if the code is fast enough. The VDP will take mid-screen color changes (or any register update), but timing them is a problem as there's no horizontal synchronization.

 

In practice, I haven't seen it done on the TI. I've seen some MSX demos that do one or two mid-screen effects with the same VDP. Needs to be played with on hardware as emulation isn't currently up to the task (so far as I know so far).

Link to comment
Share on other sites

Conceptually, maybe possible if the code is fast enough. The VDP will take mid-screen color changes (or any register update), but timing them is a problem as there's no horizontal synchronization.

 

In practice, I haven't seen it done on the TI. I've seen some MSX demos that do one or two mid-screen effects with the same VDP. Needs to be played with on hardware as emulation isn't currently up to the task (so far as I know so far).

So, if ifs possible to detect the end of the screen, i think its technically possible in calculating the exact machine Time of each instruction to be syncro with video. This technic was used for overscreen on manu computer.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...