Skip to content
This repository
Browse code

Data BUS retention for zero-page load error.

Better homebrew ROMs support
  • Loading branch information...
commit 1bccad46834aac75b547b03a1e3e45b65cf01d2b 1 parent 08447a0
ppeccin authored May 15, 2012
89  src/atari/board/BUS.java
@@ -2,6 +2,7 @@
2 2
 
3 3
 package atari.board;
4 4
 
  5
+import parameters.Parameters;
5 6
 import general.board.BUS16Bits;
6 7
 import atari.cartridge.Cartridge;
7 8
 import atari.pia.PIA;
@@ -18,81 +19,65 @@ public BUS(TIA tia, PIA pia, RAM ram) {
18 19
 
19 20
 	@Override
20 21
 	public byte readByte(int address) {
21  
-		switch (selectDevice(address)) {
22  
-			case CART:
23  
-				return cartridge.readByte(address);
24  
-			case RAM:
25  
-				return ram.readByte(address);
26  
-			case TIA:
27  
-				return tia.readByte(address);
28  
-			case PIA:
29  
-				return pia.readByte(address);
30  
-		}
31  
-		throw new IllegalStateException();
  22
+		// CART selected?
  23
+		if ((address & CART_MASK) == CART_SEL)
  24
+			return data = cartridge.readByte(address);
  25
+		// RAM selected?
  26
+		if ((address & RAM_MASK) == RAM_SEL)
  27
+			return data = ram.readByte(address);
  28
+		// PIA selected?
  29
+		if ((address & PIA_MASK) == PIA_SEL)
  30
+			return data = pia.readByte(address);
  31
+		// TIA selected...
  32
+		// Only bit 7 and 6 are connected to TIA read registers.
  33
+		if (DATA_RETENTION)
  34
+			// Use the retained data for bits 5-0
  35
+			return data = (byte)(data & 0x3f | tia.readByte(address));
  36
+		else
  37
+			// As if all bits were provided by TIA
  38
+			return data = tia.readByte(address);
32 39
 	}
33 40
 
34 41
 	@Override
35  
-	public int unsignedByte(int address) {
36  
-		switch (selectDevice(address)) {
37  
-			case CART:
38  
-				return cartridge.unsignedByte(address);
39  
-			case RAM:
40  
-				return ram.unsignedByte(address);
41  
-			case TIA:
42  
-				return tia.unsignedByte(address);
43  
-			case PIA:
44  
-				return pia.unsignedByte(address);
45  
-		}
46  
-		throw new IllegalStateException();
47  
-	}
48  
-	
49  
-	@Override
50 42
 	public void writeByte(int address, byte b) {
51  
-		switch (selectDevice(address)) {
52  
-			case CART:
53  
-				cartridge.writeByte(address, b); return;
54  
-			case RAM:
55  
-				ram.writeByte(address, b); return;
56  
-			case TIA:
57  
-				tia.writeByte(address, b); return;
58  
-			case PIA:
59  
-				pia.writeByte(address, b); return;
  43
+		data = b;
  44
+		// RAM selected?
  45
+		if ((address & RAM_MASK) == RAM_SEL) {
  46
+			ram.writeByte(address, b); return;
  47
+		}
  48
+		// TIA selected?
  49
+		if ((address & TIA_MASK) == TIA_SEL) {
  50
+			tia.writeByte(address, b); return;
60 51
 		}
61  
-		throw new IllegalStateException();
  52
+		// PIA selected?
  53
+		if ((address & PIA_MASK) == PIA_SEL) {
  54
+			pia.writeByte(address, b); return;
  55
+		}
  56
+		// CART selected...
  57
+		cartridge.writeByte(address, b);
62 58
 	}
63 59
 
64 60
 	public void cartridge(Cartridge cartridge) {
65 61
 		this.cartridge = cartridge;
66 62
 	}
67 63
 
68  
-	private int selectDevice(int address) {
69  
-		if ((address & CART_MASK) == CART_SEL)
70  
-			return CART;
71  
-		if ((address & RAM_MASK) == RAM_SEL)
72  
-			return RAM;
73  
-		if ((address & TIA_MASK) == TIA_SEL)
74  
-			return TIA;
75  
-		if ((address & PIA_MASK) == PIA_SEL)
76  
-			return PIA;
77  
-		throw new UnsupportedOperationException(String.format("Address not mapped: $%04x", address));
78  
-	}
79 64
 
80 65
 	public Cartridge cartridge;
81 66
 	public final RAM ram;
82 67
 	public final TIA tia;
83 68
 	public final PIA pia;
84  
-	
85  
-	private static final int CART = 0;
  69
+
  70
+	private byte data = 0;
  71
+
86 72
 	private static final int CART_MASK = 0x1000;
87 73
 	private static final int CART_SEL = 0x1000;
88  
-	private static final int RAM = 1;
89 74
 	private static final int RAM_MASK = 0x1280;
90 75
 	private static final int RAM_SEL = 0x0080;
91  
-	private static final int TIA = 2;
92 76
 	private static final int TIA_MASK = 0x1080;
93 77
 	private static final int TIA_SEL = 0x0000;
94  
-	private static final int PIA = 3;
95 78
 	private static final int PIA_MASK = 0x1280;
96 79
 	private static final int PIA_SEL = 0x0280;
97 80
 
  81
+	private static final boolean DATA_RETENTION = Parameters.BUS_DATA_RETENTION;
  82
+
98 83
 }
5  src/atari/cartridge/Cartridge.java
@@ -16,11 +16,6 @@ public byte readByte(int address) {
16 16
 	}
17 17
 
18 18
 	@Override
19  
-	public int unsignedByte(int address) {  
20  
-		return readByte(address) & 0xff;
21  
-	}
22  
-	
23  
-	@Override
24 19
 	public void writeByte(int address, byte b) {	
25 20
 		// Writing to ROMs is possible, but nothing is changed
26 21
 	}
1  src/atari/cartridge/bankswitching/Cartridge12K.java
@@ -27,7 +27,6 @@ protected int maskAddress(int address) {
27 27
 				break;
28 28
 			case 0x0ffa:	// bank 2 selection
29 29
 				bankAddressOffset = 8192;
30  
-				break;
31 30
 		}
32 31
 		return add;
33 32
 	}
1  src/atari/cartridge/bankswitching/Cartridge16K.java
@@ -30,7 +30,6 @@ protected int maskAddress(int address) {
30 30
 				break;
31 31
 			case 0x0ff9:	// bank 3 selection
32 32
 				bankAddressOffset = 12288;
33  
-				break;
34 33
 		}
35 34
 		return add;
36 35
 	}
1  src/atari/cartridge/bankswitching/Cartridge28K.java
@@ -39,7 +39,6 @@ protected int maskAddress(int address) {
39 39
 				break;
40 40
 			case 0x0ffb:	// bank 6 selection
41 41
 				bankAddressOffset = 16384 + 8192;
42  
-				break;
43 42
 		}
44 43
 		return add;
45 44
 	}
1  src/atari/cartridge/bankswitching/Cartridge32K.java
@@ -42,7 +42,6 @@ protected int maskAddress(int address) {
42 42
 				break;
43 43
 			case 0x0ffb:	// bank 7 selection
44 44
 				bankAddressOffset = 16384 + 12288;
45  
-				break;
46 45
 		}
47 46
 		return add;
48 47
 	}
3  src/atari/cartridge/bankswitching/Cartridge8K.java
@@ -12,6 +12,8 @@ public Cartridge8K(byte[] content, Boolean superChip) {
12 12
 		if (content.length != SIZE)
13 13
 			throw new IllegalStateException("Invalid size for " + this.getClass().getName() + ": " + content.length);
14 14
 		setContent(content);
  15
+		// Start at bank 1	TODO Check
  16
+		bankAddressOffset = 4096;
15 17
 	}
16 18
 
17 19
 	@Override
@@ -24,7 +26,6 @@ protected int maskAddress(int address) {
24 26
 				break;
25 27
 			case 0x0ff9:	// bank 1 selection
26 28
 				bankAddressOffset = 4096;
27  
-				break;
28 29
 		}
29 30
 		return add;
30 31
 	}
5  src/atari/pia/PIA.java
@@ -82,11 +82,6 @@ public byte readByte(int address) {
82 82
 	}
83 83
 
84 84
 	@Override
