+jedimatt42 Posted October 31, 2021 Share Posted October 31, 2021 On 10/24/2021 at 1:56 PM, Vorticon said: I can't seem to get CTRL-M to register with a CALL KEY in XB. It's working fine for me: 10 CALL KEY(5,K,S) 20 PRINT K 30 GOTO 10 prints 141 2 Quote Link to comment Share on other sites More sharing options...
globeron Posted June 22, 2022 Share Posted June 22, 2022 Hi @Asmusr (I am doing some screen recording using js99er.net), but some games require a Joystick Fire or Up to start . e.g. Bouncy uses Fire: JS99'er (js99er.net) or SCRAA requires Joystick up SCRAA.bin I cannot figure out how to use the Joystick in js99er.net (Q and Y do not work, it seems sometimes TAB works as Firebutton) In http://old.js99er.net/# you had these Joystick buttons and can start the game: Quote Link to comment Share on other sites More sharing options...
+arcadeshopper Posted June 23, 2022 Share Posted June 23, 2022 2 hours ago, globeron said: Hi @Asmusr (I am doing some screen recording using js99er.net), but some games require a Joystick Fire or Up to start . e.g. Bouncy uses Fire: JS99'er (js99er.net) or SCRAA requires Joystick up SCRAA.bin I cannot figure out how to use the Joystick in js99er.net (Q and Y do not work, it seems sometimes TAB works as Firebutton) In http://old.js99er.net/# you had these Joystick buttons and can start the game: probably hook up a gamepad that's supported Quote Link to comment Share on other sites More sharing options...
globeron Posted June 23, 2022 Share Posted June 23, 2022 Scud Buster works in MAME, but somehow it hangs in both js99er.net and Classic99 SCUDBUSTER32KB8.rpk (I came along more modules I will let know), I believe these as I did the video recordings with MAME Games3.rpk enigma.rpk borzork.rpk 1 Quote Link to comment Share on other sites More sharing options...
Asmusr Posted June 23, 2022 Author Share Posted June 23, 2022 Joystick 1 is mapped to the arrow keys and tab as in Classic99. If up doesn't work, maybe you need to press Caps Lock to disable Alpha Lock? 1 Quote Link to comment Share on other sites More sharing options...
globeron Posted June 23, 2022 Share Posted June 23, 2022 4 hours ago, arcadeshopper said: probably hook up a gamepad that's supported I have USB Joystick and game-controllers, but need to use joy2key tool to map buttons. The problem is that Q, E,S,D,X, Y, etc. do not work to map the Joystick keys (or do I oversee something?) Quote Link to comment Share on other sites More sharing options...
globeron Posted June 23, 2022 Share Posted June 23, 2022 (edited) 56 minutes ago, Asmusr said: Joystick 1 is mapped to the arrow keys and tab as in Classic99. If up doesn't work, maybe you need to press Caps Lock to disable Alpha Lock? All okay now. the Joysticks work in Edge browser. (and after turning off / on all plugins, the joysticks now also works again in Chrome) Edited June 23, 2022 by globeron 1 Quote Link to comment Share on other sites More sharing options...
Tursi Posted June 23, 2022 Share Posted June 23, 2022 21 hours ago, globeron said: Scud Buster works in MAME, but somehow it hangs in both js99er.net and Classic99 SCUDBUSTER32KB8.rpk 5.51 kB · 0 downloads Scud Buster is crashing in Classic99 because it hits a copy loop at >A032 with the count register set to 0. I guess this is a copy cart (copying from ROM to RAM?) Breakpoint at >A000: A000 MOV R11,@>8300 save return address (60E8, but this is possibly meaningless as RAM was branched to, not branch and link) A004 jmp >A016 A016 lwpi >C202 workspace in high RAM - this space is all zeros in Classic99, data ends around >C1F0 A01A mov @>83D0,R12 >9804 (GROM data, but, second base?) A01E mov @>83D2,R9 >E000 A022 ldcr @>ba14,16 loads >0101 but to a CRU base of >9804? I think that works out to >1804, which would be on the thermal printer? A026 ai r9,>0004 >E000 becomes >E004 A02A movb *r9+,R4 this memory is all zeroed, R4 gets 0 A02C srl r4,8 from byte to int A02E li r10,>2678 R10 gets >2678 - this is also empty memory A032 movb *r9+,*R10+ Copy loop, though the source memory space is empty A034 dec r4 But R4 is 0, so this wraps around to >FFFF A036 jne >A032 and the loop attempts to overwrite 65536 bytes, corrupting the program and crashing. I'm curious why MAME does NOT crash.. is the wrong data being copied to RAM? The copy loop at >A032 looks just like the copy loop that sets up RAM at >6052 in page 1. 1 Quote Link to comment Share on other sites More sharing options...
globeron Posted June 23, 2022 Share Posted June 23, 2022 27 minutes ago, Tursi said: Scud Buster is crashing in Classic99 because it hits a copy loop at >A032 with the count register set to 0. I guess this is a copy cart (copying from ROM to RAM?) Breakpoint at >A000: A000 MOV R11,@>8300 save return address (60E8, but this is possibly meaningless as RAM was branched to, not branch and link) A004 jmp >A016 A016 lwpi >C202 workspace in high RAM - this space is all zeros in Classic99, data ends around >C1F0 A01A mov @>83D0,R12 >9804 (GROM data, but, second base?) A01E mov @>83D2,R9 >E000 A022 ldcr @>ba14,16 loads >0101 but to a CRU base of >9804? I think that works out to >1804, which would be on the thermal printer? A026 ai r9,>0004 >E000 becomes >E004 A02A movb *r9+,R4 this memory is all zeroed, R4 gets 0 A02C srl r4,8 from byte to int A02E li r10,>2678 R10 gets >2678 - this is also empty memory A032 movb *r9+,*R10+ Copy loop, though the source memory space is empty A034 dec r4 But R4 is 0, so this wraps around to >FFFF A036 jne >A032 and the loop attempts to overwrite 65536 bytes, corrupting the program and crashing. I'm curious why MAME does NOT crash.. is the wrong data being copied to RAM? The copy loop at >A032 looks just like the copy loop that sets up RAM at >6052 in page 1. @mizapf probably knows? 1 Quote Link to comment Share on other sites More sharing options...
Tursi Posted June 24, 2022 Share Posted June 24, 2022 5 hours ago, globeron said: @mizapf probably knows? I bet it's because he initializes the 32k to >FF00 instead of all zeroes - so the copy loop would only copy 256 bytes in that case. Pointless, but also harmless. A quick test here suggests that would work. But it means it would also crash on real hardware that uses SRAM instead of DRAM. Amusingly, if true, this would make the second known piece of software that relies on that startup pattern. Unfortunately, the game still didn't work... next it hung up checking >8378 was greater than or equal to >002D. >8378 is the output of GPL RAND, but I didn't see anything calling RAND, so the value would never change. Bypassing that.. well, still more things didn't function. Perhaps it's unimplemented hardware... but I thought everything inside the console was pretty solid by this point in Classic99. 1 Quote Link to comment Share on other sites More sharing options...
+mizapf Posted June 24, 2022 Share Posted June 24, 2022 Try it in MAME by using another memory expansion, like samsmem or the 32K 16bit console mod. 2 Quote Link to comment Share on other sites More sharing options...
TheMole Posted June 27, 2022 Share Posted June 27, 2022 @Asmusr, could there be a feature added that lets js99er capture the mouse cursor when mouse emulation is used (i.e. hide the normal macos/windows/Linux mouse cursor until a magic key combo is pressed)? Quote Link to comment Share on other sites More sharing options...
Asmusr Posted June 28, 2022 Author Share Posted June 28, 2022 On 6/27/2022 at 12:51 PM, TheMole said: @Asmusr, could there be a feature added that lets js99er capture the mouse cursor when mouse emulation is used (i.e. hide the normal macos/windows/Linux mouse cursor until a magic key combo is pressed)? It's possible to disable to mouse pointer in specific areas using CSS, so it should be possible to disable the mouse pointer over the TI-99/4A canvas when mouse messages are sent from TI software to the TIPI emulation, and maybe enable it again after hard reset. 3 Quote Link to comment Share on other sites More sharing options...
TheMole Posted June 30, 2022 Share Posted June 30, 2022 20 hours ago, Asmusr said: It's possible to disable to mouse pointer in specific areas using CSS, so it should be possible to disable the mouse pointer over the TI-99/4A canvas when mouse messages are sent from TI software to the TIPI emulation, and maybe enable it again after hard reset. That might work and would definitely solve part of the problem, but ideally the mouse would be kept within the confines of the canvas if at all possible (no idea of the limitations of the javascript environment in that regard). Just to clarify my request and provide some context: I'm developing something that requires both mouse input and the F18A (for now), so js99er is the tool for me. The mouse is used in the most classic sense, you point at something on the screen and click on it to select it. The current implementation in js99er makes it so that there are two mouse cursors on the screen: one inside the emulation (some sprites), and the host OS cursor. That's issue number one: it gets a bit confusing and your eye is often drawn to the host OS cursor, making you click the wrong part of the emulated screen. Hiding the cursor when it is over the canvas would definitely solve this. Issue number two is trickier though: if the host OS cursor moves outside of the canvas, the the mouse position inside the emulator stops updating. If the host OS cursor and emulated cursor do not move at the same speed (because of mouse acceleration, e.g.) you are not able to get to all parts of the emulated screen without some mouse acrobatics. Basically, you would need to host OS cursor to be kept within the bounds of the canvas to avoid this. A lot of windowed, mouse-driven games did this in the past, I think MAME does as well, but those are all native apps of course... Another rough workaround might be having a fullscreen mode? Quote Link to comment Share on other sites More sharing options...
Asmusr Posted June 30, 2022 Author Share Posted June 30, 2022 12 hours ago, TheMole said: That might work and would definitely solve part of the problem, but ideally the mouse would be kept within the confines of the canvas if at all possible (no idea of the limitations of the javascript environment in that regard). Just to clarify my request and provide some context: I'm developing something that requires both mouse input and the F18A (for now), so js99er is the tool for me. The mouse is used in the most classic sense, you point at something on the screen and click on it to select it. The current implementation in js99er makes it so that there are two mouse cursors on the screen: one inside the emulation (some sprites), and the host OS cursor. That's issue number one: it gets a bit confusing and your eye is often drawn to the host OS cursor, making you click the wrong part of the emulated screen. Hiding the cursor when it is over the canvas would definitely solve this. Issue number two is trickier though: if the host OS cursor moves outside of the canvas, the the mouse position inside the emulator stops updating. If the host OS cursor and emulated cursor do not move at the same speed (because of mouse acceleration, e.g.) you are not able to get to all parts of the emulated screen without some mouse acrobatics. Basically, you would need to host OS cursor to be kept within the bounds of the canvas to avoid this. A lot of windowed, mouse-driven games did this in the past, I think MAME does as well, but those are all native apps of course... Another rough workaround might be having a fullscreen mode? It sounds like a job for the Pointer Lock API https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API 4 Quote Link to comment Share on other sites More sharing options...
Asmusr Posted December 2, 2022 Author Share Posted December 2, 2022 I have added some screen layout options to JS99'er. The first is a full screen mode that you enter and leave by pressing F11 in most browsers. I'm maintaining the 4/3 aspect ratio, so on most screens you will get white bars to the left and right of the TI screen. I don't know how to run in full screen on a phone, so I haven't tried if that works. The second is a button to show/hide the tabbed panel but maintain the toolbar. It also centers the TI screen, which may be more agreeable to look at. 5 1 Quote Link to comment Share on other sites More sharing options...
Asmusr Posted December 2, 2022 Author Share Posted December 2, 2022 On 6/30/2022 at 5:26 AM, TheMole said: Another rough workaround might be having a fullscreen mode? Sorry I completely forgot about your request for better mouse support, but maybe the full screen mode will help? Otherwise I will be happy to look into using the Pointer Lock API. 1 Quote Link to comment Share on other sites More sharing options...
TheMole Posted December 5, 2022 Share Posted December 5, 2022 On 12/3/2022 at 2:19 AM, Asmusr said: Sorry I completely forgot about your request for better mouse support, but maybe the full screen mode will help? Otherwise I will be happy to look into using the Pointer Lock API. No worries! I tested the fullscreen mode (which is great, btw!), and it doesn't solve the cursor issue. If you move the host cursor out out the TI screen area (in the white bars), it gets out of sync with the TI mouse cursor position. But I think there's only one thing needed to solve this, which is to hide the host OS cursor in full screen mode. 2 Quote Link to comment Share on other sites More sharing options...
Asmusr Posted December 15, 2022 Author Share Posted December 15, 2022 On 12/5/2022 at 7:31 AM, TheMole said: I tested the fullscreen mode (which is great, btw!), and it doesn't solve the cursor issue. If you move the host cursor out out the TI screen area (in the white bars), it gets out of sync with the TI mouse cursor position. But I think there's only one thing needed to solve this, which is to hide the host OS cursor in full screen mode. In the latest version the host mouse pointer is disabled in the TI area in full screen view, but it doesn't solve all the issues. If you move the mouse pointer outside the TI area, try, for the best alignment, to move it in again as the same position as the TI mouse pointer. 1 Quote Link to comment Share on other sites More sharing options...
TheMole Posted December 17, 2022 Share Posted December 17, 2022 On 12/15/2022 at 2:18 PM, Asmusr said: In the latest version the host mouse pointer is disabled in the TI area in full screen view, but it doesn't solve all the issues. If you move the mouse pointer outside the TI area, try, for the best alignment, to move it in again as the same position as the TI mouse pointer. Indeed, I would've expected the host mouse coordinates to continue updating when the mouse goes out of bounds, but it seems like it doesn't. The video below shows how misalignment between the host cursor and the perceived cursor position in the emulated program leads to some awkward issues: 3 Quote Link to comment Share on other sites More sharing options...
PeteE Posted December 17, 2022 Share Posted December 17, 2022 (edited) 5 hours ago, TheMole said: Indeed, I would've expected the host mouse coordinates to continue updating when the mouse goes out of bounds, but it seems like it doesn't. The video below shows how misalignment between the host cursor and the perceived cursor position in the emulated program leads to some awkward issues: Cool demo! The TIPI mouse API uses relative mouse positioning, basically the same PS/2 mouse protocol coming from a hardware mouse rotary encoders indicating how far you moved your mouse. So there isn't any real way for the emulator to tell the running program the mouse is at a particular pixel location. Perhaps the emulator could try to determine which sprite is being used as mouse pointer and try to send the right amounts of relative displacement to get the sprite location to match the host mouse pointer location, but I could see that being really difficult due to lag. Edit: Except sprite detection won't work in 40 or 80-column text mode (due to no sprites) Edited December 17, 2022 by PeteE 2 Quote Link to comment Share on other sites More sharing options...
Asmusr Posted December 17, 2022 Author Share Posted December 17, 2022 7 hours ago, TheMole said: Indeed, I would've expected the host mouse coordinates to continue updating when the mouse goes out of bounds, but it seems like it doesn't. Yes, very cool demo! It's tricky. Even if you allow the mouse coordinates to update when you move the host mouse around the entire screen (just tried that) there can still be areas on the TI screen that you cannot reach, depending on where the host mouse happen to be when you start the TI program that uses the mouse. That's why I went in the other direction and only recorded mouse movement when you're inside the border of the TI screen. That makes it relatively easy to align the host mouse pointer and the TI mouse pointer, which is when it works best. But I'm happy to try other solutions. 1 Quote Link to comment Share on other sites More sharing options...
Asmusr Posted December 17, 2022 Author Share Posted December 17, 2022 (edited) As I mentioned before, the solution is to use the pointer lock API https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API Pointer lock lets you access mouse events even when the cursor goes past the boundary of the browser or screen. Edited December 17, 2022 by Asmusr 4 Quote Link to comment Share on other sites More sharing options...
PeteE Posted December 22, 2022 Share Posted December 22, 2022 On 12/17/2022 at 12:41 PM, Asmusr said: As I mentioned before, the solution is to use the pointer lock API https://developer.mozilla.org/en-US/docs/Web/API/Pointer_Lock_API Pointer lock lets you access mouse events even when the cursor goes past the boundary of the browser or screen. I have some time now to add the pointer lock method to the TIPI mouse in JS99er, if you haven't already started on it yet. It will change so that clicking in the 99/4A canvas the first time will activate the pointer lock, and the mouse pointer will be hidden while the mouse events are sent exclusively to the canvas. Pressing escape key will deactivate pointer lock and the mouse pointer will reappear. Do you think this should have its own configuration option? 1 Quote Link to comment Share on other sites More sharing options...
Asmusr Posted December 24, 2022 Author Share Posted December 24, 2022 On 12/23/2022 at 12:29 AM, PeteE said: I have some time now to add the pointer lock method to the TIPI mouse in JS99er, if you haven't already started on it yet. It will change so that clicking in the 99/4A canvas the first time will activate the pointer lock, and the mouse pointer will be hidden while the mouse events are sent exclusively to the canvas. Pressing escape key will deactivate pointer lock and the mouse pointer will reappear. Do you think this should have its own configuration option? I have made some experiments with pointer lock and it seems to be working fine, but I haven't decided what the best way of activating it would be. Just clicking anywhere would prevent the other mouse functionality (that you can click on numbers in the menus) from being used. I was thinking either a toolbar button that you have to click before entering full screen mode, or that you have to click in the border, which is a bit obscure. Because of Christmas I don't have much time for this now. 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.