Thread in English for Fujitsu FM7

jltursan
Mensajes: 5619
Registrado: 20 Sep 2011 13:59
Ubicación: Madrid
Agradecido : 990 veces
Agradecimiento recibido: 2040 veces
Contactar:

Re: Thread in English for Fujitsu FM7

Mensajepor jltursan » 31 Jul 2017 21:11

Último mensaje de la página anterior:

The one from the manual. I've checked the output and measured an 1.6V/2Mhz signal, I've double-checked this as 1.6V is too low; but they're there without doubt...

I'm used to found +12V in most japanese machines; but it's true that the specs for pin 1 are +12V or video clock.

malikto999
Mensajes: 152
Registrado: 09 Jun 2017 11:20
Agradecimiento recibido: 192 veces

Re: Thread in English for Fujitsu FM7

Mensajepor malikto999 » 01 Ago 2017 01:04

I am not familiar with hardware, but I think VIDEO CLOCK is correct.
According to the manual, it is written that +12V is for power supply of home color TV adapter.
Since pser1 is asking for a green CRT connector, +12V should be unnecessary.
In the manual, the first pin of the color CRT connector is written as +12V.

Avatar de Usuario
pser1
Mensajes: 4094
Registrado: 08 Dic 2012 18:34
Agradecido : 1352 veces
Agradecimiento recibido: 1118 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 04 Sep 2017 13:30

Hi,
after some work, I am updatig the port to version 0.33, The zip contains the source code and the D77 virtual file.
Now the game has some basic blocks to work with:
- a subroutine to manage the changes from one location to another
- Showing conversations and erasing those four text lines
- event control routine to enable conversations or locations changes ...
By now only events in 1st screen (House) and changing to the 2nd one (Car)
To erase 'old' Brody (the one that was at the end of previous screen) I have created a subsystem function that sets to $ff all bytes inside the
rectangular area used by Brody in both planes (green, red)
Text - conversations has been a real pain (to me)
First try - I sent four commands to the subsystem in order to write four lines with 42 spaces.
This worked, but I felt it was a bit too slow. Then I wanted to create a function to erase everything with only one command
but, where the heck are the text bytes in memory???
I found that the ASCII codes were saved at these positions:
Line 16 from $C500, line 17 from $C550, line 18 from $C5a0, line 19 from $C5f0
But writting $00, $ff or whatever value here does NOT affect the screen #$%&# -banghead
Analyzing the graphic memory (VRAM), I found out that the character's bitmaps are in the three planes like that:
Line 16 from $B200 using 10 rows until $B51F. Line 17 from $B520 until $B83F
Line 18 from $B840 until $BB5F. Line 19 from $BB60 until $BE7F
So, the command sets to $ff (white color) the rectangle occupied by the four lines with 42 chars each one, in the three planes.
This is fast enough, and will be used as is. This seems to tell us that we could only use for code this range: $c000-$c4ff
because from $c500 on, the system uses that RAM to save ASCII data (console workspace)
cheers
pere
06-Shark v0.33.zip
(67.29 KiB) Descargado 73 veces

malikto999
Mensajes: 152
Registrado: 09 Jun 2017 11:20
Agradecimiento recibido: 192 veces

Re: Thread in English for Fujitsu FM7

Mensajepor malikto999 » 05 Sep 2017 10:44

FM-7 does not have so-called text VRAM.
In order to explain the console buffer($c000-$cfff), I quote from the article of Oh!FM 1985/1(P37-P38).
(Just jltursan is making threads.)

"
Since the FM-7 series does not have a dedicated VRAM for text, character strings such as text are expanded into graphic patterns and written to the VRAM.
Therefore, when editing the text etc. displayed on the screen, it is impossible to refer to the data on the VRAM.
So it needs a buffer memory to memorize where on the screen what letters are displayed, and that is here.
The console buffer requires 2 bytes for each character, of which 1 byte represents the character code of that character and another byte represents the attribute (color, etc.) of that character.

Let's explain it a little more concretely.
To display the letter A in the upper left corner, first the character code $41 of A is written in $C000 in the console buffer, and its attribute is written in $C7D0. (WIDTH80 case)
Next, it extracts the pattern data of A from the character ROM and writes it on the VRAM.
With this, the letter A is registered and displayed on the console buffer, VRAM.

As you already know, the console buffer is like a text VRAM that is not displayed on the CRT.
It itself is completely independent of the VRAM of $0000-$BFFF actually displayed on the CRT, so clearing the $0000-$BFFF does not clear the console buffer.
Conversely, even if you clear the console buffer, the characters displayed on the screen remain intact.
"


