Skip to content

Commit 09684f9

Browse files
New version 1.5.7
1 parent 16b021e commit 09684f9

File tree

8 files changed

+125
-18
lines changed

8 files changed

+125
-18
lines changed

MCP.pas

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
{$LIBRARYPATH midfile/}
2-
{$LIBRARYPATH units/}
3-
{$LIBRARYPATH includes/}
1+
{$LIBRARYPATH './midfile/'}
2+
{$LIBRARYPATH './units/'}
3+
{$LIBRARYPATH './includes/'}
44
{$DEFINE ROMOFF}
55
Uses
66
MIDFiles,
@@ -9,12 +9,12 @@
99
filestr,
1010
screen,
1111
list,
12-
inputLine;
12+
inputline;
1313
{$I-}
1414

15-
{$i const.inc}
15+
{$i 'const.inc'}
1616

17-
{$r player.rc}
17+
{$r 'player.rc'}
1818

1919
var
2020
_tm:Byte absolute $14;
@@ -51,14 +51,14 @@
5151
counter:Longint absolute $88;
5252
cntBCD:Longint absolute $8c;
5353

54-
{$i myNMI.inc}
55-
{$i status.inc}
56-
{$i load.inc}
57-
{$i list.inc}
58-
{$i getdirectory.inc}
59-
{$i keyboard.inc}
60-
{$i autostop_songchange.inc}
61-
{$i init.inc}
54+
{$i 'myNMI.inc'}
55+
{$i 'status.inc'}
56+
{$i 'load.inc'}
57+
{$i 'list.inc'}
58+
{$i 'getdirectory.inc'}
59+
{$i 'keyboard.inc'}
60+
{$i 'autostop_songchange.inc'}
61+
{$i 'init.inc'}
6262

6363
begin
6464
asm lda PORTB \ pha end;
@@ -83,7 +83,7 @@
8383
processMIDI;
8484
AutoStopAndSongChange;
8585

86-
if _tm-otm>refreshRate then
86+
if {_tm-otm<>0} byte(_tm-otm)>refreshRate then
8787
begin
8888
otm:=_tm;
8989
if screenStatus and ss_isRefresh<>0 then

const.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const
22
{$i memory.inc}
33

4-
VERSION= 'v1.5.6b'~;
4+
VERSION= 'v1.5.7'~;
55
// base memory (under 64KB) available
66
FREE_MEM = ($8000-$4000)+($ff00-$d800);
77

includes/init.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ end;
4242

4343
procedure exit2DOS; keep;
4444
begin
45+
sendClearPushLCD;
46+
4547
unsetNMI;
4648
doneMIDI;
4749
Cls(0); Opn(0,12,0,'E:'); // SOUNDR:=1;

midfile/determine_song_length.inc

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,54 @@
1+
procedure sendPushLCDText; Keep;
2+
const
3+
push_sysex:array[0..7] of byte = (
4+
$f0, $47, $7f, $15, $01, $00, $45, $00
5+
);
6+
7+
begin
8+
asm
9+
event = $ff
10+
11+
sei
12+
jsr $2003
13+
cli
14+
15+
ldx #0
16+
17+
sysex_header_loop:
18+
txa
19+
pha
20+
lda ADR.PUSH_SYSEX,x
21+
sta event
22+
jsr $2006
23+
pla
24+
tax
25+
inx
26+
cpx #8
27+
bne sysex_header_loop
28+
29+
// sysex data loop
30+
jmp checkDataLen
31+
readLoop:
32+
jsr MAIN.MIDFILES.readB
33+
jsr $2006
34+
35+
dec _tmp
36+
37+
checkDataLen:
38+
lda _tmp
39+
bne readLoop
40+
41+
lda #$F7
42+
sta event
43+
jsr $2006
44+
45+
sei
46+
sec ; flush buffer & uninitialize driver
47+
jsr $200c
48+
cli
49+
end;
50+
end;
51+
152
procedure determineSongLength;
253
begin
354
_songTicks:=0; curTrackPtr:=@MIDTracks;
@@ -84,6 +135,22 @@ begin
84135
cmp #$2F ; end of track
85136
beq exitUntil
86137

138+
cmp #$01 ; meta for Text
139+
beq pushText
140+
cmp #$02 ; meta for Copyright
141+
beq pushText
142+
cmp #$03 ; meta for Sequence/Track name
143+
bne endCase
144+
145+
pushText:
146+
// lda cTrk
147+
// cmp #1 ; only for track #1 (0)
148+
// bne endCase
149+
150+
jsr sendPushLCDText
151+
152+
jmp processTrack
153+
87154
endCase:
88155

89156
; end of event cases

midfile/loadmid.inc

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,38 @@
1+
procedure sendClearPushLCD; Keep;
2+
const
3+
push_sysex:array[0..5] of byte = (
4+
$f0, $47, $7f, $15, $00, $F7
5+
);
6+
7+
begin
8+
asm
9+
event = $ff
10+
11+
sei
12+
jsr $2003
13+
cli
14+
15+
ldx #0
16+
17+
sysex_header_loop:
18+
txa
19+
pha
20+
lda ADR.PUSH_SYSEX,x
21+
sta event
22+
jsr $2006
23+
pla
24+
tax
25+
inx
26+
cpx #6
27+
bne sysex_header_loop
28+
29+
sei
30+
sec ; flush buffer & uninitialize driver
31+
jsr $200c
32+
cli
33+
end;
34+
end;
35+
136
function LoadMID:shortint;
237
const
338
LOADBUF_SIZE=16*1024;
@@ -36,6 +71,8 @@ var
3671
end;
3772

3873
begin
74+
sendClearPushLCD;
75+
3976
Opn(CIO_CHN,4,0,fn);
4077
if IOResult>127 then
4178
begin

midfile/midfiles.pas

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ procedure setTempo;
5959
procedure ProcessTrack; Assembler;
6060
procedure ProcessMIDI;
6161
procedure determineSongLength;
62+
procedure sendClearPushLCD; Keep;
6263

6364
implementation
6465
Uses

midfile/processtrack.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
}
44

5-
procedure readB; Inline; Assembler;
5+
procedure readB; Keep; Assembler;
66
asm
77
event = $ff;
88

units/inputline.pas

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
unit inputLine;
1+
unit inputline;
22

33
interface
44

0 commit comments

Comments
 (0)