Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : CMM game: PTETRIS
Author | Message | ||||
ceptimus Senior Member Joined: 05/07/2019 Location: United KingdomPosts: 130 |
PTETRIS.zip Another Tetris for the Colour Maximite. This one has a few extra features familiar to Tetris players such as wall and floor kick, ghost piece, hold piece, a high score table etc. And it has the 'correct' colours, as far as I could manage, and runs in mode 3! If you want music you must copy the PTETRIS.MOD file to your internal A: drive copy "B:PTETRIS.MOD" TO "A:PTETRIS.MOD" If anyone has some better Tetris music (Korobeiniki) .MOD file that fits in the A: drive, please let me know and I'll include that one instead. The one in this first .zip file I downloaded from an on-line archive of .MOD files - it's not my work. The code I wrote myself - my first program for the CMM. Thanks for the inspiration from 'The 8-Bit Guy', David Murray, from whose YouTube channel I learned of the existence of MiniMites and MaxiMites about a month ago. |
||||
ceptimus Senior Member Joined: 05/07/2019 Location: United KingdomPosts: 130 |
The P is silent, by the way: like in pterosaur, pterodactyl, Ptolemy, Psmith, and ptarmigan. |
||||
Poppy Guru Joined: 25/07/2019 Location: GermanyPosts: 486 |
Great! Really nice work! Just let the program copy the MOD-File by itself adding (I did on the first line): Copy "PTETRIS.MOD" To "A:PTETRIS.MOD" Andre ... such a GURU? | ||||
ceptimus Senior Member Joined: 05/07/2019 Location: United KingdomPosts: 130 |
Thanks! I did consider auto-copying the .mod file, but it's complicated: the mod file might already be present on A: or there might not be enough room for it due to other files there, or maybe the user doesn't have a speaker or earphones, or she doesn't like music. Also the screen goes blank when copying to or deleting from the A: drive which is potentially disconcerting for some users. |
||||
Poppy Guru Joined: 25/07/2019 Location: GermanyPosts: 486 |
I tested it and it did not disconcert me at all. But you are right, if "A:" is already full then for a naive user (just like myself right here: https://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=8423#138449 ) it could be somehow disturbing. What about a little check up before starting the game, asking the user if he wants music at all and consequently looking it up for being already on A: or not?!? Keeping read/write cycles low on A: does also extend the PICīs lifespan I assume, so if not being really necessary it should generally not be copied. Andre ... such a GURU? | ||||
MauroXavier Guru Joined: 06/03/2016 Location: BrazilPosts: 303 |
It would be great if MMBasic accepts such a command as ERASE "A:*.*" or at least another command to read free space from a drive letter. |
||||
Poppy Guru Joined: 25/07/2019 Location: GermanyPosts: 486 |
I think I was a little too fast considering, still mixing MMBASIC too much up with MSBASIC including SHELL commands. But I also thought of constructing something with the "MM.ERRNO", but now I see that this is just related to the SD-Drive. If A: is fully charged and nothing else more fits into it then a complete purge would be great, but could it be possible to read out each individual filename from A: into a variable and then kill it one after another? Andre ... such a GURU? | ||||
MauroXavier Guru Joined: 06/03/2016 Location: BrazilPosts: 303 |
I tried to use these approaches in the past but doesn't work on A: drive (see the code on Boulder Dash). If the A: is full, in the middle of a file copy inside a Basic program it crash the system. |
||||
MauroXavier Guru Joined: 06/03/2016 Location: BrazilPosts: 303 |
I played it now and liked a lot! Very good port! Let's increase the game library of CMM! I must work in three titles in my vacation: - Gauntlet - Boulder Dash - Tunnel 4B (this I not published yet). @ceptimus, if you think it's a good idea, I can send to you the last PSGLib with some tetris musics in VGM type to be played in a SN76489, with this you can call the library and play VGM musics, using PWM sounds to play SFX. With the newer PSGLib you can choose some sound implementations: - PSG Musics + PWM SFX - PWM Music (The PSGLib can play VGM files from PSG in native PWM without using a SN76489 but with only two channels and with poor sound quality) - PWM SFX only - MOD Music only (it's the current sound of your game) - MOD SFX only |
||||
Poppy Guru Joined: 25/07/2019 Location: GermanyPosts: 486 |
I have just been playing some rounds and yes it is still great! Just some thoughts for nice toppings, some sound effects on rotations and hard drops and at last failing a level. A different, smoother music for the highscore-list would be a great contrast, thinking of something like "Commando" on the C64 just as a general example concerning contrast: Main Theme: https://www.youtube.com/watch?v=qrQuR1LHAVI Highscore Theme: https://www.youtube.com/watch?v=La9XUa4iwpE Andre ... such a GURU? | ||||
ceptimus Senior Member Joined: 05/07/2019 Location: United KingdomPosts: 130 |
Thanks. As far as I know, you can't have a mod file playing AND have sound effects at the same time - it's one or the other. I suppose you could get some primitive music playing by encoding lots of tone commands, one for each note, into the program - and then you could have sound effects too. But the music would likely be much more primitive sounding than can be achieved by playing a mod file, and I don't really want to put in the work to try it! The different music for the high score list is a great idea. I've found a couple of minor bugs so I can fix those and add the different music for the next release. I've been working on a Manic Miner conversion for the MaxiMite since I uploaded PTETRIS. I've not hit any insurmountable problems, yet. Edited 2019-08-08 02:49 by ceptimus |
||||
Poppy Guru Joined: 25/07/2019 Location: GermanyPosts: 486 |
Yes, you are right, only one single MOD can be played. But what about changing the Toggle ("M") not to switch between music and silence but between music and sound effects separately. After a while the music could get annoying to some players and they probably would prefer some explicit sounds then. Andre ... such a GURU? | ||||
MauroXavier Guru Joined: 06/03/2016 Location: BrazilPosts: 303 |
If you allow me I can use the PSGLib to put some musics in PTETRIS with a little configuration screen: - Native MOD (your original code) - Native PWM only (ZX Spectrum 48k style) - SN76489 + PWM SFX (SEGA Master System style) The PSGLib has some rotines that can play VGM files using native squared waves from the CMM, and yes, it's like you said, it's primitive but I think it's a interesting option. If you allow me, I can do it in this weekend and post here the source, and obviously, I wouldn't change other things nor remove your credits. PS.: Would be great to see a Manic Miner conversion to the CMM! |
||||
ceptimus Senior Member Joined: 05/07/2019 Location: United KingdomPosts: 130 |
Thanks Mauro! I've attached the latest version (V0.9a) which has some (very small) bug fixes. I think the main one was that the game now exits straight away when you press Esc, rather than going via the High Score screen. Beware that memory seems tight for the main PTETRIS.BAS program - the program is actually pretty small, but it does run in Mode 3 which uses up lots of RAM, and I guess the sprites and arrays tip it over the edge. I know I saw memory errors a few times while developing it, and that's why I separated out the High Score table, and the Sprite creation program (which now gets chained unless the PTETRIS.SPR file has already been created by a previous run). And I also removed almost all the comments - which is a shame as it makes the program harder to understand now - even for me! Please don't think you have to do the sound enhancement thing - if you run into problems or get bored with it, please feel free to give up! A trick I'm using in my Manic Miner conversion is to mimic byte arrays using peek and poke. You dim an array, say A, one quarter of the size you need (because the array uses 32-bit elements) and then access the 'byte array' using peek and poke with VAR A(0), offset. I suppose the array(s) in PTETRIS could be changed to work that way if we need to save a little memory. PTETRIS.zip Edited 2019-08-08 17:15 by ceptimus |
||||
MauroXavier Guru Joined: 06/03/2016 Location: BrazilPosts: 303 |
I use always mode 4 exactly to keep more memory available... The Gauntlet and even the MStudio got me headaches to fit the program in the RAM. I had several errors until achieve the currently state. I most often load and unload libraries as needed and in the MStudio I clear all variables in many parts of the code to clean RAM, like a "garbage collector", but with this I loose the cursor position in some situations (a fix is coming). The array manner that you was talking about breaking a 32 bit element to four 8 bit parts is very like the developing in NES when the programmers need to pack some RAM, they break 8 bit elements in two 4 bit parts. Hum... You reminded me about this trick and can be very useful, I will try to adapt some Gauntlet and Mstudio sources to use it. Well, I will try to bring some new sounds to your game, although it would be possible to use the mode 4 with beatifull background screens like the arcade Tetris, but I don't want to change your original source code (this is the challenge!). |
||||
ceptimus Senior Member Joined: 05/07/2019 Location: United KingdomPosts: 130 |
I recorded a YouTube video of part of a game. https://youtu.be/0uvgsF6p7wo |
||||
Turbo46 Guru Joined: 24/12/2017 Location: AustraliaPosts: 1593 |
Regarding saving memory: Have you considered using TassyJim's MMEdit? You could use the 'Crunch' facility to remove all comments and unnecessary spaces. There is also a "Auto Crunch on load' setting to automatically crunch a program when loading (as it says). Bill Keep safe. Live long and prosper. |
||||
MauroXavier Guru Joined: 06/03/2016 Location: BrazilPosts: 303 |
I thinked to use the MMEdit, but I like so much to program directly in the Colour Maximite, for me it's a nostalgic retro feeling that I can't put aside. This is the cause that lead me to the creation of the Mstudio, to make the sprites, maps and almost all things directly on the CMM without the use of the PC, and in the future I intend to include a bmp editor and a music creator for the SN76489. |
||||
Poppy Guru Joined: 25/07/2019 Location: GermanyPosts: 486 |
If anyone wants to make a new version for the CMM2, what about THIS? Andre ... such a GURU? | ||||
Print this page |