diff --git a/BuGS.xcodeproj/project.pbxproj b/BuGS.xcodeproj/project.pbxproj index 0e2172c..750eb69 100644 --- a/BuGS.xcodeproj/project.pbxproj +++ b/BuGS.xcodeproj/project.pbxproj @@ -20,6 +20,7 @@ 9D1716A52491C49300C83148 /* system601.2mg in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9D1716A42491C49300C83148 /* system601.2mg */; }; 9D1716A72491C49300C83148 /* tail.mk in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9D1716A62491C49300C83148 /* tail.mk */; }; 9D1716AA2491C49300C83148 /* BuGS.xcscheme in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9D1716A92491C49300C83148 /* BuGS.xcscheme */; }; + 9DB90E80265AD04A003461C1 /* globalScores.c in Sources */ = {isa = PBXBuildFile; fileRef = 9DB90E7F265AD04A003461C1 /* globalScores.c */; }; /* End PBXBuildFile section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -122,6 +123,8 @@ 9DB1505324C9E54C00558B87 /* gameSpider.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = gameSpider.s; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.asm.orcam; }; 9DB1505424D3BF6C00558B87 /* gameSegments.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = gameSegments.s; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.asm.orcam; }; 9DB1505524D3BFCE00558B87 /* global.macros */ = {isa = PBXFileReference; lastKnownFileType = text; path = global.macros; sourceTree = ""; }; + 9DB90E7E265AD04A003461C1 /* globalScores.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = globalScores.h; sourceTree = ""; }; + 9DB90E7F265AD04A003461C1 /* globalScores.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = globalScores.c; sourceTree = ""; }; 9DC4D7BD24B7652100BACF4B /* ship.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = ship.s; sourceTree = ""; }; 9DC4D7BE24B80C9600BACF4B /* shot.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = shot.s; sourceTree = ""; }; /* End PBXFileReference section */ @@ -200,6 +203,8 @@ children = ( 9D17168E2491C49300C83148 /* main.c */, 9D1716902491C49300C83148 /* main.h */, + 9DB90E7E265AD04A003461C1 /* globalScores.h */, + 9DB90E7F265AD04A003461C1 /* globalScores.c */, 9D8FFC602491CA28005C9327 /* game.s */, 9D8FFC612491CAF0005C9327 /* game.h */, 9DB1505024C3801100558B87 /* gameFlea.s */, @@ -390,6 +395,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 9DB90E80265AD04A003461C1 /* globalScores.c in Sources */, 9D1716942491C49300C83148 /* Makefile in Sources */, 9D17168F2491C49300C83148 /* main.c in Sources */, ); diff --git a/BuGS.xcodeproj/xcuserdata/jrand.xcuserdatad/xcschemes/xcschememanagement.plist b/BuGS.xcodeproj/xcuserdata/jrand.xcuserdatad/xcschemes/xcschememanagement.plist index c7870af..dc9e153 100644 --- a/BuGS.xcodeproj/xcuserdata/jrand.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/BuGS.xcodeproj/xcuserdata/jrand.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,7 +7,7 @@ Binary.xcscheme_^#shared#^_ orderHint - 1 + 3 BuGS.xcscheme_^#shared#^_ @@ -22,7 +22,7 @@ doNotBuild.xcscheme_^#shared#^_ orderHint - 3 + 1 diff --git a/BuGS/globalScores.c b/BuGS/globalScores.c new file mode 100644 index 0000000..173bac8 --- /dev/null +++ b/BuGS/globalScores.c @@ -0,0 +1,81 @@ +/* + * globalScores.c + * BuGS + * + * Created by Jeremy Rand on 2021-05-23. + * Copyright © 2021 Jeremy Rand. All rights reserved. + */ + +#include +#include +#include + +#include "globalScores.h" + + +#define REQUEST_TYPE_GET_HIGH_SCORES 0 +#define REQUEST_TYPE_SET_SCORE 1 + +#define RESPONSE_TYPE_HELLO 0 +#define RESPONSE_TYPE_SCORES 1 +#define RESPONSE_TYPE_STATUS 2 + + +typedef struct tSessionSecrets { + uint32_t secret; + uint32_t nonce; +} tSessionSecrets; + + +typedef struct tHighScoreRequest { + uint16_t requestType; +} tHighScoreRequest; + + +typedef struct tHighScoreRequestWithHash { + tHighScoreRequest highScoreRequest; + uint8_t md5Digest[16]; +} tHighScoreRequestWithHash; + + +typedef struct tSetHighScoreRequest { + uint16_t requestType; + char who[4]; + uint32_t score; + Boolean is60Hz; +} tSetHighScoreRequest; + + +typedef struct tSetHighScoreRequestWithHash { + tSetHighScoreRequest setHighScoreRequest; + uint8_t md5Digest[16]; +} tSetHighScoreRequestWithHash; + + +typedef struct tHelloResponse { + uint16_t responseType; + uint32_t nonce; +} tHelloResponse; + + +typedef struct tScoresResponse { + uint16_t responseType; + tHighScore highScores[10]; +} tScoresResponse; + + +typedef struct tStatusResponse { + uint16_t responseType; + Boolean success; +} tStatusResponse; + + +#if 0 +Word blah(void) +{ + // This is how to read the 50 or 60 Hz indicator: + // 0 is 60 Hz + // 1 is 50 Hz + return ReadBParam(hrtz50or60); +} +#endif diff --git a/BuGS/globalScores.h b/BuGS/globalScores.h new file mode 100644 index 0000000..2134a91 --- /dev/null +++ b/BuGS/globalScores.h @@ -0,0 +1,21 @@ +/* + * globalScores.h + * BuGS + * + * Created by Jeremy Rand on 2021-05-23. + * Copyright © 2021 Jeremy Rand. All rights reserved. + */ + +#ifndef _GUARD_PROJECTBuGS_FILEglobalScores_ +#define _GUARD_PROJECTBuGS_FILEglobalScores_ + + +typedef struct tHighScore +{ + char scoreText[10]; + char who[4]; + unsigned long score; +} tHighScore; + + +#endif /* define _GUARD_PROJECTBuGS_FILEglobalScores_ */ diff --git a/BuGS/main.c b/BuGS/main.c index cd15994..b43cabc 100644 --- a/BuGS/main.c +++ b/BuGS/main.c @@ -20,6 +20,7 @@ #include "main.h" #include "game.h" +#include "globalScores.h" #include "tileData.h" @@ -33,13 +34,6 @@ /* Typedefs */ -typedef struct tHighScore -{ - char scoreText[10]; - char who[4]; - unsigned long score; -} tHighScore; - typedef struct tSettingsData { char magic[4]; diff --git a/BuGS/main.rez b/BuGS/main.rez index 97d8dc1..35f08e8 100644 --- a/BuGS/main.rez +++ b/BuGS/main.rez @@ -62,9 +62,9 @@ resource rUpdateInfo (UPDATE_INFO, $0000) { resource rVersion (1) { { 1, /* Major version number in BCD */ - 0, /* Minor version number in BCD */ - 1, /* Bug version number in BCD */ - release, /* Development phase */ + 9, /* Minor version number in BCD */ + 0, /* Bug version number in BCD */ + alpha, /* Development phase */ 0 /* Release number */ }, verUS, diff --git a/BuGS/make/system601_net.2mg b/BuGS/make/system601_net.2mg index 546cb29..ad7867b 100644 Binary files a/BuGS/make/system601_net.2mg and b/BuGS/make/system601_net.2mg differ