Skip to content

Commit 408b67a

Browse files
committed
Moved the console bus speed to the lst files
1 parent faac698 commit 408b67a

File tree

5 files changed

+28
-2
lines changed

5 files changed

+28
-2
lines changed

ttyd-tools/rel/include/gc/os.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#pragma once
2+
3+
#include <cstdint>
4+
5+
namespace gc::os {
6+
7+
extern "C" {
8+
9+
extern uint32_t OSBusClock;
10+
11+
}
12+
13+
}

ttyd-tools/rel/include/ttyd.eu.lst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// os
2+
// data
3+
800000F8:OSBusClock
4+
15
// __mem.c
26
800050B4:memset
37
// 800050E4:__fill_mem

ttyd-tools/rel/include/ttyd.jp.lst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// os
2+
// data
3+
800000F8:OSBusClock
4+
15
// __mem.c
26
800050B4:memset
37
// 800050E4:__fill_mem

ttyd-tools/rel/include/ttyd.us.lst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// os
2+
// data
3+
800000F8:OSBusClock
4+
15
// __mem.c
26
800050B4:memset
37
// 800050E4:__fill_mem

ttyd-tools/rel/source/memorywatch.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#include "commonfunctions.h"
44
#include "menufunctions.h"
55

6+
#include <gc/os.h>
67
#include <ttyd/system.h>
78

89
#include <cstdio>
@@ -118,8 +119,8 @@ const char *getValueString(int32_t slot)
118119
}
119120
case time:
120121
{
121-
uint32_t *ConsoleBusSpeed = reinterpret_cast<uint32_t *>(0x800000F8);
122-
uint32_t TimeBase = *ConsoleBusSpeed / 4;
122+
uint32_t ConsoleBusSpeed = gc::os::OSBusClock;
123+
uint32_t TimeBase = ConsoleBusSpeed / 4;
123124
uint32_t FPS = getCurrentFPS();
124125

125126
int64_t CurrentTime = *reinterpret_cast<int64_t *>(Address) / (TimeBase / FPS);

0 commit comments

Comments
 (0)