Skip to content

Commit 6636d49

Browse files
author
iss
committed
new: BD500 DOS70 support
1 parent 252172e commit 6636d49

File tree

7 files changed

+38
-12
lines changed

7 files changed

+38
-12
lines changed

ChangeLog.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Oricutron ChangeLog
33

44
pre-release changes (work in progress)
55
--------------------------------------
6+
* Updated BD500 for DOS70
67
* Added option to disable menu color scheme
78
* Updated BD500 support
89
* Fixed crash with visual keyboard on/off

disk.c

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1503,8 +1503,9 @@ void microdisc_write( struct microdisc *md, unsigned short addr, unsigned char d
15031503
// the BD interface but it is safer to switch it
15041504
// on in the boot sector (page 4) code.
15051505
//
1506-
// 0x312 DSTATS R on read (BIT instruction) to obtain the
1507-
// FDC's DRQ in bit 7 and IRQ in bit 6.
1506+
// 0x312 DSTATS R bit 7 - DRQ
1507+
// bit 6 - IRQ
1508+
// bit 0 - motor status (): b0=0 ON, b0=1 OFF (NOTE: DOS7 only).
15081509
//
15091510
// 0x313 MAPOFF R/W enables the ORIC ROM and disables the overlay RAM.
15101511
//
@@ -1525,6 +1526,11 @@ void microdisc_write( struct microdisc *md, unsigned short addr, unsigned char d
15251526
// and therefore enables the overlay RAM when MAPON
15261527
// has been accessed.
15271528
//
1529+
// 0x31a DRVSEL R bit 7,6 - current drive
1530+
// bit 5 - current side
1531+
// W bit 7,6 - select drive
1532+
// bit 1 - select side
1533+
//
15281534
// 0x0380 R/W disables the BD interface ROM which covers addresses
15291535
// 0xE000 to 0xFFFF but before that is done, it takes
15301536
// precedence over the above for that memory space.
@@ -1569,6 +1575,7 @@ void bd500_init( struct bd500 *bd, struct wd17xx *wd, struct machine *oric )
15691575
bd->wd = wd;
15701576
bd->oric = oric;
15711577
bd->diskrom = SDL_TRUE;
1578+
bd->motor = SDL_FALSE;
15721579
}
15731580

15741581
void bd500_free( struct bd500 *bd )
@@ -1580,6 +1587,8 @@ void bd500_free( struct bd500 *bd )
15801587

15811588
unsigned char bd500_read( struct bd500 *bd, unsigned short addr )
15821589
{
1590+
unsigned char ret = 0xff;
1591+
15831592
// dbg_printf( "DISK: (%04X) Read from %04X", bd->oric->cpu.pc-1, addr );
15841593

15851594
if( ( addr >= 0x320 ) && ( addr < 0x324 ) )
@@ -1588,7 +1597,8 @@ unsigned char bd500_read( struct bd500 *bd, unsigned short addr )
15881597
switch( addr )
15891598
{
15901599
case 0x312:
1591-
return (bd->drq | bd->intrq);
1600+
ret = bd->drq | bd->intrq;
1601+
if( bd->oric->dos70 ) ret |= bd->motor? 0:1;
15921602
break;
15931603

15941604
case 0x313:
@@ -1600,10 +1610,12 @@ unsigned char bd500_read( struct bd500 *bd, unsigned short addr )
16001610
break;
16011611

16021612
case 0x310:
1603-
case 0x311:
16041613
// MOTOFF = 0
1614+
bd->motor = SDL_FALSE;
1615+
break;
1616+
case 0x311:
16051617
// MOTON = 1
1606-
// or MOTOR = addr & 1;
1618+
bd->motor = SDL_TRUE;
16071619
break;
16081620

16091621
case 0x315:
@@ -1621,6 +1633,12 @@ unsigned char bd500_read( struct bd500 *bd, unsigned short addr )
16211633
bd->diskrom = bd->oric->rom16? SDL_FALSE : SDL_TRUE;
16221634
break;
16231635

1636+
case 0x31a:
1637+
// bits 7,6 current drive
1638+
// bit 5 current side
1639+
ret = ((bd->wd->c_drive&3)<<6) | ((bd->wd->c_side&1)<<5);
1640+
break;
1641+
16241642
case 0x0380:
16251643
bd->diskrom = SDL_FALSE;
16261644
break;
@@ -1629,7 +1647,7 @@ unsigned char bd500_read( struct bd500 *bd, unsigned short addr )
16291647
break;
16301648
}
16311649

1632-
return 0xff;
1650+
return ret;
16331651
}
16341652

16351653
void bd500_write( struct bd500 *bd, unsigned short addr, unsigned char data )

disk.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ struct bd500
178178
struct wd17xx *wd; // Pointer to the WD17xx structure
179179
struct machine *oric; // Pointer to the Oric structure
180180
SDL_bool diskrom; // TRUE if the diskrom is enabled
181+
SDL_bool motor;
181182
};
182183

