DearHorse Posted November 14, 2017 Share Posted November 14, 2017 (edited) 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 CONSOLtst_se: CMP #$05 ; select BNE tst_op LDA #$1F ; change PM color STA $2C0 jmp skiptst_op: CMP #$03 ; option BNE tst_st LDA #$3F ; change PM color STA $2C1 JMP skiptst_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 November 14, 2017 by DearHorse Quote Link to comment Share on other sites More sharing options...
shanti77 Posted November 14, 2017 Share Posted November 14, 2017 (edited) 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 November 14, 2017 by shanti77 Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted November 14, 2017 Share Posted November 14, 2017 Write #$08 to CONSOL before reading it back. 1 Quote Link to comment Share on other sites More sharing options...
_The Doctor__ Posted November 14, 2017 Share Posted November 14, 2017 while it's always nice to give the answers, it's always good to explain why.. Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted November 14, 2017 Share Posted November 14, 2017 Not when I'm trying to help by posting via my phone. http://www.virtualdub.org/downloads/Altirra%20Hardware%20Reference%20Manual.pdf Page 269. 3 Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted November 14, 2017 Share Posted November 14, 2017 (edited) 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 November 14, 2017 by Wrathchild Quote Link to comment Share on other sites More sharing options...
DearHorse Posted November 14, 2017 Author Share Posted November 14, 2017 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 Quote Link to comment Share on other sites More sharing options...
DearHorse Posted November 14, 2017 Author Share Posted November 14, 2017 (edited) 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 November 14, 2017 by DearHorse Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted November 14, 2017 Share Posted November 14, 2017 OK. In that case, go to Input->Keyboard, and in the Keyboard Options dialog, make sure "Enable function keys" is unchecked. 2 Quote Link to comment Share on other sites More sharing options...
DearHorse Posted November 14, 2017 Author Share Posted November 14, 2017 Not when I'm trying to help by posting via my phone. http://www.virtualdub.org/downloads/Altirra%20Hardware%20Reference%20Manual.pdf Page 269. Thanks for the link Jazz best Rudy Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted November 14, 2017 Share Posted November 14, 2017 try setting a breakpoint in Altirra such as: bx "read=$d01f and db($D01f)!=7" Quote Link to comment Share on other sites More sharing options...
DearHorse Posted November 14, 2017 Author Share Posted November 14, 2017 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. Quote Link to comment Share on other sites More sharing options...
DearHorse Posted November 14, 2017 Author Share Posted November 14, 2017 (edited) 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 November 14, 2017 by DearHorse Quote Link to comment Share on other sites More sharing options...
DearHorse Posted November 14, 2017 Author Share Posted November 14, 2017 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 Quote Link to comment Share on other sites More sharing options...
phaeron Posted November 15, 2017 Share Posted November 15, 2017 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. 6 Quote Link to comment Share on other sites More sharing options...
DearHorse Posted November 15, 2017 Author Share Posted November 15, 2017 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 Quote Link to comment Share on other sites More sharing options...
flashjazzcat Posted November 15, 2017 Share Posted November 15, 2017 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. Quote Link to comment Share on other sites More sharing options...
DearHorse Posted November 21, 2017 Author Share Posted November 21, 2017 (edited) 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 November 21, 2017 by DearHorse 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.