2 * Copyright (C) 1996-1998 Szeredi Miklos
3 * Email: mszeredi@inf.bme.hu
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version. See the file COPYING.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 #define SOUNDPORT 0x10
27 int SPNM(halfframe
)(int firsttick
, int numlines
)
31 int feport
, scline
, border
= 0;
35 scrptr
= (byte
*) SPNM(image
);
37 tc
= firsttick
- CHKTICK
;
39 for(linesleft
= numlines
; linesleft
; linesleft
--) {
40 DANM(next_scri
) = SPNM(scri
)[SPNM(scline
)];
45 scline
= SPNM(scline
);
48 SPNM(sound_buf
)[scline
] = DANM(sound_sam
);
49 feport
= DANM(ula_outport
);
51 if(feport
& SOUNDPORT
) DANM(sound_sam
) = 240;
52 else DANM(sound_sam
) = 16;
54 /* change EAR bit, store MIC bit*/
56 SPNM(fe_outport_time
)[scline
] = feport
;
57 if(DANM(imp_change
)) DANM(ula_inport
) ^= 0x40;
58 DANM(imp_change
) = SPNM(tape_impinfo
)[scline
];
60 /* Check if updating screen */
63 #if LCD_WIDTH == 320 && ( LCD_HEIGHT == 240 || LCD_HEIGHT == 200 )
64 border
= SPNM(lastborder
);
65 if((feport
& 0x07) != border
) {
66 SPNM(border_update
) = 2;
67 SPNM(lastborder
) = feport
& 0x07;
70 SPNM(border_update
) = 0;
72 scrptr
= update_screen_line(scrptr
, SPNM(coli
)[scline
], DANM(next_scri
),