Network code

Technical discussion for those interested in Supermodel development and Model 3 reverse engineering. Prospective contributors welcome.
Forum rules
Keep it classy!

  • No ROM requests or links.
  • Do not ask to be a play tester.
  • Do not ask about release dates.
  • No drama!

Re: Network code

Postby Ian » Tue Sep 05, 2017 8:56 am

Spindizzi wrote:Hello,
I don't know if it worth it but months ago, I've made a look to hook a network card in supermodel
No success, of course
This is a really early working copy, no more, and given as is. I'm sure of nothing (address mapping, r/w, ...). It's only a test to implant the card, no protocol yet
I've abandonned because I've not enough skill
May be it'll give some ideas for those who have great talent ...
I only work with daytona2 in this test case
you need to launch supermodel with -no-threads switch else there is a melting pot with the 68k cpu soundboard and the 68k cpu netboard registers. This is due to Musashi doesn't not accept multi threaded 68k cpu (see discussion here https://www.supermodel3.com/Forum/viewtopic.php?f=7&t=1363). I've tested thread with the netboard like the soundboard but I had to remove the code because of that
I separate netrom netram, not sure it's correct. And I must say I'm a little lost (commram = netram ?). There are several sections of code (multiple program ?) inside with multiple org (origine)
The 68k network code seems to run. In the debugger, we see it waits for some events and we can poke values to advance in the code (68k and ppc side)
We can easily follow the code with the dump dissassembled in IDA
Also, it crashes when quit, I certainly forgot something (bad pointers, bad memory management....)

https://yadi.sk/d/uK7sIc-B3McD6g

Is Nik's graphical debugger private tool ? Could it help for netboard card or it's just for graphical debug part ?

Is it me, or the forum have no more working certificate ?
++

What's the clock speed of the cpu on the network board? Does it really need to run on it's own thread? I have a copy of Nik's debugger. Pm me and i'll email it to you.
And yes it seems the certificate for the site is expired, which is annoying :)
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: Network code

Postby Spindizzi » Tue Sep 05, 2017 9:24 am

The 68k netboard runs apparently at 12MHz but in my code I give him only 1000 cycles to eat for tests
I don't know if it must be threaded or not. Anyway, if I call the cnetboard::runframe() in the cmodel3::runframe() multithreaded part, I have the mix register/memory with soundboard and network card (first time I saw that, It's fooling me). Same thing happens if the netboard is multithreaded (code removed) or not (actual code)
Spindizzi
 
Posts: 196
Joined: Thu Nov 17, 2016 8:55 am
Location: France

Re: Network code

Postby Bart » Tue Sep 05, 2017 9:49 am

You will probably have to run the network board in the same thread as the audio CPU. Either that, or you'll have to compile in a second instance of Musashi 68K (I think this can be done by having the code generator prefix the symbol names with a new identifier). If you run it in the same thread, you'll have to make sure to switch contexts each time you run the sound CPU and then the network CPU. I think you can see how I do this already with the sound and MPEG 68Ks. They both run in the same thread and require a context save/restore each time.

Sorry I can't be of much assistance lately. I'm busy with that Sept 15 VR show deadline and my health situation has taken a turn for the worse (substantial further degradation in my hearing, out of treatment options, prognosis is permanent loss -- and it's not just a matter of hearing less, but rather, even what I do hear is garbled and distorted, plus a feeling of constant ear pressure, plus extremely loud and non-stop tinnitus, like having an earbud surgically affixed to your left ear playing a 1500 Hz tone 24/7 at conversational volume). Needless to say this has affected my ability to focus on projects.
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: Network code

Postby Ian » Tue Sep 05, 2017 10:04 am

That sucks Bart :(
Hopefully it will get better. Sounds like some kind of infection ?
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: Network code

Postby Bart » Tue Sep 05, 2017 10:35 am

Ian wrote:That sucks Bart :(
Hopefully it will get better. Sounds like some kind of infection ?


That's long been a suspected cause of SSNHL but no medical study has ever been able to isolate a pathogen and anti-viral medications are not clinically helpful. I do think in my case an infection is likely given that the onset was two days after a flight. Very unlikely to be a coincidence. But there was never any visible sign of infection or inflammation, and that has been confirmed with an MRI scan of my head. Could well be some lucky common virus that burrowed itself into the nervous tissue. Unfortunately, once the damage is done, it's done for good.

Interestingly, there was a step function change in the severity and intensity of the tinnitus two days ago when I went for a run in Central Park. The intensity fluctuates but is pretty constant and loud, but I had never yet experienced such a sudden and dramatic increase. Unfortunately, that's not evidence of anything, as tinnitus in general can definitely be affected by all kinds of factors from diet to exercise. Maybe I should go ride roller coasters this week. My sister found an interesting article in a medical journal of a singular case of a girl with almost identical symptoms to mine whose hearing loss cleared up after two months suddenly when she rode a roller coaster. Hers was even associated with an airplane flight but the three factors against me on this one are 1) it's a singular case out of thousands studied, 2) she was 16 (the causes of these things are very different for juveniles vs. adults), and 3) she experienced discomfort and pain during the descent phase of her flight before onset of hearing loss days later. I experienced nothing abnormal during the flight and don't even recall having to pop my ears.
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: Network code

Postby Ian » Tue Sep 05, 2017 11:21 am

Can you pop your inner ear, like when you yawn ?
Ian
 
Posts: 2044
Joined: Tue Feb 23, 2016 9:23 am

Re: Network code

Postby Bart » Tue Sep 05, 2017 11:40 am

Ian wrote:Can you pop your inner ear, like when you yawn ?


Nope. Although it feels like it's plugged it actually is not. They even measured ear pressure and function during the test today. Up until about 24-48 hours ago, trying to exercise those muscles would trigger a sensation of movement or vertigo, as if the ground was shifting below me. Yawning or trying to flex those muscles that open up the eustacian tubes would do it consistently 100% of the time since the first onset of symptoms in July. But that stopped suddenly two evenings ago. I thought this was a good sign initially but it's totally inconclusive. The hearing has gone the other way with across-the-board loss at all frequencies.

People affected with this condition report that this feeling of having one's ears plugged can persist forever and you just get used to it as a new normal.
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

Re: Network code

Postby Boomslangnz » Fri Sep 08, 2017 12:06 am

Ive waited so long for potential Supermodel network :)

