Saturn builds
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# Copyright (c) 2026 Dominic Masters
|
||||
#
|
||||
# This software is released under the MIT License.
|
||||
# https://opensource.org/licenses/MIT
|
||||
|
||||
target_sources(${DUSK_BINARY_TARGET_NAME}
|
||||
PUBLIC
|
||||
${CMAKE_CURRENT_LIST_DIR}/networksaturn.c
|
||||
)
|
||||
@@ -0,0 +1,19 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "networksaturn.h"
|
||||
|
||||
#define networkPlatformInit networkSaturnInit
|
||||
#define networkPlatformUpdate networkSaturnUpdate
|
||||
#define networkPlatformDispose networkSaturnDispose
|
||||
#define networkPlatformIsConnected networkSaturnIsConnected
|
||||
#define networkPlatformRequestConnection networkSaturnRequestConnection
|
||||
#define networkPlatformRequestDisconnection networkSaturnRequestDisconnection
|
||||
#define networkPlatformGetInfo networkSaturnGetInfo
|
||||
|
||||
typedef networksaturn_t networkplatform_t;
|
||||
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#include "network/network.h"
|
||||
#include "util/memory.h"
|
||||
|
||||
errorret_t networkSaturnInit(void) { errorOk(); }
|
||||
errorret_t networkSaturnUpdate(void) { errorOk(); }
|
||||
errorret_t networkSaturnDispose(void) { errorOk(); }
|
||||
|
||||
bool_t networkSaturnIsConnected(void) { return false; }
|
||||
|
||||
void networkSaturnRequestConnection(
|
||||
void (*onConnected)(void *user),
|
||||
void (*onFailed)(errorret_t error, void *user),
|
||||
void (*onDisconnect)(errorret_t error, void *user),
|
||||
void *user
|
||||
) {
|
||||
(void)onConnected; (void)onDisconnect; (void)user;
|
||||
errorret_t err = errorThrowImpl(
|
||||
NULL, ERROR_NOT_OK,
|
||||
__FILE__, __func__, __LINE__,
|
||||
"Network not supported on Saturn"
|
||||
);
|
||||
if(onFailed) onFailed(err, user);
|
||||
}
|
||||
|
||||
void networkSaturnRequestDisconnection(
|
||||
void (*onComplete)(void *user),
|
||||
void *user
|
||||
) {
|
||||
if(onComplete) onComplete(user);
|
||||
}
|
||||
|
||||
networkinfo_t networkSaturnGetInfo(void) {
|
||||
networkinfo_t info;
|
||||
memoryZero(&info, sizeof(info));
|
||||
return info;
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Copyright (c) 2026 Dominic Masters
|
||||
*
|
||||
* This software is released under the MIT License.
|
||||
* https://opensource.org/licenses/MIT
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "error/error.h"
|
||||
#include "network/networkinfo.h"
|
||||
|
||||
/*
|
||||
* Saturn networking is not supported (the NetLink modem cartridge is too
|
||||
* rare to target). All functions are no-ops; network-dependent features
|
||||
* will gracefully degrade via the existing NETWORK_STATE_DISCONNECTED path.
|
||||
*/
|
||||
|
||||
typedef struct {
|
||||
uint8_t unused;
|
||||
} networksaturn_t;
|
||||
|
||||
errorret_t networkSaturnInit(void);
|
||||
errorret_t networkSaturnUpdate(void);
|
||||
errorret_t networkSaturnDispose(void);
|
||||
bool_t networkSaturnIsConnected(void);
|
||||
void networkSaturnRequestConnection(
|
||||
void (*onConnected)(void *user),
|
||||
void (*onFailed)(errorret_t error, void *user),
|
||||
void (*onDisconnect)(errorret_t error, void *user),
|
||||
void *user
|
||||
);
|
||||
void networkSaturnRequestDisconnection(
|
||||
void (*onComplete)(void *user),
|
||||
void *user
|
||||
);
|
||||
networkinfo_t networkSaturnGetInfo(void);
|
||||
Reference in New Issue
Block a user