Well, in this game you have a program in the console buffer to directly control the subsystem.
Using the console related subsystem instruction ($07 PUT BLOCK1), character codes and attributes are written in the console buffer. It is better not to use it because the program will be destroyed.

To display the text, there is also a way to use the graphic instruction ($19 SYMBOL). But this is slow, so I do not recommend it.
I think that it is best to call the display routine in the subsytem ROM.
For concrete method, sample code is attached so please refer to it.
Adjuntos
SAMPLE.ZIP
(2.6 KiB) Descargado 64 veces

Avatar de Usuario
pser1
Mensajes: 4094
Registrado: 08 Dic 2012 18:34
Agradecido : 1352 veces
Agradecimiento recibido: 1118 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 05 Sep 2017 12:43

malikto999 escribió:FM-7 does not have so-called text VRAM.
Well, in this game you have a program in the console buffer to directly control the subsystem.
Using the console related subsystem instruction ($07 PUT BLOCK1), character codes and attributes are written in the console buffer. It is better not to use it because the program will be destroyed.

Hi, Thanks a lot for your clear explanation and the possible solutions -thumbup
That's right, but as we are using ONLY lines 16-17-18-19 counting from 0 to 19, the first byte used is $c500 and this leaves a lot of space for us
to work with, say some $500 bytes = 1280 decimal.
By now we are only using $1aa = 426 decimal, which means just about a third part of the 'free' space.
I will give a peek at the code you have uploaded, for maybe it uses even less space!
The PUT BLOCK1 is fast enough and having the command that sets these four lines to white colour, everything works flawlessly.
I will talk about that after looking at your code.
cheers
pere

Avatar de Usuario
pser1
Mensajes: 4094
Registrado: 08 Dic 2012 18:34
Agradecido : 1352 veces
Agradecimiento recibido: 1118 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 05 Sep 2017 17:22

@malikto999
I have substituted the use of "PUT BLOCK1" with the better version you uploaded.
This means about 35 extra bytes in the $c000 area but if this frees all of the $c000-$cfff range, that is perfect!
Besides, the program writes very well (fast), I am still using the old subroutine to set all pixels to white while erasing
the 4 lines of 42 chars each. It is a function that just requieres the function code to be called.
I am attaching here the source code and the virtual file with version SHARK35
cheers
pere
SHARK v0.35.ZIP
(66.91 KiB) Descargado 74 veces

Avatar de Usuario
pser1
Mensajes: 4094
Registrado: 08 Dic 2012 18:34
Agradecido : 1352 veces
Agradecimiento recibido: 1118 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 05 Sep 2017 19:34

@malikto999
In the program I am using color 3 for the text to show.
I have been testig other values. The best one seems 2 because it only affects GREEN plane (setting pixels to 1 to show black color text)
That way, the erase routine can be modified so that it sets to 1 only the pixels in the RED plane, and according to the redefined palette
on this game, (Green +) Red set to 1 means white pixels = white background, no more visible text!
That way just chaging one plane (instead of the three), the text is erased. This means three time faster!
Now this begins to pay the effort of adding the extra routine in the subsystem to 'paint' the text!
If you don't see any drawback to this procedure, I will change it into the last game version.
Thanks in advance
cheers
pere

jltursan
Mensajes: 5619
Registrado: 20 Sep 2011 13:59
Ubicación: Madrid
Agradecido : 990 veces
Agradecimiento recibido: 2040 veces
Contactar:

Re: Thread in English for Fujitsu FM7

Mensajepor jltursan » 05 Sep 2017 19:55

