1 #include "stdafx.h"
2 #include <QSettings>
3 #include "main.h"
4 
5 
6 //////////////////////////////////////////////////////////////////////
7 
8 
Settings_SetFloppyFilePath(int slot,const QString & sFilePath)9 void Settings_SetFloppyFilePath(int slot, const QString & sFilePath)
10 {
11     char bufValueName[] = "Floppy0";
12     bufValueName[6] = slot + '0';
13     Global_getSettings()->setValue(bufValueName, sFilePath);
14 }
Settings_GetFloppyFilePath(int slot)15 QString Settings_GetFloppyFilePath(int slot)
16 {
17     char bufValueName[] = "Floppy0";
18     bufValueName[6] = slot + '0';
19     QVariant value = Global_getSettings()->value(bufValueName, "");
20     return value.toString();
21 }
22 
Settings_SetCartridgeFilePath(int slot,const QString & sFilePath)23 void Settings_SetCartridgeFilePath(int slot, const QString &sFilePath)
24 {
25     char bufValueName[] = "Cartridge1";
26     bufValueName[9] = slot + '0';
27     Global_getSettings()->setValue(bufValueName, sFilePath);
28 }
Settings_GetCartridgeFilePath(int slot)29 QString Settings_GetCartridgeFilePath(int slot)
30 {
31     char bufValueName[] = "Cartridge1";
32     bufValueName[9] = slot + '0';
33     QVariant value = Global_getSettings()->value(bufValueName, "");
34     return value.toString();
35 }
36 
Settings_SetHardFilePath(int slot,const QString & sFilePath)37 void Settings_SetHardFilePath(int slot, const QString &sFilePath)
38 {
39     char bufValueName[] = "Hard1";
40     bufValueName[4] = slot + '0';
41     Global_getSettings()->setValue(bufValueName, sFilePath);
42 }
Settings_GetHardFilePath(int slot)43 QString Settings_GetHardFilePath(int slot)
44 {
45     char bufValueName[] = "Hard1";
46     bufValueName[4] = slot + '0';
47     QVariant value = Global_getSettings()->value(bufValueName, "");
48     return value.toString();
49 }
50 
Settings_SetSound(bool flag)51 void Settings_SetSound(bool flag)
52 {
53     Global_getSettings()->setValue("Sound", flag);
54 }
Settings_GetSound()55 bool Settings_GetSound()
56 {
57     QVariant value = Global_getSettings()->value("Sound", false);
58     return value.toBool();
59 }
60 
Settings_SetDebugCpuPpu(bool flag)61 void Settings_SetDebugCpuPpu(bool flag)
62 {
63     Global_getSettings()->setValue("DebugCpuPpu", flag);
64 }
Settings_GetDebugCpuPpu()65 bool Settings_GetDebugCpuPpu()
66 {
67     QVariant value = Global_getSettings()->value("DebugCpuPpu", false);
68     return value.toBool();
69 }
70 
Settings_SetDebugMemoryMode(quint16 mode)71 void Settings_SetDebugMemoryMode(quint16 mode)
72 {
73     Global_getSettings()->setValue("DebugMemoryMode", mode);
74 }
Settings_GetDebugMemoryMode()75 quint16 Settings_GetDebugMemoryMode()
76 {
77     QVariant value = Global_getSettings()->value("DebugMemoryMode", 3);
78     return (quint16)value.toUInt();
79 }
80 
Settings_SetDebugMemoryAddress(quint16 mode)81 void Settings_SetDebugMemoryAddress(quint16 mode)
82 {
83     Global_getSettings()->setValue("DebugMemoryAddress", mode);
84 }
Settings_GetDebugMemoryAddress()85 quint16 Settings_GetDebugMemoryAddress()
86 {
87     QVariant value = Global_getSettings()->value("DebugMemoryAddress", 0);
88     return (quint16)value.toUInt();
89 }
90 
Settings_SetDebugMemoryByte(bool flag)91 void Settings_SetDebugMemoryByte(bool flag)
92 {
93     Global_getSettings()->setValue("DebugMemoryByte", flag);
94 }
Settings_GetDebugMemoryByte()95 bool Settings_GetDebugMemoryByte()
96 {
97     QVariant value = Global_getSettings()->value("DebugMemoryByte", false);
98     return value.toBool();
99 }
100 
101 
102 //////////////////////////////////////////////////////////////////////
103