sync finder_info_helper.

This commit is contained in:
Kelvin Sherlock 2017-01-24 16:28:40 -05:00
parent e81e47d4c8
commit 97787b30e4
2 changed files with 57 additions and 0 deletions

View File

@ -45,6 +45,44 @@
namespace {
/*
tech note PT515
ProDOS -> Macintosh conversion
ProDOS Macintosh
Filetype Auxtype Creator Filetype
$00 $0000 'pdos' 'BINA'
$B0 (SRC) (any) 'pdos' 'TEXT'
$04 (TXT) $0000 'pdos' 'TEXT'
$FF (SYS) (any) 'pdos' 'PSYS'
$B3 (S16) (any) 'pdos' 'PS16'
$uv $wxyz 'pdos' 'p' $uv $wx $yz
Programmer's Reference for System 6.0:
ProDOS Macintosh
File Type Auxiliary Type Creator Type File Type
$00 $0000 pdos BINA
$04 (TXT) $0000 pdos TEXT
$FF (SYS) (any) pdos PSYS
$B3 (S16) $DByz pdos p $B3 $DB $yz
$B3 (S16) (any) pdos PS16
$D7 $0000 pdos MIDI
$D8 $0000 pdos AIFF
$D8 $0001 pdos AIFC
$E0 $0005 dCpy dImg
$FF (SYS) (any) pdos PSYS
$uv $wxyz pdos p $uv $wx $yz
mpw standard:
$uv (any) "pdos" printf("%02x ",$uv)
*/
int hex(uint8_t c)
{
if (c >= '0' && c <= '9') return c - '0';
@ -443,6 +481,7 @@ bool finder_info_helper::is_text() const {
return false;
}
uint32_t finder_info_helper::file_type() const {
uint32_t rv = 0;
for (unsigned i = 0; i < 4; ++i) {
@ -460,3 +499,18 @@ uint32_t finder_info_helper::creator_type() const {
}
return rv;
}
void finder_info_helper::set_file_type(uint32_t x) {
_finder_info[0] = x >> 24;
_finder_info[1] = x >> 16;
_finder_info[2] = x >> 8;
_finder_info[3] = x >> 0;
}
void finder_info_helper::set_creator_type(uint32_t x) {
_finder_info[4] = x >> 24;
_finder_info[5] = x >> 16;
_finder_info[6] = x >> 8;
_finder_info[7] = x >> 0;
}

View File

@ -76,6 +76,9 @@ public:
void set_prodos_file_type(uint16_t);
void set_prodos_file_type(uint16_t, uint32_t);
void set_file_type(uint32_t);
void set_creator_type(uint32_t);
bool is_text() const;
private: