Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expert support #75

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Expert support #75

wants to merge 5 commits into from

Conversation

smdprutser
Copy link

I have add support for the Expert cartridge and Georam Cartridge (only 64K for now). Expert cart can be loaded when the appropriate crt is selected in the directory menu, but it can also be programmed in through the C64 itself. For that the settingsmenu has a new setting 'Expansion on F8'. This setting controls if nothing (none option), expert cartridge (expert option) or Georam (Georam-64K option) is active when the F8 is pressed in the menu.

In order to program the Expert cart make sure the Expert is selected in the Settings menu and persistent BASIC selection is yes. Press F8 somewhere in the menu and you get into regular C64 mode. The cart is now in 'Program' mode. Load the Expert disk and select the appropriate payload you want. when the programming is done reset your commodore as requested. The payload should be executed. Entering the Menu wil reset this flag to 'PRG' mode.

A few notes:

  • I noticed the expert doesn't play wel along with Jiffydos active, make sure stock kernal is used.
  • Also I couldn't get the freeze button to work properly, so only the restore key and fiddling the CIA works.

The Georam is for now only 64K big and rolls over on every 64K which makes it not very usefull at the moment. I think we can push it to about 160K in the end (but requires a bit of rework of the code). Dunno if it is usefull then too, but for simple disk-copying or native compiler like TMP it will suffice. 512K (which is the smallest Georam) is out of reach without a major hardware change.

I did my development on a PAL SX64 which can be picky on the KFF cart. NTSC is not tested at all.

@smdprutser smdprutser mentioned this pull request Jan 13, 2021
@KimJorgensen
Copy link
Owner

Thank you for your PR. It would be nice to have Expert Cartridge and GeoRAM support.

There are a couple of design choices that I would like done differently, and would liked a more polished solution before adding this to the codebase. If you are willing to discuss and address some of these issues then I would suggest splitting this PR into two, and start with Expert Cartridge.

@smdprutser
Copy link
Author

I'm a bit of a github noob, so dunno how to proceed now.

Feel free to mail me (info at my github handle ended with .nl) or PM me on the forum) with a bit more details what you want as I think they don't belong in this discussion.

…nd will be re-enabled later)

- When expert expansion is active and programmed (the special button toggles between active and inactive)
@smdprutser smdprutser changed the title Expert and Georam support Expert support Jan 27, 2021
@smdprutser
Copy link
Author

As requested I removed the georam support for now. When this part is ok I re-enable it.

The Expert support is now quite solid and seem to work consistantly on my setup (PAL SX64). When the expert software is active (either by loading the .crt or as expansion loading the software on the C64 and resetting it) it can be enabled/disabled with the special button.

@KimJorgensen
Copy link
Owner

The reason for asking you to split the PR up into two was that I consider this as two different features that could be implemented independent of each other. Having a small PR would help keeping the discussion shorter and focused. Sorry, for not making that clear. For now I'll ignore GeoRAM and focus on the general feedback for the Expert Cartridge.

To keep the functionality consistent with the existing I would prefer if we could adhere to the following:

  1. The "Kill" functionality (F8) should only have one meaning
  2. Use of the settings menu should rarely be required
  3. Changing the state of the cartridge should preferably be done with the special button
  4. The state of the cartridge should be indicated by the LED if possible

I have an idea on how to achieve this but would like to hear your opinion before presenting this. I also have a lot of comments to the code but think we should agree on the general stuff first before moving on to the details.

Please excuse if my response time is a bit long at times but my spare time is limited and I have other projects that I work on.

@smdprutser
Copy link
Author

Everybody has the problem of too less spare-time :) Don't think you can see them separate as both are carts that doesn't have a .crt file to run but are more an expansion. They call for a way to implement differently then the other parts.

I had several thoughts before coming up with this code/way to organize things. So here are my thoughts:

Kill option
didn't want to add a new function key to the menu. I saw the kill function as the best way. In retrospect it makes more sense to add it to the F7 menu or separate F key.

