MJoergen / C64MEGA65

Commodore 64 core for the MEGA65 based on the MiSTer FPGA C64 core
GNU General Public License v3.0
29 stars 4 forks source link

TeensyROM is not booting its menu #143

Open sy2002 opened 4 months ago

sy2002 commented 4 months ago

@dansanderson reported via Discord:

grafik

I do not know the TeensyROM cartridge, yet and assume it is this one:

https://github.com/SensoriumEmbedded/TeensyROM

@dansanderson please clarify/confirm: I do assume you tested on an R6 board using V5.1 RC3 or RC3A?

dansanderson commented 4 months ago

Correct, that's TeensyROM. C64 core WIP-V5.1-RC2.

Technically we tested on an unpatched R5, which might make a difference. I didn't get around to installing the bodge wires that IIRC we told Trenz to install on the R6. I should have an R6 to test with when my number comes up soon.

sy2002 commented 4 months ago

@dansanderson Indeed it would be great if you could confirm that the problem persists on a R6 board. Reason: The C64 core explicitly makes use of "hardware stuff" that requires a modded R5 or a (regular) R6 board. Means: If you use an unmodded R5, then the C64 core might stumble. But I am not claiming this is the reason ;-) There MIGHT be other reasons. Please take your time, we are not in a hurry regarding this issue - but as soon as time is ripe, please confirm.

paich64 commented 3 months ago

I just got my Tensyrom and tested it with my R6 board.

Here are the observations using the c64 core V5.1 :

1) When booting the Mega65 with the Tensyrom inserted, the C64 core is started, meaning, the cartridge is detected as a C64 cartridge 2) However, the TensyROM menu won't show show up 3) Pressing the "main menu" TensyROM button will result in the core being reset (obviously) but the menu won't show up 4) Short/long reset of the C64 core won't help

Here are the observations when enforcing the MEGA65 core to boot with the cartridge inserted (Holding NOSCROLL and selecting the MEGA65 core in slot number 1

1) Most of the of the time, the TensyROM main menu will show up 2) When the TensyROM menu does not show up (instead we have the Mega65 basic prompt) a simple reset, or using GO64 will result in the TensyROM menu showing up 3) Contrary to the C64 core, the "main menu" TensyROM button does not trigger any reset (while it should) 4) .prg will load and work as expected 5) .crt will keep loading forever and will never start 6) F2 which is supposed to leave the menu and go back to the Basic prompt does not work and result in freezing all other keys which are usually working

I have ordered a second TENSYROM and will ship it to @MJoergen as soon as i get it. I confirm it's this cartridge : https://github.com/SensoriumEmbedded/TeensyROM I confirm that TRAVIS agrees to help us with the troubleshooting.

paich64 commented 1 month ago

update : Tensyrom will be shipped to Michael next monday. In the meantime here is the behaviour observed on 3 different configurations :

Note, this is the manual for the Tensyrom : https://github.com/SensoriumEmbedded/TeensyROM/blob/main/docs/General_Usage.md

TENSYROM on Ultimate 64 This is the expected behaviour.

https://www.youtube.com/watch?v=zu5A68Ha8nY

switching on the Ultimate 64 results in the cartridge booting and starting the tensyrom menu. we can hit F3, browse the Tensyrom SD card, select a .prg file, the .prg file gets loaded and the program started. Hitting the Tensyrom button reset button results in the tensyrom cartridge being reset (loading again the the tensyrom menu). Holding the reset button a long time results in the catrige starting its reset procedure but being frozen (as if cpu was stopped) and releasing it will result in the tensyrom cartridge reset procedure completing (loading again the the tensyrom menu).

TENSYROM with the MEGA65 core 0.96 (R6 board)

https://www.youtube.com/watch?v=tLNC_dhvpHY

the c64 core is not installed, so if a c64 cartridge is inserted the Mega65 core will start in GO64 mode.

switching on the Mega65 WITHOUT the C64 core installed and the Tensyrom inserted results in the GO64 mode starting and the cartridge booting and starting the tensyrom menu. As on a real C64, we can hit F3, browse the Tensyrom SD card, select a .prg file, the .prg file gets loaded and the program started. Note : because of the limitations of the GO64 mode, not all .prg will load and play.

The tensyrom reset button does not work when in GO64 mode : pressing it does nothing. To go back to the Tensyrom menu, we have to push the Mega65 reset button.

TENSYROM with the C64 core V5.1 (R6 board)

https://www.youtube.com/watch?v=U397i7pEvgc

the C64 core is installed and configured to start when a c64 cartridge is inserted.

switching on the Mega65 with the C64 core installed and the Tensyrom inserted results in the C64 core starting. This means that the tensyrom is detected as a C64 cartridge. However, The tensyrom menu does not show up.

The video show the Mega65 booting the C64 core (but no tensyrom menu shows up). Then 2 short resets are consecutively executed using the Tensyrom reset button : each time a black screen appears and we get back to the C64 "ready" prompt. Then 1 long reset is executed with the Tensyrom reset button (we keep the tensyrom reset button held a few seconds before releasing it) : The black screen appears and stays until we release the Tensyrom reset button. When we release it we get back to the C64 "ready" prompt.

Kugelblitz360 commented 1 month ago

And @sensoriumembedded mentioned to me that TeensyROM is holding the Reset line for approx. 50.000 Phi2 cycles in order to initialize itself; this halts the CPU.

SensoriumEmbedded commented 1 month ago

The 50mS reset hold time was chosen somewhat arbitrarily. If you think holding it that long is the cause, I'm happy to do a build with shorter reset time to help prove it out. Just let me know, thanks!

Kugelblitz360 commented 3 weeks ago

When the MEGA65 is in M65 Core mode, GO64 activates the (physical) TeensyROM cartridge. It boots, Music plays, Menu works. Internal functionality like updating via SD card works too.

In the C64 Core the cartridge does not boot but the RAM test in Reset sees that there is a ROM and outputs 30719 BASIC BYTES FREE

A quick and dirty test:

10 PRINT PEEK (32768) 20 GOTO 10 show the value 255 with a 70% chance. In the other 30% of cases it shows either 9 (the correct value for most carts), 63 or 127. Doing the test with 32769, which most often contains $80, gets again most often 255, some 128, some 191 and some 159.

So somehow the cart simply is not read correctly.

In the setup screen (f8) "RW Read Dly" is default "Off". You could set this to "On" (it gets saved in EEPROM) then power off and back on to apply it and see if you notice anything different.

When this is done, the values switch to 9, 41 and 57. Getting there, 9 is the correct value, but still there is something wrong.

sy2002 commented 3 weeks ago

@Kugelblitz360 Can you please check what happens, if you turn "HDMI: Flicker-free" OFF, save the settings (confirm by resetting without the cartridge) and then try again?

Kugelblitz360 commented 3 weeks ago

That was with Flicker-Free off (because I was still testing CRT stuff too) but in 5:4 576p and Audio On, if that makes a difference?

With HDMI Flicker ON the values for $8000 are most often 63, some 9, some 61.

Kugelblitz360 commented 3 weeks ago

POKE 32768,0 or POKE 32768,255 does not change anything, so it is not that it sometimes reads the RAM.

Sanity checked with 32767 too, there PEEK gives the value I poked.