(classic) New target: Mitsubishi Multi8

Post Reply
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

(classic) New target: Mitsubishi Multi8

Post by dom »

Another day, another new target, this one is quite special though:

* Z80 @ 3.993600 Mhz
* 64k RAM, 32k ROM + 2K chargen
* VDP: HD46505 (m6845 clone), 48K VRAM total
* Audio: AY-3-8192 on ports 0x18 and 0x19
* Wiki: https://github.com/z88dk/z88dk/wiki/Pla ... shi-Multi8

The machine can in theory run CP/M, and as such is already supported. But, relying on CP/M is cheating!

The information on the machine is very, very sparse - the Mame emulator is non-functional, but Takeda has an emulator and some hardware notes. There's a mention on comp.os.cpm from 1998 suggesting that only 1000 of these machines were built.

The port is fairly bare bones at the moment, the generic console is up and running along with some keyboard interaction - the hardware doesn't support multiple keypresses unfortunately.

I'm planning on adding support for graphics, 80 column mode, sound and tidying things up.
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

well done! I'm very excited for the many new targets you are adding to z88dk! Please try analysing the rom with an updated version of basck, it should greatly help in finding the useful pieces of code in a rom disassembly
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

I tested BASCK on the MULTI-8 ROM and I noticed it is not able to spot the keywords and the jump tables, I'll try to fix it.

Here's what it is able to find at the moment.


# Microsoft 8080/Z80 BASIC found
# Extended BASIC detected
# Double precision maths detected
# Microsoft signature found


BASTXT = $F19F ; BASIC program start ptr (aka TXTTAB)


# CPDEHL (compare DE and HL), code found at $12FF
# (Detected position for ORG: 0)

INPORT = $F08B ; Current port for 'INP' function
OTPORT = $F053 ; Current port for 'OUT' statement
SEED = $F067 ; Seed for RND numbers
LSTRND2 = $F088 ; Last RND number
BUFFER = $F2D0 ; Start of input buffer
TMSTPT = $F6CF ; Temporary string pool pointer
TMPSTR = $F6EF ; Temporary string
NXTOPR = $F713 ; Address ptr to next operator
CURPOS = $F513 ; Character position on line (TTYPOS on Ext. Basic)
LPTPOS = $F193 ; Character position on printer
PROGND = $F719 ; BASIC program end ptr (aka VARTAB)
VAREND = $F71B ; End of variables
ARREND = $F71D ; End of arrays (lowest free mem)
SGNRES = $F825 ; Sign of result
TEMPST = $F6D1 ; (word), temporary descriptors
TEMPPT = $F6CF ; (word), start of free area of temporary descriptor
PRMLEN = $F73D ; (word), number of bytes of obj table
NOFUNS = $F80E ; (byte), 0 if no function active
PRMLN2 = $F7A5 ; (word), size of parameter block
FUNACT = $F811 ; (word), active functions counter
PRMSTK = $F73B ; (word), previous block definition on stack
SUBFLG = $F6FC ; (byte), flag for USR fn. array
TEMP = $F6FE ; (word) temp. reservation for st.code
SAVTXT = $F706 ; (word), prg pointer for resume
TEMPST = $F6D1 ; (word), temporary descriptors
TEMPPT = $F6CF ; (word), start of free area of temporary descriptor
CURLIN = $F19D ; (word), line number being interpreted
OLDLIN = $F715 ; (word), old line number set up ^C ...
SAVTXT = $F706 ; (word), prg pointer for resume
OLDTXT = $F717 ; (word), prg pointer for CONT

HALFPI = $400C ; Half PI constant ptr
HALF = $3DA5 ; Constant ptr for 0.5 in FP
UNITY = $3166 ; Constant ptr for number 1 in FP
LOGTAB = $316A ; Table used by LOG

FPREG = $F821 ; Floating Point Register (FACCU, FACLOW on Ext. BASIC)
FPEXP = $F824 ; Floating Point Exponent
DBL_FPREG = $F821 ; Double Precision Floating Point Register (aka FACLOW)
DBL_LAST_FPREG = $F82D ; Last byte in Double Precision FP register (+sign bit)

