Jump to content
Sign in to follow this  
senior_falcon

Game Engine 256

Recommended Posts

The winning entry in the 10 line BASIC/XB contest was Game Engine X by KL99. The idea for the game is quite interesting, but I found that the "rubbery" feel of the graphics and the 40 pixel scrolling left much to be desired. Since XB256 offers scolling by single pixels, plus programs written for XB256 can be compiled, I decided to try to make a port of Game Engine X for XB256 to see better results could be achieved. The results are contained in the attached disk image.

 

ENGINE256 is the original source program which runs using XB256. Although the XB256 subroutines are written in assembly, there is a lot of overhead (both assembly and XB) involved in scrolling the platform. When running in straight XB256 the program is way too slow, with gameplay happening at a glacial pace. CPU overdrive in Classic99 helps out a lot. The game is much more playable and easier to test. Of course, from the beginning the intention was to compile the program, which these days happens pretty quickly. On my old Dell Optiplex 780 it takes just 22 seconds to save, compile, assemble, load and save the compiled program. A modern computer would be even faster.

 

The compiled program is ENGINE256X. This loads and runs like any XB program. Start by choosing speed 2. The controls are just like Game Engine X - use joystick left/right to move and the fire button to jump. On a keyboard, left and right arrow keys to move and Q to jump. Death of the player is not very elegant - he is immediately dropped back into the game again.

 

One thing you will notice is the sound effects. Constantly playing is a wonderfully frantic composition called Bumble Bee Boogie by Jack Fina, Sam Moore and Ollie Hebert. Superimposed on that is a rising scale when you jump and a descending scale when you fall. The sound list player in XB256 makes this possible and it can be used in both XB and compiled programs. When the game ends or if you break the program the sound list will hang. Press any letter and enter to cause an error which will clear the sound chip. SLCONVERT was used to create the sound list. The XB source program for the sound effects is called BUMBLE.

 

This program was written to be a demo and proof of concept, and I will not develop it further. There are rough edges that could be ironed out, and it ends abruptly just where Klaus's program ends. In a more developed version there would be objects to collect, monsters/aliens to shoot at, different levels, etc. Although compiled programs are fast, this one really pushes the limits and the horizontal scrolling is right on the edge of being too slow. You will see this if you choose a speed of 1. The edges of the platform flicker a bit. In later posts I will offer thoughts on how to improve the horizontal scrolling. If you want to make changes to the program, there is an important step that must be taken. When running in XB256 you must activate line 1 by removing the exclamation point. This reserves the proper amount of memory for the sound list. When compiling, line 1 must be turned back into a comment or the program will crash.

ENGINE256.DSK

  • Like 8

Share this post


Link to post
Share on other sites

One of the purposes of the GameEngine256 demo program was to show off the advanced sound list capabilities of XB256, both when running in XB and when compiled. 

 

After listening to many TI XB music programs, I decided to use Bumblebee Boogie for the main theme. I did not want to play the entire composition, just a loop that was long enough to be interesting. To do this I had to decide what lines would be the first and last lines of the loop. This required some patience. I pressed F4 in various places in the song to try to get an idea of where the program was and using GOTO's was able to narrow it down to lines 200 to 400. This music will be played constantly.

 

Superimposed on that I wanted a rising chromatic scale from 220 to 440 Hz to be played when "Tex" jumps, and a falling chromatic scale from 220 to 110 Hz to be played when "Tex" falls. This is pretty simple. For the rising scale:
20 SN=220::INTV=2^(1/12)::FOR I=1 TO 13 :: CALL SOUND(25,SN,0)::SN=SN*INTV::NEXT I
And the falling scale is similar.

 

Here is a tutorial showing how I created the sound lists to do this.

 

Building on the original Bumblebee boogie program which started at line 100, I added the code for the scales before this. I also broke up some of the long lines in the original program to isolate the FOR/NEXT loops on one line. As written, Bumblebee boogie is all played at volume 0. Because I wanted the sound effects to be louder than the main theme I changed the volume to 10. This is the variable V in line 165. The resulting program is listed below. 

 

Spoiler

