Commit 28bda80

Nick committed on
Remove palette code causing range check error
commit 28bda805bdca6e91bee5cfb6c03d3a66ee8b0dac parent 5aa34b2
4 changed files +8−6
ModifiedCpu/machine.pas +2−2
@@ -419,7 +419,7 @@ begin
419 exit; 419 exit;
420 end; 420 end;
421 421
422 case address of 422 {case address of
423 $ff69: 423 $ff69:
424 begin 424 begin
425 palramb[(m_iram[$ff68]) and 63] := Data; 425 palramb[(m_iram[$ff68]) and 63] := Data;
@@ -488,7 +488,7 @@ begin
488 m_iram[$ff6a] := m_iram[$ff6a] or 128; 488 m_iram[$ff6a] := m_iram[$ff6a] or 128;
489 end; 489 end;
490 end; 490 end;
491 end; 491 end;}
492 end; 492 end;
493 493
494 if ((address >= $e000) and (address < $fe00)) then 494 if ((address >= $e000) and (address < $fe00)) then
ModifiedGlobal/vars.pas +3−3
@@ -115,8 +115,8 @@ var
115 sio_count: byte; 115 sio_count: byte;
116 116
117 m_cgbram: array[0..32767] of byte; 117 m_cgbram: array[0..32767] of byte;
118 pal_b, pal_o: array[0..7, 0..3, 0..2] of byte; 118 {pal_b, pal_o: array[0..7, 0..3, 0..2] of byte;
119 pal_dx_b, pal_dx_o: array[0..7, 0..3] of DWord; 119 pal_dx_b, pal_dx_o: array[0..7, 0..3] of DWord;}
120 palramb, palramo: array[0..16383] of byte; 120 palramb, palramo: array[0..16383] of byte;
121 hdma: DWord; 121 hdma: DWord;
122 gb_speed: byte; 122 gb_speed: byte;
@@ -616,7 +616,7 @@ end;
616 function ReadGameState(filename: string): byte; 616 function ReadGameState(filename: string): byte;
617 var 617 var
618 f: file; 618 f: file;
619 numread, fsize: DWord; 619 fsize: DWord;
620 begin 620 begin
621 if gb_mode = cgb then 621 if gb_mode = cgb then
622 fsize := 32 * 1024 622 fsize := 32 * 1024
Modifiedmainloop.pas +2−0
@@ -341,7 +341,9 @@ begin
341 341
342 if (n_ff04 > 255) then 342 if (n_ff04 > 255) then
343 begin 343 begin
344 {$PUSH}{$R-}{$Q-}
344 Dec(m_iram[$ff04]); // DIVIDER [RW] Divider 345 Dec(m_iram[$ff04]); // DIVIDER [RW] Divider
346 {$POP}
345 // This register is incremented 16384 times 347 // This register is incremented 16384 times
346 // a second. Writing any value sets it to $00. 348 // a second. Writing any value sets it to $00.
347 349
Modifiedsong.pas +1−1
@@ -176,7 +176,7 @@ end;
176 176
177 procedure ReadSongFromStream(S: TStream; out ASong: TSong); 177 procedure ReadSongFromStream(S: TStream; out ASong: TSong);
178 var 178 var
179 Version: Integer; 179 Version: Integer = 1;
180 SV1: TSongV1; 180 SV1: TSongV1;
181 begin 181 begin
182 S.Read(Version, SizeOf(Integer)); 182 S.Read(Version, SizeOf(Integer));