183184
// Current state of the Jasmin hardware

machine.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ void atmoswrite( struct m6502 *cpu, unsigned short addr, unsigned char data )
315315
struct machine *oric = (struct machine *)cpu->userdata;
316316

317317

318-
if (oric->twilighteboard_activated && addr >= 0xc000 )
318+
if (oric->twilighteboard_activated && addr >= 0xc000 )
319319
twilighteboard_oric_ROM_RAM_write(oric->twilighte,addr-0xc000,data);
320320
else
321321
if( ( !oric->romdis ) && ( addr >= 0xc000 ) ) return; // Can't write to ROM!
@@ -327,7 +327,7 @@ void atmoswrite( struct m6502 *cpu, unsigned short addr, unsigned char data )
327327

328328
else if( oric->ch376_activated && ( 0x340 <= addr ) && ( addr < 0x342 ) )
329329
ch376_oric_write(oric->ch376, addr, data);
330-
330+
331331
else if(oric->twilighteboard_activated && ((0x342 <= addr && addr < 0x344 ) || (0x320 <= addr && addr < 0x330 )))
332332
twilighteboard_oric_write(oric->twilighte,addr,0x00,data);
333333

@@ -407,7 +407,7 @@ void telestratwrite( struct m6502 *cpu, unsigned short addr, unsigned char data
407407
ch376_oric_write(oric->ch376, addr, data);
408408
break;
409409
}
410-
410+
411411

412412
default:
413413
via_write( &oric->via, addr, data );
@@ -1137,6 +1137,7 @@ void preinit_machine( struct machine *oric )
11371137
oric->tapenoise = SDL_FALSE;
11381138
oric->rawtape = SDL_FALSE;
11391139
oric->rom16 = SDL_TRUE;
1140+
oric->dos70 = SDL_FALSE;
11401141

11411142
oric->joy_iface = JOYIFACE_NONE;
11421143
oric->joymode_a = JOYMODE_KB1;
@@ -1378,7 +1379,7 @@ SDL_bool emu_event( SDL_Event *ev, struct machine *oric, SDL_bool *needrender )
13781379
if (oric->ch376 != NULL)
13791380
ch376_oric_config(oric->ch376);
13801381
}
1381-
1382+
13821383

13831384

13841385
break;

machine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ struct machine
136136
int vsync;
137137

138138
SDL_bool vid_double;
139-
SDL_bool romdis, romon, rom16;
139+
SDL_bool romdis, romon, rom16, dos70;
140140
SDL_bool vsynchack;
141141

142142
unsigned short vid_addr;

main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,7 @@ static void load_config( struct start_opts *sto, struct machine *oric )
423423
if( read_config_bool( &sto->lctmp[i], "hstretch", &oric->hstretch ) ) continue;
424424
if( read_config_bool( &sto->lctmp[i], "palghosting", &oric->palghost ) ) continue;
425425
if( read_config_bool( &sto->lctmp[i], "rom16", &oric->rom16 ) ) continue;
426+
if( read_config_bool( &sto->lctmp[i], "dos70", &oric->dos70 ) ) continue;
426427
if( read_config_string( &sto->lctmp[i], "diskimage", sto->start_disk, 1024 ) ) continue;
427428
if( read_config_string( &sto->lctmp[i], "tapeimage", sto->start_tape, 1024 ) ) continue;
428429
if( read_config_string( &sto->lctmp[i], "symbols", sto->start_syms, 1024 ) ) continue;
@@ -1399,7 +1400,7 @@ void frameloop_normal( struct machine *oric, SDL_bool *framedone, SDL_bool *need
13991400

14001401
if (!oric->twilighteboard_activated)
14011402
tape_patches( oric );
1402-
1403+
14031404
via_clock( &oric->via, oric->cpu.icycles );
14041405
ay_ticktock( &oric->ay, oric->cpu.icycles );
14051406

oricutron.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ debug = no
101101
; rom16 = no - 56k mode
102102
;rom16 = yes
103103

104+
; Support BD500/DOS70
105+
; dos70 = no (default)
106+
;dos70 = no
107+
104108
; ----------------------------------
105109

106110
; Render mode (soft, opengl)

0 commit comments

Comments
 (0)