ITotalJustice / TotalSMS

Sega Master System emulator
https://itotaljustice.github.io/TotalSMS/
MIT License
23 stars 4 forks source link

Add build for N64 #30

Open networkfusion opened 1 year ago

networkfusion commented 1 year ago

I am (attempting) to create a CI build for the N64.

So far I have:

The aim is to make an emulator that is able to boot ROM's without injecting them for flashcarts such as the SC64 and ED64.

I am currently struggling to boot ROM's from DFS that are either direct (i.e. the .gg extension) or zipped (i.e. the .zip extension and contains a ROM with the .gg extension), however the N64 is able to boot the menu and show that both files exist.

It would be helpful to know (as a starting point) which commit (date) of libdragon was used to create the ROM, and any defines that I am missing.

If I can get the ROM's to work, I will at minimum try to update the ROM to work with the latest versions of libdragon.

ariahiro64 commented 1 year ago

just had a similar issue with sodium and sfc roms. the extensions the everdrive64 can accept is hardcodded.

ITotalJustice commented 1 year ago

I am (attempting) to create a CI build for the N64.

So far I have:

  • tracked down a workable build for libdragon
  • used a homebrew ROM to satisfy dfs
  • got the ROM to boot and display the menu (and contained ROM's).

The aim is to make an emulator that is able to boot ROM's without injecting them for flashcarts such as the SC64 and ED64.

I am currently struggling to boot ROM's from DFS that are either direct (i.e. the .gg extension) or zipped (i.e. the .zip extension and contains a ROM with the .gg extension), however the N64 is able to boot the menu and show that both files exist.

It would be helpful to know (as a starting point) which commit (date) of libdragon was used to create the ROM, and any defines that I am missing.

If I can get the ROM's to work, I will at minimum try to update the ROM to work with the latest versions of libdragon.

Thank you for the pr!

I have fixed the ROM loading bug you mentioned and have also updated the code so that it works with the latest commit of libdragon.

I haven't pushed the changes as there still more code changes that I'd like to make first. Not sure when I'll get around to it however...

If you would like the changes pushed anyway, let me know :)

networkfusion commented 1 year ago

Thanks for the reply,

It would be helpful it you did push your changes to a branch, maybe I can help (saves and all). I am on discord N64Brew.

BTW, most emulators load ROM's from 0x200000 and use SRAM as the save type.

See here for an example: https://github.com/Polprzewodnikowy/N64FlashcartMenu/blob/fc2f3aa42cf750d55075b2e5846ed57e952099c8/src/menu/cart_load.c#L86

Although, that is a decussion topic, rather than this PR.

networkfusion commented 1 year ago

In addition (more on a discussion) to force the savetype as SRAM (which I would suggest is the default save type), you can adjust the header of the ROM for testing: https://n64brew.dev/wiki/ROM_Header in section "Homebrew ROM Header special flags". Also see https://github.com/DragonMinded/libdragon/blob/unstable/tools/ed64romconfig.c

ITotalJustice commented 1 year ago

thanks, i have added rom loading from sdram.

is there a way to detect the size of the rom within sdram?

networkfusion commented 1 year ago

Without seeing the code, it is pretty hard to determine what you mean. Of course, you can use <sys/stat.h> stat or whatever to get a file size from storage if it helps...

ariahiro64 commented 5 months ago

any updates on this