Skip to content

Commit 7e7dabc

Browse files
committed
BUG #67 Copy patterns
1 parent 771472b commit 7e7dabc

File tree

4 files changed

+61
-96
lines changed

4 files changed

+61
-96
lines changed

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,8 @@ On second-generation or higher MSX computers, an enhanced palette is used.
5757

5858
## Acknowledgments
5959

60-
* **Kun/Paxanga Soft** - Second place in the Experimental Sound Minicompo with his application Noise Raiser. http://paxangasoft.retroinvaders.com/
61-
* **Hap** - Third place in the Experimental Sound Minicompo with his application VDP Music.
60+
* **Kun/Paxanga Soft** - Participant in the Experimental Sound Minicompo with his application Noise Raiser. http://paxangasoft.retroinvaders.com/
61+
* **Hap** - Participant in the Experimental Sound Minicompo with his application VDP Music.
6262
* **Fubukimaru** for betatesting
6363
* **Karoshi MSX Community** (RIP 2007-2020)
6464

@@ -120,18 +120,21 @@ List of controls:
120120

121121
Using keyboard shortcuts you can operate many of the controls in the control area, except those related to the wave envelope, but add controls that affect playback, such as those that limit the size of the pattern.
122122

123+
**Cursor keys and Joystick A or B:**
123124
* [Up] Menu cursor up
124125
* [Down] Menu cursor down
125126
* [Left] Switch left or decrease value
126127
* [Right] Switch right or increase value
127128
* [SPACE] or Joystick Button - Actuate the random buttons or the switchers
129+
130+
**Keyboard:**
128131
* [RETURN] It goes into Play mode and moves to the first step of the sequence
129132
* [STOP] Stop pattern playback
130133
* [F1] Rhythm channel On/Off
131134
* [F2] Melody channel On/Off
132-
* [TAB] Random Rhythm & Melody patterns
133-
* [CTRL] Random Rhythm pattern
134-
* [SHIFT] Random Melody pattern
135+
* [TAB] Generate random Rhythm and Melody patterns
136+
* [CTRL] Generate random Rhythm pattern
137+
* [SHIFT] Generate random Melody pattern
135138
* [1] Loop first 2 steps
136139
* [2] Loop first 4 steps
137140
* [3] Loop first 8 steps

bin/TARP1.ROM

0 Bytes
Binary file not shown.

docs/TARP.README.TXT

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ On second-generation or higher MSX computers, an enhanced palette is used.
4646
--------------------------------------------------------------------------------
4747
4 Acknowledgments
4848

49-
- Kun/Paxanga Soft - Second place in the Experimental Sound Minicompo with his
49+
- Kun/Paxanga Soft - Participant in the Experimental Sound Minicompo with his
5050
application Noise Raiser. http://paxangasoft.retroinvaders.com/
51-
- Hap - Third place in the Experimental Sound Minicompo with his application
51+
- Hap - Participant in the Experimental Sound Minicompo with his application
5252
VDP Music.
5353
- Fubukimaru for betatesting
5454
- Karoshi MSX Community (RIP 2007-2020)
@@ -135,18 +135,21 @@ Using keyboard shortcuts you can operate many of the controls in the control
135135
area, except those related to the wave envelope, but add controls that affect
136136
playback, such as those that limit the size of the pattern.
137137

138-
- [Up] Menu cursor up
139-
- [Down] Menu cursor down
140-
- [Left] Switch left or value down
141-
- [Right] Switch right or value up
142-
- [SPACE] or Joystick Button - Actuate the random buttons or the switchers
138+
Cursor keys and Joystick A or B:
139+
- [UP] Menu cursor up
140+
- [DOWN] Menu cursor down
141+
- [LEFT] Switch left or value down
142+
- [RIGHT] Switch right or value up
143+
- [SPACE] or [Joy button] - Actuate the random buttons or the switchers.
144+
145+
Keyboard:
143146
- [RETURN] It goes into Play mode and moves to the first step of the sequence
144147
- [STOP] Stop pattern playback
145148
- [F1] Rhythm channel On/Off
146149
- [F2] Melody channel On/Off
147-
- [TAB] Random Rhythm & Melody patterns
148-
- [CTRL] Random Rhythm pattern
149-
- [SHIFT] Random Melody pattern
150+
- [TAB] Generate random Rhythm & Melody patterns
151+
- [CTRL] Generate random Rhythm pattern
152+
- [SHIFT] Generate random Melody pattern
150153
- [1] Loop first 2 steps
151154
- [2] Loop first 4 steps
152155
- [3] Loop first 8 steps

