Gury Posted March 6, 2016 Share Posted March 6, 2016 (edited) Hello there, I've got an idea of posting games written in Mad Pascal. Here you can post any game you created in this language, it could even be a type-in listing game from any magazine or book, but converted to Mad Pascal. I begin with Wolves, type-in listing from ex-Yu book Mirko Tipka Na Radirko, which included games and utility listings written in Sinclair BASIC for ZX Spectrum. Game was originally written by Primoz Petrlin. There is executable file at the bottom of this post. If you wish, you can modify it and make it even better. Story: Small village in Bosnian mountains is attacked by hord of hungry wolves. Your 5 heroes must defend your people by stopping wolves eating them. When five of them reach your village, people are doomed and game is over. Controls: 5 - left, 6 - down, 7 - up, 8 - right I tried to make game close to the original, but making some changes, for example, in sounds which are not the same. I also added title music, which is actually a code excerpt from De re Atari book. // Wolves // Ported from the book Mirko tipka na radirko // Original author: Primoz Petrlin // Original game written for ZX Spectrum in Sinclair BASIC // Ported to Atari XL/XE/400/800 in Mad Pascal: Bostjan Gorisek 2016 uses graph, crt, sysutils; var topMem : word; CHBAS : byte absolute $2F4; RAMTOP : byte absolute $6A; playerName : string[15] = 'M.M'; playerScore : shortInt = 10; score, lives, a, b, // Our hero's coordinates s, d : byte; // Wolf coordinates isNewGame : boolean = true; // Data for new characters _grave : array[0..6] of byte = ( %01111100, %10000010, %10000010, %10000010, %10000010, %01010100, %11111110); // character g _hero02 : array[0..7] of byte = ( %00011100, %00101010, %00010100, %00001000, %00111111, %01001000, %00010100, %00110110); // character c _dead_wolf : array[0..7] of byte = ( %00010000, %00010000, %11111110, %00010000, %00010000, %00010000, %00010000, %00010000); // character j _hero : array[0..7] of byte = ( %00011100, %00101010, %10010100, %01001001, %00111110, %00001000, %00010100, %00110110); // character p _weapon : array[0..7] of byte = ( 0, %01100000, %01100000, %01000000, %11000000, %01000000, %01000000, 0); // character o _wolf : array[0..6] of byte = ( 0, %00100000, %11100010, %01111100, %00111100, %00100100, %00100100); // character d _tree : array[0..7] of byte = ( 0, %00011100, %00111110, %01111111, %00111110, %00010100, %00010100, 0); // character h // Custom write routines procedure PrintAt(x, y : byte; text : string); overload; begin GotoXY(x+1, y+1); Write(text); end; procedure PrintAt(x, y : byte; text : char); overload; begin GotoXY(x+1, y+1); Write(text); end; // New game? function NewGame : boolean; var ch : char; begin if KeyPressed then ReadKey; Writeln(#$9b#$9b'ANOTHER GAME? (Y/N)'); isNewGame := false; ch := #255; repeat if KeyPressed then begin ch := UpCase(ReadKey); isNewGame := (ch = 'Y'); end; until (ch = 'Y') or (ch = 'N'); result := isNewGame; end; // High score code block function HighScore : boolean; var i, j : byte; begin Poke($D201, 168); for i:=200 downTo 100 do begin Poke($D200, i); Delay(10); end; ClrScr; for j:=1 to 10 do begin PrintAt(18, 16, 'HURA!'); PrintAt(18, 6, 'HURA!'); PrintAt(20, 11, 'P'); Delay(40); Poke($D200, 90); ClrScr; PrintAt(20, 11, 'c'); Delay(40); Poke($D200, 154); for i:=6 to 16 do begin PrintAt(11, i, 'HURA'); PrintAt(26, i, 'HURA'); end; end; for i:=255 downTo 60 do begin Poke($D200, i); Delay(10); end; FillChar(Pointer($D200), 2, 0); Delay(40); ClrScr; CursorOn; if KeyPressed then ReadKey; Writeln('YOU REACHED HIGH SCORE!'#$9b'ENTER YOUR NAME:'); ReadLn(playerName); CursorOff; playerScore := score; result := NewGame; end; // Game is on procedure Game; var y, x, z, n, m : byte; ch : char; begin FillChar(Pointer($D200), 8, 0); ClrScr; PrintAt(1, 0, 'ppppp'); score := 0; // Initialize score lives := 5; // You have 5 lives Randomize; // Draw trees on random locations for y := 1 to 38 do begin z := Random(22); x := Random(38); PrintAt(x, z+1, 'h'); end; // Row of trees for y := 0 to 22 do PrintAt(38, y, 'h'); // Hero position a := 11; b := 11; // Wolf coordinates d := 36; s := Random(22) + 1; // Game play loop repeat PrintAt(b, a, 'po'); // Hero position // Keep track of hero deaths if lives < 5 then PrintAt(lives+1, 0, ' g'); PrintAt(d, s, 'd'); // Draw attacking wolf Dec(d); //if d = 0 then Continue; // Wolf reached your village if d = 0 then begin PrintAt(d+2, s, ' '); PrintAt(d, s, ' '); Dec(lives); d := 36; s := Random(22) + 1; if lives = 0 then begin break; end; end; PrintAt(d+2, s, ' '); // Hero control if KeyPressed then begin ch := UpCase(ReadKey); case ch of '8': begin Inc(b); if b = 37 then b := 36; PrintAt(b-1, a, ' '); end; '5': begin Dec(b); if b = 1 then b := 2; PrintAt(b+1, a, ' '); end; '6': begin Inc(a); if a = 23 then a := 22; PrintAt(b, a-1, ' '); end; '7': begin Dec(a); if a = 0 then a := 1; PrintAt(b, a+1, ' '); end; end; end; // You hit a wolf if (a = s) and (b = d) then begin // beep beep PrintAt(d, a, ' '); Poke($D201, 168); for m := 1 to 50 do begin for n:=40 to 100 do Poke($D200, n); end; Poke($D200, 0); Poke($D201, 0); d := 36; s := Random(22) + 1; Inc(score); GotoXY(30, 1); Write('DEAD=', score); PrintAt(b+2, a, 'j'); end; Delay(75); until lives = 0; ClrScr; if score <= playerScore then begin PrintAt(1, 11, 'VILLAGE PEOPLE ARE DEAD.'#$9b'YOU KILLED '); Write(IntToStr(score), ' WOLVES!'); NewGame; //if not NewGame then Halt(0); end else begin // If you break new record... HighScore; end; end; begin // Set display mode, colors and left margin InitGraph(0); CursorOff; Poke(710, 34); Poke(709, 30); Poke(82, 1); //Poke($D201, 168); // sound channel 0 volume and distortion // Prepare new character set topMem := RAMTOP - 8; topMem := topMem * 256; CHBAS := topMem div 256; move(pointer(57344), pointer(topMem), 1023); // Redefine characters for the game move(_grave, pointer(topMem+103*, sizeOf(_grave)); // g move(_hero02, pointer(topMem+99*, sizeOf(_hero02)); // c move(_dead_wolf, pointer(topMem+106*, sizeOf(_dead_wolf)); // j move(_hero, pointer(topMem+112*, sizeOf(_hero)); // p move(_weapon, pointer(topMem+111*, sizeOf(_weapon)); // o move(_wolf, pointer(topMem+100*, sizeOf(_wolf)); // d move(_tree, pointer(topMem+104*, sizeOf(_tree)); // h // Title screen Writeln(#$9b' ddd WOLVES ddd' + #$9b#$9b'SMALL VILLAGE IN BOSNIAN MOUNTAINS IS' + #$9b'ATTACKED BY HORD OF HUNGRY WOLVES.' + #$9b'YOU MUST DEFEND YOUR PEOPLE BY STOPPING' + 'WOLVES BY ANY COST.' + #$9b#$9b' po'#$9b + #$9b'WHEN FIVE OF THEM REACH THE VILLAGE,' + #$9b'PEOPLE ARE EATEN AND GAME IS OVER.'); // Some title music // Taken from the book De Re Atari Poke(53768, 24); Poke( 53761, 168); Poke( 53763, 168); Poke( 53765, 168); Poke(53767, 168); Poke( 53760, 240); Poke( 53764, 252); Poke( 53762, 28); Poke(53766, 49); // Main game loop repeat // Best score information Writeln(#$9b'BEST SCORE ', playerScore, ' HOLDS ', playerName); Writeln(#$9b#$9b'PRESS ANY KEY...'); repeat until keypressed; // Game Game; until not isNewGame; end. ZX Spectrum type-in listing in Sinclair BASIC (Mirko Tipka Na Radirko): Page 1 Page 2 wolves.xex wolves.zip Edited March 6, 2016 by Gury 2 Quote Link to comment Share on other sites More sharing options...
miker Posted March 6, 2016 Share Posted March 6, 2016 Not bad but steering is ridiculous. Some joystick hack or at least arrows/WSAD? Quote Link to comment Share on other sites More sharing options...
Gury Posted March 6, 2016 Author Share Posted March 6, 2016 Good point! ZX Spectrum key layout I modified game to play with joystick. I will take this into consideration when porting ZX games. Greetings wolves_v1_1.zip wolves_v1_1.xex 2 Quote Link to comment Share on other sites More sharing options...
miker Posted March 6, 2016 Share Posted March 6, 2016 Now is much better. Thanks! Quote Link to comment Share on other sites More sharing options...
tebe Posted March 12, 2016 Share Posted March 12, 2016 conversion from Turbo Basic XL (author: mgr inż. Rafał Chabowski) - Duck Hunt duck_hunt.zip 1 Quote Link to comment Share on other sites More sharing options...
Gury Posted March 26, 2016 Author Share Posted March 26, 2016 Nice! Quote Link to comment Share on other sites More sharing options...
Gury Posted March 26, 2016 Author Share Posted March 26, 2016 (edited) Another conversion from the book Mirko tipka na radirko, a story about kangaroo in game called Stupid Kangaroo. You are a kangaroo, who was captured by crazy evil king. The king decided to test your intelligence and psychical abilities hoping to break you, because he thinks you are stupid. He was way too WRONG You control your hero kangaroo with joystick (left / right). He jumps all the time, so you don't have to jump yourself with joystick button. Your goal is to reach each level by finding red brick, which brings you one point and open door for the next level. Each new level brings you additional points. When you finish all four levels, you come back to first level, but with a surprising twist You start with 3 lives and additional life when you finish all 4 levels. In Mad Pascal code, don't be confused with coordinate system of PrintAt and Screen routines, because they simulate Sinclair BASIC way of handling coordinate system (y axis first, x axis second). I put these routine in special unit for easier handling of Sinclair BASIC commands. Attached below are source code and binary files. Enjoy the game! Gury ZX Spectrum type-in listing in Sinclair BASIC (Mirko Tipka Na Radirko): Page 1 Page 2 Page 3 sk.zip sk.xex Edited March 26, 2016 by Gury 2 Quote Link to comment Share on other sites More sharing options...
tebe Posted April 10, 2016 Share Posted April 10, 2016 (edited) NUTS (MadPascal version) http://jeffpiepmeier.blogspot.de/2016/02/nuts-atari-basic-10-liner-contest-2016.html nuts.zip Edited April 10, 2016 by tebe 1 Quote Link to comment Share on other sites More sharing options...
Gury Posted April 11, 2016 Author Share Posted April 11, 2016 Nice little adrenalin game Quote Link to comment Share on other sites More sharing options...
Gury Posted April 17, 2016 Author Share Posted April 17, 2016 Stupid Kangaroo, new version 1.1, additional level and high score tracking added... Greetings sk.zip sk.xex 1 Quote Link to comment Share on other sites More sharing options...
Gury Posted April 30, 2016 Author Share Posted April 30, 2016 (edited) Yet another conversion from the book Mirko tipka na radirko, now it is time for some action from the second world war. The game is titled Parachute, originally written by Bostjan Jerko. The game begins with flying plane over war zone on the ocean. Your mission is to land as many soldiers as you can in the middle of the island. When your soldier jumps, it drops very quickly, so you must open your parachute before you land on the island. You control a soldier with joystick by pressing trigger button first time for jump and second time for opening the parachute. Later you open it, more score points you get. But be sure to do this before landing if you don't want to die. When your parachute opens, you can control soldier with joystick (left/right). After five jumps the plane moves lower, making jumping area lower and harder. When you succeed to land soldiers in some 5 jump waves, you progress to next wave (level), where plane moves faster and faster. The game is written in Mad Pascal, version 1.3.1. You can download executable file and source code listing below. Original ZX Spectrum game is written in Sinclair BASIC: Page 1 Page 2 Page 3 Greetings, Gury parachute.zip Parachute.xex Edited April 30, 2016 by Gury 3 Quote Link to comment Share on other sites More sharing options...
Gury Posted June 14, 2017 Author Share Posted June 14, 2017 (edited) Hello, Here is another little game conversion from the book Mirko tipka na radirko, titled Formula 126PZ by Branislav Milosavljevic. In this game you control a car which must struggle through the scrolling screen with obstacles on the way. The car is shaking, but you will be comfortable with it very soon. The score increases as long as you manage not to crash. Enjoy! Gury formula126pz.xex formula126pz.zip Edited June 14, 2017 by Gury 6 Quote Link to comment Share on other sites More sharing options...
peteym5 Posted June 15, 2017 Share Posted June 15, 2017 (edited) On the main section, under "More Games to Come..." people had been suggesting this game called "Klax" looks like another Tempest and Columns type game. I feel this will be perfect for the Mad Pascal People to make because it is not complicated and does not require heavy machine language to make this game run on the Atari 8-bit. In there I suggested something with GTIA mode 10 or Super IRG, but that will be the programmer to decide. I know we can do better with our Atari Computers. https://www.youtube.com/watch?v=2cLb3g4IH4U Edited June 15, 2017 by peteym5 Quote Link to comment Share on other sites More sharing options...
+Stephen Posted June 15, 2017 Share Posted June 15, 2017 On the main section, under "More Games to Come..." people had been suggesting this game called "Klax" looks like another Tempest and Columns type game. I feel this will be perfect for the Mad Pascal People to make because it is not complicated and does not require heavy machine language to make this game run on the Atari 8-bit. In there I suggested something with GTIA mode 10 or Super IRG, but that will be the programmer to decide. I know we can do better with our Atari Computers. https://www.youtube.com/watch?v=2cLb3g4IH4U If you want to do Klax, please look at the Lynx version! Excellent graphics, digitised sounds. Quote Link to comment Share on other sites More sharing options...
tebe Posted June 16, 2017 Share Posted June 16, 2017 written in AmigaBasic http://www.gutenberg.cc/articles/Klax_(video_game) Quote Link to comment Share on other sites More sharing options...
+Allan Posted June 16, 2017 Share Posted June 16, 2017 I believe Klax for the Atari 5200 is written in compiled BASIC. I think it is called 5200bas. Allan Quote Link to comment Share on other sites More sharing options...
peteym5 Posted June 16, 2017 Share Posted June 16, 2017 They have Klax in 5200 Basic? That would save us a lot of time. Can this 5200 Basic set up to compile for the 8-bit? Quote Link to comment Share on other sites More sharing options...
Gury Posted June 18, 2017 Author Share Posted June 18, 2017 (edited) Another little conversion from the book Mirko tipka na radirko, now it is time for shooting the stars with the game called Hit Star. The goal is to shoot all stars at the top of the screen. You can do that with two space ships on the left and right side. Use your joystick to move left and right to trigger both ships. When ships collide, the missile is fired. Let's see how many shoots do you need to remove all the stars. Link to the source book Greetings hit_star.zip hit_star.xex Edited June 18, 2017 by Gury 1 Quote Link to comment Share on other sites More sharing options...
devwebcl Posted June 19, 2017 Share Posted June 19, 2017 It would be nice to have a single page where are all these Mad games (imho) Quote Link to comment Share on other sites More sharing options...
+CharlieChaplin Posted June 21, 2017 Share Posted June 21, 2017 It would be nice to have a single page where are all these Mad games (imho) Well, Adam created it for you: http://www.atarionline.pl/v01/index.php?subaction=showfull&id=1497991734&archive=&start_from=0&ucat=1&ct=nowinki&action=new_product_preview&%3Bsa=U&%3Bved=0CEAQFjAO&%3Busg=AFQjCNEfYOFRSBBctNbFmeEiJkLZH3sLWg%2F%2Findex.php%3Foption%3Dcom_jce&PHPSESSID=d1bf6855f71b1dd3549a62fc9b22d608 at least for now... 1 Quote Link to comment Share on other sites More sharing options...
Gury Posted June 25, 2017 Author Share Posted June 25, 2017 Hello, Today I represent you a game full of adrenalin. Why? Because you must save your planet from enemy attack from outer space. You have to bring four space ships to safe place to prepare them for a fight against the enemy. But, there is always a but... you must do this very quickly, because time is not your friend. Hurry up, hero, defend your planet. Enjoy! Gury galactica.xex galactica.zip 2 Quote Link to comment Share on other sites More sharing options...
tebe Posted August 13, 2017 Share Posted August 13, 2017 (edited) https://gitlab.com/bocianu/PacMad http://mimuma.pl/PacMadEditor/ Edited August 14, 2017 by tebe 5 Quote Link to comment Share on other sites More sharing options...
xxl Posted August 13, 2017 Share Posted August 13, 2017 (edited) Hi-Score Cafe: http://xxl.atari.pl/hsc-pac-mad/ Pac-Mad hi-score table banner: <img>http://atari.pl/hsc/hsc.php?i=1.104</img> player: <img>http://atari.pl/hsc/ad.php?i=1.104</img> Edited August 13, 2017 by xxl 1 Quote Link to comment Share on other sites More sharing options...
+MrFish Posted August 14, 2017 Share Posted August 14, 2017 https://gitlab.com/bocianu/PacMad Nice game. I have a hard time rolling without the "munch" sound, though. Possible to add in? Quote Link to comment Share on other sites More sharing options...
devwebcl Posted August 15, 2017 Share Posted August 15, 2017 Nice game. I have a hard time rolling without the "munch" sound, though. Possible to add in? The ghost may have a little more AI Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.