I can't help much as I am just a user with no development skills but I do have Scud Race and Daytona USA 2 complete units here so can try to help with photos or send a board etc if needed
Boomslangnz
 
Posts: 141
Joined: Mon Jul 23, 2012 10:35 pm

Re: Network code

Postby SailorSat » Fri Sep 08, 2017 2:38 am

My findings so far...

Code: Select all
0xc0000000 to 0xc000ffff   - shared mem
0xc0010000 to 0xc00101ff   - registers/control mem
0xc0020000 to 0xc003ffff   - mc68000 ram

0xc0010000 - master/slave/relay register? (master modes writes 0, slave mode writes 1)
0xc0010110 - ?? register (maybe FG)
0xc0010114 - ?? register (code seems to check if value matches the previous register)
0xc0010180 - CN register (pretty sure)


Code: Select all
wr c0010180 0         ; disable comm board
<memory test from c0000000 to c000ffff>

wr c0020000 0...
code upload 68k?

wr c0020800 0
wr c0020804 20000
wr c0020808 10000

wr c0020800 0
wr c0020804 f03e0000
wr c0020808 50030000

wr c0010180 0         ; disable comm board
wr c0010110 800000      ; flip pages?
wr c0010110 800000      ; flip pages?
wr c0010180 ffffffff      ; enable comm board

rd c0010110 ...
@fe1c   r10 = c0010000
@fe20   r10 = r10 + 0110
@fe24   b fe30         ; goto?
@fe30   r3 = [r10]      ; read from c0010110
@fe34   r0 = r3 AND 8000000
@fe38   bne fe30      ; loop while bit 31 is set
@fe40   blr         ; return?

@15ce0   bl fe1c
@15ce4   r0 = r3 AND 8000
@15ce8   bne 15ce0      ; loop while bit 15 is set

(at this point I cheated and set r3 to 0)

wr c0010110 b00000
wr c0010110 b00000

rd c0010000

wr c0010000 0

rd c0010110 .. (@fe30 again)

...

rd c0010114 .. (@fe30)
@99a00   r28 = r3 AND ffff
@00a04   rlwinm r30, r28, 19, 7   ; ????

...

wr c00000fc 0
   ...
wr c0000e38 0

rd c0010110 ...
rd c0010114 ...
SailorSat
 
Posts: 33
Joined: Mon Jun 06, 2016 4:26 am

Re: Network code

Postby Bart » Fri Sep 08, 2017 9:06 am

Thanks, Sailor Sat! How did you get this information? Are you using MAME or Supermodel? I think what Nik did is actually disassemble the 68K program and look at it carefully. He did not translate all of it but eventually figured out where the PowerPC was writing and reading data in the shared memory space, and was able to deduce that there was some sort of a simple buffer being sent in a relatively synchronous fashion. I'm not sure how complex the 68K code is but it might be possible to just disassemble the whole thing either with IDA (which I don't have) or manually (laborious but within the realm of possibility if it isn't too large).

I know that when the program is transferred by the PowerPC, it will appear a bit mangled. I think it transfers 32-bit words, with half of the word being empty or something like that, and then a word swap needs to be done. Should be easy to dump the program once it's been uploaded.
User avatar
Bart
Site Admin
 
Posts: 3086
Joined: Thu Sep 01, 2011 2:13 pm
Location: Reno, Nevada

PreviousNext

Return to The Dark Room

Who is online

Users browsing this forum: No registered users and 1 guest

cron