New Applesoft BASIC game "Dobble" (AKA "Spot-it") for Apple-1 / ][

7 posts / 0 new
Last post
Offline
Last seen: 18 hours 45 min ago
Joined: May 4 2021 - 06:35
Posts: 178
New Applesoft BASIC game "Dobble" (AKA "Spot-it") for Apple-1 / ][
Dear friends,
I am following up Jader Monari's post on  RetroProgramming Italia - RP Italia (A division of RetroCampus)  FB group to share with you my personal version of the game "DOBBLE" (AKA "SPOT-IT") for Applesoft BASIC for Apple-1 ( and Apple ][ ), hoping you will enjoy it.
 
 
Basically, I have kept the card generation algorithm written by Jader and Prof. M. Ferri from University of Bologna.
All the rest has been rewritten only to have the best possible game-play, even with the notorious super slow and text-only terminal of the Apple-1.
In fact, the differences with the original C64 versions -in keyboard input and screen output- are too many for an efficient adaptation of what Jader wrote.
 
I also modified the storage of generated cards: they do not end up in the dedicated RAM area but instead they go straight into the array that is then used by the game itself.
 
Lastly, I added the possibility to choose the type of game: ‘The Towering Inferno’ or ‘The Well’, and added a page of instructions.
 
The choice of the number-symbol to be played is done by pressing the appropriate alphabetic key (a, b, c, d, e, f, g, h for player A, i, j ,k ,l ,m, n, o, p for player B): unfortunately it is not possible to have the same selection method of the C64 version.
 
I believe the final result is well playable... and fun!
 
Since the final binary file is just over 4kB long, a further downsizing for ‘native 4kB’ INTEGER Basic is not excluded. I think it's quite difficult because - after stripping out arrays and unusable ram - there are ~3kB free, but never say never... volunteers are welcome!
 
You can find everything you need on my usual repository dedicated to new games for Apple-1, but I'm quite confident that the game will run smoothly on many other different Basic:
 
 
If you like, you can also play it on the Apple emulator ][ ( http://www.sblendorio.eu/misc/jsbasic/index.htm ) provided by Francesco Sblendorio, if you don't find it in the drop-down menu list, just copy-paste-Run the .txt  source.
 
Enjoy!  :-)
 
Claudio Parmigiani - P-LAB
 
 
Offline
Last seen: 18 hours 45 min ago
Joined: May 4 2021 - 06:35
Posts: 178
Dobble/Spot-It game now available for Integer Basic 4k!

Hi all,

as “almost promised” I am pleased to share with you the 4K INTEGER BASIC version of “Dobble” (or "Spot-it"), which now runs on non-expanded Apple-1/Replicas as well.

Optimizing the program to stay within the 3456 bytes RAM available was challenging, but well worth the effort.

 

The card array in BASIC, for example, (57 cards, 8 symbols per card for a total of 456 elements) required  456*2+4=916 bytes, which was way too much.

I therefore "carved out" a small area of RAM dedicated exclusively to the cards, without conflicting with the rest of variables and program itself.

In fact, in INTEGER BASIC the actual program is stored starting from the last available RAM location going backwards, while variables -whether explicitly or implicitly declared- are stored from the first free location

onwards.

 

I also worked a bit on the pseudo-random number generator -one of the weaknesses of both INTEGER and Applesoft BASIC- because after shuffling the deck the cards always were in the same sequence.  

 

This was even more challenging since the RND function here works in its own way and there is no “seed” feature.

The solution involves randomly generating pseudo-random numbers for a variable amount of time at the beginning of each game to “move the number sequence forward.”

 

This occurs at the choice of game type: the keypress wait loop for the player's selection continues to call the RND function until a choice is made.

Thanks Francesco (as usual) for the suggestion.

 

This method also works with Applesoft BASIC, but on Apple ][ a clever trick -that uses the contents of two memory locations related to the keyboard  as initial seed- can be used.

However, in the Apple-1 variant of Applesoft BASIC this does not work because the handling of the keyboard and related events are different.

So I have adopted the same solution of INTEGER Basic and upgraded the program: update it if you have already downloaded it.

 

As always, all the material is available for download from the dedicated page:

https://p-l4b.github.io/angela/

 

 

If you want to discover more about how variables are stored in memory in INTEGER Basic, take a look here:

https://retroprogramming.it/2020/04/storage-of-variables-in-apple-1-integer-basic/

 

Enjoy! :-)

 

Claudio - P-LAB

 

 

Offline
Last seen: 5 hours 46 min ago
Joined: Oct 4 2021 - 05:31
Posts: 73
This is a great game Claudio,

This is a great game Claudio, thanks for it. I have it working on my replica, however it does not seem to work in the online js emulator (https://www.scullinsteel.com/apple1/). There it shuffles the cards and displays them, but when you hit a key / letter it does nothing. On my replica this works fine. Strange, I attached the turbo wozmon file, which you can copy paste over to the emulator or Apple-1.

 

Plain text icondobble.tur_.txt

 

Offline
Last seen: 18 hours 45 min ago
Joined: May 4 2021 - 06:35
Posts: 178
Thank you! :-)Yes, I was

Thank you! :-)

Yes, I was aware of that: apparently, the website emulation of the PIA behaviour is not 100% accurate.

Have you tried Windows "Pom-1" emulator? Honestly, I don't remember if I tried it and what were the result...

 

Regards,

Claudio - P-LAB

Offline
Last seen: 18 hours 45 min ago
Joined: May 4 2021 - 06:35
Posts: 178
Working with POM-1 Emulator

Ok, I've just tested the INTEGER BASIC version, taken from my repository https://p-l4b.github.io/angela/ with the good old POM-1 emulator, and it works:

I still think that there might be something wrong with that specific emulator... ;-)

 

Regards,

Claudio - P-LAB

 

 

 

 

Offline
Last seen: 5 hours 46 min ago
Joined: Oct 4 2021 - 05:31
Posts: 73
Thanks Claudio. Did you also

Thanks Claudio. Did you also test it in the Pom1 with the TurboType source I posted? Then indeed it is an emulator specific thing. Not to worry about, but just letting you know.

Offline
Last seen: 18 hours 45 min ago
Joined: May 4 2021 - 06:35
Posts: 178
Yes, I just tried and

Yes, I just tried and unfortunately it didn't work.

 

The dump you gave me seems to include other things beyond the BASIC program itself like: zero page, stack...

I tried to load it as-is but it hangs the emulator.

 

I've also tried to load just the INTEGER BASIC part (the usual zero page 4A.FF, plus the segment from 280 and on) but it hangs, too.

 

If there is something else you want me to test, feel free to ask!

 

Regards,

Claudio - P-LAB

 

Log in or register to post comments