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
Adding CH376 chip emulation for Orix/telemon30 #95
Conversation
machine.c
Outdated
#ifdef WIN32 | ||
case 0x040: | ||
return ch376_oric_read(oric->tele_ch376, addr); | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dead code because of return above
Corrected real ch376 page 3 address in machine.c as Polluks noticed |
plugins/ch376/oric_ch376_plugin.h
Outdated
void ch376_oric_config(struct ch376 *ch376); | ||
void ch376_oric_destroy(struct ch376 *ch376); | ||
|
||
void ch376_oric_reset(struct ch376 *ch376); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EOL
Corrected :) |
|
||
static CH376_BOOL system_init_context(CH376_CONTEXT *context, UNUSED void *user_data) | ||
{ | ||
/* Nothing to do */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need: return CHS376_TRUE;
or ch376_create() will return NULL when compiled on Linux
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
plugins/ch376/ch376.c
Outdated
|
||
static void system_file_close(CH376_CONTEXT *context, CH376_FILE file) | ||
{ | ||
fclose(file); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
must be enclose by:
if (file) { }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
plugins/ch376/ch376.c
Outdated
|
||
static void system_finish_examine_directory(CH376_CONTEXT *context, CH376_DIR fib) | ||
{ | ||
closedir(fib->handle); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
must be enclosed by:
if (fib) { ... }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
machine.c
Outdated
@@ -1091,6 +1114,10 @@ SDL_bool emu_event( SDL_Event *ev, struct machine *oric, SDL_bool *needrender ) | |||
via_init( &oric->via, oric, VIA_MAIN ); | |||
via_init( &oric->tele_via, oric, VIA_TELESTRAT ); | |||
acia_init( &oric->tele_acia, oric ); | |||
#ifdef WIN32 | |||
oric->tele_ch376=ch376_oric_init(); | |||
ch376_oric_config(oric->tele_ch376); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe add a test to check the value of oric->tele_ch376 against NULL in case of memory allocation or context initialization failure in function ch376_create() called by ch376_oric_init()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Original Oric ROMs are not present in the git repository, because ownership and licensing are unclear. I take the risk of including them in the binary releases, but it is not appropriate for them to be in the repo. If the Orix ROM is yours, you are welcome to add it to the repo. |
Please change the "#ifdef WIN32" to a check for "oric->ch376enabled" (or so), and add it as an option to the hardware options menu (and commandline). |
Fix as requests
@pete-gordon I added Orix rom managed in gitignore. |
Yes, that's fine. We can add menu items and command line options later. |
He will try to add menu items. |
Adding ch376 into menu Adding ch376 option in oricutron.cfg Removing some crap comment
Hello, I added ch376 into the menu in hardware section below serial option. ch376 option is also added in .cfg |
What you can do is make it so that if you select "ch376" it automatically switches to telestrat mode. That's what happens when you select other impossible configs, it just switches to the right combination. Do you want to do that on this pull request, or shall I take this one now? |
machine.c
Outdated
if (addr == 0x340 || addr == 0x341) | ||
ch376_oric_write(oric->ch376, addr, data); | ||
} | ||
break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't quite correct. If ch476 is NOT activated, writes to 0x34x do nothing, instead of the normal VIA write.
Please move the 0x40 case to just before the "default:" and only do "break" inside the if(), that way if ch376 is NOT enabled, it'll drop into the default case.
machine.c
Outdated
return ch376_oric_read(oric->ch376, addr); | ||
} | ||
break; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as the comment above.
…st answer instead
hello, for telestrat switch, i prefer to release my card before, and i'll add ch376 for others machines. For the bug noticed, i totally forgot this (VIA6522 answer on the whole page 3 when there is no hardware behind. |
Thanks :-) |
Hello, as explained on defence-force forum, here is the ch376 emulation.
This emulation is for telestrat only, because i did not finished the electronic card for the atmos, but telestrat mode on Oricutron will do the job.
I did some "ifdef WIN32" because i did emulation on windows. For linux, it should work, but someone should test without ifdef. Morphos should work too because emulation works on Morphos, but i did not compile oricutron on Morphos.
Other thing, when you start telestrat, ch376 emulation starts. If it's a problem let me know.
I would like to add telemon3.0 roms and Orix roms, but i don't know where the rom are in this repository. How can i share theses ROMs in oricutron ?
I did a plugins folder because i think that it's better to prepare any plugins management. And it should be clear in this way. Anyway, if it's a problem let me know.
Docs are here : http://orix.oric.org
Usbdrive is the main folder. Emulation will read files in this directory.
If something is wrong let me know :)
I would like to add some binary on usbdrive folder, let me know if it's a problem for you