Skip to content

Commit

Permalink
3.9a release candidate
Browse files Browse the repository at this point in the history
Added OPL3 fix to have all channels rendered (in mono, no fpga space for stereo as rendering a second OPL3 sequencer requires too much logic), added a fix for SMX-HB keyboard SELECT key that was not working, added a possibility of emulating PS/2 keyboard Page Up and Page Down on SMX-HB keyboard through SELECT + UP and SELECT + DOWN so you can change master volume with keyboard as well use the autofire module by Hara-san!
  • Loading branch information
ducasp committed Apr 19, 2022
1 parent 21c28fa commit f7360fe
Show file tree
Hide file tree
Showing 170 changed files with 1,054 additions and 28 deletions.
17 changes: 13 additions & 4 deletions FPGA/ocm-pld v3.9a/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ brings to the table:
interrupt, not having IRQ and not having the proper scaler for timer
caused its timing to be slow, darn slow...

- Fix: I've fixed OPL3 sound rendering as it was discarding all information
that is on right output channel only, unfortunately we do not have enough
FPGA resources to run the sequencer for two channels, but a clever trick
allow all songs content to be properly played in MONO glory :P Try as an
example Doom soundtrack track 3 before updating and after updating it. :)

- Adds support to SMX-HB (as it has only initial support for OCM 3.7.1)

- Extra: I've allowed Joystick port debounce to be disabled, this perhaps
Expand All @@ -33,10 +39,13 @@ brings to the table:
as the internal keyboard of Hotbit is not standard and its map is very
peculiar, while PS/2 keyboards have a different mapping. DIP switch 9 set
to OFF is the default, using the internal mapping, if set to ON it will
use the mapping the firmware was built-in (my releases are usually for
Brazilian Keyboards, let me know if you need for a different layout that
is covered by KdL regular releases), that is handy when you want to use
an external keyboard.
use the mapping the firmware was built-in, that is handy when you want to
use an external keyboard.

- Fix: Select key was not working on original 3.7.1 based release, it works
now. Also, SELECT + UP and SELECT + DOWN replaces Page Up and Page Down,
so it is possible to activate the autofire module using only SMX-HB
internal keyboard.

- Missing: SMX-HB FPGA has less cells than other SM-X devices as it uses
a FPGA with about 70% of the capacity of the other devices, so it doesn't
Expand Down
77 changes: 77 additions & 0 deletions FPGA/ocm-pld v3.9a/firmware/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# FIRMWARE

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/R6R2BRGX6)

IMPORTANT! READ THIS AND BE CAREFUL! BRICKING YOUR 2nd GEN FPGA MSX ISN'T FUN!
IT IS A PAIN TO RESTORE IT USING JIC / USB BLASTER AS YOU WILL NEED TO CONNECT
IT TO AN USB BLASTER TO RESTORE IT. YOU HAVE BEEN WARNED! REALLY!

ONLY USE SMXFLASH.COM to update your 2nd Gen FPGA MSX (SM-X, SMX-HB, SM-X Mini,
SX2). ONLY USE A FIRMWARE THAT IS MEANT TO YOUR DEVICE. EACH DEVICE USE A
DIFFERENT SET OF CONNECTIONS, SOME USE DIFFERENT FPGAs, SO DO NOT EVER THINK OF
USING A 1ST GEN PLD FILE OR A 2ND GEN PLD FILE THAT DOESN'T CARRY YOUR DEVICE
NAME IN THE PACKAGE.

The version of SMXFLASH.COM that is sent along with the firmware files also
works on NEXTOR. Older versions of SMXFLASH.COM requires MSX DOS 2 Kernel to be
loaded. Why would you use other version? I have no idea. Read this fully and
be carefull to not have any issues. Command line to update:

SMXFLASH OCM_SM.PLD

Wait until it quits to the dos prompt telling it is done. If there is an error
message after it started erasing or writing, try again until it works, as if
you power it down with an unfinished update, it will BRICK and you will need
to use an USB Blaster and JIC file to restore it, like said above, a pain!

Also, be aware that if power fails during update, you are most likely to end up
with a bricked unit and you will need to use an USB Blaster and JIC file to
restore it, again, a pain!

How to choose the firmware?

1 - Obviously, you will download the one for your device. (i.e.: I have a SM-X,
so I get firmware files from folders that start with smx_)

2 - Next step is to find out if you want vanilla or Franky Sound version. If
you don't own a Franky cartridge or a Playsoniq cartridge, go ahead with the
Franky Sound version. If you have one of those two interfaces, a Franky or
Franky Sound version will conflict with your cartridge, so it is best to stick
with a vanilla version. (Vanilla means nothing after the device name)

