Jump to content
Blinky

Cheap 2K/4K X-in-1 menu driven Multicart for Atari 2600

Recommended Posts

not really... look here:

; ---------------------------------------------------------------------------
;            Table of bank titles written in ASCII (13 chars each)
; ---------------------------------------------------------------------------
TitleStrings
     ; For now the allowed characters are: 0-9 A-Z a-z . - ' ( ) *
     ;
     ; The first 10 lines use the new macro, sadly it only allows for strings
     ; of 4 characters to be send. So titles are split in the middle
     ;
     ; The other sample titles use the old format, but they can be replaced
     ; with macro lines
     ;

     PutTitle "FROG", "GER ", "    ", " "
     PutTitle "INVA", "DERS", "    ", " "
     PutTitle "Keys", "tone", " Kap", "."
     PutTitle "PAC-", "MAN ", "    ", " "
     PutTitle "PEEK", "-A-B", "OO  ", " "
     PutTitle "PELE", "'S S", "OCCE", "R"
     PutTitle "POOY", "AN  ", "    ", " "
     PutTitle "Q.BE", "RT  ", "    ", " "
     PutTitle "SPAC", "E IN", "VADE", "R"
     PutTitle "STAR", " WAR", "S   ", " "

     PutTitle "BREA", "KOUT", "    ", " "
     PutTitle "V.PI", "NBAL", "L   ", " "
     PutTitle "WALL", " BAL", "L   ", " "
     PutTitle "WIZZ", "ARD'", "O'WO", "R"
     PutTitle "CRAC", "KPOT", "S   ", " "
     PutTitle "Titl", "e 00", "0000", " "
     PutTitle "Titl", "e 00", "0000", " "
     PutTitle "Titl", "e 00", "0000", " "
     PutTitle "Titl", "e 00", "0000", " "
     PutTitle "Titl", "e 00", "0000", " "

    .byte ChT, ChI, ChT, ChL, ChE, Spc, Ch0, Ch0, Ch0, Ch0 ,Ch0 ,Ch2 ,Ch0
    .byte ChT, ChI, ChT, ChL, ChE, Spc, Ch0, Ch0, Ch0, Ch0 ,Ch0 ,Ch2 ,Ch1
    .byte ChT, ChI, ChT, ChL, ChE, Spc, Ch0, Ch0, Ch0, Ch0 ,Ch0 ,Ch2 ,Ch2
    .byte ChT, ChI, ChT, ChL, ChE, Spc, Ch0, Ch0, Ch0, Ch0 ,Ch0 ,Ch2 ,Ch3
    ...

If you need to change more code lines then you can replace every line like this:

.byte ChT, ChI, ChT, ChL, ChE, Spc, Ch0, Ch0, Ch0, Ch0 ,Ch0 ,Ch2 ,Ch0

 

with a line like this:

PutTitle "-MY ", "OWN ", "GAME", "-"

 

They are easy to change, the only problem in those lines are that you have to split up the title in groeps of 4 charcters.

I was not able to find a macro that can allow a full 13 char string. Maybe someone else will find a solution.

Share this post


Link to post
Share on other sites

I forgot to mention that I'm not able to test your roms on real hardware since I don't have such large eproms or eeproms by hand.

Blinky uses a bigger flash chip, so maybe he can test it. I'm unsure how big the flash chip is that he uses though.

I have not tested your rom on stella either, but for you the same advice.

Check if the games run like they should, and if they are 4K games then lock the bank to be sure.

Just let the menu call bank 128-255 instead of 0-127.

But you might already have done that.

 

They run fine in Stella and the source has conditionals to generate code that will lock the bank if possible with the specified number of games.

Here is the bankswitch routine from the POP rom (executed from RIOT ram):

        IF MDMC_HACK
            IF [[NR_GAMES<127]&&[RESET_BUTTON]]||[[NR_GAMES<128]&&[!RESET_BUTTON]] 
            ora #$80
            ELSE
            nop
            nop
            ENDIF
       sta ramcode+5   
       lda $0800 
        ELSE
       ora #$80        ;09 80
       sta ROMLATCH    ;8D 00 08
        ENDIF

       sta WSYNC       ;85 02
       sta WSYNC       ;85 02
       jmp ($FFFC)     ;6C FC FF

Accumulator holds the lower byte of the hotspot address; if the total number of banks is 128 or less (SafeNet rom + Menu + max 126 games, or Menu + max 127 games), then 128 is added to that value by the "ora #$80" instruction.

 

