Previous 15994 Revisions Next

r8666 Saturday 31st July, 2010 at 14:22:25 UTC by Angelo Salese
[BASIC MASTER JR]: Miscellaneous fixes
[src/mess/drivers]bmjr.c

src/mess/drivers/bmjr.c
r8665r8666
11/***************************************************************************
22
3        Hitachi Basic Master Jr (MB-6885)
3   Basic Master Jr (MB-6885) (c) 1982? Hitachi
44
5        13/07/2010 Skeleton driver.
5   preliminary driver by Angelo Salese
66
7   TODO:
8   - for whatever reason, BASIC won't work if you try to use it directly,
9     it does if you enter into MON first then exit (with E)
10   - tape hook-up doesn't work yet (shouldn't be hard to fix)
11   - Break key is unemulated (tied with the NMI)
12
713****************************************************************************/
814
915#include "emu.h"
1016#include "cpu/m6800/m6800.h"
1117#include "sound/beep.h"
18#include "devices/cassette.h"
19#include "sound/wave.h"
1220
1321static UINT8 *wram;
1422static UINT8 tape_switch;
23static UINT8 xor_display;
1524
1625static VIDEO_START( bmjr )
1726{
r8665r8666
3746            {
3847               int pen;
3948
40               pen = (gfx_rom[tile*8+yi] >> (7-xi) & 1) ? color : 0;
49               if(xor_display)
50                  pen = (gfx_rom[tile*8+yi] >> (7-xi) & 1) ? 0 : color;
51               else
52                  pen = (gfx_rom[tile*8+yi] >> (7-xi) & 1) ? color : 0;
4153
4254               *BITMAP_ADDR16(bitmap, y*8+yi, x*8+xi) = screen->machine->pens[pen];
4355            }
r8665r8666
6779{
6880   key_mux = data & 0xf;
6981
70   if(data & 0xf0)
71      printf("%02x",data & 0xf0);
82//   if(data & 0xf0)
83//      printf("%02x",data & 0xf0);
7284}
7385
86static running_device *bmjr_cassette;
87
7488static READ8_HANDLER( ff_r )
7589{
7690   return 0xff;
7791}
7892
93static READ8_HANDLER( unk_r )
94{
95   return 0x30;
96}
97
7998static READ8_HANDLER( tape_r )
8099{
81   return 0xff; //TODO
100   //cassette_change_state(bmjr_cassette,CASSETTE_PLAY,CASSETTE_MASK_UISTATE);
101
102   return (cassette_input(bmjr_cassette) > 0.03) ? 0xff : 0x00;
82103}
83104
84105static WRITE8_HANDLER( tape_w )
r8665r8666
89110   }
90111   else
91112   {
92      // ...
113      //cassette_change_state(bmjr_cassette,CASSETTE_RECORD,CASSETTE_MASK_UISTATE);
114      cassette_output(bmjr_cassette, (data & 0x80) ? -1.0 : +1.0);
93115   }
94116}
95117
118static READ8_HANDLER( tape_stop_r )
119{
120   tape_switch = 0;
121   //cassette_change_state(bmjr_cassette,CASSETTE_STOPPED,CASSETTE_MASK_UISTATE);
122   cassette_change_state(bmjr_cassette,CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR);
123   return 0x01;
124}
125
126static READ8_HANDLER( tape_start_r )
127{
128   tape_switch = 1;
129   cassette_change_state(bmjr_cassette,CASSETTE_MOTOR_ENABLED,CASSETTE_MASK_MOTOR);
130   return 0x01;
131}
132
133static WRITE8_HANDLER( xor_display_w )
134{
135   xor_display = data;
136}
137
96138static ADDRESS_MAP_START(bmjr_mem, ADDRESS_SPACE_PROGRAM, 8)
97139   ADDRESS_MAP_UNMAP_HIGH
98140   //0x0100, 0x03ff basic vram
99141   //0x0900, 0x20ff vram, modes 0x40 / 0xc0
100142   //0x2100, 0x38ff vram, modes 0x44 / 0xcc
101143   AM_RANGE(0x0000, 0xafff) AM_RAM AM_BASE(&wram)
102   AM_RANGE(0xb000, 0xe7ff) AM_ROM
144   AM_RANGE(0xb000, 0xdfff) AM_ROM
145   AM_RANGE(0xe000, 0xe7ff) AM_ROM
103146//   AM_RANGE(0xe890, 0xe890) W MP-1710 tile color
104147//   AM_RANGE(0xe891, 0xe891) W MP-1710 background color
105148//   AM_RANGE(0xe892, 0xe892) W MP-1710 monochrome / color setting
106//   AM_RANGE(0xee00, 0xee00) R stop tape
107//   AM_RANGE(0xee20, 0xee20) R start tape
108//   AM_RANGE(0xee40, 0xee40) W Picture reverse (?)
149   AM_RANGE(0xee00, 0xee00) AM_READ(tape_stop_r) //R stop tape
150   AM_RANGE(0xee20, 0xee20) AM_READ(tape_start_r) //R start tape
151   AM_RANGE(0xee40, 0xee40) AM_WRITE(xor_display_w) //W Picture reverse
109152   AM_RANGE(0xee80, 0xee80) AM_READWRITE(tape_r,tape_w)//RW tape input / output
110153   AM_RANGE(0xeec0, 0xeec0) AM_READWRITE(key_r,key_w)//RW keyboard
111154   AM_RANGE(0xef00, 0xef00) AM_READ(ff_r) //R timer
112//   AM_RANGE(0xef40, 0xef40) R unknown
113//   AM_RANGE(0xef80, 0xef80) R unknown
155   AM_RANGE(0xef40, 0xef40) AM_READ(ff_r) //R unknown
156   AM_RANGE(0xef80, 0xef80) AM_READ(unk_r) //R unknown
114157//   AM_RANGE(0xefe0, 0xefe0) W screen mode
115158   AM_RANGE(0xf000, 0xffff) AM_ROM
116159ADDRESS_MAP_END
r8665r8666
267310static MACHINE_RESET(bmjr)
268311{
269312   tape_switch = 0;
313   bmjr_cassette = machine->device("cassette");
314   cassette_change_state(bmjr_cassette,CASSETTE_MOTOR_DISABLED,CASSETTE_MASK_MOTOR);
270315}
271316
272317static MACHINE_DRIVER_START( bmjr )
r8665r8666
293338    MDRV_VIDEO_START(bmjr)
294339    MDRV_VIDEO_UPDATE(bmjr)
295340
341   MDRV_CASSETTE_ADD( "cassette", default_cassette_config )
342
296343   MDRV_SPEAKER_STANDARD_MONO("mono")
297344
298345   MDRV_SOUND_ADD("beeper", BEEP, 0)
299346   MDRV_SOUND_ROUTE(ALL_OUTPUTS,"mono",0.50)
347
348   MDRV_SOUND_WAVE_ADD("wave", "cassette")
349   MDRV_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.20)
300350MACHINE_DRIVER_END
301351
302352/* ROM definition */

Previous 15994 Revisions Next


© 1998-2018 The MESS Team