It is currently Mon Oct 15, 2018 3:14 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 83 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
PostPosted: Sat May 27, 2017 8:36 am 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 817
Location: New York, NY
jblazing wrote:
I'm gonna post to hope and see if the dev even sees this.

A problem that I seem to be having is with the C api. Whenever I try to run getPixels(api,pixels) in the FrameListener, once the function escapes the program will segfault. I made sure to make the array size is 256 * 240, I have tried both dynamically allocated memory and array on the stack, both cause a segfault.

I am using the latest versions of both the api and the emulator from 5/1/17 .

Code: https://pastebin.com/mUgsjDQu


The getPixels bug has been fixed. The updated version of nintaco.c has been zipped up here.


Top
 Profile  
 
PostPosted: Sun Aug 20, 2017 4:38 pm 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 817
Location: New York, NY
I posted a new build containing a small round of patches.


Top
 Profile  
 
PostPosted: Sun Oct 15, 2017 2:30 pm 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 817
Location: New York, NY
I posted a new build with another round of bug fixes including some light gun related patches. A test program I wrote to evaluate those changes evolved into this small fun project.


Top
 Profile  
 
PostPosted: Thu Oct 19, 2017 2:13 pm 
Offline
User avatar

Joined: Thu Oct 19, 2017 1:31 pm
Posts: 2
Tis FIRE!!! I like playing with your software. I have started learning Java just for it. Now i'm trying to make remote graphic interface. It requires using setGamepad() function. But when i try to use it from simple loop within interface Nintaco freezes. When i try to call it from some method that uses ControllersListener interface like controllersProbed() without the loop it works, but I loose sweet input data. And parameters don't seem to work...


Attachments:
buttonmash.rar [4.93 KiB]
Downloaded 106 times
Top
 Profile  
 
PostPosted: Thu Oct 19, 2017 8:38 pm 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 817
Location: New York, NY
Yodak wrote:
Tis FIRE!!! I like playing with your software. I have started learning Java just for it. Now i'm trying to make remote graphic interface. It requires using setGamepad() function. But when i try to use it from simple loop within interface Nintaco freezes. When i try to call it from some method that uses ControllersListener interface like controllersProbed() without the loop it works, but I loose sweet input data. And parameters don't seem to work...


Store the inputs in class variables. When controllersProbed() is called, invoke writeGamepad() with parameters based on the inputs stored in the class variables.


Top
 Profile  
 
PostPosted: Sun Oct 22, 2017 12:19 pm 
Offline
User avatar

Joined: Thu Oct 19, 2017 1:31 pm
Posts: 2
Thank you very much!:mrgreen: That was so simple! I wasted so much time trying to figure it out. Though now it's pure fun and awesomeNESs!!!


Top
 Profile  
 
PostPosted: Thu Oct 26, 2017 9:19 am 
Offline

Joined: Thu Oct 26, 2017 9:14 am
Posts: 1
Has anyone had success running Nintaco on a Raspberry Pi? The program loads on my Pi 3, but I get a black screen upon loading any ROM. I haven't looked for any logs or ways to track errors yet, but I'll look into that later tonight. But in the meantime, does anyone have any tricks for successful Nintacoing on a Raspberry Pi?


Top
 Profile  
 
PostPosted: Mon Oct 30, 2017 9:44 am 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 817
Location: New York, NY
radishes wrote:
Has anyone had success running Nintaco on a Raspberry Pi? The program loads on my Pi 3, but I get a black screen upon loading any ROM. I haven't looked for any logs or ways to track errors yet, but I'll look into that later tonight. But in the meantime, does anyone have any tricks for successful Nintacoing on a Raspberry Pi?


Anything in the log file within the /system subdir?


Top
 Profile  
 
PostPosted: Sun Aug 26, 2018 10:14 am 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 817
Location: New York, NY
I just added Miracle Piano support to Nintaco. Here are some details on how to use it for those interested. As mentioned on that link, it maps piano keys to keyboard keys (by default) and it maps the Miracle patches to General MIDI instruments. Unfortunately, both of these have issues: rollover limitations and MIDI lag, respectively. But it's still fun nonetheless.

My implementation is based on NoCash's NES doc and the protocol details in the Miracle Piano manuals. However, NoCash failed to document something important regarding this MIDI message:

Code:
  Note on/off command       R/W  9#h,<key>,<velo>


A chain of note on/off messages directed to the same channel can be achieved in 2 ways:

Code:
90 24 80 90 25 80 90 26 80
90 24 80 25 80 26 80


Both of those sequences are equivalent. They both turn on 3 notes (24, 25 and 26) on channel 0 with velocity 80. However, 90 (note on, channel 0) only appears once at the start of the chain in the second case. Chaining note on/off messages like that reduces reduces the amount of data that the NES sends to the keyboard and it's a feature used in the intro music. It's surprising that neither NoCash nor the Miracle manual mentioned this aspect of the protocol.


Top
 Profile  
 
PostPosted: Sun Aug 26, 2018 10:38 am 
Offline

Joined: Sun Apr 13, 2008 11:12 am
Posts: 7648
Location: Seattle
zeroone wrote:
Chaining note on/off messages like that reduces reduces the amount of data that the NES sends to the keyboard and it's a feature used in the intro music. It's surprising that neither NoCash nor the Miracle manual mentioned this aspect of the protocol.
Not that this helps you now but some number of years ago I was building an esoteric MIDI instrument and got stung by this abbreviated encoding.