I used similar code also in the 208 in 1 menu hack.

 

The Stella debugger confirms that banks are locked in the roms I posted.

post-10599-0-80234900-1447237632_thumb.png

 

So far I could only check the menus by themselves (as 4k roms) on real hardware, just to see if there weren't glitches in display or input routines.

Share this post


Link to post
Share on other sites

So far I could only check the menus by themselves (as 4k roms) on real hardware, just to see if there weren't glitches in display or input routines.

I can test part of the rom on my test board, but it only supports roms up to 64k.

So if I understand correctly you lock all game banks? I hope you did not do this by default in megacardmenu v2.1.

That would dissable the possibility for roms over 4k

 

I still have to take a good look at your code, so don't shoot me if I say something stupid.

But you say 'if the total number of banks is 128 or less'... MDM does not support more than 128 banks anymore, not since the bank locking was added.

 

 

 

@Madhatter:

Here is a tool I made for you. You can create a list of names with it and it will generate the code for it.

After you did that you need to copy the list from the program and replace the lines in the source code.

megacardmenu ListTool.zip

Edited by DrWho198

Share this post


Link to post
Share on other sites

Here is a video I made of the linker/dumper software that I'm working on.
post-37130-0-55223200-1447250950_thumb.png
https://youtu.be/cxjlbCDv3V8

No writing features are yet included, and this video only shows an automated mode.
Also keep in mind there are still some problems like:

  • F6 works, but sometimes a game after F6 hangs, this is probably a small bug.
  • FE works when you are Lucky... sometimes after 1 try and sometimes like in this clip after too many tries.
    https://youtu.be/cxjlbCDv3V8?t=286
  • MDM is slow, the reason for this is that there is no specific size for MDM catridges and the software first checks every bank to see how big the rom is, then it starts dumping. I know the detecting can be faster, which I intend to tackle in the future.

The cards tested in this video are:

  • Jungle Hunt
  • Smurfs
  • a generic MDM test cartridge with some homebrew
  • Decathlon... and again... and again...
  • Pac-Man Jr
  • ... a mystery cartridge ... :P

 

 

 

@Madhatter:

I just notice you try to hack the roms and not the source, I'm not saying it's not possible but it's a lot harder. Try changing the source code and compile it using dasm.

Edited by DrWho198
  • Like 1

Share this post


Link to post
Share on other sites

So if I understand correctly you lock all game banks? I hope you did not do this by default in megacardmenu v2.1.

That would dissable the possibility for roms over 4k

Nope, the only changes were in the firebutton routine and in the added conditionals so that you only have to set a few constants to generate the rom (a single flag is used to generate PAL or NTSC version and the number of text lines is determined based on the TV format and number of games). Of course if someone needs/wants a different behaviour it's still possible to manually change every aspect like before.

 

 

But you say 'if the total number of banks is 128 or less'... MDM does not support more than 128 banks anymore, not since the bank locking was added.

If you build the cart using the schematic in post #45, you have a 27C080 eprom and the lock bit is also used as the higher address line (BA19 in the schematic), so I think in that configuration there are 256 4k banks, with only the upper 128 which are locked.

post-10599-0-19581400-1447250924_thumb.gif

I don't plan to have all that games when I will build the cart, as having the bankswitch unlocked can easily cause a game to crash, but it was simple enough to add that option, so I did while I was hacking the other 2 menus.

 

As for bankswitched games I didn't look in detail (I'm even less experienced in hardware than I am in software and I plan to build this only for 4k games anyway), but I think you could have the in-game bankswitch logic separated from the multicart one, so that the lock only happen on the latter.

 

E.g.: in the case of a 127 F8 (atari 8k) bankswitched games using a 27C080 ( 1Mb x 8 ), you can have eprom A0-A11 wired directly to the cart port, eprom A12 connected to the output of the F8 bankswitch logic (circuit below is from this page: http://www94.pair.com/jsoper/bankswitch_f8.html) and eprom A13-A19 connected to the pins labeled BA12-BA18 in Blinky's schematic. The eprom must contain the menu (repeated twice) in the lower 8k and then 127 8k games to fill the space.

By using game numbers 129-255 in the menu you will only lock eprom addresses A13-A19, but A12 will still be used for the F8 in-game bankswitch.

                       |\      
          -------------| >()--------------  Eprom
         |             |/                   Enable
         |                       5v  5v
    A12 -+-|-                   __|___|_
    A11 ---|  \                | Set Rst|
    A10 ---|   \               |        |
     A9 ---| 7  \          A0--|D  7   Q|-- A12
     A8 ---| 4 N \             |   4    | of eprom
     A7 ---| 1 A |     |\      |   7    |
     A6 ---| 3 N |()-+-| >()---|>  4    |
     A5 ---| 3 D |   | |/      |________|
     A4 ---|     /   |           
     A3 ---|    /   ___         
    /A2 ---|   /    ___ 1000pf (0.001 uf)
    /A1 ---|  /      |
        \--|_/       |
                    gnd

A similar approach can be used for different in-game bankswitch schemes.

 

 

Here is a video I made of the linker/dumper software that I'm working on.

Cool! :thumbsup: :thumbsup:

Share this post


Link to post
Share on other sites

Nice thinking, but adding F8 bankswitching logic would ask more space in the cartridge and a lot more complicated circuit. Blinky and I are working on patches to use with different games to allow them to put in an MDM cartridge. It works fine for most games, But sometimes you need to patch more because of accidental bankswitches. if you wish to add an 8k game to MDM then ask me, I might be able to provide you with a working rom, but you can not run the game locked or the bankswicthing in the game would not work.

Share this post


Link to post
Share on other sites

Ok, I got it now...
When I hacked the 2 old menu roms I was only considering a multicart where all the games are the same size (sort of a replacement of the dipswitches commonly used in cheap multicarts). Hacking the game roms to use the MDM bankswitch allows for much greater flexibility. In that case, my 208 in 1 and POP menu hacks would need to be changed to use a lookup table for the bank numbers (so that you can use non consecutive bank numbers and set the lock bit only for non bankswitched games). It shouldn't be difficult to add an option for that, I'll look into it later.

Share this post


Link to post
Share on other sites

True, but it depends what you want to do with it.

The roms in your POP, are they the Original games in the POP machine?

if so, I would keep it like that. I was even thinking of building a cartridge like that once you showed up with the menu.

Edited by DrWho198

Share this post


Link to post
Share on other sites

I just hacked them for fun, but if I build a cart I will probably use your menu with the game names...
Anyway, I like the idea of a cart simulating the POP kiosk. By looking at the service manual I found that Asteroids was included in the list of games, and that's 8k in size.

So I modified the 2 menus.

If using 4k roms only, the bank numbers are automatically generated by setting "AUTO_BANK_NR = 1" in the source.

If "AUTO_BANK_NR = 0", the bank number for each game can be set manually in a table, so using bankswitched games is also possible now.
208in1_MDMC_v2.asm

POP_MDMC_v2.asm


Here is the POP menu with the original 42 games, ready to be burned to a 256k x 8 eprom like a 27c020 (or to be used in stella).

PAL version included (I had to convert a couple of early games which were not released in PAL...)
Atari_POP_MDM_hack_NTSC.bin

Atari_POP_MDM_hack_PAL.bin

Here is the bank table I used. Bankswitch is locked for all games (bit 7 set) except for Asteroids.

   .byte $81    ; 01 Adventure    
   .byte $82    ; 02 Air-Sea Battle
   .byte $03    ; 03 Asteroids (bank0)
;  .byte $04                   (bank1)
   .byte $85    ; 04 BackGammon
   .byte $86    ; 05 Basketball
   .byte $87    ; 06 Bowling
   .byte $88    ; 07 Breakout
   .byte $89    ; 08 Canyon Bomber
   .byte $8a    ; 09 Casino
   .byte $8b    ; 10 Circus Atari
   .byte $8c    ; 11 Combat
   .byte $8d    ; 12 Dodge'em
   .byte $8e    ; 13 Football
   .byte $8f    ; 14 Golf
   .byte $90    ; 15 Hangman
   .byte $91    ; 16 Homerun
   .byte $92    ; 17 H. Cannonball
   .byte $93    ; 18 Maze Craze
   .byte $94    ; 19 Missile CMD
   .byte $95    ; 20 Night Driver
   .byte $96    ; 21 Othello
   .byte $97    ; 22 Outlaw
   .byte $98    ; 23 Champ. Soccer
   .byte $99    ; 24 Sky Diver
   .byte $9a    ; 25 Slot Racers
   .byte $9b    ; 26 Space Invaders
   .byte $9c    ; 27 Street Racer
   .byte $9d    ; 28 Superman
   .byte $9e    ; 29 3D Tic-Tac-Toe
   .byte $9f    ; 30 Video Checkers
   .byte $a0    ; 31 Video Chess
   .byte $a1    ; 32 Video Olympics
   .byte $a2    ; 33 Video Pinball
   .byte $a3    ; 34 Warlords
   .byte $a4    ; 35 Berzerk
   .byte $a5    ; 36 Haunted House
   .byte $a6    ; 37 Math Grand Prix
   .byte $a7    ; 38 Defender
   .byte $a8    ; 39 Yar's Revenge
   .byte $a9    ; 40 Pac-Man
   .byte $aa    ; 41 Super Breakout
   .byte $ab    ; 42 Demons to Diamonds

Edited by alex_79

Share this post


Link to post
Share on other sites

Again, thank you for sharing.
Astroids might give you a small headache to patch.
Blinky already patched that one, if you want I can give you the patches.
Unless you want to look for it yourself :)

