Skip to content

Commit

Permalink
Latest code
Browse files Browse the repository at this point in the history
  • Loading branch information
emoon committed Feb 1, 2024
1 parent 58e504d commit 482180a
Show file tree
Hide file tree
Showing 163 changed files with 37,208 additions and 161 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,10 @@ packages.config
**/.vs
*.7z
*.zip
*.d
build68k
genblitter
gencomp
gencpu
genlinetoscr
winuae
77 changes: 77 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
.PHONY: all clean

all: winuae

# build68k

build68k: FORCE
$(MAKE) -f Makefile.build68k

cpudefs.cpp: build68k table68k
./build68k < table68k > $@

generated += cpudefs.cpp

# gencomp

gencomp: FORCE $(generated)
$(MAKE) -f Makefile.gencomp

jit/comptbl.h: gencomp
./gencomp

generated += jit/comptbl.h

# gencpu

gencpu: FORCE $(generated)
$(MAKE) -f Makefile.gencpu

cputbl.h: gencpu
./gencpu

generated += cputbl.h

# genblitter

genblitter: FORCE
$(MAKE) -f Makefile.genblitter

blit.h: genblitter
./genblitter i > $@
blitfunc.cpp: genblitter
./genblitter f > $@
blitfunc.h: genblitter
./genblitter h > $@
blittable.cpp: genblitter
./genblitter t > $@

generated += blit.h blitfunc.cpp blitfunc.h blittable.cpp

# genlinetoscr

genlinetoscr: FORCE
$(MAKE) -f Makefile.genlinetoscr

linetoscr.cpp: genlinetoscr
./genlinetoscr > linetoscr.cpp

generated += linetoscr.cpp

# winuae

winuae: FORCE $(generated)
$(MAKE) -f Makefile.winuae

# clean

clean:
make -f Makefile.build68k clean
make -f Makefile.genblitter clean
make -f Makefile.gencomp clean
make -f Makefile.gencpu clean
make -f Makefile.genlinetoscr clean
make -f Makefile.winuae clean
rm -rf out

FORCE: ;
4 changes: 2 additions & 2 deletions archivers/chd/chdcodec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#include "flac.h"
#include "chdcdrom.h"
#include <zlib.h>
#include "7z/LzmaEnc.h"
#include "7z/LzmaDec.h"
//#include "7z/LzmaEnc.h"
#//include "7z/LzmaDec.h"
#include <new>


Expand Down
2 changes: 1 addition & 1 deletion archivers/chd/chdtypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#define ARRAY_LENGTH(x) (sizeof(x) / sizeof(x[0]))

#define CLIB_DECL __cdecl
#define CLIB_DECL //__cdecl
#define FLAC_API_EXPORTS