CPDEHL = $1300 ; compare DE and HL (aka DCOMPR)
FNDNUM = $2B2D ; Load 'A' with the next number in BASIC program
GETINT = $2B2E ; Get a number to 'A'
DEPINT = $2B15 ; Get integer variable to DE, error if negative
FPSINT = $2B11 ; Get subscript
GETVAR = $20E4 ; Get variable address to DE
CHKSTK = $0DFF ; Check for C levels of stack
OPRND = $1E9A ; Get next expression value
SYNCHR = $130D ; Check syntax, 1 byte follows to be compared
LFRGNM = $29A1 ; number in program listing and check for ending ')'
HLPASS = $348B ; Get back from function passing an INT value HL
MIDNUM = $29A6 ; Get number in program listing
INT_RESULT_A = $32FD ; Get back from function, result in A (signed)
INT_RESULT_HL = $3451 ; Get back from function, result in HL
UNSIGNED_RES_A = $2499 ; Get back from function, result in A

GETYPR = $2080 ; Test number FAC type (Precision mode, etc..)
TSTSGN = $32C3 ; Test sign of FPREG
_TSTSGN = $3304 ; Test sign in number
INVSGN = $32F2 ; Invert number sign
STAKFP = $3316 ; Put FP value on stack
NEGAFT = $3E51 ; Negate number
LOG = $3177 ; LOG
SQR = $3E56 ; SQR
POWER = $3E61 ; POWER
EXP = $3EA8 ; EXP
COS = $3FC2 ; COS
SIN = $3FC8 ; SIN
TAN = $4029 ; TAN
ATN = $403E ; ATN
DBL_ABS = $3652 ; ABS (double precision BASIC variant)
RND = $3F4F ; RND
SUBCDE = $3083 ; Subtract BCDE from FP reg
FPADD = $3086 ; Add BCDE to FP reg
SCALE = $3145 ; Scale number in BCDE for A exponent (bits)
PLUCDE = $3125 ; Add number pointed by HL to CDE
COMPL = $3131 ; Convert a negative number to positive
PHLTFP = $3323 ; Number at HL to BCDE
FPBCDE = $3326 ; Move BCDE to FPREG
ADDPHL = $307B ; ADD number at HL to BCDE
SUBPHL = $3080 ; SUBTRACT number at HL from BCDE
MLSP10 = $32AC ; Multiply number in FPREG by 10
FPMULT = $31B5 ; Multiply BCDE to FP reg
DIV10 = $3205 ; Divide FP by 10
DIV = $320E ; Divide FP by number on stack
DVBCDE = $3210 ; Divide FP by BCDE
DCBCDE = $34DA ; Decrement FP value in BCDE
BCDEFP = $3331 ; Load FP reg to BCDE
LOADFP = $3334 ; Load FP value pointed by HL to BCDE
SHRITE = $3152 ; Shift right number in BCDE
CMPNUM = $3380 ; Compare FP reg to BCDE
FPINT = $34B6 ; Floating Point to Integer
FLGREL = $32D2 ; CY and A to FP, & normalise
SUMSER = $3F09 ; Evaluate sum of series
INT = $3500 ; INT
DBL_SUB = $3678 ; Double precision SUB (formerly SUBCDE)
DBL_ADD = $367F ; Double precision ADD (formerly FPADD)
DBL_DIV = $37EC ; Double precision DIVIDE
FIX = $34E1 ; Double Precision to Integer conversion
INT_MUL = $35B2 ; Integer MULTIPLY
MLDEBC = $356A ; Multiply DE by BC
ASCTFP = $3873 ; ASCII to FP number (New version)
DBL_ASCTFP = $386C ; ASCII to Double precision FP number
PRNUMS = $2713 ; Print number string
PRS = $2714 ; Create string entry and print it
PRS1 = $2717 ; Print string at HL
STR = $26A1 ; STR BASIC function entry
SAVSTR = $26AA ; Save string in string area
MKTMST = $26C2 ; Make temporary string
CRTMST = $26C5 ; Create temporary string entry
SSTSA = $287C ; Move string on stack to string area
TOSTRA = $2884 ; Move string in BC, (len in L) to string area
TSALP = $2885 ; TOSTRA loop
FOR = $13CB ; 'FOR' BASIC instruction
FDTLP = $1C89 ; Find next DATA statement
DATA = $183C ; DATA statement: find next DATA program line..
RESTOR = $1574 ; 'RESTORE' stmt, init ptr to DATA program line..
CHR = $28DC ; CHR$ BASIC function
MAKINT = $2B31 ; Convert tmp string to int in A register
CONCAT = $2845 ; String concatenation
TESTR = $272A ; Test if enough room for string
TOPOOL = $28E8 ; Save in string pool
TSTOPL = $26EF ; Temporary string to pool
OPNPAR = $1D2C ; Chk Syntax, make sure '(' follows
EVAL = $1D30 ; a.k.a. GETNUM, evaluate expression
EVAL1 = $1D33 ; Save precedence and eval until precedence break
EVAL2 = $1D3C ; Evaluate expression until precedence break
EVAL3 = $1D3F ; Evaluate expression until precedence break
EVAL = $1D31 ; (a.k.a. GETNUM, evaluate expression (GETNUM)
EVAL1 = $1D34 ; Save precedence and eval until precedence break
CRTST = $26D0 ; Create String
QTSTR = $26D1 ; Create quote terminated String
DTSTR = $26D4 ; Create String, termination char in D
GETSTR = $288D ; Get string pointed by FPREG 'Type Error' if it is not
GSTRCU = $2890 ; Get string pointed by FPREG
GSTRHL = $2893 ; Get string pointed by HL
GSTRDE = $2894 ; Get string pointed by DE
TSTSTR = $34AF ; Test a string, 'Type Error' if it is not
ATOH = $1744 ; ASCII to Integer, result in DE

LNUM_RANGE = $100A ; Read numeric range function parameters
LNUM_PARM = $1728 ; Read numeric function parameter
UCASE_HL = $1F6C ; Get char from (HL) and make upper case
UCASE = $1F6D ; Make char in 'A' upper case
OUTC = $0018 ; Output char in 'A' to console

DATSNR = $0E3B ; 'SN err' entry for Input STMT
SNERR = $0E41 ; entry for '?SN ERROR'
FCERR = $1723 ; entry for '?FC ERROR'
ULERR = $181C ; entry for '?UL ERROR'
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

Do we have enough information to build a floating point library for the MS BASIC ROMS? That is, do we know the format and can detect all the necessary entry points?
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

It was my original idea when I developed basck. I think we have enough to work on it, but I discovered that the preferences on the default FP precision for the functions output changed frequently and that the FP format itself evolved in the time, nevertheless it is worth to stub some program in z88dk c or asm to probe the ROMs.

About the multi8, here's the missing information, (I'm updating basck accordingly)... the entry point for PLAY or PSET can be useful:


