Home » CEEFAX disks » telesoftware1.adl » Utils/DUALSC1
Utils/DUALSC1
This website contains an archive of files for the Acorn Electron, BBC Micro, Acorn Archimedes, Commodore 16 and Commodore 64 computers, which Dominic Ford has rescued from his private collection of floppy disks and cassettes.
Some of these files were originally commercial releases in the 1980s and 1990s, but they are now widely available online. I assume that copyright over them is no longer being asserted. If you own the copyright and would like files to be removed, please contact me.
Tape/disk: | Home » CEEFAX disks » telesoftware1.adl |
Filename: | Utils/DUALSC1 |
Read OK: | ✔ |
File size: | 2418 bytes |
Load address: | 1900 |
Exec address: | 8023 |
Duplicates
There is 1 duplicate copy of this file in the archive:
- AEW website » mu » mu_5_25_discs_Micro_User_04_09_D-MU04_09.ssd » DUALSC1
- CEEFAX disks » telesoftware1.adl » Utils/DUALSC1
File contents
1PRINTCHR$12''"This program saves DUALSCN"'"for 'Dual Screen 2' (DUALSC2)"''"Press any key to save code";:Z=GET 10REM *** DUAL SCREEN *** 20REM (C) The Micro User 30REM By Pete Gaunt 40REM Assemble code to use I/O processor memory for extra screen 50REM Code must run in the I/O processor 60REM Modes 4, 5 and 6 only. 70REM Code saved after assembly as "dualscn" 80REM Run using Basic 2 or Hi-Basic 90code=&2C00 100DIM ass_addr &400 110REM Code assembles at ass_addr but with origin at "code". Inc store space 120userv=&200 130oldv=&230:REM spare vector, may cause trouble if other software uses it. 140oswrch=&FFEE 150osword=&FFF1 160osbyte=&FFF4 170FOR I%=4 TO 6 STEP 2 180O%=ass_addr 190P%=code 200[OPT I% 210.change_vectors \this routine called when code is *RUN 220LDA#dualscreen MOD &100 \check that code isn't being re-run 230CMPuserv 240BNEfirst_run 250LDA#dualscreen DIV &100 260CMPuserv+1 270BNEfirst_run 280JMPend_init 290.first_run \set up vectors if not already set 300LDAuserv \store copy of old user vector contents 310STAoldv 320LDAuserv+1 330STAoldv+1 340LDA#dualscreen MOD &100 \uservec to point to new code 350STAuserv 360LDA#dualscreen DIV &100 370STAuserv+1 380.end_init 390RTS 400.dualscreen 410CMP#0 420BEQok \*code enters with A=0, *line with A=1, oswords 224+ with A=224+ 430JMP(oldv) \if not *code or *fx136 then exit to old routine 440.ok 450STAstore_A 460STXstore_X 470STYstore_Y 480CPX#3 \X less than three switches screens 490BCSnot_screens 500JSRscreens 510BCCfine \returns with C=0 if everything OK 520JMPbad_command 530.fine 540JMPreturn 550.not_screens 560CPX#22 570BNEnot_init \X=22 means set up for Mode Y 580JSRinitialise 590JMPreturn 600.not_init 610CPX#26 \X=26 removes text and graphics windows 620BNEnot_clear_all 630JSRcheck 640JSRno_textwind 650JSRno_graphwind 660JMPreturn 670.not_clear_all 680CPX#24 \X=24 removes graphics window 690BNEnot_no_graphwind 700JSRcheck 710JSRno_graphwind 720JMPreturn 730.not_no_graphwind 740CPX#28 \X=28 removes text window 750BNEnot_no_textwind 760JSRcheck 770JSRno_textwind 780JMPreturn 790.not_no_textwind 800CPX#19 \X=19 or 20 switches palette flag 810BEQps 820CPX#20 830BNEnot_palette_switch 840.ps 850JSRcheck 860JSRpalette_switch 870JMPreturn 880.not_palette_switch 890CPX#3 900BNEnot_copy 910JSRcheck 920JSRcopy_screen 930JMPreturn 940.not_copy 950CPX#4 960BNEnot_tell_output 970JSRcheck 980JSRtell_output 990JMPreturn 1000.not_tell_output 1010CPX#5 1020BNEbad_command 1030JSRcheck 1040JSRtell_display 1050.return 1060RTS \main return point 1070.bad_command \any other X value exits to old uservec routine 1080LDAstore_A 1090LDXstore_X 1100LDYstore_Y 1110JMP(oldv) 1120.screens 1130CPX#0 1140BNEx_ok 1150SEC 1160JMPend_screens 1170.x_ok 1180JSRcheck 1190CPY#0 \Y=0 means switch output to screen X 1200BNEnot_output 1210JSRoutput_to_screen 1220CLC 1230JMPend_screens 1240.not_output 1250CPY#1 \Y=1 means reveal screen X 1260BNEnot_reveal 1270JSRreveal_screen 1280CLC 1290JMPend_screens 1300.not_reveal 1310CPY#2 \Y=2 means output to and reveal screen X 1320BEQnr_ok 1330SEC 1340JMPend_screens 1350.nr_ok 1360JSRoutput_to_screen 1370JSRreveal_screen 1380CLC 1390.end_screens 1400RTS 1410.output_to_screen 1420JSRcurrent_screen 1430CPXstore_X 1440BEQend_ots \if screen requested is the one already used then do nothing 1450JSRswap_variables \else swap variables 1460.end_ots 1470RTS 1480.rev_scn BRK \store for current revealed screen start address 1490.reveal_screen 1500JSRget_start \get start of screen X in A 1510STArev_scn 1520LSR A 1530LSR A 1540LSR A \divide by 8 1550STArev_codes+17 1560LDA#rev_codes MOD &100 1570STAvdu+1 1580LDA#rev_codes DIV &100 1590STAvdu+2 1600LDXrev_codes 1610JSRvdu \change 6845 CRTC registers 12 & 13 1620RTS 1630.rev_codes 1640EQUB(20) \20 bytes 1650EQUD(0) \equiv to VDU23;12,x;0;0;0;23;13,0;0;0;0; 1660EQUD(&0D000000) 1670EQUD(&00001700) 1680EQUD(0) 1690EQUD(&17000CFF) \"FF" set up by reveal routine 1700.no_textwind \set text window of current output screen to whole screen 1710LDA#t_window MOD &100 1720STAvdu+1 1730LDA#t_window DIV &100 1740STAvdu+2 1750LDXt_window 1760JSRvdu 1770RTS 1780.t_window \store for default text window 1790EQUB(6) \6 bytes 1800EQUD(&001E) \sequence ends in 30 (to simulate VDU26) 1810EQUW(0) \set by set_up routine to 28,a,b,c,d,30 (in reverse) 1820.no_graphwind \set graphics window to whole screen 1830LDA#ngw_codes MOD &100 1840STAvdu+1 1850LDA#ngw_codes DIV &100 1860STAvdu+2 1870LDXngw_codes 1880JSRvdu 1890RTS 1900.ngw_codes 1910EQUB(20) \20 bytes 1920EQUD(0) \equiv to VDU29,0;0;24,0;0;1279;1023;25,4,0;0; 1930EQUD(&FF031904) 1940EQUD(&0000FF04) 1950EQUD(&00180000) 1960EQUD(&1D000000) 1970.copy_screen \relies on screens starting at page boundary 1980JSRcurrent_screen \and lo-byte of length always being zero 1990CPX#1 2000BNEtwo_to_one 2010LDXscreen 2020LDYscreen+1 2030JMPmove_mem 2040.two_to_one 2050LDXscreen+1 2060LDYscreen 2070.move_mem 2080STXstart1+2 2090STYstart2+2 2100LDA#0 2110STAstart1+1 2120STAstart2+1 2130LDY#0 2140LDXlength 2150.start1 2160LDA&FFFF,Y \dummy operand 2170.start2 2180STA&FFFF,Y \dummy operand 2190INY 2200BNEstart1 2210INCstart1+2 2220INCstart2+2 2230DEX 2240BNEstart1 2250RTS 2260.tell_output 2270JSRflush_keyboard 2280JSRcurrent_screen 2290TXA 2300CLC 2310ADC#48 2320TAY 2330JSRpoke_keyboard 2340RTS 2350.tell_display 2360JSRflush_keyboard 2370LDY#49 2380LDArev_scn 2390CMPscreen 2400BEQsc1 2410INY 2420.sc1 2430JSRpoke_keyboard 2440RTS 2450.flush_keyboard 2460LDA#21 2470LDX#0 2480JSRosbyte 2490RTS 2500.poke_keyboard \put char in Y into keyboard buffer 2510LDA#138 2520LDX#0 2530JSRosbyte 2540RTS 2550.get_start \return hi-byte of screen start in A 2560LDXstore_X 2570DEX 2580LDAscreen,X 2590RTS 2600.vdu \output VDU codes. Number of bytes passed in X 2610LDA&FFFF,X \dummy operand 2620JSRoswrch 2630DEX \note list is accessed from end. Set up in reverse. 2640BNEvdu 2650RTS 2660.current_screen \returns current output screen (1 or 2) in X 2670LDX#1 2680LDA&34E 2690CMPscreen 2700BEQend_cs 2710INX 2720.end_cs 2730RTS 2740.palette_switch \set flag for separate/common palettes 2750LDA#0 2760STApalette 2770CPX#20 2780BNEnot_off 2790INCpalette \palette=1 if X=20 (no separate palettes) 2800.not_off 2810RTS 2820.check \check if enabled or mode changed 2830LDAenabled 2840BNEcheck_mode 2850BRK \generate error if not set up (with *CODE22,Y) 2860EQUB(254) 2870EQUS("Not set up") 2880BRK 2890.check_mode 2900LDA&355 \&355 contains current mode 2910CMPmode 2920BNEmode_changed 2930RTS 2940.mode_changed \generate error if mode has changed since set up 2950BRK 2960EQUB(253) 2970EQUS"Mode changed" 2980BRK 2990.enabled 3000BRK 3010.swap_variables \swap current variables with stored variables 3020LDX#0 3030.swap_loop 3040LDA&300,X 3050PHA 3060LDAstore,X 3070STA&300,X 3080PLA 3090STAstore,X 3100INX 3110CPX#&7F 3120BNEswap_loop 3130LDX#0 3140.swapzp_loop 3150LDA&D0,X 3160PHA 3170LDAzp_store,X 3180STA&D0,X 3190PLA 3200STAzp_store,X 3210INX 3220CPX#&A 3230BNEswapzp_loop 3240LDApalette 3250BNEnot_palette \if palette<>0 then ignore palette changes 3260LDA&360 \&360 contains number of colours in current mode minus one 3270STAno_colours 3280INCno_colours 3290LDX#0 3300.palette_loop 3310LDA&36F,X \&36F - &37E contain current palette 3320STXosword_block 3330STAosword_block+1 3340TXA 3350PHA 3360LDA#&C \use osword &C to program Video ULA with stored palette 3370LDX#osword_block MOD &100 \faster than VDU19 3380LDY#osword_block DIV &100 3390JSRosword 3400PLA 3410TAX 3420INX 3430CPXno_colours 3440BCCpalette_loop 3450.not_palette 3460RTS 3470.initialise \called after *code22,Y 3480CPY#7 3490BCSno_way 3500CPY#4 3510BCCno_way \if not Mode 4,5 or 6 then flag error 3520STYmode 3530LDA#22 3540JSRoswrch 3550TYA 3560JSRoswrch \change to Mode Y 3570LDA&354 \store length of screen memory (hi-byte) 3580STAlength 3590LDA&34E 3600STAscreen \store bottom of normal screen memory (hi-byte) 3610SEC 3620SBClength \subtract length of screen 3630STAscreen+1 \store start address for extra screen 3640LDA#28 3650STAt_window+6 3660LDX#0 3670LDY#4 3680.wloop \store default text window 3690LDA&308,X 3700STAt_window+1,Y 3710INX 3720DEY 3730BNEwloop 3740JSRno_textwind 3750LDX#0 3760.su_loop \store default VDU variables from page 3 in store 3770LDA&300,X 3780STAstore,X 3790INX 3800CPX#&7F 3810BNEsu_loop 3820LDX#0 3830.su_loop2 3840LDA&D0,X \store default vdu variables from zero page in zp_store 3850STAzp_store,X 3860INX 3870CPX#&A 3880BNEsu_loop2 3890LDAscreen+1 \alter value of screen start in store to that of new screen 3900STAstore+&4E 3910STAstore+&51 3920LDA#1 3930STAenabled \set enabled flag 3940\clear both screens. OSBYTE 136 is same as *code 3950LDA#136 3960LDX#2 3970LDY#0 3980JSRosbyte 3990LDA#12 4000JSRoswrch 4010LDA#136 4020LDX#1 4030LDY#2 4040JSRosbyte 4050LDA#12 4060JSRoswrch 4070RTS 4080.no_way \generate error if not Mode 4, 5 or 6 4090LDA#0 4100STAenabled 4110BRK 4120EQUB(252) \error number 252 4130EQUS("Mode!") 4140BRK 4150.palette BRK 4160.store_A BRK 4170.store_X BRK 4180.store_Y BRK 4190.screen \store for hi-bytes of start of each screen 4200BRK 4210BRK 4220.length \store for hi_byte of screen length 4230BRK 4240.no_colours \store for number of colours in current mode 4250BRK 4260.mode 4270EQUB(255) \store for screen mode when set up (with *code22,Y) 4280.osword_block 4290EQUB(0) 4300EQUD(0) 4310.store 4320EQUS(STRING$(&80,CHR$0)) \store for page 3 (first &7F bytes) 4330.zp_store 4340EQUS(STRING$(&B,CHR$0)) \store for zero page &D0 to &DA 4350.end 4360] 4370NEXT 4380S%=code OR &FFFF0000 4390OSCLI"*save dualscn "+STR$~ass_addr+" "+STR$~O%+" "+STR$~S%+" "+STR$~S%
i�12''"This program saves DUALSCN"'"for 'Dual Screen 2' (DUALSC2)"''"Press any key to save code";:Z=� � *** DUAL SCREEN *** � (C) The Micro User � By Pete Gaunt (@� Assemble code to use I/O processor memory for extra screen 2(� Code must run in the I/O processor <� Modes 4, 5 and 6 only. F,� Code saved after assembly as "dualscn" P#� Run using Basic 2 or Hi-Basic Zcode=&2C00 d� ass_addr &400 nK� Code assembles at ass_addr but with origin at "code". Inc store space xuserv=&200 �Joldv=&230:� spare vector, may cause trouble if other software uses it. �oswrch=&FFEE �osword=&FFF1 �osbyte=&FFF4 �� I%=4 � 6 � 2 �O%=ass_addr �P%=code �[OPT I% �:.change_vectors \this routine called when code is *� �?LDA#dualscreen � &100 \check that code isn't being re-run �CMPuserv �BNEfirst_run �LDA#dualscreen � &100 CMPuserv+1 BNEfirst_run JMPend_init "2.first_run \set up vectors if not already set ,7LDAuserv \store copy of old user vector contents 6STAoldv @LDAuserv+1 J STAoldv+1 T8LDA#dualscreen � &100 \uservec to point to new code ^STAuserv hLDA#dualscreen � &100 rSTAuserv+1 | .end_init �RTS �.dualscreen � CMP#0 �JBEQok \*code enters with A=0, *line with A=1, oswords 224+ with A=224+ �?JMP(oldv) \if not *code or *fx136 then exit to old routine �.ok �STAstore_A �STXstore_X �STYstore_Y �.CPX#3 \X less than three switches screens �BCSnot_screens �JSRscreens �/BCCfine \returns with C=0 if everything OK JMPbad_command .fine JMPreturn &.not_screens 0 CPX#22 :.BNEnot_init \X=22 means set up for Mode Y DJSRinitialise N JMPreturn X .not_init b4CPX#26 \X=26 removes text and graphics windows lBNEnot_clear_all vJSRcheck �JSRno_textwind �JSRno_graphwind � JMPreturn �.not_clear_all �+CPX#24 \X=24 removes graphics window �BNEnot_no_graphwind �JSRcheck �JSRno_graphwind � JMPreturn �.not_no_graphwind �'CPX#28 \X=28 removes text window �BNEnot_no_textwind �JSRcheck JSRno_textwind JMPreturn .not_no_textwind -CPX#19 \X=19 or 20 switches palette flag * BEQps 4 CPX#20 >BNEnot_palette_switch H.ps RJSRcheck \JSRpalette_switch f JMPreturn p.not_palette_switch z CPX#3 �BNEnot_copy �JSRcheck �JSRcopy_screen � JMPreturn � .not_copy � CPX#4 �BNEnot_tell_output �JSRcheck �JSRtell_output � JMPreturn �.not_tell_output � CPX#5 �BNEbad_command JSRcheck JSRtell_display .return $RTS \main return point .B.bad_command \any other X value exits to old uservec routine 8LDAstore_A BLDXstore_X LLDYstore_Y V JMP(oldv) `.screens j CPX#0 tBNEx_ok ~SEC �JMPend_screens � .x_ok �JSRcheck �/CPY#0 \Y=0 means switch output to screen X �BNEnot_output �JSRoutput_to_screen �CLC �JMPend_screens �.not_output �%CPY#1 \Y=1 means reveal screen X �BNEnot_reveal �JSRreveal_screen CLC JMPend_screens .not_reveal 3CPY#2 \Y=2 means output to and reveal screen X (BEQnr_ok 2SEC <JMPend_screens F .nr_ok PJSRoutput_to_screen ZJSRreveal_screen dCLC n.end_screens xRTS �.output_to_screen �JSRcurrent_screen �CPXstore_X �LBEQend_ots \if screen requested is the one already used then do nothing �*JSRswap_variables \else swap variables �.end_ots �RTS �A.rev_scn BRK \store for current revealed screen start address �.reveal_screen �,JSRget_start \get start of screen X in A �STArev_scn � LSR A � LSR A LSR A \divide by 8 STArev_codes+17 LDA#rev_codes � &100 "STAvdu+1 ,LDA#rev_codes � &100 6STAvdu+2 @LDXrev_codes J1JSRvdu \change 6845 CRTC registers 12 & 13 TRTS ^.rev_codes hEQUB(20) \20 bytes r4EQUD(0) \equiv to �23;12,x;0;0;0;23;13,0;0;0;0; |EQUD(&0D000000) �EQUD(&00001700) �EQUD(0) �3EQUD(&17000CFF) \"FF" set up by reveal routine �K.no_textwind \set text window of current output screen to whole screen �LDA#t_window � &100 �STAvdu+1 �LDA#t_window � &100 �STAvdu+2 �LDXt_window � JSRvdu �RTS �,.t_window \store for default text window �EQUB(6) \6 bytes 7EQUD(&001E) \sequence ends in 30 (to simulate �26) @EQUW(0) \set by set_up routine to 28,a,b,c,d,30 (in reverse) 6.no_graphwind \set graphics window to whole screen &LDA#ngw_codes � &100 0STAvdu+1 :LDA#ngw_codes � &100 DSTAvdu+2 NLDXngw_codes X JSRvdu bRTS l.ngw_codes vEQUB(20) \20 bytes �9EQUD(0) \equiv to �29,0;0;24,0;0;1279;1023;25,4,0;0; �EQUD(&FF031904) �EQUD(&0000FF04) �EQUD(&00180000) �EQUD(&1D000000) �>.copy_screen \relies on screens starting at page boundary �@JSRcurrent_screen \and lo-byte of length always being zero � CPX#1 �BNEtwo_to_one � LDXscreen �LDYscreen+1 �JMPmove_mem �.two_to_one LDXscreen+1 LDYscreen .move_mem STXstart1+2 *STYstart2+2 4 LDA#0 >STAstart1+1 HSTAstart2+1 R LDY#0 \ LDXlength f.start1 pLDA&FFFF,Y \dummy operand z.start2 �STA&FFFF,Y \dummy operand �INY � BNEstart1 �INCstart1+2 �INCstart2+2 �DEX � BNEstart1 �RTS �.tell_output �JSRflush_keyboard �JSRcurrent_screen �TXA �CLC ADC#48 TAY JSRpoke_keyboard $RTS ..tell_display 8JSRflush_keyboard B LDY#49 LLDArev_scn V CMPscreen ` BEQsc1 jINY t.sc1 ~JSRpoke_keyboard �RTS �.flush_keyboard � LDA#21 � LDX#0 � JSRosbyte �RTS �7.poke_keyboard \put char in Y into keyboard buffer �LDA#138 � LDX#0 � JSRosbyte �RTS �4.get_start \return hi-byte of screen start in A LDXstore_X DEX LDAscreen,X RTS (6.vdu \output � codes. Number of bytes passed in X 2LDA&FFFF,X \dummy operand < JSRoswrch F=DEX \note list is accessed from end. Set up in reverse. P BNEvdu ZRTS dA.current_screen \returns current output screen (1 or 2) in X n LDX#1 xLDA&34E � CMPscreen � BEQend_cs �INX �.end_cs �RTS �;.palette_switch \set flag for separate/common palettes � LDA#0 �STApalette � CPX#20 �BNEnot_off �9INCpalette \palette=1 if X=20 (no separate palettes) �.not_off �RTS -.check \check if enabled or mode changed LDAenabled BNEcheck_mode "9BRK \generate error if not set up (with *CODE22,Y) , EQUB(254) 6EQUS("Not set up") @BRK J.check_mode T(LDA&355 \&355 contains current mode ^CMPmode hBNEmode_changed rRTS |D.mode_changed \generate error if mode has changed since set up �BRK � EQUB(253) �EQUS"Mode changed" �BRK �.enabled �BRK �B.swap_variables \swap current variables with stored variables � LDX#0 �.swap_loop � LDA&300,X �PHA �LDAstore,X � STA&300,X PLA STAstore,X INX &CPX#&7F 0BNEswap_loop : LDX#0 D.swapzp_loop NLDA&D0,X XPHA bLDAzp_store,X lSTA&D0,X vPLA �STAzp_store,X �INX � CPX#&A �BNEswapzp_loop �LDApalette �=BNEnot_palette \if palette<>0 then ignore palette changes �HLDA&360 \&360 contains number of colours in current mode minus one �STAno_colours �INCno_colours � LDX#0 �.palette_loop �5LDA&36F,X \&36F - &37E contain current palette �STXosword_block STAosword_block+1 TXA PHA HLDA#&C \use osword &C to program Video ULA with stored palette *-LDX#osword_block � &100 \faster than �19 4LDY#osword_block � &100 > JSRosword HPLA RTAX \INX fCPXno_colours pBCCpalette_loop z.not_palette �RTS �*.initialise \called after *code22,Y � CPY#7 � BCSno_way � CPY#4 �4BCCno_way \if not Mode 4,5 or 6 then flag error �STYmode � LDA#22 � JSRoswrch �TYA �!JSRoswrch \change to Mode Y �7LDA&354 \store length of screen memory (hi-byte) � STAlength LDA&34E >STAscreen \store bottom of normal screen memory (hi-byte) SEC $(SBClength \subtract length of screen .6STAscreen+1 \store start address for extra screen 8 LDA#28 BSTAt_window+6 L LDX#0 V LDY#4 `%.wloop \store default text window j LDA&308,X tSTAt_window+1,Y ~INX �DEY �BNEwloop �JSRno_textwind � LDX#0 �=.su_loop \store default � variables from page 3 in store � LDA&300,X �STAstore,X �INX �CPX#&7F �BNEsu_loop � LDX#0 � .su_loop2 FLDA&D0,X \store default vdu variables from zero page in zp_store STAzp_store,X INX CPX#&A (BNEsu_loop2 2KLDAscreen+1 \alter value of screen start in store to that of new screen <STAstore+&4E FSTAstore+&51 P LDA#1 Z"STAenabled \set enabled flag d4\clear both screens. OSBYTE 136 is same as *code nLDA#136 x LDX#2 � LDY#0 � JSRosbyte � LDA#12 � JSRoswrch �LDA#136 � LDX#1 � LDY#2 � JSRosbyte � LDA#12 � JSRoswrch �RTS �2.no_way \generate error if not Mode 4, 5 or 6 � LDA#0 STAenabled BRK EQUB(252) \error number 252 "EQUS("Mode!") ,BRK 6.palette BRK @.store_A BRK J.store_X BRK T.store_Y BRK ^9.screen \store for hi-bytes of start of each screen hBRK rBRK |1.length \store for hi_byte of screen length �BRK �>.no_colours \store for number of colours in current mode �BRK � .mode �BEQUB(255) \store for screen mode when set up (with *code22,Y) �.osword_block �EQUB(0) �EQUD(0) � .store �6EQUS(�&80,�0)) \store for page 3 (first &7F bytes) � .zp_store �2EQUS(�&B,�0)) \store for zero page &D0 to &DA �.end ] � S%=code � &FFFF0000 &;�"*save dualscn "+�~ass_addr+" "+�~O%+" "+�~S%+" "+�~S% �
00000000 0d 00 01 69 f1 bd 31 32 27 27 22 54 68 69 73 20 |...i..12''"This | 00000010 70 72 6f 67 72 61 6d 20 73 61 76 65 73 20 44 55 |program saves DU| 00000020 41 4c 53 43 4e 22 27 22 66 6f 72 20 27 44 75 61 |ALSCN"'"for 'Dua| 00000030 6c 20 53 63 72 65 65 6e 20 32 27 20 28 44 55 41 |l Screen 2' (DUA| 00000040 4c 53 43 32 29 22 27 27 22 50 72 65 73 73 20 61 |LSC2)"''"Press a| 00000050 6e 79 20 6b 65 79 20 74 6f 20 73 61 76 65 20 63 |ny key to save c| 00000060 6f 64 65 22 3b 3a 5a 3d a5 0d 00 0a 19 f4 20 2a |ode";:Z=...... *| 00000070 2a 2a 20 44 55 41 4c 20 53 43 52 45 45 4e 20 2a |** DUAL SCREEN *| 00000080 2a 2a 0d 00 14 18 f4 20 28 43 29 20 54 68 65 20 |**..... (C) The | 00000090 4d 69 63 72 6f 20 55 73 65 72 0d 00 1e 13 f4 20 |Micro User..... | 000000a0 42 79 20 50 65 74 65 20 47 61 75 6e 74 0d 00 28 |By Pete Gaunt..(| 000000b0 40 f4 20 41 73 73 65 6d 62 6c 65 20 63 6f 64 65 |@. Assemble code| 000000c0 20 74 6f 20 75 73 65 20 49 2f 4f 20 70 72 6f 63 | to use I/O proc| 000000d0 65 73 73 6f 72 20 6d 65 6d 6f 72 79 20 66 6f 72 |essor memory for| 000000e0 20 65 78 74 72 61 20 73 63 72 65 65 6e 0d 00 32 | extra screen..2| 000000f0 28 f4 20 43 6f 64 65 20 6d 75 73 74 20 72 75 6e |(. Code must run| 00000100 20 69 6e 20 74 68 65 20 49 2f 4f 20 70 72 6f 63 | in the I/O proc| 00000110 65 73 73 6f 72 0d 00 3c 1c f4 20 4d 6f 64 65 73 |essor..<.. Modes| 00000120 20 34 2c 20 35 20 61 6e 64 20 36 20 6f 6e 6c 79 | 4, 5 and 6 only| 00000130 2e 0d 00 46 2c f4 20 43 6f 64 65 20 73 61 76 65 |...F,. Code save| 00000140 64 20 61 66 74 65 72 20 61 73 73 65 6d 62 6c 79 |d after assembly| 00000150 20 61 73 20 22 64 75 61 6c 73 63 6e 22 0d 00 50 | as "dualscn"..P| 00000160 23 f4 20 52 75 6e 20 75 73 69 6e 67 20 42 61 73 |#. Run using Bas| 00000170 69 63 20 32 20 6f 72 20 48 69 2d 42 61 73 69 63 |ic 2 or Hi-Basic| 00000180 0d 00 5a 0e 63 6f 64 65 3d 26 32 43 30 30 0d 00 |..Z.code=&2C00..| 00000190 64 13 de 20 61 73 73 5f 61 64 64 72 20 26 34 30 |d.. ass_addr &40| 000001a0 30 0d 00 6e 4b f4 20 43 6f 64 65 20 61 73 73 65 |0..nK. Code asse| 000001b0 6d 62 6c 65 73 20 61 74 20 61 73 73 5f 61 64 64 |mbles at ass_add| 000001c0 72 20 62 75 74 20 77 69 74 68 20 6f 72 69 67 69 |r but with origi| 000001d0 6e 20 61 74 20 22 63 6f 64 65 22 2e 20 49 6e 63 |n at "code". Inc| 000001e0 20 73 74 6f 72 65 20 73 70 61 63 65 0d 00 78 0e | store space..x.| 000001f0 75 73 65 72 76 3d 26 32 30 30 0d 00 82 4a 6f 6c |userv=&200...Jol| 00000200 64 76 3d 26 32 33 30 3a f4 20 73 70 61 72 65 20 |dv=&230:. spare | 00000210 76 65 63 74 6f 72 2c 20 6d 61 79 20 63 61 75 73 |vector, may caus| 00000220 65 20 74 72 6f 75 62 6c 65 20 69 66 20 6f 74 68 |e trouble if oth| 00000230 65 72 20 73 6f 66 74 77 61 72 65 20 75 73 65 73 |er software uses| 00000240 20 69 74 2e 0d 00 8c 10 6f 73 77 72 63 68 3d 26 | it.....oswrch=&| 00000250 46 46 45 45 0d 00 96 10 6f 73 77 6f 72 64 3d 26 |FFEE....osword=&| 00000260 46 46 46 31 0d 00 a0 10 6f 73 62 79 74 65 3d 26 |FFF1....osbyte=&| 00000270 46 46 46 34 0d 00 aa 12 e3 20 49 25 3d 34 20 b8 |FFF4..... I%=4 .| 00000280 20 36 20 88 20 32 0d 00 b4 0f 4f 25 3d 61 73 73 | 6 . 2....O%=ass| 00000290 5f 61 64 64 72 0d 00 be 0b 50 25 3d 63 6f 64 65 |_addr....P%=code| 000002a0 0d 00 c8 0b 5b 4f 50 54 20 49 25 0d 00 d2 3a 2e |....[OPT I%...:.| 000002b0 63 68 61 6e 67 65 5f 76 65 63 74 6f 72 73 20 20 |change_vectors | 000002c0 20 5c 74 68 69 73 20 72 6f 75 74 69 6e 65 20 63 | \this routine c| 000002d0 61 6c 6c 65 64 20 77 68 65 6e 20 63 6f 64 65 20 |alled when code | 000002e0 69 73 20 2a f9 0d 00 dc 3f 4c 44 41 23 64 75 61 |is *....?LDA#dua| 000002f0 6c 73 63 72 65 65 6e 20 83 20 26 31 30 30 20 20 |lscreen . &100 | 00000300 20 5c 63 68 65 63 6b 20 74 68 61 74 20 63 6f 64 | \check that cod| 00000310 65 20 69 73 6e 27 74 20 62 65 69 6e 67 20 72 65 |e isn't being re| 00000320 2d 72 75 6e 0d 00 e6 0c 43 4d 50 75 73 65 72 76 |-run....CMPuserv| 00000330 0d 00 f0 10 42 4e 45 66 69 72 73 74 5f 72 75 6e |....BNEfirst_run| 00000340 0d 00 fa 19 4c 44 41 23 64 75 61 6c 73 63 72 65 |....LDA#dualscre| 00000350 65 6e 20 81 20 26 31 30 30 0d 01 04 0e 43 4d 50 |en . &100....CMP| 00000360 75 73 65 72 76 2b 31 0d 01 0e 10 42 4e 45 66 69 |userv+1....BNEfi| 00000370 72 73 74 5f 72 75 6e 0d 01 18 0f 4a 4d 50 65 6e |rst_run....JMPen| 00000380 64 5f 69 6e 69 74 0d 01 22 32 2e 66 69 72 73 74 |d_init.."2.first| 00000390 5f 72 75 6e 20 20 5c 73 65 74 20 75 70 20 76 65 |_run \set up ve| 000003a0 63 74 6f 72 73 20 69 66 20 6e 6f 74 20 61 6c 72 |ctors if not alr| 000003b0 65 61 64 79 20 73 65 74 0d 01 2c 37 4c 44 41 75 |eady set..,7LDAu| 000003c0 73 65 72 76 20 20 20 20 5c 73 74 6f 72 65 20 63 |serv \store c| 000003d0 6f 70 79 20 6f 66 20 6f 6c 64 20 75 73 65 72 20 |opy of old user | 000003e0 76 65 63 74 6f 72 20 63 6f 6e 74 65 6e 74 73 0d |vector contents.| 000003f0 01 36 0b 53 54 41 6f 6c 64 76 0d 01 40 0e 4c 44 |.6.STAoldv..@.LD| 00000400 41 75 73 65 72 76 2b 31 0d 01 4a 0d 53 54 41 6f |Auserv+1..J.STAo| 00000410 6c 64 76 2b 31 0d 01 54 38 4c 44 41 23 64 75 61 |ldv+1..T8LDA#dua| 00000420 6c 73 63 72 65 65 6e 20 83 20 26 31 30 30 20 20 |lscreen . &100 | 00000430 5c 75 73 65 72 76 65 63 20 74 6f 20 70 6f 69 6e |\uservec to poin| 00000440 74 20 74 6f 20 6e 65 77 20 63 6f 64 65 0d 01 5e |t to new code..^| 00000450 0c 53 54 41 75 73 65 72 76 0d 01 68 19 4c 44 41 |.STAuserv..h.LDA| 00000460 23 64 75 61 6c 73 63 72 65 65 6e 20 81 20 26 31 |#dualscreen . &1| 00000470 30 30 0d 01 72 0e 53 54 41 75 73 65 72 76 2b 31 |00..r.STAuserv+1| 00000480 0d 01 7c 0d 2e 65 6e 64 5f 69 6e 69 74 0d 01 86 |..|..end_init...| 00000490 07 52 54 53 0d 01 90 0f 2e 64 75 61 6c 73 63 72 |.RTS.....dualscr| 000004a0 65 65 6e 0d 01 9a 09 43 4d 50 23 30 0d 01 a4 4a |een....CMP#0...J| 000004b0 42 45 51 6f 6b 20 5c 2a 63 6f 64 65 20 65 6e 74 |BEQok \*code ent| 000004c0 65 72 73 20 77 69 74 68 20 41 3d 30 2c 20 2a 6c |ers with A=0, *l| 000004d0 69 6e 65 20 77 69 74 68 20 41 3d 31 2c 20 6f 73 |ine with A=1, os| 000004e0 77 6f 72 64 73 20 32 32 34 2b 20 77 69 74 68 20 |words 224+ with | 000004f0 41 3d 32 32 34 2b 0d 01 ae 3f 4a 4d 50 28 6f 6c |A=224+...?JMP(ol| 00000500 64 76 29 20 20 5c 69 66 20 6e 6f 74 20 2a 63 6f |dv) \if not *co| 00000510 64 65 20 6f 72 20 2a 66 78 31 33 36 20 74 68 65 |de or *fx136 the| 00000520 6e 20 65 78 69 74 20 74 6f 20 6f 6c 64 20 72 6f |n exit to old ro| 00000530 75 74 69 6e 65 0d 01 b8 07 2e 6f 6b 0d 01 c2 0e |utine.....ok....| 00000540 53 54 41 73 74 6f 72 65 5f 41 0d 01 cc 0e 53 54 |STAstore_A....ST| 00000550 58 73 74 6f 72 65 5f 58 0d 01 d6 0e 53 54 59 73 |Xstore_X....STYs| 00000560 74 6f 72 65 5f 59 0d 01 e0 2e 43 50 58 23 33 20 |tore_Y....CPX#3 | 00000570 20 5c 58 20 6c 65 73 73 20 74 68 61 6e 20 74 68 | \X less than th| 00000580 72 65 65 20 73 77 69 74 63 68 65 73 20 73 63 72 |ree switches scr| 00000590 65 65 6e 73 0d 01 ea 12 42 43 53 6e 6f 74 5f 73 |eens....BCSnot_s| 000005a0 63 72 65 65 6e 73 0d 01 f4 0e 4a 53 52 73 63 72 |creens....JSRscr| 000005b0 65 65 6e 73 0d 01 fe 2f 42 43 43 66 69 6e 65 20 |eens.../BCCfine | 000005c0 20 5c 72 65 74 75 72 6e 73 20 77 69 74 68 20 43 | \returns with C| 000005d0 3d 30 20 69 66 20 65 76 65 72 79 74 68 69 6e 67 |=0 if everything| 000005e0 20 4f 4b 0d 02 08 12 4a 4d 50 62 61 64 5f 63 6f | OK....JMPbad_co| 000005f0 6d 6d 61 6e 64 0d 02 12 09 2e 66 69 6e 65 0d 02 |mmand.....fine..| 00000600 1c 0d 4a 4d 50 72 65 74 75 72 6e 0d 02 26 10 2e |..JMPreturn..&..| 00000610 6e 6f 74 5f 73 63 72 65 65 6e 73 0d 02 30 0a 43 |not_screens..0.C| 00000620 50 58 23 32 32 0d 02 3a 2e 42 4e 45 6e 6f 74 5f |PX#22..:.BNEnot_| 00000630 69 6e 69 74 20 20 5c 58 3d 32 32 20 6d 65 61 6e |init \X=22 mean| 00000640 73 20 73 65 74 20 75 70 20 66 6f 72 20 4d 6f 64 |s set up for Mod| 00000650 65 20 59 0d 02 44 11 4a 53 52 69 6e 69 74 69 61 |e Y..D.JSRinitia| 00000660 6c 69 73 65 0d 02 4e 0d 4a 4d 50 72 65 74 75 72 |lise..N.JMPretur| 00000670 6e 0d 02 58 0d 2e 6e 6f 74 5f 69 6e 69 74 0d 02 |n..X..not_init..| 00000680 62 34 43 50 58 23 32 36 20 20 20 5c 58 3d 32 36 |b4CPX#26 \X=26| 00000690 20 72 65 6d 6f 76 65 73 20 74 65 78 74 20 61 6e | removes text an| 000006a0 64 20 67 72 61 70 68 69 63 73 20 77 69 6e 64 6f |d graphics windo| 000006b0 77 73 0d 02 6c 14 42 4e 45 6e 6f 74 5f 63 6c 65 |ws..l.BNEnot_cle| 000006c0 61 72 5f 61 6c 6c 0d 02 76 0c 4a 53 52 63 68 65 |ar_all..v.JSRche| 000006d0 63 6b 0d 02 80 12 4a 53 52 6e 6f 5f 74 65 78 74 |ck....JSRno_text| 000006e0 77 69 6e 64 0d 02 8a 13 4a 53 52 6e 6f 5f 67 72 |wind....JSRno_gr| 000006f0 61 70 68 77 69 6e 64 0d 02 94 0d 4a 4d 50 72 65 |aphwind....JMPre| 00000700 74 75 72 6e 0d 02 9e 12 2e 6e 6f 74 5f 63 6c 65 |turn.....not_cle| 00000710 61 72 5f 61 6c 6c 0d 02 a8 2b 43 50 58 23 32 34 |ar_all...+CPX#24| 00000720 20 20 20 20 5c 58 3d 32 34 20 72 65 6d 6f 76 65 | \X=24 remove| 00000730 73 20 67 72 61 70 68 69 63 73 20 77 69 6e 64 6f |s graphics windo| 00000740 77 0d 02 b2 17 42 4e 45 6e 6f 74 5f 6e 6f 5f 67 |w....BNEnot_no_g| 00000750 72 61 70 68 77 69 6e 64 0d 02 bc 0c 4a 53 52 63 |raphwind....JSRc| 00000760 68 65 63 6b 0d 02 c6 13 4a 53 52 6e 6f 5f 67 72 |heck....JSRno_gr| 00000770 61 70 68 77 69 6e 64 0d 02 d0 0d 4a 4d 50 72 65 |aphwind....JMPre| 00000780 74 75 72 6e 0d 02 da 15 2e 6e 6f 74 5f 6e 6f 5f |turn.....not_no_| 00000790 67 72 61 70 68 77 69 6e 64 0d 02 e4 27 43 50 58 |graphwind...'CPX| 000007a0 23 32 38 20 20 20 20 5c 58 3d 32 38 20 72 65 6d |#28 \X=28 rem| 000007b0 6f 76 65 73 20 74 65 78 74 20 77 69 6e 64 6f 77 |oves text window| 000007c0 0d 02 ee 16 42 4e 45 6e 6f 74 5f 6e 6f 5f 74 65 |....BNEnot_no_te| 000007d0 78 74 77 69 6e 64 0d 02 f8 0c 4a 53 52 63 68 65 |xtwind....JSRche| 000007e0 63 6b 0d 03 02 12 4a 53 52 6e 6f 5f 74 65 78 74 |ck....JSRno_text| 000007f0 77 69 6e 64 0d 03 0c 0d 4a 4d 50 72 65 74 75 72 |wind....JMPretur| 00000800 6e 0d 03 16 14 2e 6e 6f 74 5f 6e 6f 5f 74 65 78 |n.....not_no_tex| 00000810 74 77 69 6e 64 0d 03 20 2d 43 50 58 23 31 39 20 |twind.. -CPX#19 | 00000820 20 5c 58 3d 31 39 20 6f 72 20 32 30 20 73 77 69 | \X=19 or 20 swi| 00000830 74 63 68 65 73 20 70 61 6c 65 74 74 65 20 66 6c |tches palette fl| 00000840 61 67 0d 03 2a 09 42 45 51 70 73 0d 03 34 0a 43 |ag..*.BEQps..4.C| 00000850 50 58 23 32 30 0d 03 3e 19 42 4e 45 6e 6f 74 5f |PX#20..>.BNEnot_| 00000860 70 61 6c 65 74 74 65 5f 73 77 69 74 63 68 0d 03 |palette_switch..| 00000870 48 07 2e 70 73 0d 03 52 0c 4a 53 52 63 68 65 63 |H..ps..R.JSRchec| 00000880 6b 0d 03 5c 15 4a 53 52 70 61 6c 65 74 74 65 5f |k..\.JSRpalette_| 00000890 73 77 69 74 63 68 0d 03 66 0d 4a 4d 50 72 65 74 |switch..f.JMPret| 000008a0 75 72 6e 0d 03 70 17 2e 6e 6f 74 5f 70 61 6c 65 |urn..p..not_pale| 000008b0 74 74 65 5f 73 77 69 74 63 68 0d 03 7a 09 43 50 |tte_switch..z.CP| 000008c0 58 23 33 0d 03 84 0f 42 4e 45 6e 6f 74 5f 63 6f |X#3....BNEnot_co| 000008d0 70 79 0d 03 8e 0c 4a 53 52 63 68 65 63 6b 0d 03 |py....JSRcheck..| 000008e0 98 12 4a 53 52 63 6f 70 79 5f 73 63 72 65 65 6e |..JSRcopy_screen| 000008f0 0d 03 a2 0d 4a 4d 50 72 65 74 75 72 6e 0d 03 ac |....JMPreturn...| 00000900 0d 2e 6e 6f 74 5f 63 6f 70 79 0d 03 b6 09 43 50 |..not_copy....CP| 00000910 58 23 34 0d 03 c0 16 42 4e 45 6e 6f 74 5f 74 65 |X#4....BNEnot_te| 00000920 6c 6c 5f 6f 75 74 70 75 74 0d 03 ca 0c 4a 53 52 |ll_output....JSR| 00000930 63 68 65 63 6b 0d 03 d4 12 4a 53 52 74 65 6c 6c |check....JSRtell| 00000940 5f 6f 75 74 70 75 74 0d 03 de 0d 4a 4d 50 72 65 |_output....JMPre| 00000950 74 75 72 6e 0d 03 e8 14 2e 6e 6f 74 5f 74 65 6c |turn.....not_tel| 00000960 6c 5f 6f 75 74 70 75 74 0d 03 f2 09 43 50 58 23 |l_output....CPX#| 00000970 35 0d 03 fc 12 42 4e 45 62 61 64 5f 63 6f 6d 6d |5....BNEbad_comm| 00000980 61 6e 64 0d 04 06 0c 4a 53 52 63 68 65 63 6b 0d |and....JSRcheck.| 00000990 04 10 13 4a 53 52 74 65 6c 6c 5f 64 69 73 70 6c |...JSRtell_displ| 000009a0 61 79 0d 04 1a 0b 2e 72 65 74 75 72 6e 0d 04 24 |ay.....return..$| 000009b0 1e 52 54 53 20 20 20 20 20 5c 6d 61 69 6e 20 72 |.RTS \main r| 000009c0 65 74 75 72 6e 20 70 6f 69 6e 74 0d 04 2e 42 2e |eturn point...B.| 000009d0 62 61 64 5f 63 6f 6d 6d 61 6e 64 20 20 20 5c 61 |bad_command \a| 000009e0 6e 79 20 6f 74 68 65 72 20 58 20 76 61 6c 75 65 |ny other X value| 000009f0 20 65 78 69 74 73 20 74 6f 20 6f 6c 64 20 75 73 | exits to old us| 00000a00 65 72 76 65 63 20 72 6f 75 74 69 6e 65 0d 04 38 |ervec routine..8| 00000a10 0e 4c 44 41 73 74 6f 72 65 5f 41 0d 04 42 0e 4c |.LDAstore_A..B.L| 00000a20 44 58 73 74 6f 72 65 5f 58 0d 04 4c 0e 4c 44 59 |DXstore_X..L.LDY| 00000a30 73 74 6f 72 65 5f 59 0d 04 56 0d 4a 4d 50 28 6f |store_Y..V.JMP(o| 00000a40 6c 64 76 29 0d 04 60 0c 2e 73 63 72 65 65 6e 73 |ldv)..`..screens| 00000a50 0d 04 6a 09 43 50 58 23 30 0d 04 74 0b 42 4e 45 |..j.CPX#0..t.BNE| 00000a60 78 5f 6f 6b 0d 04 7e 07 53 45 43 0d 04 88 12 4a |x_ok..~.SEC....J| 00000a70 4d 50 65 6e 64 5f 73 63 72 65 65 6e 73 0d 04 92 |MPend_screens...| 00000a80 09 2e 78 5f 6f 6b 0d 04 9c 0c 4a 53 52 63 68 65 |..x_ok....JSRche| 00000a90 63 6b 0d 04 a6 2f 43 50 59 23 30 20 20 5c 59 3d |ck.../CPY#0 \Y=| 00000aa0 30 20 6d 65 61 6e 73 20 73 77 69 74 63 68 20 6f |0 means switch o| 00000ab0 75 74 70 75 74 20 74 6f 20 73 63 72 65 65 6e 20 |utput to screen | 00000ac0 58 0d 04 b0 11 42 4e 45 6e 6f 74 5f 6f 75 74 70 |X....BNEnot_outp| 00000ad0 75 74 0d 04 ba 17 4a 53 52 6f 75 74 70 75 74 5f |ut....JSRoutput_| 00000ae0 74 6f 5f 73 63 72 65 65 6e 0d 04 c4 07 43 4c 43 |to_screen....CLC| 00000af0 0d 04 ce 12 4a 4d 50 65 6e 64 5f 73 63 72 65 65 |....JMPend_scree| 00000b00 6e 73 0d 04 d8 0f 2e 6e 6f 74 5f 6f 75 74 70 75 |ns.....not_outpu| 00000b10 74 0d 04 e2 25 43 50 59 23 31 20 20 5c 59 3d 31 |t...%CPY#1 \Y=1| 00000b20 20 6d 65 61 6e 73 20 72 65 76 65 61 6c 20 73 63 | means reveal sc| 00000b30 72 65 65 6e 20 58 0d 04 ec 11 42 4e 45 6e 6f 74 |reen X....BNEnot| 00000b40 5f 72 65 76 65 61 6c 0d 04 f6 14 4a 53 52 72 65 |_reveal....JSRre| 00000b50 76 65 61 6c 5f 73 63 72 65 65 6e 0d 05 00 07 43 |veal_screen....C| 00000b60 4c 43 0d 05 0a 12 4a 4d 50 65 6e 64 5f 73 63 72 |LC....JMPend_scr| 00000b70 65 65 6e 73 0d 05 14 0f 2e 6e 6f 74 5f 72 65 76 |eens.....not_rev| 00000b80 65 61 6c 0d 05 1e 33 43 50 59 23 32 20 20 5c 59 |eal...3CPY#2 \Y| 00000b90 3d 32 20 6d 65 61 6e 73 20 6f 75 74 70 75 74 20 |=2 means output | 00000ba0 74 6f 20 61 6e 64 20 72 65 76 65 61 6c 20 73 63 |to and reveal sc| 00000bb0 72 65 65 6e 20 58 0d 05 28 0c 42 45 51 6e 72 5f |reen X..(.BEQnr_| 00000bc0 6f 6b 0d 05 32 07 53 45 43 0d 05 3c 12 4a 4d 50 |ok..2.SEC..<.JMP| 00000bd0 65 6e 64 5f 73 63 72 65 65 6e 73 0d 05 46 0a 2e |end_screens..F..| 00000be0 6e 72 5f 6f 6b 0d 05 50 17 4a 53 52 6f 75 74 70 |nr_ok..P.JSRoutp| 00000bf0 75 74 5f 74 6f 5f 73 63 72 65 65 6e 0d 05 5a 14 |ut_to_screen..Z.| 00000c00 4a 53 52 72 65 76 65 61 6c 5f 73 63 72 65 65 6e |JSRreveal_screen| 00000c10 0d 05 64 07 43 4c 43 0d 05 6e 10 2e 65 6e 64 5f |..d.CLC..n..end_| 00000c20 73 63 72 65 65 6e 73 0d 05 78 07 52 54 53 0d 05 |screens..x.RTS..| 00000c30 82 15 2e 6f 75 74 70 75 74 5f 74 6f 5f 73 63 72 |...output_to_scr| 00000c40 65 65 6e 0d 05 8c 15 4a 53 52 63 75 72 72 65 6e |een....JSRcurren| 00000c50 74 5f 73 63 72 65 65 6e 0d 05 96 0e 43 50 58 73 |t_screen....CPXs| 00000c60 74 6f 72 65 5f 58 0d 05 a0 4c 42 45 51 65 6e 64 |tore_X...LBEQend| 00000c70 5f 6f 74 73 20 20 5c 69 66 20 73 63 72 65 65 6e |_ots \if screen| 00000c80 20 72 65 71 75 65 73 74 65 64 20 69 73 20 74 68 | requested is th| 00000c90 65 20 6f 6e 65 20 61 6c 72 65 61 64 79 20 75 73 |e one already us| 00000ca0 65 64 20 74 68 65 6e 20 64 6f 20 6e 6f 74 68 69 |ed then do nothi| 00000cb0 6e 67 0d 05 aa 2a 4a 53 52 73 77 61 70 5f 76 61 |ng...*JSRswap_va| 00000cc0 72 69 61 62 6c 65 73 20 5c 65 6c 73 65 20 73 77 |riables \else sw| 00000cd0 61 70 20 76 61 72 69 61 62 6c 65 73 0d 05 b4 0c |ap variables....| 00000ce0 2e 65 6e 64 5f 6f 74 73 0d 05 be 07 52 54 53 0d |.end_ots....RTS.| 00000cf0 05 c8 41 2e 72 65 76 5f 73 63 6e 20 42 52 4b 20 |..A.rev_scn BRK | 00000d00 5c 73 74 6f 72 65 20 66 6f 72 20 63 75 72 72 65 |\store for curre| 00000d10 6e 74 20 72 65 76 65 61 6c 65 64 20 73 63 72 65 |nt revealed scre| 00000d20 65 6e 20 73 74 61 72 74 20 61 64 64 72 65 73 73 |en start address| 00000d30 0d 05 d2 12 2e 72 65 76 65 61 6c 5f 73 63 72 65 |.....reveal_scre| 00000d40 65 6e 0d 05 dc 2c 4a 53 52 67 65 74 5f 73 74 61 |en...,JSRget_sta| 00000d50 72 74 20 5c 67 65 74 20 73 74 61 72 74 20 6f 66 |rt \get start of| 00000d60 20 73 63 72 65 65 6e 20 58 20 69 6e 20 41 0d 05 | screen X in A..| 00000d70 e6 0e 53 54 41 72 65 76 5f 73 63 6e 0d 05 f0 09 |..STArev_scn....| 00000d80 4c 53 52 20 41 0d 05 fa 09 4c 53 52 20 41 0d 06 |LSR A....LSR A..| 00000d90 04 17 4c 53 52 20 41 20 20 5c 64 69 76 69 64 65 |..LSR A \divide| 00000da0 20 62 79 20 38 0d 06 0e 13 53 54 41 72 65 76 5f | by 8....STArev_| 00000db0 63 6f 64 65 73 2b 31 37 0d 06 18 18 4c 44 41 23 |codes+17....LDA#| 00000dc0 72 65 76 5f 63 6f 64 65 73 20 83 20 26 31 30 30 |rev_codes . &100| 00000dd0 0d 06 22 0c 53 54 41 76 64 75 2b 31 0d 06 2c 18 |..".STAvdu+1..,.| 00000de0 4c 44 41 23 72 65 76 5f 63 6f 64 65 73 20 81 20 |LDA#rev_codes . | 00000df0 26 31 30 30 0d 06 36 0c 53 54 41 76 64 75 2b 32 |&100..6.STAvdu+2| 00000e00 0d 06 40 10 4c 44 58 72 65 76 5f 63 6f 64 65 73 |..@.LDXrev_codes| 00000e10 0d 06 4a 31 4a 53 52 76 64 75 20 20 20 20 5c 63 |..J1JSRvdu \c| 00000e20 68 61 6e 67 65 20 36 38 34 35 20 43 52 54 43 20 |hange 6845 CRTC | 00000e30 72 65 67 69 73 74 65 72 73 20 31 32 20 26 20 31 |registers 12 & 1| 00000e40 33 0d 06 54 07 52 54 53 0d 06 5e 0e 2e 72 65 76 |3..T.RTS..^..rev| 00000e50 5f 63 6f 64 65 73 0d 06 68 16 45 51 55 42 28 32 |_codes..h.EQUB(2| 00000e60 30 29 20 5c 32 30 20 62 79 74 65 73 0d 06 72 34 |0) \20 bytes..r4| 00000e70 45 51 55 44 28 30 29 20 20 5c 65 71 75 69 76 20 |EQUD(0) \equiv | 00000e80 74 6f 20 ef 32 33 3b 31 32 2c 78 3b 30 3b 30 3b |to .23;12,x;0;0;| 00000e90 30 3b 32 33 3b 31 33 2c 30 3b 30 3b 30 3b 30 3b |0;23;13,0;0;0;0;| 00000ea0 0d 06 7c 13 45 51 55 44 28 26 30 44 30 30 30 30 |..|.EQUD(&0D0000| 00000eb0 30 30 29 0d 06 86 13 45 51 55 44 28 26 30 30 30 |00)....EQUD(&000| 00000ec0 30 31 37 30 30 29 0d 06 90 0b 45 51 55 44 28 30 |01700)....EQUD(0| 00000ed0 29 0d 06 9a 33 45 51 55 44 28 26 31 37 30 30 30 |)...3EQUD(&17000| 00000ee0 43 46 46 29 20 20 5c 22 46 46 22 20 73 65 74 20 |CFF) \"FF" set | 00000ef0 75 70 20 62 79 20 72 65 76 65 61 6c 20 72 6f 75 |up by reveal rou| 00000f00 74 69 6e 65 0d 06 a4 4b 2e 6e 6f 5f 74 65 78 74 |tine...K.no_text| 00000f10 77 69 6e 64 20 20 5c 73 65 74 20 74 65 78 74 20 |wind \set text | 00000f20 77 69 6e 64 6f 77 20 6f 66 20 63 75 72 72 65 6e |window of curren| 00000f30 74 20 6f 75 74 70 75 74 20 73 63 72 65 65 6e 20 |t output screen | 00000f40 74 6f 20 77 68 6f 6c 65 20 73 63 72 65 65 6e 0d |to whole screen.| 00000f50 06 ae 17 4c 44 41 23 74 5f 77 69 6e 64 6f 77 20 |...LDA#t_window | 00000f60 83 20 26 31 30 30 0d 06 b8 0c 53 54 41 76 64 75 |. &100....STAvdu| 00000f70 2b 31 0d 06 c2 17 4c 44 41 23 74 5f 77 69 6e 64 |+1....LDA#t_wind| 00000f80 6f 77 20 81 20 26 31 30 30 0d 06 cc 0c 53 54 41 |ow . &100....STA| 00000f90 76 64 75 2b 32 0d 06 d6 0f 4c 44 58 74 5f 77 69 |vdu+2....LDXt_wi| 00000fa0 6e 64 6f 77 0d 06 e0 0a 4a 53 52 76 64 75 0d 06 |ndow....JSRvdu..| 00000fb0 ea 07 52 54 53 0d 06 f4 2c 2e 74 5f 77 69 6e 64 |..RTS...,.t_wind| 00000fc0 6f 77 20 5c 73 74 6f 72 65 20 66 6f 72 20 64 65 |ow \store for de| 00000fd0 66 61 75 6c 74 20 74 65 78 74 20 77 69 6e 64 6f |fault text windo| 00000fe0 77 0d 06 fe 14 45 51 55 42 28 36 29 20 5c 36 20 |w....EQUB(6) \6 | 00000ff0 62 79 74 65 73 0d 07 08 37 45 51 55 44 28 26 30 |bytes...7EQUD(&0| 00001000 30 31 45 29 20 20 5c 73 65 71 75 65 6e 63 65 20 |01E) \sequence | 00001010 65 6e 64 73 20 69 6e 20 33 30 20 28 74 6f 20 73 |ends in 30 (to s| 00001020 69 6d 75 6c 61 74 65 20 ef 32 36 29 0d 07 12 40 |imulate .26)...@| 00001030 45 51 55 57 28 30 29 20 5c 73 65 74 20 62 79 20 |EQUW(0) \set by | 00001040 73 65 74 5f 75 70 20 72 6f 75 74 69 6e 65 20 74 |set_up routine t| 00001050 6f 20 32 38 2c 61 2c 62 2c 63 2c 64 2c 33 30 20 |o 28,a,b,c,d,30 | 00001060 28 69 6e 20 72 65 76 65 72 73 65 29 0d 07 1c 36 |(in reverse)...6| 00001070 2e 6e 6f 5f 67 72 61 70 68 77 69 6e 64 20 5c 73 |.no_graphwind \s| 00001080 65 74 20 67 72 61 70 68 69 63 73 20 77 69 6e 64 |et graphics wind| 00001090 6f 77 20 74 6f 20 77 68 6f 6c 65 20 73 63 72 65 |ow to whole scre| 000010a0 65 6e 0d 07 26 18 4c 44 41 23 6e 67 77 5f 63 6f |en..&.LDA#ngw_co| 000010b0 64 65 73 20 83 20 26 31 30 30 0d 07 30 0c 53 54 |des . &100..0.ST| 000010c0 41 76 64 75 2b 31 0d 07 3a 18 4c 44 41 23 6e 67 |Avdu+1..:.LDA#ng| 000010d0 77 5f 63 6f 64 65 73 20 81 20 26 31 30 30 0d 07 |w_codes . &100..| 000010e0 44 0c 53 54 41 76 64 75 2b 32 0d 07 4e 10 4c 44 |D.STAvdu+2..N.LD| 000010f0 58 6e 67 77 5f 63 6f 64 65 73 0d 07 58 0a 4a 53 |Xngw_codes..X.JS| 00001100 52 76 64 75 0d 07 62 07 52 54 53 0d 07 6c 0e 2e |Rvdu..b.RTS..l..| 00001110 6e 67 77 5f 63 6f 64 65 73 0d 07 76 16 45 51 55 |ngw_codes..v.EQU| 00001120 42 28 32 30 29 20 5c 32 30 20 62 79 74 65 73 0d |B(20) \20 bytes.| 00001130 07 80 39 45 51 55 44 28 30 29 20 20 5c 65 71 75 |..9EQUD(0) \equ| 00001140 69 76 20 74 6f 20 ef 32 39 2c 30 3b 30 3b 32 34 |iv to .29,0;0;24| 00001150 2c 30 3b 30 3b 31 32 37 39 3b 31 30 32 33 3b 32 |,0;0;1279;1023;2| 00001160 35 2c 34 2c 30 3b 30 3b 0d 07 8a 13 45 51 55 44 |5,4,0;0;....EQUD| 00001170 28 26 46 46 30 33 31 39 30 34 29 0d 07 94 13 45 |(&FF031904)....E| 00001180 51 55 44 28 26 30 30 30 30 46 46 30 34 29 0d 07 |QUD(&0000FF04)..| 00001190 9e 13 45 51 55 44 28 26 30 30 31 38 30 30 30 30 |..EQUD(&00180000| 000011a0 29 0d 07 a8 13 45 51 55 44 28 26 31 44 30 30 30 |)....EQUD(&1D000| 000011b0 30 30 30 29 0d 07 b2 3e 2e 63 6f 70 79 5f 73 63 |000)...>.copy_sc| 000011c0 72 65 65 6e 20 20 5c 72 65 6c 69 65 73 20 6f 6e |reen \relies on| 000011d0 20 73 63 72 65 65 6e 73 20 73 74 61 72 74 69 6e | screens startin| 000011e0 67 20 61 74 20 70 61 67 65 20 62 6f 75 6e 64 61 |g at page bounda| 000011f0 72 79 0d 07 bc 40 4a 53 52 63 75 72 72 65 6e 74 |ry...@JSRcurrent| 00001200 5f 73 63 72 65 65 6e 20 20 20 5c 61 6e 64 20 6c |_screen \and l| 00001210 6f 2d 62 79 74 65 20 6f 66 20 6c 65 6e 67 74 68 |o-byte of length| 00001220 20 61 6c 77 61 79 73 20 62 65 69 6e 67 20 7a 65 | always being ze| 00001230 72 6f 0d 07 c6 09 43 50 58 23 31 0d 07 d0 11 42 |ro....CPX#1....B| 00001240 4e 45 74 77 6f 5f 74 6f 5f 6f 6e 65 0d 07 da 0d |NEtwo_to_one....| 00001250 4c 44 58 73 63 72 65 65 6e 0d 07 e4 0f 4c 44 59 |LDXscreen....LDY| 00001260 73 63 72 65 65 6e 2b 31 0d 07 ee 0f 4a 4d 50 6d |screen+1....JMPm| 00001270 6f 76 65 5f 6d 65 6d 0d 07 f8 0f 2e 74 77 6f 5f |ove_mem.....two_| 00001280 74 6f 5f 6f 6e 65 0d 08 02 0f 4c 44 58 73 63 72 |to_one....LDXscr| 00001290 65 65 6e 2b 31 0d 08 0c 0d 4c 44 59 73 63 72 65 |een+1....LDYscre| 000012a0 65 6e 0d 08 16 0d 2e 6d 6f 76 65 5f 6d 65 6d 0d |en.....move_mem.| 000012b0 08 20 0f 53 54 58 73 74 61 72 74 31 2b 32 0d 08 |. .STXstart1+2..| 000012c0 2a 0f 53 54 59 73 74 61 72 74 32 2b 32 0d 08 34 |*.STYstart2+2..4| 000012d0 09 4c 44 41 23 30 0d 08 3e 0f 53 54 41 73 74 61 |.LDA#0..>.STAsta| 000012e0 72 74 31 2b 31 0d 08 48 0f 53 54 41 73 74 61 72 |rt1+1..H.STAstar| 000012f0 74 32 2b 31 0d 08 52 09 4c 44 59 23 30 0d 08 5c |t2+1..R.LDY#0..\| 00001300 0d 4c 44 58 6c 65 6e 67 74 68 0d 08 66 0b 2e 73 |.LDXlength..f..s| 00001310 74 61 72 74 31 0d 08 70 1e 4c 44 41 26 46 46 46 |tart1..p.LDA&FFF| 00001320 46 2c 59 20 20 5c 64 75 6d 6d 79 20 6f 70 65 72 |F,Y \dummy oper| 00001330 61 6e 64 0d 08 7a 0b 2e 73 74 61 72 74 32 0d 08 |and..z..start2..| 00001340 84 1e 53 54 41 26 46 46 46 46 2c 59 20 20 5c 64 |..STA&FFFF,Y \d| 00001350 75 6d 6d 79 20 6f 70 65 72 61 6e 64 0d 08 8e 07 |ummy operand....| 00001360 49 4e 59 0d 08 98 0d 42 4e 45 73 74 61 72 74 31 |INY....BNEstart1| 00001370 0d 08 a2 0f 49 4e 43 73 74 61 72 74 31 2b 32 0d |....INCstart1+2.| 00001380 08 ac 0f 49 4e 43 73 74 61 72 74 32 2b 32 0d 08 |...INCstart2+2..| 00001390 b6 07 44 45 58 0d 08 c0 0d 42 4e 45 73 74 61 72 |..DEX....BNEstar| 000013a0 74 31 0d 08 ca 07 52 54 53 0d 08 d4 10 2e 74 65 |t1....RTS.....te| 000013b0 6c 6c 5f 6f 75 74 70 75 74 0d 08 de 15 4a 53 52 |ll_output....JSR| 000013c0 66 6c 75 73 68 5f 6b 65 79 62 6f 61 72 64 0d 08 |flush_keyboard..| 000013d0 e8 15 4a 53 52 63 75 72 72 65 6e 74 5f 73 63 72 |..JSRcurrent_scr| 000013e0 65 65 6e 0d 08 f2 07 54 58 41 0d 08 fc 07 43 4c |een....TXA....CL| 000013f0 43 0d 09 06 0a 41 44 43 23 34 38 0d 09 10 07 54 |C....ADC#48....T| 00001400 41 59 0d 09 1a 14 4a 53 52 70 6f 6b 65 5f 6b 65 |AY....JSRpoke_ke| 00001410 79 62 6f 61 72 64 0d 09 24 07 52 54 53 0d 09 2e |yboard..$.RTS...| 00001420 11 2e 74 65 6c 6c 5f 64 69 73 70 6c 61 79 0d 09 |..tell_display..| 00001430 38 15 4a 53 52 66 6c 75 73 68 5f 6b 65 79 62 6f |8.JSRflush_keybo| 00001440 61 72 64 0d 09 42 0a 4c 44 59 23 34 39 0d 09 4c |ard..B.LDY#49..L| 00001450 0e 4c 44 41 72 65 76 5f 73 63 6e 0d 09 56 0d 43 |.LDArev_scn..V.C| 00001460 4d 50 73 63 72 65 65 6e 0d 09 60 0a 42 45 51 73 |MPscreen..`.BEQs| 00001470 63 31 0d 09 6a 07 49 4e 59 0d 09 74 08 2e 73 63 |c1..j.INY..t..sc| 00001480 31 0d 09 7e 14 4a 53 52 70 6f 6b 65 5f 6b 65 79 |1..~.JSRpoke_key| 00001490 62 6f 61 72 64 0d 09 88 07 52 54 53 0d 09 92 13 |board....RTS....| 000014a0 2e 66 6c 75 73 68 5f 6b 65 79 62 6f 61 72 64 0d |.flush_keyboard.| 000014b0 09 9c 0a 4c 44 41 23 32 31 0d 09 a6 09 4c 44 58 |...LDA#21....LDX| 000014c0 23 30 0d 09 b0 0d 4a 53 52 6f 73 62 79 74 65 0d |#0....JSRosbyte.| 000014d0 09 ba 07 52 54 53 0d 09 c4 37 2e 70 6f 6b 65 5f |...RTS...7.poke_| 000014e0 6b 65 79 62 6f 61 72 64 20 20 5c 70 75 74 20 63 |keyboard \put c| 000014f0 68 61 72 20 69 6e 20 59 20 69 6e 74 6f 20 6b 65 |har in Y into ke| 00001500 79 62 6f 61 72 64 20 62 75 66 66 65 72 0d 09 ce |yboard buffer...| 00001510 0b 4c 44 41 23 31 33 38 0d 09 d8 09 4c 44 58 23 |.LDA#138....LDX#| 00001520 30 0d 09 e2 0d 4a 53 52 6f 73 62 79 74 65 0d 09 |0....JSRosbyte..| 00001530 ec 07 52 54 53 0d 09 f6 34 2e 67 65 74 5f 73 74 |..RTS...4.get_st| 00001540 61 72 74 20 20 5c 72 65 74 75 72 6e 20 68 69 2d |art \return hi-| 00001550 62 79 74 65 20 6f 66 20 73 63 72 65 65 6e 20 73 |byte of screen s| 00001560 74 61 72 74 20 69 6e 20 41 0d 0a 00 0e 4c 44 58 |tart in A....LDX| 00001570 73 74 6f 72 65 5f 58 0d 0a 0a 07 44 45 58 0d 0a |store_X....DEX..| 00001580 14 0f 4c 44 41 73 63 72 65 65 6e 2c 58 0d 0a 1e |..LDAscreen,X...| 00001590 07 52 54 53 0d 0a 28 36 2e 76 64 75 20 20 5c 6f |.RTS..(6.vdu \o| 000015a0 75 74 70 75 74 20 ef 20 63 6f 64 65 73 2e 20 4e |utput . codes. N| 000015b0 75 6d 62 65 72 20 6f 66 20 62 79 74 65 73 20 70 |umber of bytes p| 000015c0 61 73 73 65 64 20 69 6e 20 58 0d 0a 32 1e 4c 44 |assed in X..2.LD| 000015d0 41 26 46 46 46 46 2c 58 20 20 5c 64 75 6d 6d 79 |A&FFFF,X \dummy| 000015e0 20 6f 70 65 72 61 6e 64 0d 0a 3c 0d 4a 53 52 6f | operand..<.JSRo| 000015f0 73 77 72 63 68 0d 0a 46 3d 44 45 58 20 20 20 5c |swrch..F=DEX \| 00001600 6e 6f 74 65 20 6c 69 73 74 20 69 73 20 61 63 63 |note list is acc| 00001610 65 73 73 65 64 20 66 72 6f 6d 20 65 6e 64 2e 20 |essed from end. | 00001620 53 65 74 20 75 70 20 69 6e 20 72 65 76 65 72 73 |Set up in revers| 00001630 65 2e 0d 0a 50 0a 42 4e 45 76 64 75 0d 0a 5a 07 |e...P.BNEvdu..Z.| 00001640 52 54 53 0d 0a 64 41 2e 63 75 72 72 65 6e 74 5f |RTS..dA.current_| 00001650 73 63 72 65 65 6e 20 20 5c 72 65 74 75 72 6e 73 |screen \returns| 00001660 20 63 75 72 72 65 6e 74 20 6f 75 74 70 75 74 20 | current output | 00001670 73 63 72 65 65 6e 20 28 31 20 6f 72 20 32 29 20 |screen (1 or 2) | 00001680 69 6e 20 58 0d 0a 6e 09 4c 44 58 23 31 0d 0a 78 |in X..n.LDX#1..x| 00001690 0b 4c 44 41 26 33 34 45 0d 0a 82 0d 43 4d 50 73 |.LDA&34E....CMPs| 000016a0 63 72 65 65 6e 0d 0a 8c 0d 42 45 51 65 6e 64 5f |creen....BEQend_| 000016b0 63 73 0d 0a 96 07 49 4e 58 0d 0a a0 0b 2e 65 6e |cs....INX.....en| 000016c0 64 5f 63 73 0d 0a aa 07 52 54 53 0d 0a b4 3b 2e |d_cs....RTS...;.| 000016d0 70 61 6c 65 74 74 65 5f 73 77 69 74 63 68 20 20 |palette_switch | 000016e0 5c 73 65 74 20 66 6c 61 67 20 66 6f 72 20 73 65 |\set flag for se| 000016f0 70 61 72 61 74 65 2f 63 6f 6d 6d 6f 6e 20 70 61 |parate/common pa| 00001700 6c 65 74 74 65 73 0d 0a be 09 4c 44 41 23 30 0d |lettes....LDA#0.| 00001710 0a c8 0e 53 54 41 70 61 6c 65 74 74 65 0d 0a d2 |...STApalette...| 00001720 0a 43 50 58 23 32 30 0d 0a dc 0e 42 4e 45 6e 6f |.CPX#20....BNEno| 00001730 74 5f 6f 66 66 0d 0a e6 39 49 4e 43 70 61 6c 65 |t_off...9INCpale| 00001740 74 74 65 20 20 5c 70 61 6c 65 74 74 65 3d 31 20 |tte \palette=1 | 00001750 69 66 20 58 3d 32 30 20 28 6e 6f 20 73 65 70 61 |if X=20 (no sepa| 00001760 72 61 74 65 20 70 61 6c 65 74 74 65 73 29 0d 0a |rate palettes)..| 00001770 f0 0c 2e 6e 6f 74 5f 6f 66 66 0d 0a fa 07 52 54 |...not_off....RT| 00001780 53 0d 0b 04 2d 2e 63 68 65 63 6b 20 20 5c 63 68 |S...-.check \ch| 00001790 65 63 6b 20 69 66 20 65 6e 61 62 6c 65 64 20 6f |eck if enabled o| 000017a0 72 20 6d 6f 64 65 20 63 68 61 6e 67 65 64 0d 0b |r mode changed..| 000017b0 0e 0e 4c 44 41 65 6e 61 62 6c 65 64 0d 0b 18 11 |..LDAenabled....| 000017c0 42 4e 45 63 68 65 63 6b 5f 6d 6f 64 65 0d 0b 22 |BNEcheck_mode.."| 000017d0 39 42 52 4b 20 20 20 20 5c 67 65 6e 65 72 61 74 |9BRK \generat| 000017e0 65 20 65 72 72 6f 72 20 69 66 20 6e 6f 74 20 73 |e error if not s| 000017f0 65 74 20 75 70 20 28 77 69 74 68 20 2a 43 4f 44 |et up (with *COD| 00001800 45 32 32 2c 59 29 0d 0b 2c 0d 45 51 55 42 28 32 |E22,Y)..,.EQUB(2| 00001810 35 34 29 0d 0b 36 16 45 51 55 53 28 22 4e 6f 74 |54)..6.EQUS("Not| 00001820 20 73 65 74 20 75 70 22 29 0d 0b 40 07 42 52 4b | set up")..@.BRK| 00001830 0d 0b 4a 0f 2e 63 68 65 63 6b 5f 6d 6f 64 65 0d |..J..check_mode.| 00001840 0b 54 28 4c 44 41 26 33 35 35 20 20 5c 26 33 35 |.T(LDA&355 \&35| 00001850 35 20 63 6f 6e 74 61 69 6e 73 20 63 75 72 72 65 |5 contains curre| 00001860 6e 74 20 6d 6f 64 65 0d 0b 5e 0b 43 4d 50 6d 6f |nt mode..^.CMPmo| 00001870 64 65 0d 0b 68 13 42 4e 45 6d 6f 64 65 5f 63 68 |de..h.BNEmode_ch| 00001880 61 6e 67 65 64 0d 0b 72 07 52 54 53 0d 0b 7c 44 |anged..r.RTS..|D| 00001890 2e 6d 6f 64 65 5f 63 68 61 6e 67 65 64 20 20 20 |.mode_changed | 000018a0 5c 67 65 6e 65 72 61 74 65 20 65 72 72 6f 72 20 |\generate error | 000018b0 69 66 20 6d 6f 64 65 20 68 61 73 20 63 68 61 6e |if mode has chan| 000018c0 67 65 64 20 73 69 6e 63 65 20 73 65 74 20 75 70 |ged since set up| 000018d0 0d 0b 86 07 42 52 4b 0d 0b 90 0d 45 51 55 42 28 |....BRK....EQUB(| 000018e0 32 35 33 29 0d 0b 9a 16 45 51 55 53 22 4d 6f 64 |253)....EQUS"Mod| 000018f0 65 20 63 68 61 6e 67 65 64 22 0d 0b a4 07 42 52 |e changed"....BR| 00001900 4b 0d 0b ae 0c 2e 65 6e 61 62 6c 65 64 0d 0b b8 |K.....enabled...| 00001910 07 42 52 4b 0d 0b c2 42 2e 73 77 61 70 5f 76 61 |.BRK...B.swap_va| 00001920 72 69 61 62 6c 65 73 20 20 5c 73 77 61 70 20 63 |riables \swap c| 00001930 75 72 72 65 6e 74 20 76 61 72 69 61 62 6c 65 73 |urrent variables| 00001940 20 77 69 74 68 20 73 74 6f 72 65 64 20 76 61 72 | with stored var| 00001950 69 61 62 6c 65 73 0d 0b cc 09 4c 44 58 23 30 0d |iables....LDX#0.| 00001960 0b d6 0e 2e 73 77 61 70 5f 6c 6f 6f 70 0d 0b e0 |....swap_loop...| 00001970 0d 4c 44 41 26 33 30 30 2c 58 0d 0b ea 07 50 48 |.LDA&300,X....PH| 00001980 41 0d 0b f4 0e 4c 44 41 73 74 6f 72 65 2c 58 0d |A....LDAstore,X.| 00001990 0b fe 0d 53 54 41 26 33 30 30 2c 58 0d 0c 08 07 |...STA&300,X....| 000019a0 50 4c 41 0d 0c 12 0e 53 54 41 73 74 6f 72 65 2c |PLA....STAstore,| 000019b0 58 0d 0c 1c 07 49 4e 58 0d 0c 26 0b 43 50 58 23 |X....INX..&.CPX#| 000019c0 26 37 46 0d 0c 30 10 42 4e 45 73 77 61 70 5f 6c |&7F..0.BNEswap_l| 000019d0 6f 6f 70 0d 0c 3a 09 4c 44 58 23 30 0d 0c 44 10 |oop..:.LDX#0..D.| 000019e0 2e 73 77 61 70 7a 70 5f 6c 6f 6f 70 0d 0c 4e 0c |.swapzp_loop..N.| 000019f0 4c 44 41 26 44 30 2c 58 0d 0c 58 07 50 48 41 0d |LDA&D0,X..X.PHA.| 00001a00 0c 62 11 4c 44 41 7a 70 5f 73 74 6f 72 65 2c 58 |.b.LDAzp_store,X| 00001a10 0d 0c 6c 0c 53 54 41 26 44 30 2c 58 0d 0c 76 07 |..l.STA&D0,X..v.| 00001a20 50 4c 41 0d 0c 80 11 53 54 41 7a 70 5f 73 74 6f |PLA....STAzp_sto| 00001a30 72 65 2c 58 0d 0c 8a 07 49 4e 58 0d 0c 94 0a 43 |re,X....INX....C| 00001a40 50 58 23 26 41 0d 0c 9e 12 42 4e 45 73 77 61 70 |PX#&A....BNEswap| 00001a50 7a 70 5f 6c 6f 6f 70 0d 0c a8 0e 4c 44 41 70 61 |zp_loop....LDApa| 00001a60 6c 65 74 74 65 0d 0c b2 3d 42 4e 45 6e 6f 74 5f |lette...=BNEnot_| 00001a70 70 61 6c 65 74 74 65 20 5c 69 66 20 70 61 6c 65 |palette \if pale| 00001a80 74 74 65 3c 3e 30 20 74 68 65 6e 20 69 67 6e 6f |tte<>0 then igno| 00001a90 72 65 20 70 61 6c 65 74 74 65 20 63 68 61 6e 67 |re palette chang| 00001aa0 65 73 0d 0c bc 48 4c 44 41 26 33 36 30 20 20 20 |es...HLDA&360 | 00001ab0 5c 26 33 36 30 20 63 6f 6e 74 61 69 6e 73 20 6e |\&360 contains n| 00001ac0 75 6d 62 65 72 20 6f 66 20 63 6f 6c 6f 75 72 73 |umber of colours| 00001ad0 20 69 6e 20 63 75 72 72 65 6e 74 20 6d 6f 64 65 | in current mode| 00001ae0 20 6d 69 6e 75 73 20 6f 6e 65 0d 0c c6 11 53 54 | minus one....ST| 00001af0 41 6e 6f 5f 63 6f 6c 6f 75 72 73 0d 0c d0 11 49 |Ano_colours....I| 00001b00 4e 43 6e 6f 5f 63 6f 6c 6f 75 72 73 0d 0c da 09 |NCno_colours....| 00001b10 4c 44 58 23 30 0d 0c e4 11 2e 70 61 6c 65 74 74 |LDX#0.....palett| 00001b20 65 5f 6c 6f 6f 70 0d 0c ee 35 4c 44 41 26 33 36 |e_loop...5LDA&36| 00001b30 46 2c 58 20 20 20 20 5c 26 33 36 46 20 2d 20 26 |F,X \&36F - &| 00001b40 33 37 45 20 63 6f 6e 74 61 69 6e 20 63 75 72 72 |37E contain curr| 00001b50 65 6e 74 20 70 61 6c 65 74 74 65 0d 0c f8 13 53 |ent palette....S| 00001b60 54 58 6f 73 77 6f 72 64 5f 62 6c 6f 63 6b 0d 0d |TXosword_block..| 00001b70 02 15 53 54 41 6f 73 77 6f 72 64 5f 62 6c 6f 63 |..STAosword_bloc| 00001b80 6b 2b 31 0d 0d 0c 07 54 58 41 0d 0d 16 07 50 48 |k+1....TXA....PH| 00001b90 41 0d 0d 20 48 4c 44 41 23 26 43 20 20 20 20 20 |A.. HLDA#&C | 00001ba0 20 20 5c 75 73 65 20 6f 73 77 6f 72 64 20 26 43 | \use osword &C| 00001bb0 20 74 6f 20 70 72 6f 67 72 61 6d 20 56 69 64 65 | to program Vide| 00001bc0 6f 20 55 4c 41 20 77 69 74 68 20 73 74 6f 72 65 |o ULA with store| 00001bd0 64 20 70 61 6c 65 74 74 65 0d 0d 2a 2d 4c 44 58 |d palette..*-LDX| 00001be0 23 6f 73 77 6f 72 64 5f 62 6c 6f 63 6b 20 83 20 |#osword_block . | 00001bf0 26 31 30 30 20 20 5c 66 61 73 74 65 72 20 74 68 |&100 \faster th| 00001c00 61 6e 20 ef 31 39 0d 0d 34 1b 4c 44 59 23 6f 73 |an .19..4.LDY#os| 00001c10 77 6f 72 64 5f 62 6c 6f 63 6b 20 81 20 26 31 30 |word_block . &10| 00001c20 30 0d 0d 3e 0d 4a 53 52 6f 73 77 6f 72 64 0d 0d |0..>.JSRosword..| 00001c30 48 07 50 4c 41 0d 0d 52 07 54 41 58 0d 0d 5c 07 |H.PLA..R.TAX..\.| 00001c40 49 4e 58 0d 0d 66 11 43 50 58 6e 6f 5f 63 6f 6c |INX..f.CPXno_col| 00001c50 6f 75 72 73 0d 0d 70 13 42 43 43 70 61 6c 65 74 |ours..p.BCCpalet| 00001c60 74 65 5f 6c 6f 6f 70 0d 0d 7a 10 2e 6e 6f 74 5f |te_loop..z..not_| 00001c70 70 61 6c 65 74 74 65 0d 0d 84 07 52 54 53 0d 0d |palette....RTS..| 00001c80 8e 2a 2e 69 6e 69 74 69 61 6c 69 73 65 20 20 20 |.*.initialise | 00001c90 20 5c 63 61 6c 6c 65 64 20 61 66 74 65 72 20 2a | \called after *| 00001ca0 63 6f 64 65 32 32 2c 59 0d 0d 98 09 43 50 59 23 |code22,Y....CPY#| 00001cb0 37 0d 0d a2 0d 42 43 53 6e 6f 5f 77 61 79 0d 0d |7....BCSno_way..| 00001cc0 ac 09 43 50 59 23 34 0d 0d b6 34 42 43 43 6e 6f |..CPY#4...4BCCno| 00001cd0 5f 77 61 79 20 20 5c 69 66 20 6e 6f 74 20 4d 6f |_way \if not Mo| 00001ce0 64 65 20 34 2c 35 20 6f 72 20 36 20 74 68 65 6e |de 4,5 or 6 then| 00001cf0 20 66 6c 61 67 20 65 72 72 6f 72 0d 0d c0 0b 53 | flag error....S| 00001d00 54 59 6d 6f 64 65 0d 0d ca 0a 4c 44 41 23 32 32 |TYmode....LDA#22| 00001d10 0d 0d d4 0d 4a 53 52 6f 73 77 72 63 68 0d 0d de |....JSRoswrch...| 00001d20 07 54 59 41 0d 0d e8 21 4a 53 52 6f 73 77 72 63 |.TYA...!JSRoswrc| 00001d30 68 20 20 20 5c 63 68 61 6e 67 65 20 74 6f 20 4d |h \change to M| 00001d40 6f 64 65 20 59 0d 0d f2 37 4c 44 41 26 33 35 34 |ode Y...7LDA&354| 00001d50 20 20 20 20 5c 73 74 6f 72 65 20 6c 65 6e 67 74 | \store lengt| 00001d60 68 20 6f 66 20 73 63 72 65 65 6e 20 6d 65 6d 6f |h of screen memo| 00001d70 72 79 20 28 68 69 2d 62 79 74 65 29 0d 0d fc 0d |ry (hi-byte)....| 00001d80 53 54 41 6c 65 6e 67 74 68 0d 0e 06 0b 4c 44 41 |STAlength....LDA| 00001d90 26 33 34 45 0d 0e 10 3e 53 54 41 73 63 72 65 65 |&34E...>STAscree| 00001da0 6e 20 20 5c 73 74 6f 72 65 20 62 6f 74 74 6f 6d |n \store bottom| 00001db0 20 6f 66 20 6e 6f 72 6d 61 6c 20 73 63 72 65 65 | of normal scree| 00001dc0 6e 20 6d 65 6d 6f 72 79 20 28 68 69 2d 62 79 74 |n memory (hi-byt| 00001dd0 65 29 0d 0e 1a 07 53 45 43 0d 0e 24 28 53 42 43 |e)....SEC..$(SBC| 00001de0 6c 65 6e 67 74 68 20 5c 73 75 62 74 72 61 63 74 |length \subtract| 00001df0 20 6c 65 6e 67 74 68 20 6f 66 20 73 63 72 65 65 | length of scree| 00001e00 6e 0d 0e 2e 36 53 54 41 73 63 72 65 65 6e 2b 31 |n...6STAscreen+1| 00001e10 20 20 5c 73 74 6f 72 65 20 73 74 61 72 74 20 61 | \store start a| 00001e20 64 64 72 65 73 73 20 66 6f 72 20 65 78 74 72 61 |ddress for extra| 00001e30 20 73 63 72 65 65 6e 0d 0e 38 0a 4c 44 41 23 32 | screen..8.LDA#2| 00001e40 38 0d 0e 42 11 53 54 41 74 5f 77 69 6e 64 6f 77 |8..B.STAt_window| 00001e50 2b 36 0d 0e 4c 09 4c 44 58 23 30 0d 0e 56 09 4c |+6..L.LDX#0..V.L| 00001e60 44 59 23 34 0d 0e 60 25 2e 77 6c 6f 6f 70 20 5c |DY#4..`%.wloop \| 00001e70 73 74 6f 72 65 20 64 65 66 61 75 6c 74 20 74 65 |store default te| 00001e80 78 74 20 77 69 6e 64 6f 77 0d 0e 6a 0d 4c 44 41 |xt window..j.LDA| 00001e90 26 33 30 38 2c 58 0d 0e 74 13 53 54 41 74 5f 77 |&308,X..t.STAt_w| 00001ea0 69 6e 64 6f 77 2b 31 2c 59 0d 0e 7e 07 49 4e 58 |indow+1,Y..~.INX| 00001eb0 0d 0e 88 07 44 45 59 0d 0e 92 0c 42 4e 45 77 6c |....DEY....BNEwl| 00001ec0 6f 6f 70 0d 0e 9c 12 4a 53 52 6e 6f 5f 74 65 78 |oop....JSRno_tex| 00001ed0 74 77 69 6e 64 0d 0e a6 09 4c 44 58 23 30 0d 0e |twind....LDX#0..| 00001ee0 b0 3d 2e 73 75 5f 6c 6f 6f 70 20 20 5c 73 74 6f |.=.su_loop \sto| 00001ef0 72 65 20 64 65 66 61 75 6c 74 20 ef 20 76 61 72 |re default . var| 00001f00 69 61 62 6c 65 73 20 66 72 6f 6d 20 70 61 67 65 |iables from page| 00001f10 20 33 20 69 6e 20 73 74 6f 72 65 0d 0e ba 0d 4c | 3 in store....L| 00001f20 44 41 26 33 30 30 2c 58 0d 0e c4 0e 53 54 41 73 |DA&300,X....STAs| 00001f30 74 6f 72 65 2c 58 0d 0e ce 07 49 4e 58 0d 0e d8 |tore,X....INX...| 00001f40 0b 43 50 58 23 26 37 46 0d 0e e2 0e 42 4e 45 73 |.CPX#&7F....BNEs| 00001f50 75 5f 6c 6f 6f 70 0d 0e ec 09 4c 44 58 23 30 0d |u_loop....LDX#0.| 00001f60 0e f6 0d 2e 73 75 5f 6c 6f 6f 70 32 0d 0f 00 46 |....su_loop2...F| 00001f70 4c 44 41 26 44 30 2c 58 20 20 20 5c 73 74 6f 72 |LDA&D0,X \stor| 00001f80 65 20 64 65 66 61 75 6c 74 20 76 64 75 20 76 61 |e default vdu va| 00001f90 72 69 61 62 6c 65 73 20 66 72 6f 6d 20 7a 65 72 |riables from zer| 00001fa0 6f 20 70 61 67 65 20 69 6e 20 7a 70 5f 73 74 6f |o page in zp_sto| 00001fb0 72 65 0d 0f 0a 11 53 54 41 7a 70 5f 73 74 6f 72 |re....STAzp_stor| 00001fc0 65 2c 58 0d 0f 14 07 49 4e 58 0d 0f 1e 0a 43 50 |e,X....INX....CP| 00001fd0 58 23 26 41 0d 0f 28 0f 42 4e 45 73 75 5f 6c 6f |X#&A..(.BNEsu_lo| 00001fe0 6f 70 32 0d 0f 32 4b 4c 44 41 73 63 72 65 65 6e |op2..2KLDAscreen| 00001ff0 2b 31 20 5c 61 6c 74 65 72 20 76 61 6c 75 65 20 |+1 \alter value | 00002000 6f 66 20 73 63 72 65 65 6e 20 73 74 61 72 74 20 |of screen start | 00002010 69 6e 20 73 74 6f 72 65 20 74 6f 20 74 68 61 74 |in store to that| 00002020 20 6f 66 20 6e 65 77 20 73 63 72 65 65 6e 0d 0f | of new screen..| 00002030 3c 10 53 54 41 73 74 6f 72 65 2b 26 34 45 0d 0f |<.STAstore+&4E..| 00002040 46 10 53 54 41 73 74 6f 72 65 2b 26 35 31 0d 0f |F.STAstore+&51..| 00002050 50 09 4c 44 41 23 31 0d 0f 5a 22 53 54 41 65 6e |P.LDA#1..Z"STAen| 00002060 61 62 6c 65 64 20 20 20 5c 73 65 74 20 65 6e 61 |abled \set ena| 00002070 62 6c 65 64 20 66 6c 61 67 0d 0f 64 34 5c 63 6c |bled flag..d4\cl| 00002080 65 61 72 20 62 6f 74 68 20 73 63 72 65 65 6e 73 |ear both screens| 00002090 2e 20 4f 53 42 59 54 45 20 31 33 36 20 69 73 20 |. OSBYTE 136 is | 000020a0 73 61 6d 65 20 61 73 20 2a 63 6f 64 65 0d 0f 6e |same as *code..n| 000020b0 0b 4c 44 41 23 31 33 36 0d 0f 78 09 4c 44 58 23 |.LDA#136..x.LDX#| 000020c0 32 0d 0f 82 09 4c 44 59 23 30 0d 0f 8c 0d 4a 53 |2....LDY#0....JS| 000020d0 52 6f 73 62 79 74 65 0d 0f 96 0a 4c 44 41 23 31 |Rosbyte....LDA#1| 000020e0 32 0d 0f a0 0d 4a 53 52 6f 73 77 72 63 68 0d 0f |2....JSRoswrch..| 000020f0 aa 0b 4c 44 41 23 31 33 36 0d 0f b4 09 4c 44 58 |..LDA#136....LDX| 00002100 23 31 0d 0f be 09 4c 44 59 23 32 0d 0f c8 0d 4a |#1....LDY#2....J| 00002110 53 52 6f 73 62 79 74 65 0d 0f d2 0a 4c 44 41 23 |SRosbyte....LDA#| 00002120 31 32 0d 0f dc 0d 4a 53 52 6f 73 77 72 63 68 0d |12....JSRoswrch.| 00002130 0f e6 07 52 54 53 0d 0f f0 32 2e 6e 6f 5f 77 61 |...RTS...2.no_wa| 00002140 79 20 20 5c 67 65 6e 65 72 61 74 65 20 65 72 72 |y \generate err| 00002150 6f 72 20 69 66 20 6e 6f 74 20 4d 6f 64 65 20 34 |or if not Mode 4| 00002160 2c 20 35 20 6f 72 20 36 0d 0f fa 09 4c 44 41 23 |, 5 or 6....LDA#| 00002170 30 0d 10 04 0e 53 54 41 65 6e 61 62 6c 65 64 0d |0....STAenabled.| 00002180 10 0e 07 42 52 4b 0d 10 18 1f 45 51 55 42 28 32 |...BRK....EQUB(2| 00002190 35 32 29 20 5c 65 72 72 6f 72 20 6e 75 6d 62 65 |52) \error numbe| 000021a0 72 20 32 35 32 0d 10 22 11 45 51 55 53 28 22 4d |r 252..".EQUS("M| 000021b0 6f 64 65 21 22 29 0d 10 2c 07 42 52 4b 0d 10 36 |ode!")..,.BRK..6| 000021c0 10 2e 70 61 6c 65 74 74 65 20 42 52 4b 0d 10 40 |..palette BRK..@| 000021d0 10 2e 73 74 6f 72 65 5f 41 20 42 52 4b 0d 10 4a |..store_A BRK..J| 000021e0 10 2e 73 74 6f 72 65 5f 58 20 42 52 4b 0d 10 54 |..store_X BRK..T| 000021f0 10 2e 73 74 6f 72 65 5f 59 20 42 52 4b 0d 10 5e |..store_Y BRK..^| 00002200 39 2e 73 63 72 65 65 6e 20 20 20 5c 73 74 6f 72 |9.screen \stor| 00002210 65 20 66 6f 72 20 68 69 2d 62 79 74 65 73 20 6f |e for hi-bytes o| 00002220 66 20 73 74 61 72 74 20 6f 66 20 65 61 63 68 20 |f start of each | 00002230 73 63 72 65 65 6e 0d 10 68 07 42 52 4b 0d 10 72 |screen..h.BRK..r| 00002240 07 42 52 4b 0d 10 7c 31 2e 6c 65 6e 67 74 68 20 |.BRK..|1.length | 00002250 20 20 5c 73 74 6f 72 65 20 66 6f 72 20 68 69 5f | \store for hi_| 00002260 62 79 74 65 20 6f 66 20 73 63 72 65 65 6e 20 6c |byte of screen l| 00002270 65 6e 67 74 68 0d 10 86 07 42 52 4b 0d 10 90 3e |ength....BRK...>| 00002280 2e 6e 6f 5f 63 6f 6c 6f 75 72 73 20 20 20 5c 73 |.no_colours \s| 00002290 74 6f 72 65 20 66 6f 72 20 6e 75 6d 62 65 72 20 |tore for number | 000022a0 6f 66 20 63 6f 6c 6f 75 72 73 20 69 6e 20 63 75 |of colours in cu| 000022b0 72 72 65 6e 74 20 6d 6f 64 65 0d 10 9a 07 42 52 |rrent mode....BR| 000022c0 4b 0d 10 a4 09 2e 6d 6f 64 65 0d 10 ae 42 45 51 |K.....mode...BEQ| 000022d0 55 42 28 32 35 35 29 20 20 5c 73 74 6f 72 65 20 |UB(255) \store | 000022e0 66 6f 72 20 73 63 72 65 65 6e 20 6d 6f 64 65 20 |for screen mode | 000022f0 77 68 65 6e 20 73 65 74 20 75 70 20 28 77 69 74 |when set up (wit| 00002300 68 20 2a 63 6f 64 65 32 32 2c 59 29 0d 10 b8 11 |h *code22,Y)....| 00002310 2e 6f 73 77 6f 72 64 5f 62 6c 6f 63 6b 0d 10 c2 |.osword_block...| 00002320 0b 45 51 55 42 28 30 29 0d 10 cc 0b 45 51 55 44 |.EQUB(0)....EQUD| 00002330 28 30 29 0d 10 d6 0a 2e 73 74 6f 72 65 0d 10 e0 |(0).....store...| 00002340 36 45 51 55 53 28 c4 26 38 30 2c bd 30 29 29 20 |6EQUS(.&80,.0)) | 00002350 5c 73 74 6f 72 65 20 66 6f 72 20 70 61 67 65 20 |\store for page | 00002360 33 20 28 66 69 72 73 74 20 26 37 46 20 62 79 74 |3 (first &7F byt| 00002370 65 73 29 0d 10 ea 0d 2e 7a 70 5f 73 74 6f 72 65 |es).....zp_store| 00002380 0d 10 f4 32 45 51 55 53 28 c4 26 42 2c bd 30 29 |...2EQUS(.&B,.0)| 00002390 29 20 20 5c 73 74 6f 72 65 20 66 6f 72 20 7a 65 |) \store for ze| 000023a0 72 6f 20 70 61 67 65 20 26 44 30 20 74 6f 20 26 |ro page &D0 to &| 000023b0 44 41 0d 10 fe 08 2e 65 6e 64 0d 11 08 05 5d 0d |DA.....end....].| 000023c0 11 12 05 ed 0d 11 1c 17 53 25 3d 63 6f 64 65 20 |........S%=code | 000023d0 84 20 26 46 46 46 46 30 30 30 30 0d 11 26 3b ff |. &FFFF0000..&;.| 000023e0 22 2a 73 61 76 65 20 64 75 61 6c 73 63 6e 20 22 |"*save dualscn "| 000023f0 2b c3 7e 61 73 73 5f 61 64 64 72 2b 22 20 22 2b |+.~ass_addr+" "+| 00002400 c3 7e 4f 25 2b 22 20 22 2b c3 7e 53 25 2b 22 20 |.~O%+" "+.~S%+" | 00002410 22 2b c3 7e 53 25 0d ff |"+.~S%..| 00002418