In order to explain the console buffer($c000-$cfff), I quote from the article of Oh!FM 1985/1(P37-P38).
(Just jltursan is making threads.


Yep, I've finally received the Oh!FM from Japan, it's great and it has been carefully preserved, looks like new!. The "bad" news are that the articles are huge and obviously it could be a huge task to translate them. As for now, I've already scanned pages 33-72 (nearly 775MB of high quality TIF scans), I think that they cover all the interesting info published in this issue.

Now this begins to pay the effort of adding the extra routine in the subsystem to 'paint' the text!


I vote for that!

Avatar de Usuario
pser1
Mensajes: 4094
Registrado: 08 Dic 2012 18:34
Agradecido : 1352 veces
Agradecimiento recibido: 1118 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 06 Sep 2017 15:08

Hello,
I have been comparing old versions with this last one, and I have found something interesting.
I have been using WIDTH80,20 from the beginning, this implies that each text row uses 10 pixels (200/20 = 10)
For this reason, when I analyzed the VRAM searching for traces of the text I had written in lines 16-17-18-19 (counting rows 0 till 19)
I found that they begin at these places:
L16 - $B200; L17 - $B520; L18 - $B840; L19 - $BB60
The space between them is $B520-$B200 = $320 = 800 decimal (clearly 10 rows of 80 pixels) not 8 rows of 80 pixels = 640.
But the subroutine we are calling now to write text ($e51d) works as it were in the WIDTH80,25 mode.
This is why Malik wrote the equation (x+y*8*80) that works flawlessly ... but then the text appears
more compact (no white rows between text lines)
I think that, as the text is clear enough to be read, I will use this 80x25 definition for text.
And ... this means that now the 'eraseText' function can be modified to change only 80% of space it was cleaning, so getting faster -thumbup
cheers
pere

Ps I am sorry for 'seeing' things that late, but I need time to experiment with the code and this machine is a box of mysteries to me!

malikto999
Mensajes: 152
Registrado: 09 Jun 2017 11:20
Agradecimiento recibido: 192 veces

Re: Thread in English for Fujitsu FM7

Mensajepor malikto999 » 07 Sep 2017 02:55

I see. Since I do not use 20 line mode much, the sample assumed 25 lines mode.
As you know, the VRAM address where the text is written for WIDTH 80,20 is X+Y*10*80 (Y=0-19).

By the way, I executed SHARK several times in WIDTH 40 mode and the text may not be displayed properly.
How about initializing the screen in the program?
It can be done with subsystem command INIT ($01).

$fc82:command code ($01)
$fc83:back color (0-7)
$fc84:number of columns (40 or 80)
$fc85:number of lines (20 or 25)
$fc86:scroll start line (0-)
$fc87:number of scroll lines (0-)
$fc88:function key display (0:no other:yes)
$fc89:clear screen (0:no other:yes)
$fc8a:green(mono) display (0:not other:yes)

If you do, it is a console command, so please do before transferring the program to the subsystem.

malikto999
Mensajes: 152
Registrado: 09 Jun 2017 11:20
Agradecimiento recibido: 192 veces

Re: Thread in English for Fujitsu FM7

Mensajepor malikto999 » 07 Sep 2017 03:00

jltursan escribió:Yep, I've finally received the Oh!FM from Japan, it's great and it has been carefully preserved, looks like new!. The "bad" news are that the articles are huge and obviously it could be a huge task to translate them. As for now, I've already scanned pages 33-72 (nearly 775MB of high quality TIF scans), I think that they cover all the interesting info published in this issue.


How do you cut out text from TIF images?
Do you use Japanese font OCR?

Avatar de Usuario
pser1
Mensajes: 4094
Registrado: 08 Dic 2012 18:34
Agradecido : 1352 veces
Agradecimiento recibido: 1118 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 07 Sep 2017 09:52

malikto999 escribió:I see. Since I do not use 20 line mode much, the sample assumed 25 lines mode.
As you know, the VRAM address where the text is written for WIDTH 80,20 is X+Y*10*80 (Y=0-19).
By the way, I executed SHARK several times in WIDTH 40 mode and the text may not be displayed properly.
How about initializing the screen in the program?
It can be done with subsystem command INIT ($01).
$fc82:command code ($01)
$fc83:back color (0-7)
$fc84:number of columns (40 or 80)
$fc85:number of lines (20 or 25)
$fc86:scroll start line (0-)
$fc87:number of scroll lines (0-)
$fc88:function key display (0:no other:yes)
$fc89:clear screen (0:no other:yes)
$fc8a:green(mono) display (0:not other:yes)
If you do, it is a console command, so please do before transferring the program to the subsystem.

Hi,
thanks a lot for that advice / solution to the text problem ... that didn't happen before because PUT BLOCK1
accepts parameters 80x25.
I will add this call before transferring code and then will delete the ShowTxt function changing the 'only' place
it is called from (show Brody position in hexa) that is only needed for debugging purposes.
cheers
pere

Avatar de Usuario
pser1
Mensajes: 4094
Registrado: 08 Dic 2012 18:34
Agradecido : 1352 veces
Agradecimiento recibido: 1118 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 07 Sep 2017 13:30

malikto999 escribió:By the way, I executed SHARK several times in WIDTH 40 mode and the text may not be displayed properly.
How about initializing the screen in the program?
It can be done with subsystem command INIT ($01).
If you do, it is a console command, so please do before transferring the program to the subsystem.

Okay, done!
I even changed the debugging subroutine ShowText to use this command instead of PUT BLOCK1
Thanks a lot -thumbup

Now you can move to the car location and if you have the keys, Brody goes to the Police station, but NO events for this
last Location (by now) so it does nothing. If you press 'Q' key game will end.
I don't know the reason for this behaviour:
after quitting the game, it is in 80x25 mode, but typing FILES fills the screen, then a glitch is produced and the
rest of the files are shown.
Of course with command WIDTH80,25 this doesn't happen!

cheers
pere
Shark v0.37D.zip
(69.38 KiB) Descargado 72 veces

malikto999
Mensajes: 152
Registrado: 09 Jun 2017 11:20
Agradecimiento recibido: 192 veces

Re: Thread in English for Fujitsu FM7

Mensajepor malikto999 » 08 Sep 2017 12:17

pser1 escribió:Now you can move to the car location and if you have the keys, Brody goes to the Police station, but NO events for this
last Location (by now) so it does nothing. If you press 'Q' key game will end.


It is approaching completion for each day!


pser1 escribió:I don't know the reason for this behaviour:
after quitting the game, it is in 80x25 mode, but typing FILES fills the screen, then a glitch is produced and the
rest of the files are shown.
Of course with command WIDTH80,25 this doesn't happen!


It is probably because 0 is specified as the number of scroll lines with the INIT command.
If you specify 25, it defaults.

Avatar de Usuario
pser1
Mensajes: 4094
Registrado: 08 Dic 2012 18:34
Agradecido : 1352 veces
Agradecimiento recibido: 1118 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 08 Sep 2017 12:43

malikto999 escribió:
pser1 escribió:Now you can move to the car location and if you have the keys, Brody goes to the Police station, but NO events for this
last Location (by now) so it does nothing. If you press 'Q' key game will end.

It is approaching completion for each day!
pser1 escribió:I don't know the reason for this behaviour:
after quitting the game, it is in 80x25 mode, but typing FILES fills the screen, then a glitch is produced and the
rest of the files are shown.
Of course with command WIDTH80,25 this doesn't happen!

It is probably because 0 is specified as the number of scroll lines with the INIT command.
If you specify 25, it defaults.

Hi, Malik,
you are right, I was searching for a parameter to change on the initialization, but were unable to find it out!
We would be absolutely 'lost in space' without your unvaluable help -thanks -drinks

And this port advances, but not at the speed I thought, because there are a lot of values to be recalculated as the graphic resolutions
are too different. And by now, there is no wav reproduction nor music in the game ... Quite a lot of work still to be done!
But step by step we will reach to the end, for sure -thumbup
cheers
pere

Avatar de Usuario
pser1
Mensajes: 4094
Registrado: 08 Dic 2012 18:34
Agradecido : 1352 veces
Agradecimiento recibido: 1118 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 08 Sep 2017 19:09

Just to keep this thread to the same level than the other, I upload here version 0.37E
This one adds event controls for Locations 3,4 and 5
Unfortunately this must be done for 6-7-8-9-10 and 11 too -banghead
Now you can walk for many more locations, keeping into account that if you enter one of those
that has not yet event control routine, you will not be able to get out of it, and the only accepted key is "Q" to quit the game.
FIlename = SHARK37E
cheers
pere
Shark v0.37E.zip
(71.34 KiB) Descargado 57 veces

Avatar de Usuario
pser1
Mensajes: 4094
Registrado: 08 Dic 2012 18:34
Agradecido : 1352 veces
Agradecimiento recibido: 1118 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 17 Sep 2017 14:06

Hello,
just to keep this thread up to date, I am uploading a new version that allows the player to end the game!
IN order to have the same level that we have on the Dragon version, there are some pitfalls to solve:

1) Show the 'small' shark appear little by little coming out of the sea
2) Redraw first plane objects on Brody, for instance these ones: the stairs, the pole, the counter and the Orca
3) Change to WIDTH 80,20 so that it is easier to read
4) Add some music intro (a song), maybe we could send commands right to the AY-3-8910
5) ¿Could we reproduce WAV files anyway?

- The two first points imply adding big sprites an dmodifying the subroutine that sends chunks to the Subsystem
making it compatible with the behaviour we have right now
_ The third one seems easy despite some fixed values and calculations will be affected,l becuase we are going to
have text lines that will be 10 rows high instead just 8 rows (25 x 8 = 20 x 10)
- The two final points are simply unknown to me. Maybe Malik and José Luis (jltursan) could shine some light!

Attached is the zip with the .D77 virtual disk and the source code
To test, just do
LOADM"SHARK37L",,R

You should better NOT keep pressing the same key, FM-7 repeats it for free. On certain situations, when the conversation
is not a dialogue, any keypress will erase the text, so, please, remember that recommendation!
There are some things that will need some adjustements, for instance some timings to let the user read messages, etc
Any comment about the whole game will be highly appreciated. Have fun!
cheers
pere
Shark v0.37L.zip
(81.4 KiB) Descargado 83 veces


Volver a “Fujitsu FM7”

¿Quién está conectado?

Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 4 invitados