Skip to content

Commit

Permalink
Merge pull request #251 from ThKattanek/valgrind_mem_fixed
Browse files Browse the repository at this point in the history
Valgrind mem fixed
  • Loading branch information
ThKattanek committed Jul 15, 2023
2 parents 7ba7cde + 117eff3 commit aed0545
Show file tree
Hide file tree
Showing 13 changed files with 66 additions and 50 deletions.
3 changes: 2 additions & 1 deletion src/c64_keyboard_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// Dieser Sourcecode ist Copyright geschützt! //
// Geistiges Eigentum von Th.Kattanek //
// //
// Letzte Änderung am 18.08.2021 //
// www.emu64.de //
// //
//////////////////////////////////////////////////
Expand Down Expand Up @@ -76,6 +75,8 @@ C64KeyboardWindow::C64KeyboardWindow(QWidget *parent, QSettings *ini, C64Class *
rec_key_curr_x = 0xFF;
rec_key_curr_y = 0xFF;

rec_time_out = 0;

key_matrix_to_port_a = nullptr;
key_matrix_to_port_b = nullptr;

Expand Down
5 changes: 3 additions & 2 deletions src/cartridge_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// Dieser Sourcecode ist Copyright geschützt! //
// Geistiges Eigentum von Th.Kattanek //
// //
// Letzte Änderung am 23.06.2023 //
// www.emu64.de //
// //
//////////////////////////////////////////////////
Expand All @@ -20,7 +19,6 @@
#include "./cartridge_window.h"
#include "./ui_cartridge_window.h"
#include "./utils.h"
#include "qdebug.h"

CartridgeWindow::CartridgeWindow(QWidget *parent, QSettings *_ini, C64Class *c64, QString tmp_path) :
QDialog(parent),
Expand All @@ -41,6 +39,9 @@ CartridgeWindow::CartridgeWindow(QWidget *parent, QSettings *_ini, C64Class *c64
ui->FC3_LED->setIcon(*LedRedOff);
ui->EF_LED->setIcon(*LedRedOff);

for(int i=0; i<LED_NUM; i++)
LedStatus[i] = LedStatusOld[i] = false;

ui->PageEasyFlash->setEnabled(false);
ui->PageFC->setEnabled(false);
ui->PageAR->setEnabled(false);
Expand Down
1 change: 0 additions & 1 deletion src/cartridge_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// Dieser Sourcecode ist Copyright geschützt! //
// Geistiges Eigentum von Th.Kattanek //
// //
// Letzte Änderung am 31.08.2019 //
// www.emu64.de //
// //
//////////////////////////////////////////////////
Expand Down
18 changes: 13 additions & 5 deletions src/debugger_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
// Dieser Sourcecode ist Copyright geschützt! //
// Geistiges Eigentum von Th.Kattanek //
// //
// Letzte Änderung am 21.06.2023 //
// www.emu64.de //
// https://github.com/ThKattanek/emu64 //
// //
//////////////////////////////////////////////////

Expand All @@ -18,9 +17,7 @@

#include "./debugger_window.h"
#include "./ui_debugger_window.h"
#include "./micro_code_tbl_6510.h"
#include "./micro_code_string_tbl_6510.h"
#include "qdebug.h"

DebuggerWindow::DebuggerWindow(QWidget* parent, QSettings* ini) :
QDialog(parent),
Expand All @@ -41,6 +38,17 @@ DebuggerWindow::DebuggerWindow(QWidget* parent, QSettings* ini) :
old_adresse = 0;
old_make_idx = 0;

c64_cpu_reg = {0,0,0,0,0,0,0,0,0,0,0};
c64_cpu_ireg = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};

c64_cpu_ireg.current_opcode = 0;

for(int i=0; i<MAX_FLOPPY_NUM; i++)
{
floppy_cpu_reg[i] = {0,0,0,0,0,0,0,0,0,0,0};
floppy_cpu_ireg[i] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
}

ui->setupUi(this);

// Center Window
Expand Down Expand Up @@ -347,7 +355,7 @@ void DebuggerWindow::UpdateRegister()
{
if(c64 == nullptr) return;

char str00[1024];
char str00[1024] = "";

if(current_source > 0)
{
Expand Down
2 changes: 0 additions & 2 deletions src/debugger_window.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// Dieser Sourcecode ist Copyright geschützt! //
// Geistiges Eigentum von Th.Kattanek //
// //
// Letzte Änderung am 18.06.2023 //
// www.emu64.de //
// //
//////////////////////////////////////////////////
Expand All @@ -27,7 +26,6 @@
#include "./c64_class.h"
#include "./custom_save_file_dialog.h"
#include "./label_widget_mod.h"
#include "./cpu_info.h"
#include "./memory_window.h"
#include "./debugger_vic_window.h"
#include "./debugger_iec_window.h"
Expand Down
3 changes: 2 additions & 1 deletion src/floppy1541_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// Dieser Sourcecode ist Copyright geschützt! //
// Geistiges Eigentum von Th.Kattanek //
// //
// Letzte Änderung am 22.06.2023 //
// www.emu64.de //
// //
//////////////////////////////////////////////////
Expand Down Expand Up @@ -128,6 +127,8 @@ Floppy1541::Floppy1541(bool *reset, int samplerate, int buffersize, bool *floppy
SoundBufferSize = buffersize;
SoundBuffer = new short[SoundBufferSize*2];
for(int i=0;i<SoundBufferSize*2;i++) SoundBuffer[i] = 0;

memset(Breakpoints, 0, sizeof Breakpoints);
}

Floppy1541::~Floppy1541()
Expand Down
3 changes: 2 additions & 1 deletion src/mmu_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// Dieser Sourcecode ist Copyright geschützt! //
// Geistiges Eigentum von Th.Kattanek //
// //
// Letzte Änderung am 23.03.2022 //
// www.emu64.de //
// //
//////////////////////////////////////////////////
Expand All @@ -29,6 +28,8 @@ MMU::MMU(void)
Cia1IOReadProc = std::bind(&MMU::ReadRam,this,std::placeholders::_1);
Cia2IOReadProc = std::bind(&MMU::ReadRam,this,std::placeholders::_1);

MEMORY_MAP = MEMORY_MAP_OLD = 0;

InitProcTables();

srand (time(NULL));
Expand Down
3 changes: 2 additions & 1 deletion src/mos6510_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// Dieser Sourcecode ist Copyright geschützt! //
// Geistiges Eigentum von Th.Kattanek //
// //
// Letzte Änderung am 15.09.2022 //
// www.emu64.de //
// //
//////////////////////////////////////////////////
Expand Down Expand Up @@ -1798,6 +1797,8 @@ void MOS6510_PORT::Reset(void)
DATA_SET_BIT7 = 0;
DATA_FALLOFF_BIT6 = 0;
DATA_FALLOFF_BIT7 = 0;

TAPE_SENSE = false;
}

void MOS6510_PORT::ConfigChanged(int tape_sense, int caps_sense,unsigned char pullup)
Expand Down
5 changes: 4 additions & 1 deletion src/mos6581_8085_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ MOS6581_8085::MOS6581_8085(int nummer,int samplerate,int puffersize,int *error)
interpolate(f0_points_8580, f0_points_8580+ sizeof(f0_points_8580)/sizeof(*f0_points_8580) - 1,PointPlotter<int>(f0_8580), 1.0);

SoundOutputEnable=false;
SetChipType(0);

this->CycleExact=false;

Expand All @@ -83,7 +82,11 @@ MOS6581_8085::MOS6581_8085(int nummer,int samplerate,int puffersize,int *error)
Recording = false;
RecSampleCounter = 0;

FilterResonanz = 0;

SetChipType(0);
Reset();

*error = 0;
}

Expand Down
57 changes: 28 additions & 29 deletions src/structs.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
// Dieser Sourcecode ist Copyright geschützt! //
// Geistiges Eigentum von Th.Kattanek //
// //
// Letzte Änderung am 20.06.2023 //
// www.emu64.de //
// https://github.com/ThKattanek/emu64 //
// //
//////////////////////////////////////////////////

Expand Down Expand Up @@ -107,37 +106,37 @@ typedef enum KeyStatus

struct REG_STRUCT
{
uint8_t reg_mask;
uint16_t pc;
uint8_t ac;
uint8_t xr;
uint8_t yr;
uint8_t sp;
uint8_t sr;
uint16_t irq;
uint16_t nmi;
uint16_t _0314;
uint16_t _0318;
uint8_t reg_mask = 0;
uint16_t pc = 0;
uint8_t ac = 0;
uint8_t xr = 0;
uint8_t yr = 0;
uint8_t sp = 0;
uint8_t sr = 0;
uint16_t irq = 0;
uint16_t nmi = 0;
uint16_t _0314 = 0;
uint16_t _0318 = 0;
};

struct IREG_STRUCT
{
uint8_t pointer;
uint16_t address;
uint16_t branch_address;
uint16_t current_opcode_pc;
uint16_t current_opcode;
uint8_t current_micro_code;
uint8_t tmp_byte;
bool irq;
bool nmi;
bool rdy;
bool reset;
bool cpu_wait;
bool jam_flag;
uint32_t cycle_counter;
bool exrom;
bool game;
uint8_t pointer = 0;
uint16_t address = 0;
uint16_t branch_address = 0;
uint16_t current_opcode_pc = 0;
uint16_t current_opcode = 0;
uint8_t current_micro_code = 0;
uint8_t tmp_byte = 0;
bool irq = false;
bool nmi = false;
bool rdy = false;
bool reset = false;
bool cpu_wait = false;
bool jam_flag = false;
uint32_t cycle_counter = 0;
bool exrom = false;
bool game = false;
};

struct VIC_STRUCT
Expand Down
2 changes: 2 additions & 0 deletions src/video_crt_class.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ VideoCrtClass::VideoCrtClass()
origin = sector/2.0f;
radian = static_cast<float>(MATH_PI)/180.0f;

phase_alternating_line = 0;

enable_pal_delay_line = false;
pal_delay_line_u_only = false;

Expand Down
7 changes: 5 additions & 2 deletions src/widget_floppy_status.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
// Dieser Sourcecode ist Copyright geschützt! //
// Geistiges Eigentum von Th.Kattanek //
// //
// Letzte Änderung am 12.03.2022 //
// www.emu64.de //
// https://github.com/ThKattanek/emu64 //
// //
//////////////////////////////////////////////////

Expand All @@ -30,6 +29,10 @@ WidgetFloppyStatus::WidgetFloppyStatus(QWidget *parent, int floppy_nr, Floppy154
{
FloppyNr = floppy_nr;
floppy = _floppy;

old_Sektor = 255;
old_Spur = 255;

ui->setupUi(this);

QFontDatabase fontDB;
Expand Down
7 changes: 3 additions & 4 deletions src/widget_floppy_status.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
// Dieser Sourcecode ist Copyright geschützt! //
// Geistiges Eigentum von Th.Kattanek //
// //
// Letzte Änderung am 12.03.2022 //
// www.emu64.de //
// https://github.com/ThKattanek/emu64 //
// //
//////////////////////////////////////////////////

Expand Down Expand Up @@ -83,8 +82,8 @@ private slots:
bool MotorLED;
bool RWLED;

unsigned char old_Sektor;
unsigned char old_Spur;
uint8_t old_Sektor;
uint8_t old_Spur;

QString AktFileName;
};
Expand Down

0 comments on commit aed0545

Please sign in to comment.