Peter's z80.eu site blog
Search 

Please read ! 
If NO IMAGES will be shown, use www.z80.eu/blog instead of blog.z80.eu

Please note also - THIS BLOG ENDS HERE WITH THE LAST ENTRY FROM NOVEMBER 9th 2021.

I have prepared a new blog with wordpress at https://vintagecomputing.info !!!

Thank you.
Programming a BASIC game - still fun, even with a vintage PC/XT 
Tuesday, March 15, 2016, 11:00 PM
Posted by Administrator
Yes, it can be still fun, although you should not try to program too large programs in BASIC.

I remembered these racing game tries of the first microcomputer days, without any high res graphics, just characters. So I tried to program a small game in less than 1KB source code.
That's the result:

10 DEFINT A-Z:RANDOMIZE TIMER:D!=TIMER:S=RND*40!+20:C=S+4:O=C:CLS
20 LOCATE 11,1:FOR I=1 TO 12:PRINT SPC(S);"|";SPC(10);"|":NEXT I:Z=0:V!=.3
30 R=RND*7:IF R<3 THEN M=-1 ELSE IF R=3 THEN M=0 ELSE M=1
40 LOCATE 2,1:PRINT "SCORE";Z;" Vmax:";310-CINT(V!*1000!):S=S+M
50 LOCATE 23,1:IF S>58 THEN S=58 ELSE IF S<1 THEN S=1
60 PRINT SPC(S%);"|";SPC(10);"|":PRINT:Z=Z+10:T=SCREEN(10,C):LOCATE 10,C
70 PRINT "*";:LOCATE 9,O:PRINT " ";:IF T<>32 THEN LOCATE 3,1:PRINT "CRASH!"
80 IF T<>32 THEN SOUND 37,5:LOCATE 23,1:END ELSE O=C:IF TIMER<D!+1 THEN 110
90 IF V!>.1 THEN V!=V!-.01 ELSE IF V!>.05 THEN V!=V!-.005 ELSE V!=V!-.001
100 D!=TIMER:SOUND Z/10+100,2:IF V!<0 THEN V!=0
110 K$=INKEY$:T!=TIMER+V!:WHILE TIMER<T!:WEND
120 IF K$="" THEN 30 ELSE IF K$="n" THEN C=C-1 ELSE IF K$="m" THEN C=C+1
130 IF K$="q" THEN LOCATE 23,1:END ELSE 30:REM WRITTEN BY P. DASSOW

And that's how it looks:


If you would say "that's not coded perfectly", that's true, but some strange things like two IF branches with the same condition - see line 70 and 80 - are done just because to get less lines and having still a line length < 80 chars. It is programmed CPU speed "independent" (means delays are timer based).

This is a version with more lines, but somewhat speed optimized:

10 DEFINT A-Z:RANDOMIZE TIMER:D!=TIMER:S=RND*40!+20:C=S+4:W$="|"+SPACE$(10)+"|"
20 CLS:O=C:LOCATE 11,1:FOR I=1 TO 12:PRINT SPC(S);W$:NEXT I:Z=0:V!=.3
30 R=RND*7:IF R<3 THEN M=-1 ELSE IF R=3 THEN M=0 ELSE M=1
40 LOCATE 2,1:PRINT "SCORE";Z;" Vmax:";310-CINT(V!*1000!):S=S+M
50 LOCATE 23,1:IF S>58 THEN S=58 ELSE IF S<1 THEN S=1
60 PRINT SPC(S%);W$:PRINT:Z=Z+10:T=SCREEN(10,C):LOCATE 10,C
70 PRINT "*";:LOCATE 9,O:PRINT " ";:IF T=32 THEN O=C:IF TIMER<D!+1 THEN 110 ELSE 90
80 LOCATE 3,1:PRINT "CRASH!":SOUND 37,5:LOCATE 23,1:END
90 IF V!>.1 THEN V!=V!-.01 ELSE IF V!>.05 THEN V!=V!-.005 ELSE V!=V!-.001
100 D!=TIMER:SOUND Z/10+100,2:IF V!<0 THEN V!=0
110 K$=INKEY$:T!=TIMER+V!:WHILE TIMER<T!:WEND
120 IF K$="" THEN 30
130 IF K$="n" THEN C=C-1:GOTO 30
140 IF K$="m" THEN C=C+1:GOTO 30
150 IF K$="q" THEN LOCATE 23,1:END
160 GOTO 30:REM WRITTEN BY P. DASSOW

Now imagine to spend additional 4 hours of testing and programming, and see the results:






I added a title screen with explanations, a bit more color, some random grass, a more sophisticated curve algorithm to have a more sinuos course, and also high score saving.

There is still a problem with the TIMER variable, if speed reaches the value 307, subtracting TIMER with very small values will result in inaccurate behaviour of the car on the street (it warps forward until it crashes).
This is surprisingly NOT the case if you execute the program on a slow PC/XT or an AMSTRAD PC 1640 for example. On such a slow computer, you will reach the highest possible speed of 310 without problems.... strange, isn't it ?

