From d5cf8df59e8919b3eb508ca4e634e7c26daf7dfe Mon Sep 17 00:00:00 2001 From: Gurce Isikyildiz Date: Sat, 21 Dec 2024 13:43:14 +0000 Subject: [PATCH 1/2] try skipping 'FetchScreenRamLine' state when in bitplane mode --- src/vhdl/viciv.vhdl | 52 +++++++++++++++++++++++---------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/src/vhdl/viciv.vhdl b/src/vhdl/viciv.vhdl index 9e062ab91..43bf5211a 100644 --- a/src/vhdl/viciv.vhdl +++ b/src/vhdl/viciv.vhdl @@ -1811,7 +1811,7 @@ begin -- fiddle with registers in this range. -- For more C65 register info, see: -- http://www.zimmers.net/cbmpics/cbm/c65/c65manual.txt - -- @IO:C65 $D032 - Bitplane enable bits + -- @IO:C65 $D032 VIC-III:BPENABLE Bitplane enable bits elsif register_number=50 then fastio_rdata <= bitplane_enables; -- @IO:C65 $D033 - Bitplane 0 address @@ -2577,22 +2577,22 @@ begin viciv_legacy_mode_registers_touched <= '1'; elsif register_number=50 then bitplane_enables <= fastio_wdata; - -- @IO:C65 $D033.5-7 VIC-III:B0ADODD@BXADODD Bitplane X address, odd lines - -- @IO:C65 $D033.1-3 VIC-III:B0ADEVN@BXADEVN Bitplane X address, even lines - -- @IO:C65 $D034.5-7 VIC-III:B1ADODD @BXADODD - -- @IO:C65 $D034.1-3 VIC-III:B1ADEVN @BXADEVN - -- @IO:C65 $D035.5-7 VIC-III:B2ADODD @BXADODD - -- @IO:C65 $D035.1-3 VIC-III:B2ADEVN @BXADEVN - -- @IO:C65 $D036.5-7 VIC-III:B3ADODD @BXADODD - -- @IO:C65 $D036.1-3 VIC-III:B3ADEVN @BXADEVN - -- @IO:C65 $D037.5-7 VIC-III:B4ADODD @BXADODD - -- @IO:C65 $D037.1-3 VIC-III:B4ADEVN @BXADEVN - -- @IO:C65 $D038.5-7 VIC-III:B5ADODD @BXADODD - -- @IO:C65 $D038.1-3 VIC-III:B5ADEVN @BXADEVN - -- @IO:C65 $D039.5-7 VIC-III:B6ADODD @BXADODD - -- @IO:C65 $D039.1-3 VIC-III:B6ADEVN @BXADEVN - -- @IO:C65 $D03A.5-7 VIC-III:B7ADODD @BXADODD - -- @IO:C65 $D03A.1-3 VIC-III:B7ADEVN @BXADEVN + -- @IO:C65 $D033.5-7 VIC-III:B0ADODD Odd rows of Even Bitplane 0 address[15:13] (only used in v400 mode) + -- @IO:C65 $D033.1-3 VIC-III:B0ADEVN Even rows of Even Bitplane 0 address[15:13] (for v200, even row drawn twice) + -- @IO:C65 $D034.5-7 VIC-III:B1ADODD Odd rows of Odd Bitplane 1 address[15:13] (+64KB) (only used in v400 mode) + -- @IO:C65 $D034.1-3 VIC-III:B1ADEVN Even rows of Odd Bitplane 1 address[15:13] (+64KB) (for v200, even row drawn twice) + -- @IO:C65 $D035.5-7 VIC-III:B2ADODD Odd rows of Even Bitplane 2 address[15:13] (only used in v400 mode) + -- @IO:C65 $D035.1-3 VIC-III:B2ADEVN Even rows of Even Bitplane 2 address[15:13] (for v200, even row drawn twice) + -- @IO:C65 $D036.5-7 VIC-III:B3ADODD Odd rows of Odd Bitplane 3 address[15:13] (+64KB) (only used in v400 mode) + -- @IO:C65 $D036.1-3 VIC-III:B3ADEVN Even rows of Odd Bitplane 3 address[15:13] (+64KB) (for v200, even row drawn twice) + -- @IO:C65 $D037.5-7 VIC-III:B4ADODD Odd rows of Even Bitplane 4 address[15:13] (only used in v400 mode) + -- @IO:C65 $D037.1-3 VIC-III:B4ADEVN Even rows of Even Bitplane 4 address[15:13] (for v200, even row drawn twice) + -- @IO:C65 $D038.5-7 VIC-III:B5ADODD Odd rows of Odd Bitplane 5 address[15:13] (+64KB) (only used in v400 mode) + -- @IO:C65 $D038.1-3 VIC-III:B5ADEVN Even rows of Odd Bitplane 5 address[15:13] (+64KB) (for v200, even row drawn twice) + -- @IO:C65 $D039.5-7 VIC-III:B6ADODD Odd rows of Even Bitplane 6 address[15:13] (only used in v400 mode) + -- @IO:C65 $D039.1-3 VIC-III:B6ADEVN Even rows of Even Bitplane 6 address[15:13] (for v200, even row drawn twice) + -- @IO:C65 $D03A.5-7 VIC-III:B7ADODD Odd rows of Odd Bitplane 7 address[15:13] (+64KB) (only used in v400 mode) + -- @IO:C65 $D03A.1-3 VIC-III:B7ADEVN Even rows of Odd Bitplane 7 address[15:13] (+64KB) (for v200, even row drawn twice) elsif register_number >= 51 and register_number <= 58 then -- @IO:C65 $D033-$D03A - VIC-III Bitplane addresses --bitplane_number := safe_to_integer(register_number(3 downto 0)) - 3; @@ -4091,7 +4091,10 @@ begin render_activity <= "000"; when FetchScreenRamLine => -- Make sure that painting is not in progress - if paint_ready='1' then + if bitplane_mode='1' then + paint_fsm_state <= Idle; + raster_fetch_state <= EndOfCharGen; + elsif paint_ready='1' then -- Set FSM state so that no painting occurs, and so that we -- continue to fetch the screen row. Note that here we just -- schedule the memory reads. The data is written elsewhere. This @@ -4986,25 +4989,24 @@ begin else -- Fetch VIC-III bitplanes -- Bitplanes for odd raster lines - -- All figures are increased by 1/3 to allow for 800 wide when required if (reg_h640='0' and reg_h1280='0') then if bitplane_sixteen_colour_mode_flags(sprite_fetch_sprite_number mod 8)='0' then -- 320px, mono bitplane = 40 bytes for 320 pixels - max_sprite_fetch_byte_number <= 49; -- 39; + max_sprite_fetch_byte_number <= 39; else -- 320px, 16-colour bitplane = 160 bytes for 320 pixels - max_sprite_fetch_byte_number <= 199; -- 159; + max_sprite_fetch_byte_number <= 159; end if; end if; if (reg_h640='1' and reg_h1280='0') then if bitplane_sixteen_colour_mode_flags(sprite_fetch_sprite_number mod 8)='0' then - -- 320px, mono bitplane = 80 bytes for 640 pixels - max_sprite_fetch_byte_number <= 99; -- 79; + -- 640px, mono bitplane = 80 bytes for 640 pixels + max_sprite_fetch_byte_number <= 79; else - -- 320px, 16-colour bitplane = 320 bytes for 640 pixels - max_sprite_fetch_byte_number <= 399; -- 319; + -- 640px, 16-colour bitplane = 320 bytes for 640 pixels + max_sprite_fetch_byte_number <= 319; end if; end if; -- Don't waste time fetching bitplanes that are disabled. From d6ebb404f1174191a240724a0330775a4af07814 Mon Sep 17 00:00:00 2001 From: Oliver Graf Date: Fri, 3 Jan 2025 08:30:10 +0100 Subject: [PATCH 2/2] docs(viciv.vhdl): fix bitplane docstrings to concice format #689 --- src/vhdl/viciv.vhdl | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/vhdl/viciv.vhdl b/src/vhdl/viciv.vhdl index 43bf5211a..818ccc576 100644 --- a/src/vhdl/viciv.vhdl +++ b/src/vhdl/viciv.vhdl @@ -2577,22 +2577,22 @@ begin viciv_legacy_mode_registers_touched <= '1'; elsif register_number=50 then bitplane_enables <= fastio_wdata; - -- @IO:C65 $D033.5-7 VIC-III:B0ADODD Odd rows of Even Bitplane 0 address[15:13] (only used in v400 mode) - -- @IO:C65 $D033.1-3 VIC-III:B0ADEVN Even rows of Even Bitplane 0 address[15:13] (for v200, even row drawn twice) - -- @IO:C65 $D034.5-7 VIC-III:B1ADODD Odd rows of Odd Bitplane 1 address[15:13] (+64KB) (only used in v400 mode) - -- @IO:C65 $D034.1-3 VIC-III:B1ADEVN Even rows of Odd Bitplane 1 address[15:13] (+64KB) (for v200, even row drawn twice) - -- @IO:C65 $D035.5-7 VIC-III:B2ADODD Odd rows of Even Bitplane 2 address[15:13] (only used in v400 mode) - -- @IO:C65 $D035.1-3 VIC-III:B2ADEVN Even rows of Even Bitplane 2 address[15:13] (for v200, even row drawn twice) - -- @IO:C65 $D036.5-7 VIC-III:B3ADODD Odd rows of Odd Bitplane 3 address[15:13] (+64KB) (only used in v400 mode) - -- @IO:C65 $D036.1-3 VIC-III:B3ADEVN Even rows of Odd Bitplane 3 address[15:13] (+64KB) (for v200, even row drawn twice) - -- @IO:C65 $D037.5-7 VIC-III:B4ADODD Odd rows of Even Bitplane 4 address[15:13] (only used in v400 mode) - -- @IO:C65 $D037.1-3 VIC-III:B4ADEVN Even rows of Even Bitplane 4 address[15:13] (for v200, even row drawn twice) - -- @IO:C65 $D038.5-7 VIC-III:B5ADODD Odd rows of Odd Bitplane 5 address[15:13] (+64KB) (only used in v400 mode) - -- @IO:C65 $D038.1-3 VIC-III:B5ADEVN Even rows of Odd Bitplane 5 address[15:13] (+64KB) (for v200, even row drawn twice) - -- @IO:C65 $D039.5-7 VIC-III:B6ADODD Odd rows of Even Bitplane 6 address[15:13] (only used in v400 mode) - -- @IO:C65 $D039.1-3 VIC-III:B6ADEVN Even rows of Even Bitplane 6 address[15:13] (for v200, even row drawn twice) - -- @IO:C65 $D03A.5-7 VIC-III:B7ADODD Odd rows of Odd Bitplane 7 address[15:13] (+64KB) (only used in v400 mode) - -- @IO:C65 $D03A.1-3 VIC-III:B7ADEVN Even rows of Odd Bitplane 7 address[15:13] (+64KB) (for v200, even row drawn twice) + -- @IO:C65 $D033.5-7 VIC-III:B0ADODD@BXADODD Odd rows of even Bitplane X address[15:13] (only used in v400 mode) + -- @IO:C65 $D033.1-3 VIC-III:B0ADEVN@BXADEVN Even rows of even Bitplane X address[15:13] (for v200, even row drawn twice) + -- @IO:C65 $D034.5-7 VIC-III:B1ADODD@BYADODD Odd rows of odd Bitplane Y address[15:13] (+64KB) (only used in v400 mode) + -- @IO:C65 $D034.1-3 VIC-III:B1ADEVN@BYADEVN Even rows of odd Bitplane Y address[15:13] (+64KB) (for v200, even row drawn twice) + -- @IO:C65 $D035.5-7 VIC-III:B2ADODD @BXADODD + -- @IO:C65 $D035.1-3 VIC-III:B2ADEVN @BXADEVN + -- @IO:C65 $D036.5-7 VIC-III:B3ADODD @BYADODD + -- @IO:C65 $D036.1-3 VIC-III:B3ADEVN @BYADEVN + -- @IO:C65 $D037.5-7 VIC-III:B4ADODD @BXADODD + -- @IO:C65 $D037.1-3 VIC-III:B4ADEVN @BXADEVN + -- @IO:C65 $D038.5-7 VIC-III:B5ADODD @BYADODD + -- @IO:C65 $D038.1-3 VIC-III:B5ADEVN @BYADEVN + -- @IO:C65 $D039.5-7 VIC-III:B6ADODD @BXADODD + -- @IO:C65 $D039.1-3 VIC-III:B6ADEVN @BXADEVN + -- @IO:C65 $D03A.5-7 VIC-III:B7ADODD @BYADODD + -- @IO:C65 $D03A.1-3 VIC-III:B7ADEVN @BYADEVN elsif register_number >= 51 and register_number <= 58 then -- @IO:C65 $D033-$D03A - VIC-III Bitplane addresses --bitplane_number := safe_to_integer(register_number(3 downto 0)) - 3;