Previous Thread
Next Thread
Print Thread
Page 1 of 2 1 2
#93164 03/08/14 02:18 AM
Joined: Apr 2012
Posts: 293
Pernod Offline OP
Senior Member
OP Offline
Senior Member
Joined: Apr 2012
Posts: 293
The current Electron driver runs way too fast. The 6502 runs at 2MHz which is correct, but only when ROM is being accessed.

When RAM or peripheral devices are accessed, the timing will be highly dependent on the display mode. This is because twice as much data has to be removed from the RAM to produce the display in modes 0-3 as in modes 4-6.

Modes 4-6
The processor will normally be running at 2MHz when it first needs to access RAM or peripherals like the 6522. It has to slow down to 1MHz first. This slow down either consists of a PHI OUT low time of 250ns followed by a high time of 750ns, or a low of 250ns followed by a high of 1250ns. The particular type of transition which occurs will depend upon the relative phases of the 2MHz and 1MHz clocks. Both the 1MHz and 2MHz clocks are internal to the ULA, and are not available outside. They must be generated separately.

Modes 0-3
In these modes, the ULA must have access to the RAM for all the displayed part of a line (40s out of 64s in 256 lines out of 312). This doesnt matter provided that the CPU only wants to access peripherals and the ROM, which it is free to do in the normal way. However, if it tries to access RAM the ULA will hold its clock high for up to 40s. The overall effect is that the processor can be effectively disabled for up to 40s. The only way for the processor to obtain priority over the ULA is by an NMI being generated. This will automatically cause the ULA to release the 6502 (and the RAM), but inevitably creates snow on the screen.

This slow down of the 6502 is currently not implemented, and I have no idea how this should be handled. Can anyone give a little advice, or point me to a driver that does something similar for reference?


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Pernod #93165 03/08/14 02:34 AM
Joined: Mar 2001
Posts: 16,612
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,612
It is not possible to do that at present in the MAME/MESS framework, unfortunately. It's currently (poorly) simulated in some drivers by calling adjust_icount(some negative number) on the main CPU object inside read/write handlers to things that are supposed to slow down.

Pernod #93169 03/08/14 11:43 AM
Joined: Apr 2012
Posts: 293
Pernod Offline OP
Senior Member
OP Offline
Senior Member
Joined: Apr 2012
Posts: 293
Thanks, exactly what I needed to know. The only other decent Electron emulator, Elkulator, does something very similar and already has a method of counting the cycles to delay, so I'll see if I can implement that here.


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Pernod #106777 08/08/16 08:59 PM
Joined: Apr 2012
Posts: 293
Pernod Offline OP
Senior Member
OP Offline
Senior Member
Joined: Apr 2012
Posts: 293
I'm currently adding more bus devices to the electron driver. A device can contain multiple 16K ROMs that are in the device region "exp_rom". I want to assign each of these ROMs to a membank in the electron machine. This is currently done in electron_state::machine_start() by iterating through each "exp" device.

I'd prefer to do this in each device in device_start, which is where I also install memory handlers. The electron machine has membank("bank2") and in my device start I have:
Code:
machine().root_device().membank("bank2")->configure_entry(0xc, memregion("exp_rom")->base() + 0x0000);
machine().root_device().membank("bank2")->configure_entry(0xd, memregion("exp_rom")->base() + 0x4000);
machine().root_device().membank("bank2")->configure_entry(0x0, memregion("exp_rom")->base() + 0x8000);
machine().root_device().membank("bank2")->configure_entry(0x2, memregion("exp_rom")->base() + 0xc000);

This should assign 16K blocks from "exp_rom" to membank("bank2") entries 12,13,0,2. It doesn't complain but doesn't seem to work either. Any suggestions?

Edit: Problem solved, was inadvertently setting the membank entries to blank areas elsewhere.

Last edited by Pernod; 08/09/16 12:36 AM.

BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Pernod #113006 03/30/18 12:23 PM
Joined: Apr 2012
Posts: 293
Pernod Offline OP
Senior Member
OP Offline
Senior Member
Joined: Apr 2012
Posts: 293
Just added a really cool modern Electron cartridge, the Mega Games Cartridge (details at http://stardot.org.uk/forums/viewtopic.php?f=1&t=8246). It's houses 4M FlashRAM containing a large selection of games. The 4M is banked in 16K blocks which are enabled depending on which game is selected from the menu.
Code
mame electron -exp plus1 -cart1 mgc
(plus1 or romboxp required for cartridge slots)
Then SHIFT+BREAK (F12) to boot to the menu from the ROM Filing System.
[Linked Image]

Last edited by Pernod; 03/30/18 12:26 PM.

BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Pernod #113007 03/30/18 12:34 PM
Joined: Mar 2001
Posts: 16,612
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,612
Very cool!

Pernod #113121 04/15/18 02:09 PM
Joined: Apr 2012
Posts: 293
Pernod Offline OP
Senior Member
OP Offline
Senior Member
Joined: Apr 2012
Posts: 293
I've been looking at improving video timing. Here's Flight Path 737, not a great game, but requires accurate timing to change screen modes and palette during the screen update.

The select screen uses MODE1 (4 colours) for the top and bottom rows, and MODE4 (2 colours) for the options, but manages to display 8 colours overall. After the initial title line the MODE is changed and palette changed for each option. The timing of these changes is critical to ensure the colour bands coincide with the options.
0.196
[Linked Image]
0.197 WIP
[Linked Image]
Similarly for the in-game screen the MODE is changed and improvements are obvious.
0.196
[Linked Image]
0.197 WIP
[Linked Image]


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Pernod #113123 04/15/18 04:17 PM
Joined: Mar 2001
Posts: 16,612
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,612
Great improvements!

Pernod #117691 08/19/20 06:07 PM
Joined: Apr 2012
Posts: 293
Pernod Offline OP
Senior Member
OP Offline
Senior Member
Joined: Apr 2012
Posts: 293
I have an Electron expansion device that adds the teletext mode. The device takes the RGB output from the Electron and produces it's own RGB output which will either that from the Electron passed through, or the new teletext mode when selected by software.

I've currently implemented this by adding a new screen for the expansion device, so the original Electron screen is unchanged, and when teletext mode is enabled it is displayed on the new screen. Any suggestions on how I can combine these screens, from the base machine and expansion device? Unfortunately they are at different resolutions too, especially as we double the height of teletext screens due to interlace.


BBC Model B, ATPL Sidewise, Acorn Speech, 2xWatford Floppy Drives, AMX Mouse, Viglen case, etc.
Pernod #117692 08/19/20 06:11 PM
Joined: Mar 2001
Posts: 16,612
R
Very Senior Member
Offline
Very Senior Member
R
Joined: Mar 2001
Posts: 16,612
That's a thing for 80-column cards on the Apple II as well. I don't know of any great solution right now.

Page 1 of 2 1 2

Link Copied to Clipboard
Who's Online Now
0 members (), 47 guests, and 1 robot.
Key: Admin, Global Mod, Mod
ShoutChat
Comment Guidelines: Do post respectful and insightful comments. Don't flame, hate, spam.
Forum Statistics
Forums9
Topics8,834
Posts116,214
Members4,921
Most Online890
Jan 17th, 2020
Powered by UBB.threads™ PHP Forum Software 7.7.5