FM77AV - learning how to program it (english thread)
- pser1
- Mensajes: 3965
- Registrado: 08 Dic 2012 18:34
- Agradecido : 1247 veces
- Agradecimiento recibido: 1103 veces
FM77AV - learning how to program it (english thread)
Hello everybody,
we are lucky to have Malik back to Retrowiki forums to help us understand the special features of this machine
Hope you won't mind to write here in english to make thing seasier to Malik
Thanks in advance to all of you
Pere
we are lucky to have Malik back to Retrowiki forums to help us understand the special features of this machine
Hope you won't mind to write here in english to make thing seasier to Malik
Thanks in advance to all of you
Pere
-
- Mensajes: 133
- Registrado: 09 Jun 2017 11:20
- Agradecimiento recibido: 167 veces
Re: FM77AV - knowing how to program it (english thread)
The memory specifications of FM77AV are as follows.
MAIN RAM:128KB (maximum 192KB)
SUB RAM:5KB, VRAM:96KB
The above memories are assigned unique addresses called physical addresses.
$00000-$0FFFF: RAM space (64KB)
$10000-$1FFFF: SUB CPU space during direct access (64KB)
$20000-$2FFFF: Extended memory space (64KB)
$30000-$3FFFF: Standard space(64KB)
1.RAM space ($00000-$0FFFF)
Used by FBASIC3.3. In the case of FBASIC3.0, it can be used freely as a free area.
2.SUB CPU space during direct access ($10000-$1FFFF)
When the SUB CPU is HALT, the SUB CPU memory is mapped to this area.
It will be possible to access VRAM, Work area, and I/O on the sub CPU side from the main CPU side via MMR.
This feature is called "direct access".
3. Extended memory space ($20000-$2FFFF)
It can be used as free memory by installing an optional expansion memory card.
Unfortunately, the English version of XM7 does not seem to be able to use additional memory cards.
4.Standard space ($30000-$3FFFF)
This area is mapped to the CPU space when booting FBASIC3.0 or when MMR is disabled.
On the other hand, the 64KB memory area ($0000-$FFFF) that the 6809CPU can access is called CPU space.
CPU space can map arbitrary physical addresses for each 4096-byte area when MMR is enabled.
When running FBASIC3.0, physical addresses are mapped to CPU addresses as follows.
CPU physical
---------------------------
$0000-$0FFF <- $30000-$30FFF
$1000-$1FFF <- $31000-$31FFF
$2000-$2FFF <- $32000-$30FFF
:
$D000-$DFFF <- $3D000-$3DFFF
$E000-$EFFF <- $3E000-$3EFFF
$F000-$FFFF <- $3F000-$3FFFF
The above is the outline of the memory of FM77AV. Next, I will write about the function of MMR memory mapping.
MAIN RAM:128KB (maximum 192KB)
SUB RAM:5KB, VRAM:96KB
The above memories are assigned unique addresses called physical addresses.
$00000-$0FFFF: RAM space (64KB)
$10000-$1FFFF: SUB CPU space during direct access (64KB)
$20000-$2FFFF: Extended memory space (64KB)
$30000-$3FFFF: Standard space(64KB)
1.RAM space ($00000-$0FFFF)
Used by FBASIC3.3. In the case of FBASIC3.0, it can be used freely as a free area.
2.SUB CPU space during direct access ($10000-$1FFFF)
When the SUB CPU is HALT, the SUB CPU memory is mapped to this area.
It will be possible to access VRAM, Work area, and I/O on the sub CPU side from the main CPU side via MMR.
This feature is called "direct access".
3. Extended memory space ($20000-$2FFFF)
It can be used as free memory by installing an optional expansion memory card.
Unfortunately, the English version of XM7 does not seem to be able to use additional memory cards.
4.Standard space ($30000-$3FFFF)
This area is mapped to the CPU space when booting FBASIC3.0 or when MMR is disabled.
On the other hand, the 64KB memory area ($0000-$FFFF) that the 6809CPU can access is called CPU space.
CPU space can map arbitrary physical addresses for each 4096-byte area when MMR is enabled.
When running FBASIC3.0, physical addresses are mapped to CPU addresses as follows.
CPU physical
---------------------------
$0000-$0FFF <- $30000-$30FFF
$1000-$1FFF <- $31000-$31FFF
$2000-$2FFF <- $32000-$30FFF
:
$D000-$DFFF <- $3D000-$3DFFF
$E000-$EFFF <- $3E000-$3EFFF
$F000-$FFFF <- $3F000-$3FFFF
The above is the outline of the memory of FM77AV. Next, I will write about the function of MMR memory mapping.
-
- Mensajes: 5448
- Registrado: 20 Sep 2011 13:59
- Ubicación: Madrid
- Agradecido : 927 veces
- Agradecimiento recibido: 1955 veces
- Contactar:
Re: FM77AV - knowing how to program it (english thread)
It's great to see you here again malikto999!. This thread would be a nice reading for sure 

