Jump to content

Photo

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


17 replies to this topic

#1 DearHorse OFFLINE  

DearHorse

    Space Invader

  • 38 posts
  • Location:Belgium - EUROPA

Posted Tue Nov 14, 2017 7:07 AM

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, Tue Nov 14, 2017 7:53 AM.


#2 shanti77 OFFLINE  

shanti77

    Chopper Commander

  • 101 posts
  • Location:Poland

Posted Tue Nov 14, 2017 9:28 AM

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 *

Edited by shanti77, Tue Nov 14, 2017 9:33 AM.


#3 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 12,763 posts
  • Location:United Kingdom

Posted Tue Nov 14, 2017 10:37 AM

Write #$08 to CONSOL before reading it back.



#4 _The Doctor__ OFFLINE  

_The Doctor__

    River Patroller

  • 2,669 posts
  • Location:10-0-11-00:02

Posted Tue Nov 14, 2017 11:53 AM

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



#5 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 12,763 posts
  • Location:United Kingdom

Posted Tue Nov 14, 2017 12:19 PM

Not when I'm trying to help by posting via my phone.

 

http://www.virtualdu...ence Manual.pdf

 

Page 269.



#6 Wrathchild OFFLINE  

Wrathchild

    Stargunner

  • 1,876 posts
  • Location:Reading, UK.

Posted Tue Nov 14, 2017 3:05 PM

If you are not so worried about combinations of console key presses, then I'd favour the CMP over AND as the latter requires you to reload the CONSOL register's value to the accumulator.


Edited by Wrathchild, Tue Nov 14, 2017 3:28 PM.


#7 DearHorse OFFLINE  

DearHorse

    Space Invader

  • Topic Starter
  • 38 posts
  • Location:Belgium - EUROPA

Posted Tue Nov 14, 2017 3:26 PM

Write #$08 to CONSOL before reading it back.

Hi Jazz,

I do that last week but no more result.

Anyway thanks for reply Jazz 

 

Rudy 



#8 DearHorse OFFLINE  

DearHorse

    Space Invader

  • Topic Starter
  • 38 posts
  • Location:Belgium - EUROPA

Posted Tue Nov 14, 2017 3:32 PM

 

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, Tue Nov 14, 2017 3:59 PM.


#9 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 12,763 posts
  • Location:United Kingdom

Posted Tue Nov 14, 2017 3:36 PM

OK. In that case, go to Input->Keyboard, and in the Keyboard Options dialog, make sure "Enable function keys" is unchecked.



#10 DearHorse OFFLINE  

DearHorse

    Space Invader

  • Topic Starter
  • 38 posts
  • Location:Belgium - EUROPA

Posted Tue Nov 14, 2017 3:37 PM

Not when I'm trying to help by posting via my phone.

 

http://www.virtualdu...ence Manual.pdf

 

Page 269.

Thanks for the link Jazz

best

 

Rudy



#11 Wrathchild OFFLINE  

Wrathchild

    Stargunner

  • 1,876 posts
  • Location:Reading, UK.

Posted Tue Nov 14, 2017 3:38 PM

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



#12 DearHorse OFFLINE  

DearHorse

    Space Invader

  • Topic Starter
  • 38 posts
  • Location:Belgium - EUROPA

Posted Tue Nov 14, 2017 3:42 PM

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.

;-)



#13 DearHorse OFFLINE  

DearHorse

    Space Invader

  • Topic Starter
  • 38 posts
  • Location:Belgium - EUROPA

Posted Tue Nov 14, 2017 3:55 PM

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, Tue Nov 14, 2017 4:07 PM.


#14 DearHorse OFFLINE  

DearHorse

    Space Invader

  • Topic Starter
  • 38 posts
  • Location:Belgium - EUROPA

Posted Tue Nov 14, 2017 4:04 PM

OK. In that case, go to Input->Keyboard, and in the Keyboard Options dialog, make sure "Enable function keys" is unchecked.

re-hi Jazz,

I think I see a thing like that but I do no change.

I will try your suggest soon 

thanks again

Rudy



#15 phaeron ONLINE  

phaeron

    River Patroller

  • 2,281 posts
  • Location:USA

Posted Tue Nov 14, 2017 10:41 PM

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.



#16 DearHorse OFFLINE  

DearHorse

    Space Invader

  • Topic Starter
  • 38 posts
  • Location:Belgium - EUROPA

Posted Wed Nov 15, 2017 2:38 AM

Hi Phaeron,

 

I will follow your suggest to change Altirra to new version in the wudsn chain.

 

Thanks for precise information, I appreciate it a lot and I will add it on my tech-paper cards.

 

Best wishes,

 

Rudy



#17 flashjazzcat OFFLINE  

flashjazzcat

    Quadrunner

  • 12,763 posts
  • Location:United Kingdom

Posted Wed Nov 15, 2017 6:35 AM

You don't need to write $08 to CONSOL all time, as it's normally done for you by the OS VBI handler.


OS? Bah... I always have it turned off. :) Actually, I wish I'd known the data direction needed to be set when I first wrote code which ran without the OS VBI.

#18 DearHorse OFFLINE  

DearHorse

    Space Invader

  • Topic Starter
  • 38 posts
  • Location:Belgium - EUROPA

Posted Tue Nov 21, 2017 8:03 AM

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, Tue Nov 21, 2017 8:09 AM.





0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users