# JP table relocated in ram, ptr in $F0A4

# JP table for statements = $7808


# TOKEN table position = $7940, word list in 'extended BASIC' mode.
# Token range: 85

# -- STATEMENTS --

# USING [226] - $2D7A
# TAB( [217] - $1AA7
# SPC( [221] - same as TAB(
# + operand [243] - $1E9A
# - operand [244] - $1F4E
# " string [34] - $26D1
# NOT [222] - $206B
# & specifier [38] - $1F7B
# ERR [224] - $1ED3
# ERL [223] - $1EE1
# VARPTR [229] - $1EEF
# USR [219] - $249F
# INSTR [227] - $29AB
# TOKEN_? [235] - $55AB
# TOKEN_? [233] - $51A3
# TOKEN_? [239] - $62E0
# TOKEN_? [234] - $55E3
# TOKEN_? [225] - $28EC
# TOKEN_? [133] - $4F2C
# TOKEN_? [230] - $4FAB
# TOKEN_? [231] - $F8BF
# TOKEN_? [232] - $F8BC
# TOKEN_? [220] - $250F

# ELSE [161]

# AND [248]
# ABS [6] - $32E5
# ATN [14] - $403E
# ASC [21] - $28CC
# AUTO [169] - $194D
# ATTR$ [231]
# BCD$ [30] - $F880
# BEEP [178] - $51C7
# CONSOLE [159] - $7801
# CLOSE [202] - $F895
# CONT [153] - $15FB
# CLEAR [146] - $1766
# CLOAD [155] - $4B57
# CSAVE [154] - $4B08
# CSRLIN [230]
# CINT [31] - $33F3
# CSNG [32] - $3468
# CDBL [33] - $3494
# CVI [35] - $F85C
# CVS [36] - $F85F
# CVD [37] - $F862
# COS [12] - $3FC2
# CHR$ [22] - $28DC
# COLOR [181] - $61A7
# CIRCLE [186] - $67D0
# CLS [188] - $6217
# CMD [179] - $F88F
# DATA [132] - $183C
# DIM [134] - $20DF
# DEFSTR [171] - $16D9
# DEFINT [172] - $16DC
# DEFSNG [173] - $16DF
# DEFDBL [174] - $16E2
# DSKO$ [194] - $F88C
# DEF [151] - $24E9
# DELETE [168] - $2D0D
# DSKI$ [232]
# DSKF [38] - $F8B9
# DEC [29] - $F883
# DATE$ [235]
# END [129] - $15A1
# ELSE [161] - $183E
# ERASE [165] - $1657
# ERROR [166] - $1942
# ERL [223]
# ERR [224]
# EXP [11] - $3EA8
# EOF [39] - $F865
# EQV [251]
# FOR [130] - $13CB
# FIELD [198] - $F87A
# FILES [205] - $F8AD
# FN [220]
# FRE [15] - $2471
# FIX [34] - $34E1
# FPOS [42] - $F8C8
# GOTO [137] - $17EB
# GO TO [137] - $17EB
# GOSUB [141] - $17D3
# GET [199] - $4767
# HEX$ [26] - $269C
# INPUT [133] - $1B58
# IF [139] - $1980
# INSTR [227]
# INT [5] - $34F4
# INP [16] - $2AD5
# IMP [252]
# INIT [212] - $4E84
# INKEY$ [233]
# KILL [207] - $F8A1
# KEY [180] - $555F
# KANJI [184] - $6B9E
# LET [136] - $185C
# LOCATE [213] - $442E
# LINE [175] - $1AF5
# LOAD [203] - $F898
# LSET [208] - $F8A4
# LPRINT [157] - $19B8
# LLIST [158] - $2B3B
# LPOS [27] - $2491
# LIST [147] - $2B40
# LFILES [211] - $F886
# LOG [10] - $3177
# LOC [40] - $F868
# LEN [18] - $28C0
# LEFT$ [1] - $292D
# LOF [41] - $F86B
# LCOPY [193] - $5F76
# MOUNT [196] - $F8B3
# MERGE [204] - $F89B
# MOD [253]
# MKI$ [43] - $F86E
# MKS$ [44] - $F871
# MKD$ [45] - $F874
# MID$ [3] - $2966
# MOTOR [185] - $5211
# MON [183] - $070D
# NEXT [131] - $1CA9
# NAME [206] - $F89E
# NEW [148] - $104E
# NOT [222]
# OUT [156] - $2AE1
# ON [149] - $18C0
# OPEN [197] - $F877
# OR [249]
# OCT$ [25] - $2697
# PUT [200] - $476F
# POKE [152] - $2D4C
# PRINT [145] - $19C0
# POS [17] - $2496
# PEEK [23] - $2D45
# PORT [28] - $4D38
# PSET [177] - $62B3
# PRESET [176] - $62B8
# POINT [239]
# PAINT [187] - $725E
# PLAY [189] - $57CD
# READ [135] - $1BDA
# RUN [138] - $17BB
# RESTORE [140] - $1574
# RETURN [142] - $1821
# REMOVE [195] - $F8B0
# REM [143] - $183E
# RESUME [167] - $190A
# RSET [209] - $F8A7
# RIGHT$ [2] - $295D
# RND [8] - $3F38
# RENUM [170] - $2F21
# RLOAD [192] - $5C42
# STOP [144] - $159C
# SWAP [164] - $1614
# SET [201] - $F8B6
# SAVE [210] - $F8AA
# SPC( [221]
# STEP [218]
# SGN [4] - $32FA
# SQR [7] - $3E56
# SIN [9] - $3FC8
# STR$ [19] - $26A1
# STRING$ [225]
# SPACE$ [24] - $2913
# STATUS [238]
# SRQ [237]
# SOUND [190] - $57AE
# SCREEN [191] - $625D
# TRON [162] - $160E
# TROFF [163] - $160F
# TAB( [217]
# TO [215]
# THEN [216]
# TAN [13] - $4029
# TERM [182] - $5228
# TIME$ [234]
# USING [226]
# USR [219]
# VAL [20] - $2987
# VARPTR [229]
# WIDTH [160] - $44DF
# WAIT [150] - $2AE7
# XOR [250]
# Z
# [+ [243]
# [- [244]
# [* [245]
# [/ [246]
# [^ [247]
# [\ [254]
# [' [228]
# [> [240]
# [= [241]
# [< [242]
#
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

