======================================== SUPER MARIO FRUIT MACHINE 2 For 128K Spectrum models by Jim Waterman 29 July - 8 August 2021, for CSSCGC 2022 In .TZX, .DSK, .MGT and .TRD formats! ======================================== Loading from disc - notes ------------------------- The .MGT and .TRD versions of this game are, in effect, extra bonuses - and I find both to be a bit stroppy when it comes to the use of PEEK 23611 to check if the Spectrum is in 128K mode or not. If there is a beep accompanying the "Epic Fail" message (made by a PLAY command), then there is no epic fail at all - just run the program again (select 128 BASIC if you need to do so) and it'll work. The tape and +3 disc don't have this problem, but then, they have no need for extraneous add-ons. Select 128 BASIC and type RANDOMIZE USR 15619: REM: LOAD "boot" to make the .TRD version work on a normal 128K Spectrum that isn't a Pentagon or Scorpion. Fuse can do this. Both .MGT and .TRD will fail on a +2A as this game intentionally uses the internal RAM disc, and these versions only contain the code for the 128K and +2 (i.e. LOAD !"file" rather than LOAD "M:file"). Introduction ------------ As with Corona Capers in 2020, this game is dedicated to the memory of Jim Langmead, the host of the 2004 CSSCGC. 2004 was the first year I ever entered the CSSCGC, and the original Super Mario Fruit Machine was one of the games I sent him to review. Of course, he wasn't impressed - it's a Crap Game after all, and was intentionally generic. All I was doing was showing off the battery of user-defined graphics I'd ripped from various Mario games in the early days... and this was, I thought, a perfect vehicle to do so. But I was never quite satisfied with the end product. At the time I never worked out a way to make the drums actually *move* like a real fruit machine, I just hid them behind colour-circling blinds and shoved three random symbols on the screen afterwards, assessed whether or not the line had won and that was your lot. There was a fair bit of music and sound effects ripped from Super Mario Bros. and delivered via PLAY statements, just to keep it somewhat interesting. For my return to Crap Game programming in 2020 I had to tackle the problem of moving drums for the Casio MG-777 Games suite - Game II was a very rudimentary fruit machine that a calculator from 1981 could handle, so how hard could it be? Tricky, but I managed to get it working just the way the calculator did. So I intended to use that same game mechanic and translate it to a new version of Super Mario Fruit Machine. While writing the program it soon became obvious that this was the wrong approach, and actually the drums should be kept small and rotated by a random amount, rather than rotating them by a fixed amount and sending random symbols into the drum on each spin, the way Game II worked. It took six days, on and off, to get a working version going entirely in BASIC (i.e. that can be saved as a .BAS file and will run on BASin, with all the graphics and other code defined within the listing), and then another day and a bit to embellish it with a bit of rudimentary machine code, just to speed it up a bit (and I do mean, a bit). Playing the game ---------------- Press any key to start the game and listen to the wonderful Overworld Theme from Super Mario Bros. 2 - I thought it appropriate to pick the music from the second game in the NES Mario series (that *isn't* the second game in Japan, even though I've splattered Gratuitous Japanese all over this game, but it is the one *we* know). ONE KEY ON THE KEYBOARD will unleash an EXTRA-SPECIAL SECRET VERSION of this game, with completely changed music and graphics, as well as a few other tweaks. Can you find it without examining the listing? Press any key to spin the drums - or Q to quit if you've had enough and want to walk away with your winnings, or cut your losses. Seeing as this is a game based on Japanese characters, your amount of money is shown in yen (because I realised US dollars in the original was a terrible oversight). Each spin will cost you ¥10, and winning lines pay out the following: Two (L&M): All three: Mushroom ¥20 ¥40 Flower ¥30 ¥60 Star ¥40 ¥100 Leaf ¥50 ¥200 P-Wing ¥80 ¥500 The chances of a payout are far better than they were on the original, where you'd have an 86.3% chance of losing and 0.0048% chance of hitting the jackpot (which would happen, on average, every 20,833 spins!). This time, there is a 77.5% chance of losing and a 1% chance of hitting the jackpot. Don't get too excited, though, because I didn't include any flashy routines if you do - except that there is something unique to the jackpot in the EXTRA-SPECIAL SECRET VERSION of the game. Hashtag gambleaware and all that malarkey aimed at those who can't control themselves. Roll of Honour -------------- - Koji Kondo, for writing all the music in the first place. - Dave Hughes, for the "Flash Dance" program in WOOT! Tape Magazine 2020, used to create the loading screen. - See the Development Log for links to these three: = "bowserjr14", for writing the piano score for Super Mario Bros. 2 so I could convert it to PLAY statements. = Col. G.L. Sicherman for the version of the SMB2 Overworld Theme - which had mistakes that I had to correct, but at least it was written so that I could easily convert it to compound time (i.e. 2:1). "bowserjr14" merely writes "Swing" above it - I know what that means, but it's easier when I can see it already written in the notes! = the unknown author of the "Bold Kana" font on romhacking.net. Development Log --------------- 29 July 2021: - Rehashed the Mario character set from what I'd previously made circa 2003 and used in Super Mario Fruit Machine. - Everything will be held in the character set this time - no UDGs, just POKE 23607,251. - Drew the game screen with the huge Chunk-o-Vision Mario and the mushroom, flower, star round the border. = Chunk-o-Vision screen capture requires 1408 bytes for each screen, hence Mario screen can be stored at 62336. = Free bytes from 65280 to 65367 can be used for short machine code routines, if necessary. - Worked out the overall level of loss-versus-gain on a spreadsheet - attempting to make it somewhat fair (in a way that SMFM2004 really wasn't!) 30 July 2021: - Built the layout of the three drums. - Found some sheet music for Super Mario Bros. 2 World 1-1, apparently Koji Kondo's original score, but clearly with mistakes in it! Corrected the mistakes and turned it into PLAY statements. = Sources for the SMB2 sheet music: https://userpages.monmouth.com/~colonel/videogames/smb2/index.html - Four characters from romhacking.net Bold Kana font added to the custom character set... you'll see why. = Source: https://www.romhacking.net/fonts/115/ - Built the title screen. v0.4 (.bas) loads the character set and data, prints the title screen, plays the intro music. 2 August 2021: - Built a rudimentary BASIC drum-spinning routine that *isn't* copied from Casio MG-777 Game II (and didn't need to be). - Added loss of money on each level and the Game Over. = "Game Over" and other "jingles" from SMB2 piano score: https://musescore.com/bowserjr14/super-mario-bros-2-the-complete-ost-arranged-for-piano 3 August 2021: - Added all the routines to detect winning lines and pay out the appropriate amount - with animation similar to the original SMFM and more of the "jingles" as above. - Added the in-game-quit routine and an assessment of your performance. - Tweaked some of the sound effects. - Added an extra-special celebration for those who break the bank (10,000 yen or more). - Version 0.7a is now effectively a working version of the game (except for the introduction routine being bypassed in line 210). 7 August 2021: - Tested a machine code routine to display the drums faster (though it may not be much faster in reality as it will need to access variables and POKE them into the machine code area first; in fact, the number of POKEs needs to be minimised!). - Found that it will be better to POKE ink colour, POKE column position, POKE first character of four-character square and then have the machine code work out the rest from those three values. Also this will mean there's no need for the array b$, and a$ can be cut in half. 8 August 2021: - Wrote a better machine code routine (not compact but 131 bytes is better than a whole K) to print the drums. Required seven POKEs before the routine can be executed. - With MC: all three drums advance 20 times in 9.1 seconds. With BASIC: all three drums advance 19 times in 10.6 seconds (so the saving is marginal... bah!) - Got shot of the arrays a$ and b$ (see the BASIC version!) as only the first character of a$ is needed with the MC routine. Replaced with a number array d(5) containing the CODEs of a, e, i, m, q - now three drums advance 20 times in 8.4 seconds. Better! - v0.9 (with all the MC routines dropped in where they should be and are working) is the definitive version of the game - just need to bolt on all the extras now! v0.7c has been left as a version of the game that is entirely generated using BASIC. - Created an animated Chunk-o-Vision loading screen that only needs to load the (flashing) attributes. Cheers to Dave Hughes for his Flash Dance program (part of WOOT! Tape Magazine 2020) that was very useful for making in very useful in making the loading screen! - Wrote the initial tape loader, compiled it all together and ironed out all the creases. - Made a disc version... or three. (What's this?) $tr#t% $%&uui ah yF=J a_a`i \ p D64@?5 492C24E6C D6E WE96 +6=52 D6EX H:== 92G6 :ED DA246 C6D6CG65 2E ebfcc] \ $64@?5 +6=52\32D65 r9F?<\@\G:D:@? D4C66?[ DE@C65 2E e_hag] #p|%~! :D 2E e_haf 2E E9:D A@:?E 7@C >6>@CJ 42=4F=2E:@? AFCA@D6D] b_ yF=J a_a`i \ |256 E96 +6=52 ~G6CH@C=5 %96>6 W}t$\32D65X] l D@FC46i 9EEADi^^>FD6D4@C6]4@>^E960:?5:8@\8@0A:2?:DE^D4@C6D^ee`ehbh \ qF:=E E96 +6=52 E:E=6 D4C66?[ 2D A6C E96 QAC@A6CQ |2C:@ D4C66?] b` yF=J a_a`i \ p5565 E96 :?:E:2= QAC6DD + E@ EFC? E96 82>6 :?E@ +6=52 >@56Q H:E9 x}[ 2?5 E96 QD64C6E 5:D4@G6CJQ D@F?5i l D@FC46i 9EEADi^^HHH]?:?D966E>FD:4]@C8^5@H?=@25^A57^`eca a pF8FDE a_a`i \ v2>6 ~G6C EH62<65 7@C E96 D64C6E 82>6] p5565 Q{:76 {@DEQ E96>6] l D@FC46i 9EEADi^^>FD6D4@C6]4@>^E960:?5:8@\8@0A:2?:DE^D4@C6D^ee`ehbh b pF8FDE a_a`i \ |256 2 5:776C6?E 2?:>2E:@? C@FE:?6 7@C H96? E96 +6=52 G2C:2?E A2JD H:??:?8D[ D9@H:?8 E96 4@CC64E E@E2= @7 CFA66D :? E96 2AAC@AC:2E6 4@=@FCD] ~?=J E96 ;246 D@F?5 67764EDi 9EEAi^^HHH]?@AC@3=@]52J;@]@C8^+6=52$@F?5D^{%%!^:?56I]9E>= SECRET STUFF: 29 July 2021: - A second character set (the Zelda set) will have its space reserved at 63744. - Second Zelda-based Chunk-o-vision screen, stored at 60928. RAMTOP is at 60927 at this point for memory calculation purposes. 30 July 2021: - Made the Zelda Overworld Theme (NES-based). = source: https://musescore.com/the_indigo-go_pianist/scores/6616939 - Built the Zelda title screen, as per the "proper" Mario screen. 31 July 2021: - Added the initial "press Z to turn the game into Zelda mode" with IN, and the "secret discovery" sound: = source: https://www.ninsheetmusic.org/download/pdf/1642 2 August 2021: - Game Over tweaked for the secret game. Added "Life Lost" theme. = source: https://musescore.com/the_indigo-go_pianist/scores/6616939 3 August 2021: - Made a different animation routine for when the Zelda variant pays winnings, showing the correct total of rupees in the appropriate colours. Only the jackpot will show the red rupee! - This helped with some sound effects: http://www.noproblo.dayjo.org/ZeldaSounds/LTTP/index.html