mirror of
https://github.com/edmccard/twoapple-reboot.git
synced 2024-09-29 16:55:25 +00:00
64-bit cleanup
This commit is contained in:
parent
3c7cca9c55
commit
0063a9e8e0
@ -1,7 +1,7 @@
|
|||||||
DMD_OPTS = -c -version=CycleAccuracy -op -Jdata -I$(GTKD)/src -I$(GTKD)/srcgl \
|
DMD_OPTS = -c -version=CycleAccuracy -op -Jdata -I$(GTKD)/src -I$(GTKD)/srcgl \
|
||||||
-I$(DERELICT)/import
|
-I$(DERELICT)/import
|
||||||
|
|
||||||
GCC_OPTS = -m32 -lpthread -lm -lGL -ldl -lrt \
|
GCC_OPTS = -lpthread -lm -lGL -ldl -lX11 -lrt \
|
||||||
-L$(GTKD) -lgtkd -lgtkdgl \
|
-L$(GTKD) -lgtkd -lgtkdgl \
|
||||||
-L$(DERELICT)/lib -lDerelictSDL -lDerelictUtil \
|
-L$(DERELICT)/lib -lDerelictSDL -lDerelictUtil \
|
||||||
-lphobos2 -ldruntime
|
-lphobos2 -ldruntime
|
||||||
|
@ -87,13 +87,13 @@ class Keyboard
|
|||||||
{
|
{
|
||||||
// assert(canRead()); XXX
|
// assert(canRead()); XXX
|
||||||
int val = values[nextRead];
|
int val = values[nextRead];
|
||||||
nextRead = (nextRead + 1) % values.length;
|
nextRead = (nextRead + 1) % cast(int)values.length;
|
||||||
return val;
|
return val;
|
||||||
}
|
}
|
||||||
|
|
||||||
void write(int val)
|
void write(int val)
|
||||||
{
|
{
|
||||||
int next = (nextWrite + 1) % values.length;
|
int next = (nextWrite + 1) % cast(int)values.length;
|
||||||
if (next != nextRead)
|
if (next != nextRead)
|
||||||
{
|
{
|
||||||
values[nextWrite] = val;
|
values[nextWrite] = val;
|
||||||
|
11
src/host.d
11
src/host.d
@ -100,7 +100,9 @@ class Delay
|
|||||||
|
|
||||||
// Assume that tv_sec = 0;
|
// Assume that tv_sec = 0;
|
||||||
if (timeCompare(&timeShould, &timeNow, &timeDiff))
|
if (timeCompare(&timeShould, &timeNow, &timeDiff))
|
||||||
usleep(timeDiff.tv_usec);
|
{
|
||||||
|
usleep(cast(uint)timeDiff.tv_usec);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void reset()
|
void reset()
|
||||||
@ -122,7 +124,8 @@ class Delay
|
|||||||
{
|
{
|
||||||
gettimeofday(&timeNow, null);
|
gettimeofday(&timeNow, null);
|
||||||
timeCompare(&timeNow, &timeCheck, &timeDiff);
|
timeCompare(&timeNow, &timeCheck, &timeDiff);
|
||||||
uint elapsed = (timeDiff.tv_sec * 1000000) + timeDiff.tv_usec;
|
uint elapsed =
|
||||||
|
cast(uint)((timeDiff.tv_sec * 1000000) + timeDiff.tv_usec);
|
||||||
if (elapsed >= 1000000)
|
if (elapsed >= 1000000)
|
||||||
{
|
{
|
||||||
float percent = cast(float)checkCycles / cast(float)elapsed;
|
float percent = cast(float)checkCycles / cast(float)elapsed;
|
||||||
@ -137,12 +140,12 @@ class Delay
|
|||||||
bool timeCompare(timeval* later, timeval* earlier, timeval* diff)
|
bool timeCompare(timeval* later, timeval* earlier, timeval* diff)
|
||||||
{
|
{
|
||||||
if (later.tv_usec < earlier.tv_usec) {
|
if (later.tv_usec < earlier.tv_usec) {
|
||||||
int nsec = (earlier.tv_usec - later.tv_usec) / 1000000 + 1;
|
int nsec = cast(int)((earlier.tv_usec - later.tv_usec) / 1000000 + 1);
|
||||||
earlier.tv_usec -= 1000000 * nsec;
|
earlier.tv_usec -= 1000000 * nsec;
|
||||||
earlier.tv_sec += nsec;
|
earlier.tv_sec += nsec;
|
||||||
}
|
}
|
||||||
if (later.tv_usec - earlier.tv_usec > 1000000) {
|
if (later.tv_usec - earlier.tv_usec > 1000000) {
|
||||||
int nsec = (later.tv_usec - earlier.tv_usec) / 1000000;
|
int nsec = cast(int)((later.tv_usec - earlier.tv_usec) / 1000000);
|
||||||
earlier.tv_usec += 1000000 * nsec;
|
earlier.tv_usec += 1000000 * nsec;
|
||||||
earlier.tv_sec -= nsec;
|
earlier.tv_sec -= nsec;
|
||||||
}
|
}
|
||||||
|
@ -297,7 +297,7 @@ class IOMem_IIe : IOMem
|
|||||||
|
|
||||||
void setRom(ubyte[] romDump)
|
void setRom(ubyte[] romDump)
|
||||||
{
|
{
|
||||||
int c100 = romDump.length - 16128;
|
int c100 = cast(int)(romDump.length - 16128);
|
||||||
c100c2ff = new Rom(0xC100, 0x0200, romDump[c100 .. (c100 + 0x0200)]);
|
c100c2ff = new Rom(0xC100, 0x0200, romDump[c100 .. (c100 + 0x0200)]);
|
||||||
intC3ROM = new IntC3ROM(romDump[(c100 + 0x0200) .. (c100 + 0x0300)]);
|
intC3ROM = new IntC3ROM(romDump[(c100 + 0x0200) .. (c100 + 0x0300)]);
|
||||||
c400c7ff = new Rom(0xC400, 0x0400,
|
c400c7ff = new Rom(0xC400, 0x0400,
|
||||||
|
@ -808,7 +808,7 @@ class DSKImage : ExternalImage
|
|||||||
|
|
||||||
void loadBytes(ubyte[] data)
|
void loadBytes(ubyte[] data)
|
||||||
{
|
{
|
||||||
uint len = data.length;
|
uint len = cast(uint)data.length;
|
||||||
trackData[offset..offset+len] = data;
|
trackData[offset..offset+len] = data;
|
||||||
offset += len;
|
offset += len;
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ class Timer
|
|||||||
|
|
||||||
private void deleteCounters()
|
private void deleteCounters()
|
||||||
{
|
{
|
||||||
int numCounters = counters.length;
|
int numCounters = cast(int)counters.length;
|
||||||
int lastCounter;
|
int lastCounter;
|
||||||
main: for (int counter = 0; counter < counters.length; ++counter)
|
main: for (int counter = 0; counter < counters.length; ++counter)
|
||||||
{
|
{
|
||||||
|
@ -48,7 +48,7 @@ class TestSystem : II
|
|||||||
|
|
||||||
void setRom(ubyte[] rom_data)
|
void setRom(ubyte[] rom_data)
|
||||||
{
|
{
|
||||||
uint rom_len = rom_data.length;
|
uint rom_len = cast(uint)rom_data.length;
|
||||||
memory_.mainRom.data_[0..12288] = rom_data[(rom_len - 12288)..rom_len];
|
memory_.mainRom.data_[0..12288] = rom_data[(rom_len - 12288)..rom_len];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -442,7 +442,7 @@ class TwoappleDialog
|
|||||||
response = 0;
|
response = 0;
|
||||||
else if ((response == ResponseType.GTK_RESPONSE_CANCEL) ||
|
else if ((response == ResponseType.GTK_RESPONSE_CANCEL) ||
|
||||||
(response == ResponseType.GTK_RESPONSE_DELETE_EVENT))
|
(response == ResponseType.GTK_RESPONSE_DELETE_EVENT))
|
||||||
response = buttonText.length - 1;
|
response = cast(int)(buttonText.length - 1);
|
||||||
|
|
||||||
host.delay.reset();
|
host.delay.reset();
|
||||||
soundCard.resume();
|
soundCard.resume();
|
||||||
|
@ -188,7 +188,8 @@ class TextPatternGenerator_II : TextPatternGenerator
|
|||||||
{
|
{
|
||||||
foreach(index, pattern; segments[seg])
|
foreach(index, pattern; segments[seg])
|
||||||
{
|
{
|
||||||
uint ascii = (((index / 32) * 4) + (index % 4)) + (seg * 32);
|
uint ascii =
|
||||||
|
cast(uint)((((index / 32) * 4) + (index % 4)) + (seg * 32));
|
||||||
uint dotLine = (index / 4) % 8;
|
uint dotLine = (index / 4) % 8;
|
||||||
switch (seg)
|
switch (seg)
|
||||||
{
|
{
|
||||||
@ -249,7 +250,8 @@ class TextPatternGenerator_IIe : TextPatternGenerator
|
|||||||
{
|
{
|
||||||
foreach(index, pattern; segments[seg])
|
foreach(index, pattern; segments[seg])
|
||||||
{
|
{
|
||||||
uint ascii = (((index / 32) * 4) + (index % 4)) + (seg * 32);
|
uint ascii =
|
||||||
|
cast(uint)((((index / 32) * 4) + (index % 4)) + (seg * 32));
|
||||||
uint dotLine = (index / 4) % 8;
|
uint dotLine = (index / 4) % 8;
|
||||||
switch (seg)
|
switch (seg)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user