85  
-	public int unsignedByte(int address) {
86  
-		return readByte(address) & 0xff;
87  
-	}
88  
-
89  
-	@Override
90 85
 	public void writeByte(int address, byte b) {
91 86
 		int i = b & 0xff;
92 87
 		switch(address & WRITE_ADDRESS_MASK) {
8  src/atari/pia/RAM.java
@@ -18,14 +18,12 @@ public void powerOn() {
18 18
 	public void powerOff() {
19 19
 	}
20 20
 
  21
+	@Override
21 22
 	public byte readByte(int address) {		
22 23
 		return bytes[(address & ADDRESS_MASK)];	
23 24
 	}
24 25
 
25  
-	public int unsignedByte(int address) {  
26  
-		return bytes[(address & ADDRESS_MASK)] & 0xff;
27  
-	}
28  
-	
  26
+	@Override
29 27
 	public void writeByte(int address, byte b) {	
30 28
 		bytes[(address & ADDRESS_MASK)] = b;		
31 29
 	}
@@ -33,7 +31,7 @@ public void writeByte(int address, byte b) {
33 31
 	public void dump() {
34 32
 		System.out.println("RAM DUMP:");
35 33
 		for(int i = 0; i < bytes.length; i++)
36  
-			System.out.printf("%02x ", unsignedByte(i));
  34
+			System.out.printf("%02x ", bytes[i]);
37 35
 		System.out.println();
38 36
 	}
39 37
 	
19  src/atari/tia/TIA.java
@@ -136,7 +136,7 @@ private boolean debugPauseHook() {
136 136
 
137 137
 	private void setPixelValue() {
138 138
 		// Updates the current PlayFiled pixel to draw only each 4 pixels, or at the first calculated pixel after stopped using cached line
139  
-		if (clock >= 68 && (clock == lastObservableChangeClock || clock % 4 == 0))
  139
+		if (clock % 4 == 0 || clock == lastObservableChangeClock)
140 140
 			playfieldUpdateCurrentPixel();
141 141
 		// No need to calculate all possibilities in vBlank. TODO No collisions will be detected during vBlank
142 142
 		if (vBlankOn) {
@@ -767,11 +767,6 @@ public byte readByte(int address) {
767 767
 	}	
768 768
 
769 769
 	@Override
770  
-	public int unsignedByte(int address) {
771  
-		return readByte(address) & 0xff;
772  
-	}	
773  
-
774  
-	@Override
775 770
 	public void writeByte(int address, byte b) {
776 771
 		int i = b & 0xff;
777 772
 		switch(address & WRITE_ADDRESS_MASK) {
@@ -798,11 +793,7 @@ public void writeByte(int address, byte b) {
798 793
 			case 0x14:	RESBL  = i; hitRESBL(); return;
799 794
 			case 0x15:	AUDC0  = i; audioOutput.channel0().setControl(i & 0x0f); return;
800 795
 			case 0x16:	AUDC1  = i; audioOutput.channel1().setControl(i & 0x0f); return;
801  
-			case 0x17:	
802  
-				
803  
-				System.out.printf("%2x   %s\n", i, cpu.printMemory(0x90, 16));
804  
-				
805  
-				AUDF0  = i; audioOutput.channel0().setDivider((i & 0x1f) + 1); return;		// Bits 0-4, Divider from 1 to 32 )
  796
+			case 0x17:	AUDF0  = i; audioOutput.channel0().setDivider((i & 0x1f) + 1); return;		// Bits 0-4, Divider from 1 to 32 )
806 797
 			case 0x18:	AUDF1  = i; audioOutput.channel1().setDivider((i & 0x1f) + 1); return;		// Bits 0-4, Divider from 1 to 32 )
807 798
 			case 0x19:	AUDV0  = i; audioOutput.channel0().setVolume(i & 0x0f); return;				// Bits 0-3, Volume from 0 to 15 )
808 799
 			case 0x1A:	AUDV1  = i; audioOutput.channel1().setVolume(i & 0x0f); return;				// Bits 0-3, Volume from 0 to 15 )
@@ -1337,10 +1328,10 @@ public void loadState(TIAState state) {
1337 1328
 	
1338 1329
 	private static final int PLAYERS_DELAYED_SPRITE_GHANGES_MAX_COUNT = 50;  // Supports a maximum of player GR changes before any is drawn
1339 1330
 	
1340  
-	public static final boolean SYNC_WITH_AUDIO_MONITOR = Parameters.TIA_SYNC_WITH_AUDIO_MONITOR;
1341  
-	public static final boolean SYNC_WITH_VIDEO_MONITOR = Parameters.TIA_SYNC_WITH_VIDEO_MONITOR;
  1331
+	private static final boolean SYNC_WITH_AUDIO_MONITOR = Parameters.TIA_SYNC_WITH_AUDIO_MONITOR;
  1332
+	private static final boolean SYNC_WITH_VIDEO_MONITOR = Parameters.TIA_SYNC_WITH_VIDEO_MONITOR;
1342 1333
 	
1343  
-	public static final double FORCED_CLOCK = Parameters.TIA_FORCED_CLOCK;	//  TIA Real Clock = NTSC clock = 3584160 or 3579545 Hz
  1334
+	private static final double FORCED_CLOCK = Parameters.TIA_FORCED_CLOCK;	//  TIA Real Clock = NTSC clock = 3584160 or 3579545 Hz
1344 1335
 
1345 1336
 	public static final double DEFAUL_CLOCK_NTSC = Parameters.TIA_DEFAULT_CLOCK_NTSC;		
1346 1337
 	public static final double DEFAUL_CLOCK_PAL = Parameters.TIA_DEFAULT_CLOCK_PAL;		
2  src/general/board/BUS16Bits.java
@@ -8,8 +8,6 @@
8 8
 
9 9
 	public byte readByte(int address);
10 10
 
11  
-	public int unsignedByte(int address);
12  
-	
13 11
 	public void writeByte(int address, byte b);
14 12
 
15 13
 }
12  src/general/m6502/M6502.java
@@ -118,8 +118,8 @@ public void clockPulse() {
118 118
 			if (!RDY) return;						// CPU is halted
119 119
 		if (--cyclesToExecute >= 0) return;			// CPU is still "executing" remaining instruction cycles
120 120
 		if (trace) showTrace();
121  
-		instructionToExecute = instructions[memory.unsignedByte(PC++)];		// Reads the instruction to be executed
122  
-		cyclesToExecute = instructionToExecute.fetch() - 1;					// One cycle was just executed already!
  121
+		instructionToExecute = instructions[toUnsignedByte(memory.readByte(PC++))];		// Reads the instruction to be executed
  122
+		cyclesToExecute = instructionToExecute.fetch() - 1;				// One cycle was just executed already!
123 123
 	}
124 124
 
125 125
 	public void powerOn() {	// Initializes the CPU as if it were just powered on
@@ -146,7 +146,7 @@ public char fetchRelativeAddress() {
146 146
 	}
147 147
 
148 148
 	public char fetchZeroPageAddress() {
149  
-		return (char) (memory.unsignedByte(PC++));
  149
+		return (char) toUnsignedByte((memory.readByte(PC++)));
150 150
 	}
151 151
 
152 152
 	public char fetchZeroPageXAddress() {
@@ -191,12 +191,12 @@ public char fetchIndirectYAddress() {
191 191
 	}
192 192
 
193 193
 	public char memoryReadWord(int address) {
194  
-		return (char) (memory.unsignedByte(address) + (memory.unsignedByte(address + 1) << 8));		// Address + 1 may wrap, LSB first
  194
+		return (char) (toUnsignedByte(memory.readByte(address)) + (toUnsignedByte(memory.readByte(address + 1)) << 8));		// Address + 1 may wrap, LSB first
195 195
 	}
196 196
 
197 197
 	public char memoryReadWordWrappingPage(int address) {		// Accounts for the page-cross problem  (should wrap page)
198 198
 		if ((address & 0xff) == 0xff)		
199  
-			return (char) (memory.unsignedByte(address) + (memory.unsignedByte(address & 0xff00) << 8));		// Gets hi byte from the page-wrap &xx00 (addr + 1 wraps to begin of page)
  199
+			return (char) (toUnsignedByte(memory.readByte(address)) + (toUnsignedByte(memory.readByte(address & 0xff00)) << 8));	// Gets hi byte from the page-wrap &xx00 (addr + 1 wraps to begin of page)
200 200
 		else
201 201
 			return memoryReadWord(address);
202 202
 	}
@@ -591,7 +591,7 @@ public void loadState(M6502State state) {
591 591
 	public static int toUunsignedByte(byte b) {	// ** NOTE does not return a real byte for signed operations
592 592
 		return b & 0xff;
593 593
 	}
594  
-	public static int toUnsignedByte(int i) {		// ** NOTE does not return a real byte for signed operations
  594
+	public static int toUnsignedByte(int i) {	// ** NOTE does not return a real byte for signed operations
595 595
 		return toUunsignedByte((byte)i);
596 596
 	}
597 597
 
2  src/general/m6502/instructions/BRK.java
@@ -16,7 +16,7 @@ public BRK(M6502 cpu) {
16 16
 	public int fetch() {
17 17
 		// BRK requires one extra unused byte after the opcode, as of the specification
18 18
 		// Lets use this byte as a parameter for debug purposes!
19  
-		par = cpu.memory.unsignedByte(cpu.fetchImmediateAddress());
  19
+		par = M6502.toUnsignedByte(cpu.memory.readByte(cpu.fetchImmediateAddress()));
20 20
 		return 7;
21 21
 	}
22 22
 
2  src/general/m6502/instructions/CPx.java
@@ -41,7 +41,7 @@ public int fetch() {
41 41
 
42 42
 	@Override
43 43
 	public void execute() {
44  
-		int uVal = cpu.memory.unsignedByte(ea); 
  44
+		int uVal = M6502.toUnsignedByte(cpu.memory.readByte(ea)); 
45 45
 		int uR;
46 46
 		switch (reg) {
47 47
 			case rA:
2  src/general/m6502/instructions/uSBX.java
@@ -20,7 +20,7 @@ public int fetch() {
20 20
 	public void execute() {
21 21
 		byte b = (byte) (cpu.A & cpu.X);
22 22
 		int uB = M6502.toUunsignedByte(b);
23  
-		int uVal = cpu.memory.unsignedByte(ea); 
  23
+		int uVal = M6502.toUnsignedByte(cpu.memory.readByte(ea)); 
24 24
 		byte newX = (byte)(uB - uVal);
25 25
 		cpu.X = newX;
26 26
 		
2  src/parameters/Emulator.properties
... ...
@@ -1 +1 @@
1  
-
# 0 = No Forced Clock, -1 = Full Speed (useful for VSynch).    ***  TIA Real Clock = 3584160 ***
TIA_FORCED_CLOCK = 0
TIA_DEFAULT_CLOCK_NTSC = 60
TIA_DEFAULT_CLOCK_PAL = 50.39
TIA_SYNC_WITH_AUDIO_MONITOR = false
TIA_SYNC_WITH_VIDEO_MONITOR = false

TIA_AUDIO_SAMPLE_RATE = 31430
TIA_AUDIO_MAX_AMPLITUDE = 0.5
TIA_AUDIO_MAX_MONO_CHANNEL_AMPLITUDE = 0.5
TIA_AUDIO_MAX_STEREO_CHANNEL_AMPLITUDE = 0.9

# 0 = External Synch (useful for VSynch), -1 = Auto FPS (On Demand)
SCREEN_DEFAULT_FPS = -1
SCREEN_DEFAULT_ORIGIN_X = 68
SCREEN_DEFAULT_ORIGIN_Y_PCT = 12
SCREEN_DEFAULT_WIDTH = 160
SCREEN_DEFAULT_HEIGHT_PCT = 81.5
SCREEN_DEFAULT_SCALE_X = 4
SCREEN_DEFAULT_SCALE_Y = 2
SCREEN_DEFAULT_SCALE_ASPECT_X = 2
SCREEN_BORDER_SIZE = 3
SCREEN_OSD_FRAMES = 160
SCREEN_VSYNC_TOLERANCE = 20
SCREEN_QUALITY_RENDERING = false
SCREEN_CRT_MODE = 0
SCREEN_CRT_RETENTION_ALPHA = 0.78
SCREEN_SCANLINES_STRENGTH = 0.5
SCREEN_MULTI_BUFFERING = 2
SCREEN_PAGE_FLIPPING = true
SCREEN_BUFFER_VSYNC = 0
SCREEN_FRAME_ACCELERATION = 0
SCREEN_INTERM_FRAME_ACCELERATION = -1
SCREEN_SCANLINES_ACCELERATION = -1 

# 0 = External Synch, -1 = Auto FPS (On Demand)
SPEAKER_DEFAULT_FPS = -1
SPEAKER_INPUT_BUFFER_SIZE = 1536
SPEAKER_OUTPUT_BUFFER_SIZE = 1024
SPEAKER_OUTPUT_BUFFER_FULL_SLEEP_TIME = 5
SPEAKER_NO_DATA_SLEEP_TIME = 10
SPEAKER_ADDED_THREAD_PRIORITY = 0

CONSOLE_FAST_SPEED_FACTOR = 20

SERVER_SERVICE_NAME = "AtariP1Server"
SERVER_SERVICE_PORT = 9998
SERVER_MAX_UPDATES_PENDING = 20
CLIENT_MAX_UPDATES_PENDING = 20
  1
+
# 0 = No Forced Clock, -1 = Full Speed (useful for VSynch).    ***  TIA Real Clock = 3584160 ***
TIA_FORCED_CLOCK = 0
TIA_DEFAULT_CLOCK_NTSC = 60
TIA_DEFAULT_CLOCK_PAL = 50.39
TIA_SYNC_WITH_AUDIO_MONITOR = false
TIA_SYNC_WITH_VIDEO_MONITOR = false

TIA_AUDIO_SAMPLE_RATE = 31430
TIA_AUDIO_MAX_AMPLITUDE = 0.5
TIA_AUDIO_MAX_MONO_CHANNEL_AMPLITUDE = 0.5
TIA_AUDIO_MAX_STEREO_CHANNEL_AMPLITUDE = 0.9

# 0 = External Synch (useful for VSynch), -1 = Auto FPS (On Demand)
SCREEN_DEFAULT_FPS = -1
SCREEN_DEFAULT_ORIGIN_X = 68
SCREEN_DEFAULT_ORIGIN_Y_PCT = 12
SCREEN_DEFAULT_WIDTH = 160
SCREEN_DEFAULT_HEIGHT_PCT = 81.5
SCREEN_DEFAULT_SCALE_X = 4
SCREEN_DEFAULT_SCALE_Y = 2
SCREEN_DEFAULT_SCALE_ASPECT_X = 2
SCREEN_BORDER_SIZE = 3
SCREEN_OSD_FRAMES = 160
SCREEN_VSYNC_TOLERANCE = 20
SCREEN_QUALITY_RENDERING = false
SCREEN_CRT_MODE = 0
SCREEN_CRT_RETENTION_ALPHA = 0.75
SCREEN_SCANLINES_STRENGTH = 0.5
SCREEN_MULTI_BUFFERING = 2
SCREEN_PAGE_FLIPPING = true
SCREEN_BUFFER_VSYNC = 0
SCREEN_FRAME_ACCELERATION = 0
SCREEN_INTERM_FRAME_ACCELERATION = -1
SCREEN_SCANLINES_ACCELERATION = -1 

# 0 = External Synch, -1 = Auto FPS (On Demand)
SPEAKER_DEFAULT_FPS = -1
SPEAKER_INPUT_BUFFER_SIZE = 1536
SPEAKER_OUTPUT_BUFFER_SIZE = 1024
SPEAKER_OUTPUT_BUFFER_FULL_SLEEP_TIME = 5
SPEAKER_NO_DATA_SLEEP_TIME = 10
SPEAKER_ADDED_THREAD_PRIORITY = 0

CONSOLE_FAST_SPEED_FACTOR = 20

BUS_DATA_RETENTION = true

SERVER_SERVICE_NAME = "AtariP1Server"
SERVER_SERVICE_PORT = 9998
SERVER_MAX_UPDATES_PENDING = 20
CLIENT_MAX_UPDATES_PENDING = 20
2  src/parameters/Emulator.properties.single
... ...
@@ -1 +1 @@
1  
-
# 0 = No Forced Clock, -1 = Full Speed (useful for VSynch).    ***  TIA Real Clock = 3584160 ***
TIA_FORCED_CLOCK = 0
TIA_DEFAULT_CLOCK_NTSC = 60
TIA_DEFAULT_CLOCK_PAL = 50.39
TIA_SYNC_WITH_AUDIO_MONITOR = true
TIA_SYNC_WITH_VIDEO_MONITOR = true

TIA_AUDIO_SAMPLE_RATE = 31430
TIA_AUDIO_MAX_AMPLITUDE = 0.5
TIA_AUDIO_MAX_MONO_CHANNEL_AMPLITUDE = 0.5
TIA_AUDIO_MAX_STEREO_CHANNEL_AMPLITUDE = 0.9

# 0 = External Synch (useful for VSynch), -1 = Auto FPS (On Demand)
SCREEN_DEFAULT_FPS = 0
SCREEN_DEFAULT_ORIGIN_X = 68
SCREEN_DEFAULT_ORIGIN_Y_PCT = 12
SCREEN_DEFAULT_WIDTH = 160
SCREEN_DEFAULT_HEIGHT_PCT = 81.5
SCREEN_DEFAULT_SCALE_X = 4
SCREEN_DEFAULT_SCALE_Y = 2
SCREEN_DEFAULT_SCALE_ASPECT_X = 2
SCREEN_BORDER_SIZE = 3
SCREEN_OSD_FRAMES = 160
SCREEN_VSYNC_TOLERANCE = 20
SCREEN_QUALITY_RENDERING = false
SCREEN_CRT_MODE = 0
SCREEN_CRT_RETENTION_ALPHA = 0.78
SCREEN_SCANLINES_STRENGTH = 0.5
SCREEN_MULTI_BUFFERING = 2
SCREEN_PAGE_FLIPPING = true
SCREEN_BUFFER_VSYNC = 0
SCREEN_FRAME_ACCELERATION = 0
SCREEN_INTERM_FRAME_ACCELERATION = -1
SCREEN_SCANLINES_ACCELERATION = -1 

# 0 = External Synch, -1 = Auto FPS (On Demand)
SPEAKER_DEFAULT_FPS = 0
SPEAKER_INPUT_BUFFER_SIZE = 1536
SPEAKER_OUTPUT_BUFFER_SIZE = 1536
SPEAKER_OUTPUT_BUFFER_FULL_SLEEP_TIME = 5
SPEAKER_NO_DATA_SLEEP_TIME = 10
SPEAKER_ADDED_THREAD_PRIORITY = 0

CONSOLE_FAST_SPEED_FACTOR = 20

SERVER_SERVICE_NAME = "AtariP1Server"
SERVER_SERVICE_PORT = 9998
SERVER_MAX_UPDATES_PENDING = 20
CLIENT_MAX_UPDATES_PENDING = 20
  1
+
# 0 = No Forced Clock, -1 = Full Speed (useful for VSynch).    ***  TIA Real Clock = 3584160 ***
TIA_FORCED_CLOCK = 0
TIA_DEFAULT_CLOCK_NTSC = 60
TIA_DEFAULT_CLOCK_PAL = 50.39
TIA_SYNC_WITH_AUDIO_MONITOR = true
TIA_SYNC_WITH_VIDEO_MONITOR = true

TIA_AUDIO_SAMPLE_RATE = 31430
TIA_AUDIO_MAX_AMPLITUDE = 0.5
TIA_AUDIO_MAX_MONO_CHANNEL_AMPLITUDE = 0.5
TIA_AUDIO_MAX_STEREO_CHANNEL_AMPLITUDE = 0.9

# 0 = External Synch (useful for VSynch), -1 = Auto FPS (On Demand)
SCREEN_DEFAULT_FPS = 0
SCREEN_DEFAULT_ORIGIN_X = 68
SCREEN_DEFAULT_ORIGIN_Y_PCT = 12
SCREEN_DEFAULT_WIDTH = 160
SCREEN_DEFAULT_HEIGHT_PCT = 81.5
SCREEN_DEFAULT_SCALE_X = 4
SCREEN_DEFAULT_SCALE_Y = 2
SCREEN_DEFAULT_SCALE_ASPECT_X = 2
SCREEN_BORDER_SIZE = 3
SCREEN_OSD_FRAMES = 160
SCREEN_VSYNC_TOLERANCE = 20
SCREEN_QUALITY_RENDERING = false
SCREEN_CRT_MODE = 0
SCREEN_CRT_RETENTION_ALPHA = 0.78
SCREEN_SCANLINES_STRENGTH = 0.5
SCREEN_MULTI_BUFFERING = 2
SCREEN_PAGE_FLIPPING = true
SCREEN_BUFFER_VSYNC = 0
SCREEN_FRAME_ACCELERATION = 0
SCREEN_INTERM_FRAME_ACCELERATION = -1
SCREEN_SCANLINES_ACCELERATION = -1 

# 0 = External Synch, -1 = Auto FPS (On Demand)
SPEAKER_DEFAULT_FPS = 0
SPEAKER_INPUT_BUFFER_SIZE = 1536
SPEAKER_OUTPUT_BUFFER_SIZE = 1536
SPEAKER_OUTPUT_BUFFER_FULL_SLEEP_TIME = 5
SPEAKER_NO_DATA_SLEEP_TIME = 10
SPEAKER_ADDED_THREAD_PRIORITY = 0

CONSOLE_FAST_SPEED_FACTOR = 20

BUS_DATA_RETENTION = true

SERVER_SERVICE_NAME = "AtariP1Server"
SERVER_SERVICE_PORT = 9998
SERVER_MAX_UPDATES_PENDING = 20
CLIENT_MAX_UPDATES_PENDING = 20
6  src/parameters/Parameters.java
@@ -30,7 +30,7 @@ public static void load() {
30 30
 		TIA_AUDIO_MAX_AMPLITUDE = Float.valueOf(p.getProperty("TIA_AUDIO_MAX_AMPLITUDE", String.valueOf(TIA_AUDIO_MAX_AMPLITUDE)));  
31 31
 		TIA_AUDIO_MAX_MONO_CHANNEL_AMPLITUDE = Float.valueOf(p.getProperty("TIA_AUDIO_MAX_MONO_CHANNEL_AMPLITUDE", String.valueOf(TIA_AUDIO_MAX_MONO_CHANNEL_AMPLITUDE)));
32 32
 		TIA_AUDIO_MAX_STEREO_CHANNEL_AMPLITUDE= Float.valueOf(p.getProperty("TIA_AUDIO_MAX_STEREO_CHANNEL_AMPLITUDE", String.valueOf(TIA_AUDIO_MAX_STEREO_CHANNEL_AMPLITUDE)));
33  
-		
  33
+
34 34
 		SCREEN_DEFAULT_FPS = Double.valueOf(p.getProperty("SCREEN_DEFAULT_FPS", String.valueOf(SCREEN_DEFAULT_FPS)));
35 35
 		SCREEN_DEFAULT_ORIGIN_X = Integer.valueOf(p.getProperty("SCREEN_DEFAULT_ORIGIN_X", String.valueOf(SCREEN_DEFAULT_ORIGIN_X)));
36 36
 		SCREEN_DEFAULT_ORIGIN_Y_PCT = Double.valueOf(p.getProperty("SCREEN_DEFAULT_ORIGIN_Y_PCT", String.valueOf(SCREEN_DEFAULT_ORIGIN_Y_PCT)));
@@ -62,6 +62,8 @@ public static void load() {
62 62
 
63 63
 		CONSOLE_FAST_SPEED_FACTOR = Integer.valueOf(p.getProperty("CONSOLE_FAST_SPEED_FACTOR", String.valueOf(CONSOLE_FAST_SPEED_FACTOR)));
64 64
 
  65
+		BUS_DATA_RETENTION = Boolean.valueOf(p.getProperty("BUS_DATA_RETENTION", String.valueOf(BUS_DATA_RETENTION)));
  66
+
65 67
 		SERVER_SERVICE_NAME = String.valueOf(p.getProperty("SERVER_SERVICE_NAME", String.valueOf(SERVER_SERVICE_NAME)));
66 68
 		SERVER_SERVICE_PORT = Integer.valueOf(p.getProperty("SERVER_SERVICE_PORT", String.valueOf(SERVER_SERVICE_PORT)));
67 69
 		SERVER_MAX_UPDATES_PENDING = Integer.valueOf(p.getProperty("SERVER_MAX_UPDATES_PENDING", String.valueOf(SERVER_MAX_UPDATES_PENDING)));
@@ -113,6 +115,8 @@ public static void load() {
113 115
 
114 116
 	public static int		CONSOLE_FAST_SPEED_FACTOR = 8;
115 117
 
  118
+	public static boolean 	BUS_DATA_RETENTION = true;
  119
+
116 120
 	public static String	SERVER_SERVICE_NAME = "AtariP1Server";
117 121
 	public static int 		SERVER_SERVICE_PORT = 9998;
118 122
 	public static int 		SERVER_MAX_UPDATES_PENDING = 20;

0 notes on commit 1bccad4

Please sign in to comment.
Something went wrong with that request. Please try again.