Jump to content
IGNORED

CONSOL ($D01F) on WUDSN (MADS/ALTIRRA)


Recommended Posts

Hi All,

Just to know if someone experimented trouble with CONSOL (start/select/option) in mads/Altirra 2.40.0 ?

I port/rewrite big sources from MAC/65 to MADS 1.9.5/ ALTIRRA 2.4.0 (800XL 64K hardware) under WUDSN and some input (CONSOL) code act in unexpected way.

 

Of course it's certainly because I'm not skilled with Altirra/mads, .. options and I certainly do something wrong.

 

for $D01F, I use (to test) :

 

(just changing a PM color on start-select-option, with PM correctly set before)

 

Loop:

tst_co: LDA $D01F ; reading CONSOL
tst_se: CMP #$05 ; select
BNE tst_op
LDA #$1F ; change PM color
STA $2C0
jmp skip
tst_op: CMP #$03 ; option
BNE tst_st
LDA #$3F ; change PM color
STA $2C1
JMP skip
tst_st: CMP #$06 ; start
BNE skip
LDA #$5F ; change PM color
STA $2C2

skip:

JMP Loop

 

and no response with F2-F3-F4 on altirra emu. (in main code or in vbi)

I try with keyboard test just to see if inputs are ok with :

 

loop: LDA $2FC ; read keyboard
STA $2C0 ; change PM color
JMP loop

 

just work fine AND read F2-F3-F4 (start-select-option) CONSOL keys.

 

I just try combinations, change test values reading from CONSOL, use a buffer for $D01F but nothing [seems] work, $D01F stays at value 7.

I dissassemble-debug donkeykong-well-working (on altirra) just to see option-select function at $D01F, but it's the same way I do.

:-(

any option to set in altirra ? something wrong ?

thanks for reading.

 

best wishes to all AA followers.

 

Rudy

Edited by DearHorse
Link to comment
Share on other sites

 

Push this keys clear bits in $D01F:

 

OPTION equ 4 ;bit 2
SELECT equ 2 ;bit 1
START equ 1  ;bit 0
You must:
lda $D01F
and #%001     ;START , bit 0 = 1 = %001
bne next_key   ;if not pressed
;if key pressed
...
...


next_key equ *

 

Hi Shanti,

I test with cmp to have the right values (in visual) and to not reload $d01F/ backup it after modification, I know that's not the most optimal code but I do that just for better reading.

Of course I do test only on bit instead of full values before asking here -> but not working.

That's the reason why I was thinking (perhaps wrong, of course) it will be an option in altirra.

but thanks for reply.

best

Rudy

Edited by DearHorse
Link to comment
Share on other sites

while it's always nice to give the answers, it's always good to explain why.. ;)

Hi,

If I don't do an mistake, I know that it's to clear $d01f register, since some buzz-sound can be emitted with some values (in 800 model at the less) and release old values pushed for further consol keypushed.

;-)

Link to comment
Share on other sites

try setting a breakpoint in Altirra such as: bx "read=$d01f and db($D01f)!=7"

I already try into altirra debug-mode, but the value stay at 7.

Note that in MAC/65 (800 real hardware) or even in basic (other emulator) my code works fine.

 

but I write your breakpoint info (not yet experimented)

thanks

Edited by DearHorse
Link to comment
Share on other sites

Please update to Altirra 2.90, 2.40 is four years old.

 

For something like this, I'd recommend the debugger command "wb consol" instead. This will print the value on screen every VBI so you can see it change or not-change live. Use "wc *" to clear the watches.

 

You don't need to write $08 to CONSOL all time, as it's normally done for you by the OS VBI handler. The reason for this value being written isn't to clear keys -- it's because CONSOL is both an input and an output register, and if any of bits 0-2 are set in the output, it'll pull the line down and block reading from the corresponding button. The low three bits need to be 0 on the output for the inputs to work, thus $08. There's no need to rewrite $08 after a button press, either; the OS probably does it just to make it easier to do clicks on the speaker (bit 3).

 

Make sure you don't have any 5200 controllers active in the Input menu. This will interfere with reading console buttons since the CONSOL port is used for controller selection instead on the 5200. More recent versions of Altirra separate 800 and 5200 modes more strongly to prevent this type of mixup.

  • Like 6
Link to comment
Share on other sites

Hi All,

 

Just to close this topic.

 

I find the solution of the problem I submit.

 

After trying all here above suggestions (functions keys enabled, 5200 controlers, upgrade Altirra to 2.90, ...) with no success , I try to edit a custom map [in Altirra] with start/option/select using the same F2-F3-F4 and [against my expectations] it works fine after that operation.

 

I will thanks all Atari fellows who answer me in this topic and drive me to the solution. And with this, I discover some really interesting features in Altirra 2.90

 

Best regards to all,

 

Rudy

Edited by DearHorse
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...