Version 0.9a - see readme for details

This commit is contained in:
Dave Bernazzani 2025-05-02 07:43:39 -04:00
parent 02aa987675
commit 77c6bc7b62
16 changed files with 43 additions and 44 deletions

Binary file not shown.

View File

@ -9,7 +9,7 @@ include $(DEVKITARM)/ds_rules
export TARGET := GimliDS
export TOPDIR := $(CURDIR)
export VERSION := 0.9
export VERSION := 0.9a
ICON := -b $(CURDIR)/C64_icon.bmp "GimliDS $(VERSION);wavemotion-dave;https://github.com/wavemotion-dave/GimliDS"

View File

@ -109,6 +109,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
```
## Change Log
Version 0.9a release 02-May-2025 by wavemotion-dave
* Fixed TrueDrive loading so it doesn't alter the CPU speed (for games like Pang which were playing quite 'uneven').
* Bumped up volume of the SID output by 50% (was too quiet)
* Improved 1541 Drive emulation - mostly in the GCR and IEC areas. Nothing noticeable but should be more accurate.
* Fixed write floppy icon color (instead of the usual green, will flash blue).
* Tweaks to C64 keyboard graphic to be more authentic.
Version 0.9 release 30-Apr-2025 by wavemotion-dave
* New and improved key mapping - including the new Slide-n-Glide joysticks handling.
* SID filtering improved for better audio rendering (Space Taxi voice heard!).

View File

@ -28,7 +28,7 @@ ARCH := -marm -mthumb-interwork
CFLAGS := -g -O3 -flto -Wall -Wformat=0 -Wno-sequence-point -Wno-delete-non-virtual-dtor -Wno-pointer-arith -Wno-register -Wno-narrowing -march=armv5te -mtune=arm946e-s -fomit-frame-pointer -ffast-math $(ARCH) -falign-functions=4 -frename-registers -finline-functions $(ARCH)
CFLAGS += $(INCLUDE) -DARM9 -D__NDS__=1 -DPRECISE_CPU_CYCLES=1 -DPRECISE_CIA_CYCLES=0 -DGLOBAL_VARS=1
CFLAGS += $(INCLUDE) -DARM9 -D__NDS__=1 -DPRECISE_CPU_CYCLES=1 -DGLOBAL_VARS=1
CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions
ASFLAGS := -g $(ARCH) -march=armv5te -mtune=arm946e-s

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View File

@ -1170,16 +1170,17 @@ void C64::main_loop(void)
}
// The order of calls is important here
int cycles = TheVIC->EmulateLine();
int cpu_cycles_to_execute = TheVIC->EmulateLine();
TheSID->EmulateLine(SID_CYCLES_PER_LINE);
#if !PRECISE_CIA_CYCLES
TheCIA1->EmulateLine(63);
TheCIA2->EmulateLine(63);
#endif
TheCIA1->EmulateLine(CIA_CYCLES_PER_LINE);
TheCIA2->EmulateLine(CIA_CYCLES_PER_LINE);
// -----------------------------------------------------------------
// TrueDrive is more complicated as we must interleave the two CPUs
// -----------------------------------------------------------------
if (ThePrefs.TrueDrive)
{
int cycles_1541 = 64;
int cycles_1541 = FLOPPY_CYCLES_PER_LINE + CycleDeltas[myConfig.flopCycles];
TheCPU1541->CountVIATimers(cycles_1541);
if (!TheCPU1541->Idle)
@ -1190,17 +1191,17 @@ void C64::main_loop(void)
// is now handled inside CPU_emuline.h for the 1541 processor
// to avoid the overhead of lots of function calls...
// -----------------------------------------------------------
TheCPU1541->EmulateLine(cycles_1541, cycles);
TheCPU1541->EmulateLine(cycles_1541, cpu_cycles_to_execute);
}
else
{
TheCPU->EmulateLine(cycles);
TheCPU->EmulateLine(cpu_cycles_to_execute);
}
}
else
{
// 1541 processor disabled, only emulate 6510
TheCPU->EmulateLine(cycles);
TheCPU->EmulateLine(cpu_cycles_to_execute);
}
linecnt++;

View File

@ -30,6 +30,11 @@ const int CHAR_ROM_SIZE = 0x1000;
const int DRIVE_RAM_SIZE = 0x800;
const int DRIVE_ROM_SIZE = 0x4000;
#define SID_CYCLES_PER_LINE 63
#define CIA_CYCLES_PER_LINE 63
#define BAD_CYCLES_PER_LINE 23
#define FLOPPY_CYCLES_PER_LINE 64
class Prefs;
class C64Display;
class MOS6510;

View File

@ -116,9 +116,10 @@ public:
uint8 IECLines; // State of IEC lines (bit 7 - DATA, bit 6 - CLK, bit 4 - ATN)
private:
void write_pa(uint8_t byte);
MOS6569 *the_vic;
MOS6502_1541 *the_cpu_1541;
void write_pa(uint8_t byte);
};

View File

@ -46,11 +46,6 @@
#define PRECISE_CPU_CYCLES 0
#endif
// Set this to 1 for instruction-aligned CIA emulation
#ifndef PRECISE_CIA_CYCLES
#define PRECISE_CIA_CYCLES 0
#endif
// Interrupt types
enum {

View File

@ -128,34 +128,23 @@
#define ENDOP(cyc) last_cycles = cyc; break;
#ifndef IS_CPU_1541
#ifndef IS_CPU_1541 // If main C64 CPU we handle borrowed cycles
// Main opcode fetch/execute loop
#if PRECISE_CPU_CYCLES
if (cycles_left) cycles_left -= borrowed_cycles;
while (true)
{
#if PRECISE_CIA_CYCLES && !defined(IS_CPU_1541)
if (last_cycles) {
TheCIA1->EmulateLine(last_cycles);
TheCIA2->EmulateLine(last_cycles);
}
#endif
if ((cycles_left -= last_cycles) < 0) {
if ((cycles_left -= last_cycles) < 0)
{
borrowed_cycles = -cycles_left;
break;
}
#else
while ((cycles_left -= last_cycles) >= 0) {
#endif
#else
#else // CPU is 1541
cpu_cycles += CycleDeltas[myConfig.cpuCycles];
MOS6510 *localCPU = the_c64->TheCPU;
while ((cycles_left -= last_cycles) >= 0)
{
cycle_counter += last_cycles; // Needed for GCR timing
// If we are 1541CPU, we want to alternate running instructions with the main CPU ...
while (cpu_cycles > cycles_left) cpu_cycles -= localCPU->EmulateLine(0);
#endif
@ -1381,8 +1370,12 @@
// Extension opcode
case 0xf2: ext_opcode(); break;
}
#ifdef IS_CPU_1541
cycle_counter += last_cycles; // Needed for GCR timing
#endif
}
#ifdef IS_CPU_1541
// See if there are any straggler cycles left for the CPU
while (cpu_cycles > 0) cpu_cycles -= the_c64->TheCPU->EmulateLine(1);
while (cpu_cycles > 0) cpu_cycles -= the_c64->TheCPU->EmulateLine(0);
#endif

View File

@ -162,7 +162,7 @@ void C64Display::UpdateLEDs(int l0, int l1)
#define RET '\n' // Enter
#define BSP 0x08 // Backspace
#define CTL 0x21 // Ctrl
#define SPC 0x20// Space
#define SPC 0x20 // Space
#define ATT 0x22 // At@
#define UPA 0x23 //uparrow symbol
#define RUN 0x00 // RunStop
@ -602,7 +602,7 @@ void C64Display::PollKeyboard(uint8 *key_matrix, uint8 *rev_matrix, uint8 *joyst
else if (tilex < 194) c = '0';
else if (tilex < 213) c = '+';
else if (tilex < 233) c = '-';
else if (tilex < 256) c = UPA;
else if (tilex < 256) c = PND;
}
else if (tiley < 104) // QWERTY Row
{

View File

@ -40,9 +40,6 @@
#include <nds.h>
#include <stdlib.h>
#define SID_CYCLES_PER_LINE 63
extern uint8 regs[32];
extern uint8 last_sid_byte;
extern int16_t EGDivTable[16]; // Clock divisors for A/D/R settings

View File

@ -1464,7 +1464,7 @@ int MOS6569::EmulateLine(void)
{
if (raster >= FIRST_DMA_LINE && raster <= LAST_DMA_LINE && ((raster & 7) == y_scroll) && bad_lines_enabled) {
is_bad_line = true;
cycles_left = 23 + CycleDeltas[myConfig.badCycles];
cycles_left = BAD_CYCLES_PER_LINE;
}
goto VIC_nop;
}
@ -1485,7 +1485,7 @@ int MOS6569::EmulateLine(void)
{
// Turn on display
display_state = is_bad_line = true;
cycles_left = 23 + CycleDeltas[myConfig.badCycles];
cycles_left = BAD_CYCLES_PER_LINE;
rc = 0;
// Read and latch 40 bytes from video matrix and color RAM

View File

@ -370,7 +370,7 @@ void SetDefaultGameConfig(void)
myConfig.reserved7 = 0;
myConfig.reserved8 = 0xA5; // So it's easy to spot on an "upgrade" and we can re-default it
myConfig.cpuCycles = 0; // Normal 63 - this is the delta adjustment to that
myConfig.badCycles = 0; // Normal 23 - this is the delta adjustment to that
myConfig.flopCycles = 0; // Normal 64 - this is the delta adjustment to that
myConfig.offsetX = 32; // Push the side border off the main display
myConfig.offsetY = 19; // Push the top border off the main display
@ -378,7 +378,7 @@ void SetDefaultGameConfig(void)
myConfig.scaleY = 200; // Scale the 200 pixels of C64 display to the DS 200 (yes, there is only 192 so this will cut... use PAN UP/DN)
}
s16 CycleDeltas[] = {0,1,2,3,4,5,6,7,8,9,-9,-8,-7,-6,-5,-4,-3,-2,-1}; // Used with myConfig.cpuCycles and myConfig.badCycles
s16 CycleDeltas[] = {0,1,2,3,4,5,6,7,8,9,-9,-8,-7,-6,-5,-4,-3,-2,-1}; // Used with myConfig.cpuCycles and myConfig.flopCycles
// ----------------------------------------------------------------------
// Read file twice and ensure we get the same CRC... if not, do it again
@ -575,7 +575,7 @@ const struct options_t Option_Table[1][20] =
{"LCD JITTER", {"NONE", "LIGHT", "HEAVY"}, &myConfig.jitter, 3},
{"DISK SOUND", {"SFX OFF", "SFX ON"}, &myConfig.diskSFX, 2},
{"CPU CYCLES", {CYCLE_DELTA_STR}, &myConfig.cpuCycles, 19},
{"BAD CYCLES", {CYCLE_DELTA_STR}, &myConfig.badCycles, 19},
{"1541 CYCLES", {CYCLE_DELTA_STR}, &myConfig.flopCycles, 19},
{"D-PAD UP", {KEY_MAP_OPTIONS}, &myConfig.key_map[0], 64},
{"D-PAD DOWN", {KEY_MAP_OPTIONS}, &myConfig.key_map[1], 64},

View File

@ -21,7 +21,7 @@ struct __attribute__((__packed__)) Config_t
u8 reserved7;
u8 reserved8;
u8 cpuCycles;
u8 badCycles;
u8 flopCycles;
s8 offsetX;
s8 offsetY;
s16 scaleX;