Previous Thread
Next Thread
Print Thread
Page 2 of 2 1 2
Joined: Nov 1999
Posts: 706
Likes: 8
B
Senior Member
Offline
Senior Member
B
Joined: Nov 1999
Posts: 706
Likes: 8
Looking at the code, I think the code smell is that you've blown out all of your template instantiation in that huge two dimensional array, and between that and template parameters such as A/B/C/D/E/F, it is very difficult to follow what is going on.

Also, I'm not familiar with this view stuff... is this new? (i.e. - <5 years old? ;-))

I think that it does make a great deal of sense to do view setup up front in device_start(), but it looks like you're trying to do even more up front by populating m_all_ram_maps and m_ram_rom_p0_maps in the constructor. Given that device_start() only happens once in an emulation session, it isn't clear to me what this buys you, and it really obscures that is going on.

Instead of having "uber templates" that do everything (all_ram_map, ram_rom_map, ram_rom_map_p1, ram_read) for swathes of the address space, I'd favor smaller templates that "governed" specific slices of memory ($0000-$0FFF, $1000-$1FFF, $2000-$3FFF etc) and had set up the right thing based on well named template arguments (i.e. - not single letters). And instead of creating a big lookup table, use switch/case statements to select the right template when setting up the view.

Of course, its highly likely I might be missing something.

Joined: Mar 2001
Posts: 17,008
Likes: 94
R
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 17,008
Likes: 94
Views are the replacement for address_map_bank_device, circa 2021. The syntax is a bit cleaner and there are performance advantages since it's built into the memory system.

Joined: Nov 2003
Posts: 806
S
smf Offline
Senior Member
Offline
Senior Member
S
Joined: Nov 2003
Posts: 806
Originally Posted by R. Belmont
Views are the replacement for address_map_bank_device, circa 2021. The syntax is a bit cleaner and there are performance advantages since it's built into the memory system.

I don't think it can actually replace all the use cases yet, I tried talking OG into extending emumem a while back.

Joined: Jun 2001
Posts: 503
Likes: 20
O
Senior Member
Online Content
Senior Member
O
Joined: Jun 2001
Posts: 503
Likes: 20
Remind me what you noticed could be added? I forgot by now, sorry...

Joined: Nov 2003
Posts: 806
S
smf Offline
Senior Member
Offline
Senior Member
S
Joined: Nov 2003
Posts: 806
Originally Posted by Olivier Galibert
Remind me what you noticed could be added? I forgot by now, sorry...

Two use cases I can think of off the top of my head that I may have mentioned.

1. 573 banks onboard flash and pccard slot in a 4mb window. The onboard flash fits within the window, but the pccard slot can be any size.
2. commodore/clcd.cpp has a smaller banking granularity than the window size.

My understanding, at the time we discussed it, was that neither of those were supported by views but you considered that it was possible.

Joined: Mar 2001
Posts: 17,008
Likes: 94
R
Very Senior Member
Online Content
Very Senior Member
R
Joined: Mar 2001
Posts: 17,008
Likes: 94
I think we'd agreed that bankdev could stick around for the degenerate cases, but looking at flashbank_map in 573 I don't see how it's unusual (clcd certainly is).

Page 2 of 2 1 2

Link Copied to Clipboard
Who's Online Now
1 members (AJR), 35 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
Topics9,189
Posts120,338
Members5,044
Most Online1,283
Dec 21st, 2022
Our Sponsor
These forums are sponsored by Superior Solitaire, an ad-free card game collection for macOS and iOS. Download it today!

Superior Solitaire
Forum hosted by www.retrogamesformac.com