The Memotech MTX Series
MTX / Z80 Assembly Language
Paul Daniels is working on an Assembler environment for the MTX
under Windows, but it should also work under Linux
anyone has any ideas or code that would be useful when
writing games please let Paul know via the
Memorum forum thread
The shell takes over the machine, setting
up its own VDP interrupt, scans for the joystick and
incorporates PSGLib. Compiling a bit of code should be as easy
as editing the main_assem.z80 file and
then typing "nmake". The
command is usually provided by Microsoft's free C compiler.
Make files are used to simplify the process.
There is an env.bat file which sets up the path for
mtx2bas. Update as
There is a make file to generate a MAIN.mtx
|There is a user
defined section in the Make file :-
|Builds a 48Kb image for MTX512
|Builds a 32Kb image for MTX500
|Compiles the code so that it is
loaded at $4100 or $8100
|Compiles the code as part of a
|Don't auto-start the program
|Auto-start the program
To use sprites, a table at
VDP_SPR_TAB is used to hold the Sprite Attributes. This differs
from the VDP sprite attribute table in that the horizontal
coordinate is 16bit. The other change is vertical sprite
coordinates are from 0 to 208 and horizontal coordinates from 0
Coordinate 0 is 16 pixels before the actual
screen so the sprite will not be seen. Coordinate 16 is the
first pixal on the screen. likewise vertical coordinate 208 will
put the sprite below the screen and 272 to the left of the
screen. This should allow easy placement of sprites for bleed-in
from the edges.
Another variable, VDP_SPR_CNT, holds the
number of sprites to process. This is reset after every
interrupt. The VDP Interrupt handles the conversion to
coordinates required by the VDP, e.g. Early Clock.
MEMU - For testing
MTX2BAS - A
program to convert .mtx, .sdx and .run files to text
PSGLib - Z80
ASM library (and C conversion/compression tools) to allow
replay of VGMs as background music/SFX in SEGA 8 bit
Put Events into own library.
Triggered event returns
event number in A reg
Add zx7 decompression to RAM.
Added macros :
VDP_SETVDPINT, VDP_SETNAMPOS_W, VDP_SETNAMPOS_R,
VDP_WRITE_A, VDP_WRITE_N, VDP_READ_A, VDP_FILL_A,
VDP_WRITE_STR, SCO_INIT, SCO_PRINT, SCO_ADDVAL,
SCO_ADDHI Added VDP_WRITE_FF.
functions in header files.
Add defines for VDP
graphic type, sprite size and mag.
Add defines for
Also includes the game
Head On, as demonstrated at
Released at Memofest 2016
WLA-DX Libraries now
Improved WLA-DX memory mapping.
Added ZX7 decoder by Einar
Saukas & Urusergi.
ZX7 updated by Daniel Bienvenu
for VRAM decompression.
Added 61Hz CTC interrupt.
Renamed JOY_READ to JOY_ISR.
Added simple Event
Added EVT_UNSET to remove given event.
Updated VDP to allow for other interrupt sources.
Constants for VDP registers now using values from
Replace VDP_CLRNAM with VDP_FILL
Swapped hl & de register usage for VDL_LDIR
to match ldir.
Added VDP_SETFONT routine.
Change Log (Now included in the archive file)
Licence added -
Pass initial paper/border colour to
Change PAYLOAD to use CODE and BASIC.
Change MTX512 and MTX500 to be MACHINE=MTX???.
Change AUTOSTART to be YES or NO.
User code now
appears in usercode.z80.
Change VDP_SPR_CNT to be a
pointer, not a table.
New lib_stdlib.inc file with
standard library functions.
Add random number
generator, a CMWC from WOS by Patrik Rak.
256 char font from a 768 char font.
Demo of Events to bounce skull around screen
and change colour.
Single Project which can build
either 32kb or 48kb images.
Code payload can be
included as part of BASIC or loaded afterwards.
Ability to Auto-start.
Interface to VDP sprites.
Demo of 32 sprites being moved by Joystick or numeric
keypad, showing how sprites can hide behind the borders.
The memory model is now determined
by a variable in the Makefile
Started to use
headers and include files for the libraries (a la "C")
The font used is apparently the
Namco arcade one. The Code project uses the music from
the first level of
Sonic the Hedgehog, the Basic project uses the music
Rainbow Island (I think).
VDP interrupt based.
2. Joystick sensing.
3. PSGLib providing interrupt
VGM music and effects
|Initial release 02/11/2015