3 - (FUTURE ONLY, NOT NOW) You've found out that your 2nd Gen device has
support for a FrankyFull version. If in 2 you would choose Franky Sound, then
seems like choosing FrankyFull (that has Master System VDP support) would be a
no brainer, right? Wrong... Unfortunately it is not possible to fit Master
System VDP / CRAM / VRAM along with OPL3. So if you like VGMPLAY and use it to
play OPL3 VGMs or have other uses for OPL3, you may prefer to use Franky Sound
version instead.

4 - WOW! That folder contains 16 different firmware files!!! I have no idea how
to choose from...

- Do not worry, first, let's get down to four different files, you do this
by figuring out your PS/2 Keyboard Layout, French, Spanish, Brazilian or
US. IMPORTANT: SD-BIOS DO NOT CHANGE Keyboard Layout, so it is important
to choose the correct one :)
- Now, you have four different versions, let's get down to two. Do you
prefer backslash symbol to be shown as a real backslash or do you prefer a
it to be shown as the yen symbol like japanese MSX's? Based on that, choose
yen or backslash. If you use SD-BIOS, then this is not relevant as the
SD-BIOS will override whatever is flashed in that regards
- Finally, you will have SINGLE EPBIOS or DUAL EPBIOS. On DUAL EPBIOS, if
you do not use a SD-BIOS, you can easily switch between Nextor or MSX Dos 2
kernel by flicking dip-switch 7. In the position for 4096 MB Mapper it will
use Nextor Kernel (this change needs turning the device off and then on to
take effect), in the position for 2048 MB Mapper it will use MSX Dos 2
Kernel. Single EPBIOS use only MSX Dos 2 Kernel. If you use SD-BIOS, then
this is not relevant as the SD-BIOS will override whatever is flashed in
that regards

5 - Now you have your firmware file, just use it :)

All source code and binaries:
(c)2022 Oduvaldo Pavan Junior - ducasp@gmail.com

All code can be re-used, re-written, derivative work can be sold, as long as the
source code of changes is made public as well.
65 changes: 65 additions & 0 deletions FPGA/ocm-pld v3.9a/firmware/smx/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# SMX

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/R6R2BRGX6)

IMPORTANT! READ THIS AND BE CAREFUL! BRICKING SM-X ISN'T FUN! IT IS A PAIN TO
RESTORE IT USING JIC / USB BLASTER AS YOU WILL NEED TO CONNECT IT TO AN USB
BLASTER TO RESTORE IT. YOU HAVE BEEN WARNED! REALLY!

ONLY USE SMXFLASH.COM to update your SM-X. ONLY USE A FIRMWARE THAT IS MEANT TO
SM-X. NO, SMX-HB firmware IS NOT COMPATIBLE. SM-X MINI firmware IS NOT
COMPATIBLE. SX2 firmware IS NOT COMPATIBLE. IF THE FIRMWARE IS NOT SAYING IT
IS FOR SM-X STAY AWAY FROM IT.

The version of SMXFLASH.COM that is sent along with the firmware file also
works on NEXTOR. Older versions of SMXFLASH.COM requires MSX DOS 2 Kernel to be
loaded. Why would you use other version? I have no idea. Read this fully and
be carefull to not have any issues. Command line to update:

SMXFLASH OCM_SM.PLD

Wait until it quits to the dos prompt telling it is done. If there is an error
message after it started erasing or writing, try again until it works, as if
you power it down with an unfinished update, it will BRICK and you will need
to use an USB Blaster and JIC file to restore it, like said above, a pain!

Also, be aware that if power fails during update, you are most likely to end up
with a bricked unit and you will need to use an USB Blaster and JIC file to
restore it, again, a pain!

OCM-PLD v3.9a is an extension on KdL OCM release v3.9. What this extension
brings to the table on this version:

- Fix: I've fixed OPL3, it had two issues that prevented it to work with
the latest VGMPlay version:

- IRQ was not connected, so timers programmed wouldn't trigger,
instead only the VDP interrupt, to slow, so music would play darn
slow with VGMPlay.

- Even after fixing that, playing speed was almost half of the correct
speed for VGMs. The timer scaler was not properly set causing it to
trigger slower than programmed.

Since VGMPlay 1.3 relies on OPL3 timer when present to drive a high speed
interrupt, not having IRQ and not having the proper scaler for timer
caused its timing to be slow, darn slow...

- Fix: I've fixed OPL3 sound rendering as it was discarding all information
that is on right output channel only, unfortunately we do not have enough
FPGA resources to run the sequencer for two channels, but a clever trick
allow all songs content to be properly played in MONO glory :P Try as an
example Doom soundtrack track 3 before updating and after updating it. :)

- Planned for the future SM-X, SM-X mini and SX-2 will have a franky build:

