?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download | RSS feed

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