;LAST UPDATE: 14.06.2013 savelij
GSRomBaseL EQU 0X0000
GSRomBaseH EQU 0XC000
BTICK EQU 750
DAC0 EQU 0X6000
DAC1 EQU 0X6100
DAC2 EQU 0X6200
DAC3 EQU 0X6300
;VOL0 EQU 0X06
;VOL1 EQU 0X07
;VOL2 EQU 0X08
;VOL3 EQU 0X09
;FLAGS EQU 0X04
;OUTRG EQU 0X03
;DATRG EQU 0X02
;COMRG EQU 0X01
;RSCOM EQU 0X05
;PAGE EQU 0X00
CHSTAT EQU 0X00
CHFLAGS EQU 0X01
CHCURL EQU 0X02
CHCURH EQU 0X03
CHCURP EQU 0X04
CHENDL EQU 0X05
CHENDH EQU 0X06
CHENDP EQU 0X07
CHLPBL EQU 0X08
CHLPBH EQU 0X09
CHLPBP EQU 0X0A
CHLPEL EQU 0X0B
CHLPEH EQU 0X0C
CHLPEP EQU 0X0D
CHCNTL EQU 0X0E
CHCNTH EQU 0X0F
CHFRQL EQU 0X10
CHFRQH EQU 0X11
CHPERL EQU 0X12
CHPERH EQU 0X13
CHREAL EQU 0X14
CHFINE EQU 0X15
CHRLNT EQU 0X16
CHPAN EQU 0X17
CHEPAN EQU 0X18
CHVOL EQU 0X19
CHMVOL EQU 0X1A
CHEVOL EQU 0X1B
CHFVOL EQU 0X1C
CHDELVL EQU 0X1D
CHDELVH EQU 0X1E
CHDELSL EQU 0X1F
CHDELSH EQU 0X20
CHFADVL EQU 0X21
CHFADVH EQU 0X22
CHFADSL EQU 0X23
CHFADSH EQU 0X24
CHRDR EQU 0X25
CHRDRI EQU 0X26
CHRDN EQU 0X27
CHNOTE EQU 0X28
CHINS EQU 0X29
CHSMP EQU 0X2A
CHCOM EQU 0X2B
CHPARM EQU 0X2C
CHVCMD EQU 0X2D
CHPORT EQU 0X2E
CHWNT EQU 0X2F
CHVIBCM EQU 0X30
CHVIBPS EQU 0X31
CHTRMCM EQU 0X32
CHTRMPS EQU 0X33
CHPATPS EQU 0X34
CHLPCNT EQU 0X35
CHOFFST EQU 0X36
CHSLUP EQU 0X37
CHSLDN EQU 0X38
CHPRIOR EQU 0X39
CHSQZ EQU 0X3A
;CH EQU 0X3B
;CH EQU 0X3C
;CH EQU 0X3D
;CH EQU 0X3E
CHOLDV EQU 0X3F
CHANLEN EQU 0X40
CHNS EQU 0X04
SMPBEG EQU 0X00 ;+00 SAMPLE START ADRESS
SMPEND EQU 0X03 ;+03 SAMPLE END ADRESS
SMPFT EQU 0X06 ;+06 SAMPLE FINETUNE
SMPVOL EQU 0X07 ;+07 SAMPLE VOLUME
SMPLPB EQU 0X08 ;+08 SAMPLE LOOP START
SMPLPE EQU 0X0B ;+0B SAMPLE LOOP END
SMPTYPE EQU 0X00
SMPBEGL EQU 0X01
SMPBEGM EQU 0X02
SMPBEGH EQU 0X03
SMPENDL EQU 0X04
SMPENDM EQU 0X05
SMPENDH EQU 0X06
SMPFINE EQU 0X08
SMPLPBL EQU 0X09
SMPLPBM EQU 0X0A
SMPLPBH EQU 0X0B
SMPLPEL EQU 0X0C
SMPLPEM EQU 0X0D
SMPLPEH EQU 0X0E
SMPREL EQU 0X0F
SMPPAN EQU 0X10
SMPCNT EQU 0X11
SMPSQZ EQU 0X12
SMPFRQL EQU 0X13
SMPFRQH EQU 0X14
SMPPERL EQU 0X15
SMPPERH EQU 0X16
SMPCHAN EQU 0X17
;STACK EQU 0X4400
;FXHEAD EQU 0X41C0
;TBUFFER EQU 0X4200
ISTACK EQU 0X4400
CHANSFX EQU 0X4400
CHANS EQU 0X4600
SMPADR EQU 0X4800
;FXADR EQU 0X4C00
;INSTAB EQU 0X4E00
;SMPTAB EQU 0X4F00
;PATDC0 EQU 0X5000
;PATDC1 EQU 0X5200
;PATDC2 EQU 0X5400
;PATDC3 EQU 0X5600
BUFFER EQU 0X5800
INTAREA EQU 0X4242;0X4040 ;адрес таблицы прерываний
BAS4000 EQU 0X4000
RAMPG EQU BAS4000 ;DS 0X3F таблица страниц ОЗУ
ROMPG EQU RAMPG+0X7F ;DS 1 страница ПЗУ
NUMPG EQU BAS4000+0X80 ;4080 DS 1 адрес последней страницы
CPAGE EQU NUMPG+1 ;4081 DS 1 значение записанное в порт MPAG
SYSTEM EQU CPAGE+1 ;4082 DS 1
SDPAGE EQU SYSTEM+1 ;4083 DS 1
PROCESS EQU SDPAGE+1 ;4084 DEFS 0X01
PLAYING EQU PROCESS+1 ;4085 DEFS 0X01
BUSY EQU PLAYING+1 ;4086 DEFS 0X01
INGEN EQU BUSY+1 ;4087 DEFS 0X01
INT EQU INGEN+1 ;4088 DEFS 0X01
INTYPE EQU INT+1 ;4089 DEFS 0X01
INTADR EQU INTYPE+1 ;408A DEFS 0X02
QTFREE EQU INTADR+2 ;408C DEFS 0X02
QTBUSY EQU QTFREE+2 ;408E DEFS 0X02
CNTMOD EQU QTBUSY+2 ;4090 DEFS 0X01
CNTSMP EQU CNTMOD+1 ;4091 DEFS 0X01
CNTFX EQU CNTSMP+1 ;4092 DEFS 0X01
CNTTRK EQU CNTFX+1 ;4093 DEFS 0X02
CNTCHN EQU CNTTRK+2 ;4095 DEFS 0X01
CURMOD EQU CNTCHN+1 ;4096 DEFS 0X01
CURSMP EQU CURMOD+1 ;4097 DEFS 0X01
CURFX EQU CURSMP+1 ;4098 DEFS 0X01
CURTRK EQU CURFX+1 ;4099 DEFS 0X02
CURCHN EQU CURTRK+2 ;409B DEFS 0X01
CURCHAN EQU CURCHN+1 ;409C DEFS 0X02
MODULE EQU CURCHAN+2 ;409E DEFS 0X01
GSCHNS EQU MODULE+1 ;409F DEFS 0X01
FXCHNS EQU GSCHNS+1 ;40A0 DEFS 0X01
PLCHNS EQU FXCHNS+1 ;40A1 DEFS 0X01 ; << PAIR
MDCHNS EQU PLCHNS+1 ;40A2 DEFS 0X01 ; <<
MTCHNS EQU MDCHNS+1 ;40A3 DEFS 0X01
MODVOL EQU MTCHNS+1 ;40A4 DEFS 0X01
FXVOL EQU MODVOL+1 ;40A5 DEFS 0X01
FXMVOL EQU FXVOL+1 ;40A6 DEFS 0X01
MODFADE EQU FXMVOL+1 ;40A7 DEFS 0X01
FXFADE EQU MODFADE+1 ;40A8 DEFS 0X01
MODSWCH EQU FXFADE+1 ;40A9 DEFS 0X01
FILLALL EQU MODSWCH+1 ;40AA DEFS 0X01
INFO EQU FILLALL+1 ;40AB DEFS 0X01
MODSLEN EQU INFO+1 ;40AC DEFS 0X03
FXSLEN EQU MODSLEN+3 ;40AF DEFS 0X03
ERRCODE EQU FXSLEN+3 ;40B2 DEFS 0X01
SGENOFF EQU ERRCODE+1 ;40B3 DEFS 0X01
CHANNEL EQU SGENOFF+1 ;40B4 DEFS 0X01
MODPLT EQU CHANNEL+1 ;40B5 DEFS 0X01
MODSPLT EQU MODPLT+1 ;40B6 DEFS 0X01
CONVERT EQU MODSPLT+1 ;40B7 DEFS 0X01
LSTCHN EQU CONVERT+1 ;40B8 DEFS 0X01
LSTFX EQU LSTCHN+1 ;40B9 DEFS 0X01
LSTMOD EQU LSTFX+1 ;40BA DEFS 0X01
LSTTRC EQU LSTMOD+1 ;40BB DEFS 0X02
FXTICK EQU LSTTRC+2 ;40BD DEFS 0X02
FXTCLEN EQU FXTICK+2 ;40BF DEFS 0X02
SIZE_MOD EQU FXTCLEN+2 ;40C1 РАЗМЕР MOD В СТРАНИЦАХ 32К
;TADR EQU FXTCLEN+2 ;40C1 DEFS 2
;TLEN EQU TADR+2 ;40C3 DEFS 2
;TBUFLEN EQU TLEN+2 ;40C5 DEFS 2
;TBUFBEG EQU TBUFLEN+2 ;40C7 DEFS 2
;TBUFLN2 EQU TBUFBEG+2 ;40C9 DEFS 2
;TBUFBG2 EQU TBUFLN2+2 ;40CB DEFS 2
;TBUFOLD EQU TBUFBG2+2 ;40CD DEFS 1
;TERROR EQU TBUFOLD+1 ;40CE DEFS 1
;TGLBL EQU TERROR+1 ;40CF DEFS 2
;TGLBH EQU TGLBL+2 ;40D1 DEFS 1
;TLDDL EQU TGLBH+1 ;40D2 DEFS 2
;TLDDH EQU TLDDL+2 ;40D4 DEFS 1
;TRQLENL EQU TLDDH+1 ;40D5 DEFS 2
;TRQLENH EQU TRQLENL+2 ;40D7 DEFS 1
;TSIZE EQU TRQLENH+1 ;40D8 DEFS 2
;TCRC EQU TSIZE+2 ;40DA DEFS 1
;TBURST EQU TCRC+1 ;40DB DEFS 1
;TMODE EQU TBURST+1 ;40DC DEFS 1 ;0X00-MODULE,0XFF-SAMPLE
;TMODL EQU TMODE+1 ;40DD DEFS 2
;TMODH EQU TMODL+2 ;40DF DEFS 1
;TSMPL EQU TMODH+1 ;40E0 DEFS 2
;TSMPH EQU TSMPL+2 ;40E2 DEFS 1
;LBCOUNT EQU TSMPH+1 ;40E3 DEFS 1
RAMBOT EQU BAS4000+0XD0 ;40D0 DEFS 0X03
PTR1 EQU RAMBOT+3 ;40D3 DEFS 0X03
PTR2 EQU PTR1+3 ;40D6 DEFS 0X03
MEMBOT EQU PTR2+3 ;40D9 DEFS 0X03
PTR3 EQU MEMBOT+3 ;40DC DEFS 0X03
PTR4 EQU PTR3+3 ;40DF DEFS 0X03
MEMTOP EQU PTR4+3 ;40E2 DEFS 0X03
PTR5 EQU MEMTOP+3 ;40E5 DEFS 0X03
PTR6 EQU PTR5+3 ;40E8 DEFS 0X03
PTR7 EQU PTR6+3 ;40EB DEFS 0X03
PTR8 EQU PTR7+3 ;40EE DEFS 0X03
PTR9 EQU PTR8+3 ;40F1 DEFS 0X03
PTRA EQU PTR9+3 ;40F4 DEFS 0X03
PTRB EQU PTRA+3 ;40F7 DEFS 0X03
PTRC EQU PTRB+3 ;40FA DEFS 0X03
RAMTOP EQU PTRC+3 ;40FD DEFS 0X03
BAS4100 EQU BAS4000+0X100
QTMAP EQU BAS4100 ;4100 DEFS 0X20
VOLTAB EQU QTMAP+0X20 ;4120 DEFS 0X20
CHNVOL EQU VOLTAB+0X20 ;4140 DEFS 0X08
VOLRQTB EQU CHNVOL+8 ;4148 DEFS 0X08
MTTYPE EQU VOLRQTB+8 ;4150 DEFS 0X01
MTSTAT EQU MTTYPE+1 ;4151 DEFS 0X01
MTFLAGS EQU MTSTAT+1 ;4152 DEFS 0X01
TICKLEN EQU MTFLAGS+1 ;4153 DEFS 0X02
TCKLEFT EQU TICKLEN+2 ;4155 DEFS 0X02
MTBPM EQU TCKLEFT+2 ;4157 DEFS 0X01
MTSPEED EQU MTBPM+1 ;4158 DEFS 0X01
MTCOUNT EQU MTSPEED+1 ;4159 DEFS 0X01
MTPATPS EQU MTCOUNT+1 ;415A DEFS 0X01 нота
MTSNGPS EQU MTPATPS+1 ;415B DEFS 0X01 позиция
MTSNGSZ EQU MTSNGPS+1 ;415C DEFS 0X01 количество паттернов
MTSNGLP EQU MTSNGSZ+1 ;415D DEFS 0X01 позиция зацикливания ??
MTPDT2 EQU MTSNGLP+1 ;415E DEFS 0X01
MTPDT EQU MTPDT2+1 ;415F DEFS 0X01
MTBRKFL EQU MTPDT+1 ;4160 DEFS 0X01
MTBRKPS EQU MTBRKFL+1 ;4161 DEFS 0X01
MTJMPFL EQU MTBRKPS+1 ;4162 DEFS 0X01
MTFILTR EQU MTJMPFL+1 ;4163 DEFS 0X01
MTROWS EQU MTFILTR+1 ;4164 DEFS 0X01
MTVOL EQU MTROWS+1 ;4165 DEFS 0X01
;4166 DEFS 0X01
;4167 DEFS 0X01
;MODDIR EQU MTVOL+3 ;4168 DEFS 8*6
CURADR EQU MTVOL+0X33 ;MODDIR+0X30 ;4198 DEFS 3
SMPS EQU CURADR+3 ;419B DEFS 0X03
PATTS EQU SMPS+3 ;419E DEFS 0X01
MODTP EQU PATTS+1 ;419F DEFS 0X01
PlMode EQU MODTP+1 ;41A0 DEFS 0X01 new var4new command
MODLLEN EQU PlMode+1 ;41A1 DEFS 0X01 minimal loop len
MODSMPS EQU 0X5000
MODPTST EQU 0X5001
ChipSP_ EQU 0X5005
CHIP246 EQU 0X5007
TOcip_ EQU 0X5009
CHIPLN EQU 0X5010 ; НА4АЛО СЕМПЛОВ (pointer)
CHIPPP EQU 0X5013 ; ДЛИНА МОДУЛЯ
CIP1 EQU 0X5016 ; ОТКУДА ПЕРЕНОСИТЬ
CIP2 EQU 0X5019 ; КУДА ПЕРЕНОСИТЬ
CIP3 EQU 0X501C ; КОНЕЦ БЛОКА