From df1980d214271e30115ed586f9a204039ad23b67 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Wed, 13 Apr 2022 21:35:48 -0400 Subject: [PATCH] lemm: get music working on IIc --- games/lemm/pt3_lib_mockingboard_detect.s | 4 +- games/lemm/pt3_lib_mockingboard_setup.s | 54 ++++-------------------- 2 files changed, 10 insertions(+), 48 deletions(-) diff --git a/games/lemm/pt3_lib_mockingboard_detect.s b/games/lemm/pt3_lib_mockingboard_detect.s index cd36df72..788b6eea 100644 --- a/games/lemm/pt3_lib_mockingboard_detect.s +++ b/games/lemm/pt3_lib_mockingboard_detect.s @@ -45,7 +45,7 @@ mockingboard_detect: ; it difficult if you actually wanted to use any ; Applesoft/Monitor ROM routines -.ifdef PT3_ENABLE_APPLE_IIC +;.ifdef PT3_ENABLE_APPLE_IIC lda APPLEII_MODEL cmp #'C' bne not_iic @@ -56,7 +56,7 @@ mockingboard_detect: sta MOCK_6522_DDRA1 ; $C403 sta MOCK_6522_T1CL ; $C404 -.endif +;.endif not_iic: lda #$00 diff --git a/games/lemm/pt3_lib_mockingboard_setup.s b/games/lemm/pt3_lib_mockingboard_setup.s index 781d42a0..5a2c1587 100644 --- a/games/lemm/pt3_lib_mockingboard_setup.s +++ b/games/lemm/pt3_lib_mockingboard_setup.s @@ -172,57 +172,19 @@ mockingboard_setup_interrupt: ; for this game with things in language card including - ; irq handler, always force IIc mode + ; irq handler, always force IIc mode (where RAM swapped in + ; and we put the irq handler address directly up at $FFFE) -;.ifdef PT3_ENABLE_APPLE_IIC -; lda APPLEII_MODEL -; cmp #'C' -; bne done_iic_hack - - ; bypass the firmware interrupt handler - ; should we do this on IIe too? probably faster - - ; first we have to copy the ROM to the language card -.if 0 - sei ; disable interrupts - -copy_rom_loop: - lda $c089 ; read ROM, write RAM1 - lda $c089 - - ldy #0 -read_rom_loop: - lda $D000,Y - sta $400,Y ; note this uses text page as - ; temporary data store - iny - bne read_rom_loop - - lda $c08B ; read/write RAM1 - lda $c08B ; - -write_rom_loop: - lda $400,Y - sta $D000,Y - iny - bne write_rom_loop - - inc read_rom_loop+2 - inc write_rom_loop+5 - bne copy_rom_loop -.endif lda #interrupt_handler sta $ffff - - ; nop out the "lda $45" in the irq handler + ; nop out the "lda $45" since we are bypassing the ROM irq handler + ; that puts A in $45 lda #$EA sta interrupt_smc sta interrupt_smc+1 -;.endif -done_iic_hack: ;========================= @@ -231,10 +193,10 @@ done_iic_hack: ; Vector address goes to 0x3fe/0x3ff ; FIXME: should chain any existing handler - lda #interrupt_handler - sta $03ff +; lda #interrupt_handler +; sta $03ff ;============================ ; Enable 50Hz clock on 6522