/* Macros for normalizing data into big or little endian formats */
Expand Down
6 changes: 3 additions & 3 deletions archivers/chd/corealloc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ memory_entry *memory_entry::allocate(size_t size, void *base, const char *file,
fprintf(stderr, "#%06d, alloc %d bytes (%s:%d)\n", (UINT32)entry->m_id, static_cast<UINT32>(entry->m_size), entry->m_file, (int)entry->m_line);

// add it to the alloc list
int hashval = reinterpret_cast<FPTR>(base) % k_hash_prime;
int hashval = reinterpret_cast<FPTR>((unsigned int)(uintptr_t)base) % k_hash_prime;
entry->m_next = s_hash[hashval];
if (entry->m_next != NULL)
entry->m_next->m_prev = entry;
Expand All @@ -317,7 +317,7 @@ memory_entry *memory_entry::find(void *ptr)
// scan the list under the lock
acquire_lock();

int hashval = reinterpret_cast<FPTR>(ptr) % k_hash_prime;
int hashval = reinterpret_cast<FPTR>((unsigned int)(uintptr_t)ptr) % k_hash_prime;
memory_entry *entry;
for (entry = s_hash[hashval]; entry != NULL; entry = entry->m_next)
if (entry->m_base == ptr)
Expand All @@ -340,7 +340,7 @@ void memory_entry::release(memory_entry *entry, const char *file, int line)
fprintf(stderr, "#%06d, release %d bytes (%s:%d)\n", (UINT32)entry->m_id, static_cast<UINT32>(entry->m_size), file, line);

// remove ourselves from the alloc list
int hashval = reinterpret_cast<FPTR>(entry->m_base) % k_hash_prime;
int hashval = reinterpret_cast<FPTR>((unsigned int)(uintptr_t)entry->m_base) % k_hash_prime;
if (entry->m_prev != NULL)
entry->m_prev->m_next = entry->m_next;
else
Expand Down
6 changes: 6 additions & 0 deletions build/Makefile.build68k
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# ./build68k < table68k > cpudefs.cpp

target = build68k
srcs = build68k.cpp

include Makefile.inc
9 changes: 9 additions & 0 deletions build/Makefile.genblitter
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# ./genblitter i > blit.h
# ./genblitter f > blitfunc.c
# ./genblitter h > blitfunc.h
# ./genblitter t > blittable.c

target = genblitter
srcs = blitops.cpp genblitter.cpp

include Makefile.inc
7 changes: 7 additions & 0 deletions build/Makefile.gencomp
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# ./gencomp

target = gencomp
srcs = cpudefs.cpp jit/gencomp.cpp missing.cpp readcpu.cpp od-cross/unicode.cpp

include Makefile.inc

6 changes: 6 additions & 0 deletions build/Makefile.gencpu
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# ./gencpu

target = gencpu
srcs = cpudefs.cpp gencpu.cpp missing.cpp readcpu.cpp od-cross/unicode.cpp

include Makefile.inc
6 changes: 6 additions & 0 deletions build/Makefile.genlinetoscr
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# ./genlinetoscr > linetoscr.cpp

target = genlinetoscr
srcs = genlinetoscr.cpp

include Makefile.inc
134 changes: 134 additions & 0 deletions build/Makefile.quaesar
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@

target = quaesar

srcs = aros.rom.cpp \
akiko.cpp \
amax.cpp \
ar.cpp \
audio.cpp \
autoconf.cpp \
blitfunc.cpp \
blittable.cpp \
blitter.cpp \
calc.cpp \
cd32_fmv_genlock.cpp \
cdrom.cpp \
cdtvcr.cpp \
cfgfile.cpp \
cia.cpp \
consolehook.cpp \
cpudefs.cpp \
cpuemu_0.cpp \
cpuemu_11.cpp \
cpuemu_13.cpp \
cpuemu_20.cpp \
cpuemu_21.cpp \
cpuemu_22.cpp \
cpuemu_23.cpp \
cpuemu_24.cpp \
cpuemu_31.cpp \
cpuemu_32.cpp \
cpuemu_33.cpp \
cpuemu_34.cpp \
cpuemu_35.cpp \
cpuemu_40.cpp \
cpuemu_50.cpp \
cpummu.cpp \
cpummu30.cpp \
cpustbl.cpp \
crc32.cpp \
custom.cpp \
debug.cpp \
debugmem.cpp \
def_icons.cpp \
devices.cpp \
disasm.cpp \
disk.cpp \
diskutil.cpp \
dlopen.cpp \
dongle.cpp \
drawing.cpp \
driveclick.cpp \
enforcer.cpp \
ethernet.cpp \
events.cpp \
expansion.cpp \
fdi2raw.cpp \
filesys.cpp \
flashrom.cpp \
fpp.cpp \
fpp_native.cpp \
fpp_softfloat.cpp \
fsdb.cpp \
gayle.cpp \
hardfile.cpp \
hrtmon.rom.cpp \
ide.cpp \
idecontrollers.cpp \
identify.cpp \
ini.cpp \
inputdevice.cpp \
inputrecord.cpp \
isofs.cpp \
keybuf.cpp \
logging.cpp \
main.cpp \
memory.cpp \
missing.cpp \
native2amiga.cpp \
newcpu.cpp \
newcpu_common.cpp \
readcpu.cpp \
rommgr.cpp \
rtc.cpp \
sana2.cpp \
savestate.cpp \
scp.cpp \
scsi.cpp \
scsiemul.cpp \
scsitape.cpp \
sndboard.cpp \
statusline.cpp \
tabletlibrary.cpp \
test_card.cpp \
tinyxml2.cpp \
traps.cpp \
uaeexe.cpp \
uaelib.cpp \
uaenative.cpp \
uaeresource.cpp \
uaeserial.cpp \
quaesar.cpp \
blkdev.cpp \
od-cross/gfx.cpp \
od-cross/gui.cpp \
od-cross/mman.cpp \
od-cross/machdep/m68k.cpp \
od-cross/thread.cpp \
od-cross/unicode.cpp \
od-cross/file_system.cpp \
od-cross/hardfile_host.cpp \
od-cross/filepaths.cpp \
od-cross/sounddep/sound.cpp \
od-cross/time.cpp \
od-cross/dummy.cpp \
od-cross/input.cpp \
zfile.cpp \
zfile_archive.cpp \
vm.cpp \
softfloat/softfloat.cpp \
softfloat/softfloat_fpsp.cpp \
softfloat/softfloat_decimal.cpp \


include Makefile.inc

CPPFLAGS += -DUAE=1
CPPFLAGS += -D_cdecl= -DFILEFLAG_WRITE=1 -DOS_NAME=\"linux\"
CPPFLAGS += -DUSHORT=uint16_t
CPPFLAGS += -DHWND=uint32_t -DHRESULT=uint32_t -DWPARAM=uint16_t -DLPARAM=uint32_t
CPPFLAGS += -DFILEFLAG_DIR=1 -D_ftelli64=ftello64 -D_fseeki64=fseeko64

EXTS = sdl2 libpng
CPPFLAGS += $(foreach ext,$(EXTS), $(shell pkg-config --cflags $(ext)))
LDLIBS += $(foreach ext,$(EXTS), $(shell pkg-config --libs $(ext))) -lz
44 changes: 44 additions & 0 deletions build/gen_vcproj.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
def extract_srcs_from_file(file):
with open(file, 'r') as f:
text = f.read()

lines = text.split('\n')
files = []
srcs_found = False

for line in lines:
if line.startswith('srcs ='):
srcs_found = True
line = line.replace('srcs =', '')

if srcs_found:
# Continue appending files if the line ends with '\'
if line.endswith('\\'):
files.extend(line[:-1].strip().split())
else:
# Last line of files
files.extend(line.strip().split())
break
return files

# read file to string
def read_file_to_string(file):
with open(file, 'r') as f:
text = f.read()
return text

def main():
header = read_file_to_string("build/vc_proj_header.txt")
footer = read_file_to_string("build/vc_proj_footer.txt")
files = extract_srcs_from_file("Makefile.winuae")

with open("build/quaesar.vcxproj", 'w') as f:
f.write(header)
for file in files:
f.write('<ClCompile Include="../' + file + '" />\n')
f.write(footer)

if __name__ == "__main__":
main()


31 changes: 31 additions & 0 deletions build/quaesar.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.34320.172
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "quaesar", "quaesar.vcxproj", "{63A381AB-E300-47A7-AAD7-BAD5A97A14D3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{63A381AB-E300-47A7-AAD7-BAD5A97A14D3}.Debug|x64.ActiveCfg = Debug|x64
{63A381AB-E300-47A7-AAD7-BAD5A97A14D3}.Debug|x64.Build.0 = Debug|x64
{63A381AB-E300-47A7-AAD7-BAD5A97A14D3}.Debug|x86.ActiveCfg = Debug|Win32
{63A381AB-E300-47A7-AAD7-BAD5A97A14D3}.Debug|x86.Build.0 = Debug|Win32
{63A381AB-E300-47A7-AAD7-BAD5A97A14D3}.Release|x64.ActiveCfg = Release|x64
{63A381AB-E300-47A7-AAD7-BAD5A97A14D3}.Release|x64.Build.0 = Release|x64
{63A381AB-E300-47A7-AAD7-BAD5A97A14D3}.Release|x86.ActiveCfg = Release|Win32
{63A381AB-E300-47A7-AAD7-BAD5A97A14D3}.Release|x86.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {EB2079E1-1FF7-4A69-9C4E-7FCA6B4DD501}
EndGlobalSection
EndGlobal
Loading

0 comments on commit 482180a

Please sign in to comment.