Items related to MSX Assembly: Z80 code on the MSX1, measured on the...

MSX Assembly: Z80 code on the MSX1, measured on the machine: two complete games, and every screen photographed (code&books) - Softcover

Book 5 of 17: code&books

Deshmukh, Aravind J.; Radclyffe, Henry

 
9798164813321: MSX Assembly: Z80 code on the MSX1, measured on the machine: two complete games, and every screen photographed (code&books)

Synopsis

On the MSX, the picture is not in the processor's memory. It lives in sixteen kilobytes that belong to the video chip, and the processor reaches them only through a pair of ports, a byte at a time, at a speed the video chip decides. This book teaches Z80 assembly language on the MSX1 by facing that fact head on, and it measures what it claims.

It begins before the beginning. Chapter 2 explains binary and hexadecimal; chapter 4 installs the sjasmplus assembler, the openMSX emulator and C-BIOS on Windows, macOS and Linux; Part II teaches the Z80 one family of instructions at a time and prices each in T-states, with the wait the MSX adds to every opcode fetch. Along the way it builds two original games, from the first line of a specification to a cartridge.

What you will learn

  • The Z80 language: registers and flags, every addressing mode, arithmetic and BCD, logic and shifts, the stack, block instructions, the index registers, the undocumented instructions, the assembler, and the BIOS as a library.
  • The VDP: an interrupt of your own, a frame of 313 or 262 lines of 228 T-states, two ports and eight registers, the access slots and the 29 T-state loop, the screen modes, Graphic II and colour clash, tiles, hardware sprites and flicker, software sprites, scrolling, fonts, fast transfers to VRAM, racing the beam.
  • A game machine: the frame loop at 50 and 60 Hz, keyboard and joysticks, the PSG and a music and effects engine that runs from the interrupt, slots and memory, collisions, score, random numbers, game states and the frame budget.
  • Two complete games: GRIN ALLEY, a single-screen arcade game in which a runner crosses four alleys of faces to pick up gems, and LANTERN KEEP, a keep of sixteen rooms with thirty-two lanterns to light and twenty-eight guards on their rounds. Appendices K and L print their complete sources, commented.
  • Beyond the 32 KB cartridge: mappers and a 128 KB cartridge, drums and voices through the PSG, tape and disk, one cartridge on twenty-two machines, optimisation.
  • Releasing your work: compression into VRAM, title screens and demo mode, testing on real hardware, ROM files, EPROMs and labels.

Every screen is real

The book has 219 figures, and 202 of them are frames captured from the openMSX emulator while it ran a program from the book's repository, which the caption names. No screen was drawn or redrawn. Every number in the book was measured on openMSX by a program written to produce it, and chapter 55 gives you a cartridge that measures, on a real MSX, the things an emulator may get wrong. A verification program reassembles every program and compares it, byte for byte, with the cartridges the book was photographed from. The code is free to use under the MIT licence.

Learning from the broken screen

Fifty-seven boxes called Where it breaks take a mistake and show what it does to the machine; fifty called Count the T-states work out what a routine costs; and each of the fifty-six chapters ends with a Workshop, whose answers are in appendix I.

Inside

  • Seven parts, fifty-six chapters and thirteen appendices
  • The Z80 instruction set with T-states measured on the MSX, the undocumented Z80, every register and port of the VDP, the PSG and the PPI, Graphic II address tables, and the BIOS entry points the book uses
  • A sjasmplus and openMSX command reference, troubleshooting by symptom, a glossary with five reading paths, and an index

Who it is for

Readers who have never written assembly language, programmers who know another processor and want the MSX's timing, and MSX veterans who want the numbers measured rather than remembered.

Printed in black and white. Appendix E measures each of the MSX's fifteen colours and the grey this book prints it in.

"synopsis" may belong to another edition of this title.