The versions:
The original first BASIC source code
The compiled first BASIC version, DOS compatible
The original first BASIC source code, optimized
The compiled and "improved" BASIC version, DOS compatible
The compiled and "improved" BASIC version, OS/2 compatible

Compiled versions are for 286 based PCs and older. Source can be run with an BASICA/GWBASIC interpreter from 386 up to a modern PC, if DOS (or DOSBOX) is used.

See related link for the WINDOWS 7 compatible QB64 compiled and "improved" version.
If you're curios about the source code of the "improved" version, please send me a mail, and you will get the source code (2.5 KB and still BASICA compatible) of it also.
add comment ( 213 views )   |  permalink   |  related link   |   ( 3 / 1527 )
My ZIP 100 dropped about 50cm down to the ground - dead :-( 
Sunday, February 28, 2016, 04:00 PM
Posted by Administrator
After using my parallel port ZIP 100 drive very often for transferring files to my vintage Amstrad PC 1640 (I used an USB ZIP drive for my modern PC, too), it dropped about 50cm down to the ground (front side first). It didn't worked anymore, so I thought it would be a good idea to open it, looking for a circuit path interruption or similar.
BUT. You can't open it without destroying it. These plastic brackets will break, see first image where they're located.

The good thing - now I can take a look at the board...

You see a large chip made from Iomega, named Phaethon (or at least branded with Iomega).
There are two other chips as well, I guess one of them is used to convert it to a parallel port signal. The red circles in the secound picture marking the flat ribbon cable connectors from the motor board.
Fortunately ZIP 100 drives aren't still too expensive at *bay, so I just have to get another one again. The DOS driver from Mr. Peichl ( see related link ) is still working fine, although I was *not* able to use the driver with Compaq MS-DOS 3.31, which runs well on an Amstrad PC 1640 and bigger hard drives (I had to copy the keyboard driver program from the original Amstrad MS-DOS 3.20 and patched it for version 3.31). So I finally had to take MS-DOS 5.0 for using PALMZIP.SYS instead of Compaq DOS 3.31 (with had a smaller memory footprint).

P.S.: Someone already tried to open it also, see http://www.techrepublic.com/pictures/cr ... zip-drive/
add comment ( 234 views )   |  permalink   |  related link   |   ( 3 / 1595 )
Famous game classics on Sega Mega Drive (Genesis): TinyToon Adventures ! 
Saturday, February 20, 2016, 03:00 PM
Posted by Administrator
If you search for a real game classics on Sega Mega Drive (Genesis), and you like to play "jump'n run" games, choose TinyToon Adventures !
It's far better than Sonic, and has a cool theme tune/song.
Also, if you growed up in the early 90's, you had to like this animated television series, and it's catchy song. I've extracted for you the first seconds (may be you like to have it as a ring tone).
Also, the look of the start/title screen is very promising:


But don't think it's easy to play - almost all games "before 3D" have at least a decent difficulty, e.g. this passage:


Pictures were made with a REAL CONSOLE, not an emulator ;-)

See "related link" for the MP3 of the theme tune.

add comment ( 237 views )   |  permalink   |  related link   |   ( 3.1 / 2191 )
OT: For those who would like to travel through time ... 
Sunday, January 31, 2016, 02:00 PM
Posted by Administrator
It's slightly off-topic, but interesting. It's an explanation why time is going always forward, not backward. An asymmetry exists between time and space in the sense that physical systems inevitably evolve over time whereas there is no corresponding ubiquitous translation over space.
The asymmetry is represented by equations of motion and conservation laws that operate differently over time and space. But there are reasons for it, which are digged deeper into theoretical physics.
It seems to be related with K and B meson particles and their behaviour (spin and state) and balance between them. Experiments to test the time-reversal symmetry exists already.

Now think about trying to manipulating exactly what was mentioned (K and B mesons).
It can be the way travelling through time, although it can be done only in a microscopical way, and only for a very small area. I am not sure how to accomplish this without an extraordinary amount of energy and without destroying anything with a bit complexity (means if you can accomplish it by a supernova, it will not help you).

See related link for a general overview.
add comment ( 220 views )   |  permalink   |  related link   |   ( 3 / 2323 )
Ho ho ho - Merry christmas and a happy new year 2016 
Friday, December 25, 2015, 01:00 AM
Posted by Administrator
It's not the best animation, but perhaps one of the best known XMAS demo:

Just grab your C64 out of the cellar, get the (SX-64) demo program (see related link), and run it on a real Commodore 64 or at least on one of the many emulators (like WinVICE).
1 comment ( 434 views )   |  permalink   |  related link   |   ( 3 / 1567 )

<<First <Back | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | Next> Last>>