I just made it smart enough to grab the jp table address from similar BASIC variants (PC8001, Multi8..).
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

I've just added hires (640x200) graphics to the +multi8 library. There's also the c_plot() family for the lores blocks.

It's only in black and white at the moment, pixel based colour should be possible but I want to do a bit of a cleanup of the graphics libraries before I add that.
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Post by RobertK »

Thanks for the Multi8 and SPC-1000 targets, both are very interesting machines. My game is already running on the SPC-1000.

On the Multi8, it seems that graphics and text cannot be mixed. In graphics mode, printf() generates some unreadable pattern.

Do you have an idea how to add text output in graphics mode? Maybe using the 4x6 font, like on the VZ200, P2000 or VG5000? Although the letters would be very small on a 640x200 screen.

Here is my updated plot test where I have added only the clg() call for the Multi8 (and a few comments at the top).

BTW, I have already tried c_plot() and c_point() on the Colecovision and it works great, thank you.

Code: Select all

/* plot(), Unplot() and Point() Test by RobertK, 2018-07-06

   Compile command for the following targets:
  
   === ZX81 (64?48) === (ok)
   zcc +zx81 -startup=2 -Cz--disable-autorun -o plottest_ZX81 -create-app plottest.c
   
   === ZX80 (64?48) === (ok)
   zcc +zx80 -o plottest_ZX80 -create-app plottest.c
   Note: point() function was not working yet for this system 
   with 1.99B (calling it made the program crash), since nightly 
   build 2018-03-22 it works correctly.
 
   === Jupiter Ace (64x48) === (ok)
   zcc +ace -lgfxace -clib=ansi -vn -create-app plottest.c -o pt.bin
   Note: with 1.99B plotted points could not be seen, and the 
   point() function returned inverse values -> fixed since nightly
   build 2018-03-28 (-lgfxace option added by Stefano for 64x48)
   Last remaining issue: clearing the screen does not clear the 
   bottom line. Workaround: compiling with the paramter -clib=ansi for 
   VT100 ANSI mode solves the problem.
   Load the program on the Jupiter Ace by typing:
   0 0 bload pt.bin
   
   === Galaksija (64?48) === (ok)
   zcc +gal -vn -create-app plottest.c -o plottest_galaksija.bin   
   Note: on the Galaksija computer type OLD to load a program from cassette.

   === VZ200 / Laser 210 / Laser 110 (128?64) === (ok)
   zcc +vz -lm -pragma-redirect=fputc_cons=putc4x6 -o plottest_vz200.vz plottest.c 
   Note from the z88dk wiki: "The graphics mode is automatically switched on 
   by calling ?clg? or printing CHR$ 12 or calling the vz_mode() function."
   We use clg() in this example.
   Works correctly since nightly build 2018-03-31. Stefano: 
   "The VZ200. Its "operating system" (aka BASIC interpreter) is designed to switch 
   back to text mode as soon as a character is being printed.
   After this nightly build you should have a new function in all the mid and low-rez 
   graphics drivers permitting to output some text in graphics mode.
   You just need to add the following parameter in your zcc command line:"
   -pragma-redirect=fputc_cons=putc4x6

   === TRS-80 (128?48) === (ok)
   zcc  +trs80 -lndos -lm -create-app -o plottest_trs80.bin -subtype=disk plottest.c
   Clearing the screen does not work with 1.99B, since nightly build 2018-03-24 
   this works as well. Use the HT1080Z emulator for testing (select "Autostart file" 
   and open the .cmd file)
   
   === Robotron Z1013 (64?64) === (ok)
   zcc +z1013 -lm -create-app plottest.c -o plottest_z1013
   Note: top line (plotted pixel at 1,1) was not visible with 1.99B, 
   since nightly build 2018-03-22 it works correctly.
 
   === Robotron Z9001 (80x48) === (almost ok)
   zcc +z9001 -lm -lgfx9001 -o plottest_z9001 -create-app plottest.c
   or
   zcc +z9001 -lm -lgfx9001 -subtype=kcc -o plottest_z9001 -create-app plottest.c
   Use JKCEMU for testing, there you can run either a .TAP or a .KCC file.
   Note: combining -lgfx9001 and -clib=ansi...
   zcc +z9001 -lm -lgfx9001 -clib=ansi -o plottest_z9001_ansi -create-app plottest.c
   ...works only on monochrome systems (on colour machines, characters cannot be 
   seen and plotted points are partly invisible)
   
   === Philips VG5000 (80?72) === (ok)
   zcc +vg5k -create-app -clib=graphics -lm plottest.c -o plottest_vg5000
   Note: In 1.99B plot() function displayed " characters instead of pixels.
   New compile option -clib=graphics added since nightly build 2018-03-31.
   Use the DCVG5K emulator (dcvg5k.free.fr) for testing
   Attach the .k7 cassette file and type CLOAD to load the program
   (note that the VG5000 has a French AZERTY keyboard so on most 
   other keyboard layouts you have to type CLOQD)
   
   === Mattel Aquarius (80?48) === (ok)
   zcc +aquarius -lm -create-app plottest.c -o plottest_aquarius
   Note: Everything works, except for that plotted pixels are not 
   all the same size. In the plot test the second pixel looks ok 
   while the first and third are too flat.
   
   Stefano: "I saw a comment about odd pixels on the Mattel Aquarius. 
   Sadly there is very little we can do for it, the character set is 
   so fancy and unbalanced.  The bottom right pixel in a 2x3 matrix is 
   totally missing while the bottom-right pixel in a 2x2 matrix is 
   repeated twice, this is something I really can't understand because 
   the font was accurately overloaded of any kind of different symbol 
   and a duplicate like this is very odd (chr 26 = chr 224).
   By the way I added a graphics variant [in nightly build 2018-03-29]:
   just use  '-lgfxaq48' to bend your graphics resolution from 64x72 
   to 64x48 [should be 80x48],  they are both compatible with the text mode."
   -> looks good now, the plotted pixels are all the same size now
   
   Use the "Virtual Aquarius" emulator for testing. Loading 
   instructions from the z88dk wiki:
    from within the emulator, load the loader: cload
    press ENTER twice, then play the ?_plottest_aquarius.caq? cassette file (loader)
    at the ?OK? prompt, type RUN <ENTER>
    press ENTER twice, then play the ?plottest_aquarius.caq? cassette file
    wait? then have fun !
   
   === Sharp MZ-700 (80?50) === (ok)
   zcc +mz -lm -create-app plottest.c -o plottest_sharpmz
   Note: clearing the screen does not work in 1.99B, fixed since 
   nightly build 2018-03-29
   In M.A.M.E. attach The .mzt cassette file, then press L and Enter 
   to initiate loading, then use M.A.M.E.'s tape control to start the tape.

   === EG2000 (160?100) === (probably ok)
   zcc  +trs80 -lndos -lm -create-app -subtype=eg2000disk -pragma-redirect=fputc_cons=putc4x6 -o plottest_eg2000.bin plottest.c   
   Note: plotted points could not be seen with 1.99B. New compile option
   -pragma-redirect=fputc_cons=putc4x6 added in nightly build 2018-04-05.
   Use the Genieous emulator (gaia.atilia.eu) for testing. See the TRS-80 
   loading instructions above (use "Autostart file" after entering SYSTEM).
   
   === Philips P2000 (78?72) === (ok)
   zcc +p2000 -pragma-redirect=fputc_cons=putc4x6 -o plottest_p2000g -create-app -lm plottest.c
   M.A.M.E. (tested with 0.170 and 0.196) does not allow to load software on that system. 
   Tested with the M2000 emulator for DOS (in DOSBox), use the -tape <filename> option to 
   attach the .cas file, load it with "cload" and then type "run".
   Stefano: "text and graphics cannot be mixed on the P2000. As on the vg5000 it uses the same 
   videochip designed for the "TELETEXT" TV service (known in Italy as TELEVIDEO), later adopted 
   also by the French "MINITEL"  (known in Italy as "VIDEOTEL", or "PRESTEL" in the UK).
   It works on a text row base, where a first control character determines the output mode for 
   the whole text row (e.g. TEXT versus GRAPHICS).   The Graphics mode is just a different font 
   configured for the well known blocky low resolution.
   So..  you can still try to apply some target specific trick to force text or graphics 
   content on selected rows (I could provide a clg variant acting on a single row specified), 
   or you try to fit the new 4x6 font mode."
   -> 4x6 parameter added to the compile command above.
   Everything works correctly since nightly build 2018-04-20.
   
   === Casio PV-1000 (56x48) === (ok)
   zcc +pv1000 -o plottest_pv1000 -create-app plottest.c

   === Exidy Sorcerer (128x60) === (ok)
   zcc +srr -lm -lndos -o plottest_sorcerer -create-app plottest.c -Cz--audio
   Note: in MAME, insert the WAV cassette file, type LO to start loading, and then GO 0100 to run the program.
   Issues:
   - Pixels are not all the same size (probably a system feature that we will have to live with)
   - Bottom line of the border (at y coordinate 89) cannot be seen
   - Plotting over a character results in the letter "z" instead of the pixel being displayed
   -> all fixed since nightly build 2018-06-27 (graphics screen resolution was 128x90 until then)
   
   === Triumph-Adler Alphatronic PC (80x72) === (ok)
   zcc +alphatro plottest.c -create-app -o plottest_alphatronic
   Use MAME for testing and run the created .rom file
   
   === Samsung SPC-1000 (64x32) === (ok)
   zcc +spc1000 plottest.c -create-app -o plottest_scp1000
   Select "Basic" (not CP/M) on startup
   Type "load" to load the program
  
   === Mitsubishi Multi8 (640x200) ===
   zcc +multi8 plottest.c -create-app -o plottest_multi8
   Note: use Takeda Emulator http://takeda-toshiya.my.coocan.jp/multi8/ for testing
   (extract the three files from the MAME rom set multi8.zip into the emulator directory)
   Use Menu "CMT" to insert the .cas file and then type...
    MON
    R
    GC000
   ...to load and run the program
   Issues:
   -  printf() does not work in graphics mode
   
   === ABC80 (78?72) === (still to be tested)
   zcc +abc80 -lm -o plottest_abc80 -create-app plottest.c
   Note from z88dk Wiki: "The pseudo graphics mode is supported. You first 
   need to issue a clg () command to set up the graphics page."
   .BAC or .BAS file can be quickloaded and listed in M.A.M.E., but cannot be run
   
   === Nascom (96?48) === (still to be tested)
   zcc +nascom -lm -o plottest_nascom -create-app plottest.c
   (.nas file can be successfully loaded in M.A.M.E. in 
   both Nascom 1 and Nascom 2, but what to do next?)
      
*/

