2015-05-24 06:55:12 +02:00
|
|
|
// Copyright 2009 Dolphin Emulator Project
|
2015-05-18 01:08:10 +02:00
|
|
|
// Licensed under GPLv2+
|
2013-04-17 22:43:11 -04:00
|
|
|
// Refer to the license.txt file included.
|
2009-07-06 02:10:26 +00:00
|
|
|
|
2014-02-10 13:54:46 -05:00
|
|
|
#pragma once
|
2009-07-06 02:10:26 +00:00
|
|
|
|
2018-03-25 18:29:11 -04:00
|
|
|
#include <optional>
|
2009-04-12 13:12:42 +00:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2009-07-06 02:10:26 +00:00
|
|
|
|
2014-09-07 20:06:58 -05:00
|
|
|
#include "Common/CommonTypes.h"
|
2009-07-06 02:10:26 +00:00
|
|
|
|
2016-12-30 13:25:40 -05:00
|
|
|
namespace DSP
|
|
|
|
{
|
2014-03-12 15:33:41 -04:00
|
|
|
bool Assemble(const std::string& text, std::vector<u16>& code, bool force = false);
|
2009-04-25 10:38:26 +00:00
|
|
|
bool Disassemble(const std::vector<u16>& code, bool line_numbers, std::string& text);
|
2009-04-12 14:48:55 +00:00
|
|
|
bool Compare(const std::vector<u16>& code1, const std::vector<u16>& code2);
|
2009-07-06 02:10:26 +00:00
|
|
|
|
2009-04-12 13:12:42 +00:00
|
|
|
// Big-endian, for writing straight to file using File::WriteStringToFile.
|
2018-03-25 18:29:11 -04:00
|
|
|
std::string CodeToBinaryStringBE(const std::vector<u16>& code);
|
|
|
|
std::vector<u16> BinaryStringBEToCode(const std::string& str);
|
2009-07-06 02:10:26 +00:00
|
|
|
|
2009-04-12 13:12:42 +00:00
|
|
|
// Load code (big endian binary).
|
2018-03-25 18:29:11 -04:00
|
|
|
std::optional<std::vector<u16>> LoadBinary(const std::string& filename);
|
2014-03-12 15:33:41 -04:00
|
|
|
bool SaveBinary(const std::vector<u16>& code, const std::string& filename);
|
2017-05-14 20:19:34 -07:00
|
|
|
|
2020-04-08 18:19:37 -07:00
|
|
|
bool DumpDSPCode(const u8* code_be, size_t size_in_bytes, u32 crc);
|
2016-12-30 13:25:40 -05:00
|
|
|
} // namespace DSP
|