29 February 2008

Galaksija real video

Last two days I was working on implementing real video emulation for Galaksija, since there was a hack used for it till now.

Hardware for it is simple, video output is generated by shift register.
There is a clock generator at 6144000Hz (when divided by 2 is used as clock for Z80 CPU) which is used to shift register for video signal generator.

Width of line is 384 ticks and each horizontal line beginning is shifted by some number of ticks (9 * 8 ticks for Galaksija ROM1), this shift is configurable and ROM2 and Glaksija plus change this value. Also there are two empty lines in beginning of video info.

Idea for implementing this is to do exact thing what real hardware do. We will first make periodic interrupt:

MDRV_CPU_PERIODIC_INT(gal_video, XTAL );

And in it’s body we will generate image :
UINT8 *gfx = memory_region(REGION_GFX1);
unsigned int dat = (gal_latch_value & 0x3c) >> 2; // char line displaying
y = p / 384; // new line each 384 ticks
x = p - (y * 384); // this is horizontal pos
if ((gal_cnt % 8)==0) { //fetch code only on char beginning
// Take address refreshing in latch there is A7 status
addr = (((unsigned) cpunum_get_reg(0, Z80_I)) << 8) + (unsigned) cpunum_get_reg(0, Z80_R) + ((gal_latch_value & 0x80) ^ 0x80);
// Read video memory location
code = program_read_byte(addr) & 0xbf;
code += (code & 0x80) >> 1;
// take line from char gen
code = gfx[(code & 0x7f) +(dat << 7 )];
}
// display and shift
*BITMAP_ADDR16(tmpbitmap, y, x) = (code >> (p & 7)) & 1;


This one is working, only problem is implementation of Z80 CPU since it will set value of latch in wrong moment (on the beginning of executing instruction LD (HL),A , since on real one it is done at the end), that is why we now have first char in line displayed twice, and some minor glitches in 13th lines of char.

Now have to think how to solve that. Idea is not to change Z80 CPU implementation, but also it should be as much as possible like in real life.

26 February 2008

Romanian computers

Yesterday I have received quite large number of ROM's (from Romanian computers from 80's and 90's) from Valentin H. All of them are some kind of Spectrum clones, so all that should be done is to connect ROM's to right places :)

So I have done that today, now CIP03, HC85, HC90, HC91 and Jet-EM are supported.

For other ROM's I need to spend more time since they are not just ROM replacements.

When these 5 were supported I have thought, why shouldn’t I try to find more of clone ROM's myself, so I have start browsing, and found few more.

So now Didaktik Gama and Didaktik M from ex Czechoslovakia, machines now boots ok, but still need to find right info about memory, since one source seas that there is 80KB of RAM.

Will work on this.

Here are boot screens of working Romanian spectrum clones:





Orao and Galeb

As you may see in last post link (on Josip site), well he also made a emulator for Galeb and Orao himself (Orao have source code too), and since ROMs where there I have decided to write that also.

His source was a good guide, but I have made quite different implementation, still MESS is all about accuracy, that's why I have for example decided to support keyboard as it was on original (for example Galeb have only two cursor keys, only left and down , to get up and right you need to press shift) and it since it was QWERTZ that is how it is now used by emulator too.

Also by debugging I have found that sound is made by DAC so now it sounds more like real machine.

Since almost all info could be found on one place it was one day job to make these two.

Need to work on tape support and then it is complete.





P.S. As you may note all posts have same date, well thing is I have made my blog after I have implemented these two.

Galaksija plus

So as it "should" be done first I have decided to support some domestic computer.
As there is already support for Galaksija inside MESS I tought that best idea would be to write extension for improved model of it.

I have found lot of info regarding this computer in computer magazines in which even schematic is available. To see yourself click here

But main problem is that I could not find ROM C anywhere on web. Then I have tried to contact one person that I saw build one Galaksija himself, and yes he responded :)

Thanks again to Josip Perušanec for his great help.

First I have made memory maps as described by magazine and made a connection to AY-3-8910. And guess what it sings now. Also I was annoyed by white tick line at the end of screen and then I saw that it seas 218 lines for graphics, but in documentation and by manual calculation it can be seen that it is only 208 lines, so that is also fixed now.

Since graphics is implemented with "hack" I have decided to leave it like that for now and keep this driver with GAME_NOT_WORKING status since high graphics mode is still not implemented.

So I have started

Well I have decided to start writing some MESS drivers of my own.
I was analyzing a list of supported computers and thing I have found is that there is quite few of computers from "Eastern block" so think it is good way to start, let's support as much as possible.
Think I need some help from others as well. ROM dumping needs to be done for lot of them since small number of ROM's are currently available.