-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
4.7.1 add apple2gs clock functionality and rearrange the apple2 platf…
…orm source dirs
- Loading branch information
1 parent
df98441
commit 52a2001
Showing
54 changed files
with
210 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#include <stdint.h> | ||
#include <string.h> | ||
|
||
#include "fujinet-clock.h" | ||
#include "fujinet-bus-apple2.h" | ||
|
||
// these correspond to the enum TimeFormat | ||
const char format_cmds[] = { 'T', 'P', 'A', 'B', 'S', 'Z' }; | ||
|
||
uint8_t clock_get_time(uint8_t* tz, TimeFormat format) { | ||
uint8_t result; | ||
|
||
sp_get_clock_id(); | ||
if (sp_clock_id == 0) return FN_ERR_IO_ERROR; | ||
|
||
result = sp_status(sp_clock_id, 'G'); | ||
if (result == 0) return FN_ERR_IO_ERROR; | ||
|
||
memcpy(tz, sp_payload, sp_count); | ||
return FN_ERR_OK; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include <stdint.h> | ||
#include <string.h> | ||
|
||
#include "fujinet-clock.h" | ||
#include "fujinet-bus-apple2.h" | ||
|
||
uint8_t clock_get_tz(uint8_t *tz) { | ||
uint8_t result; | ||
|
||
sp_get_clock_id(); | ||
if (sp_clock_id == 0) return FN_ERR_IO_ERROR; | ||
|
||
result = sp_status(sp_clock_id, 'G'); | ||
if (result == 0) return FN_ERR_IO_ERROR; | ||
|
||
memcpy(tz, sp_payload, sp_count); | ||
return FN_ERR_OK; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#include <stdint.h> | ||
#include <string.h> | ||
|
||
#include "fujinet-clock.h" | ||
#include "fujinet-bus-apple2.h" | ||
|
||
uint8_t clock_set_tz(char *tz) { | ||
uint16_t len; | ||
int8_t result; | ||
|
||
sp_get_clock_id(); | ||
if (sp_clock_id == 0) return FN_ERR_IO_ERROR; | ||
|
||
len = strlen(tz) + 1; | ||
|
||
sp_payload[0] = len & 0xFF; | ||
sp_payload[1] = len >> 8; | ||
memcpy(&sp_payload[2], tz, len); | ||
|
||
result = sp_control(sp_clock_id, 'T'); | ||
return fn_error(result); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# bus | ||
|
||
Only common C files for all apple2 platforms should go in here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# fn_clock | ||
|
||
Only common C files for all apple2 platforms should go in here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# target (not platform) changes to OBJECTS/OBJECTS_ARC list | ||
|
||
# this adds all the c files as a files to the archive, as the compiler creates .root and .a files for them. | ||
OBJECTS_ARC += $(patsubst %.c,%.a,$(filter %.c,$(SOURCES))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
#!/bin/bash | ||
|
||
if [ $# -ne 2 ]; then | ||
echo "Usage: $(basename $0) SOURCE_DIR DESTINATION_DIR" | ||
echo " This script flattens every file in any directory under SOURCE_DIR into DESTINATION_DIR and then applies 0xb1 filetype for orca makefile" | ||
echo " It will fail if the SOURCE_DIR does not exist" | ||
exit 1 | ||
fi | ||
|
||
SOURCE_DIR=$1 | ||
DEST_DIR=$2 | ||
|
||
if [ ! -d "${SOURCE_DIR}" ]; then | ||
echo "ERROR: SOURCE_DIR '${SOURCE_DIR}' does not exist." | ||
exit 1 | ||
fi | ||
|
||
# Create destination directory if it does not exist | ||
if [ ! -d "$DEST_DIR" ]; then | ||
mkdir -p "$DEST_DIR" | ||
fi | ||
|
||
TEMP_ZIP=$(mktemp -u --tmpdir source_archive_XXXXX.zip) | ||
|
||
# Ensure the temporary file is removed on script exit or interruption | ||
trap 'rm -f "$TEMP_ZIP"' EXIT | ||
|
||
# Create a zip file of the entire source directory (including subdirectories) | ||
zip -r "$TEMP_ZIP" "$SOURCE_DIR"/* >/dev/null 2>&1 | ||
|
||
# Check if destination directory exists, if not create it | ||
if [ ! -d "$DEST_DIR" ]; then | ||
mkdir -p "$DEST_DIR" | ||
fi | ||
|
||
# Extract the zip file without preserving the directory structure | ||
unzip -j "$TEMP_ZIP" -d "$DEST_DIR" > /dev/null 2>&1 | ||
|
||
cd $DEST_DIR | ||
find . -type f -exec iix chtyp -t 0xb1 {} \; | ||
FILE_LIST=$(find . -type f -exec basename {} \; | xargs -I {} echo -n "+{} " | sed 's/ $$//') | ||
echo ${FILE_LIST} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
4.7.0 | ||
4.7.1 |