Thread in English for Fujitsu FM7

jltursan
Mensajes: 1810
Registrado: 20 Sep 2011 13:59
Agradecido : 42 veces
Agradecimiento recibido: 124 veces

Re: Thread in English for Fujitsu FM7

Mensajepor jltursan » 16 Jun 2017 19:09

Último mensaje de la página anterior:

Thanks for the link!, Ill test it for sure :-)

Avatar de Usuario
pser1
Mensajes: 1984
Registrado: 08 Dic 2012 18:34
Agradecido : 184 veces
Agradecimiento recibido: 160 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 21 Jun 2017 16:50

malikto999 escribió:The first 16 bytes of the binary file are the header.
+00-07:Filename(blank-padded)
+08-09:0
+0A-0A:0:Basic program 1:Data file 2:Machine language file
+0B-0B:0:Binary $FF:Ascii
+0C-0C:0:Sequential file others:Random file
+0D-0F:ID("XM7")
.

Thanks, that's fine
But when I compile with any other compiler,for instance ASM6809, I get a raw binary file
and I add there the header you have explained and a trailer that seems mandatory:
- one byte $FF
- two bytes $00, $00
- the exec address $nnnn
- Then a byte $1A (cannot get the meaning of this byte )
- Some null bytes so that the file becomes multiple of 256 in length plus 16 extra bytes.
Only doing so I could Import the binary into a .D77 using your D77Manager

Could you tell us what is the exact format for the end of a binary file?
Thanks a lot in advance
pere

Avatar de Usuario
pser1
Mensajes: 1984
Registrado: 08 Dic 2012 18:34
Agradecido : 184 veces
Agradecimiento recibido: 160 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 21 Jun 2017 19:44

Is there any way to configure graphics so that the screen is used as 320x200 pixels?
So using only 8k per plane = 24k VRAM releasing some 24k for user code (maybe?)
Changing WIDTH 40,20 only affects the text, not the graphics
Any advice will be highly appreciated
pere

Avatar de Usuario
pser1
Mensajes: 1984
Registrado: 08 Dic 2012 18:34
Agradecido : 184 veces
Agradecimiento recibido: 160 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 21 Jun 2017 23:17

some (sad) reflections about that FM-7
- It seems that we would like to 'send' code and data (sprites) to the subsystem, so we need an area of RAM for that purpose.
The Subsystem uses:
$0000-$bfff 48k for VideoRAM
$c000-$cfff 4k for console, where the text on screen and its color attributes are saved, despite some of the
very last bytes seem used by the system because they change at a fast rate.
$d000-d0ff is the direct page reserved by the ROM
$d100-$d37f is FREE RAM, which means *ONLY* 640 bytes ($280)
$d380-$d3ff is the shared area with the main CPU (128 bytes)
$d400-$d7ff is an I/O area
$d800-$ffff is ROM
So we can see that we can just use 640 bytes out of 64k -banghead
I cannot imagine a sprite like boss Brody (from Tiburon / Jaws) that is 32 x 56 pixels at a resolution of 256x192
Once converted to 640x200, it would need 64 x 56 = 448 bytes (for every plane), so 1,344 bytes at 8 colors just for the sprite,
and we used Sprite, Mask and a Buffer to save the screen data overprinted with the sprite, this means some 1,344x3 -> 4,032 bytes
for *one* sprite, more than 6x what we can use ... and no code sent to the SS.
OK, double horizontal definition and triple color depth means 6x, so it begins to 'need' great areas
I am sure, or at least I hope so, that I am missing some important points in the use of the Subsystem, but right now I think it doesn't
help at all having two CPUs, the first one with 32k free RAM but unable to write a simple bit on the screen

- Loading an image from disk seems another awful task. We can only load to the RAM of the first CPU and then all 48k have to be sent
to the subsystem (in chunks of 124 bytes) so that it puts them on the VRAM ... again, is there any other way?

cheers
pere

malikto999
Mensajes: 51
Registrado: 09 Jun 2017 11:20
Agradecimiento recibido: 49 veces

Re: Thread in English for Fujitsu FM7

Mensajepor malikto999 » 22 Jun 2017 02:26

