Emulator r39 Released

Announcements by the development team or forum staff.
Greg King
Posts: 162
Joined: Wed Jul 08, 2020 1:14 pm

Emulator r39 Released

Post by Greg King »



On 3/31/2022 at 6:33 PM, desertfish said:




I'd like to try your test program but the sdcard image acts weird, I can't load the file off of it. It is in petscii symbols (uppercase) and I can't load it it keeps saying file not found. Can you post just the PRGs zipped here perhaps as well instead of on an sdcard image?



Type a control-n.  Then, load the file with lower-case letters:

load"cx16*"

User avatar
svenvandevelde
Posts: 488
Joined: Wed Dec 23, 2020 6:30 am
Location: Belgium, Antwerpen

Emulator r39 Released

Post by svenvandevelde »



On 4/1/2022 at 12:33 AM, desertfish said:




I'd like to try your test program but the sdcard image acts weird, I can't load the file off of it. It is in petscii symbols (uppercase) and I can't load it it keeps saying file not found. Can you post just the PRGs zipped here perhaps as well instead of on an sdcard image?



Of course, please find attached. Thank you for trying it out:

cx16-mouse - problem.prg

cx16-mouse - working.prg

FILE

 

KICKC home page by Jesper Gravgaard.
My KICKC alpha with Commander X16 extensions.
User avatar
svenvandevelde
Posts: 488
Joined: Wed Dec 23, 2020 6:30 am
Location: Belgium, Antwerpen

Emulator r39 Released

Post by svenvandevelde »



On 4/1/2022 at 5:42 AM, TomXP411 said:




It's an upper-lower case thing. Just mount the file in Windows and invert the case, making the filename all (I think) upper case.



Correct. In the above post I've attached the prg files and the input file for trying.

You can modify and compile using kick assembler the assembler files i attached in the above post.

For example, change the file name and then recompile ...



In parallel i'm also testing further and today i'm checking the ROM code as well ...

KICKC home page by Jesper Gravgaard.
My KICKC alpha with Commander X16 extensions.
User avatar
svenvandevelde
Posts: 488
Joined: Wed Dec 23, 2020 6:30 am
Location: Belgium, Antwerpen

Emulator r39 Released

Post by svenvandevelde »



On 3/31/2022 at 8:30 PM, Greg King said:




You should call cbm_k_clrchn() before you call cbm_k_close().



It's the opposite of when you started to use the file:




  1. OPEN the file,


  2. connect to the file.




When you're finished, you must:




  1. disconnect from the file,


  2. close the file.




This does not seem to help. Made a video demonstrating the issue.

Also the API CLRCHN is to clear all channels. I believe the CLRCHN is to refocus on the keyboard input and to clear all channels.

Should not influence the CLOSE call. But that is a discussion that already happened earlier in this forum.

Please have a look in the video, it demonstrates the problem.

This issue also occurs in my game, where i did identify the issue by eliminating all logic gradually

until i got the mouse pointer working, and then gradually i reapplied parts of the logic until i found the

exact routines that were causing the issue (i did multiple recompiles, as you can imagine :-)-.





 

KICKC home page by Jesper Gravgaard.
My KICKC alpha with Commander X16 extensions.
User avatar
svenvandevelde
Posts: 488
Joined: Wed Dec 23, 2020 6:30 am
Location: Belgium, Antwerpen

Emulator r39 Released

Post by svenvandevelde »


Could even further narrow the issue ... Just opening a file and closing a file result in the issue without any reading of characters done.

cx16-mouse - open close.prg

cx16-mouse - open close.asm

cx16-mouse - open only.prg

cx16-mouse - open only.asm

FILE

I'm going to leave it at this stage not to over pollute the forum here ... There is now sufficient information to have a look at the ROM code or emulator code (don't know), to see where the problem is.

Please try out the PRGs. I've made a very verbose explanation in the code ...

Also attached the relevant C code routines so you can see the logic on a higher level.

cx16-mouse - open close.c

cx16-mouse - open only.c

Would be interested @Michael Steil what is your take on this. I've been looking at the commit history of the R39 and I

don't think the issue is due to the mouse logic itself. I think the issue is related to a combination of dos or file io updates and screen mode updates.

I've also noticed a couple of vectors being updated ... Could it be that registers are incorrectly overwritten?

Note that in this resimulation is not doing much actually, just opening a file and closing and measuring mouse IO.

The screen writing is natively on the VERA, there are no CHROUT API calls done.

Sven

KICKC home page by Jesper Gravgaard.
My KICKC alpha with Commander X16 extensions.
Greg King
Posts: 162
Joined: Wed Jul 08, 2020 1:14 pm

Emulator r39 Released

Post by Greg King »


What happens if you open and close the command/status channel instead of a file?

User avatar
svenvandevelde
Posts: 488
Joined: Wed Dec 23, 2020 6:30 am
Location: Belgium, Antwerpen

Emulator r39 Released

Post by svenvandevelde »



On 4/1/2022 at 11:33 AM, Greg King said:




What happens if you open and close the command/status channel instead of a file?



You mean 1,8,15 ? Same effect. Tried that already ?

KICKC home page by Jesper Gravgaard.
My KICKC alpha with Commander X16 extensions.
User avatar
desertfish
Posts: 1096
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Emulator r39 Released

Post by desertfish »


@svenvandevelde  with the "cx16-mouse open close.prg"  program, I could reproduce the problem. However, I think it's an emulator issue ;  the problem only occurs when using x16emu. Using box16 to run the same program, the issue does NOT occur.

 

User avatar
svenvandevelde
Posts: 488
Joined: Wed Dec 23, 2020 6:30 am
Location: Belgium, Antwerpen

Emulator r39 Released

Post by svenvandevelde »



On 4/1/2022 at 8:12 PM, desertfish said:




@svenvandevelde  with the "cx16-mouse open close.prg"  program, I could reproduce the problem. However, I think it's an emulator issue ;  the problem only occurs when using x16emu. Using box16 to run the same program, the issue does NOT occur.



 



now THAT is an amazing finding. Kudos @desertfish for this!

So I need to remake the ROM and plug it into the box16. Let me try that ...

On top, please find an interesting discussion here:

Match mouse position in emulator window with host position · Issue #376 · commanderx16/x16-emulator (github.com)

KICKC home page by Jesper Gravgaard.
My KICKC alpha with Commander X16 extensions.
User avatar
svenvandevelde
Posts: 488
Joined: Wed Dec 23, 2020 6:30 am
Location: Belgium, Antwerpen

Emulator r39 Released

Post by svenvandevelde »


It is working perfectly now in Box16 using rom R39 ...

Game is flowing well ... Also implemented performance improvements on the floor painter and scroller.

 





 

KICKC home page by Jesper Gravgaard.
My KICKC alpha with Commander X16 extensions.
Post Reply