]> Shamusworld >> Repos - apple2/commitdiff
Misc. cleanups, incl. cleanup up Makefile.
authorShamus Hammons <jlhamm@acm.org>
Thu, 18 May 2017 04:17:17 +0000 (23:17 -0500)
committerShamus Hammons <jlhamm@acm.org>
Thu, 18 May 2017 04:17:17 +0000 (23:17 -0500)
Makefile
apple2.cfg
cross-compile
src/apple2.cpp
src/floppy.h
src/mmu.cpp
src/settings.h
src/sound.cpp
src/v65c02.cpp
src/video.cpp

index 60547dfee28c2daaed93708e85508df9847c39ff..f0a37523fb6dfae29bee7631dfa42793cf343730 100644 (file)
--- 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: "
index 31500bd3ca8d2413fbaf49f268290c989e0c2953..2d92f2788b680b0661c74d89f8472f6563cd84e8 100644 (file)
@@ -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
index ec0745077a8b1791682f7ea99e9f531a8ef85b0c..f0b73fabc88b0df5b9875ac409dd52c6e809753e 100755 (executable)
@@ -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
index d3d37b2e62e6c9f32bc14e4bdf5fd5354aa273ff..a8628434898e73100be3b62f62b1611ab0fb52e7 100644 (file)
@@ -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...
index d439bfe84d9393348f5038d5b32026ae0bf0607e..2a25505ae4c52177d34288b03177dffea7d5a9a4 100644 (file)
 #define MAX_PATH               _POSIX_PATH_MAX
 #else
 #include <stdlib.h>                                                            // for MAX_PATH on MinGW/Darwin
+// Kludge for Win64
+#ifndef MAX_PATH
+#define        MAX_PATH        _MAX_PATH
+#endif
 #endif
 #include <stdint.h>
 #include <stdio.h>
index 7070fda34b93347f6bc539b3c8cf1147a5c6397d..eaf1000dc0da790f81ab91e9ffbc48bab8eb38c1 100644 (file)
@@ -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]);
        }
 }
 
index 2a698f9e7e5bdbdbebf95f12982257aa750ed0e6..4dbca07912dc6e91157635c00ce5958406e881c7 100644 (file)
 #define MAX_PATH               _POSIX_PATH_MAX
 #else
 #include <stdlib.h>                                                            // for MAX_PATH on MinGW/Darwin
+// Win64 kludge
+#ifndef MAX_PATH
+#define MAX_PATH               _MAX_PATH               // Ugh.
+#endif
 #endif
 #include <stdint.h>
 
index 75f9ba2bae9779c3493752f28867905f59fd0d8d..18c076005a49ca63171a0a276898d87a008f168f 100644 (file)
@@ -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
index e33c6541c0e493d76eb7e737eb215497316f3fc8..015fe6ea281dbdc53e47ba0f6a7e4cc163300b0a 100644 (file)
@@ -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
index 361e886df0e81cfc3b78b15e1deef495ad5c53f6..01fecc1a5185b461be18175e5dd5c79f1dc8467e 100644 (file)
@@ -14,7 +14,7 @@
 #include "video.h"
 #include <string.h>    // Why??? (for memset, etc... Lazy!) Dunno why, but this just strikes me as wrong...
 #include <malloc.h>
-#include "gui/gui.h"
+//#include "gui/gui.h"
 #include "apple2-icon-64x64.h"
 #include "log.h"
 #include "settings.h"