pser1 escribió:Thanks, that's fine
But when I compile with any other compiler,for instance ASM6809, I get a raw binary file
and I add there the header you have explained and a trailer that seems mandatory:
- one byte $FF
- two bytes $00, $00
- the exec address $nnnn
- Then a byte $1A (cannot get the meaning of this byte )
- Some null bytes so that the file becomes multiple of 256 in length plus 16 extra bytes.
Only doing so I could Import the binary into a .D77 using your D77Manager

Could you tell us what is the exact format for the end of a binary file?
Thanks a lot in advance
pere


pser1,I pray for your mother's health.

It is the disk storage format of F-BASIC machine language file.
SAVEM command records a program in a machine language file in the following format.

+00 $00
+01-02 program byte length
+03-04 start address
+05-n program data
+n+1 $ff
+n+2-n+3 $00
+n+4-n+5 entry addres
+n+6 $1a(EOF mark = End Of File)

Please uncheck "Display FBASIC machine-language files as memory dump" in settings of D77Manager.
So you can see the FD sector dump of the machine language file.

malikto999
Mensajes: 51
Registrado: 09 Jun 2017 11:20
Agradecimiento recibido: 49 veces

Re: Thread in English for Fujitsu FM7

Mensajepor malikto999 » 22 Jun 2017 02:42

pser1 escribió:Is there any way to configure graphics so that the screen is used as 320x200 pixels?
So using only 8k per plane = 24k VRAM releasing some 24k for user code (maybe?)
Changing WIDTH 40,20 only affects the text, not the graphics
Any advice will be highly appreciated
pere


This is not a question of how to switch to FM77AV 320x200 4096 color mode, is not it?

Unfortunately, FM-7 does not support 320 x 200 resolution.
I will write about the arrangement and execution method of the program on the subsystem by another post.

malikto999
Mensajes: 51
Registrado: 09 Jun 2017 11:20
Agradecimiento recibido: 49 veces

Re: Thread in English for Fujitsu FM7

Mensajepor malikto999 » 22 Jun 2017 12:42

First, as far as I know, usage of FM-7's display subsystem was written clearly in most detail in the magazine "Oh! FM" January, 1985 issue.
The article "Conquer the subsystem" is written in Japanese, but if you can understand the content, you will probably get all you want to know.

From the article, I will write about the arrangement and execution method of the program on the subsystem.


Three ways to execute the program on the sub CPU side

a)Place the program in shared RAM and execute
b)Transfer the program to the subsystem and call it when necessary (usually under sub-monitor management)
c)Transfer the program to the subsystem and move execution to the program off the management of the sub-monitor


a) is the best method if programs are less than 113 bytes.
However, since it is necessary to transfer the program to the shared RAM every time it is executed, efficiency is bad.

* shared RAM at user program execution
* main sub data
* ----------------------------------------------------
* $FC82 $D382 $3F
* $FC83- $D383- /YAMAUCHI/
* $FC8B $D38B $93
* $FC8C $D38C $D38F start address of user program
* $FC8E $D38E $90
* $FC8F- $D38F- user program (max 113 bytes)


b), transfer the program to the subsystem in advance, and execute it using the TEST command.
This method can execute a program with 13 bytes transfer only.

* shared RAM at user program execution
* main sub data
* ----------------------------------------------------
* $FC82 $D382 $3F
* $FC83- $D383- /YAMAUCHI/
* $FC8B $D38B $93
* $FC8C $D38C $nnnn start address of user program
* $FC8E $D38E $90


c) is the fastest method to process.
Leaving from the management of the sub-monitor, always execute the user program.
The processing is branched by the command handler of the user program.
You can not use normal subsystem command because it leaves from management of the sub monitor.
However, you can implement them by devising the command handler.


You are already practicing methods of a) and b).
I will upload sample code of method c), so please refer.

I will write about the location of the program in the next post.

malikto999
Mensajes: 51
Registrado: 09 Jun 2017 11:20
Agradecimiento recibido: 49 veces

Re: Thread in English for Fujitsu FM7

Mensajepor malikto999 » 22 Jun 2017 12:54

The area on the subsystem side where the user program can be located is as follows.