15 !CALL LABEL("JUMP")
18 !CALL PLAYER2
20 SN=220::INTV=2^(1/12)::FOR I=1 TO 13 :: CALL SOUND(25,SN,0)::SN=SN*INTV::NEXT I
22 END !CALL STOP  !done with this sound list
25 !CALL LABEL("FALL")
26 !CALL PLAYER2
28 SN=220::INTV=2^(1/12)::FOR I=1 TO 13 :: CALL SOUND(25,SN,0)::SN=SN/INTV::NEXT I
32 END !CALL STOP  !done with this sound list
100 ! BUMBLEBOOG                Flight of the Bumblebee  by Jack Fina.  Program (and jazz) by Sam Moore, Jr.     Changes: Ollie Hebert, 1987
102 RESTORE 110
110 DATA 000E314080700C0300010307FF0301023048844424120A865455555555555554,0408000000000000060F5F5F5E00008040200000000000000000F
120 CALL DELSPRITE(ALL):: CALL CLEAR :: CALL SCREEN(12):: CALL CHARSET :: CALL MAGNIFY(1)! Also UPPER CASE only, all for RUN ALL sequencing.
130 FOR Y=128 TO 132 STEP 4 :: READ A$ :: CALL CHAR(Y,A$):: NEXT Y :: CALL SOUND(1,111,30):: FOR Z=8 TO 18 STEP 5
140 DISPLAY AT(Z,8):"€‚   €‚   €‚":"       ƒ…‡ ƒ…‡ ƒ…‡":"       „ †  „ †  „ †" :: NEXT Z :: DISPLAY AT(4,8):"BUMBLE-BOOGIE"
150 DISPLAY AT(6,6):"BASE BY JACK FINA" :: DISPLAY AT(22,2):"JAZZED UP BY SAM MOORE, JR." :: READ A,B,C,D,DS,E,F,FS,G,GS,HA,HAS,HB,HC,HCS
160 READ HD,HDS,HE,HF,HFS,HG,HGS,HHA,HHC,HHCS,HHD,HHDS,HHE,HHF,HHFS,HHG,HHGS,LA,LC,LCS,LD,LDS,LE,LF,LG,LGS,LLA,LLAS,LLB,T 
165 V=10::T=75::  [email protected]
166 !GOTO 201
170 FOR Z=0 TO 3 :: CALL SOUND(T,LLA,V,A,V):: CALL SOUND(T,LLA,V,LA,V):: CALL SOUND(T,LA,V,HA,V):: CALL SOUND(T,LA,V,A,V)
180 CALL SOUND(T,LC,V,HC,V):: CALL SOUND(T,LC,V,C,V):: CALL SOUND(T,LD,V,HD,V):: CALL SOUND(T,LD,V,D,V):: CALL SOUND(T,LDS,V,HDS,V)
190 CALL SOUND(T,LDS,V,DS,V):: CALL SOUND(T,LE,V,HE,V):: CALL SOUND(T,LE,V,E,V):: CALL SOUND(T,LC,V,HC,V):: CALL SOUND(T,LC,V,C,V)
200 CALL SOUND(T,LE,V,HE,V):: CALL SOUND(T,LE,V,E,V):: NEXT Z :: FOR Y=0 TO 2 
201 !CALL LABEL("BUMBLE")
202 FOR Z=0 TO 2 !CALL LABEL("LOOP1")
204 CALL SOUND(T,LLA,V,HE,V)
210 CALL SOUND(T,LLA,V,HDS,V):: CALL SOUND(T,LA,V,HD,V):: CALL SOUND(T,LA,V,HCS,V):: CALL SOUND(T,LC,V,HC,V):: CALL SOUND(T,LC,V,HF,V)
220 CALL SOUND(T,LD,V,HE,V):: CALL SOUND(T,LD,V,HDS,V):: CALL SOUND(T,LDS,V,HE,V):: CALL SOUND(T,LDS,V,HDS,V):: CALL SOUND(T,LE,V,HD,V)
230 CALL SOUND(T,LE,V,HCS,V):: CALL SOUND(T,LC,V,HC,V):: CALL SOUND(T,LC,V,HCS,V):: CALL SOUND(T,LE,V,HD,V):: CALL SOUND(T,LE,V,HDS,V)
240 NEXT Z !CALL LOOP("LOOP1",3)
241 CALL SOUND(T,LLA,V,A,V,HE,V):: CALL SOUND(T,LLA,V,LA,V):: CALL SOUND(T,LA,V,HA,V):: CALL SOUND(T,LA,V,A,V)
250 CALL SOUND(T,LC,V,HC,V):: CALL SOUND(T,LC,V,C,V):: CALL SOUND(T,LD,V,HD,V):: CALL SOUND(T,LF,V,D,V):: CALL SOUND(T,LDS,V,HDS,V)
260 CALL SOUND(T,LDS,V,DS,V):: CALL SOUND(T,LE,V,HA,V):: CALL SOUND(T,LE,V,A,V):: CALL SOUND(T,LC,V,HA,V):: CALL SOUND(T,LC,V,A,V)
270 CALL SOUND(T,LE,V,HF,V):: CALL SOUND(T,LF,V,F,V)
272 FOR Z=0 TO 2 !CALL LABEL("LOOP2")
274 CALL SOUND(T,LD,V,HA,V):: CALL SOUND(T,LD,V,HGS,V)
280 CALL SOUND(T,D,V,HG,V):: CALL SOUND(T,D,V,HFS,V):: CALL SOUND(T,LF,V,HF,V):: CALL SOUND(T,LF,V,HAS,V):: CALL SOUND(T,LG,V,HA,V)
290 CALL SOUND(T,LG,V,HGS,V):: CALL SOUND(T,LGS,V,HA,V):: CALL SOUND(T,LGS,V,HGS,V):: CALL SOUND(T,LA,V,HG,V):: CALL SOUND(T,LA,V,HFS,V)
300 CALL SOUND(T,LLA,V,HF,V):: CALL SOUND(T,LLA,V,HFS,V):: CALL SOUND(T,LA,V,HG,V):: CALL SOUND(T,LA,V,HGS,V)
302 NEXT Z !CALL LOOP("LOOP2",3)
310 CALL SOUND(T,LD,V,HA,V,HD,V):: CALL SOUND(T,LD,V,D,V):: CALL SOUND(T,D,V,HHD,V):: CALL SOUND(T,D,V,HD,V):: CALL SOUND(T,LF,V,HF,V)
320 CALL SOUND(T,LF,V,F,V):: CALL SOUND(T,LG,V,HG,V):: CALL SOUND(T,LG,V,G,V):: CALL SOUND(T,LGS,V,HGS,V):: CALL SOUND(T,LGS,V,GS,V)
330 CALL SOUND(T,LA,V,HD,V):: CALL SOUND(T,LA,V,D,V):: CALL SOUND(T,LLA,V,HF,V):: CALL SOUND(T,LLA,V,F,V):: CALL SOUND(T,LA,V,HA,V)
340 CALL SOUND(T,LA,V,A,V)
342 FOR Z=0 TO 1 !CALL LABEL("LOOP3")
344 CALL SOUND(T,LE,V):: CALL SOUND(T,LE,V,E,V):: CALL SOUND(T,E,V,HD,V,HHE,V)
350 CALL SOUND(T,E,V,HE,V):: CALL SOUND(T,LE,V,HE,V):: CALL SOUND(T,LE,V,E,V):: CALL SOUND(T,E,V,HG,V):: CALL SOUND(T,E,V,G,V)
360 CALL SOUND(T,LE,V,HGS,V):: CALL SOUND(T,LE,V,GS,V):: CALL SOUND(T,E,V,HB,V):: CALL SOUND(T,E,V,B,V):: CALL SOUND(T,LE,V,HHCS,V)
370 CALL SOUND(T,LE,V,HCS,V):: CALL SOUND(T,E,V,HHE,V):: CALL SOUND(T,E,V,HE,V):: CALL SOUND(T,LF,V,HGS,V,HHF,V):: CALL SOUND(T,LF,V,F,V)
380 CALL SOUND(T,F,V,HF,V):: CALL SOUND(T,HF,V,HHF,V):: CALL SOUND(T,LF,V,F,V):: CALL SOUND(T,F,V,HF,V):: CALL SOUND(T,F,V,HGS,V,HHF,V)
390 CALL SOUND(T,HF,V,HHF,V):: CALL SOUND(T,LF,V,F,V):: CALL SOUND(T,LF,V,F,V):: CALL SOUND(T,F,V,HF,V):: CALL SOUND(T,HF,V,HHF,V)
400 CALL SOUND(T,LF,V,HGS,V,HHF,V):: CALL SOUND(T,LF,V,F,V):: CALL SOUND(T,F,V,HF,V):: CALL SOUND(T,HF,V,HHF,V)
402 NEXT Z !CALL LOOP("LOOP3",2)
404 !GOTO 201 !CALL GOTO("BUMBLE")
406 !CALL LASTLINE  !last line of the sound list
408 !END !none of the following call sounds will be performed
410 FOR Z=0 TO 3 :: CALL SOUND(T,LLA,V,HA,V):: CALL SOUND(T,LLA,V,HAS,V):: CALL SOUND(T,LA,V,HA,V):: CALL SOUND(T,LA,V,HGS,V):: NEXT Z
420 CALL SOUND(T,LLA,V,HA,V):: CALL SOUND(T,LLA,V,HAS,V):: CALL SOUND(T,LA,V,HB,V):: CALL SOUND(T,LA,V,HHC,V):: CALL SOUND(T,LLA,V,HHCS,V)
430 CALL SOUND(T,LLA,V,HHC,V):: CALL SOUND(T,LA,V,HB,V):: CALL SOUND(T,LA,V,HAS,V):: CALL SOUND(T,LLA,V,HA,V):: CALL SOUND(T,LLA,V,HAS,V)
440 CALL SOUND(T,LA,V,HB,V):: CALL SOUND(T,LA,V,HHC,V):: CALL SOUND(T,LLA,V,HHCS,V):: CALL SOUND(T,LLA,V,LA,V):: CALL SOUND(T,LA,V,A,V)
450 CALL SOUND(T,A,V,HA,V):: FOR Z=0 TO 1 :: CALL SOUND(T,LD,V):: CALL SOUND(T,LD,V,D,V):: CALL SOUND(T,D,V,HC,V,HHD,V)
460 CALL SOUND(T,D,V,HD,V):: CALL SOUND(T,LD,V,HD,V):: CALL SOUND(T,LD,V,D,V):: CALL SOUND(T,D,V,HF,V):: CALL SOUND(T,D,V,F,V)
470 CALL SOUND(T,LD,V,HFS,V):: CALL SOUND(T,LD,V,FS,V):: CALL SOUND(T,D,V,HA,V):: CALL SOUND(T,D,V,A,V):: CALL SOUND(T,LD,V,HB,V)
480 CALL SOUND(T,LD,V,B,V):: CALL SOUND(T,D,V,HHD,V):: CALL SOUND(T,D,V,HD,V):: CALL SOUND(T,LDS,V,HCS,V,HHDS,V):: CALL SOUND(T,LDS,V,DS,V)
490 CALL SOUND(T,DS,V,HDS,V):: CALL SOUND(T,HDS,V,HHDS,V):: CALL SOUND(T,LDS,V,DS,V):: CALL SOUND(T,DS,V,HDS,V)
500 CALL SOUND(T,DS,V,HCS,V,HHDS,V):: CALL SOUND(T,HDS,V,HHDS,V):: CALL SOUND(T,LDS,V,DS,V):: CALL SOUND(T,LDS,V,DS,V)
510 CALL SOUND(T,DS,V,HDS,V):: CALL SOUND(T,HDS,V,HHDS,V):: CALL SOUND(T,LDS,V,HCS,V,HHDS,V):: CALL SOUND(T,LDS,V,DS,V)
520 CALL SOUND(T,DS,V,HDS,V):: CALL SOUND(T,HDS,V,HHDS,V):: NEXT Z :: FOR Z=0 TO 3 :: CALL SOUND(T,LD,V,HHD,V):: CALL SOUND(T,LD,V,HHDS,V)
530 CALL SOUND(T,D,V,HHD,V):: CALL SOUND(T,D,V,HHCS,V):: NEXT Z :: CALL SOUND(T,LD,V,HHD,V):: CALL SOUND(T,LD,V,HHDS,V)
540 CALL SOUND(T,D,V,HHE,V):: CALL SOUND(T,D,V,HHF,V):: CALL SOUND(T,LD,V,HHFS,V):: CALL SOUND(T,LD,V,HHF,V):: CALL SOUND(T,D,V,HHE,V)
550 CALL SOUND(T,D,V,HHDS,V):: CALL SOUND(T,LD,V,HHD,V):: CALL SOUND(T,LD,V,HHDS,V):: CALL SOUND(T,D,V,HHE,V):: CALL SOUND(T,D,V,HHF,V)
560 CALL SOUND(T,LD,V,HHFS,V):: CALL SOUND(T,LD,V,D,V):: CALL SOUND(T,D,V,HD,V):: CALL SOUND(T,HD,V,HHD,V):: CALL SOUND(T,LG,V,HHD,V)
570 CALL SOUND(T,LG,V,HHCS,V):: CALL SOUND(T,G,V,HHC,V):: CALL SOUND(T,G,V,HB,V):: CALL SOUND(T,LG,V,HAS,V):: CALL SOUND(T,LG,V,HHDS,V)
580 CALL SOUND(T,G,V,HHD,V):: CALL SOUND(T,G,V,HHCS,V):: CALL SOUND(T,LG,V,HHD,V):: CALL SOUND(T,LG,V,HHCS,V):: CALL SOUND(T,G,V,HHC,V)
590 CALL SOUND(T,G,V,HB,V):: CALL SOUND(T,LG,V,HAS,V):: CALL SOUND(T,LG,V,HB,V):: CALL SOUND(T,G,V,HHC,V):: CALL SOUND(T,G,V,HHCS,V)
600 CALL SOUND(T,LG,V,HHD,V):: CALL SOUND(T,LG,V,HHCS,V):: CALL SOUND(T,G,V,HHC,V):: CALL SOUND(T,G,V,HB,V):: CALL SOUND(T,LG,V,HHC,V)
610 CALL SOUND(T,LG,V,HB,V):: CALL SOUND(T,G,V,HAS,V):: CALL SOUND(T,G,V,HA,V):: CALL SOUND(T,LG,V,HAS,V):: CALL SOUND(T,LG,V,HB,V)
620 CALL SOUND(T,G,V,HHC,V):: CALL SOUND(T,G,V,HHCS,V):: CALL SOUND(T,LG,V,HHD,V):: CALL SOUND(T,LG,V,HHDS,V):: CALL SOUND(T,G,V,HHE,V)
630 CALL SOUND(T,G,V,HHF,V):: CALL SOUND(T,LE,V,HHE,V):: CALL SOUND(T,LE,V,HHDS,V):: CALL SOUND(T,E,V,HHD,V):: CALL SOUND(T,E,V,HHCS,V)
640 CALL SOUND(T,LE,V,HHD,V):: CALL SOUND(T,LE,V,HHCS,V):: CALL SOUND(T,E,V,HHC,V):: CALL SOUND(T,E,V,HB,V):: CALL SOUND(T,LE,V,HHC,V)
650 CALL SOUND(T,LE,V,HB,V):: CALL SOUND(T,E,V,HAS,V):: CALL SOUND(T,E,V,HA,V):: CALL SOUND(T,LE,V,HGS,V):: CALL SOUND(T,LE,V,HG,V)
660 CALL SOUND(T,E,V,HFS,V):: CALL SOUND(T,E,V,HF,V):: FOR Z=0 TO 7 :: CALL SOUND(T,LE,V,HE,V):: CALL SOUND(T,LE,V,HF,V)
670 CALL SOUND(T,E,V,HE,V):: CALL SOUND(T,E,V,HGS,V):: NEXT Z :: CALL SOUND(T,LE,V,HE,V,HHE,V):: CALL SOUND(T,LE,V,E,V,HE,V)
680 CALL SOUND(T,LE,V,HE,V,HHE,V):: CALL SOUND(T,LE,V,E,V,HE,V):: CALL SOUND(T,LDS,V,HDS,V,HHDS,V):: CALL SOUND(T,LDS,V,DS,V,HDS,V)
690 CALL SOUND(T,LD,V,HE,V,HHE,V):: CALL SOUND(T,LD,V,E,V,HE,V):: CALL SOUND(T,LCS,V,HF,V,HHF,V):: CALL SOUND(T,LCS,V,F,V,HF,V)
700 CALL SOUND(T,LC,V,HFS,V,HHFS,V):: CALL SOUND(T,LC,V,FS,V,HFS,V):: CALL SOUND(T,LLB,V,HG,V,HHG,V):: CALL SOUND(T,LLB,V,G,V,HG,V)
710 CALL SOUND(T,LLAS,V,HGS,V,HHGS,V):: CALL SOUND(T,LLAS,V,GS,V,HGS,V):: FOR Z=0 TO 1 :: CALL SOUND(T,LLA,V,HA,V,HHA,V)
720 CALL SOUND(T,LLA,V,LA,V):: CALL SOUND(T,LA,V,HA,V):: CALL SOUND(T,LA,V,A,V):: CALL SOUND(T,LC,V,HC,V):: CALL SOUND(T,LC,V,C,V)
730 CALL SOUND(T,LD,V,HD,V):: CALL SOUND(T,LD,V,D,V):: CALL SOUND(T,LDS,V,HDS,V):: CALL SOUND(T,LDS,V,DS,V):: IF Z THEN 760
740 CALL SOUND(T,LE,V,HE,V):: CALL SOUND(T,LE,V,E,V):: CALL SOUND(T,LC,V,HC,V):: CALL SOUND(T,LC,V,C,V):: CALL SOUND(T,LE,V,HE,V)
750 CALL SOUND(T,LE,V,E,V)
760 NEXT Z :: CALL SOUND(T,LE,V,HHE,V):: CALL SOUND(T,LE,V,HE,V):: CALL SOUND(T,LC,V,HHE,V):: CALL SOUND(T,LC,V,HE,V)
770 CALL SOUND(T,LE,V,HHC,V):: CALL SOUND(T,LE,V,HC,V):: NEXT Y :: FOR Z=V TO 30 STEP 2 :: CALL SOUND(T,LLA,Z,HE,Z):: CALL SOUND(T,LLA,Z,HDS,Z)
780 CALL SOUND(T,LA,Z,HD,Z):: CALL SOUND(T,LA,Z,HCS,Z):: CALL SOUND(T,LC,Z,HC,Z):: CALL SOUND(T,LC,Z,HF,Z):: CALL SOUND(T,LD,Z,HE,Z)
790 CALL SOUND(T,LD,Z,HDS,Z):: CALL SOUND(T,LDS,Z,HE,Z):: CALL SOUND(T,LDS,Z,HDS,Z):: CALL SOUND(T,LE,Z,HD,Z):: CALL SOUND(T,LE,Z,HCS,Z)
800 CALL SOUND(T,LC,Z,HC,Z):: CALL SOUND(T,LC,Z,HCS,Z):: CALL SOUND(T,LE,Z,HD,Z):: CALL SOUND(T,LE,Z,HDS,Z):: NEXT Z :: RUN "DSK1.LOAD"
810 DATA 440,494,262,294,311,330,349,370,392,415,880,932,988,523,554,587,622,659,698
820 DATA 740,784,831,1760,1047,1109,1175,1245,1319,1397,1480,1568,1661,220,131,139,147,156,165,175,196,208
830 DATA 110,117,123,-99

 

 

