Skip to content

Commit

Permalink
STBL454 2024/08/14
Browse files Browse the repository at this point in the history
  AY:マルチソングファイルに対応
  • Loading branch information
kumatan committed Aug 13, 2024
1 parent 705917e commit 6a678b1
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
3 changes: 3 additions & 0 deletions CHANGE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
�X�V����
STBL454 2024/08/14
AY:�}���`�\���O�t�@�C���ɑΉ�

STBL453 2024/08/13
�R�A:.AY�ɂ������Ή�

Expand Down
Binary file not shown.
2 changes: 1 addition & 1 deletion MDPlayer/MDPlayer_InstKit/02info.nsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
!define NAME "MDPlayer"
!define VERSION "STBL452"
!define VERSION "STBL453"
!define PUBLISHER "Kumata"
!define PACKAGE "${NAME} ${VERSION}"
10 changes: 6 additions & 4 deletions MDPlayer/MDPlayerx64/Audio.cs
Original file line number Diff line number Diff line change
Expand Up @@ -776,7 +776,7 @@ public static void CopyWaveBuffer(short[][] dest)
Driver.AY.AY ay = new();
GD3 gd3 = ay.getGD3Info(buf, 0);

//for (int s = 0; s < ay.songs; s++)
for (int s = 0; s < ay.Information.NumOfSongs; s++)
{
music = new PlayList.Music
{
Expand All @@ -786,16 +786,16 @@ public static void CopyWaveBuffer(short[][] dest)
arcType = EnmArcType.unknown,
//title = string.Format("{0} - Trk {1}", gd3.TrackName, s + 1),
//titleJ = string.Format("{0} - Trk {1}", gd3.TrackName, s + 1),
title = gd3.TrackName,
titleJ = gd3.TrackNameJ,
title = ay.Information.SongsStructure[s].PSongName,
titleJ = ay.Information.SongsStructure[s].PSongName,
game = "",
gameJ = "",
composer = gd3.Composer,
composerJ = gd3.Composer,
vgmby = "",
converted = "",
notes = gd3.Notes,
//songNo = s
songNo = s
};
if (!string.IsNullOrEmpty(zipFile)) music.arcType = zipFile.ToLower().LastIndexOf(".zip") != -1 ? EnmArcType.ZIP : EnmArcType.LZH;

Expand Down Expand Up @@ -2689,11 +2689,13 @@ public static bool AyPlay(Setting setting)

chipRegister.initChipRegister(lstChips.ToArray());

((Driver.AY.AY)DriverVirtual).song = (byte)SongNo;
if (!DriverVirtual.init(vgmBuf, chipRegister, EnmModel.VirtualModel, new EnmChip[] { EnmChip.AY8910 }
, (uint)(setting.outputDevice.SampleRate * setting.LatencyEmulation / 1000)
, (uint)(setting.outputDevice.SampleRate * setting.outputDevice.WaitTime / 1000))) return false;
if (DriverReal != null)
{
((Driver.AY.AY)DriverReal).song = (byte)SongNo;
if (!DriverReal.init(vgmBuf, chipRegister, EnmModel.RealModel, new EnmChip[] { EnmChip.AY8910 }
, (uint)(setting.outputDevice.SampleRate * setting.LatencySCCI / 1000)
, (uint)(setting.outputDevice.SampleRate * setting.outputDevice.WaitTime / 1000))) return false;
Expand Down
13 changes: 8 additions & 5 deletions MDPlayer/MDPlayerx64/Driver/AY/AY.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ public class Block

public class AY : baseDriver
{
private byte[] buf;
public Information Information;
private Z80Processor z80;
public int song=0;


public override bool init(byte[] vgmBuf, ChipRegister chipRegister, EnmModel model, EnmChip[] useChip, uint latency, uint waitTime)
{
this.chipRegister = chipRegister;
Expand All @@ -65,7 +71,7 @@ public override bool init(byte[] vgmBuf, ChipRegister chipRegister, EnmModel mod
try
{
Run(vgmBuf);
Setup(0);
Setup(song);
}
catch
{
Expand Down Expand Up @@ -104,10 +110,6 @@ public override GD3 getGD3Info(byte[] buf, uint vgmGd3)



private byte[] buf;
public Information Information;
private Z80Processor z80;
//public MDSound.MDSound mds;

public void Run(byte[] buf)
{
Expand Down Expand Up @@ -229,6 +231,7 @@ public void Setup(int songNum)
//e) if INIT equal to ZERO then place to first CALL instruction address of first AY file block instead of INIT(see next f) and g) steps)
//f) if INTERRUPT equal to ZERO then place at ZERO address next player:
//g) if INTERRUPT not equal to ZERO then place at ZERO address next player:
if (songNum >= Information.SongsStructure.Count) songNum = 0;
int init = Information.SongsStructure[songNum].SongData.Points.Init;
if (init == 0)
{
Expand Down

0 comments on commit 6a678b1

Please sign in to comment.