Not that it was hard to fix, but required that I know it.


Top
 Profile  
 
PostPosted: Sun Aug 26, 2018 11:02 am 
Offline

Joined: Thu May 19, 2005 11:30 am
Posts: 672
That feature is called Running Status and applies to any MIDI message, not just Note On messages. Any time a message's status byte is identical to the previous message's status byte, it can be omitted. System Exclusive messages ($F0 and $F7) cancel the previous status byte, while System Realtime messages (status byte $F8 and above) are exempt and continue the previous status byte. The MIDI Implementation of the Miracle manual probably did not mention this because they considered it common knowledge among people familiar with MIDI. 8-)

Edit:
Code:
90 24 80 90 25 80 90 26 80
90 24 80 25 80 26 80
Velocity can only go up to 7F. If the Miracle Piano really transmits this, then it's transmitting invalid MIDI data, because the 80 could be interpreted as another status byte (of a dedicated NoteOff message, $8x kk vv).

Edit 2: Corrected System Exclusive/System Realtime statement, added link.


Top
 Profile  
 
PostPosted: Sun Aug 26, 2018 11:58 am 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 817
Location: New York, NY
NewRisingSun wrote:
Velocity can only go up to 7F. If the Miracle Piano really transmits this, then it's transmitting invalid MIDI data, because the 80 could be interpreted as another status byte (of a dedicated NoteOff message, $8x kk vv).


You are correct. The Miracle does not transmit velocities greater than $7F. The example that I posted contained contrived numbers invented on the fly; I failed to keep the value within the proper range.

NewRisingSun wrote:
That feature is called Running Status and applies to any MIDI message, not just Note On messages. Any time a message's status byte is identical to the previous message's status byte, it can be omitted. System Exclusive messages ($F0 and $F7) cancel the previous status byte, while System Realtime messages (status byte $F8 and above) are exempt and continue the previous status byte. The MIDI Implementation of the Miracle manual probably did not mention this because they considered it common knowledge among people familiar with MIDI.


Thanks for that link. It shows a much clearer example of what I was trying to convey.

I should have studied the MIDI protocol. I only applied "running status" to $8x and $9x messages. But given the subset of MIDI in NoCash's spec, that is probably sufficient. NoCash's spec also includes messages that he marked as "unknown" that I encountered during testing. If those are in the MIDI spec anywhere, please point me in that direction.


Top
 Profile  
 
PostPosted: Sun Aug 26, 2018 12:45 pm 
Offline

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 20656
Location: NE Indiana, USA (NTSC)
These MIDI messages also use running status, but I don't know which the Miracle keyboard can generate:

Pressure (An kk pp)
Effect (Bn cc vv)
Instrument (Cn ii)
Pressure all notes (Dn pp)
Pitch bend (En ll hh)

Source: List of MIDI messages from MIDI Manufacturers Association


Top
 Profile  
 
PostPosted: Sun Aug 26, 2018 12:50 pm 
Offline

Joined: Thu May 19, 2005 11:30 am
Posts: 672
Except for FF, the unknown messages are System Exclusive messages, which any manufacturer can define himself and are therefore not part of the MIDI Specification. So if the manual does not explain them, one is generally out of luck.


Top
 Profile  
 
PostPosted: Sun Aug 26, 2018 3:41 pm 
Offline
User avatar

Joined: Mon Dec 29, 2014 1:46 pm
Posts: 817
Location: New York, NY
tepples wrote:
These MIDI messages also use running status, but I don't know which the Miracle keyboard can generate:

Pressure (An kk pp)
Effect (Bn cc vv)
Instrument (Cn ii)
Pressure all notes (Dn pp)
Pitch bend (En ll hh)

Source: List of MIDI messages from MIDI Manufacturers Association


Regarding "running status", it's only relevant to what the NES transmits to the Keyboard. From the aforementioned sources, that includes message types $8x, $9x, $Bx, $Cx, and $Fx. From NewRisingSun's link, $Fx is a real-time status message that can even appear inside another message! I have yet to encounter that and hopefully the NES doesn't generate such messages. Also, "running status" does not apply to $Fx messages per that link. As mentioned, I think I have $8x and $9x covered. As for $Bx and $Cx, if you look at the effect of those messages, it seems unlikely that you would need "running status". I.e., set main volume, sustain/dampen an entire channel, enable/disable the keyboard, silence a channel, etc. These are things you rarely want to use in succession and I didn't encounter that during testing. Long story short, I think I implemented just enough MIDI to communicate with the emulated Miracle software.

----------------------------------------

On a slightly different topic, the Miracle Keyboard is limited to 8 channels. But, in one of those proprietary $Fx messages, there is a way to split the keyboard in half. The keys below middle-C assume one instrument and the remaining keys above assume a different instrument. The teaching system usually only does this at the end of a lesson when you do the virtual performance. Each hand plays with a different instrument, which is fun (at least on real hardware). The human normally plays on channel 0. But during a split, I suspect both channels 0 and 8 are used. Or, more generally, x and x + 8. Meaning, the Keyboard might effectively be able to use all 16 channel. NoCash mentioned something about the SNES version initializing 16 channels. I don't know if there is a connection, but I thought I'd mention all this anyway.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 83 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: Tomy and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group