• R/O
  • SSH
  • HTTPS

oricsdk: Commit


Commit MetaInfo

Revision1715 (tree)
Time2023-11-25 21:21:57
Authordbug

Log Message

Moved gCurrentLocation and gCurrentLocationPtr from the C module to some zero page location.
Replaced a bunch of gLocations[gCurrentLocation] by gCurrentLocationPtr->
Result: Free size increased from 1053 bytes to 1246 bytes

Change Summary

Incremental Difference

--- users/dbug/UpgradeTime/Encounter/FloppyBuilderVersion/code/game_data.c (revision 1714)
+++ users/dbug/UpgradeTime/Encounter/FloppyBuilderVersion/code/game_data.c (revision 1715)
@@ -4,8 +4,6 @@
44 #include "common.h"
55
66
7-unsigned char gCurrentLocation = e_LOCATION_MARKETPLACE;
8-location* gCurrentLocationPtr = 0;
97
108 /*
119 e_DIRECTION_NORTH = 0,
--- users/dbug/UpgradeTime/Encounter/FloppyBuilderVersion/code/game_main.c (revision 1714)
+++ users/dbug/UpgradeTime/Encounter/FloppyBuilderVersion/code/game_main.c (revision 1715)
@@ -127,7 +127,7 @@
127127
128128 void PrintSceneDirections()
129129 {
130- unsigned char* directions = gLocations[gCurrentLocation].directions;
130+ unsigned char* directions = gCurrentLocationPtr->directions;
131131 int direction;
132132
133133 gFlagDirections = 0;
@@ -282,7 +282,7 @@
282282 void PrintSceneInformation()
283283 {
284284 // Print the description of the place at the top (centered)
285- PrintTopDescription(gLocations[gCurrentLocation].description);
285+ PrintTopDescription(gCurrentLocationPtr->description);
286286
287287 // The redefined charcters to draw the bottom part of the directional arrows \v/
288288 poke(0xbb80+16*40+16,9); // ALT charset
@@ -344,7 +344,7 @@
344344
345345 #if 1
346346 // Set the byte stream pointer
347- SetByteStream(gLocations[gCurrentLocation].script);
347+ SetByteStream(gCurrentLocationPtr->script);
348348
349349 // And run the first set of commands for this scene
350350 HandleByteStream();
@@ -358,9 +358,7 @@
358358
359359 void PlayerMove(unsigned char direction)
360360 {
361- location* locationPtr = &gLocations[gCurrentLocation];
362-
363- unsigned char requestedScene = gLocations[gCurrentLocation].directions[direction];
361+ unsigned char requestedScene = gCurrentLocationPtr->directions[direction];
364362 if (requestedScene==e_LOCATION_NONE)
365363 {
366364 PrintErrorMessage(gTextErrorInvalidDirection); // "Impossible to move in that direction"
--- users/dbug/UpgradeTime/Encounter/FloppyBuilderVersion/code/game_utils.s (revision 1714)
+++ users/dbug/UpgradeTime/Encounter/FloppyBuilderVersion/code/game_utils.s (revision 1715)
@@ -1,4 +1,10 @@
11
2+ .zero
3+
4+_gCurrentLocation .dsb 1
5+_gCurrentLocationPtr .dsb 2
6+
7+
28 .text
39
410 _gCurrentStream
Show on old repository browser