1)Console buffer ($C000-$CFFF)
Since it has a size of 4KB, you can place a large program.
However, subsytem commands related to the console can not be used at all.
Therefore, when using this area it is best to place screen processing of game programs that do not require console processing.

2)Sub-monitor work area ($D0A0-$D2BF)
It is a work area used by PAINT etc. of the subsystem command.
If you don't use PAINT or SYMBOL,etc, you can use this area.

3)VRAM ($0000-$BFFF)
When using this area, it is necessary to always set the VRAM access flag.
This slows the execution speed of the sub CPU to 1/3.

In the past, it was said that it is necessary to transfer all programs including pattern data to the subsystem in order to make high speed games on the FM series.
In practice, however, even if the pattern data is transferred from the main side to the sub side via the shared RAM every time, it is fast enough.


In my opinion, it is best to place a pattern drawing program in the console buffer and transfer the pattern each time.
The sample code places the user program in the console buffer and transfers 32x16 pattern data to the subsystem at the time of drawing.
Adjuntos
SAMPLE.zip
(3.82 KiB) Descargado 9 veces

Avatar de Usuario
pser1
Mensajes: 1984
Registrado: 08 Dic 2012 18:34
Agradecido : 184 veces
Agradecimiento recibido: 160 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 22 Jun 2017 16:04

malikto999 escribió:It is the disk storage format of F-BASIC machine language file.
SAVEM command records a program in a machine language file in the following format.
+00 $00
+01-02 program byte length
+03-04 start address
+05-n program data
+n+1 $ff
+n+2-n+3 $00
+n+4-n+5 entry addres
+n+6 $1a(EOF mark = End Of File)
Please uncheck "Display FBASIC machine-language files as memory dump" in settings of D77Manager.
So you can see the FD sector dump of the machine language file.

Thanks a lot!
I will uncheck it.
So the extra zeros I am adding till the file is a certain length, aren't they necessary?
I think I received bad format file message when I didn't do that ... will try again
pere

Ps When I 'export' a binary file from a D77 file, the D77Manager creates a file on the PC that has a lot of zeros past the
end of file, so I thought they were mandatory!

Avatar de Usuario
pser1
Mensajes: 1984
Registrado: 08 Dic 2012 18:34
Agradecido : 184 veces
Agradecimiento recibido: 160 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 22 Jun 2017 16:07

malikto999 escribió:This is not a question of how to switch to FM77AV 320x200 4096 color mode, is not it?
Unfortunately, FM-7 does not support 320 x 200 resolution.
I will write about the arrangement and execution method of the program on the subsystem by another post.

Right, It was just a *desire* so that we could gain some 24K of free VRAM and working at 320x200 things would move faster, for sure
cheers
pere

Avatar de Usuario
pser1
Mensajes: 1984
Registrado: 08 Dic 2012 18:34
Agradecido : 184 veces
Agradecimiento recibido: 160 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 22 Jun 2017 18:56

Hi,
in the last test I have done to convert an image from the Tiburon (Shark) game for the Dragon64 to the FM-7,
I compiled the image without the extra zeros and it works flawlessly as malikto999 suggested
Now I need to know how could I save the VRAM to disk and how can I load it back later from within Basic (by now)
thanks beforehand
pere

Avatar de Usuario
pser1
Mensajes: 1984
Registrado: 08 Dic 2012 18:34
Agradecido : 184 veces
Agradecimiento recibido: 160 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 22 Jun 2017 20:00

malikto999 escribió:First, as far as I know, usage of FM-7's display subsystem was written clearly in most detail in the magazine "Oh! FM" January, 1985 issue.

Hello friends,
I have been searching for this magazine issue to download it ... but I have not found it.
Does anybody know the url where it could be found?
Thanks a bunch
pere

Avatar de Usuario
minter
Mensajes: 1207
Registrado: 22 Jul 2014 18:51
Agradecido : 425 veces
Agradecimiento recibido: 229 veces

Re: Thread in English for Fujitsu FM7

Mensajepor minter » 22 Jun 2017 21:01

pser1 escribió:
malikto999 escribió:First, as far as I know, usage of FM-7's display subsystem was written clearly in most detail in the magazine "Oh! FM" January, 1985 issue.

