Skip to content
This repository has been archived by the owner on Oct 16, 2021. It is now read-only.

MMC5 pulse phase reset Support. #122

Open
B00daW opened this issue Jul 25, 2018 · 1 comment · Fixed by Dn-Programming-Core-Management/Dn-FamiTracker#156
Open

MMC5 pulse phase reset Support. #122

B00daW opened this issue Jul 25, 2018 · 1 comment · Fixed by Dn-Programming-Core-Management/Dn-FamiTracker#156
Labels

Comments

@B00daW
Copy link

B00daW commented Jul 25, 2018

Phase reset works on hardware by doing the below pseudocode:

SAVE current MMC5 pulse channel x period state to blah
WRITE %xxxxx000.00000000 to MMC5 pulse channel x period
WRITE blah back to MMC5 pulse channel x period

The command is already assigned to H00/I00 for the 2a0x pulse channels.

Not all emulators support period values of MMC5 >0x08 due to inaccuracy. FamiTracker seems to emulate them.

@B00daW
Copy link
Author

B00daW commented Jul 26, 2018

not certain, but this may work for MMC5 pulse phase reset
in "player.s"


; MMC5
.if .defined(USE_MMC5) ; Pulse phase reset --B00
ft_cmd_mmc5_phase_reset:
    jsr ft_get_pattern_byte
    sta var_ch_periodCalcLo + MMC5_OFFSET, x
    and #$07
    sta var_ch_periodCalcHi + MMC5_OFFSET, x
    rts

have to define a command byte for it too
have to do a hard limit in FamiTracker do disallow nonzero values

.if .defined(USE_MMC5)  ; E0
    .word ft_cmd_mmc5_phase_reset
.endif

there ya go
then ft_get_pattern_byte value 0xE0 will be the phase reset command

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants