Skip to content

Commit

Permalink
Fixes s'more (Kingsoft Business Basic) cartridge.
Browse files Browse the repository at this point in the history
  • Loading branch information
GideonZ committed Sep 9, 2021
1 parent 708055d commit be804d2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 6 additions & 5 deletions fpga/cart_slot/vhdl_source/all_carts_v5.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -268,13 +268,11 @@ begin

when c_bbasic => -- Write IO1 = off, Read IO1 = ON
if io_write='1' and io_addr(8)='0' then
mode_bits(0) <= '1';
bank_bits(14) <= '1';
elsif io_read='1' and io_addr(8)='0' then
mode_bits(0) <= '0';
bank_bits(14) <= '0';
elsif io_read='1' and io_addr(8)='0' then
mode_bits(0) <= '1';
end if;
if mode_bits(0)='0' then -- ROM mode (starts in ROM mode?)
if mode_bits(0)='1' then
game_n <= '0';
exrom_n <= '0';
-- Dynamic mode, Ultimax in ranges 8000, A000 and E000. How about writes?
Expand All @@ -286,6 +284,9 @@ begin
exrom_n <= '1';
end if;
serve_rom <= '1';
serve_io1 <= '1';
rom_mode <= "11"; -- 32K! The ROMs shall be placed in memory at the right location by the software.
-- Note that the CRT files are usually wrong; they list 3 banks of 8K, all at $8000, which is incorrect.

when c_blackbox_v3 =>
if io_write='1' and io_addr(8)='0' then -- write IO1 => disable
Expand Down
4 changes: 4 additions & 0 deletions software/io/c64/c64_crt.cc
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,10 @@ void C64_CRT::configure_cart(cart_def *def)
case CART_BBASIC:
cart_type = CART_TYPE_BBASIC; // Business Basic
prohibit = CART_PROHIBIT_DEXX;
// CHIPs have been loaded at 0000, 4000 and 8000; while they should be at 0000, 2000 and 6000
// So source and destinations do not overlap; we can simply copy the data
memcpy(cart_memory + 0x2000, cart_memory + 0x4000, 0x2000);
memcpy(cart_memory + 0x6000, cart_memory + 0x8000, 0x2000);
break;
case CART_PAGEFOX:
cart_type = CART_TYPE_PAGEFOX; // Pagefox
Expand Down

0 comments on commit be804d2

Please sign in to comment.