From 88e3e60550c47bee0c070d0aee74a88f6eee123e Mon Sep 17 00:00:00 2001 From: Christian Groessler Date: Tue, 15 Apr 2014 11:36:27 +0200 Subject: [PATCH] address issue raised in the pull request; add support to not use page 6 again --- libsrc/atari/mcbpm-shape.s | 6 +-- libsrc/atari/mcbpm.s | 72 ++++++++++++++++++++++++++++------ libsrc/atari/mcbtxtchar-char.s | 4 +- libsrc/atari/mcbtxtchar.s | 6 +-- 4 files changed, 66 insertions(+), 22 deletions(-) diff --git a/libsrc/atari/mcbpm-shape.s b/libsrc/atari/mcbpm-shape.s index baf8c0020..3a001b561 100644 --- a/libsrc/atari/mcbpm-shape.s +++ b/libsrc/atari/mcbpm-shape.s @@ -9,9 +9,9 @@ ; .export mouse_pm_bits - .export mouse_pm_height : absolute - .export mouse_pm_hotspot_x : absolute - .export mouse_pm_hotspot_y : absolute + .export mouse_pm_height : zeropage + .export mouse_pm_hotspot_x : zeropage + .export mouse_pm_hotspot_y : zeropage .data diff --git a/libsrc/atari/mcbpm.s b/libsrc/atari/mcbpm.s index b431ac414..52a396d9e 100644 --- a/libsrc/atari/mcbpm.s +++ b/libsrc/atari/mcbpm.s @@ -7,6 +7,8 @@ ; be called from an interrupt handler ; +USE_PAGE6 = 1 + .include "atari.inc" .importzp sp .export _mouse_pm_callbacks @@ -14,17 +16,28 @@ .destructor pm_down,7 ; get mouse shape data - .import mouse_pm_bits - .import mouse_pm_height - .import mouse_pm_hotspot_x - .import mouse_pm_hotspot_y + .import mouse_pm_bits + .importzp mouse_pm_height + .importzp mouse_pm_hotspot_x + .importzp mouse_pm_hotspot_y -; P/M definitions. The first value can be changed to adjust the number -; of the P/M used for the mouse. All others depend on this value. +; P/M definitions. The MOUSE_PM_NUM value can be changed to adjust the +; number of the P/M used for the mouse. All others depend on this value. ; Valid P/M numbers are 0 to 4. When 4 is used, the missiles are used ; as a player. +.if USE_PAGE6 MOUSE_PM_NUM = 2 ; P/M used for the mouse + ; This cannot be changed since only player #2 uses the memory at $600. +.else +MOUSE_PM_NUM = 4 ; P/M used for the mouse + ; Using player #4 (missiles) wastes the least amount of memory on the + ; atari target, since top of memory is typically at $xC20, and the + ; missiles use the space at $xB00-$xBFF. + ; On the atarixl target this configuration (not using page 6) is not + ; really satisfying since the top of memory typically lies beneath + ; the ROM and there is flickering visible while the ROM is banked in. +.endif MOUSE_PM_BASE = pm_base ; ZP location pointing to the hw area used by the selected P/M .if MOUSE_PM_NUM = 4 @@ -100,14 +113,14 @@ movex: cpx #1 ror a clc adc #48 - sbc #<(mouse_pm_hotspot_x - 1) + sbc #(mouse_pm_hotspot_x - 1) & $FF set_mouse_x jmp update_colors ; Move the mouse cursor y position to the value in A/X. movey: clc adc #32 - sbc #<(mouse_pm_hotspot_y - 1) + sbc #(mouse_pm_hotspot_y - 1) & $FF pha lda omy jsr clr_pm ; remove player at old position @@ -125,12 +138,12 @@ set_l: lda mouse_pm_bits,x inx iny beq set_end - cpx #