?login_element?

Subversion Repositories NedoOS

Rev

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

  1. _MENU_SET:
  2.  
  3.         call _fill_sc_com_tables
  4.         call _precache_menu
  5.  
  6.         push hl
  7.         xor a
  8. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  9. ;reset cursor position        
  10.        ld h,a
  11.        ld l,h
  12.        ld (g_curpos),hl    
  13.        pop hl
  14.         call _menu
  15.         CALL WINCLR2
  16.        
  17.  
  18.  
  19. SEARCH:
  20.         LD DE,ILINK
  21.         EX DE,HL
  22. SEARCH0:
  23.         LD A,(HL)
  24.         INC HL
  25.         CP E
  26.         JR NZ,SEARCH1
  27.         LD A,(HL)
  28.         INC HL
  29.         CP D
  30.         JR NZ,SEARCH1+1
  31.         LD A,(HL)
  32.         INC HL
  33.         LD H,(HL)
  34.         LD L,A
  35.         LD A,(HL)
  36.         INC HL
  37.         LD H,(HL)
  38.         LD L,A
  39.  
  40.  
  41.         LD BC,4
  42.         ADD HL,BC
  43.         LD A,(HL)
  44.         INC HL,HL
  45.         LD A,(HL)
  46.         INC HL
  47.         LD H,(HL)
  48.         LD L,A
  49.  
  50.         JP _txt_out
  51. SEARCH1:
  52.         INC HL,HL,HL
  53.         JR SEARCH0
  54.  
  55.  
  56. _flg_if:
  57.         ld b,(hl)  ;opcode
  58.         inc hl
  59.  
  60.                 ld d,HIGH GLOBVARS
  61.                 ld e,(hl) ;variable
  62.  
  63.                 ld a,(de) ; variable value
  64.                 ld d,a     ; move variable value to d
  65.  
  66.                 ld a,b    ; move opcode to a
  67.                 ld b,d    ; move variable value to b
  68.  
  69.                 ;exit a - opcode  b - variable value
  70.  
  71.         inc hl
  72.         ld c,(hl) ;value
  73.         inc hl
  74.         ld e,(hl)
  75.         inc hl
  76.         ld d,(hl)  ;goto value
  77.         inc hl
  78.        
  79.         and a
  80.         jr z,flg_if_equ
  81.         dec a ;1
  82.         jr z,flg_if_greater_equ
  83.         dec a ;2
  84.         jr z,flg_if_less_equ
  85.         dec a ;3
  86.         jr z,flg_if_less
  87.         dec a ;4
  88.         jr z,flg_if_greater
  89.         dec a  ;5
  90.         jr z,flg_if_not_equ        
  91.         dec a ;6
  92.         jr z,flg_if_not_equ
  93.  
  94.         pop hl
  95.         jp flg_if_error
  96.  
  97. flg_if_not_equ:
  98.         ld a,b
  99.         cp c
  100.         jr nz,flg_if_jump
  101.         jr flg_if_exit
  102. flg_if_equ:
  103.         ld a,b
  104.         cp c
  105.         jr z,flg_if_jump
  106.         jr flg_if_exit
  107. flg_if_less:
  108.         ld a,b
  109.         cp c
  110.         jr c,flg_if_jump
  111.         jr flg_if_exit
  112. flg_if_greater:
  113.         ld a,b
  114.         cp c
  115.         jr c,flg_if_exit
  116.         and a
  117.         jr z,flg_if_exit
  118.         jr flg_if_jump
  119. flg_if_greater_equ:
  120.         ld a,b
  121.         cp c
  122.         jr nc,flg_if_jump
  123.         jr flg_if_exit        
  124. flg_if_less_equ:
  125.         ld a,b
  126.         cp c
  127.         jr z,flg_if_jump
  128.         jr c,flg_if_jump
  129.         jr flg_if_exit  
  130. flg_if_jump:
  131.         ex de,hl
  132. flg_if_exit:        
  133.         jp _print
  134.  
  135.  
  136.  
  137.  
  138.  
  139. _goto:
  140.         LD A,(HL)
  141.         INC HL
  142.         LD H,(HL)
  143.         LD L,A
  144.         JP _print
  145.  
  146. _jtbl:
  147.         LD E,(HL)
  148.         LD D,HIGH GLOBVARS
  149.         LD A,(DE)
  150.         ADD A,A
  151.         INC HL
  152.         LD D,0
  153.         LD E,A
  154.         ADD HL,DE
  155.         LD C,(HL)
  156.         INC HL
  157.         LD B,(HL)
  158.         EX DE,HL
  159.         ld h,b
  160.         LD L,C
  161.  
  162.         JP _print  ;!!!!!!!!! skip set ret addr
  163.  
  164. _gata:
  165.         inc hl
  166.         ld b,(hl)
  167.         inc hl
  168.  
  169.         push hl
  170.         push bc
  171.  
  172.         call store8000c000
  173.  
  174.         ld a,(user_scr0_low)
  175.         SETPG8000
  176.         ld a,(user_scr1_low)
  177.         SETPGC000
  178.  
  179.         ld hl,0x8000+320
  180.         ld de,0xc000
  181.         ld bc,8000-320
  182.         ldir
  183.         ;ld hl,0x8000
  184.         ;ld bc,320
  185.         ;ldir
  186.  
  187.         ld hl,0xa000+320
  188.         ld de,0xe000
  189.         ld bc,8000-320
  190.         ldir
  191.         ;ld hl,0xa000
  192.         ;ld bc,320
  193.         ;ldir
  194.  
  195.  
  196.         ld a,(user_scr0_high)
  197.         SETPG8000
  198.         ld a,(user_scr1_high)
  199.         SETPGC000
  200.  
  201.         ld hl,0x8000+320
  202.         ld de,0xc000
  203.         ld bc,8000-320
  204.         ldir
  205.         ;ld hl,0x8000
  206.         ;ld bc,320
  207.         ;ldir
  208.  
  209.         ld hl,0xa000+320
  210.         ld de,0xe000
  211.         ld bc,8000-320
  212.         ldir
  213.         ;ld hl,0xa000
  214.         ;ld bc,320
  215.         ;ldir
  216.  
  217.  
  218.         pop bc
  219. .gata_lp:
  220.         push bc
  221.  
  222.         ld e,1
  223.         OS_SETSCREEN
  224.  
  225.         halt
  226.         halt
  227.         halt
  228.         halt
  229.         halt
  230.  
  231.         ld e,0
  232.         OS_SETSCREEN
  233.  
  234.         halt
  235.         halt
  236.         halt
  237.         halt
  238.         halt
  239.  
  240.         pop bc
  241.         djnz .gata_lp
  242.  
  243.         call restore8000c000
  244.         pop hl
  245.         jp _print
  246.  
  247. t_ppal:
  248.         dw blackpal
  249.         dw whitepal
  250.         dw redpal
  251.  
  252. _flash:
  253.         inc hl
  254.         ld b,(hl)
  255.         inc hl
  256.         ld a,(hl)
  257.         inc hl ; skip flash color
  258.         push hl
  259.  
  260.         push bc
  261.  
  262.         ld hl,t_ppal
  263.         call sel_word
  264.         ld (.pall),hl
  265.  
  266.         ld hl,pal
  267.         ld de,temppal
  268.         ld bc,32
  269.         ldir
  270.  
  271.         pop bc
  272.  
  273. .FLASH_LP:
  274.         push bc
  275.  
  276.         ld hl,0
  277. .pall:  equ $-2        
  278.         ld de,pal
  279.         ld bc,32
  280.         ldir
  281.  
  282.         ld a,1
  283.         ld (setpalflag),a
  284.  
  285.         halt
  286.         halt
  287.         halt
  288.         halt
  289.         halt
  290.  
  291.  
  292.         ld hl,temppal
  293.         ld de,pal
  294.         ld bc,32
  295.         ldir
  296.  
  297.         ld a,1
  298.         ld (setpalflag),a
  299.  
  300.         halt
  301.         halt
  302.         halt
  303.         halt
  304.         halt
  305.  
  306.         pop bc
  307.         djnz .FLASH_LP
  308.         pop hl
  309.         jp _print
  310.  
  311. SCREENOUTPUT1A:
  312.  
  313.  
  314.         INC HL
  315.         LD A,(HL) ;DELAY
  316.         LD (DELAY),A
  317.         INC HL,HL
  318.         LD A,(HL)
  319.         LD (outtyp),A
  320.         INC HL
  321.         LD A,(HL)
  322.         INC HL,HL
  323.         PUSH HL
  324.         CP 3       ;SELECTOR 3-FROM OUTPUT BUFER
  325.         JR Z,scrop2m   ;         4- FROM MEMORY BUFFER
  326.         CALL _memory_output_mask
  327.         JR scrop1
  328. scrop2m:
  329.         CALL _buffer_output_mask
  330. scrop1m:
  331.         POP HL
  332.         JP _print
  333.  
  334. _SCREENOUTPUT1  ;SHOW FROM BUFFERS
  335. ;out load buffer to screen by mask index8
  336.                 push hl
  337.                 ld a,(redraw_border)
  338.                 and a
  339.                 jr z,.redraw_skip
  340.                 call redraw_border_sub
  341.                 xor a
  342.                 ld (redraw_border),a
  343. .redraw_skip:
  344.                 pop hl        
  345.         INC HL
  346.         ld a,(hl)
  347.         cp 8
  348.         jr z,SCREENOUTPUT1A
  349.  
  350.         INC HL
  351.         LD A,(HL) ;DELAY
  352.         LD (DELAY),A
  353.         INC HL,HL
  354.         LD A,(HL)
  355.         LD (outtyp),A
  356.         INC HL
  357.         LD A,(HL)
  358.         INC HL,HL
  359.         PUSH HL
  360.         CP 3       ;SELECTOR 3-FROM OUTPUT BUFER
  361.         JR Z,scrop2   ;         4- FROM MEMORY BUFFER
  362.         CALL _memory_output
  363.         JR scrop1
  364. scrop2:
  365.         CALL _buffer_output
  366. scrop1:
  367.         POP HL
  368.         JP _print
  369.  
  370.  
  371.  
  372. _LOAD_TO_MEM
  373.         INC HL,HL
  374.  
  375.         push hl
  376.         call load_gfx_to_mem_buf
  377.  
  378.         call clear_all_stored_names
  379.  
  380.         pop hl
  381.  
  382.         ld de,loadedCg
  383.         call copystr_hlde
  384.         xor a
  385.         ld (de),a
  386.         inc hl
  387.         JP _print
  388.  
  389.  
  390. _COPY_MEM_2_LOAD:
  391.        PUSH HL
  392.        call store8000c000
  393.  
  394.        ld a,(mem_buf1)
  395.        SETPG8000
  396.        ld a,(load_buf1)
  397.        SETPGC000
  398.  
  399.        ld hl,0x8000
  400.        ld de,0xc000
  401.        ld bc,16384
  402.        ldir
  403.  
  404.        ld a,(mem_buf2)
  405.        SETPG8000
  406.        ld a,(load_buf2)
  407.        SETPGC000
  408.  
  409.        ld hl,0x8000
  410.        ld de,0xc000
  411.        ld bc,16384
  412.        ldir
  413.  
  414.        ld hl,mempal
  415.        ld de,pal
  416.        ld bc,32
  417.        ldir
  418.  
  419.        call restore8000c000
  420.  
  421.        ;call clear_all_stored_names_spr
  422.  
  423.        POP HL
  424.        JP _print        
  425.        
  426. _T_CG:
  427.         inc hl
  428.         inc hl
  429.         inc hl
  430.         ld a,(hl)
  431.         inc hl
  432.         inc hl
  433.  
  434.         push hl
  435.         push af
  436.         call load_gfx_to_scr_buf
  437.         pop af
  438. ;        ld (spr_poss),a
  439.  
  440. ;         ld de,loadedSpr1
  441. ;         cp 1
  442. ;         jr z,.pos0a
  443. ;         ld de,loadedSpr2
  444. ;         cp 2
  445. ;         jr z,.pos0a
  446. ;         ld de,loadedSpr3
  447. ; .pos0a
  448.          pop hl
  449.  
  450.         push af
  451.         ld de,buf
  452.         call copystr_hlde
  453.         xor a
  454. ;        ld (de),a
  455.         ld (outtyp),a
  456.         inc hl
  457.         pop af
  458.  
  459. ;         ld b,2
  460. ;         dec a
  461. ;         jr z,.pos11a
  462. ;         ld b,20
  463. ;         dec a
  464. ;         jr z,.pos11a
  465. ;         ld b,36
  466. ; .pos11a
  467. ;         ld a,b
  468. ;         ld (XPOS),a
  469.  
  470.         push hl,de
  471.         push af
  472.  
  473.         ld a,(gfx_mode)
  474.         ld hl,Modes_x
  475.         call sel_word
  476.         pop af
  477.         dec a
  478.         ld d,0
  479.         ld e,a
  480.         add hl,de
  481.         ld a,(hl)
  482.         ld (XPOS),a
  483.         pop de
  484.  
  485.         call copy_screen_to_loadbuf
  486.  
  487.         CALL DECR_SPR
  488.  
  489.         call _buffer_output
  490.         ;call copy_loadbuf_to_screen
  491.  
  492.         pop hl
  493.         jp _print
  494.  
  495. _loadovl:
  496. ;        POP DE
  497.         inc hl
  498.         ld de,OVL
  499.         call copystr_hlde
  500.         xor a
  501.         ld (DE),a
  502.         JP BEG
  503. _var_equal:
  504.           ld a,(hl)
  505.           inc hl
  506.           ld b,(hl)
  507.           inc hl
  508.           push hl
  509.  
  510.           ld h,high GLOBVARS
  511.  
  512.           cp 0xf0
  513.           jr z,.dialogue
  514.           ld l,a
  515.          
  516.           ld (hl),b
  517.  
  518.  
  519.           ld a,(redraw_border)
  520.           and a
  521.           jr nz,.skip ;do not redraw if blackout
  522.           call check_yoku
  523.           call update_satus
  524. .skip:
  525.  
  526.  
  527.  
  528.           pop hl
  529.           jp _print
  530.  
  531. .dialogue:
  532.          ld l,0xf0
  533. .dialogue_lp:
  534.          ld (hl),b
  535.          inc l
  536.          ld a,l
  537.          cp 0xf8
  538.          jr nz,.dialogue_lp
  539.           pop hl
  540.           jp _print
  541.  
  542.  
  543. _var_plus:  
  544.           ld a,(hl)
  545.           inc hl
  546.           ld b,(hl)
  547.           inc hl
  548.           push hl
  549.  
  550.           ld h,high GLOBVARS
  551.           ld l,a
  552.           ld a,(hl)
  553.           add a,b
  554.           ld (hl),a
  555.  
  556.           ld a,(redraw_border)
  557.           and a
  558.           jr nz,.skip ;do not redraw if blackout
  559.           call check_yoku
  560.           call update_satus
  561. .skip:
  562.  
  563.           pop hl
  564.           jp _print
  565.  
  566. _var_minus:  
  567.           ld a,(hl)
  568.           inc hl
  569.           ld b,(hl)
  570.           inc hl
  571.           push hl
  572.  
  573.           ld h,high GLOBVARS
  574.           ld l,a
  575.           ld a,(hl)
  576.           sub b
  577.           ld (hl),a
  578.  
  579.           ld a,(redraw_border)
  580.           and a
  581.           jr nz,.skip ;do not redraw if blackout
  582.           call check_yoku
  583.           call update_satus
  584. .skip:
  585.  
  586.           pop hl
  587.           jp _print
  588.  
  589. _var_div:
  590.           ld a,(hl)
  591.           inc hl
  592.           ld b,(hl)
  593.           inc hl
  594.           push hl
  595.  
  596.           ld h,high GLOBVARS
  597.           ld l,a
  598.           ld c,(hl)
  599.           push hl
  600.           call DIVIS
  601.           ld l,a
  602.           pop hl
  603.           ld (hl),a
  604.  
  605.  
  606.           ld a,(redraw_border)
  607.           and a
  608.           jr nz,.skip ;do not redraw if blackout
  609.  
  610.           call check_yoku
  611.           call update_satus
  612. .skip:
  613.           pop hl
  614.           jp _print
  615.  
  616.  
  617. _var_down:       ;W variable (0xf0) only
  618.           ld a,(hl)
  619.           inc hl
  620.           ld b,(hl)
  621.           inc hl
  622.           push hl
  623.           cp 0xf0
  624.           jr nz,.skip
  625.  
  626.           ld a,b
  627.           add a,0xf0
  628.           ld l,a
  629.           ld h,high GLOBVARS
  630.           ld (hl),0
  631.  
  632. .skip:
  633.           pop hl
  634.           jp _print
  635.  
  636. check_yoku:
  637.           ld a,l
  638.            cp 201
  639.            ret nz
  640.            ld a,(hl)
  641.            and a
  642.            jp p,.next1
  643.             ;yoku <0  . set to 0
  644.            ld (hl),0
  645.             ret  
  646. .next1:
  647.             cp 101
  648.             ret c
  649.             ld (hl),100
  650.             ret
  651.  
  652. update_satus:
  653.           ld a,l
  654.           cp 201
  655.           jr z,update_satus_bar
  656.           cp 7
  657.           jr z,update_satus_bar
  658.           ;;;cp 2
  659.           ;;;jr z,.update_satus_bar
  660.           ret
  661.  
  662.  
  663.  
  664.  
  665.  
  666. update_satus_bar:
  667.           push bc,de,hl
  668.  
  669.           call clear_status_bar
  670.           call print_excite
  671.           call print_lamp_post
  672.           ;;;call print_date
  673.           call print_loaded  ;;;debug
  674.  
  675.           call print_day
  676.  
  677.           ld bc ,txt_coor
  678.           call _pradd_p
  679.  
  680.  
  681.           pop hl,de,bc
  682.           ret
  683.  
  684.  
  685.  
  686. _SCR_SET:
  687.         push hl
  688.  
  689.         call clear_all_stored_names
  690.         pop hl
  691.         push hl
  692.  
  693.         call load_gfx_to_mem_buf
  694.         pop hl
  695.         ld de,loadedCg
  696.         call copystr_hlde
  697.         xor a
  698.         ld (de),a
  699.  
  700.         inc hl
  701.         push hl
  702.  
  703.         call load_gfx_to_mem2_buf
  704.  
  705.         pop hl
  706.         ld de,buf
  707.         call copystr_hlde
  708.         xor a
  709.         ld (de),a
  710.         inc hl
  711.  
  712.         ld a,(hl)
  713.         ld (_toleft_x),a
  714.         inc hl
  715.         ld a,(hl)
  716.         ld (_toup_y),a
  717.         inc hl
  718.         ld a,(hl)
  719.         ld (_toright_x),a
  720.         inc hl
  721.         ld a,(hl)
  722.         ld (_todown_y),a
  723.         inc hl
  724.         push hl
  725.         call _scr_move_
  726.         pop hl
  727.         jp _print
  728.  
  729. _toleft_x:
  730.          db 0
  731. _toup_y:
  732.         db 0
  733. _toright_x:
  734.         db 0
  735. _todown_y:
  736.         db 0        
  737.  
  738.  
  739.  
  740.  
  741. _CDPLAY:
  742.         inc hl
  743.         PUSH HL
  744.         LD A,(HL)
  745.         CALL load_mus
  746.         POP HL
  747.         INC HL
  748.         JP _print
  749. _T_WAIT:
  750.         inc hl
  751.         LD A,(HL)
  752.         LD B,A
  753.         INC HL
  754.         PUSH HL
  755.         RLCA
  756.         LD B,A
  757. .t1:    
  758.         ld c,6
  759. .t2:     HALT
  760.          dec c
  761.          jr nz,.t2
  762.         DJNZ .t1
  763.  
  764.         ld hl,txt_buff
  765.         ld (hl),32
  766.         inc hl
  767.         ld (hl),0
  768.         call _print_txt_buf_p
  769.  
  770.         ;call WINCLR2
  771.         POP HL
  772.         JP _print
  773.  
  774.  
  775. _cls:
  776.         call WINCLR2
  777.         jr WINCLR3        
  778. ;;;;;-------------
  779. WINCLR:
  780.         CALL WINCLR1
  781. WINCLR3:
  782.  
  783.         ld a,1
  784.         ld (first_word),a
  785.         ld (first_letter),a
  786.  
  787.         inc hl
  788.         JP _print
  789.  
  790. WINCLR1:
  791.          CALL waitkey_a
  792. WINCLR2:
  793.         PUSH HL
  794.         CALL _clear_textbox  ;-0-0-3423566400------------------
  795.        
  796. COOOR   LD BC,txt_coor
  797.         call _pradd_p
  798.         pop hl
  799.         ret
  800.         ;ret
  801. ;;;;;-------------
  802. _F_O
  803.         ld a,(hl)
  804.         ld (outtyp),a
  805.         inc hl
  806.         inc hl ;skip fade color
  807.         push hl
  808.         call clear_all_stored_names
  809.         call _F_O_sub
  810.         pop hl
  811.         jp _print
  812.  
  813. _F_O_sub:        
  814.                 ld a,(mem_buf3)
  815.                 SETPGC000
  816.                 ld hl,0xc000
  817.                 ld de,0xc001
  818.                 ld bc,16383
  819.                 ld (hl),0
  820.                 ldir
  821.                 ld a,(mem_buf4)
  822.                 SETPGC000
  823.                 ld hl,0xc000
  824.                 ld de,0xc001
  825.                 ld bc,16383
  826.                 ld (hl),0
  827.                 ldir
  828.  
  829.  
  830.  
  831.                jp _memory2_output_nopal
  832. ;;;;;-------------
  833. _B_O:
  834.                inc hl ;skip fade type
  835.                ld a,(hl) ;fade color
  836.                inc hl
  837.                push hl
  838.  
  839.                call _B_O_sub
  840.  
  841.                ld a,1
  842.                ld (redraw_border),a
  843.  
  844.                call clear_all_stored_names
  845.    
  846.                 CALL _clear_textbox
  847.  
  848.  
  849.                pop hl
  850.                jp _print
  851.  
  852. _B_O_sub:
  853.                call fade_toblack
  854.  
  855.                call clear_whole_screen
  856.  
  857.                 ld de,pal
  858.                 ld hl,nblackpal
  859.                 ld bc,32
  860.                 ldir    
  861.                 halt
  862.                 ld a,1
  863.                 ld (setpalflag),a                
  864.                 ret
  865.  
  866.  
  867. _EVENT_CG:
  868.                 ld a,(redraw_border)
  869.                 and a
  870.                 jr z,.redraw_skip
  871.                 call redraw_border_sub
  872.                 xor a
  873.                 ld (redraw_border),a
  874.  
  875. .redraw_skip
  876.                 inc hl,hl
  877.                 ld a,(hl)
  878.                 ld (DELAY),a
  879.                 inc hl,hl
  880.                 ld a,(hl)
  881.                 ld (outtyp),a
  882.                 inc hl  
  883.                 inc hl ; skip gallery image ID
  884.  
  885.  
  886.                 push hl
  887.                 call load_gfx_to_load_buf
  888.                 call _buffer_output
  889.  
  890.  
  891.                 call clear_all_stored_names
  892.  
  893.  
  894.                 pop hl
  895.  
  896.                 ld de,loadedCg
  897.                 call copystr_hlde
  898.                 xor a
  899.                 ld (de),a
  900.                 inc hl
  901.  
  902.                 JP _print                
  903. _gameend
  904.         call fade_towhite
  905.         CALL clear_whole_screen
  906.         jp begin