sources/tarp.c

Lines changed: 40 additions & 81 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
#define GUI_SWITCHER_ON 221
4444
#define GUI_SWITCHER_OFF 222
4545

46-
#define GUI_CASIO_VADDR 0x1949
46+
#define GUI_DKIT_VADDR 0x1949
4747
#define GUI_ABMIX_VADDR 0x19C9
4848
#define GUI_ENVLOOP_VADDR 0x1A29
4949

@@ -105,7 +105,6 @@ typedef struct {
105105

106106
boolean isLoop;
107107
char ampValues[16];
108-
//char length;
109108

110109
} Envelope;
111110

@@ -291,11 +290,6 @@ char _transpose;
291290
boolean _ToneEnabled; //_ToneEnabled
292291
boolean _DrumEnabled; //_DrumEnabled
293292

294-
//boolean _AB_MIX;
295-
//char _AB_offset;
296-
297-
//char _env_index;
298-
//char _env_speed;
299293
char _env_step;
300294

301295
char _toneAmp;
@@ -313,12 +307,6 @@ PATTERN *_pattern;
313307
PATTERN patternA;
314308
PATTERN patternB;
315309

316-
//char drum_pattern[16];
317-
//char tone_pattern[16]; //={46,0,49,0,50,0,51,0,46,0,49,0,50,0,51,0};
318-
319-
//char prev_octave;
320-
//char prev_drum_pattern[16]; // #9
321-
//char prev_tone_pattern[16];
322310

323311
Envelope envelope_list[8];
324312

@@ -327,7 +315,8 @@ char SEED;
327315

328316
signed char _cursor_pos;
329317

330-
boolean _isCasio;
318+
char _isDrumKitB;
319+
331320

