From: Shamus Hammons Date: Thu, 18 May 2017 04:17:17 +0000 (-0500) Subject: Misc. cleanups, incl. cleanup up Makefile. X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=721ead373fc3d4fab6b02e0d549c0cdf9913b71b;p=apple2 Misc. cleanups, incl. cleanup up Makefile. --- diff --git a/Makefile b/Makefile index 60547df..f0a3752 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ # Unified Makefile for Apple 2 SDL # # by James Hammons -# (C) 2005 Underground Software +# (C) 2005-17 Underground Software # This software is licensed under the GPL v3 # @@ -106,7 +106,7 @@ OBJS = \ obj/font14pt.o \ obj/gui.o \ \ - obj/apple2-icon-64x64.o \ + obj/apple2-icon-64x64.o \ obj/applevideo.o \ obj/ay8910.o \ obj/charset.o \ @@ -136,30 +136,19 @@ OBJS = \ obj/textedit.o \ obj/window.o \ -all: checkenv message obj $(TARGET)$(EXESUFFIX) +all: message obj $(TARGET)$(EXESUFFIX) @echo @echo -e "\033[01;33m***\033[00;32m Looks like it compiled OK... Give it a whirl!\033[00m" # Check the compilation environment, barf if not appropriate -checkenv: - @echo - @echo -en "\033[01;33m***\033[00;32m Checking compilation environment... \033[00m" ifeq "$(FINDSDL2)" "" - @echo - @echo - @echo -e "\033[01;33mIt seems that you don't have the SDL 2 development libraries installed. If you" - @echo -e "have installed them, make sure that the sdl2-config file is somewhere in your" - @echo -e "path and is executable.\033[00m" - @echo -#Is there a better way to break out of the makefile? - @false; -# @break -# YES! But ignores all the echo's above... :-/ -#$(error SDL2 MISSING) - -else - @echo -e "\033[01;37mOK\033[00m" + $(info ) + $(info It seems that you don't have the SDL 2 development libraries installed. If you) + $(info have installed them, make sure that the sdl2-config file is somewhere in your) + $(info path and is executable.) + $(info ) + $(error SDL2 MISSING) endif message: @@ -176,8 +165,7 @@ clean: obj: @mkdir obj -# This is only done for Win32 at the moment... - +# Icon creation is only done for Win32 at the moment... ifneq "" "$(ICON)" $(ICON): res/$(TARGET).rc res/$(TARGET).ico @echo -e "\033[01;33m***\033[00;32m Processing icon...\033[00m" @@ -193,15 +181,15 @@ obj/%.o: src/%.cpp @$(CC) $(CPPFLAGS) $(INCS) -c $< -o $@ #GUI compilation... -obj/%.o: src/gui/%.cpp - @echo -e "\033[01;33m***\033[00;32m Compiling $<...\033[00m" - @$(CC) $(CPPFLAGS) $(INCS) -c $< -o $@ +#obj/%.o: src/gui/%.cpp +# @echo -e "\033[01;33m***\033[00;32m Compiling $<...\033[00m" +# @$(CC) $(CPPFLAGS) $(INCS) -c $< -o $@ $(TARGET)$(EXESUFFIX): $(OBJS) @echo -e "\033[01;33m***\033[00;32m Linking it all together...\033[00m" @$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) -# strip --strip-all vj$(EXESUFFIX) -# upx -9 vj$(EXESUFFIX) +# strip --strip-all $(TARGET)$(EXESUFFIX) +# upx -9 $(TARGET)$(EXESUFFIX) statistics: @echo -n "Lines in source files: " diff --git a/apple2.cfg b/apple2.cfg index 31500bd..2d92f27 100644 --- a/apple2.cfg +++ b/apple2.cfg @@ -14,90 +14,6 @@ autoSaveState = 1 #This is the default--we don't advertise it just yet... ;-) #autoStateFilename = ./apple2auto.state -# TEMPORARY disk image load paths - -#floppyImage1 = ./disks/dos33.dsk -#floppyImage1 = ./disks/prodos.dsk -#floppyImage1 = ./disks/temp.nib -#floppyImage1 = ./disks/temp.dsk -# Yes -#floppyImage1 = ./disks/sneakers.do -# Yes -#floppyImage1 = ./disks/Gumball (Mr. Krac-Man and The Disk Jockey crack).dsk -# Yes -#floppyImage1 = ./disks/prince_of_persia_boot.dsk -#floppyImage2 = ./disks/prince_of_persia_a.dsk -#floppyImage1 = ./disks/prince_of_persia_b.dsk -# Yes -#floppyImage1 = ./disks/Oregon Trail (Disk 1 of 2).dsk -#floppyImage2 = ./disks/Oregon Trail (Disk 2 of 2).dsk -# Yes -floppyImage1 = ./disks/bt1_boot.dsk -# Yes -#floppyImage1 = ./disks/bt2_boot.dsk -# Yes -#floppyImage1 = ./disks/bt3_boot_fixed.dsk -#floppyImage2 = ./disks/bt3_character_fixed.dsk -# Yes -#floppyImage1 = ./disks/Sabotage.dsk -# Yes -#floppyImage1 = ./disks/airheart.dsk -# Yes -#floppyImage1 = ./disks/drol.dsk -# Yes -#floppyImage1 = ./disks/skyfox.dsk -# Yes -#floppyImage1 = ./disks/karateka.dsk -# Yes -#floppyImage1 = ./disks/wolfenstein_dos32.nib -# Yes, keys??? (joystick only) -#floppyImage1 = ./disks/MidnightMagic_etc.dsk -# Yes -#floppyImage1 = ./disks/battle_chess_1.dsk -#floppyImage2 = ./disks/battle_chess_2.dsk -# Yes -#floppyImage1 = ./disks/MoebiusI-1.dsk -#floppyImage2 = ./disks/MoebiusI-2.dsk -# Yes, but crashes on the attract mode (does the same in AppleWin) -# Also, write problems -#floppyImage1 = ./disks/moebiusiia.dsk -#floppyImage1 = ./disks/MoebiusIIA.dsk -#floppyImage2 = ./disks/MoebiusIIB.dsk -# Yes -#floppyImage1 = ./disks/wind_walker_1.dsk -#floppyImage2 = ./disks/wind_walker_2.dsk -# Yes -#floppyImage1 = ./disks/dino_eggs.dsk -# ??? 1, yes; 2, no -#floppyImage1 = ./disks/mockingboard1.dsk -#floppyImage2 = ./disks/mockingboard2.dsk -# Yes, but have to load manually -#floppyImage1 = ./disks/ultima_ii-1.dsk -#floppyImage2 = ./disks/ultima_ii-2.dsk -# Yes, autoloads! -#floppyImage1 = ./disks/u2prog.dsk -#floppyImage2 = ./disks/u2master-jlh.dsk -#floppyImage2 = ./disks/u2player-jlh.dsk -# Yes -#floppyImage1 = ./disks/Ultima_II_-_Program_Disk.dsk -#floppyImage2 = ./disks/Ultima_II_-_Player_Disk-jlh.dsk -# Yes -#floppyImage1 = ./disks/TheHeist.dsk -# Yes -#floppyImage1 = ./disks/ult31snd.dsk -#floppyImage2 = ./disks/ult32snd.dsk -# Yes (key repeat is too high) -#floppyImage1 = ./disks/bandits.dsk -# Yes -#floppyImage1 = ./disks/SpareChange.dsk -# Yes -#floppyImage1 = ./disks/lode_runner.dsk -# Yes -#floppyImage1 = ./disks/championship_lode_runner.dsk -# Yes -#floppyImage1 = ./disks/championship_lode_runner.bin - - # OpenGL filtering type: 1 - blurry, 0 - sharp glFilterType = 0 @@ -114,50 +30,3 @@ useJoystick = 0 joyport = 0 -# Jaguar joypad key assignments -# Note: It would be nicer to be able to have a single left side to store all this in... -# E.g. p1keys = 34, 32, 22, etc. instead of what we have here... - -p1k_up = 273 # SDLK_UP -p1k_down = 274 # SDLK_DOWN -p1k_left = 276 # SDLK_LEFT -p1k_right = 275 # SDLK_RIGHT -p1k_c = 122 # SDLK_z -p1k_b = 120 # SDLK_x -p1k_a = 99 # SDLK_c -p1k_option = 39 # SDLK_QUOTE -p1k_pause = 13 # SDLK_RETURN -p1k_0 = 256 # SDLK_KP0 -p1k_1 = 257 # SDLK_KP1 -p1k_2 = 258 # SDLK_KP2 -p1k_3 = 259 # SDLK_KP3 -p1k_4 = 260 # SDLK_KP4 -p1k_5 = 261 # SDLK_KP5 -p1k_6 = 262 # SDLK_KP6 -p1k_7 = 263 # SDLK_KP7 -p1k_8 = 264 # SDLK_KP8 -p1k_9 = 265 # SDLK_KP9 -p1k_pound = 267 # SDLK_KP_DIVIDE -p1k_star = 268 # SDLK_KP_MULTIPLY - -p2k_up = 273 # SDLK_UP -p2k_down = 274 # SDLK_DOWN -p2k_left = 276 # SDLK_LEFT -p2k_right = 275 # SDLK_RIGHT -p2k_c = 122 # SDLK_z -p2k_b = 120 # SDLK_x -p2k_a = 99 # SDLK_c -p2k_option = 39 # SDLK_QUOTE -p2k_pause = 13 # SDLK_RETURN -p2k_0 = 256 # SDLK_KP0 -p2k_1 = 257 # SDLK_KP1 -p2k_2 = 258 # SDLK_KP2 -p2k_3 = 259 # SDLK_KP3 -p2k_4 = 260 # SDLK_KP4 -p2k_5 = 261 # SDLK_KP5 -p2k_6 = 262 # SDLK_KP6 -p2k_7 = 263 # SDLK_KP7 -p2k_8 = 264 # SDLK_KP8 -p2k_9 = 265 # SDLK_KP9 -p2k_pound = 267 # SDLK_KP_DIVIDE -p2k_star = 268 # SDLK_KP_MULTIPLY diff --git a/cross-compile b/cross-compile index ec07450..f0b73fa 100755 --- a/cross-compile +++ b/cross-compile @@ -6,7 +6,8 @@ # (C) 2012 Underground Software # export PATH=/opt/mxe/usr/bin:$PATH -make CROSS=i686-pc-mingw32- clean && make CROSS=i686-pc-mingw32- +#make CROSS=i686-pc-mingw32- clean && make CROSS=i686-pc-mingw32- +make CROSS=x86_64-w64-mingw32- clean && make CROSS=x86_64-w64-mingw32.static- upx -9v apple2.exe #TARGET = apple2 diff --git a/src/apple2.cpp b/src/apple2.cpp index d3d37b2..a862843 100644 --- a/src/apple2.cpp +++ b/src/apple2.cpp @@ -987,7 +987,7 @@ if (counter == 60) #endif //let's wait, then signal... -//works longer, but then still falls behind... +//works longer, but then still falls behind... [FIXED, see above] #ifdef THREADED_65C02 if (!pauseMode) SDL_CondSignal(cpuCond);//OK, let the CPU go another frame... diff --git a/src/floppy.h b/src/floppy.h index d439bfe..2a25505 100644 --- a/src/floppy.h +++ b/src/floppy.h @@ -11,6 +11,10 @@ #define MAX_PATH _POSIX_PATH_MAX #else #include // for MAX_PATH on MinGW/Darwin +// Kludge for Win64 +#ifndef MAX_PATH +#define MAX_PATH _MAX_PATH +#endif #endif #include #include diff --git a/src/mmu.cpp b/src/mmu.cpp index 7070fda..eaf1000 100644 --- a/src/mmu.cpp +++ b/src/mmu.cpp @@ -26,9 +26,6 @@ enum { AM_RAM, AM_ROM, AM_BANKED, AM_READ, AM_WRITE, AM_READ_WRITE, AM_END_OF_LIST }; // Macros for function pointers -// The typedef would be something like: -//typedef ReadFunc (uint8_t (*)(uint16_t)); -//typedef WriteFunc (void (*)(uint16_t, uint8_t)); #define READFUNC(x) uint8_t (* x)(uint16_t) #define WRITEFUNC(x) void (* x)(uint16_t, uint8_t) @@ -51,6 +48,7 @@ struct AddressMap WRITEFUNC(write); }; +#define ADDRESS_MAP_END { 0x0000, 0x0000, AM_END_OF_LIST, 0, 0, 0, 0 } // Dunno if I like this approach or not... //ADDRESS_MAP_START() @@ -192,7 +190,8 @@ AddressMap memoryMap[] = { { 0xD000, 0xDFFF, AM_BANKED, &lcBankMemoryR, &lcBankMemoryW, 0, 0 }, { 0xE000, 0xFFFF, AM_BANKED, &upperMemoryR, &upperMemoryW, 0, 0 }, - { 0x0000, 0x0000, AM_END_OF_LIST, 0, 0, 0, 0 } +// { 0x0000, 0x0000, AM_END_OF_LIST, 0, 0, 0, 0 } + ADDRESS_MAP_END }; @@ -329,8 +328,8 @@ uint8_t ReadMemory(uint16_t address) void WriteMemory(uint16_t address, uint8_t byte) { - // We can write protect memory this way, but it adds a branch to the mix. :-/ - // (this can be avoided by setting up another bank of memory which we + // We can write protect memory this way, but it adds a branch to the mix. + // :-/ (this can be avoided by setting up another bank of memory which we // ignore... hmm...) if ((*addrPtrWrite[address]) == 0) return; @@ -372,15 +371,11 @@ WriteLog("Setting 80STORE to %s...\n", (store80Mode ? "ON" : "off")); { mainMemoryTextR = (displayPage2 ? &ram2[0x0400] : &ram[0x0400]); mainMemoryTextW = (displayPage2 ? &ram2[0x0400] : &ram[0x0400]); -// mainMemoryHGRR = (displayPage2 ? &ram2[0x2000] : &ram[0x2000]); -// mainMemoryHGRW = (displayPage2 ? &ram2[0x2000] : &ram[0x2000]); } else { mainMemoryTextR = (ramwrt ? &ram2[0x0400] : &ram[0x0400]); mainMemoryTextW = (ramwrt ? &ram2[0x0400] : &ram[0x0400]); -// mainMemoryHGRR = (ramwrt ? &ram2[0x2000] : &ram[0x2000]); -// mainMemoryHGRW = (ramwrt ? &ram2[0x2000] : &ram[0x2000]); } } @@ -704,8 +699,6 @@ WriteLog("Setting PAGE2 to %s...\n", (address & 0x01 ? "ON" : "off")); { mainMemoryTextR = (displayPage2 ? &ram2[0x0400] : &ram[0x0400]); mainMemoryTextW = (displayPage2 ? &ram2[0x0400] : &ram[0x0400]); -// mainMemoryHGRR = (displayPage2 ? &ram2[0x2000] : &ram[0x2000]); -// mainMemoryHGRW = (displayPage2 ? &ram2[0x2000] : &ram[0x2000]); } return 0; @@ -721,8 +714,6 @@ WriteLog("Setting PAGE2 to %s...\n", (address & 0x01 ? "ON" : "off")); { mainMemoryTextR = (displayPage2 ? &ram2[0x0400] : &ram[0x0400]); mainMemoryTextW = (displayPage2 ? &ram2[0x0400] : &ram[0x0400]); -// mainMemoryHGRR = (displayPage2 ? &ram2[0x2000] : &ram[0x2000]); -// mainMemoryHGRW = (displayPage2 ? &ram2[0x2000] : &ram[0x2000]); } } diff --git a/src/settings.h b/src/settings.h index 2a698f9..4dbca07 100644 --- a/src/settings.h +++ b/src/settings.h @@ -11,6 +11,10 @@ #define MAX_PATH _POSIX_PATH_MAX #else #include // for MAX_PATH on MinGW/Darwin +// Win64 kludge +#ifndef MAX_PATH +#define MAX_PATH _MAX_PATH // Ugh. +#endif #endif #include diff --git a/src/sound.cpp b/src/sound.cpp index 75f9ba2..18c0760 100644 --- a/src/sound.cpp +++ b/src/sound.cpp @@ -36,6 +36,7 @@ #define SAMPLES_PER_FRAME (SAMPLE_RATE / 60.0) #define CYCLES_PER_SAMPLE (1024000.0 / SAMPLE_RATE) //#define SOUND_BUFFER_SIZE (8192) +// 32K ought to be enough for anybody #define SOUND_BUFFER_SIZE (32768) // Global variables diff --git a/src/v65c02.cpp b/src/v65c02.cpp index e33c654..015fe6e 100644 --- a/src/v65c02.cpp +++ b/src/v65c02.cpp @@ -3051,11 +3051,13 @@ if (regs.pc == 0xFBD8) { // Not sure about this... regs.sp = 0xFF; - regs.cc = FLAG_B | FLAG_I; // Reset the CC register - regs.pc = RdMemW(0xFFFC); // And load PC with the RESET vector + regs.cc = FLAG_B | FLAG_I; // Reset the CC register + regs.pc = RdMemW(0xFFFC); // And load PC with the RESET vector - context->cpuFlags &= ~V65C02_ASSERT_LINE_RESET; - regs.cpuFlags &= ~V65C02_ASSERT_LINE_RESET; +// context->cpuFlags &= ~V65C02_ASSERT_LINE_RESET; +// regs.cpuFlags &= ~V65C02_ASSERT_LINE_RESET; + context->cpuFlags = 0; // Clear CPU flags... + regs.cpuFlags = 0; #ifdef __DEBUG__ WriteLog("\n*** RESET *** (PC = $%04X)\n\n", regs.pc); #endif diff --git a/src/video.cpp b/src/video.cpp index 361e886..01fecc1 100644 --- a/src/video.cpp +++ b/src/video.cpp @@ -14,7 +14,7 @@ #include "video.h" #include // Why??? (for memset, etc... Lazy!) Dunno why, but this just strikes me as wrong... #include -#include "gui/gui.h" +//#include "gui/gui.h" #include "apple2-icon-64x64.h" #include "log.h" #include "settings.h"