Sharp mz80x/700

Post Reply
UncleBod
Member
Posts: 11
Joined: Tue Sep 25, 2018 6:24 pm

Sharp mz80x/700

Post by UncleBod »

After installing z88DK and testcompiling for a MZ-700 emulator I realized that the text handling is not very bad. (Only capital letters, it didn't handle the DEL key on the MZ700 right)
So, I forked the repository and made some changes. When I was looking around i also fixed the standard origin of the file to 1200H
Now, should I make a Pull Request and enter my changes thtat way, or what is the normal way to handle updates?
Also, is there any recommended coding style for the project? I've seen asm files with colon in the end of labels and and dot in the beginning...

Now I'm planning to get the MZ-700 to get small letters etc in the right place so text from a c program will look normal.

Another thought is how to handle the classic mz series. MZ80A,C,K and MZ-700 has more or less the same internals but the mz80B and MZ-800 are quit different.
Should this be handled with several different machines, or by using defines to fix so the compiler makes the best use out of each of them?


/UncleBod
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

we are brave, just make your request. palese do your best to help us undersfanding what you're doing (the way you prefer)
UncleBod
Member
Posts: 11
Joined: Tue Sep 25, 2018 6:24 pm

Post by UncleBod »

First (small) pull request done.
I will go through some manuals before I start to fix the ascii coding/decoding.

BTW, I saw in another thread that the stack space is really small. I think I will look into that also.
/UncleBod
UncleBod
Member
Posts: 11
Joined: Tue Sep 25, 2018 6:24 pm

Post by UncleBod »

So, the MZ80 B needs to be split out from machine "mz", I think. A new machine "mz80b" should be created.
I will do some experiment in my fork, but I think I can make crt_0.asm that will have routines for reading keyboard and printing to the screen.
Sharp was very nice and had the assembler listings of the Monitor program sin the manual back in those days...

The rest of MZ80x serie (and probably also the MZ700) can stay in "mz" with the help of compiler time defines.
I will base it on the MZ80K/MZ80C with minimal RAM and add things from there.

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

Post by dom »

Sorry, having a little bit of a rest the past few days.

I can see the logic in splitting the two MZ lines (I saw the family tree somewhere a few days ago and it was quite impressive!).

In classic these days, I'm trying to get a consistent console interface across machines, dealing with the quirks of the individual machine control codes is both painful and tedious, it's pretty much standardised on gencon (which is a minimal VT52 engine). Under the hood these can call the IPL (eg the MZ2500) or write directly to the screen memory (most other targets).

The MZ has some minimal work in this direction - there's a gencon that writes directly to the screen memory. It shares the sharpmz_conversion code with the VT100 and also the ROM printer.

In terms of distinguishing between different machines, the -clib= and -subtype= options are really useful - we're using them for various CP/M varieties.
UncleBod
Member
Posts: 11
Joined: Tue Sep 25, 2018 6:24 pm

Post by UncleBod »

All but MZ80B shares character codes. That machine has almost standard ASCII.
The mz machine should probably have MZ80K as base (it is the oldest and the simplest of them). All other have banked RAM/ROM etc.
I am not sure where the MZ-800 fits in. It seems to be more like M80B in some respects than MZ-700.
I will play around with my local clone of the fork and see where it lands. I was quite home with MZ-700 once, since it was the first real computer I owned.
I'll write down some thoughts on how to get them to work better somewhere for comments. Will this thread be OK for that?

/UncleBod
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

my small progresses on the mz80b were obtained by using the monitor embedded in the basic interpreter
appmake has a fancy option trying to remap the monitor calls between the mz models
UncleBod
Member
Posts: 11
Joined: Tue Sep 25, 2018 6:24 pm

Post by UncleBod »

Interesting solution.
I am not sure I like it 100% though..
Rewriting so the correct labels are set when starting the compile would make it possible to use them in the code.
Besides, some machines (especially when running an emulator) could have a non-standard Monitor loaded...
This could mess things up a bit. As I wrote, I will try to write some sort of roadmap this weekend.

/UncleBod
UncleBod
Member
Posts: 11
Joined: Tue Sep 25, 2018 6:24 pm

Post by UncleBod »

I suppose the idea of z88dk is to use it on the real machines. In that case some extra thought have to be put into the division of mz and how to handle the machines. Several of the models have more than one possible amount of RAM, and this is something to take into account. Also the fact that all but the MZ-80K has bank switching of RAM/ROM in different ways.
(What have I jumped into???)

/UncleBod
UncleBod
Member
Posts: 11
Joined: Tue Sep 25, 2018 6:24 pm

Post by UncleBod »

Pull request for machine mz80b opened.
It is really just a quick copy of the mz machine.
/UncleBod
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

>Interesting solution.
>I am not sure I like it 100% though..

Sure, it is just an experiment, even worse than you can expect. It is just appmake being able to patch the resulting binary trying to spot the JP and CALL opcodes.. the fun begins when you run it in 'dumb' mode and try to convert external MZ programs :)

On your recent pull request, I agree with Dominic: to just copy the current MZ architecture but still depending on a loaded monitor is a bit pointless. I'd use a parallel CRT0 and config only if the differences are relevant, otherwise the same startup file can be slightly adapted with the '-startup=' option, in conjunction with 'SUBTYPE' and 'CLIB' sections in the configuration file.
UncleBod
Member
Posts: 11
Joined: Tue Sep 25, 2018 6:24 pm

Post by UncleBod »

I'm working on it. "Simply" copying the monitor routines for reading the keyboard and outputting characters to the clib routines.
Got a bit confused, since the printed assembler listing and the disassembly I did of the Basic differs at some points.
My goal is to have the Othello example loading from the IPL and running by the end of this week.

The MZ80B will in the end differ, since I feel that you shouldn't be forced to load the Basic before you can load the program. All other MZ-80 computers and the MZ-700 have a complete Monitor in ROM that you can use. (The MZ-800 in 800 mode is also without Monitor in ROM).

/UncleBod
stefano
Well known member
Posts: 2137
Joined: Mon Jul 16, 2007 7:39 pm

Post by stefano »

>My goal is to have the Othello example loading from the IPL and running by the end of this week.

sounds great , I tried to decode the ipl logic time ago but I was unsuccessful.
there are some targets with mixed architectural solutions which didn't require a different infrastructure, though. The mc1000 comes to my mind but we have others. let's see how it proceeds, then we'll decide ;)
UncleBod
Member
Posts: 11
Joined: Tue Sep 25, 2018 6:24 pm

Post by UncleBod »

Sharp was quite creative with the MZ series, to say the least...
The IPL has only very rudimentary functions, but it still can load programs from CMT or FD.
I will dive into that later. A good thing that the listings of the Sharp PROMs are available, and in most cases even in the official manuals...

I made a first test with my GetKey routine last night, and it is working.
Just to get text to the screen also...

/UncleBod
UncleBod
Member
Posts: 11
Joined: Tue Sep 25, 2018 6:24 pm

Post by UncleBod »

Still working on it.
I'm copying the start up code from the Monitor program now. This is interesting code. Self modifying depending on 40 or 80 characters per line.
It also have a small buffer that I so far haven't decoded for what. For this buffer they use a hard coded value at one place, so I need to look into it.
In short:
Char in and Char out is working directly from IPL in a test program. Some special characters and keys can break the joy, but not to bad.
/UncleBod

MZ-721 was my first desktop computer. I ought to know how to handle these things...
Post Reply