You can test the three parts with RUN 15, RUN 25, and RUN 100. When you RUN 100 it plays the entire composition from beginning to end. There is a slight choppiness which will go away when the sound list is created. You can set up the endless loop by uncommenting lines 166 and 404. 
166 !GOTO 201
404 !GOTO 201 !CALL GOTO("BUMBLE")
Then RUN 100 will test out the loop. The remaining code after line 404 is not executed but there is no harm in leaving it.

 

XB256 should be loaded and running for the next steps. Because it can handle numeric variables, we will use SLCONVERT to create the soundlist. It is described on pages 17-19 of the XB256 manual. SLCONVERT intercepts CALL SOUND statements and, instead of playing them, converts them into a sound list. If the CALL SOUNDs are in an endless loop, an endless sound list will be produced. Not good. If a FOR/NEXT loops 3 times there will be 3 copies of that section of the sound list, wasting memory. There are ways to deal with these problems. Once you are satisfied the XB program plays the sound effects as desired, you have to make some modifications to the music program so SLCONVERT can send instructions to the sound list being created. 

 

I have made it easy to do this in the demo program. For example:
   202 FOR Z=0 TO 2 !CALL LABEL("LOOP1")    becomes         202 CALL LABEL("LOOP1")
   ...call sound statements in the loop                     ...call sound statements in the loop
   240 NEXT Z !CALL LOOP("LOOP1",3)         becomes         240 CALL LOOP("LOOP1",3)
