Revision: 18918
http://vice-emu.svn.sourceforge.net/vice-emu/?rev=18918&view=rev
Author: blackystardust
Date: 2008-06-25 09:31:29 -0700 (Wed, 25 Jun 2008)
Log Message:
-----------
Added some more in-depth comments about the GeoRAM emulation and fixed the control registers emulation.
Modified Paths:
--------------
branches/marco/ports/vice/src/c64/c64io.c
branches/marco/ports/vice/src/c64/georam.c
branches/marco/ports/vice/src/c64/georam.h
Modified: branches/marco/ports/vice/src/c64/c64io.c
===================================================================
--- branches/marco/ports/vice/src/c64/c64io.c 2008-06-24 21:30:50 UTC (rev 18917)
+++ branches/marco/ports/vice/src/c64/c64io.c 2008-06-25 16:31:29 UTC (rev 18918)
@@ -140,7 +140,7 @@
}
#define MAX_IO1_RETURNS 8
-#define MAX_IO2_RETURNS 11
+#define MAX_IO2_RETURNS 10
#if MAX_IO1_RETURNS>MAX_IO2_RETURNS
static int io_source_return[MAX_IO1_RETURNS];
@@ -409,11 +409,6 @@
io_source_check(io_source_counter);
io_source_counter++;
}
- if (georam_enabled && addr >= 0xdf80) {
- return_value = georam_reg_read((WORD)(addr & 1));
- io_source_check(io_source_counter);
- io_source_counter++;
- }
if (mmc64_enabled && addr >= 0xdf10 && addr <= 0xdf13) {
return_value = mmc64_io2_read((WORD)(addr));
io_source_check(io_source_counter);
Modified: branches/marco/ports/vice/src/c64/georam.c
===================================================================
--- branches/marco/ports/vice/src/c64/georam.c 2008-06-24 21:30:50 UTC (rev 18917)
+++ branches/marco/ports/vice/src/c64/georam.c 2008-06-25 16:31:29 UTC (rev 18918)
@@ -24,6 +24,57 @@
*
*/
+/*
+ * The GeoRAM is a banked memory system. It uses the registers at
+ * $dffe and $dfff to determine what part of the GeoRAM memory should
+ * be mapped to $de00-$deff.
+ *
+ * The BBG (Battery Backed GeoRAM) is a version that retains the
+ * RAM contents after power-off.
+ *
+ * The register at $dfff selects which 16k block to map, and $dffe
+ * selects a 256-byte page in that block. Since there are only 64
+ * 256-byte pages inside of 16k, the value in $dffe ranges from 0 to
+ * 63.
+ *
+ * Register | bits
+ * -------------------
+ * $dffe | xx543210
+ *
+ * x = unused, not connected.
+ *
+ *
+ * The number of 16k blocks that is available depends on the
+ * size of the GeoRAM/BBG:
+ *
+ * RAM size | $dfff
+ * ------------------
+ * 64k | $00-$03
+ * 128k | $00-$07
+ * 256k | $00-$0f
+ * 512k | $00-$1f
+ * 1024k | $00-$3f
+ * 2048k | $00-$7f
+ * 2048k | $00-$ff
+ *
+ * The unused bits in both registers are ignore and using them in
+ * software will cause a wrap-around.
+ *
+ * The two registers are write-only. Attempting to read them will
+ * only return random values.
+ *
+ * Currently both the BBG and GeoRAM are emulated, BBG mode is
+ * used when selecting a save-file.
+ *
+ * The current emulation has the two registers mirrorred through the
+ * range of $df80-$dffd
+ *
+ * There is also a user-made clone of the GeoRAM called the NeoRAM,
+ * it works in the same way as the GeoRAM but seems to have extra
+ * RAM sizes currently not supported by this emulation (like 1536k).
+ *
+ */
+
#include "vice.h"
#include <stdio.h>
@@ -294,16 +345,6 @@
/* ------------------------------------------------------------------------- */
-BYTE REGPARM1 georam_reg_read(WORD addr)
-{
- BYTE retval;
-
- io_source=IO_SOURCE_GEORAM;
- retval=georam[addr&1];
-
- return retval;
-}
-
BYTE REGPARM1 georam_window_read(WORD addr)
{
BYTE retval;
Modified: branches/marco/ports/vice/src/c64/georam.h
===================================================================
--- branches/marco/ports/vice/src/c64/georam.h 2008-06-24 21:30:50 UTC (rev 18917)
+++ branches/marco/ports/vice/src/c64/georam.h 2008-06-25 16:31:29 UTC (rev 18918)
@@ -38,7 +38,6 @@
extern void georam_reset(void);
extern void georam_shutdown(void);
-extern BYTE REGPARM1 georam_reg_read(WORD addr);
extern BYTE REGPARM1 georam_window_read(WORD addr);
extern void REGPARM2 georam_reg_store(WORD addr, BYTE byte);
extern void REGPARM2 georam_window_store(WORD addr, BYTE byte);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|