- pser1
- Mensajes: 3965
- Registrado: 08 Dic 2012 18:34
- Agradecido : 1247 veces
- Agradecimiento recibido: 1103 veces
Re: FM77AV - knowing how to program it (english thread)
Hi,
if I get it correctly, using FBASIC3.0 the machine 'sees' only 64Kb so as a normal FM-7
The only way to take advantage of the 128Kb is by using the MMR but even then we will work
with 16 slots occupying 64Kb that will be mapping any 4Kb chunk in the FM77AV, right?
This reminds a bit the MMU used by the CoCo3 to deal with up to 2Mb
This computer has 96Kb of VRAM, so double than FM-7 ...
This means that there has to be a trick to write/read to/from that big amount of VRAM
because it extends beyond the 64Kb access limit, but I am sure we will learn that in your
next mesage about the MMR .. I hope!
Someone has told me that Oh!FM 1989, May has a lot of info about the I/O system for
that machine. Is that correct or is it only related to the later machines AV20/40 EX/SX?
cheers!
pere
Ps By the way, I found the Oh!FM issue from 1986, January in an auction and I did buy it
I will need to scan a lot of pages and then download a good OCR translator in order to
have it in plain english.
@jltursan
I am sure you will tell me what is the best software to do that!
if I get it correctly, using FBASIC3.0 the machine 'sees' only 64Kb so as a normal FM-7
The only way to take advantage of the 128Kb is by using the MMR but even then we will work
with 16 slots occupying 64Kb that will be mapping any 4Kb chunk in the FM77AV, right?
This reminds a bit the MMU used by the CoCo3 to deal with up to 2Mb
This computer has 96Kb of VRAM, so double than FM-7 ...
This means that there has to be a trick to write/read to/from that big amount of VRAM
because it extends beyond the 64Kb access limit, but I am sure we will learn that in your
next mesage about the MMR .. I hope!
Someone has told me that Oh!FM 1989, May has a lot of info about the I/O system for
that machine. Is that correct or is it only related to the later machines AV20/40 EX/SX?
cheers!
pere
Ps By the way, I found the Oh!FM issue from 1986, January in an auction and I did buy it
I will need to scan a lot of pages and then download a good OCR translator in order to
have it in plain english.
@jltursan
I am sure you will tell me what is the best software to do that!
-
- Mensajes: 133
- Registrado: 09 Jun 2017 11:20
- Agradecimiento recibido: 167 veces
Re: FM77AV - knowing how to program it (english thread)
This time it is how to use memory mapping by MMR.
The memory mapping function manages a maximum memory space of 256KB ($00000-$3FFFF) by allocating the 64KB CPU space to physical addresses in 4KB units.
The memory mapping feature is enabled by setting bit 7 of the Mode Select Register ($FD93) to 1. Memory mapping function is prohibited because it is initialized to $00 at reset.
The memory mapping function is controlled by MMR (Memory Management Registers: $FD80-$FD8F) and MSR (Memory Segment Register: $FD90).
The last 4 bits of MMR correspond to the upper 4 bits of the CPU address. That is, $FD80 is $0000-$0FFF, $FD81 is $1000-$1FFF...
$FD8F is mapped to $F000-$FBFF. Shared RAM and main I/O reside in CPU addresses $FC00-$FFFF.
MSR is a preset of memory mapping information. The MMR memory mapping information is stored in each of the 4 segments.
By changing the segment, you can switch memory mapping for 64KB without remapping individual MMRs.
How to use MMR specifically is as follows.
1. Segment selection
With bit 7 of $FD93 set to 0, write the target segment (0-3) to the MSR.
2. Initialize MMR
Write mapping information to $FD80-$FD8F. ($30-$3F for standard space)
Repeat steps 1-2 for as many segments as you want.
3. Enable memory mapping
Write a 1 to bit 7 of $FD93. The memory mapping feature is now enabled.
After that, you can change the segments and MMR mappings as needed.
Please refer to the attached sample source for direct access using MMR.
There is one caveat about MSR. Since $FD90 is write-only, it is necessary to manage the currently set segment by yourself using work or the like.
The memory mapping function manages a maximum memory space of 256KB ($00000-$3FFFF) by allocating the 64KB CPU space to physical addresses in 4KB units.
The memory mapping feature is enabled by setting bit 7 of the Mode Select Register ($FD93) to 1. Memory mapping function is prohibited because it is initialized to $00 at reset.
The memory mapping function is controlled by MMR (Memory Management Registers: $FD80-$FD8F) and MSR (Memory Segment Register: $FD90).
The last 4 bits of MMR correspond to the upper 4 bits of the CPU address. That is, $FD80 is $0000-$0FFF, $FD81 is $1000-$1FFF...
$FD8F is mapped to $F000-$FBFF. Shared RAM and main I/O reside in CPU addresses $FC00-$FFFF.
MSR is a preset of memory mapping information. The MMR memory mapping information is stored in each of the 4 segments.
By changing the segment, you can switch memory mapping for 64KB without remapping individual MMRs.
How to use MMR specifically is as follows.
1. Segment selection
With bit 7 of $FD93 set to 0, write the target segment (0-3) to the MSR.
2. Initialize MMR
Write mapping information to $FD80-$FD8F. ($30-$3F for standard space)
Repeat steps 1-2 for as many segments as you want.
3. Enable memory mapping
Write a 1 to bit 7 of $FD93. The memory mapping feature is now enabled.
After that, you can change the segments and MMR mappings as needed.
Please refer to the attached sample source for direct access using MMR.
There is one caveat about MSR. Since $FD90 is write-only, it is necessary to manage the currently set segment by yourself using work or the like.
- Adjuntos
-
- MMRSAMPLE.zip
- (1.04 KiB) Descargado 32 veces
-
- Mensajes: 133
- Registrado: 09 Jun 2017 11:20
- Agradecimiento recibido: 167 veces
Re: FM77AV - knowing how to program it (english thread)
pser1 escribió:Hi,
if I get it correctly, using FBASIC3.0 the machine 'sees' only 64Kb so as a normal FM-7
The only way to take advantage of the 128Kb is by using the MMR but even then we will work
with 16 slots occupying 64Kb that will be mapping any 4Kb chunk in the FM77AV, right?
This reminds a bit the MMU used by the CoCo3 to deal with up to 2Mb
This computer has 96Kb of VRAM, so double than FM-7 ...
This means that there has to be a trick to write/read to/from that big amount of VRAM
because it extends beyond the 64Kb access limit, but I am sure we will learn that in your
next mesage about the MMR .. I hope!
Someone has told me that Oh!FM 1989, May has a lot of info about the I/O system for
that machine. Is that correct or is it only related to the later machines AV20/40 EX/SX?
cheers!
pere
Ps By the way, I found the Oh!FM issue from 1986, January in an auction and I did buy it
I will need to scan a lot of pages and then download a good OCR translator in order to
have it in plain english.
@jltursan
I am sure you will tell me what is the best software to do that!
yes. I would like to introduce the FM77AV subsystem next.
As for VRAM, 48KB from $0000 to $BFFF of the sub-CPU memory is allocated to VRAM just like FM-7.
In the case of FM77AV, there are two pages of this area, and the total VRAM is 96KB.
Page switching is performed by sub I/O operation.
The feature article in the May 89 issue of Oh!FM is "How to make full use of the FM-7 series".
I looked at the contents, but there are no new technical explanations such as general knowledge of FM-7, how to use FBIOS and subsystems, etc.
Maybe it's all you already know.
On the other hand, the main CPU and sub CPU I/O maps cover the entire FM-7 series, so I think it's worth a reference.
There is also an annotation of the target model, so it is not limited to AV20/40 EX/SX.
There is also a reference of subsystem graphics commands that covers all subsystems and may help if you don't have a reference.
(However, there is no detailed explanation for each command.)
-
- Mensajes: 5448
- Registrado: 20 Sep 2011 13:59
- Ubicación: Madrid
- Agradecido : 927 veces
- Agradecimiento recibido: 1955 veces
- Contactar:
Re: FM77AV - knowing how to program it (english thread)
pser1 escribió:Ps By the way, I found the Oh!FM issue from 1986, January in an auction and I did buy it
I will need to scan a lot of pages and then download a good OCR translator in order to
have it in plain english.
@jltursan
I am sure you will tell me what is the best software to do that!
Cool!, once scanned you can try with Capture2Text. It gives great results and has a handy interface, maybe not the most common but really great when you need a quick translation.
Oh, and btw, look what I've found between my papers...
Could it be the CPU I/O map malikto999 is talking about?, seems to cover all FM family.
- pser1
- Mensajes: 3965
- Registrado: 08 Dic 2012 18:34
- Agradecido : 1247 veces
- Agradecimiento recibido: 1103 veces
Re: FM77AV - knowing how to program it (english thread)
jltursan escribió:Cool!, once scanned you can try with Capture2Text. It gives great results and has a handy interface, maybe not the most common but really great when you need a quick translation.
Oh, and btw, look what I've found between my papers...
IO.ZIP
Could it be the CPU I/O map malikto999 is talking about?, seems to cover all FM family.
That's great news. Just downloaded the zip, will have a peek at it, might be the article from the 1989,May magazine ...
I will have to wait for the Oh!FM magazine to arrive ... holidays may delay even more the delivery.
cheers!
pere
-
- Mensajes: 133
- Registrado: 09 Jun 2017 11:20
- Agradecimiento recibido: 167 veces
Re: FM77AV - knowing how to program it (english thread)
jltursan escribió:Oh, and btw, look what I've found between my papers...
IO.ZIP
Could it be the CPU I/O map malikto999 is talking about?, seems to cover all FM family.
Ah, this is it.
The layout is exactly the same, so I think it's a scan of the May 89 issue of Oh!FM.
-
- Mensajes: 133
- Registrado: 09 Jun 2017 11:20
- Agradecimiento recibido: 167 veces
Re: FM77AV - knowing how to program it (english thread)
This time I will write about subsystems. Please refer to the attached file for the memory map of the subsystem and VRAM.
FM77AV has three subsystems, A, B, and C.
Type A: 640*200 8 color screen (FM77AV only)
Type B: 320*200 4096 color screen (FM77AV only)
Type C: 640*200 8 color screen (FM-7 compatible)
*In addition, the FM series as a whole includes Type D (FM77AV40 640*400 8 color screen) and Type E (320*200 260K color screen).
Type A is upward compatible with the FM-7 subsystem. You can use functions such as real-time clock and real-time key scan unique to FM77AV.
In addition, a dedicated LSI draws LINE graphics at high speed. Therefore, switching to Type A after booting with FBASIC V3.0 has the effect of speeding up BASIC graphics instructions.
Type B is a 320*200 4096 color screen. Since there are 4 plains for each B/R/G, 16 levels (2*2*2*2) can be specified for each. Therefore, 4096 colors can be displayed with B*R*G=16*16*16.
VRAM is divided into 2 pages of 48KB each, which is switched by bit 5 of $D430 of subsystem I/O.
Any color (0 to 4095) can be assigned to the 0 to 4095 color code using the analog palette. There is a technique to take advantage of this and set a palette for Page0 for the background and Page1 for the character, and use each as a 64-color screen. (The concept is the same as the method of superimposing "SHARK" on this bulletin board.) This is called 64-color dual-screen mode. It's actually a pseudo mode, but Fujitsu has officially included this function in their manuals, and many FM77AV game software on the market uses this function.
Type C is an FM-7 compatible subsystem. This subsystem is the default when booting ROM mode or FBASIC V3.0. In this case, FM77AV specific functions cannot be used.
Each subsystem can be switched by main I/O.
Please refer to the attached sample for details.
FM77AV has three subsystems, A, B, and C.
Type A: 640*200 8 color screen (FM77AV only)
Type B: 320*200 4096 color screen (FM77AV only)
Type C: 640*200 8 color screen (FM-7 compatible)
*In addition, the FM series as a whole includes Type D (FM77AV40 640*400 8 color screen) and Type E (320*200 260K color screen).
Type A is upward compatible with the FM-7 subsystem. You can use functions such as real-time clock and real-time key scan unique to FM77AV.
In addition, a dedicated LSI draws LINE graphics at high speed. Therefore, switching to Type A after booting with FBASIC V3.0 has the effect of speeding up BASIC graphics instructions.
Type B is a 320*200 4096 color screen. Since there are 4 plains for each B/R/G, 16 levels (2*2*2*2) can be specified for each. Therefore, 4096 colors can be displayed with B*R*G=16*16*16.
VRAM is divided into 2 pages of 48KB each, which is switched by bit 5 of $D430 of subsystem I/O.
Any color (0 to 4095) can be assigned to the 0 to 4095 color code using the analog palette. There is a technique to take advantage of this and set a palette for Page0 for the background and Page1 for the character, and use each as a 64-color screen. (The concept is the same as the method of superimposing "SHARK" on this bulletin board.) This is called 64-color dual-screen mode. It's actually a pseudo mode, but Fujitsu has officially included this function in their manuals, and many FM77AV game software on the market uses this function.
Type C is an FM-7 compatible subsystem. This subsystem is the default when booting ROM mode or FBASIC V3.0. In this case, FM77AV specific functions cannot be used.
Each subsystem can be switched by main I/O.
Please refer to the attached sample for details.
- Adjuntos
-
- SUBMODE.zip
- (792 Bytes) Descargado 34 veces
-
- FM77AV_SUBSYSTEM_MEMORY_MAP.zip
- (571 Bytes) Descargado 29 veces
- pser1
- Mensajes: 3965
- Registrado: 08 Dic 2012 18:34
- Agradecido : 1247 veces
- Agradecimiento recibido: 1103 veces
Re: FM77AV - knowing how to program it (english thread)
Thanks a lot, Malik
now we have info enough to make some experiments in order to practice these FM77AV features.
I really love the 64-color dual-screen mode.
This could be a good way to convert Shark/Tiburon for the FM77AV.
cheers!
pere
now we have info enough to make some experiments in order to practice these FM77AV features.
I really love the 64-color dual-screen mode.
This could be a good way to convert Shark/Tiburon for the FM77AV.
cheers!
pere
-
- Mensajes: 5448
- Registrado: 20 Sep 2011 13:59
- Ubicación: Madrid
- Agradecido : 927 veces
- Agradecimiento recibido: 1955 veces
- Contactar:
Re: FM77AV - knowing how to program it (english thread)
I know that the 77AV family doesn't have hardware sprites; but I wonder..., is there any "blitter", custom chip or DMA-alike support to speed up memory transfers with the subsystem's VRAM?.
There're some impressive graphic specs in these modes; but seems too much data for the "humble" 6809 to transfer...
There're some impressive graphic specs in these modes; but seems too much data for the "humble" 6809 to transfer...
- pser1
- Mensajes: 3965
- Registrado: 08 Dic 2012 18:34
- Agradecido : 1247 veces
- Agradecimiento recibido: 1103 veces
Re: FM77AV - knowing how to program it (english thread)
Hello,
today I have compiled the source file named MMRSAMPLE that Malik uploaded here.
Without any change, it has created the Motorola file, added to the template disk once named TEST01
and copied to the XM7 folder.
The starting program now reads
10 LOADM"GAME",,R
Of course I have changed XM7 configuration so that it uses FM77AV
Well, once XM7 starts, the d77 file is loaded and the basic starter is called but it simply hangs
doing nothing at all. I mean black screen
If I press ALT+F12, the program aborts with message
Abort In 10
Ready
But if now I enter this:
LOADM"GAME":EXEC&H1000
It works just fine
Am I forgetting something to execute the program from the Basic start program?
thanks in advance
pere
today I have compiled the source file named MMRSAMPLE that Malik uploaded here.
Without any change, it has created the Motorola file, added to the template disk once named TEST01
and copied to the XM7 folder.
The starting program now reads
10 LOADM"GAME",,R
Of course I have changed XM7 configuration so that it uses FM77AV
Well, once XM7 starts, the d77 file is loaded and the basic starter is called but it simply hangs
doing nothing at all. I mean black screen

