diff --git a/Machines/Apple/AppleIIgs/ADB.cpp b/Machines/Apple/AppleIIgs/ADB.cpp index 4ec09e6ea..27a072024 100644 --- a/Machines/Apple/AppleIIgs/ADB.cpp +++ b/Machines/Apple/AppleIIgs/ADB.cpp @@ -13,29 +13,59 @@ using namespace Apple::IIgs::ADB; uint8_t GLU::get_keyboard_data() { - return 0; + // The classic Apple II serial keyboard register: + // b7: key strobe. + // b6–b0: ASCII code. + return 0x00; } uint8_t GLU::get_mouse_data() { + // Alternates between returning x and y values. + // + // b7: 1 = button is up; 0 = button is down. + // b6: delta sign bit; 1 = negative. + // b5–b0: mouse delta. return 0x80; } uint8_t GLU::get_modifier_status() { + // b7: 1 = command key pressed; 0 = not. + // b6: option key. + // b5: 1 = modifier key latch has been updated, no key has been pressed; 0 = not. + // b4: any numeric keypad key. + // b3: a key is down. + // b2: caps lock is pressed. + // b1: control key. + // b0: shift key. return 0x00; } uint8_t GLU::get_data() { + // b0–2: number of data bytes to be returned. + // b3: 1 = a valid service request is pending; 0 = no request pending. + // b4: 1 = control, command and delete keys have been pressed simultaneously; 0 = they haven't. + // b5: 1 = control, command and reset have all been pressed together; 0 = they haven't. + // b6: 1 = ADB controller encountered an error and reset itself; 0 = no error. + // b7: 1 = ADB has received a response from the addressed ADB device; 0 = no respone. return 0x00; } uint8_t GLU::get_status() { + // b7: 1 = mouse data register is full; 0 = empty. + // b6: 1 = mouse interrupt is enabled. + // b5: 1 = command/data has valid data. + // b4: 1 = command/data interrupt is enabled. + // b3: 1 = keyboard data is full. + // b2: 1 = keyboard data interrupt is enabled. + // b1: 1 = mouse x-data is available; 0 = y. + // b0: 1 = command register is full (set when command is written); 0 = empty (cleared when data is read). return 0x00; } -void GLU::set_command(uint8_t) { - printf("TODO: set ADB command\n"); +void GLU::set_command(uint8_t command) { + printf("TODO: set ADB command: %02x\n", command); } -void GLU::set_status(uint8_t) { - printf("TODO: set ADB status\n"); +void GLU::set_status(uint8_t status) { + printf("TODO: set ADB status %02x\n", status); } diff --git a/Machines/Apple/AppleIIgs/AppleIIgs.cpp b/Machines/Apple/AppleIIgs/AppleIIgs.cpp index 599f21859..92de873f6 100644 --- a/Machines/Apple/AppleIIgs/AppleIIgs.cpp +++ b/Machines/Apple/AppleIIgs/AppleIIgs.cpp @@ -299,20 +299,20 @@ class ConcreteMachine: } } - printf("%06x %s %02x", address, isReadOperation(operation) ? "->" : "<-", *value); - if(operation == CPU::WDC65816::BusOperation::ReadOpcode) { - printf(" a:%04x x:%04x y:%04x s:%04x e:%d p:%02x db:%02x pb:%02x d:%04x\n", - m65816_.get_value_of_register(CPU::WDC65816::Register::A), - m65816_.get_value_of_register(CPU::WDC65816::Register::X), - m65816_.get_value_of_register(CPU::WDC65816::Register::Y), - m65816_.get_value_of_register(CPU::WDC65816::Register::StackPointer), - m65816_.get_value_of_register(CPU::WDC65816::Register::EmulationFlag), - m65816_.get_value_of_register(CPU::WDC65816::Register::Flags), - m65816_.get_value_of_register(CPU::WDC65816::Register::DataBank), - m65816_.get_value_of_register(CPU::WDC65816::Register::ProgramBank), - m65816_.get_value_of_register(CPU::WDC65816::Register::Direct) - ); - } else printf("\n"); +// printf("%06x %s %02x", address, isReadOperation(operation) ? "->" : "<-", *value); +// if(operation == CPU::WDC65816::BusOperation::ReadOpcode) { +// printf(" a:%04x x:%04x y:%04x s:%04x e:%d p:%02x db:%02x pb:%02x d:%04x\n", +// m65816_.get_value_of_register(CPU::WDC65816::Register::A), +// m65816_.get_value_of_register(CPU::WDC65816::Register::X), +// m65816_.get_value_of_register(CPU::WDC65816::Register::Y), +// m65816_.get_value_of_register(CPU::WDC65816::Register::StackPointer), +// m65816_.get_value_of_register(CPU::WDC65816::Register::EmulationFlag), +// m65816_.get_value_of_register(CPU::WDC65816::Register::Flags), +// m65816_.get_value_of_register(CPU::WDC65816::Register::DataBank), +// m65816_.get_value_of_register(CPU::WDC65816::Register::ProgramBank), +// m65816_.get_value_of_register(CPU::WDC65816::Register::Direct) +// ); +// } else printf("\n"); Cycles duration = Cycles(5);