332321
// -----------------------------------------------------------------------------
333322
#define HELP_WIDTH 29
@@ -343,7 +332,7 @@ void main(void) {
343332

344333
checkMSX();
345334

346-
_playPatternNumber = 0;
335+
_playPatternNumber = PATTERN_A;
347336

348337
COLOR(15,1,1);
349338
SCREEN(2);
@@ -487,9 +476,9 @@ void WorkWin()
487476
_playerHardware=0; //select internal AY
488477
_playerStatus=PLAYER_STOP;
489478

490-
_isCasio = false;
479+
_isDrumKitB = false;
491480

492-
SetDrumKit(_isCasio);
481+
SetDrumKit(_isDrumKitB);
493482

494483
PlayerInit();
495484

@@ -601,9 +590,9 @@ void WorkWin()
601590
VPrintNum(GUI_TEMPO_VADDR, _songSpeed, 1);
602591
break;
603592
case 8: //Drum KIT Switcher
604-
_isCasio=true;
605-
SetDrumKit(_isCasio);
606-
switcher(GUI_CASIO_VADDR,true);
593+
_isDrumKitB=true;
594+
SetDrumKit(_isDrumKitB);
595+
switcher(GUI_DKIT_VADDR,true);
607596
break;
608597
case 11: //A+B
609598
_pattern->AB_MIX=true;
@@ -643,9 +632,9 @@ void WorkWin()
643632
VPrintNum(GUI_TEMPO_VADDR, _songSpeed, 1);
644633
break;
645634
case 8:
646-
_isCasio=false;
647-
SetDrumKit(_isCasio);
648-
switcher(GUI_CASIO_VADDR,false);
635+
_isDrumKitB=false;
636+
SetDrumKit(_isDrumKitB);
637+
switcher(GUI_DKIT_VADDR,false);
649638
break;
650639
case 11:
651640
_pattern->AB_MIX=false;
@@ -715,9 +704,9 @@ void WorkWin()
715704
genDrumPattern();
716705
break;
717706
case 8:
718-
_isCasio=!_isCasio;
719-
SetDrumKit(_isCasio);
720-
switcher(GUI_CASIO_VADDR,_isCasio);
707+
_isDrumKitB= !_isDrumKitB;
708+
SetDrumKit(_isDrumKitB);
709+
switcher(GUI_DKIT_VADDR,_isDrumKitB);
721710
break;
722711
case 9: //Melody channel On/Off
723712
invertToneChannel();
@@ -838,9 +827,9 @@ void WorkWin()
838827
}; // BS
839828
if (!(keyPressed&Bit6))
840829
{
841-
_isCasio=!_isCasio;
842-
SetDrumKit(_isCasio);
843-
switcher(GUI_CASIO_VADDR,_isCasio);
830+
_isDrumKitB= !_isDrumKitB;
831+
SetDrumKit(_isDrumKitB);
832+
switcher(GUI_DKIT_VADDR,_isDrumKitB);
844833
keyB7pressed=true;
845834
}; // SELECT
846835
if (!(keyPressed&Bit7)) {Play();keyB7pressed=true;}; // RETURN
@@ -1000,15 +989,8 @@ void initGUI()
1000989
showSpeaker(GUI_DRUM_VADDR,_DrumEnabled);
1001990
showSpeaker(GUI_TONE_VADDR,_ToneEnabled);
1002991

1003-
switcher(GUI_CASIO_VADDR,_isCasio);
1004-
1005-
//switcher(GUI_ABMIX_VADDR,_pattern->AB_MIX);
1006-
//VPrintNum(GUI_OFFS_VADDR,_pattern->AB_offset, 3);
992+
switcher(GUI_DKIT_VADDR,_isDrumKitB);
1007993

1008-
//showEnv(_env_index);
1009-
//VPrintNum(GUI_WSPEED_VADDR, _env_speed, 1);
1010-
//switcher(GUI_ENVLOOP_VADDR,envelope_list[_env_index].isLoop);
1011-
1012994
ShowPattern();
1013995