This loops 3 times in XB. Remove the code up to CALL LABEL and CALL LOOP and now XB will only perform the call sound statements once. But CALL LABEL and CALL LOOP create labels and instructions that tell the sound list processor to perform that loop 3 times when it plays. 

 

To prepare the program for SLCONVERT, remove everything up to the CALL in these lines as described above:
15,18,22,25,26,32,201,202,240,272,302,342,402,406. 
All now start with CALL LABEL, CALL PLAYER2, CALL STOP, etc. Uncomment 166,404, and 408 so they read:
166 GOTO 201    404 GOTO 201    408 END
While making these changes, you should study the manual and the code to help understand these concepts. 

 

Once that is done, double checked, and a backup saved (I saved it as DSK1.BUMBLE), type MERGE "DSK1.SLCONVERT". This uses line 1 and lines from 32000 and up which means that your XB program cannot use these lines. 

At last it's time to make a sound list. Be sure XB256 is loaded and running, and CPU overdrive helps a lot here! Type RUN and the program asks:
"Sound List Output File?"
Enter DSK1.BUMBLE.TXT
When the sound list source code file  has been created the program ends and you are returned to the immediate mode of XB256. The next steps are described in the XB256 manual starting at the middle of page 14 

 

First assemble the program. Return to the XBGDP main menu and select ASSEMBLER. 
I used a source file name of DSK1.BUMBLE.TXT
And the object file name was DSK1.BUMBLE.OBJ
Press ENTER 3 times and the assembly process will start. When finished press ENTER once more. 

 