I also notice that you have a lot of space left in the menu bank, what you could do is add this line somewhere in the source and Stella will automaticly detect it as an MDM cartridge:
.byte "MDMC" ; 'Menu Driven Mega Cart' Banks-witch recognition for Stella

even if the menu is in bank 1 (the second bank) stella will recognise your rom as an MDMC/MDM

by the way, how is the menu controlled?

Edited by DrWho198

Share this post


Link to post
Share on other sites

hah, once again you seem to be ahead of me, I managed to use the menu and noticed that your astroids is working fine.

I guess you already found the small problem with that rom and fixed it. Great job!

 

 

what games did you convert to pal? and how did you do it? PAL60?

I know you have some banks left over, can't you shift all games one bank up and add the safenet?

btw, blinky call the safenet a bootstrap. I'm not sure which would be the best name for it.

I prefer safenet since it has exactly the same use. Catch the programcounter wherever it drops into the bank in a safe way.

But it's his work that we are building on.

Edited by DrWho198

Share this post


Link to post
Share on other sites

I've checked what the problem is, and in my oppinion it's bad programming from the Mouse Trap programmers :P

But I guess it won't hurt to fix it in the menu rom.

 

To explain a bit more, when the menu starts a game it doesn not reset the registers since I expected the game to do it. But apparently, not all programmers felt this way, and because of this mousetrap hangs.

I'll fix it.

Share this post


Link to post
Share on other sites

Here it is v2.2!

Registers are now reset after bankswitch.

megacardmenu_v2_2.asm

 

 

@Madhatter:

Do the same with this source and mouse trap will work fine ( I hope ;) )

 

When looking at the binairy I noticed the uge waste of space with all the NOP's. I'll have to clean that up some day.

 

@Alex_79:

Did you clear registers in the other menu's?

And one other thing... atari POP service manual? where did you find that?

Edited by DrWho198

Share this post


Link to post
Share on other sites

I managed to use the menu and noticed that your astroids is working fine.

I guess you already found the small problem with that rom and fixed it. Great job!

Yes. The disassembly by Thomas Jentzsch was very helpful to fix this.

 

what games did you convert to pal? and how did you do it? PAL60?

I converterd "Canyon Bomber" and "Homerun". I just changed the color values to match the PAL palette and the timers to increase the scanline count for 50Hz display. I mainly use the stella debugger for that. I already had a PAL conversion of "Football" on my PC, but I don't remember who made that.

While testing the roms I also found that "Warlords", "Dodge'em" and "Haunted House" had some bugs (zero page reads instead of immediate), which could cause glitches in some cases. I patched the first two, and downloaded a fixed version of the third from here. (If you start stella with the "-tiadriven 1" option you can easily spot those cases).

 

 

I know you have some banks left over, can't you shift all games one bank up and add the safenet?

Here are the roms with the safenet added as well as the string for autodetection in Stella (thanks for the tip).

POP_MDM_hack_NTSC+safenet.bin

POP_MDM_hack_PAL+safenet.bin

 

Did you clear registers in the other menu's?

Nope, I supposed that the games would initialize ram and register. I wonder if Mouse Trap sporadically fails on real hardware too, depending on the state of the registers at powerup...

 

 

And one other thing... atari POP service manual? where did you find that?

Here: http://www.atarimania.com/documents-atari-2600-vcs-technical-documents_3_2.html Edited by alex_79

Share this post


Link to post
Share on other sites

I found the problem:

In version 2.2, in the "GameSelect" routine the bank number is not stored to ram before jumping to the "MDMbankswitch" routine, so the menu only switches to bank0 (that is, to itself).

 