#include <stdio.h>                // required for printf()
#include <graphics.h>        // contains plot() and point() functions

void main()
{ 
  int x,y;
  int xMax, yMax;
  // determine the screen dimensions for this system
  // coordinates go from 0 to this max value
  xMax=getmaxx();
  yMax=getmaxy();
  
  printf("%c",12); // clear the screen  
  printf("\n\n\n\n\n*** plot test (%d x %d) ***\n\n",xMax+1,yMax+1);

  #if defined(__PV1000__) || defined(__COLECO__)
        printf("plotting and unplotting...\n\n");
        msleep(3000);
  #else
        printf("press any key to plot and unplot\n\n");
        fgetc_cons();        // wait for keypress
  #endif
  
  #if defined(__ABC80__) || defined(__EG2000__) || defined(__SORCERER__) || defined(__VZ200__) || defined(__VG5000__) || defined(__P2000__) || defined(__MULTI8__) 
        clg();  // activate graphics mode
  #elif defined(__VZ200__) || defined(__VG5000__) || defined(__P2000__) || defined(__SPC1000__) 
        printf("%c",12);   // we clear the screen...
        printf("\n\n",12); // ...and move a little down because otherwise the huge 4x6 letters wouldn't fit on the screen
  #endif
  
  #if defined(__SPC1000__)
        printf("\n\n",12);   // move down two more lines
  #endif
  
  plot(1,1);
  plot(3,3);
  plot(40,4);
  plot(5,5);
  unplot(5,5);
  plot(7,7);
    
  #if defined(__PV1000__) || defined(__COLECO__)
        printf("point-checking...\n\n");
        msleep(3000);
  #else
        printf("press any key to point-check\n\n");
        fgetc_cons();        // wait for keypress
  #endif
  
  printf("point(3,3)  (plotted) is %d\n",point(3,3)); // should be 1
  printf("point(40,4) (plotted) is %d\n",point(40,4)); // should be 1
  printf("point(5,5) (unplotted) is %d\n",point(5,5)); // should be 0
  printf("point(10,10)  (blank) is %d\n",point(10,10)); // should be 0

  // check if the screen dimensions for this platform have been defined above
  if (xMax>0 && yMax>0)
  { 
          #if defined(__PV1000__) || defined(__COLECO__)
                printf("\ndrawing border...\n");
                msleep(3000);
          #else
                printf("\npress any key to draw border\n");
                fgetc_cons();        // wait for keypress
          #endif
          for (x = 0; x <=xMax; ++x)
          {
                plot(x,yMax);
                plot(x,0);
          }
          for (y = 1; y <=yMax; ++y)
          {
                plot(0,y);
                plot(xMax,y);
          }
  }
  
  #if defined(__PV1000__) || defined(__COLECO__)
        printf("\nclearing screen...\n");
        msleep(3000);
  #else
        printf("\npress any key to clear screen\n");
        fgetc_cons();        // wait for keypress
  #endif

  printf("%c",12); // clear the screen 
  
  printf("done.\n");
  #if defined(__PV1000__) || defined(__COLECO__)
        msleep(3000);
  #else
        fgetc_cons();        // wait for keypress
  #endif
}
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

Ah yes, on the targets that are character based (but also have a graphics mode, eg the MC-1000 and Multi8) a font isn't loaded by default, so you need to add a -pragma-redirect:CRT_FONT=... option as detailed here: https://github.com/z88dk/z88dk/wiki/Cla ... ricConsole
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Post by RobertK »

Ok. But how exactly do I specify the font?

I tried it like this...

zcc +multi8 plottest.c -create-app -o plottest_multi8 -pragma-redirect:CRT_FONT=font_8x8_bbc_system

...but I get this error:

Code: Select all

Error at file 'zcc_opt.def' line 6: symbol 'font_8x8_bbc_system' not defined
1 errors occurred during assembly
Errors in source file C:\Misc\z88dk\lib\config\\..\..\\lib\target\multi8\classic\multi8_crt0.asm:
Error at file 'zcc_opt.def' line 6: symbol 'font_8x8_bbc_system' not defined
                   ^ ----       defc CRT_FONT = font_8x8_bbc_system
Do I maybe have to include some library?

BTW, here is one more simple question (about compiling Aquarius cartridges) that you maybe overlooked.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

The font names have a leading underscore
User avatar
RobertK
Well known member
Posts: 347
Joined: Mon Feb 26, 2018 12:58 pm

Post by RobertK »

Ok, now it works, thanks. You should add that underscore info to the GitHub wiki.
BTW, looking at the font screenshots I would assume that "_default" should also work, but it doesn't?

There is one problem left with my plot test program on the Multi8: clearing the screen does not work (everything else does).
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

Good point I think programmatically they don?t have the underscore, but on the command line they do. I?ll clean up the docs to make it more obvious. Likewise with default - I stole the zx screenshots so it?s just using the font in the rom in that case.

I?ll check clg as well. I?ve probably done something silly.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Post by dom »

Yes, I'd done something silly - I'd forgotten to page in the VRAM when doing a graphical cls.
User avatar
dom
Well known member
Posts: 2076
Joined: Sun Jul 15, 2007 10:01 pm

Re: (classic) New target: Mitsubishi Multi8

Post by dom »

Just a quick message to warn anyone using this target that -subtype=64k now creates a complete working .cas file without having to concatenate bootstrap files together.
Post Reply