If I press ALT+F12, the program aborts with message
Abort In 10
Ready
But if now I enter this:
LOADM"GAME":EXEC&H1000
It works just fine
Am I forgetting something to execute the program from the Basic start program?
thanks in advance
pere
- pser1
- Mensajes: 3965
- Registrado: 08 Dic 2012 18:34
- Agradecido : 1247 veces
- Agradecimiento recibido: 1103 veces
Re: FM77AV - knowing how to program it (english thread)
I don't know the reason why it happens, but editting the STARTUP file so that it reads
10 LOADM"0:GAME":EXEC&H1000
works well for the tests, but of course will fail for any other program that doesn't start at $1000
Any ideas about how to solve that?
cheers!
pere
10 LOADM"0:GAME":EXEC&H1000
works well for the tests, but of course will fail for any other program that doesn't start at $1000
Any ideas about how to solve that?
cheers!
pere
- pser1
- Mensajes: 3965
- Registrado: 08 Dic 2012 18:34
- Agradecido : 1247 veces
- Agradecimiento recibido: 1103 veces
Re: FM77AV - knowing how to program it (english thread)
Hello,
After testing the first example MMRSAMPLE as it was uploaded here by Malik, I have tried to add access to the other three colour planes
I have got an example that paints thin bars that repeat every four.
First from the left is blue (it writes also on fourth column)
Next is red that writes also on fourth column
Third one is Green that also writes on fourth column
When a plane is done, the program waits for the user to press 'C'. Carefull, *must* be UpperCase!
You will see how they are added and the effect on the fourth column
Once drawn the three planes pressing 'C' will exit the program
Next step will be practicing with SUBMODE example by Malik!
I attach here the source file, the d77 virtual file and the TEMPLATE I am using to autostart the programs
Besides I am attaching three screenshots showing the result of each plane ...
cheers!
pere
After testing the first example MMRSAMPLE as it was uploaded here by Malik, I have tried to add access to the other three colour planes
I have got an example that paints thin bars that repeat every four.
First from the left is blue (it writes also on fourth column)
Next is red that writes also on fourth column
Third one is Green that also writes on fourth column
When a plane is done, the program waits for the user to press 'C'. Carefull, *must* be UpperCase!
You will see how they are added and the effect on the fourth column
Once drawn the three planes pressing 'C' will exit the program
Next step will be practicing with SUBMODE example by Malik!
I attach here the source file, the d77 virtual file and the TEMPLATE I am using to autostart the programs
Besides I am attaching three screenshots showing the result of each plane ...
cheers!
pere
-
- Mensajes: 133
- Registrado: 09 Jun 2017 11:20
- Agradecimiento recibido: 167 veces
Re: FM77AV - knowing how to program it (english thread)
pser1 escribió:I don't know the reason why it happens, but editting the STARTUP file so that it reads
10 LOADM"0:GAME":EXEC&H1000
works well for the tests, but of course will fail for any other program that doesn't start at $1000
Any ideas about how to solve that?
cheers!
pere
You wrote that you set the following in AUTOUTY.
pser1 escribió:I imported the program into the SHARK.d77 and loaded it to run it and configure 2 drives 15 files ...works perfectly. Thanks a lot
Perhaps the number of files specified is too large and is interfering with the system stack.
(I don't know why it works fine when divided into LOAD and EXEC instructions...)
What happens if you change the number of files in AUTOUTY to the default of 2?
¿Quién está conectado?
Usuarios navegando por este Foro: No hay usuarios registrados visitando el Foro y 1 invitado