- Missing: FPGA in those devices can't fit OPL3 along with Franky VDP and
PSG, so that build won't have OPL3 support.

- Extra: this is a WIP, please wait, but it will have Franky VDP :P

All source code and binaries:
(c)2022 Oduvaldo Pavan Junior - ducasp@gmail.com

All code can be re-used, re-written, derivative work can be sold, as long as the
source code of changes is made public as well.
67 changes: 67 additions & 0 deletions FPGA/ocm-pld v3.9a/firmware/smx/README.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# SMX

Do you like what I do and want to pay me a Coffee as a thank you?
https://ko-fi.com/R6R2BRGX6
Just do it if you feel like it :)

IMPORTANT! READ THIS AND BE CAREFUL! BRICKING SM-X ISN'T FUN! IT IS A PAIN TO
RESTORE IT USING JIC / USB BLASTER AS YOU WILL NEED TO CONNECT IT TO AN USB
BLASTER TO RESTORE IT. YOU HAVE BEEN WARNED! REALLY!

ONLY USE SMXFLASH.COM to update your SM-X. ONLY USE A FIRMWARE THAT IS MEANT TO
SM-X. NO, SMX-HB firmware IS NOT COMPATIBLE. SM-X MINI firmware IS NOT
COMPATIBLE. SX2 firmware IS NOT COMPATIBLE. IF THE FIRMWARE IS NOT SAYING IT
IS FOR SM-X STAY AWAY FROM IT.

The version of SMXFLASH.COM that is sent along with the firmware file also
works on NEXTOR. Older versions of SMXFLASH.COM requires MSX DOS 2 Kernel to be
loaded. Why would you use other version? I have no idea. Read this fully and
be carefull to not have any issues. Command line to update:

SMXFLASH OCM_SM.PLD

Wait until it quits to the dos prompt telling it is done. If there is an error
message after it started erasing or writing, try again until it works, as if
you power it down with an unfinished update, it will BRICK and you will need
to use an USB Blaster and JIC file to restore it, like said above, a pain!

Also, be aware that if power fails during update, you are most likely to end up
with a bricked unit and you will need to use an USB Blaster and JIC file to
restore it, again, a pain!

OCM-PLD v3.9a is an extension on KdL OCM release v3.9. What this extension
brings to the table on this version:

- Fix: I've fixed OPL3, it had two issues that prevented it to work with
the latest VGMPlay version:

- IRQ was not connected, so timers programmed wouldn't trigger,
instead only the VDP interrupt, to slow, so music would play darn
slow with VGMPlay.

- Even after fixing that, playing speed was almost half of the correct
speed for VGMs. The timer scaler was not properly set causing it to
trigger slower than programmed.

Since VGMPlay 1.3 relies on OPL3 timer when present to drive a high speed
interrupt, not having IRQ and not having the proper scaler for timer
caused its timing to be slow, darn slow...

- Fix: I've fixed OPL3 sound rendering as it was discarding all information
that is on right output channel only, unfortunately we do not have enough
FPGA resources to run the sequencer for two channels, but a clever trick
allow all songs content to be properly played in MONO glory :P Try as an
example Doom soundtrack track 3 before updating and after updating it. :)

- Planned for the future SM-X, SM-X mini and SX-2 will have a franky build:

- Missing: FPGA in those devices can't fit OPL3 along with Franky VDP and
PSG, so that build won't have OPL3 support.

- Extra: this is a WIP, please wait, but it will have Franky VDP :P

All source code and binaries:
(c)2022 Oduvaldo Pavan Junior - ducasp@gmail.com

All code can be re-used, re-written, derivative work can be sold, as long as the
source code of changes is made public as well.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions FPGA/ocm-pld v3.9a/firmware/smx_frankysnd/README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,12 @@ brings to the table on this frankysnd version:
interrupt, not having IRQ and not having the proper scaler for timer
caused its timing to be slow, darn slow...

- Fix: I've fixed OPL3 sound rendering as it was discarding all information
that is on right output channel only, unfortunately we do not have enough
FPGA resources to run the sequencer for two channels, but a clever trick
allow all songs content to be properly played in MONO glory :P Try as an
example Doom soundtrack track 3 before updating and after updating it. :)

- Planned for the future SM-X, SM-X mini and SX-2 will have a franky build:

- Missing: FPGA in those devices can't fit OPL3 along with Franky VDP and
Expand Down
6 changes: 6 additions & 0 deletions FPGA/ocm-pld v3.9a/firmware/smx_frankysnd/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ brings to the table on this frankysnd version:
interrupt, not having IRQ and not having the proper scaler for timer
caused its timing to be slow, darn slow...

- Fix: I've fixed OPL3 sound rendering as it was discarding all information
that is on right output channel only, unfortunately we do not have enough
FPGA resources to run the sequencer for two channels, but a clever trick
allow all songs content to be properly played in MONO glory :P Try as an
example Doom soundtrack track 3 before updating and after updating it. :)