At the XBGDP menu select XB256. Press F3 to kill the auto complete routine. 
Following the manual we type:
CALL LOAD(“DSK1.BUMBLE.OBJ”)    loads the object code
CALL LINK(“ST2VDP”,1)          moves sound table into VDP buffer1
And we are greeted with this error message:
"SOUND TABLE TOO LARGE  IT IS 960 BYTES LONG  CANNOT EXCEED 640 BYTES"
Now we know that the sound table will not fit into VDP buffer 1

 

OK, let's try VDP buffer 2
CALL LOAD(“DSK1.BUMBLE.OBJ”)    loads the object code
CALL LINK(“ST2VDP”,2)          moves sound table into VDP buffer2
The error message is similar: "VDP RAM BUFFER TOO SMALL   Enter CALL LINK("XB256",960)  Enter NEW  Then reload the sound table"

 

Now we know what to do:
CALL LINK("XB256",960) 
NEW
CALL LOAD(“DSK1.BUMBLE.OBJ”)    loads the object code
CALL LINK(“ST2VDP”,2)          moves sound table into VDP buffer2
Success!!! Now we get a screen similar to the one at the top of page 15 giving the three addresses we care about:
BUMBLE  6319
FALL    6245
JUMP    6176
 
We can test these in the immediate mode:
CALL LINK("PLAY",6319)  will play the main bumbleboogie music
CALL LINK("PLAY",6245)  superimposes the falling sound on the music
CALL LINK("PLAY",6176)  superimposes the jumping sound on the music.

To turn off the sound just press a key and then enter. The honk will turn off the sound list.

 

Now that those pesky error messages have been taken care of, at this point pages 15 and 16 of the XB256 manual describe how to use COMPRESS to make compressed DATA statements and how to incorporate them into your program. When XB256 is loaded, be sure you have reserved 960 bytes in vdp buffer 2. You can do this from the immediate mode as described above:
CALL LINK("XB256",960) 
NEW

Or you can have your program do it for you:
1 CALL LINK("XB256",960)::RUN 2
2 START OF PROGRAM
If you do this you must remember to comment out line 1 for compiling, and uncomment it when testing in XB256.

 

Remember that the sound list player can be used in both XB256 programs and compiled programs. 


 

Edited by senior_falcon
  • Like 3

Share this post


Link to post
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.

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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...