Previous 15994 Revisions Next

r1194 Sunday 28th October, 2007 at 14:36:32 UTC by Wilbert Pol
[OSBORNE1] Center screen and improved cursor mode drawing.
[src/mess/machine]osborne1.c

src/mess/machine/osborne1.c
r1193r1194
11/***************************************************************************
22
3There are three IRQ sources:
4- IRQ0
5- IRQ1 = IRQA from the video PIA
6- IRQ2 = IRQA from the IEEE488 PIA
7
38***************************************************************************/
49
510#include "driver.h"
r1193r1194
1318   UINT8   bank3_enabled;
1419   UINT8   *bank4_ptr;
1520   UINT8   *empty_4K;
21   /* IRQ states */
22   int      pia_0_irq_state;
23   int      pia_1_irq_state;
1624   /* video related */
1725   UINT8   start_x;
1826   UINT8   start_y;
r1193r1194
144152   memory_set_bankptr( 4, osborne1.bank4_ptr );
145153}
146154
155static void osborne1_update_irq_state(void) {
156   if ( osborne1.pia_0_irq_state || osborne1.pia_1_irq_state ) {
157      cpunum_set_input_line( 0, 0, ASSERT_LINE );
158   } else {
159      cpunum_set_input_line( 0, 0, CLEAR_LINE );
160   }
161}
162
163static void ieee_pia_irq_a_func(int state) {
164   osborne1.pia_0_irq_state = state;
165   osborne1_update_irq_state();
166}
167
147168static const pia6821_interface osborne1_ieee_pia_config = {
148169   NULL,   /* in_a_func */
149170   NULL,   /* in_b_func */
r1193r1194
155176   NULL,   /* out_b_func */
156177   NULL,   /* out_ca2_func */
157178   NULL,   /* out_cb2_func */
158   NULL,   /* irq_a_func */
179   ieee_pia_irq_a_func,   /* irq_a_func */
159180   NULL   /* irq_b_func */
160181};
161182
r1193r1194
176197}
177198
178199static void video_pia_irq_a_func(int state) {
179   if ( state ) {
180      cpunum_set_input_line( 0, 0, ASSERT_LINE );
181   } else {
182      cpunum_set_input_line( 0, 0, CLEAR_LINE );
183   }
200   osborne1.pia_1_irq_state = state;
201   osborne1_update_irq_state();
184202}
185203
186204static const pia6821_interface osborne1_video_pia_config = {
r1193r1194
212230MACHINE_RESET( osborne1 ) {
213231   /* Initialize memory configuration */
214232   osborne1_bankswitch_w( 0x00, 0 );
233
234   osborne1.pia_0_irq_state = FALSE;
235   osborne1.pia_1_irq_state = FALSE;
215236}
216237
217238DRIVER_INIT( osborne1 ) {
r1193r1194
228249
229250VIDEO_UPDATE( osborne1 ) {
230251   UINT8   *charrom = memory_region(REGION_GFX1);
231   UINT16   address = osborne1.start_y * 128 + osborne1.start_x;
252   UINT16   address = osborne1.start_y * 128 + osborne1.start_x + 10;
232253   int x, y;
233254
234255   for ( y = 0; y < 24; y++ ) {
r1193r1194
244265            int bits = charrom[ line * 128 + character ];
245266            int bit;
246267
247            if ( underline && line == 9 ) {
268            if ( underline && line == 8 ) {
248269               bits = 0xFF;
249270            }
250271            for ( bit = 0; bit < 8; bit++ ) {

Previous 15994 Revisions Next


© 1998-2018 The MESS Team