-
Notifications
You must be signed in to change notification settings - Fork 2
/
BMPTOCF1.SOF
1845 lines (1733 loc) · 50 KB
/
BMPTOCF1.SOF
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
'3ds File Handler 1.3
'
'Designed by : Subhajit Sahu(GamerZ)
'Mail : [email protected]
'
'3ds File format
'[X resolution](lo,hi) add 1 to get xresolution
'[Y resolution](lo,hi) add 1 to get yresolution
'[Total slides] no. of slides present
'[data slide1] ..
'end FORMAT
'data format(contains only coulur nos. for screen 13)
'colour format RRGGGBBB-byte
'clr(x0y0),clr(x1y0),...
'
'Any doubts, please mail me
'I request everyone to mail me if they like it
'This isn't copyright but i request you to give a part of credit
'to me if you ever use this. Thank You programmers ...
'
'Does anyone know how to prevent eye damage caused by monitor?
'Please let me know an easy way to do so
'(i have already started to wear spectacles)
'
'Happy Fast Sprite Making ... @_@
'
'Mouse Routines
DECLARE FUNCTION mouse.init% ()
DECLARE SUB mouse.show ()
DECLARE SUB mouse.hide ()
DECLARE SUB mouse.setrange (x1%, y1%, x2%, y2%)
DECLARE SUB mouse.put (x%, y%)
DECLARE SUB mouse.status ()
DECLARE SUB mouse.relativestatus ()
'Common Routines
DECLARE SUB c.delay (seconds!)
DECLARE FUNCTION c.input$ (s$, cl%, leng%)
DECLARE SUB c.clearkey ()
DECLARE SUB c.blinkcursor (cl%, size!, delay!)
DECLARE SUB c.dispstring (s$, xx%, yy%, clr%, o%, e%, size!, ers%)
DECLARE SUB c.character (char$, xx%, yy%, clr%, size!, ers%)
DECLARE FUNCTION c.stringcount% (s$, c$)
DECLARE FUNCTION c.word$ (s$, no%)
DECLARE SUB c.filewrite (fl1$, pos1&, s$)
DECLARE FUNCTION c.fileread$ (fl1$, pos1&, l%)
DECLARE FUNCTION c.val& (s$)
DECLARE SUB win.tell (x%, y%, name$, tell$, clr1%, clr2%, clr3%, clr4%)
DECLARE FUNCTION win.ask$ (x%, y%, name$, tell$, boxes$, buttons$, clr1%, clr2%, clr3%, clr4%, clr5%)
DECLARE SUB win.menus ()
DECLARE SUB win.menu ()
DECLARE SUB win.scrolls ()
DECLARE SUB win.scroll ()
DECLARE SUB win.scrollrefresh ()
DECLARE SUB win.colours ()
DECLARE SUB win.colour ()
DECLARE SUB grp.default ()
DECLARE SUB grp.xorbox (x1%, y1%, x2%, y2%, clr%)
DECLARE SUB grp.notbox (x1%, y1%, x2%, y2%)
DECLARE SUB sof.saveram (fl1$)
DECLARE SUB sof.display (fl1$, x&, y&, sld&)
DECLARE SUB sof.write (fl1$, x%, y%, sld&, clr&)
DECLARE SUB sof.message (s$)
DECLARE SUB sof.error (s1$, s2$)
DECLARE SUB sof.pasteslide (fl1$, s1&, fl2$, s2&)
DECLARE SUB sof.writeinf ()
DECLARE SUB sof.slidenumber ()
DECLARE SUB sof.resolution ()
DECLARE SUB sof.filename ()
DECLARE SUB sof.clearslide ()
DECLARE SUB too.pencil ()
DECLARE SUB too.eraser ()
DECLARE SUB too.brush ()
DECLARE SUB too.colourengine (c$)
DECLARE FUNCTION err.filename% (fl1$)
DECLARE FUNCTION err.filepresent% (fl1$)
DECLARE FUNCTION err.slidenumber% (s1$)
DECLARE FUNCTION err.slidepresent% (fl1$, s1%)
DECLARE FUNCTION err.resolution% (fl1$, xres&, yres&)
DECLARE FUNCTION err.bmpresolution% (fl1$, xres&, yres&)
DECLARE SUB snd.click ()
DECLARE SUB asm.loadprog (fl1$, s$)
DECLARE FUNCTION nospc$ (a$)
'Constants
ON ERROR GOTO men.errors
OPTION BASE 0
CONST charlimitx1 = 21, charlimity1 = 24, charlimitx2 = 304, charlimity2 = 167, charcentrex = (charlimitx1 + charlimitx2) \ 2, charcentrey = (charlimity1 + charlimity2) \ 2, charrangex = charlimitx2 - charlimitx1 + 1, charrangey = charlimity2 - _
charlimity1 + 1
CONST CONST.cspace = 6, CONST.linegap = 10, CONST.blinktime1 = .05, CONST.blinktime2 = 2
'Declaring Keys
CONST backspc = 8, enter = 13, htab = 9, esc = 27
CONST left = 75, right = 77, up = 72, down = 80
CONST uplt = 71, uprt = 73, dnlt = 79, dnrt = 81
CONST insert = 82, home = 73, pageup = 71, del = 83, endk = 81, pagedn = 79
CONST kf1 = 59, kf2 = 60, kf3 = 61, kf4 = 62, kf5 = 63, kf6 = 64, kf7 = 65, kf8 = 66, kf9 = 67, kf10 = 68, kf11 = 133, kf12 = 134
'Keys declared
'|||||||||||||||||||||||CFG|||||||||||||||||||||||||||||||
'$STATIC
'Load Engine
asm.loadprog "Engine.dll", Engine$
TYPE mouse
x AS INTEGER
y AS INTEGER
lb AS INTEGER
rb AS INTEGER
cs AS INTEGER
clk AS INTEGER
END TYPE
TYPE pixel
x AS LONG
y AS LONG
END TYPE
DIM Zone%(10)
DIM Lastcharpoint AS pixel, Piccentre AS pixel, Resolution AS pixel, Pointer AS pixel, Xrange AS pixel, Yrange AS pixel, MenuTask AS pixel
DIM Jerry AS mouse
DIM Jharka$(3, 8), Jharkas%(3, 1)
DIM ScrollBar(2, 1) AS SINGLE
DIM CONST.separators AS STRING
CONST.separators = CHR$(0) + "|"
Jharka$(0, 0) = "File "
Jharka$(0, 1) = "New 3DS File"
Jharka$(0, 2) = "Open a BMP file"
Jharka$(0, 3) = "Open a 3DS file"
Jharka$(0, 4) = "Save to 3DS file"
Jharka$(0, 5) = "Save As to a 3DS file"
Jharka$(0, 6) = "Exit"
Jharka$(1, 0) = "Edit "
Jharka$(1, 1) = "Slide Select"
Jharka$(1, 2) = "Slides State"
Jharka$(1, 3) = "View Resolution"
Jharka$(1, 4) = "Slide Paste"
Jharka$(1, 5) = "Clear Slide"
Jharka$(2, 0) = "Tools "
Jharka$(2, 1) = "Pencil"
Jharka$(2, 2) = "Eraser"
Jharka$(2, 3) = "Brush"
Jharka$(2, 4) = "Colour Engine"
Jharka$(3, 0) = "Help "
Jharka$(3, 1) = "User Help"
Jharka$(3, 2) = "Version"
SCREEN 13
'Check for mouse
a1% = mouse.init%
IF (a1% <> -1) THEN
PRINT "Sorry! Mouse not Installed."
k$ = INPUT$(1)
SYSTEM
END IF
grp.default
sof.display "dat.dat", 160, 100, 1
a1 = TIMER
DO UNTIL TIMER - a1 > 2.5
LOOP
LINE (charlimitx1 - 1, charlimity1 - 1)-(charlimitx2 + 1, charlimity2 + 1), 29, B
win.menus
Resolution.x = 319
Resolution.y = 199
GOSUB men.defaultize
win.scrolls
win.colours
GOSUB men.display
sof.slidenumber
sof.message "Default Resolution = 320*200"
mouse.show
'Now, I come to the rescue
DO
k$ = ""
c.clearkey
DO
k$ = INKEY$
mouse.status
LOOP WHILE (k$ = "" AND Jerry.lb = 0 AND Jerry.clk = 0 AND Jerry.rb = 0)'Wait for input
win.menu
win.scroll
win.colour
'Respond to button usage
IF (Jerry.x > 185 AND Jerry.x < 195 AND Jerry.y > 1 AND Jerry.y < 9 AND Jerry.clk = 1) THEN GOSUB men.save3ds
IF (Jerry.x > 5 AND Jerry.x < 15 AND Jerry.y > 35 AND Jerry.y < 45 AND Jerry.clk = 1) THEN GOSUB men.openbmp
IF (Jerry.x > 5 AND Jerry.x < 15 AND Jerry.y > 45 AND Jerry.y < 55 AND Jerry.clk = 1) THEN GOSUB men.open3ds
IF (Jerry.x > 5 AND Jerry.x < 15 AND Jerry.y > 65 AND Jerry.y < 75 AND Jerry.clk = 1) THEN GOSUB men.slidepaste
'Respond to tool usage
IF (k$ = CHR$(htab) OR Jerry.lb = 1) THEN
IF (Jerry.x >= charlimitx1 AND Jerry.x <= charlimitx2 AND Jerry.y >= charlimity1 AND Jerry.y <= charlimity2) THEN
SELECT CASE Pointer.x
CASE 0
too.pencil
CASE 1
too.eraser
CASE 2
too.brush
CASE ELSE
END SELECT
END IF
END IF
'Respond to special keys
SELECT CASE k$
CASE CHR$(0) + CHR$(left)
Jerry.x = Jerry.x - 1
IF (Jerry.x < charlimitx1) THEN Jerry.x = charlimitx1
mouse.put Jerry.x, Jerry.y
CASE CHR$(0) + CHR$(right)
Jerry.x = Jerry.x + 1
IF (Jerry.x > charlimitx2) THEN Jerry.x = charlimitx2
mouse.put Jerry.x, Jerry.y
CASE CHR$(0) + CHR$(up)
Jerry.y = Jerry.y - 1
IF (Jerry.y < charlimity1) THEN Jerry.y = charlimity1
mouse.put Jerry.x, Jerry.y
CASE CHR$(0) + CHR$(down)
Jerry.y = Jerry.y + 1
IF (Jerry.y > charlimity2) THEN Jerry.y = charlimity2
mouse.put Jerry.x, Jerry.y
CASE CHR$(0) + CHR$(kf1)
snd.click
GOSUB men.userhelp
CASE CHR$(0) + CHR$(kf2)
snd.click
GOSUB men.version
CASE CHR$(0) + CHR$(kf3)
snd.click
GOSUB men.viewresolution
CASE CHR$(0) + CHR$(kf4)
snd.click
GOSUB men.slidestate
CASE CHR$(0) + CHR$(kf5)
snd.click
Pointer.x = 0
GOSUB men.tool
CASE CHR$(0) + CHR$(kf6)
snd.click
Pointer.x = 1
GOSUB men.tool
CASE CHR$(0) + CHR$(kf7)
snd.click
Pointer.x = 2
GOSUB men.tool
CASE CHR$(0) + CHR$(kf8)
snd.click
GOSUB men.save3ds
CASE ELSE
END SELECT
'Respond to mouse activities
IF (MenuTask.x <> 0) THEN
Jerry.lb = 0 'Deactivate idiot type writing
SELECT CASE MenuTask.x
CASE 1
SELECT CASE MenuTask.y
CASE 1
GOSUB men.new3ds
CASE 2
GOSUB men.openbmp
CASE 3
GOSUB men.open3ds
CASE 4
GOSUB men.save3ds
CASE 5
GOSUB men.saveas3ds
CASE 6
GOSUB men.exit
CASE ELSE
END SELECT
CASE 2
SELECT CASE MenuTask.y
CASE 1
GOSUB men.slideselect
CASE 2
GOSUB men.slidestate
CASE 3
GOSUB men.viewresolution
CASE 4
GOSUB men.slidepaste
CASE 5
GOSUB men.clearslide
CASE ELSE
END SELECT
CASE 3
SELECT CASE MenuTask.y
CASE 1
Pointer.x = 0
GOSUB men.tool
CASE 2
Pointer.x = 1
GOSUB men.tool
CASE 3
Pointer.x = 2
GOSUB men.tool
CASE 4
GOSUB men.colourengine
CASE ELSE
END SELECT
CASE 4
SELECT CASE MenuTask.y
CASE 1
GOSUB men.userhelp
CASE 2
GOSUB men.version
CASE ELSE
END SELECT
CASE ELSE
END SELECT
MenuTask.x = 0
mouse.status
END IF
LOOP
'Men's Lok Sabha
men.display:
sof.display "zzzzzzzz.ini", Piccentre.x, Piccentre.y, ActiveSlide&
RETURN
men.userhelp:
aa2$ = CHR$(enter)
aa1$ = "F1 = User Help" + aa2$ + "F2 = Version" + aa2$ + "F3 = View Resolution" + aa2$ + "F4 = Slides State" + aa2$ + "F5 = Pencil" + aa2$ + "F6 = Eraser" + aa2$ + "F7 = Brush" + aa2$ + "F8 = Save" + aa2$ + "Load Help.3ds for help"
win.tell 40, 60, "User Help" + SPACE$(10), aa1$, 10, 200, 248, 54
RETURN
men.version:
aa2$ = CHR$(enter)
aa1$ = "3DS File Handler" + aa2$ + "Version: 1 .3" + aa2$ + "Designed by: Subhajit Sahu(GamerZ)" + aa2$ + "E-mail: [email protected]" + aa2$ + "Please mail me."
win.tell 40, 30, "Version" + SPACE$(15), aa1$, 100, 20, 219, 54
RETURN
men.viewresolution:
aa2$ = CHR$(enter)
win.tell 80, 60, "Resolution ", "File: " + Filename$ + aa2$ + STR$(Resolution.x + 1) + "*" + STR$(Resolution.y + 1) + " pixels", 120, 20, 29, 54
RETURN
men.tool:
SELECT CASE Pointer.x
CASE 0
sof.message "Pencil Tool Selected."
CASE 1
sof.message "Eraser Tool Selected."
CASE 2
sof.message "Brush Tool Selected."
CASE ELSE
END SELECT
RETURN
men.save3ds:
IF (Filename$ = "") THEN
aa1$ = win.ask$(80, 60, "Save 3DS File", "Enter filename:", "|FileName|", "|Accept|Cancel|", 111, 179, 22, 77, 89)
aa1% = VAL(RIGHT$(aa1$, 1))
IF (aa1% <> 1) THEN GOTO men.save3dse
aa2$ = c.word$(aa1$, 1)
IF (aa2$ = "") THEN
sof.error "No Filename ", "Enter a filename"
GOTO men.save3dse
END IF
IF (err.filename%(aa2$) <> 0) THEN
sof.error "Invalid Filename", "Enter a correct DOS filename."
GOTO men.save3dse
END IF
IF (INSTR(aa2$, ".") = 0) THEN aa2$ = aa2$ + ".3ds"
Filename$ = aa2$
END IF
SHELL "copy zzzzzzzz.ini " + Filename$ + " >zzzzzzzy.ini"
KILL "zzzzzzzy.ini"
sof.message "File saved to " + Filename$
sof.filename
men.save3dse:
RETURN
men.new3ds:
aa1$ = win.ask$(40, 60, "New 3DS File ", "Enter the filename:", "|FileName|X Resolution|Y Resolution|", "|OK|Cancel|", 111, 19, 210, 127, 250)
aa1% = VAL(RIGHT$(aa1$, 1))
IF (aa1% <> 1) THEN GOTO men.new3dse
aa2$ = c.word$(aa1$, 1)
IF (aa2$ = "") THEN
sof.error "No Filename ", "Enter a filename"
GOTO men.new3dse
END IF
IF (err.filename%(aa2$) <> 0) THEN
sof.error "Invalid Filename", "Enter a correct DOS filename."
GOTO men.new3dse
END IF
aa3$ = c.word$(aa1$, 2)
IF (aa3$ = "") THEN
sof.error "No X Resolution ", "Enter X resolution"
GOTO men.new3dse
END IF
Resolution.x = c.val&(aa3$) - 1
aa3$ = c.word$(aa1$, 3)
IF (aa3$ = "") THEN
sof.error "No Y Resolution ", "Enter Y resolution"
GOTO men.new3dse
END IF
Resolution.y = c.val&(aa3$) - 1
IF (INSTR(aa2$, ".") = 0) THEN aa2$ = aa2$ + ".3ds"
Filename$ = aa2$
aa1% = FREEFILE
OPEN "O", #aa1%, Filename$
CLOSE #aa1%
KILL "zzzzzzzz.ini"
GOSUB men.defaultize
sof.message "New File " + Filename$ + " created."
GOSUB men.display
win.scrolls
men.new3dse:
RETURN
men.openbmp:
aa1$ = win.ask$(40, 70, "Open BMP File ", "Enter the 24-bit BMP filename:", "|FileName|", "|Open|Cancel|", 111, 140, 240, 127, 170)
aa2% = VAL(RIGHT$(aa1$, 1))
IF (aa2% <> 1) THEN GOTO men.openbmpe
aa2$ = c.word$(aa1$, 1)
IF (aa2$ = "") THEN
sof.error "No Filename ", "Enter a filename"
GOTO men.openbmpe
END IF
IF (err.filename%(aa2$) <> 0) THEN
sof.error "Invalid Filename", "Enter a correct DOS filename."
GOTO men.openbmpe
END IF
IF (INSTR(aa2$, ".") = 0) THEN aa2$ = aa2$ + ".bmp"
IF (err.filepresent%(aa2$) <> 0) THEN
sof.error "File not found", "Enter a file that is present on the disk."
GOTO men.openbmpe
END IF
IF (err.bmpresolution%(aa2$, Resolution.x, Resolution.y) <> 0) THEN
IF (ActiveSlide& <> 1) THEN
sof.error "Resolution Error", "The resolution of the BMP file does not match the current resolution."
GOTO men.openbmpe
ELSE
aa1$ = win.ask$(40, 50, "Resolution Unmatch", "Change current resolution to BMP resolution to load the BMP file(any other data present will be removed)", "||", "|Yes|No|", 11, 110, 230, 67, 30)
IF (RIGHT$(aa1$, 1) = "2") THEN GOTO men.openbmpe ELSE KILL "zzzzzzzz.ini"
END IF
END IF
sof.saveram aa2$
sof.message "File " + aa2$ + " opened."
Piccentre.x = charcentrex
Piccentre.y = charcentrey
GOSUB men.display
win.scrolls
men.openbmpe:
RETURN
men.open3ds:
aa1$ = win.ask$(80, 40, "Open 3DS File", "Enter the 3DS filename:", "|FileName|Slide|", "|OK|Cancel|", 111, 120, 245, 107, 90)
aa1% = VAL(RIGHT$(aa1$, 1))
IF (aa1% <> 1) THEN GOTO men.open3dse
aa2$ = c.word$(aa1$, 1)
IF (aa2$ = "") THEN
sof.error "No Filename ", "Enter a filename"
GOTO men.open3dse
END IF
IF (err.filename%(aa2$) <> 0) THEN
sof.error "Invalid Filename", "Enter a correct DOS filename."
GOTO men.open3dse
END IF
IF (INSTR(aa2$, ".") = 0) THEN aa2$ = aa2$ + ".3ds"
IF (err.filepresent%(aa2$) <> 0) THEN
sof.error "File not found", "Enter a file that is present on the disk."
GOTO men.open3dse
END IF
aa3& = c.val&(c.word$(aa1$, 2))
IF (aa3& <= 0) THEN
IF (err.resolution%(aa2$, Resolution.x, Resolution.y) <> 0) THEN
IF (ActiveSlide& <> 1) THEN
sof.error "Resolution Error", "The resolution of the 3DS file does not match the current resolution."
GOTO men.open3dse
ELSE
aa1$ = win.ask$(40, 50, "Resolution Unmatch", "Change current resolution to 3DS resolution to load the 3DS file(any other data present will be removed)", "||", "|Yes|No|", 11, 110, 200, 7, 190)
IF (RIGHT$(aa1$, 1) <> "1") THEN GOTO men.open3dse ELSE KILL "zzzzzzzz.ini"
END IF
END IF
END IF
Piccentre.x = charcentrex
Piccentre.y = charcentrey
IF (aa3& <= 0) THEN
SHELL "copy " + aa2$ + " zzzzzzzz.ini >zzzzzzzy.ini"
KILL "zzzzzzzy.ini"
Filename$ = aa2$
GOSUB men.display
sof.message "File " + aa2$ + " opened."
aa3$ = c.fileread$(aa2$, 1, 6)
Resolution.x = ASC(LEFT$(aa3$, 1)) + ASC(MID$(aa3$, 2, 1)) * 256
Resolution.y = ASC(MID$(aa3$, 3, 1)) + ASC(MID$(aa3$, 4, 1)) * 256
ActiveSlide& = 1
MaxSlide& = ASC(MID$(aa3$, 5, 1)) + ASC(RIGHT$(aa3$, 1)) * 256
sof.writeinf
win.scrolls
ELSE
sof.pasteslide aa2$, aa3&, "zzzzzzzz.ini", ActiveSlide&
GOSUB men.display
sof.message "Slide Copied from file " + aa2$ + " ."
END IF
men.open3dse:
RETURN
men.saveas3ds:
aa1$ = win.ask$(100, 60, "SaveAs 3DS File", "Enter filename:", "|FileName|", "|Accept|Cancel|", 111, 79, 220, 177, 197)
aa1% = VAL(RIGHT$(aa1$, 1))
IF (aa1% = 1) THEN
aa1$ = MID$(aa1$, 2, INSTR(2, aa1$, CHR$(0)) - 2)
IF (aa1$ = "") THEN
sof.error "No Filename ", "Enter a filename"
ELSE
IF (err.filename%(aa2$) <> 0) THEN
sof.error "Invalid Filename", "Enter a correct DOS filename."
GOTO men.saveas3dse
END IF
IF (INSTR(aa1$, ".") = 0) THEN aa1$ = aa1$ + ".3ds"
Filename$ = aa1$
END IF
END IF
IF (Filename$ <> "") THEN
SHELL "copy zzzzzzzz.ini " + Filename$ + " >zzzzzzzy.ini"
KILL "zzzzzzzy.ini"
sof.message "File saved as to " + Filename$
sof.filename
END IF
men.saveas3dse:
RETURN
men.exit:
aa1$ = win.ask$(80, 70, "Confirm Exit", "Are you sure you have done all ?", "||", "|Exit|Continue|", 111, 50, 207, 127, 176)
IF (RIGHT$(aa1$, 1) = "1") THEN
KILL "zzzzzzzz.ini"
SYSTEM
END IF
RETURN
men.slideselect:
aa1$ = win.ask$(80, 80, "Select Slide ", "Enter slide number: Current slide=" + STR$(ActiveSlide&), "|Slide|", "|Choose|Cancel|", 111, 10, 207, 27, 196)
aa1% = VAL(RIGHT$(aa1$, 1))
IF (aa1% <> 1) THEN GOTO men.slideselecte
aa2$ = c.word$(aa1$, 1)
IF (aa2$ = "") THEN
sof.error "No Slide ", "Enter a slide number"
GOTO men.slideselecte
END IF
IF (c.val&(aa2$) <= 0) THEN
sof.error "Slide error", "Out of 3ds slide range."
GOTO men.slideselecte
END IF
ActiveSlide& = c.val&(aa2$)
sof.writeinf
sof.message "Slide " + STR$(ActiveSlide&) + " selected."
GOSUB men.display
men.slideselecte:
RETURN
men.colourengine:
aa1$ = win.ask$(40, 80, "Select RGB Format", "Enter [R][G][B]", "|RGB Style|", "|Select|Cancel|", 111, 10, 230, 107, 99)
aa1% = VAL(RIGHT$(aa1$, 1))
IF (aa1% <> 1) THEN GOTO men.colourenginee
aa2$ = c.word$(aa1$, 1)
IF (LEN(aa2$) <> 3) THEN
sof.error "Incorrect Format", "Example RG0 to get a picture without blue"
GOTO men.colourenginee
END IF
too.colourengine UCASE$(aa2$)
men.colourenginee:
RETURN
men.defaultize:
ActiveSlide& = 1
MaxSlide& = 1
sof.writeinf
Piccentre.x = charcentrex
Piccentre.y = charcentrey
Xrange.x = Piccentre.x - (Resolution.x + 1) \ 2 + (Resolution.x MOD 2)
Xrange.y = Piccentre.x + (Resolution.x + 1) \ 2
Yrange.x = Piccentre.y - (Resolution.y + 1) \ 2 + (Resolution.y MOD 2)
Yrange.y = Piccentre.y + (Resolution.y + 1) \ 2
RETURN
men.slidestate:
aa1$ = "Current Slide:" + STR$(ActiveSlide&) + CHR$(enter) + "Total Slides:" + STR$(MaxSlide&)
win.tell 40, 40, "Slides State ", aa1$, 180, 120, 219, 84
RETURN
men.slidepaste:
aa1$ = win.ask$(50, 60, "Slide Paste", "Enter slide number to paste:Total slides=" + STR$(MaxSlide&), "|Slide|", "|Choose|Cancel|", 111, 122, 222, 111, 99)
aa1% = VAL(RIGHT$(aa1$, 1))
IF (aa1% <> 1) THEN GOTO men.slidepastee
aa2$ = c.word$(aa1$, 1)
IF (aa2$ = "") THEN
sof.error "No Slide ", "Enter a slide number"
GOTO men.slidepastee
END IF
IF (c.val&(aa2$) <= 0) THEN
sof.error "Slide error", "Out of 3ds slide range."
GOTO men.slidepastee
END IF
sof.pasteslide "zzzzzzzz.ini", ActiveSlide&, "zzzzzzzz.ini", VAL(aa2$)
ActiveSlide& = c.val&(aa2$)
sof.writeinf
sof.message "Slide pasted to " + STR$(ActiveSlide&) + " ."
GOSUB men.display
men.slidepastee:
RETURN
men.clearslide:
aa1$ = win.ask$(50, 60, "Clear Slide", "Are you sure you want to clear this slide?", "||", "|Sure|No|", 151, 172, 212, 151, 199)
aa1% = VAL(RIGHT$(aa1$, 1))
IF (aa1% = 1) THEN
sof.clearslide
sof.writeinf
sof.message "Slide " + STR$(ActiveSlide&) + " cleared ."
GOSUB men.display
END IF
RETURN
men.errors:
ErrorType% = ERR
RESUME NEXT
SUB asm.loadprog (fl1$, s$)
fr% = FREEFILE
OPEN "B", fr%, fl1$
FOR i& = 1 TO LOF(1)
s$ = s$ + INPUT$(1, #fr%)
NEXT
CLOSE #fr%
END SUB
SUB c.blinkcursor (cl%, size!, delay!)
SHARED Lastcharpoint AS pixel
a1! = size! * .5 * CONST.cspace
cl1% = cl%
FOR lv1% = 1 TO CONST.blinktime2
mouse.hide
IF (lv1% MOD 2 = 0) THEN
cl1% = 0
LINE (Lastcharpoint.x - a1!, Lastcharpoint.y - 5 * size!)-(Lastcharpoint.x + a1!, Lastcharpoint.y + 5 * size!), cl1%, BF
ELSE
cl1% = cl%
LINE (Lastcharpoint.x - a1!, Lastcharpoint.y - 5 * size!)-(Lastcharpoint.x + a1!, Lastcharpoint.y + 5 * size!), cl1%, BF
END IF
mouse.show
c.delay CONST.blinktime1 * delay!
NEXT
END SUB
SUB c.character (char$, xx%, yy%, clr%, size!, ers%)
'check character
a1! = size! * .5 * CONST.cspace
dis% = INT(ASC(char$) - 32)
IF (dis% > 0) THEN
sld% = dis%
fl1$ = "chars.fon"
ELSEIF (ers% = 0) THEN
LINE (xx% - a1!, yy% - 5 * size!)-(xx% + a1!, yy% + 5 * size!), 0, BF
GOTO character1
ELSE
GOTO character1
END IF
'draw character
fr% = FREEFILE
OPEN "B", #fr%, fl1$
SEEK #fr%, 1
read$ = INPUT$(4, #fr%)
xres& = ASC(LEFT$(read$, 1)) * 256 + ASC(MID$(read$, 2, 1))
yres& = ASC(MID$(read$, 3, 1)) * 256 + ASC(RIGHT$(read$, 1))
xx1% = xx% - INT(xres& / 2)
yy1% = yy% - INT(yres& / 2)
pos1& = 7 + ((sld% - 1) * (xres& + 1) * (yres& + 1))
SEEK #fr%, pos1&
read$ = INPUT$((xres& + 1) * (yres& + 1), #fr%)
CLOSE #fr%
DEF SEG = VARSEG(read$)
pos1& = SADD(read$)
FOR j% = yres& TO 0 STEP -1
FOR i% = 0 TO xres&
colour% = PEEK(pos1&)
IF (colour% = 1) THEN colour% = clr% ELSE colour% = 0
IF (colour% <> 0 OR ers% = 0) THEN LINE (xx1% + i% * size! - size! + 1, yy1% + j% * size! - size! + 1)-(xx1% + i% * size! + size! - 1, yy1% + j% * size! + size! - 1), colour%, BF
pos1& = pos1& + 1
NEXT
NEXT
DEF SEG
character1:
END SUB
SUB c.clearkey
DEF SEG = 0 'stop beep sound
POKE &H41A, PEEK(&H41C) '(by clearing keyboard buffer)
DEF SEG '(Qbasic tip)
END SUB
SUB c.delay (seconds!)
times& = 80000 * seconds!
val1% = INP(&H61) 'connect speaker to timer2
val1% = val1% OR 3
OUT &H61, val1%
FOR i% = 1000 TO 6000 STEP 100
freq% = i%
GOSUB delay2
freq% = 6200 - i%
GOSUB delay2
FOR j& = 1 TO times&
NEXT
NEXT
'disconnect speaker from timer2
val1% = INP(&H61)
val1% = val1% AND 252
OUT &H61, val1%
GOTO delay1
delay2:
countdown& = 1193180 \ freq% 'calculate countdown
low& = countdown& MOD 256'send the lowbyte and highbyte of new countdown value
high& = countdown& \ 256
OUT &H43, &HB6 'tell timer2 that we are about to load a new countdown value
OUT &H42, low&
OUT &H42, high&
RETURN
delay1:
END SUB
SUB c.dispstring (s$, xx%, yy%, clr%, o%, e%, size!, ers%)
SHARED Lastcharpoint AS pixel, cursoractive%
IF (s$ = CHR$(0)) THEN
Lastcharpoint.x = 5
Lastcharpoint.y = 5
GOTO c.dispstring1
END IF
a1% = INT(CONST.linegap * size!)
a2% = INT(CONST.cspace * size!)
x1% = xx%
y1% = yy%
FOR i% = 1 TO LEN(s$)
c$ = MID$(s$, i%, 1)
IF (c$ = CHR$(enter)) THEN
x1% = xx%
y1% = y1% + a1%
ELSE
IF (o% <> 0) THEN mouse.hide
c.character c$, x1%, y1%, clr%, size!, ers%
IF (o% <> 0) THEN mouse.show
x1% = x1% + a2%
END IF
IF (x1% >= 315) THEN
x1% = xx%
y1% = y1% + a1%
END IF
Lastcharpoint.x = x1%
Lastcharpoint.y = y1%
IF (o% <> 0) THEN c.blinkcursor o%, size!, 1
NEXT
IF (e% <> 0) THEN
y1% = y1% + INT(e% * CONST.linegap * size!)
x1% = xx%
Lastcharpoint.x = x1%
Lastcharpoint.y = y1%
END IF
c.dispstring1:
END SUB
FUNCTION c.fileread$ (fl1$, pos1&, l%)
fr% = FREEFILE
OPEN "B", #fr%, fl1$
SEEK #fr%, pos1&
c.fileread$ = INPUT$(l%, #fr%)
CLOSE #fr%
END FUNCTION
SUB c.filewrite (fl1$, pos1&, s$)
fr% = FREEFILE
OPEN "B", #fr%, fl1$
PUT #fr%, pos1&, s$
CLOSE #fr%
END SUB
FUNCTION c.input$ (s$, cl%, leng%)
SHARED Lastcharpoint AS pixel
xg% = CONST.linegap \ 2
yg% = CONST.cspace \ 2
'VIEW SCREEN (textslimitx1, textslimity1)-(textslimitx2, textslimity2)
cl1% = (cl% + 1) MOD 256
cl2% = (cl% + 2) MOD 256
cl3% = (cl% + 3) MOD 256
c.dispstring s$, CINT(Lastcharpoint.x), CINT(Lastcharpoint.y), cl%, cl1%, 0, 1, 1
LINE (Lastcharpoint.x - .5 * CONST.cspace, Lastcharpoint.y - 5)-(Lastcharpoint.x - .5 * CONST.cspace + leng% * CONST.cspace, Lastcharpoint.y + 5), 0, BF
x1% = Lastcharpoint.x
y1% = Lastcharpoint.y
ln% = 0
st$ = ""
k$ = ""
DO UNTIL k$ = CHR$(enter)
k$ = ""
c.clearkey 'clear keyboard buffer
WHILE k$ = ""
k$ = INKEY$
'mouse usage
'mouse.status
WEND
k% = ASC(k$)
SELECT CASE k%
CASE esc
Lastcharpoint.x = x1%
Lastcharpoint.y = y1%
st$ = ""
c.dispstring SPACE$(ln%), CINT(Lastcharpoint.x), CINT(Lastcharpoint.y), cl%, 0, 0, 1, 0
Lastcharpoint.x = x1%
Lastcharpoint.y = y1%
c.blinkcursor cl3%, 1, 2
ln% = 0
CASE backspc
ln% = ln% - 1
IF (ln% >= 0) THEN
Lastcharpoint.x = Lastcharpoint.x - CONST.cspace
IF (Lastcharpoint.x < charlimitx1) THEN
Lastcharpoint.x = charlimitx2
Lastcharpoint.y = Lastcharpoint.y - CONST.linegap
END IF
a1% = Lastcharpoint.x
a2% = Lastcharpoint.y
c.dispstring " ", CINT(Lastcharpoint.x), CINT(Lastcharpoint.y), cl%, 0, 0, 1, 0
st$ = LEFT$(st$, LEN(st$) - 1)
Lastcharpoint.x = a1%
Lastcharpoint.y = a2%
c.blinkcursor cl1%, 1, 1
ELSE
c.blinkcursor cl3%, 1, 1
ln% = ln% + 1
END IF
CASE IS > 31 AND k% < 127 'some character
IF (Lastcharpoint.x < charlimitx2) THEN
ln% = ln% + 1
IF (ln% > leng%) THEN
ln% = ln% - 1
c.blinkcursor cl3%, 1, 1
ELSE
c.dispstring k$, CINT(Lastcharpoint.x), CINT(Lastcharpoint.y), cl2%, cl1%, 0, 1, 1
st$ = st$ + k$
END IF
ELSE
c.blinkcursor cl3%, 1, 1
END IF
CASE ELSE
END SELECT
LOOP
Lastcharpoint.x = textlimitx1
Lastcharpoint.y = Lastcharpoint.y + CONST.linegap
IF (Lastcharpoint.y > charlimity2) THEN Lastcharpoint.y = textlimity1
'VIEW
c.input$ = st$
END FUNCTION
FUNCTION c.stringcount% (s$, c$)
a1% = LEN(c$)
FOR i% = 1 TO (LEN(s$) - a1% + 1)
a1$ = MID$(s$, i%, a1%)
IF (a1$ = c$) THEN a2% = a2% + 1
NEXT
c.stringcount% = a2%
END FUNCTION
FUNCTION c.val& (s$)
IF (VAL(s$) < 65536 AND VAL(s$) >= 0) THEN c.val& = VAL(s$)
END FUNCTION
FUNCTION c.word$ (s$, no%)
SHARED CONST.separators AS STRING
a1% = 0
a3% = 1
FOR i% = 1 TO LEN(s$)
a1$ = MID$(s$, i%, 1)
IF (INSTR(CONST.separators, a1$)) THEN
a1% = a1% + 1
a2% = a3%
a3% = i%
END IF
IF (a1% > no%) THEN EXIT FOR
NEXT
IF (a1% <= no%) THEN
ret$ = ""
ELSE
a4% = a3% - a2% - 1
IF (a4% > 0) THEN ret$ = MID$(s$, a2% + 1, a4%)
END IF
c.word$ = ret$
END FUNCTION
FUNCTION err.bmpresolution% (fl1$, xres&, yres&)
fr% = FREEFILE
OPEN "B", #fr%, fl1$
SEEK #fr%, 19
read$ = INPUT$(8, #fr%)
CLOSE #fr%
FOR i& = 0 TO 3 'Xsize,Ysize
xsize& = xsize& + ASC(MID$(read$, i& + 1, 1)) * 256 ^ i&
ysize& = ysize& + ASC(MID$(read$, i& + 5, 1)) * 256 ^ i&
NEXT
IF (xsize& <> xres& + 1 OR ysize& <> yres& + 1) THEN a1% = 1
err.bmpresolution% = a1%
END FUNCTION
FUNCTION err.filename% (fl1$)
SHARED ErrorType%
fr% = FREEFILE
OPEN "B", #fr%, fl1$
CLOSE #fr%
IF (ErrorType% = 0) THEN KILL fl1$
err.filename% = ErrorType%
ErrorType% = 0
END FUNCTION
FUNCTION err.filepresent% (fl1$)
SHARED ErrorType%
fr% = FREEFILE
OPEN "I", #fr%, fl1$
CLOSE #fr%
err.filepresent% = ErrorType%
ErrorType% = 0
END FUNCTION
FUNCTION err.resolution% (fl1$, xres&, yres&)
fr% = FREEFILE
OPEN "B", #fr%, fl1$
SEEK #fr%, 1
k$ = INPUT$(4, #fr%)
CLOSE #fr%
xres1& = ASC(LEFT$(k$, 1)) + ASC(MID$(k$, 2, 1)) * 256
yres1& = ASC(MID$(k$, 3, 1)) + ASC(RIGHT$(k$, 1)) * 256
IF (xres& <> xres1& OR yres& <> yres1&) THEN a1% = 1
err.resolution% = a1%
END FUNCTION
FUNCTION err.slidenumber% (s1$)
a1$ = LTRIM$(RTRIM$(s1$))
IF (a1$ = "0") THEN a3% = 1
FOR i% = 1 TO LEN(a1$)
a2% = ASC(MID$(a1$, i%, 1))
IF (a2% < 48 OR a2% > 57) THEN a3% = 1
NEXT
err.slidenumber% = a3%
END FUNCTION
FUNCTION err.slidepresent% (fl1$, s1%)
fr% = FREEFILE
OPEN "B", #fr%, fl1$
SEEK #fr%, 5
k$ = INPUT$(2, #fr%)
a1% = ASC(LEFT$(k$, 1)) + ASC(RIGHT$(k$, 1)) * 256
IF (s1% > a1%) THEN a2% = 1
CLOSE #fr%
err.slidepresent% = a2%
END FUNCTION
SUB grp.default
SHARED Engine$
DEF SEG = VARSEG(Engine$)
CALL absolute(SADD(Engine$) + 147)
DEF SEG
END SUB
SUB grp.notbox (x1%, y1%, x2%, y2%)
DEF SEG = &HA000
FOR yy& = y1% TO y2%
mem1& = 320 * yy&
FOR xx& = x1% TO x2%
mem2& = mem1& + xx&
POKE mem2&, NOT (PEEK(mem2&)) AND &HFF
NEXT
NEXT
DEF SEG
END SUB
SUB grp.xorbox (x1%, y1%, x2%, y2%, clr%)
SHARED Engine$
DEF SEG = VARSEG(Engine$)
CALL absolute(BYVAL x1%, BYVAL y1%, BYVAL x2%, BYVAL y2%, BYVAL clr%, SADD(Engine$) + 271)
DEF SEG
END SUB
SUB mouse.hide