- Planned for the future SM-X, SM-X mini and SX-2 will have a franky build:

- Missing: FPGA in those devices can't fit OPL3 along with Franky VDP and
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
84 changes: 84 additions & 0 deletions FPGA/ocm-pld v3.9a/firmware/smxhb/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
# SMXHB

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/R6R2BRGX6)

IMPORTANT! READ THIS AND BE CAREFUL! BRICKING SMX-HB ISN'T FUN! IT IS A PAIN
TO RESTORE IT USING JIC / USB BLASTER AS YOU WILL NEED TO DISASSEMBLE IT, TAKE
OUT THE FPGA BOARD, FEED IT WITH AN EXTERNAL POWER SUPPLY AND CONNECT IT TO AN
USB BLASTER TO RESTORE IT. THE JTAG CONNECTOR IS NOT ACCESSIBLE WITH HOTBIT
CASE ASSEMBLED, AND IT IS NOT ACCESSIBLE WITH THE FPGA BOARD CONNECTED TO THE
SMX-HB MOTHERBOARD. YOU HAVE BEEN WARNED! REALLY!

ONLY USE SMXFLASH.COM to update your SMX-HB. ONLY USE A FIRMWARE THAT IS MEANT
TO SMX-HB. NO, SM-X firmware IS NOT COMPATIBLE. SM-X MINI firmware IS NOT
COMPATIBLE. SX2 firmware IS NOT COMPATIBLE. IF THE FIRMWARE IS NOT SAYING IT
IS FOR SMX-HB STAY AWAY FROM IT.

The version of SMXFLASH.COM that is sent along with the firmware file also
works on NEXTOR. Older versions of SMXFLASH.COM requires MSX DOS 2 Kernel to be
loaded. Why would you use other version? I have no idea. Read this fully and
be careful to not have any issues. Command line to update:

SMXFLASH OCM_SM.PLD

Wait until it quits to the dos prompt telling it is done. If there is an error
message after it started erasing or writing, try again until it works, as if
you power it down with an unfinished update, it will BRICK and you will need
to use an USB Blaster and JIC file to restore it, like said above, a pain!

Also, be aware that if power fails during update, you are most likely to end up
with a bricked unit and you will need to use an USB Blaster and JIC file to
restore it, again, a pain!

OCM-PLD v3.9a is an extension on KdL OCM release v3.9. What this extension
brings to the table:

- Adds support to SMX-HB (as it has only initial support for OCM 3.7.1)

- Extra: I've allowed Joystick port debounce to be disabled, this perhaps
can alleviate the issues some users were having with paddles. To turn off
Joystick port debounce use the command SETSMART -89 , to turn it back on
use the command SETSMART -8A , power cycle will restore default, on.

- Extra: I've added support to different keyboard map tables. This is handy
as the internal keyboard of Hotbit is not standard and its map is very
peculiar, while PS/2 keyboards have a different mapping. DIP switch 9 set
to OFF is the default, using the internal mapping, if set to ON it will
use the mapping the firmware was built-in, that is handy when you want to
use an external keyboard.

- Fix: Select key was not working on original 3.7.1 based release, it works
now. Also, SELECT + UP and SELECT + DOWN replaces Page Up and Page Down,
so it is possible to activate the autofire module using only SMX-HB
internal keyboard.

- Missing: SMX-HB FPGA has less cells than other SM-X devices as it uses
a FPGA with about 70% of the capacity of the other devices, so it doesn't
support OPL3 as it won't fit

- Adds to regular SMX-HB as a frankysnd build:

- Extra: I've added partial support to a built-in Franky. That partial
support is good enough to work with SG1000, COL4MMM (using COM\Franky
versions) VGMPLAY and Sofarun (remember to set it to use MSX VDP and
Franky's PSG). As Franky sound uses I/O ports 0x48 and 0x49, and those
ports are part of the switched I/O, it is usually disabled, as OCM IPL
loader will leave switched I/O selected after booting. There are
different ways to enable Franky sound:

- VGMPLAY will automatically disable switched I/O, so you can play a
VGM song that uses SN76489 and after exiting VGMPLAY you can use other
software.

- De-select the internal switched I/O by sending the basic command
OUT &H40,0

- Use SETSMART -8C to enable the I/O ports 0x48 and 0x49 for that, so
any program relying on reading OCM information on those ports won't
get it.

All source code and binaries:
(c)2022 Oduvaldo Pavan Junior - ducasp@gmail.com

All code can be re-used, re-written, derivative work can be sold, as long as the
source code of changes is made public as well.

0 comments on commit f7360fe

Please sign in to comment.