+RXB Posted August 12, 2011 Share Posted August 12, 2011 (edited) Hello I could use some help with Classic99. Project is to make a Cartridge and put in any GROM page like say 9 or whatever, but not at the first GROM page 0. (GROM not ROM please remember that as this Cartridge has ZERO ROM needed or used.) I have attached the Classic99.ini file I have been trying to use, it shows the cartridge loads but nothing happens nor does the debugger say anything is wrong at all. Also it shows the USER cartridge and can be loaded by user (But is useless as the point is to load it at a different GROM page other then page 0 which destroys the entire point of the project) I can not see what is wrong, when using the docs I try: rom0=G9|6000|2000|MODS\MODULES\reaG.bin This results in it trying to load a GROM file into ROM0 grom=G9|6000|2000|MODS\MODULES\reaG.bin This results in no errors but does nothing at all or indicates anything is wrong at all? grom3=G9|6000|2000|MODS\MODULES\reaG.bin Again does nothing at all? Any help would really get this project going. The idea is to utilize many page banks of GROM to be used no matter the location of the loaded page banks as it finds the correct one and runs it. (PAGE means GROM pages 0 to 15 i.e. 9804, 9808, 980C.... ) (BANK means like normal GROM 6000,8000,A000,C000,E000) GROMCART.zip Edited August 12, 2011 by RXB Quote Link to comment Share on other sites More sharing options...
Tursi Posted August 12, 2011 Share Posted August 12, 2011 Hello I could use some help with Classic99. Project is to make a Cartridge and put in any GROM page like say 9 or whatever, but not at the first GROM page 0. (GROM not ROM please remember that as this Cartridge has ZERO ROM needed or used.) I have attached the Classic99.ini file I have been trying to use, it shows the cartridge loads but nothing happens nor does the debugger say anything is wrong at all. Also it shows the USER cartridge and can be loaded by user (But is useless as the point is to load it at a different GROM page other then page 0 which destroys the entire point of the project) I can not see what is wrong, when using the docs I try: rom0=G9|6000|2000|MODS\MODULES\reaG.bin This results in it trying to load a GROM file into ROM0 Any help would really get this project going. The idea is to utilize many page banks of GROM to be used no matter the location of the loaded page banks as it finds the correct one and runs it. (PAGE means GROM pages 0 to 15 i.e. 9804, 9808, 980C.... ) (BANK means like normal GROM 6000,8000,A000,C000,E000) "rom0=" only means "this is the first rom file to be loaded". It has no bearing on where in the system the file loads, that comes after the equals sign. So this statement: rom0=G9|6000|2000|MODS\MODULES\reaG.binThis results in it trying to load a GROM file into ROM0 ... is untrue. It loads the file "reaG.bin" into GROM page 9 at GROM bank >6000 (using your terminology). Can you show me why you believe it doesn't work? grom=G9|6000|2000|MODS\MODULES\reaG.binThis results in no errors but does nothing at all or indicates anything is wrong at all? Correct, it does nothing at all. "grom" is not a valid key name, and invalid keys in INI files are ignored. grom3=G9|6000|2000|MODS\MODULES\reaG.binAgain does nothing at all? Correct, "grom3" is not a valid key name. You are letting yourself get confused. "rom0" through "rom16" are just counters. They just tell the emulator you want to load a file. It doesn't even have to be ROM anymore, it can be RAM, or even keypresses. Don't be thrown. The '=G' part tells the emulator it is GROM. THIS IS THE PART THAT SAYS WHAT THE FILE REALLY IS. The 'G9' part tells it to use GROM bank 9. The '|6000|' part tells it to load at GROM bank address >6000 The '|2000|' part tells it that the file is at most >2000 bytes (8192 bytes) long. The rest of the line is the filename. Quote Link to comment Share on other sites More sharing options...
+RXB Posted August 12, 2011 Author Share Posted August 12, 2011 (edited) I have tested the GROM file and GPL@LOADER works fine with loading and running the object file OREA3, so I used CSAVE to make a GROM file then used HEX to edit out the 6 byte header and saved the file as REAG.bin The problem is Classic99 does not see the file, try it yourself the file should load but does not show up on the menu or load, the debugger says nothing about it being not able to load the file, and does not show in any cartridge menu? I have looked over the bin file and it does not look any different then any other bin file in the MODS folder. The file is named reaG.Bin I do not understand why it will not load. Now it will load with the open but that is the page 0 GROM so exactly what I do not want. What I want to do is load the page 9 GROM and run it from there. This is what I use in the INI file. [userCart0] name="REA" rom9=G9|6000|2000|MODS\MODULES\reaG.Bin It will not load at page 9 GROM, only from the OPEN file menu, it is listed in the drop down below OPEN but does not load and does not work. Any idea what is going wrong? Edited August 12, 2011 by RXB Quote Link to comment Share on other sites More sharing options...
lucien2 Posted August 12, 2011 Share Posted August 12, 2011 [userCart0] name="REA" rom9=G9|6000|2000|MODS\MODULES\reaG.Bin It will not load at page 9 GROM, only from the OPEN file menu, it is listed in the drop down below OPEN but does not load and does not work. Any idea what is going wrong? It does not load because the length is incorrect. With this entry: [usercart0] name="REA" rom0=G9|6000|20FA|mods\rea.bin It loads into bank 9, but does not show in the master title menu. With this entry: [usercart0] name="2 Cartridges" rom0=G0|6000|2000|mods\A-Maze-Ing.G.bin rom1=G1|6000|20FA|mods\rea.bin Both cartridges are accessible from the master title menu. Quote Link to comment Share on other sites More sharing options...
Tursi Posted August 12, 2011 Share Posted August 12, 2011 [userCart0] name="REA" rom9=G9|6000|2000|MODS\MODULES\reaG.Bin It will not load at page 9 GROM, only from the OPEN file menu, it is listed in the drop down below OPEN but does not load and does not work. Any idea what is going wrong? It does not load because the length is incorrect. With this entry: [usercart0] name="REA" rom0=G9|6000|20FA|mods\rea.bin It loads into bank 9, but does not show in the master title menu. With this entry: [usercart0] name="2 Cartridges" rom0=G0|6000|2000|mods\A-Maze-Ing.G.bin rom1=G1|6000|20FA|mods\rea.bin Both cartridges are accessible from the master title menu. The way that the TI GROM0 builds the cartridge menu when multiple pages are involved is that it first compares pages 0 and 1. If they are the same, it does not scan any other pages. So when you load your GROM into page 9, and nothing anywhere else, all other GROM pages are reading zeros. Thus pages 0 and 1 are identical (all zeros), and the menu never gets as far as page 9. In Lucien's example, he loads into pages 0 and 1, thus making those two pages different, and the menu code knows to enable the multiple-banking code. This is how the TI GROM0 OS works, it's got nothing to do with Classic99. RXB, you seem to be ignoring my description of the "romX=" part of the line, as you've now switched to "rom9=" when you should still be using "rom0=", because it's the only one you are listing. Think of it as meaning "file zero" instead if that helps. Getting the length right is always important. It will still load, but it will be truncated, and that WILL show up in the log. 1 Quote Link to comment Share on other sites More sharing options...
+RXB Posted August 12, 2011 Author Share Posted August 12, 2011 (edited) Thanks guys very much now I can get to work on the concept and put out some stuff. Thank you again. I am confused about one thing though, with my GRAMULATOR or PGRAM or GRAMKRACK I could put a module in any page and it would always come up on the menu even if nothing was in page 0 at all. (ROM or GROM) Why do I need to put something in page 0 for Classic99 when every other GRAM device I have ever used does not, or is it just the way Classic99 works vs real TI GRAM devices? I can work around this fine, just wondering. Edited August 12, 2011 by RXB Quote Link to comment Share on other sites More sharing options...
Tursi Posted August 13, 2011 Share Posted August 13, 2011 I am confused about one thing though, with my GRAMULATOR or PGRAM or GRAMKRACK I could put a module in any page and it would always come up on the menu even if nothing was in page 0 at all. (ROM or GROM) Why do I need to put something in page 0 for Classic99 when every other GRAM device I have ever used does not, or is it just the way Classic99 works vs real TI GRAM devices? I don't have a GRAMULATOR or PGRAM or GRAMKracker to check for sure, all I can tell you is that they /must/ expose some difference between pages 0 and 1, because the OS completely skips scanning otherwise. I spent a fair bit of time in that section of the GPL code when I was testing my GROM simulator, to make sure I understood the multiple banks. Classic99 isn't attempting to emulate a GRAM device, so none of those little variants show up. I guess you could call that part an emulator behaviour, but if you did the same thing on a real TI (without a GRAM device), it would behave the same way. If nothing else, Rich, you've been teaching us all a ton about how the GRAM devices work and the way GPL programmers are used to interacting with them. This clip (from TI Intern) shows the block of code I'm talking about (I've replaced the comments with my own): 01BE : CLR @>83FB Set GROM page to 0 (base address >9800) 01C1 : MOVE >001E TO VDP@>0400 FROM GROM@>6000 Read >1E bytes from GROM >6000 into VDP buffer 1 01C8 : ST @>83FB,>04 Set GROM page to 1 (base address >9804) 01CC : MOVE >001E TO VDP@>0420 FROM GROM@>6000 Read >1E bytes from GROM >6000 into VDP buffer 2 01D3 : CLR @>8358 Zero byte counter MSB 01D5 : CLR @>8359 Zero byte counter LSB (why not use DCLR?) 01D7 : B GROM@>01DC Jump into loop ahead 01DA : INC @>8359 Increment byte counter 01DC : CGT @>8359,>1D When we reach >1E, we are done the buffer 01DF : BS GROM@>01ED Jump ahead and out of loop if so (double branch ultimately to >01FD) 01E1 : CEQ VDP@>0400(@>8358),VDP@>0420(@>8358) Compare buffer 1 to buffer 2, using >8358 as a byte index 01E8 : BR GROM@>01EF If they differ, jump out of the loop 01EA : B GROM@>01DA Loop around again 01ED : BR GROM@>01FD We only get here from >01DF, so this jump is taken (condition is reset after the BS!) 01EF : INCT @>8372 Increment stack pointer by 2 01F1 : DCLR *>8372 Clear data at stack 01F4 : INCT @>8372 Increment stack pointer by 2 01F6 : DST *>8372,>12A1 Store literal value >12A1 (pointer to 'Review Module Library') 01FB : INC @>836C Increment count of programs on stack 01FD : CEQ @>6000,>AA All paths come here, check for ROM cart (different instruction in 2.2 GROM) So basically, this code checks the first two pages, and adds 'Review Module Library' to the menu list if the first two differ. The next block of code checks for ROM carts (except in 2.2, where that's just deleted). Finally, it checks for GROMs. As this order might suggest, the list is displayed in reverse order. The actual GROM search is done by an XML assembly subroutine (XML >1A). This subroutine searches all GROMs for one name each time it's called. I have to admit I find this subroutine really confusing, and I had to spend a lot of time in it when I did my fake 99/8 GROM for the MPD. It does too many things! But this is the function largely responsible. If I read it right again, it returns condition set if it found a name, and reset otherwise. The GPL loop that calls it loops until a name is not found, then it stops (thus filling in all the information for one page). If there's nothing on pages 0 or 1, then you don't get Review Module Library, and if there's nothing on page 0, you also don't get a GROM cartridge entry. (My confidence level in this is only about 80% - the actual GROM name search routine is complex, and I didn't take enough notes last time I went through it.) Testing matches this description, though. If there is /anything/ in bank 0 /or/ 1, then every other base will be scanned for the menu. Note that it's a binary compare, not any kind of header test, so even if it's just random noise in bank 0 that doesn't match bank 1, every other bank is searched for headers. Maybe sometime, you could write a little program that dumps the first 32 bytes of pages 0 and 1 to the screen on the real machine (when there's nothing loaded in them!), and just see if you can see any differences? Quote Link to comment Share on other sites More sharing options...
+RXB Posted August 14, 2011 Author Share Posted August 14, 2011 (edited) Thanks Tursi. Edited August 14, 2011 by RXB Quote Link to comment Share on other sites More sharing options...
lucien2 Posted September 7, 2011 Share Posted September 7, 2011 Anyone else could have posted ini examples of multiple cartridges in other GROM pages and saved Tursi the hassle. I did. [usercart0] name="REA" rom0=G9|6000|20FA|mods\rea.bin It loads into bank 9, but does not show in the master title menu. With this entry: [usercart0] name="2 Cartridges" rom0=G0|6000|2000|mods\A-Maze-Ing.G.bin rom1=G1|6000|20FA|mods\rea.bin Both cartridges are accessible from the master title menu. Ok again I am at a loss as to why I can not get Cartridges to load into Classic99. First what I want to do is load REA at GROM Page 9 and RXB at GROM page 0. There are 16 pages of GROM so I should be able to do this from Classic99.ini file. But so far I can only get RXB or REA to load and never both. Now neither loads and I did not change the REA one at all? (Also no errors are indicated from the Classic99 debugger? Included zip so please help. RXBREA.zip The problem here was not with multiple GROM pages, but the syntax of CPU ROM files. From classic99 manual: 10.2 Example of adding a User Cartridge These lines will add AtariSoft's Pole Position. The assumption is that you have the files in V9T9 format, named POLEPOSC.BIN, and POLEPOSD.BIN. Store the files into the Classic99\MODS folder. Make sure Classic99 is not running, then edit the Classic99.ini file, adding these lines: [userCart0] name="Pole Position" ROM0=C|6000|2000|MODS\POLEPOSC.BIN ROM1=X|6000|2000|MODS\POLEPOSD.BIN Pole Position is not included - this is just an example! Read the [userCart0] section above for detailed on what the fields mean! Note that you may have to change the number after 'UserCart' to the first free number not already in the file. The first line sets the name that will appear under Cartridge->User. The second line tells Classic99 that the first ROM to load is POLEPOSC.BIN, indicates that it is type 'C' (cartridge ROM), specifies the load address and size, and the path to the file. It does the same with POLEPOSD.BIN, except that the type is 'X' (bank 2 XB style cartridge). If you do not know the load address of a ROM file, 6000 is almost always a good guess as this is the base address of the cartridge port for both ROM and GROM. You can get the size from the file if you need to, and the type from the last letter of the filename before BIN: C is cartridge ROM, D is XB bank 2, and G is GROM. Here's the solution: [userCart0] name="RXB/REA" rom0=C|6000|2000|MODS\RXB2001C.bin rom1=X|6000|2000|MODS\RXB2001D.bin rom2=G0|6000|A000|MODS\RXB2001G.bin rom3=G9|6000|A000|MODS\MODULES\REAG.Bin Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.