commanderx16 / x16-demo

73 stars 29 forks source link

The mouse is overwriting the position of the first sprite in cc65-sprite demo #90

Closed haakonnessjoen closed 4 years ago

haakonnessjoen commented 4 years ago

If you write mouse 0 before run, the problem is gone.

I tried adding mouse_hide(), or even mouse_unload() to main(). But that didn't help at all.

mist64 commented 4 years ago

This should be fixed in r35, can you check?

haakonnessjoen commented 4 years ago

In r35, the demo no longer moves any of the sprites.

It seems to lock up, since pressing any key does not exit the demo any longer either.

greg-king5 commented 4 years ago

In r35, the demo no longer moves any of the sprites. It seems to lock up, since pressing any key does not exit the demo any longer either.

A lot of Kernal variables were moved between r34 and r35! cc65's library hasn't been updated, yet.

For example, the TIME variable was moved from low memory into banked RAM. Therefore, the current waitvsync() cannot work in r35 (I used TIME as an indirect -- but simple -- measure of VERA's vertical sync interrupts).

mist64 commented 4 years ago

The cc65 library should no longer export KERNAL variables such as TIME. There are APIs for this particular one, and if there are no APIs for other useful variables, I'm happy to add them.

greg-king5 commented 4 years ago

We don't want to waste time going through the Kernal. That's especially true about the vertical sync. We want our programs to have as many cycles as possible to push data into VERA before it begins to display things.

mist64 commented 4 years ago

The X16 can be easy to program, but it can also be powerful and flexible. In easy to program mode, you leave the IRQ handler as it is, and use KERNAL APIs to make your life easier. In flexible mode, you can replace the IRQ handler, and avoid all KERNAL calls.

I am not sure there is any middle ground here. We can't have a stable yet evolving variable layout.

greg-king5 commented 4 years ago

This should be fixed in r35, can you check?

Yes, it's fixed. You can close this.