Skip to content

Instantly share code, notes, and snippets.

@jblang jblang/demoa.blk
Last active Feb 9, 2019

Embed
What would you like to do?
Bold Disassembly
data: unlabeled start 0x186 unlabeled end 0x22ea type bytedata
; set tms register value
; B = register value
; C = register number
tmsreg: equ 0x0153
; set tms write address
; DE = write address
tmsaddr: equ 0x015e
; copy data from main ram to vram
; HL = source address
; DE = destination address
; BC = number of bytes to copy
tmscopy: equ 0x016a
; fill vram block with a value
; A = value to fill
; BC = number of bytes to fill
tmsfill: equ 0x0177
; various loop labels
palloop: equ 0x0118
regloop: equ 0x0123
copyloop: equ 0x016f
fillloop: equ 0x017e
; tms register configuration
tmscfg: equ 0x0186
; data that gets preloaded into vram
preload: equ 0x018e
; pattern table for loading message
patterns: equ 0x228b
; name table for "loading" message
loading: equ 0x22c3
; palette used for later TMS derivatives
palette: equ 0x22ca
data1: unlabeled start 0x158 unlabeled end 0x170 type bytedata
data2: unlabeled start 0x713 unlabeled end 0x9b9 type bytedata
data3: unlabeled start 0x4df9 unlabeled end 0xc8e0 type bytedata
interrupt: unlabeled start 0xc85a unlabeled end 0xc882 type code
mainftbl: unlabeled start 0x506a unlabeled end 0x5078 type pointers
titleftbl: unlabeled start 0x584a unlabeled end 0x585a type pointers
dancerftbl: unlabeled start 0x4f52 unlabeled end 0x4f6a type pointers
endftbl: unlabeled start 0x5c87 unlabeled end 0x5c95 type pointers
ballsftbl: unlabeled start 0x555a unlabeled end 0x5572 type pointers
zoomerftbl: unlabeled start 0x515e unlabeled end 0x5182 type pointers
; Bold by dvik&joyrex: Symbol File
; set stack pointer to ffff
; clear fa8a-fb1f
; nonsensical comparisons that are always true
; clear e000-fffe
; copy c856-c8e0 to fa00-fa8a
; (variables and ISR)
; copy vram 1f00-3fff to dram c900-ea00
; (previously loaded from demoa.com 18e-228a)
; fill fe00-feff with fc (int vector tbl)
; copy fa04-fa2b to fcfc-fd23 (ISR)
; set interrupt register to fe
; interrupt mode 2
; enable interrupts
; set interrupt subvector to 1493
; clear interrupt flag (intflag)
; clear entire vram
; set video mode 0
; wait for vblank
; count down from 900
; check vblank again
; set int flag if another vblank occurred
; cache to store current tms register values
TmsRegVals: equ 0xfa9a
TmsReg1Val: equ 0xfa9b
; set tms register (cached in tmsregval)
; E = register to set
; C = value to set
TmsSetReg: equ 0x1284
; configure the tms register values from table
; DE = table address
TmsCfg: equ 0x1295
; set vram write address
; DE = write address
TmsWriteAddr: equ 0x1269
; set vram read address
; DE = read address
TmsReadAddr: equ 0x1273
; write a block of data from main ram to vram
; DE = data block to copy
; BC = number of bytes to copy
TmsWrite: equ 0x12b5
; read a block of data from vram to main ram
; DE = data block to copy
; BC = number of bytes to copy
TmsRead: equ 0x12c7
; fill vram with a value
; E = value to fill
; BC = number of bytes to fill
TmsFill: equ 0x12d9
; fill vram with ascending values
; E = starting value
; BC = number of bytes to fill
TmsFillAsc: equ 0x12e2
; set tms screen mode from table
; E = screen mode to set
; 0 = text
; 1 = graphics 1
; 2 = graphics 2
TmsMode: equ 0x12ec
; tms registers:
; 2 name table (x 400H)
; 3 color table (x 40H)
; 4 pattern table (x 800H)
; (G2 msb 0 = 0000H, msb 1 = 200H)
; 5 sprite attribute table (x 80H)
; 6 sprite pattern table (x 800H)
; 7 colors
; enable vblank interrupts
TmsIntEnable: equ 0x132e
; detect whether frame rate is 60Hz or 50Hz
DetectHz: equ 0x12fc
; flag whether computer runs at 60 hz
Is60hz: equ 0xfa01
; currently active demo part
DemoPart: equ 0xfa99
; swap the active pattern table
PatternSwap: equ 0x499d
; tms register configuration tables
TextMode: equ 0x5078
; 00 external video disabled
; d0 16k, screen enabled, mode 1 (text)
; 00 name table x 400H = 0000H
; 00 color table unused
; 01 pattern table x 800H = 0800H
; 00 sprite attribute unused
; 00 sprite pattern unused
; 11 color (black/black)
Graph1Mode: equ 0x5080
;00 external video disabled
;c2 16k, screen enabled, mode 0 (graphics 1), 16x16 sprites
;06 name table x 400H = 1800H
;80 color table x 40H = 2000H
;00 pattern table x 800H = 0000H
;36 sprite attribute x 80H = 1B00H
;07 sprite pattern x 800H = 3800H
;e1 color (gray/black)
Graph2Mode: equ 0x5088
;02 external video disabled, mode 2 (graphics 2)
;c2 16k,screen enabled, 16x16 sprites
;06 name table x 400H = 1800H
;ff color table msb set = 2000H
;03 pattern table msb clear = 0000H
;36 sprite attribute x 80H = 1B00H
;07 sprite pattern x 800H = 3800H
;e1 color (gray/black)
; tms addresses
SpritePttnTbl: equ 0x3800
SpriteAttrTbl: equ 0x1b00
NameTable: equ 0x1800
ColorTable: equ 0x2000
; setup the demo
setupdemo: equ 0x1247
; copy data that was loaded to 1F00 in vram
; by demoa.com to C900 in main ram
DemoaCopy: equ 0x1230
; compare HL to DE
CpHlDe: equ 0x4d96
; fill interrupt vector table at FE00
; with FCFC and enable interrupt mode 2
; copy value at FA04 to 0000 through 0027
SetupInt: equ 0x1494
; interrupt vector
IntVector: equ 0xfa02
; interrupt counter
IntCount: equ 0xfa98
; set interrupt vector
; DE = new interrupt vector
SetVector: equ 0x150e
; normal interrupt handler
IntHandler: equ 0x1193
; no-op interrupt handler
NopInt: equ 0x1493
; just returns immediately
NopSub: equ 0x111e
; setup sprites for title screen
SetupTitle: equ 0x3d96
SetupTitle1: equ 0x38c2
; sprite patterns to mask title
TitleMask: equ 0x5715
; load stars into sprite table
SetupStars: equ 0x358b
; star sprite pattern
Stars: equ 0x557a
; bubble sprite pattern
Bubbles: equ 0x50a1
; title nametable
TitleNameTbl: equ 0x56d9
; "dvik & joyrex presents"
DvjrPresents: equ 0x57c6
; function pointer
FuncPtr: equ 0xfaf6
; call the function pointer
CallFp: equ 0x4dc5
; set the funciton pointer
SetFp: equ 0x3d9a
; demo scripts (table of function pointers)
MainScript: equ 0x506a
TitleScript: equ 0x584a
ZoomerScript: equ 0x515e
BallsScript: equ 0x555a
DancerScript: equ 0x4f52
EndScript: equ 0x5c87
; main demo script
Title: equ 0x11cc
Credits: equ 0x11dc
Zoomer: equ 0x11f0
Balls: equ 0x11fb
Plasma: equ 0x1209
Dancer: equ 0x1214
TheEnd: equ 0x121f
; demo parts
Title1: equ 0x3a39
Credits1: equ 0x453e
Zoomer1: equ 0x1eec
Balls1: equ 0x3499
Balls2: equ 0x2bdc
Plasma1: equ 0x49b2
Dancer1: equ 0x0de8
TheEnd1: equ 0x4b52
; title initialization
TitleWait1: equ 0x3a54
; dvik & joyrex fade in effect
TitleFadePresents: equ 0x3a73
SetPresentsSpritePattern: equ 0x393e
TitleWait2: equ 0x3b37
TitleOutline: equ 0x3b71
TitleWait3: equ 0x3b91
TitleFill: equ 0x3ba4
TitleStars: equ 0x3c08
TitleWipe: equ 0x3cc2
; title fame alternator
TitleFrameAlt: equ 0xfae2
TitleFrameCnt: equ 0xfae3
; zoomer script
Zoomwait1: equ 0x1f07
ZoomHorzBox: equ 0x1f0d
ZoomWait2: equ 0x1f12
ZoomVertBox: equ 0x1f17
ZoomWait3: equ 0x1f1c
ZoomFill: equ 0x1f2e
ZoomWait4: equ 0x1f36
ZoomRightExp: equ 0x1f58
ZoomWait5: equ 0x1f60
ZoomLeftExp: equ 0x1f65
ZoomWait6: equ 0x1f6a
ZoomGreen: equ 0x1f6f
ZoomCycle: equ 0x1fb7
ZoomBlack: equ 0x20a5
ZoomWait7: equ 0x20ab
ZoomWait8: equ 0x20b1
ZoomShrink: equ 0x20c6
ZoomBlueBg: equ 0x20cc
; run the main loop
MainLoop: equ 0x3d9f
; ProTracker 3 Entry Points
Pt3Init: equ 0x0150
Pt3Play: equ 0x0153
Pt3Mute: equ 0x0156
; ProTracker 3 Player
Release: equ 0x0036
START: equ 0x014E
SETUP: equ 0x0158
CrPsPtr: equ 0x0159
CHECKLP: equ 0x0170
MUTE: equ 0x0181
INIT: equ 0x018D
TP_0: equ 0x01CF
TP_1: equ 0x01DB
TP_2: equ 0x01E2
L20: equ 0x022B
L21: equ 0x022D
L1: equ 0x025E
L2: equ 0x026B
L3: equ 0x026F
CORR_1: equ 0x0294
CORR_2: equ 0x02A2
TC_EXIT: equ 0x02A9
M1: equ 0x02B8
INITV2: equ 0x02C1
INITV1: equ 0x02C6
M2: equ 0x02C7
M3: equ 0x02DE
PD_OrSm: equ 0x02E5
PD_SAM: equ 0x02EF
PD_SAM_: equ 0x02F0
SamPtrs: equ 0x02F4
MODADDR: equ 0x02FB
PD_VOL: equ 0x0306
PD_EOff: equ 0x030F
PD_SorE: equ 0x0317
PD_ENV: equ 0x0321
PD_ORN: equ 0x0326
PD_ESAM: equ 0x032B
PTDECOD: equ 0x0338
PD_LOOP: equ 0x0347
PD_LP2: equ 0x034A
PD_NOIS: equ 0x037D
PD_REL: equ 0x0382
PD_NOTE: equ 0x0388
PD_RES: equ 0x0390
PDSP_: equ 0x039E
PD_FIN: equ 0x03A1
C_PORTM: equ 0x03A8
PrNote: equ 0x03C9
Version: equ 0x03E6
PrSlide: equ 0x03EB
OLDPRTM: equ 0x03F4
NOSIG: equ 0x03FD
SET_STP: equ 0x0407
C_GLISS: equ 0x0413
C_SMPOS: equ 0x0426
C_ORPOS: equ 0x042C
C_VIBRT: equ 0x0432
C_ENGLS: equ 0x044A
C_DELAY: equ 0x045C
SETENV: equ 0x0462
C_NOP: equ 0x047D
SETORN: equ 0x047E
OrnPtrs: equ 0x0486
MDADDR2: equ 0x048D
SPCCOMS: equ 0x0497
CHREGS: equ 0x04B7
CH_ORPS: equ 0x04DA
CH_NTP: equ 0x04E5
CH_NOK: equ 0x04EB
CH_SMPS: equ 0x0506
CH_NOAC: equ 0x051C
CSP_: equ 0x052F
CH_STPP: equ 0x0562
CH_AMP: equ 0x0577
CH_AMIN: equ 0x0589
CH_SVAM: equ 0x058E
CH_NOAM: equ 0x0591
CH_APOS: equ 0x059A
CH_VOL: equ 0x05A0
CH_ENV: equ 0x05AB
CH_NOEN: equ 0x05B2
NO_ENAC: equ 0x05CC
NO_ENSL: equ 0x05D3
CH_MIX: equ 0x05E1
CH_EXIT: equ 0x05E5
CH_ONDL: equ 0x0604
PLAY: equ 0x0608
AdInPtA: equ 0x0620
LPosPtr: equ 0x0636
PLNLP: equ 0x063A
PatsPtr: equ 0x0643
PSP_: equ 0x065D
PL1A: equ 0x0660
PL1B: equ 0x066B
AdInPtB: equ 0x0676
PL1C: equ 0x067F
AdInPtC: equ 0x068A
Delay: equ 0x0694
PL1D: equ 0x0693
PL2: equ 0x0698
AddToEn: equ 0x06D4
Env_Del: equ 0x06F0
ESldAdd: equ 0x06F3
ROUT: equ 0x06F9
ROUT_A0: equ 0x06FA
LOUT: equ 0x06FF
NT_DATA: equ 0x0713
T_: equ 0x0723
TCOLD_0: equ 0x0723
TCOLD_1: equ 0x072F
TCOLD_2: equ 0x0731
TCNEW_3: equ 0x0743
TCOLD_3: equ 0x0744
TCNEW_0: equ 0x074D
TCNEW_1: equ 0x072F
TCNEW_2: equ 0x0758
EMPTYSAMORN: equ 0x0763
T_PACK: equ 0x0767
VARS: equ 0x079C
;CHNPRM_PsInOr: equ 0x0000
;CHNPRM_PsInSm: equ 0x0001
;CHNPRM_CrAmSl: equ 0x0002
;CHNPRM_CrNsSl: equ 0x0003
;CHNPRM_CrEnSl: equ 0x0004
;CHNPRM_TSlCnt: equ 0x0005
;CHNPRM_CrTnSl: equ 0x0006
;CHNPRM_TnAcc: equ 0x0008
;CHNPRM_COnOff: equ 0x000A
;CHNPRM_OnOffD: equ 0x000B
;CHNPRM_OffOnD: equ 0x000C
;CHNPRM_OrnPtr: equ 0x000D
;CHNPRM_SamPtr: equ 0x000F
;CHNPRM_NNtSkp: equ 0x0011
;CHNPRM_Note: equ 0x0012
;CHNPRM_SlToNt: equ 0x0013
;CHNPRM_Env_En: equ 0x0014
;CHNPRM_Flags: equ 0x0015
;CHNPRM_TnSlDl: equ 0x0016
;CHNPRM_TSlStp: equ 0x0017
;CHNPRM_TnDelt: equ 0x0019
;CHNPRM_NtSkCn: equ 0x001B
;CHNPRM_Volume: equ 0x001C
;CHNPRM_Size: equ 0x001D
ChanA: equ 0x079C
ChanB: equ 0x07B9
ChanC: equ 0x07D6
;AR_TonA: equ 0x0000
;AR_TonB: equ 0x0002
;AR_TonC: equ 0x0004
;AR_Noise: equ 0x0006
;AR_Mixer: equ 0x0007
;AR_AmplA: equ 0x0008
;AR_AmplB: equ 0x0009
;AR_AmplC: equ 0x000A
;AR_Env: equ 0x000B
;AR_EnvTp: equ 0x000D
DelyCnt: equ 0x07F3
CurESld: equ 0x07F4
CurEDel: equ 0x07F6
Ns_Base_AddToNs: equ 0x07F7
Ns_Base: equ 0x07F7
AddToNs: equ 0x07F8
AYREGS: equ 0x07F9
VT_: equ 0x07F9
EnvBase: equ 0x0807
T1_: equ 0x0809
T_OLD_1: equ 0x0809
T_OLD_2: equ 0x0821
T_OLD_3: equ 0x0839
T_OLD_0: equ 0x083B
T_NEW_0: equ 0x083B
T_NEW_1: equ 0x0809
T_NEW_2: equ 0x0853
T_NEW_3: equ 0x0839
NT_: equ 0x08F9
Ampl: equ 0x0803
VAR0END: equ 0x0809
VARSEND: equ 0x09B9
; Protracker song data
MDLADDR: equ 0x927d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.