Skip to content

Commit

Permalink
Merge pull request #47 from noisest/vic-bank-fixes
Browse files Browse the repository at this point in the history
Fix Vic bank selection
  • Loading branch information
mlund authored Dec 17, 2024
2 parents 5d874e8 + 16dcb85 commit 1933e61
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/c64.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,6 @@ bitflags! {
/// ~~~
/// set_vic_bank(cia::VicBankSelect::RegionC000);
/// ~~~
#[derive(Clone, Copy)]
pub struct VicBankSelect: u8 {
/// Bank 3: 0xC000-0xFFFF
const RegionC000 = 0;
Expand Down Expand Up @@ -267,6 +266,6 @@ pub fn set_vic_bank(bank: VicBankSelect) {
cia2().data_direction_port_a.write(dir_a | 0b11);
cia2()
.port_a
.write(port_a & VicBankSelect::VIC_0000.complement() | bank);
.write(port_a & VicBankSelect::Region0000.complement() | bank);
}
}
6 changes: 2 additions & 4 deletions src/cia.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub struct MOSComplexInterfaceAdapter6526<T1: Copy, T2: Copy> {
pub control_b: RW<u8>, // 0x0f
}

const_assert!(size_of::<MOSComplexInterfaceAdapter6526>() == 16);
const_assert!(size_of::<MOSComplexInterfaceAdapter6526<GameController, GameController>>() == 16);

/// Enum for joystick positions
pub enum JoystickPosition {
Expand Down Expand Up @@ -188,7 +188,6 @@ bitflags! {
/// serial bus input (0=Low/Active, 1=High/Inactive)
/// - CLOCK IN
/// - DATA IN
#[derive(Clone, Copy)]
pub struct SerialBusAccess: u8 {
const TXD_OUT = 0b0000_0100;
const ATN_OUT = 0b0000_1000;
Expand All @@ -210,7 +209,6 @@ bitflags! {
/// - 5 User Port Pin J IO
/// - 6 CTS R
/// - 7 DSR R
#[derive(Clone, Copy)]
pub struct RS232Access: u8 {
const RXD = 0b0000_0001;
const RTS = 0b0000_0010;
Expand All @@ -221,4 +219,4 @@ bitflags! {
const CTS = 0b0100_0000;
const DSR = 0b1000_0000;
}
}
}

0 comments on commit 1933e61

Please sign in to comment.