-
Notifications
You must be signed in to change notification settings - Fork 0
/
_9_utilities.ino
61 lines (53 loc) · 3.32 KB
/
_9_utilities.ino
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
// ####################################################################################################
// # Flight 3000 written by Mark Sunnucks (Snux) Copyright 2016 #
// # #
// # Based on and expanded from example code supplied with the myPinballs Custom Controller Boardset #
// # #
// # This code will not compile or run on its own. It requires the myPinballs Custom Controller #
// # Boardset hardware and frameworks, which are available here: #
// # http://mypinballs.co.uk/electronics/store.jsp #
// # #
// # Boardset, All Frameworks & Code Structure/Design are Copyright Orange Cloud Software Ltd #
// ####################################################################################################
//
// This file is part of Flight 3000.
//
// Flight 3000 is free software: you can redistribute it and/or modify it under the terms of the GNU General Public
// License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
// Flight 3000 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
//----------------------------------------
// define includes
//----------------------------------------
//----------------------------------------
//----------------------------------------
// define global variables
//----------------------------------------
//----------------------------------------
// methods
//----------------------------------------
int freeRam() //outputs the amount of free sram in bytes
{
extern int __heap_start, *__brkval;
int v;
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
}
// This is called when the second button in the coin door is pressed, will dump a whole load of
// game information to the serial monitor for debugging.
void game_status()
{
Serial.print(F("Game Status : balls in walker : "));Serial.println(balls_in_walker, DEC);
Serial.print(F("Game Status : multiball stage : "));Serial.println(multiball_stage[active_player_id], DEC);
Serial.print(F("Game Status : balls in trough : "));Serial.println(balls_in_trough());
Serial.print(F("Game Status : stage lit : "));Serial.println(stage_lit[active_player_id], DEC);
Serial.print(F("Game Status : blastoff count : "));Serial.println(blastoff_count[active_player_id], DEC);
Serial.print(F("Game Status : extra balls : "));Serial.println(extra_balls, DEC);
Serial.print(F("Game Status : free memory : "));Serial.println(freeRam());
Serial.print(F("Game Status : ball save : "));
if (ball_save_enabled)
Serial.println(F("enabled"));
else
Serial.println(F("disabled"));
//Serial.print(F("Free Ram:"));
//Serial.println(freeRam());
}