Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

twin16: ghost sprites in miaj #929

Open
jotego opened this issue Jan 14, 2025 · 6 comments
Open

twin16: ghost sprites in miaj #929

jotego opened this issue Jan 14, 2025 · 6 comments
Assignees
Labels
core bug Something isn't working

Comments

@jotego
Copy link
Owner

jotego commented Jan 14, 2025

commit: 5ae3cb8

As the main character moves around, he leaves ghosts behind. This can be seen in scene 1, where the character on the ground should not be visible. The one climbing up the stairs is the right one.

frame_00003

swcore twin16 ver/miaj
jtsim -s 1
jotego added a commit that referenced this issue Jan 14, 2025
@jotego jotego added the core bug Something isn't working label Jan 14, 2025
@skutis
Copy link
Collaborator

skutis commented Jan 14, 2025

Maybe the sprite table is not emptied correctly?

@jotego
Copy link
Owner Author

jotego commented Jan 14, 2025

Should it be emptied even if the sprite pre processor is not used?

@skutis
Copy link
Collaborator

skutis commented Jan 14, 2025

On real hardware the parsed sprite table is emptied, it depends on how you have implemented the parsed sprite table scanning.

@jotego
Copy link
Owner Author

jotego commented Jan 14, 2025

Currently, it is only cleared when the pre-processor is used. I see that we need to clear it each time then.

@jotego jotego moved this to 🏗 In progress in JTCores Jan 17, 2025
@jotego
Copy link
Owner Author

jotego commented Jan 18, 2025

A couple of notes from a conversation with skutis:

  • objbufinit starts right at blanking. The 1-line delay was not correct
  • the value used to clear the buffer is 8'h00, not MAME's 8'hff
  • the CPUs cannot write to the sprite RAM while the DMA is active

The last point would require modifying jttwin16_share so oram_we is not asserted during the DMA phase. A signal should be carried from jt00778x all the wait to jttwin16_share

@jotego
Copy link
Owner Author

jotego commented Jan 23, 2025

Skutis looked into this a bit more. If the CPU tries to access the object RAM while DMA is active, it will get locked because DTACKn does not get asserted for oram access if DMA is busy.

@rp-jt modify twin16_main:

jtframe_68kdtack_cen #(.W(5),.RECOVERY(1)) u_dtack(
// ...
    .bus_cs     ( bus_cs    ),
    .bus_busy   ( bus_busy  ),
    .bus_legit  ( bus_legit )
//...
);
  • include oram_cs as part of bus_cs
  • when oram_cs&dma_bsy, bus_busy should also be asserted
  • make bus_legit=oram_cs

This should fix the boot-up test

rp-jt added a commit that referenced this issue Jan 23, 2025
@jotego jotego moved this from 🏗 In progress to 🙋‍♂️ Backlog in JTCores Feb 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core bug Something isn't working
Projects
Status: 🙋‍♂️ Backlog
Development

No branches or pull requests

3 participants