Hello friends,
I have been searching for this magazine issue to download it ... but I have not found it.
Does anybody know the url where it could be found?
Thanks a bunch
pere

I was trying to find it weeks ago. But nothing. :(

malikto999
Mensajes: 51
Registrado: 09 Jun 2017 11:20
Agradecimiento recibido: 49 veces

Re: Thread in English for Fujitsu FM7

Mensajepor malikto999 » 25 Jun 2017 04:44

pser1 escribió:Thanks a lot!
I will uncheck it.
So the extra zeros I am adding till the file is a certain length, aren't they necessary?
I think I received bad format file message when I didn't do that ... will try again
pere

Ps When I 'export' a binary file from a D77 file, the D77Manager creates a file on the PC that has a lot of zeros past the
end of file, so I thought they were mandatory!


The binary file format of F-BASIC exports sectors (1sector=256 bytes) of FD as it is, so there is an extra 0 at the end.
Just import does not check end 0, so it is unnecessary if you create your own file.

However, if the file size is less than 272 bytes in the format check at the time of import, it is set as an error.
This assumes header 16 bytes + sector 256 bytes (minimum 1 sector).

So please add 0 to the end if the imported file size is less than 272 bytes.

malikto999
Mensajes: 51
Registrado: 09 Jun 2017 11:20
Agradecimiento recibido: 49 veces

Re: Thread in English for Fujitsu FM7

Mensajepor malikto999 » 25 Jun 2017 04:48

pser1 escribió:Right, It was just a *desire* so that we could gain some 24K of free VRAM and working at 320x200 things would move faster, for sure
cheers
pere


I searched for Tiburon (Shark), but I did not know exactly what kind of game it was.
So, to write now is my personal imagination.

First of all, if the original screen resolution is 256×192 and ported to FM-7's 640×200, I think that it is good to create pattern data with the original size and double it horizontally when displaying it.
That will save memory.
As I wrote before, I think that the main side is better where to put the pattern data.Transfering every time you draw a pattern does not affect speed.

If you just want to put the pattern on the sub side, there is also a way to put the pattern data in one plane of the VRAM.
In this case, the number of usable colors becomes 4 colors. It will look like an old Apple II game screen.
Set the color palette so that the plane of the pattern data is not displayed on the screen.

In this method, if it is combined with the console buffer, an area of 20KB can be secured.

malikto999
Mensajes: 51
Registrado: 09 Jun 2017 11:20
Agradecimiento recibido: 49 veces

Re: Thread in English for Fujitsu FM7

Mensajepor malikto999 » 25 Jun 2017 04:51

pser1 escribió:Hi,
in the last test I have done to convert an image from the Tiburon (Shark) game for the Dragon64 to the FM-7,
I compiled the image without the extra zeros and it works flawlessly as malikto999 suggested
Now I need to know how could I save the VRAM to disk and how can I load it back later from within Basic (by now)
thanks beforehand
pere


Unfortunately, there is no function to save and load VRAM directly to disk with normal F-BASIC.
You can do it by combining the GET@A/PUT@A command with the SAVEM/LOADM command, but this is not practical.

In the old magazine, because there should have been an article to expand BASIC, and to save/road the screen, I look for it.
Please wait a while.

Avatar de Usuario
pser1
Mensajes: 1984
Registrado: 08 Dic 2012 18:34
Agradecido : 184 veces
Agradecimiento recibido: 160 veces

Re: Thread in English for Fujitsu FM7

Mensajepor pser1 » 25 Jun 2017 15:59

malikto999 escribió:The binary file format of F-BASIC exports sectors (1sector=256 bytes) of FD as it is, so there is an extra 0 at the end.
Just import does not check end 0, so it is unnecessary if you create your own file.
However, if the file size is less than 272 bytes in the format check at the time of import, it is set as an error.
This assumes header 16 bytes + sector 256 bytes (minimum 1 sector).
So please add 0 to the end if the imported file size is less than 272 bytes.

Thanks for that point!
Untill now all files compiled gave an output greater than 272 bytes, so this problem did not arise.
cheers
pere


Volver a “Fujitsu FM7”

¿Quién está conectado?

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