sehugg / 8bitworkshop

web-based IDE for 8-bit programming and Verilog development
http://8bitworkshop.com/
GNU General Public License v3.0
504 stars 82 forks source link

NES vram buffer sample #59

Open mickbeaver opened 3 years ago

mickbeaver commented 3 years ago

Hello,

I have been following along with the projects using my local build environment (CC65 and the Mesen emulator). I found that the VRAM Buffer sample had some odd behavior where the Y scroll position jumped all around. At first I chalked it up to my local emulator, but I was able to get it to happen in JSNES, too, by increasing VBUFSIZE to 150.

As far as I can tell, the issue is that the scroll register isn't getting set during the vblank period, as the local variable y and the NESLIB variable SCROLL_Y seem correct.

mickbeaver commented 3 years ago

In other words, the bug that I'm trying to report is that the timing of the sample is extremely sensitive and that other emulators, such as Mesen and Nesicide, show scrolling artifacts at a lower VBUFSIZE (such as 128).

denisenepraunig commented 2 years ago

@mickbeaver oh I see you've setup the project locally!

I struggle quite a bit with my setup locally, may you could give me some hints how you did it?!

  1. Do you use a cfg file for the CC65 compiler like nesdoug does?
  2. Where you able to link the sprites (//#link "chr_generic.s") into the NES ROM?

Here is a little thread, but couldn't get it working... https://twitter.com/denisenepraunig/status/1454445239389806594?s=20

Many thanks in advance!

mickbeaver commented 2 years ago

Hello,

For prerequisites:

You can download chr_generic.s and create an object file out of it. The linker config is in 8bitworkshop/src/worker/lib/nes/neslib2.cfg.

I've attached the code; can't remember what state it is in.

mgftn.zip

denisenepraunig commented 2 years ago

@mickbeaver Thank you Mick for sharing your files and config - now I found all the files I need, compiled the crt0.s and things like that. Now it works for me! 👍 YAY finally 🎉

mickbeaver commented 2 years ago

You're welcome! I remember it being a bit of a mystery... Specifically, having a custom NESlib was a surprise to me.