Skip to content
This repository has been archived by the owner on Feb 5, 2023. It is now read-only.

Track and Field: nvram loading is broken #12

Closed
gyurco opened this issue Jun 10, 2022 · 4 comments
Closed

Track and Field: nvram loading is broken #12

gyurco opened this issue Jun 10, 2022 · 4 comments

Comments

@gyurco
Copy link

gyurco commented Jun 10, 2022

Fortunately easy to fix:

diff --git a/cores/track/hdl/jttrack_main.v b/cores/track/hdl/jttrack_main.v
index 5264d4b..0ada954 100644
--- a/cores/track/hdl/jttrack_main.v
+++ b/cores/track/hdl/jttrack_main.v
@@ -78,14 +78,12 @@ reg         irq_clrn, ram_cs;
 reg         ior_cs, in5_cs,
             iow_cs;
 wire        VMA;
-reg         nvram_we;
+wire        nvram_we;
 
 assign irq_trigger = ~LVBL & dip_pause;
 assign cpu_rnw     = RnW;
 assign rom_addr    = A;
-
-always @(posedge clk)
-    nvram_we <= ioctl_ram && ioctl_wr && ioctl_addr[15:11]==0;
+assign nvram_we    = ioctl_ram && ioctl_wr && ioctl_addr[15:11]==0;
 
 always @(*) begin
     // the ROM logic has some optional jumpers and the PCB we got

Sorry, no PR, but the fix is really trivial - nvram_we's clock is wrong, it should be the same as dma_clk(clk48). However I think it's even better to not delay this signal in respect to ioctl_wr - thus use combinatorial logic.

@gyurco
Copy link
Author

gyurco commented Jun 10, 2022

Might be applicable to Road Fighter, too.

@jotego
Copy link
Owner

jotego commented Jun 11, 2022

Thank you. People had been complaining about it but whenever I tested it, it seemed to work so I didn't look further. Thanks :-)

@jotego jotego closed this as completed Jun 11, 2022
@gyurco
Copy link
Author

gyurco commented Jun 11, 2022

Looks like Hypersports is also has the bug. Upd.: sorry, I didn't check it uses roadf.rbf.

@jotego
Copy link
Owner

jotego commented Jun 12, 2022

It should be ok now as it is the same rbf as Road Fighter.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
Archived in project
Development

No branches or pull requests

2 participants