settings menu
By splitting this into 2 pull requests doesn't make sense to use 2 bits here, but when adding it to F7 or F8 and Georam is also added there are at least 2 options to choose from. Preferable a byte in settings storage would be ideal for further use, but there is not much space left there without altering the settings-struct. Alternatively we can activate it by loading a dummy .crt but that is not a usefriendly option. Another option would be selecting which expansion to use every time you start it (not userfriendly either)

setting and knowing the state of the cart
The expert cartridge 'workflow' is as follows (also with the real thing): program it once, then reset it and use that programmed payload. After it starts the cart is in programming mode. The next reset activates the payload and further programming is not possible. Using the special button the user can toggle between payload active or inactive. The led displays the current state (lit is active). Due to having 3 states and only 1 led during programming mode the led is also off. When the user goes into menu the state of the cart is set back to program.

To activate the freezer the restore is used (is wired to the NMI line), same as on the real one.

The real expert has a 3way switch that switches between Program mode, Active or Off. more info about it in dept: https://rr.pokefinder.org/wiki/Expert_Cartridge

@KimJorgensen
Copy link
Owner

Thank you for your thoughts, here are mine.

Let me add a bit more context to my points 1-4:

  1. To avoid confusion the F-keys should only have one dedicated function or it should at least be clear what would happen if pressed. Making the user regular change the behavior of a F-key violates that in my opinion.
  2. It should be simple to start emulation of a cartridge and thus not require the user to change any settings first.
  3. For all other cartridge types the KFF acts as if the real cartridge was inserted after the selection is done in the menu, and the special button controls its state, if applicable. I do realize that the Expert is a bit more complex, especially if the ESM version also should be emulated, but for consistency I think it is better to control the 3 states (program / off / on) with the special button.
  4. Making the LED blink could be a way of indicating programming state. I know that would require additional logic in the interrupt handler but think it is possible.

Regarding the workflow, I would expect that most would use a CRT file as that would eliminate the programming step and therefore I don’t really see the need for having a different method for starting emulation of the Expert cartridge. Programming should of course still be possible.

I do have a real Expert Cartridge so what I'm suggesting is not based on ignorance. However, I do not claim to be an “expert” user of it.

@smdprutser
Copy link
Author

Sorry for not mentioning it explicitly in the last answer, but by selecting an Expert crt image in the browser it will get launched as well. The KFF behave as if it is programmed and can be toggled with the special button on or off.

I do think ESM is not doable as the KFF cannot pull NMI up if the CIA is pulling it down (also there is no resistor in this line) Also the LED function of it needs to get multiplexed with the current led functions.

I do agree on the seperate F key. I choosed my way as it seemed to work back then and foccussed more on getting it to work as much as the original. But you are right.

@smdprutser
Copy link
Author

smdprutser commented Feb 6, 2021

I gave your thoughts a second though.

It is prone to corrupt the image in RAM when the special button cycles through ON, OFF and PRG. The PRG mode will make the contents of the cart writable at $8000-$9FFF. Selecting prg mode by accident can overwrite things that can cause image corruption.

Having a separate and easy way to drop into programming mode will solve this (and for the future enable access to other user programmable peripherals like G/Neoram, ISEPIC, REU etc.)

@StmLord
Copy link

StmLord commented Mar 12, 2021

I gave your thoughts a second though.

It is prone to corrupt the image in RAM when the special button cycles through ON, OFF and PRG. The PRG mode will make the contents of the cart writable at $8000-$9FFF. Selecting prg mode by accident can overwrite things that can cause image corruption.

Having a separate and easy way to drop into programming mode will solve this (and for the future enable access to other user programmable peripherals like G/Neoram, ISEPIC, REU etc.)

I was following your conversation and I had an idea to propose
Is it possible to make the special button to be pressed for more than 2-3 seconds to enter the programming mode of the cartridge?
That way it could guarantee that it will not be put in prg mode by accident

@smdprutser
Copy link
Author

I gave this a though also, but I run out of cycles to get it implemented this way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants