I have a number of books on Z80, this is the code for the first of those, titled 'ZX Sepctrum Assembly. Let's make a game?'
THIS IS A BRAND NEW BOOK, IF THIS CODE LOOKS INTERESTING, PLEAE BUY IT AND SUPPORT THE AUTHOR
The book walks you through creating 3 games, Pong, Space Shooter and Tic Tac Toe, all in Z80 assembler. This is just my type-in code. It won't be exactly the same, I may have worked out and applied some small changes as I've gone along but it's going to be pretty similar, at least so far.
The code comments will not be at all similar. They're mine and reflect my understanding of the code.
Seriously, buy the book. Its really very good!