For comparison, here's (some) of the relevant sections from CALCnet2.2:
Code: Cn3_Setup:
di
ld hl,SavesScreen
push hl
pop de
push de
inc de
ld bc,546-1
ld (hl),0 ;this covers everything incl Cn2_Last_Send
ldir
#ifndef cn2fakeserial
#ifndef cn2fakeserial_gcnhost
bcall(_GetSerial)
ld hl,Op4
pop de
inc de
inc de
ld bc,5
ldir
#endif
#endif
#ifdef cn2fakeserial_gcnhost
pop hl
inc hl
inc hl
ld a,$aa
ld (hl),a
inc hl
ld (hl),a
inc hl
ld (hl),a
inc hl
ld (hl),a
inc hl
ld (hl),a
#endif
#ifdef cn2fakeserial
pop hl
ld b,5
inc hl
inc hl
cn2_ptiserialsetloop:
push bc
ld b,250
call iRandom
pop bc
ld (hl),a ;base fake-address is $00,$00,$00,$01,$00
inc hl
djnz cn2_ptiserialsetloop
#endif
di
ld hl,Cn2_Caller_Routine
ld de,$9999
ld bc,Cn2_Caller_RoutineDone-Cn2_Caller_Routine
ldir
#ifdef cn2_installerinflash
in a,(6)
ld ($9999+Cn2_caller_HomePage-Cn2_Caller_Routine+1),a ;SMC if this code is on a Flash page
#endif cn2_installerinflash
ld a,$9a
ld i,a
ld h,a
ld l,0
ld (hl),$99
push hl
pop de
inc de
ld bc,256
ldir
ld a,%00001000 ;Acknowledge and disable
out (3),a
ld a,%00001010 ;Set 1st timer active
out (3),a
ld a,%00000110 ;Slowest frequency, ~110hz
out (4),a
im 2
ld a,sendCLDL
out (0),a
ei
ret
Cn2_Caller_Routine:
ex af,af'
exx
#ifdef cn2_installerinflash
in a,(6)
push af
Cn2_Caller_HomePage:
ld a,0 ;SMC field
out (6),a
#endif ;cn2_installerinflash
call Cn2_Int_Start
#ifdef cn2_installerinflash
pop af
out (6),a
#endif ;cn2_installerinflash
ld a,%00001000 ;Acknowledge and disable
out (3),a
ld a,%00001010 ;Set 1st timer active
out (3),a
ld a,%00000110 ;Slowest frequency, ~110hz
out (4),a
exx
ex af,af'
ei
reti ;-1-8- -1-9- 9 bytes total now
Cn2_Caller_RoutineDone: