Namco 163 refinements
This commit is contained in:
		
							parent
							
								
									c4fc797578
								
							
						
					
					
						commit
						075f758e4d
					
				|  | @ -29,6 +29,7 @@ furthermore, an `or reserved` indicates this field is always present, but is res | |||
| 
 | ||||
| the format versions are: | ||||
| 
 | ||||
| - 73: Furnace dev73 | ||||
| - 72: Furnace dev72 | ||||
| - 71: Furnace dev71 | ||||
| - 70: Furnace dev70 | ||||
|  | @ -515,6 +516,14 @@ size | description | |||
|      | - 480 bytes | ||||
|  2?? | note sample × 120 | ||||
|      | - 240 bytes | ||||
|  --- | **Namco 163 data** (>=73) | ||||
|   4  | initial waveform | ||||
|   1  | wave position | ||||
|   1  | wave length | ||||
|   1  | wave mode: | ||||
|      | - bit 1: update on change | ||||
|      | - bit 0: load on playback | ||||
|   1  | reserved | ||||
| ``` | ||||
| 
 | ||||
| # wavetable | ||||
|  |  | |||
|  | @ -42,8 +42,8 @@ | |||
| #define BUSY_BEGIN_SOFT softLocked=true; isBusy.lock(); | ||||
| #define BUSY_END isBusy.unlock(); softLocked=false; | ||||
| 
 | ||||
| #define DIV_VERSION "dev72" | ||||
| #define DIV_ENGINE_VERSION 72 | ||||
| #define DIV_VERSION "dev73" | ||||
| #define DIV_ENGINE_VERSION 73 | ||||
| 
 | ||||
| // for imports
 | ||||
| #define DIV_VERSION_MOD 0xff01 | ||||
|  |  | |||
|  | @ -387,6 +387,11 @@ void DivInstrument::putInsData(SafeWriter* w) { | |||
|   } | ||||
| 
 | ||||
|   // N163
 | ||||
|   w->writeI(n163.wave); | ||||
|   w->writeC(n163.wavePos); | ||||
|   w->writeC(n163.waveLen); | ||||
|   w->writeC(n163.waveMode); | ||||
|   w->writeC(0); // reserved
 | ||||
| } | ||||
| 
 | ||||
| DivDataErrors DivInstrument::readInsData(SafeReader& reader, short version) { | ||||
|  | @ -743,6 +748,13 @@ DivDataErrors DivInstrument::readInsData(SafeReader& reader, short version) { | |||
|   } | ||||
| 
 | ||||
|   // N163
 | ||||
|   if (version>=73) { | ||||
|     n163.wave=reader.readI(); | ||||
|     n163.wavePos=(unsigned char)reader.readC(); | ||||
|     n163.waveLen=(unsigned char)reader.readC(); | ||||
|     n163.waveMode=(unsigned char)reader.readC(); | ||||
|     reader.readC(); // reserved
 | ||||
|   } | ||||
|   return DIV_DATA_SUCCESS; | ||||
| } | ||||
| 
 | ||||
|  |  | |||
|  | @ -392,8 +392,8 @@ struct DivInstrumentN163 { | |||
|   DivInstrumentN163(): | ||||
|     wave(-1), | ||||
|     wavePos(0), | ||||
|     waveLen(0), | ||||
|     waveMode(0) {} | ||||
|     waveLen(32), | ||||
|     waveMode(3) {} | ||||
| }; | ||||
| 
 | ||||
| struct DivInstrument { | ||||
|  |  | |||
|  | @ -34,7 +34,7 @@ | |||
|     rWriteMask(0x78-(c<<3)+(a&7),v,m) \ | ||||
|   } | ||||
| 
 | ||||
| #define CHIP_FREQBASE (15*65536) | ||||
| #define CHIP_FREQBASE (15*32768) | ||||
| 
 | ||||
| const char* regCheatSheetN163[]={ | ||||
|   "FreqL7", "40", | ||||
|  |  | |||
|  | @ -2043,19 +2043,16 @@ void FurnaceGUI::drawInsEdit() { | |||
|           } | ||||
|           ImGui::EndTabItem(); | ||||
|         } | ||||
|         if (ins->type==DIV_INS_N163) if (ImGui::BeginTabItem("N163")) { | ||||
|           ImGui::Text("Initial waveform"); | ||||
|           if (ImGui::InputInt("##WAVE",&ins->n163.wave,1,10)) { PARAMETER | ||||
|         if (ins->type==DIV_INS_N163) if (ImGui::BeginTabItem("Namco 163")) { | ||||
|           if (ImGui::InputInt("Waveform##WAVE",&ins->n163.wave,1,10)) { PARAMETER | ||||
|             if (ins->n163.wave<0) ins->n163.wave=0; | ||||
|             if (ins->n163.wave>=e->song.waveLen) ins->n163.wave=e->song.waveLen-1; | ||||
|           } | ||||
|           ImGui::Text("Initial waveform position in RAM"); | ||||
|           if (ImGui::InputInt("##WAVEPOS",&ins->n163.wavePos,1,16)) { PARAMETER | ||||
|           if (ImGui::InputInt("Offset##WAVEPOS",&ins->n163.wavePos,1,16)) { PARAMETER | ||||
|             if (ins->n163.wavePos<0) ins->n163.wavePos=0; | ||||
|             if (ins->n163.wavePos>255) ins->n163.wavePos=255; | ||||
|           } | ||||
|           ImGui::Text("Initial waveform length in RAM"); | ||||
|           if (ImGui::InputInt("##WAVELEN",&ins->n163.waveLen,4,16)) { PARAMETER | ||||
|           if (ImGui::InputInt("Length##WAVELEN",&ins->n163.waveLen,4,16)) { PARAMETER | ||||
|             if (ins->n163.waveLen<0) ins->n163.waveLen=0; | ||||
|             if (ins->n163.waveLen>252) ins->n163.waveLen=252; | ||||
|             ins->n163.waveLen&=0xfc; | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue
	
	 tildearrow
						tildearrow