8#include "../dumper/dumper.h"
9#include "../linker/module.h"
10#include "../linker/options.h"
11#include "../linker/reader.h"
12#include "../linker/segment.h"
13#include "../linker/writer.h"
32 AppleFormat(uint64_t default_base_address = 0x0803, std::string default_extension =
"",
bool dos33_header =
true)
85 enum file_type_t : uint8_t
94 unsigned apple_single_double_version = 2;
96 Apple::AppleSingleDouble::hfs_type home_file_system = Apple::AppleSingleDouble::HFS_UNDEFINED;
146 void GenerateFiles(std::string filename, std::shared_ptr<Contents> data_fork, std::shared_ptr<Contents> resource_fork, uint8_t file_type, uint16_t auxiliary_file_type);
172 std::shared_ptr<AppleFormat> data_fork;
185 file_type_t file_type;
215 uint8_t GetFileType()
const;
216 uint16_t GetAuxiliaryFileType()
const;
218 bool UseDOS33Header()
const
249 AtariFormat(uint64_t default_base_address = 0, std::string default_extension =
".xex")
326 std::shared_ptr<Linker::Contents>
image;
387 void OnNewSegment(std::shared_ptr<Linker::Segment> segment)
override;
414 std::shared_ptr<Linker::Segment> loader;
416 void Clear()
override;
423 void SetupDefaultLoader();
450 InitializeFields(rsx_file_names);
472 std::shared_ptr<PRLFormat>
module;
480 void Clear()
override;
492 std::shared_ptr<Linker::OptionCollector>
GetOptions()
override;
494 void SetOptions(std::map<std::string, std::string>& options)
override;
518 std::shared_ptr<Linker::Contents> image;
523 std::vector<std::unique_ptr<Segment>> segments;
525 void OnNewSegment(std::shared_ptr<Linker::Segment> segment)
override;
548 InitializeFields(banked);
607 std::shared_ptr<Linker::OptionCollector>
GetOptions()
override;
608 void SetOptions(std::map<std::string, std::string>& options)
override;
610 std::unique_ptr<Script::List> GetScript(
Linker::Module& module)
override;
612 void OnNewSegment(std::shared_ptr<Linker::Segment> segment)
override;
658 std::shared_ptr<Linker::Contents> code, data;
660 void OnNewSegment(std::shared_ptr<Linker::Segment> segment)
override;
This is not actually a file format, but an interface to permit generating multiple binary outputs for...
Definition 8bitexe.h:170
void OnReadFile(Linker::Reader &rd) override
Called if there is no container allocated.
Definition 8bitexe.cc:438
header_format_t
Definition 8bitexe.h:175
@ HEADER_BIN
For a BIN file, there may or may not be a DOS 3.3 header (if no "+naps" is specified)
Definition 8bitexe.h:177
@ HEADER_RAW
For a BIN file, there is no DOS 3.3 header (even if no "+naps" is specified)
Definition 8bitexe.h:181
@ HEADER_DOS33
For a BIN file, the DOS 3.3 header is included (even if "+naps" is specified)
Definition 8bitexe.h:179
void OnCalculateValues() override
Called if there is no container allocated.
Definition 8bitexe.cc:433
std::string GetDefaultExtension(Linker::Module &module, std::string filename) const override
Appends a default extension to the filename.
Definition 8bitexe.cc:484
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition 8bitexe.cc:496
void GenerateFile(std::string filename, Linker::Module &module) override
The main function that handles processing, calculating and generating the final image.
Definition 8bitexe.cc:403
void OnContainerCreated() override
Called after the container is created.
Definition 8bitexe.cc:426
void OnDump(Dumper::Dumper &dump) const override
Called if there is no container allocated.
Definition 8bitexe.cc:455
offset_t OnWriteFile(Linker::Writer &wr) const override
Called if there is no container allocated.
Definition 8bitexe.cc:450
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition 8bitexe.cc:393
std::shared_ptr< Apple::AppleSingleDouble > apple_single
Container for all the necessary additional information.
Definition 8bitexe.h:129
offset_t WriteFile(Linker::Writer &wr) const override
Stores data in memory to file.
Definition 8bitexe.cc:358
virtual void OnReadFile(Linker::Reader &rd)
Called if there is no container allocated.
Definition 8bitexe.cc:105
bool AddSupplementaryOutputFormat(std::string subformat) override
If the output format actually drives multiple output formats (resource file, apple double,...
Definition 8bitexe.cc:58
container_format_t container
The container type used to store metainformation while processing.
Definition 8bitexe.h:126
produce_format_t produce
Bitset of other files to produce.
Definition 8bitexe.h:82
produce_format_t
Represents what additional files should be generated.
Definition 8bitexe.h:69
@ PRODUCE_APPLE_DOUBLE
Creates an AppleDouble binary with the '' prefix.
Definition 8bitexe.h:75
@ PRODUCE_RESOURCE_FORK
Places a GS/OS format resource file under the directory .rsrc.
Definition 8bitexe.h:71
@ PRODUCE_NAPS_SUFFIX
NuLib2 attribute preservation string suffix, such as #06xxxx.
Definition 8bitexe.h:79
target_format_t
Represents the file type of the main file.
Definition 8bitexe.h:49
@ TARGET_NONE
Do not generate main file.
Definition 8bitexe.h:51
@ TARGET_APPLE_DOUBLE
Main file is an AppleDouble.
Definition 8bitexe.h:59
@ TARGET_DATA_FORK
Main file is a data fork, typically empty.
Definition 8bitexe.h:53
@ TARGET_RESOURCE_FORK
Main file is a resource fork.
Definition 8bitexe.h:55
@ TARGET_APPLE_SINGLE
Main file is an AppleSingle.
Definition 8bitexe.h:57
void ReadFile(Linker::Reader &rd) override
Loads file into memory.
Definition 8bitexe.cc:303
virtual offset_t OnWriteFile(Linker::Writer &wr) const
Called if there is no container allocated.
Definition 8bitexe.cc:110
virtual void OnContainerCreated()
Called after the container is created.
Definition 8bitexe.cc:98
void GenerateFiles(std::string filename, std::shared_ptr< Contents > data_fork, std::shared_ptr< Contents > resource_fork, uint8_t file_type, uint16_t auxiliary_file_type)
Tasked to create all the requested files.
Definition 8bitexe.cc:121
virtual void OnDump(Dumper::Dumper &dump) const
Called if there is no container allocated.
Definition 8bitexe.cc:116
virtual void OnCalculateValues()
Called if there is no container allocated.
Definition 8bitexe.cc:100
target_format_t target
Format of "filename".
Definition 8bitexe.h:65
void Dump(Dumper::Dumper &dump) const override
Display file contents in a nice manner.
Definition 8bitexe.cc:373
container_format_t
Format of container stored in memory.
Definition 8bitexe.h:117
@ CONTAINER_APPLE_SINGLE
Use an AppleSingle container.
Definition 8bitexe.h:121
@ CONTAINER_NONE
No container is stored.
Definition 8bitexe.h:119
An abstract interface that separates structure and presentation of the data inside a file.
Definition dumper.h:828
Encodes an object module file as a collection of sections, symbols and relocations.
Definition module.h:24
Helper class that contains the options interpreted by the format.
Definition options.h:474
Documents and handles command line options.
Definition options.h:306
A helper class, encapsulating functionality needed to import binary data.
Definition reader.h:20
A representation of a value within some binary data that has to be fixed up once the exact position o...
Definition relocation.h:27
Representing a resolved relocation.
Definition resolution.h:17
A helper class, encapsulating functionality needed to export binary data.
Definition writer.h:15