Skip to content

Commit 98d76cc

Browse files
ejaquayejaquay
andauthored
Correct comments and documentation for ramdisk.dll (#159)
Co-authored-by: ejaquay <[email protected]>
1 parent 12a163e commit 98d76cc

File tree

3 files changed

+20
-21
lines changed

3 files changed

+20
-21
lines changed

Ramdisk/Ramdisk.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,14 @@ extern "C"
7171
{
7272
switch (Port)
7373
{
74+
// Address of RAM disk to read/write
7475
case 0x40:
7576
case 0x41:
7677
case 0x42:
7778
WritePort(Port,Data);
7879
return;
7980
break;
80-
81+
// Write to RAM disk
8182
case 0x43:
8283
WriteArray(Data);
8384
return;
@@ -98,6 +99,7 @@ extern "C"
9899
{
99100
switch (Port)
100101
{
102+
// Read from RAM disk
101103
case 0x43:
102104
return(ReadArray());
103105
break;
@@ -107,4 +109,4 @@ extern "C"
107109
break;
108110
} //End port switch
109111
}
110-
}
112+
}

Ramdisk/memboard.cpp

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,28 @@ This file is part of VCC (Virtual Color Computer).
2020
#include <stdio.h>
2121
#include "memboard.h"
2222

23-
24-
2523
union
2624
{
2725
unsigned int Address;
28-
struct
29-
{
26+
struct {
3027
unsigned char lswlsb,lswmsb,mswlsb,mswmsb;
3128
} Byte;
32-
} IndexAddress;//BufferAddress;
29+
} IndexAddress; //BufferAddress;
3330

3431
static unsigned char *RamBuffer=NULL;
3532

3633
bool InitMemBoard(void)
3734
{
3835
IndexAddress.Address=0;
39-
if (RamBuffer!=NULL)
40-
free(RamBuffer);
36+
37+
if (RamBuffer!=NULL) free(RamBuffer); // Free existing RAM
4138
RamBuffer=(unsigned char *)malloc(RAMSIZE);
42-
if (RamBuffer==NULL)
43-
return(true);
44-
memset(RamBuffer,0,RAMSIZE);
45-
return(false);
39+
if (RamBuffer==NULL) return(true); // Failed to allocate RAM
40+
memset(RamBuffer,0,RAMSIZE); // Clear the RAM
41+
return(false); // Success
4642
}
4743

44+
// Get I/O address
4845
bool WritePort(unsigned char Port,unsigned char Data)
4946
{
5047
switch (Port)
@@ -73,5 +70,3 @@ unsigned char ReadArray(void)
7370
return(RamBuffer[IndexAddress.Address]);
7471
}
7572

76-
77-

docs/UserGuide.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ The VCC installation package & VCC Zip Package contain these files:
413413
- harddisk.dll (Generic Hard Drive Controller) mpi.dll
414414
(Tandy Multi-Pak Interface)
415415
- orch90.dll (Orchhestra90cc Program Pack)
416-
- Ramdisk.dll (256k External Ram Disk Cartridge)
416+
- Ramdisk.dll (512k External Ram Disk Cartridge)
417417
- SuperIDE.dll (Cloud9 IDE Hard Drive Controller)
418418
- GMC.dll (Game Master Cart by John Linville)
419419
- coco3.rom (the Coco 3 BASIC ROM, auto loaded)
@@ -2129,10 +2129,10 @@ emulation.
21292129

21302130
## Ramdisk Cart
21312131

2132-
NOTE: At the moment, this cart does not seem to function properly. The
2133-
issue is being investigated. The ramdisk worked before conversion to
2134-
VS2015, so it's most likely a syntax problem in the VCC code and should
2135-
be fixed soon
2132+
NOTE: This cart has port conflicts with fd502. It will only work if
2133+
fd502.dll is NOT installed. This limits it's usefullness. If there
2134+
is any interest it could easily be changed to a port range that does
2135+
not conflict.
21362136

21372137
This cart image emulates a 512k. RAM cart. It's very simple to use and
21382138
can give you 512k of extra data storage. To use the RamDisk cart, you
@@ -2154,7 +2154,9 @@ emulation.
21542154
To write &H55 to the above address: (overwrites any existing data at
21552155
that address) POKE &HFF43,&H55
21562156

2157-
A NitrOS9 driver for this cart would be a very simple project.
2157+
The contents of the RAMDisk will be lost if VCC is restarted or reset.
2158+
2159+
A NitrOS9 driver for this cart would be a simple project.
21582160

21592161
## GMC.dll
21602162

0 commit comments

Comments
 (0)