Add the line "STA $E1" before "JMP.w $E0" as shown below and recompile. it should work then.

 

 

; -------------------------------- SUBROUTINE -------------------------------
;    Do MDMC BankSwitch
; ---------------------------------------------------------------------------
GameSelect:
       LDX #17
CopyToMem
       LDA MDMCBankSwitch-1,X
       STA $E0-1,X
       DEX
       BNE CopyToMem

       CLC
       LDX SelectedTitle
       LDA BankList,X
       ADC #FirstTitleBank
       STA $E1            ; <------------------------- ADD THIS LINE!
       JMP.w $E0

MDMCBankSwitch:
       LDA $0800
       LDX #$FF
       TXS
       LDA #$00
       TAX
       TAY
       JMP ($1FFC)
; ---------------------------------------------------------------------------


Edited by alex_79

Share this post


Link to post
Share on other sites
Thanks to alex_79 and DrWho198 for your patience.

The last code it seems PAL only, (strange colors), not work in NTSC.

And, Mouse Trap not work at all.



This is, at the moment, the best code (for me :) ) :


The problem is Mouse Trap corrupt. The rest is perfect.

Edited by Madhatter

Share this post


Link to post
Share on other sites

You must set a few constants in the source before compiling. These are those you need for your example (15 games, NTSC)

; ---------------------------------------------------------------------------
;    These settings control the behaviour of the menu        (Change This)
; ---------------------------------------------------------------------------
FirstTitleBank  = 1                    ; Indicates the real BankNr of the first bank in the menu.
                                       ; When setting this to 4, the menu will load the 5th bank
                                       ; when selecting the first title.
                                       ; By default this would be 1 if bank 0 contains a menu,
                                       ; or 2 if bank 0 would contain a safety net and 1 the menu.

NrTitles        = 15                   ; The actual number of menu items, currently a range of 8 to 230,
                                       ; But since bank 128 to 255 are mirrors of 0-127, this number of
                                       ; Entries/Titles will not be needed.
PAL             = 0                    ; 1 = PAL   0 = NTSC



Moreover it's also very important to correctly set the Banklist table.
When you're only using 4k games, you can just use consecutive values
starting from 128. You only need to set as many values here as the number of
games (15 in your case), the rest is ignored.

BankList
    .byte  128, 129, 130, 131, 132, 133, 134, 135, 136, 137
    .byte  138, 139, 140, 141, 14, 15, 16, 17, 18, 19
    .byte  20, 21, 22, 23, 24, 25, 26, 27, 28, 29
    .byte  30, 31, 32, 33, 34, 35, 36, 37, 38, 39
    .byte  40, 41, 42, 43, 44, 45, 46, 47, 48, 49
    .byte  50, 51, 52, 53, 54, 55, 56, 57, 58, 59
    .byte  60, 61, 62, 63, 64, 65, 66, 67, 68, 69
    .byte  70, 71, 72, 73, 74, 75, 76, 77, 78, 79
    .byte  80, 81, 82, 83, 84, 85, 86, 87, 88, 89
    .byte  90, 91, 92, 93, 94, 95, 96, 97, 98, 99
    .byte 100,101,102,103,104,105,106,107,108,109
    .byte 110,111,112,113,114,115,116,117,118,119
    .byte 120,121,122,123,124,125,126,127

Here is the v2.2 menu source with values adjusted for your example.
megacardmenu_v2_2fix_15_games_NTSC.asm
And here is the bin

megacardmenu_v2_2fix_15_games_NTSC.bin

 

 

P.S. while mousetrap will work fine with ver 2.2 of the menu, I hacked the code so that registers are now properly initialized and also fixed the scanline count for the NTSC one. These patched versions should work fine on every hardware.

The clever initialization routine I used was posted by Omegamatrix a while ago (see the source for details).

 

mousetrap.asm

mousetrap_startup_fix_NTSC.bin

mousetrap_startup_fix_PAL.bin

 

 

Edited by alex_79

Share this post


Link to post
Share on other sites

thanks alex, I didn't have the time to help out untill now, but I notice you had this covered :)

Some advice to you Madhatter, if you wish to make more menu's then just read the source from beginning to end and look for all comments.

Most things that you need to change are documented. And don't feel scared to experiment with the code in a copy of your menu.

You might learn a little about programing along the way which might help you in the future.

Edited by DrWho198

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...