1014996
VPOKE(vaddr_cursor[_cursor_pos],GUI_CURSOR);
@@ -1122,11 +1104,8 @@ void initPatternsData()
11221104
{
11231105
char i;
11241106

1125-
//char pattern[16]={1,0,3,3,0,0,3,3,1,0,3,3,0,0,3,3};
11261107
//char pattern[16]={1,0,3,0,2,0,2,0,1,0,3,0,2,0,3,0}; //rock1
1127-
1128-
//_pattern = (PATTERN *) patternA;
1129-
1108+
11301109
patternA.octave = 1;
11311110
patternA.transpose = 12;
11321111
patternA.AB_MIX = true;
@@ -1140,12 +1119,7 @@ void initPatternsData()
11401119
patternB.Envelope = 0;
11411120

11421121
for(i=0;i<16;i++)
1143-
{
1144-
//drum_pattern[i]=0;
1145-
//tone_pattern[i]=0;
1146-
//prev_drum_pattern[i]=0;
1147-
//prev_tone_pattern[i]=0;
1148-
1122+
{
11491123
patternA.drum[i]=0;
11501124
patternA.tone[i]=0;
11511125

@@ -1193,23 +1167,13 @@ void PlayerDecode()
11931167
{
11941168
_songSpeedStep=0;
11951169

1196-
/* cursor de patron
1197-
VPOKE(0x1AAE+last_step,239); //borra la ultima posicion
1198-
VPOKE(0x1AAE+pattern_step,185); //muestra el cursor
1199-
last_step = pattern_step;
1200-
*/
1201-
1202-
12031170
// control de la percusion
12041171
if(_DrumEnabled==true)
12051172
{
12061173
drum_type = _pattern->drum[_pattern_step];
12071174

12081175
if(drum_type>0) //0 = there is no drum
12091176
{
1210-
//if(_isCasio==true) _tmp_INST= &Percu_casio[drum_type-1];
1211-
//else _tmp_INST= &Percu_basic[drum_type-1];
1212-
12131177
_Drum=&_DrumKit[drum_type-1];
12141178

12151179
SetMixer(2,_Drum->isTone,_Drum->isNoise);
@@ -1234,8 +1198,6 @@ void PlayerDecode()
12341198
{
12351199
freqA = getFreq(tone_note+(_pattern->octave*12)); //+ variacion;
12361200
freqB = freqA + _pattern->AB_offset;
1237-
//VPrintNumber(20,0, tone_note, 3); // TEST ##########################
1238-
//VPrintNumber(24,0, freq1, 5);
12391201

12401202
AYREGS[0] = freqA & 0xFF;
12411203
AYREGS[1] = (freqA & 0xFF00)/255;
@@ -1339,7 +1301,6 @@ __asm
13391301
inc C
13401302
out (C),A
13411303

1342-
;xor A
13431304
ld (HL),#0
13441305

13451306
ret
@@ -1372,7 +1333,6 @@ void SetMixer(char NumChannel, boolean isTone, boolean isNoise)
13721333
if(isTone==true){newValue&=251;}else{newValue|=4;}
13731334
if(isNoise==true){newValue&=223;}else{newValue|=32;}
13741335
}
1375-
//sound_set(7,newValue);
13761336
AYREGS[7] = newValue;
13771337
}
13781338

@@ -1527,7 +1487,7 @@ void ChangePattern()
15271487
{
15281488

15291489
_playPatternNumber++;
1530-
if (_playPatternNumber>1) _playPatternNumber=0;
1490+
if (_playPatternNumber>PATTERN_B) _playPatternNumber=PATTERN_A;
15311491

15321492
SetPattern(_playPatternNumber);
15331493
}
@@ -1550,10 +1510,9 @@ void CopyPattern()
15501510
char i;
15511511
PATTERN *_destination;
15521512

1553-
if (_playPatternNumber) _destination = (PATTERN *) patternB;
1513+
if (_playPatternNumber==PATTERN_A) _destination = (PATTERN *) patternB;
15541514
else _destination = (PATTERN *) patternA;
1555-
1556-
1515+
15571516
for(i=0;i<16;i++){
15581517
_destination->drum[i]=_pattern->drum[i];
15591518
_destination->tone[i]=_pattern->tone[i];
@@ -1919,26 +1878,26 @@ __asm
19191878
ld D,7(ix)
19201879

19211880
ld BC,#-10000
1922-
call $Num1
1923-
ld BC,#-1000
1924-
call $Num1
1925-
ld BC,#-100
1926-
call $Num1
1927-
ld C,#-10
1928-
call $Num1
1929-
ld C,B
1930-
call $Num1
1881+
call $Num1
1882+
ld BC,#-1000
1883+
call $Num1
1884+
ld BC,#-100
1885+
call $Num1
1886+
ld C,#-10
1887+
call $Num1
1888+
ld C,B
1889+
call $Num1
19311890
jr $Num3
19321891
$Num1:
19331892
ld A,#-1 ;ASCII-1 47
19341893
$Num2:
1935-
inc A
1936-
add HL,BC
1937-
jr C,$Num2
1938-
sbc HL,BC
1939-
ld (DE),A
1940-
inc DE
1941-
ret
1894+
inc A
1895+
add HL,BC
1896+
jr C,$Num2
1897+
sbc HL,BC
1898+
ld (DE),A
1899+
inc DE
1900+
ret
19421901
$Num3:
19431902
;END
19441903
pop IX

0 commit comments

Comments
 (0)