?login_element?

Subversion Repositories NedoOS

Rev

Rev 1303 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

  1. txt_setup:          db 0x0A,"Three Sisters' story (San Shimai)",0x0D,0x0A
  2.                     db "(c) 1996 JAST",0x0D,0x0A
  3.                     db "----------------------------------------",0x0D,0x0A
  4.                     db "language setup",0x0D,0x0A
  5.                     db 0x0D,0x0A
  6.                     db "1. English v1.0 (Sakura Soft)",0x0D,0x0A
  7.                     db "2. English v1.1 (Jast USA)",0x0D,0x0A
  8. ;                    db "3. Russian",0        
  9.                     db "3. ",0x90,0xe3,0xe1,0xe1,0xaa,0xa8,0xa9," (The Asenheim Project)",0x0D,0x0A,0
  10. txt_censor_setup:
  11.                     db 0x0D,0x0A
  12.                     db "----------------------------------------",0x0D,0x0A
  13.                     db "Censorship? (If available)",0x0D,0x0A
  14.                     db 0x0D,0x0A
  15.                     db "1. Yes",0x0D,0x0A
  16.                     db "2. No",0x0D,0x0A
  17.                     db 0
  18. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;        
  19. import_push:
  20.        
  21.         call store8000c000
  22.  
  23.         ld a,(load_buf1)
  24.         SETPG8000
  25.  
  26.         ld a,(load_buf2)
  27.         SETPGC000
  28.  
  29.         ld hl,0x8005
  30.         ld de,PUSH_DATA
  31.  
  32.         ld b,8
  33. import_push_loop:
  34.         push bc
  35.  
  36.  
  37.         push hl
  38.         ld b,8
  39. import_push_iloop1:
  40.         ld a,(hl)
  41.         ld (de),a
  42.         call DHL
  43.         inc de
  44.         djnz import_push_iloop1
  45.         pop hl
  46.  
  47.         set 6,H
  48.         push hl
  49.         ld b,8
  50. import_push_iloop2:
  51.         ld a,(hl)
  52.         ld (de),a
  53.         call DHL
  54.         inc de
  55.         djnz import_push_iloop2
  56.         pop hl
  57.  
  58.         res 6,H
  59.         set 5,H
  60.  
  61.         push hl
  62.         ld b,8
  63. import_push_iloop3:
  64.         ld a,(hl)
  65.         ld (de),a
  66.         call DHL
  67.         inc de
  68.         djnz import_push_iloop3
  69.         pop hl
  70.  
  71.         set 6,H
  72.         push hl
  73.         ld b,8
  74. import_push_iloop4:
  75.         ld a,(hl)
  76.         ld (de),a
  77.         call DHL
  78.         inc de
  79.         djnz import_push_iloop4
  80.         pop hl
  81.  
  82.         res 6,H
  83.         res 5,H
  84.         inc hl
  85.  
  86.         pop bc
  87.         djnz import_push_loop
  88.         jp restore8000c000
  89. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;        
  90. pre_init
  91.     ld e,6+0x80  //set TEXT mode  keep
  92.     OS_SETGFX
  93.  
  94.         ld e,0
  95.         OS_CLS
  96.  
  97.         OS_GETMAINPAGES
  98. ;dehl=??N?a ???a?? o 0000,4000,8000,c000
  99.         ld a,d
  100.         ld (winpage0),a
  101.         ld a,e
  102.         ld (winpage1),a
  103.         ld a,h
  104.         ld (winpage2),a
  105.         ld a,l
  106.         ld (winpage3),a
  107.  
  108. ; get music page page
  109.         OS_NEWPAGE
  110.         or a
  111.         jp nz,memoryerror
  112.         ld a,e
  113.         ld (music_buf),a
  114.  
  115. ; get gfx load buffer  2 pages
  116.         OS_NEWPAGE
  117.         or a
  118.         jp nz,memoryerror
  119.         ld a,e
  120.         ld (load_buf1),a
  121.  
  122.         OS_NEWPAGE
  123.         or a
  124.         jp nz,memoryerror
  125.         ld a,e
  126.         ld (load_buf2),a
  127.  
  128. ; get ingame gfx buffer pages 6 pages
  129.         OS_NEWPAGE
  130.         or a
  131.         jp nz,memoryerror
  132.         ld a,e
  133.         ld (scr_buf1),a
  134.  
  135.         OS_NEWPAGE
  136.         or a
  137.         jp nz,memoryerror
  138.         ld a,e
  139.         ld (scr_buf2),a
  140.  
  141.         OS_NEWPAGE
  142.         or a
  143.         jp nz,memoryerror
  144.         ld a,e
  145.         ld (mem_buf1),a
  146.  
  147.         OS_NEWPAGE
  148.         or a
  149.         jp nz,memoryerror
  150.         ld a,e
  151.         ld (mem_buf2),a
  152.  
  153.         OS_NEWPAGE
  154.         or a
  155.         jp nz,memoryerror
  156.         ld a,e
  157.         ld (font_page),a
  158.  
  159.  
  160.         ld hl,txt_setup
  161.         call print_hl
  162. setup_lp:        
  163.         YIELDGETKEYLOOP
  164.         cp "1"
  165.         jr z,setup_is1
  166.         cp "2"
  167.         jr z,setup_is2
  168.         cp "3"
  169.         jr z,setup_is3
  170.         jr setup_lp
  171. setup_is1:
  172.           xor a
  173.           jr setup_set
  174. setup_is2:
  175.          ld a,1
  176.           jr setup_set
  177. setup_is3:
  178.          ld a,2
  179. setup_set:
  180.         ld (language),a
  181.  
  182.         ld hl,txt_censor_setup
  183.         call print_hl
  184. setup_lpc:        
  185.         YIELDGETKEYLOOP
  186.         cp "1"
  187.         jr z,setup_isc1
  188.         cp "2"
  189.         jr z,setup_isc2
  190.         jr setup_lpc
  191. setup_isc1:
  192.           ld a,1
  193.           jr setup_setc
  194. setup_isc2:
  195.          xor a
  196. setup_setc:
  197.         ld (censor_mode),a
  198. ;-----------------------------------------
  199.         ;go to resources directory
  200.         ld de,res_path
  201.         OS_CHDIR
  202.         or a
  203.         jp nz,dirchangeerror
  204.  
  205.         ;----------------------
  206.         ;--load music player
  207.  
  208.  
  209.               call setmusicpage
  210.                 ld a,(mus_mode)
  211.                 ld hl,mus_modes
  212.                 call sel_word
  213.  
  214.                 ld de,buf
  215.                 call copystr_hlde
  216.                 ld hl,mus_plr_path
  217.                 call copystr_hlde
  218.                 xor a
  219.                 ld (de),a
  220.                 ld (wlock),a
  221.  
  222.                 ld de,buf
  223.                 call openstream_file
  224.                 or a
  225.                 jp nz,fileopenerror
  226.  
  227.                 ld hl,0x4000 ;len
  228.                 ld de,player_load ;addr
  229.                 call readstream_file
  230.                 or a
  231.                 jp nz,filereaderror
  232.  
  233.                 call closestream_file
  234.  
  235.              call unsetmusicpage
  236. ;load font
  237. loadfont:
  238.               call setfontpage
  239.               ld de,font_file  
  240.               call openstream_file
  241.               or a
  242.               jp nz,fileopenerror
  243.  
  244.               ld hl,0x4000 ;len
  245.               ld de,FONT ;addr
  246.               call readstream_file
  247.               or a
  248.               jp nz,filereaderror
  249.  
  250.               call closestream_file
  251.  
  252.               call unsetfontpage
  253.  
  254.         call int_set
  255.  
  256.         ;set mode
  257.         ld e,0+0x80  //set EGA mode keep
  258.         OS_SETGFX
  259.  
  260. ;prepare animation
  261.         call clear_screen
  262. deb_lnk
  263.         ld hl,anim_w
  264.         call load_gfx_to_load_buf_nopal
  265.         call import_push
  266. ;;
  267.  
  268.  
  269.  
  270. ;я╕исжм mem_buf. щ▓пям╝ш┤еє▓╜аыбк э╛зэ▒нчб╜ы▒аыЛК        
  271.         ld a,(mem_buf1)
  272.         SETPGC000
  273.         ld hl,0xc000
  274.         ld de,0xc001
  275.         ld bc,16383
  276.         ld (hl),0
  277.         ldir
  278.         ld a,(mem_buf2)
  279.         SETPGC000
  280.         ld hl,0xc000
  281.         ld de,0xc001
  282.         ld bc,16383
  283.         ld (hl),0
  284.         ldir
  285.         ret
  286. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  287.  
  288. introduction
  289.         ;---load resources
  290.         ; '1' - load image
  291.  
  292.         ld hl,intro_text
  293.         call load_ovl_to_script_buf
  294.  
  295.         ld hl,TABLE_W
  296.         ld (CODEPAGE),hl
  297.  
  298.  
  299.  
  300.         ld b,0
  301. introduction_loop:
  302.         push bc;
  303.    
  304.         call _ppp_pause
  305.  
  306.         ld hl,introduction_pause
  307.         push hl
  308.        
  309.         ld a,b
  310.         and a
  311.         jp z,introduction_st1
  312.         cp 1
  313.         jp z,introduction_st2
  314.         cp 2
  315.         jp z,introduction_st3
  316.  
  317.  
  318.  
  319. introduction_pause:
  320.  
  321.         pop bc
  322.         ld a,b
  323.         cp 2
  324.         jr z,introduction_exit
  325.         inc b
  326.         jr introduction_loop
  327.  
  328. introduction_exit:
  329. ;        call clear_whole_screen
  330.         ld a,1
  331.         ld (intro_switch),a
  332.         ret
  333.  
  334.  
  335. introduction_st1
  336.         ld hl,intro_pic1
  337.         call load_big_img_dark2
  338.  
  339.         call palette_precalc
  340.         jp fade_fromblack
  341.  
  342.  
  343. introduction_st3
  344.         call fade_towhite
  345.         ret
  346.  
  347. introduction_st2
  348.         call fade_toblack
  349.  
  350.  
  351.         ld hl,intro_pic2
  352.         call load_big_img_dark2
  353.  
  354.         call palette_precalc
  355.         call fade_fromblack
  356.  
  357.  
  358.  
  359.         call store8000c000
  360.         ld a,(user_scr0_low) ;ok
  361.         SETPG8000
  362.         ld a,(user_scr1_low) ;ok
  363.         SETPGC000
  364.  
  365.         ld hl,0x8000
  366.         ld de,0xc000
  367.         ld bc,16384
  368.         ldir
  369.  
  370.  
  371.         ld a,(user_scr0_high) ;ok
  372.         SETPG8000
  373.         ld a,(user_scr1_high) ;ok
  374.         SETPGC000
  375.  
  376.         ld hl,0x8000
  377.         ld de,0xc000
  378.         ld bc,16384
  379.         ldir
  380.  
  381. ;        ld e,1
  382. ;        OS_SETSCREEN
  383. ;
  384. ;        ld a,(user_scr0_low) ;ok
  385. ;        SETPG8000
  386. ;        ld a,(user_scr0_high) ;ok
  387. ;        SETPGC000
  388. ;
  389. ;        ld hl,0x8000
  390. ;        ld de,0x8001
  391. ;        ld bc,32767
  392. ;        ld (hl),0
  393. ;        ldir
  394. ;        call restore8000c000
  395.  
  396.  
  397.  
  398. ;        ld a,1
  399.  ;       ld (screenswapper),a
  400.  
  401.  
  402.         call _ppp_type
  403.  
  404.  
  405.         call store8000c000
  406.         ld a,(user_scr1_low) ;ok
  407.         SETPG8000
  408.         ld a,(user_scr0_low) ;ok
  409.         SETPGC000
  410.  
  411.         ld hl,0x8000
  412.         ld de,0xc000
  413.         ld bc,16384
  414.         ldir
  415.  
  416.  
  417.         ld a,(user_scr1_high) ;ok
  418.         SETPG8000
  419.         ld a,(user_scr0_high) ;ok
  420.         SETPGC000
  421.  
  422.         ld hl,0x8000
  423.         ld de,0xc000
  424.         ld bc,16384
  425.         ldir
  426.  
  427.         ld e,0
  428.         OS_SETSCREEN
  429.  
  430.         call restore8000c000
  431.         xor a
  432.         ld (screenswapper),a
  433.  
  434.  
  435.  
  436.         ret
  437.  
  438.                
  439. _ppp_type
  440.         LD      HL,ovl_start
  441. _ppp_type_c:
  442.         LD      BC,#0300
  443.         CALL    _pradd
  444.  
  445. _ppp:
  446.         ld a,(hl)
  447.         inc hl
  448.         cp 32
  449.         jr  c,_ppp1
  450.         jr z,_ppp_skip_ch
  451.         cp 128
  452.         call nc,change_cp
  453.         CP "#"
  454.         call z,change_cp1
  455.         CP "@"
  456.         call z,change_cp2
  457.         sub 32
  458. _ppp_o:
  459.         push hl
  460.         call _type
  461.         pop hl
  462.         jr _ppp
  463.  
  464. _ppp1:  and a
  465.         ret z
  466.  
  467.         cp 1
  468.         jr z,_ppp_wait_key
  469.  
  470.         cp 0x0a
  471.         jr z,_ppp_line_feed
  472.  
  473.  
  474.         ld a,"?"  ;unknown opcode print '?' char
  475.         jr _ppp_o
  476.  
  477. _ppp_wait_key:
  478.         push hl
  479.         call waitkey
  480.  
  481.         ;call clear_whole_screen
  482.         call _immed_big
  483.  
  484.         pop hl
  485.         jp _ppp_type_c
  486. _ppp_pause:
  487.         push bc
  488.           ld b,50
  489. 1        halt
  490.         djnz 1b
  491.         pop bc
  492.         ret
  493.  
  494. _ppp_skip_ch:
  495.         push hl
  496.         ld bc,(CORDS)
  497.         inc c
  498.         ld (CORDS),bc
  499.         ld a,c
  500.         cp 64
  501.         jr c,_ppp_skip_ch1
  502.  
  503.         inc b
  504.         ld c,0
  505. _ppp_skip_ch1:
  506.         call _pradd
  507.         pop hl
  508.         jp _ppp
  509.  
  510. _ppp_line_feed:
  511.         push hl
  512.         ld bc,(CORDS)
  513.         inc b
  514.         ld c,0
  515.         call _pradd
  516.         pop hl
  517.         jp _ppp
  518.  
  519.  
  520.  
  521.