Skip to content

Commit

Permalink
Updates for f6, f7, f8
Browse files Browse the repository at this point in the history
  • Loading branch information
ikjordan authored and ikjordan committed Aug 19, 2023
1 parent 5aba6b1 commit 9746436
Show file tree
Hide file tree
Showing 11 changed files with 395 additions and 81 deletions.
49 changes: 48 additions & 1 deletion src/emuapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,12 +410,60 @@ void emu_SetVTol(uint16_t vTol)
specific.VTol = vTol;
}

void emu_SetWRX(bool wrx)
{
general.WRX = wrx;
specific.WRX = wrx;
}

void emu_SetCentre(bool centre)
{
general.centre = centre;
specific.centre = centre;
}

void emu_SetSound(int soundType)
{
general.sound = soundType;
specific.sound = soundType;
}

void emu_SetACB(bool stereo)
{
general.acb = stereo;
specific.acb = stereo;
}

void emu_SetMemory(int memory)
{
general.memory = memory;
specific.memory = memory;
}

void emu_SetLowRAM(bool lowRAM)
{
general.lowRAM = lowRAM;
specific.lowRAM = lowRAM;
}

void emu_SetM1NOT(bool m1NOT)
{
general.M1NOT = m1NOT;
specific.M1NOT = m1NOT;
}

void emu_SetQSUDG(bool qsudg)
{
general.QSUDG = qsudg;
specific.QSUDG = qsudg;
}

void emu_SetCHR128(bool chr128)
{
general.CHR128 = chr128;
specific.CHR128 = chr128;
}

void emu_SetRebootMode(FiveSevenSix_T mode)
{
char filepath[MAX_FULLPATH_LEN];
Expand Down Expand Up @@ -791,7 +839,6 @@ void emu_ReadSpecificValues(const char *filename)
(specific.memory != used.memory) ||
(specific.computer != used.computer) ||
(specific.CHR128 != used.CHR128) ||
(specific.WRX != used.WRX) ||
(specific.QSUDG != used.QSUDG) ||
(specific.lowRAM != used.lowRAM));
}
Expand Down
8 changes: 8 additions & 0 deletions src/emuapi.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,16 @@ extern void emu_SetZX80(bool zx80);
extern void emu_SetFrameSync(FrameSync_T fsync);
extern void emu_SetNTSC(bool ntsc);
extern void emu_SetVTol(uint16_t vTol);
extern void emu_SetWRX(bool wrx);
extern void emu_SetCentre(bool centre);
extern void emu_SetSound(int soundType);
extern void emu_SetACB(bool stereo);
extern void emu_SetComputer(ComputerType_T computer);
extern void emu_SetMemory(int memory);
extern void emu_SetLowRAM(bool lowRAM);
extern void emu_SetM1NOT(bool m1NOT);
extern void emu_SetQSUDG(bool qsudg);
extern void emu_SetCHR128(bool chr128);

extern void emu_SetRebootMode(FiveSevenSix_T mode);

Expand Down
4 changes: 2 additions & 2 deletions src/emusound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ int32_t sound_count = 0;
int64_t int_count = 0;
#endif

void emu_sndInit(bool playSound)
void emu_sndInit(bool playSound, bool reset)
{
genSound = playSound;

Expand All @@ -71,7 +71,7 @@ void emu_sndInit(bool playSound)
// Call each time, as sound type may have changed
if (soundCreated)
{
sound_init(emu_ACBRequested());
sound_init(emu_ACBRequested(), reset);
}

// Begin sound regardless, as needed for 50 Hz
Expand Down
2 changes: 1 addition & 1 deletion src/emusound.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#ifdef __cplusplus
extern "C" {
#endif
extern void emu_sndInit(bool playSound);
extern void emu_sndInit(bool playSound, bool reset);
extern void emu_generateSoundSamples(void);
extern void emu_silenceSound(void);

Expand Down
4 changes: 2 additions & 2 deletions src/hid_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ bool hidReadUsbKeyboard(uint8_t* special, bool usedouble)
for(unsigned int i = 0; i < 6; ++i)
{
if (usedouble && (doubleshift == 2) && (!shift) &&
(((report.keycode[i] >= HID_KEY_1) && (report.keycode[i] <= HID_KEY_7)) || (report.keycode[i] == HID_KEY_0)))
(((report.keycode[i] >= HID_KEY_1) && (report.keycode[i] <= HID_KEY_8)) || (report.keycode[i] == HID_KEY_0)))
{
if (report.keycode[i] != HID_KEY_0)
{
Expand Down Expand Up @@ -280,7 +280,7 @@ bool hidReadUsbKeyboard(uint8_t* special, bool usedouble)
else
{
// Check for non Sinclair keys here:
if (((report.keycode[i] >= HID_KEY_F1) && (report.keycode[i] <= HID_KEY_F7)) ||
if (((report.keycode[i] >= HID_KEY_F1) && (report.keycode[i] <= HID_KEY_F8)) ||
(report.keycode[i] == HID_KEY_ESCAPE))
{
*special = report.keycode[i];
Expand Down
Loading

0 comments on commit 9746436

Please sign in to comment.