Jump to content
IGNORED

Auto-starting GROM carts?


ralphb

Recommended Posts

I'm trying to create an auto-starting cartridge, or more precisely, a cart with a menu translator that is used to start the cart without a menu selection. MBX and SF titles do this.

 

But when I run this program

.

* GROM auto start sample

       grom >6000

       data >aaff
       data >0100
       data 0
       data 0 ;menu
       data 0, 0, 0, 0
       byte 0, 0, 0

;menu:
;       data 0
;       data autostart
;       byte 9
;       text 'AUTOSTART'

autostart:
       all   42               ; >6013
       fmt
       row   10
       col   10
       htext 'AUTOSTART'
       fend
       back  14
stop:       
       b     stop
              
       end

.

the TI crashes with a white screen (in MESS). When I add a proper menu, everything works.

 

Is there anything special that programs have to do when running as a menu translator? Note that my program does not return, but keeps on running.

 

Link to comment
Share on other sites

Auto Start from ROM is not allowed, it only works from GROM/GRAM.

RXB was originally Auto Start when turned on the Console.

First off you did not set up a proper GPL header and of course it crashed.

This is the RXB header for an example:

[0440]               ***********************************************************
[0441]               *                        GROM HEADER
[0442]               ***********************************************************
[0443]                      GROM >6000
[0444]                      AORG 0
[0445] 6000 AA,0F           DATA >AA0F      * VALID GROM / VERSION
[0446] 6002 01,00           DATA >0100      * (FUTURE EXPANSION)
[0447] 6004 00,00           DATA >0000      * POWERUP
[0448] 6006 63,3B           DATA XBCART     * PROGRAMS
[0449] 6008 00,00           DATA >0000      * DSR 
[0450] 600A A0,26           DATA LINK1      * CALL
[0451] 600C 00,00           DATA >0000      * INTERUPT
[0452] 600E 00,00           DATA >0000      * BASIC CALL

You should look at the RXB source code for help or use my GPL HOW 2 demos.

 

Here is a video on GRAM RESET, but also uses GPL POWER UP HEADER:

 

 

Link to comment
Share on other sites

I think my header is perfectly fine. I set 'AA' for cartridge and 'FF' for autostart, leave all powerup, menu, subprogram, DSRs etc. entries blank, and (auto-)start my code at >6013 as menu translator.

 

This should work, but doesn't.

 

For proof, let's look at some other autostarting image. This is the beginning of Fantastic Fractions:

.
00000000: aaff 1f00 0000 0000 0000 0000 0000 0000  ................
00000010: 0000 0040 3341 2754 0342 ac4c 7053 b643  ...@3A'T.B.LpS.C
00000020: 7442 c447 ab48 df4c 844f 5b56 024c 4a55  tB.G.H.L.O[V.LJU

.

Disassembled, it looks like this:

.

6013: BR    GROM@>6033                                           40 33 
6015: BR    GROM@>6127                                           41 27 
6017: BR    GROM@>7403                                           54 03 
6019: BR    GROM@>62AC                                           42 AC 
601B: BR    GROM@>6C70                                           4C 70 
601D: BR    GROM@>73B6                                           53 B6 
601F: BR    GROM@>6374                                           43 74 
6021: BR    GROM@>62C4                                           42 C4 
6023: BR    GROM@>67AB                                           47 AB 
6025: BR    GROM@>68DF                                           48 DF 
6027: BR    GROM@>6C84                                           4C 84 
6029: BR    GROM@>6F5B                                           4F 5B 
602B: BR    GROM@>7602                                           56 02 
602D: BR    GROM@>6C4A                                           4C 4A 
602F: BR    GROM@>7587                                           55 87 
6031: BR    GROM@>73DC                                           53 DC 
6033: ST    >01,VDP@>2600                                        BE AF 26 00 01
...

.

I don't get this. Why would you jump with BR instead of B, and why is there such a large list of jumps? I could be data, but doesn't look like it.

Link to comment
Share on other sites

Your first post of a program looks like a mishmash of C, Assembly and GPL all rolled into one source code and could not possibly work as I have no clue what GPL Assembler would make this work.

As for over 20 years I have been a mostly GPL programmer I can tell you what works and what does not, really I do know GPL!

Here is a source code in GPL Text that will work if you use the RYTE DATA GPL Assembler like I do. I

It should also work in the RAG GPL Assembler also.

**************************************
*          GROM HEADER               *
**************************************
           GROM >6000
           AORG 0
           DATA >AA01      * VALID GROM / VERSION
           DATA >0100      * (FUTURE EXPANSION)
           DATA MENU       * POWERUP
           DATA >0000      * PROGRAMS
           DATA >0000      * DSR 
           DATA >0000      * CALL
           DATA >0000      * INTERUPT
           DATA >0000      * BASIC CALL

MENU       DATA >0000
           DATA AUTOSTART
AUTOSTART  ALL  42
           FMT
           ROW  10
           COL  10
           HTEX ‘AUTOSTART’
           FEND
           BACK 14

STOP       B    STOP

           END

A semicolon is only used in C not GPL and I have no idea why you have this in the GPL code?

 

Now he Autostart you are showing I never use as it has a few issues as it uses a DEBUGGING MODE AUTOSTART and that creates more issues then it is worth.

This is why I only use the Header method as it is less prone to crashing and like i have said before I have been a mostly GPL programmer for over 20 years.

 

As for you Question of BR (Branch Reset) vs B (Branch) the BR takes only 2 bytes and B takes 3 so the only time you need a B is when you need a long jump and can not be bypassed like BR can be.

BR or BS can be bypassed by a status change and a B can never do this, but it costs an extra byte.

 

Most GPL source I have written or including XB use long BR tables like the look up table for all the XB mini subroutines such as RND, ASC, SEG, ATN for example.

Take a look at RXB GPL source if you want to see how TI writes the GPL code, and I have stuck to this method.

 

Many third parties came up with novel ways to run carts and some are pretty interesting but I prefer the standard method for reliability.

 

Oh note that most BR tables that you ask about have CASE @VALUE that works just like the XB:

 

10 ON VALUE GOTO 100,120, 150,190,200

 

In GPL they would look like this:

 

SUBPGM CASE @VALUE

BR ATN

BR SEG

BR VAL

BR ARC

BR PI

 

As you can see VALUE would be loaded with 0 to 5 for the above case similar to the XB above of VALUE would be from 1 to 5 also.

 

Hope this helps.

 

Rich

Link to comment
Share on other sites

Thanks, Rich, for your explanation about the BR list. I didn't remember CASE, and I didn't know about the size difference between B and BR. This BR list is not preceded by CASE, but it may still be a branch list.

 

The GPL code was written for my xga99, which is a bit more permissive than other GPL assemblers. The semicolon introduces a comment, like *, but doesn't have to start at the beginning of a line.

 

Anyway, you converted the code exactly right. Note, however, that this is not the beginning of a program I want to write, but a test specifically for autostarting.

 

What happens if you change >AA01 into >AAFF? Does it still work?

Link to comment
Share on other sites

Hmm in GPL the * can be anywhere in a line so why use the ; instead as all the GPL Assemblers made all use * as the comment command?

And what do you mean by permissive?

A label in GPL normally does not need a : colon to follow it to be a label.

 

I know your version looks more like C listing then GPL and you can do this with normal GPL without all the exta syntax like a : or ;

 GROM auto start sample

       grom >6000

       DATA >AAFF
       DATA >0100
       DATA 0
       DATA 0 * menu
       DATA 0, 0, 0, 0
       BYTE 0, 0, 0

* menu:
*      DATA 0
*      DATA AUTOSTART
*      BYTE 9
*      TEXT 'AUTOSTART'

AUTOSTART
       ALL   42               * >6013
       FMT
       ROW   10
       COL   10
       HTEX 'AUTOSTART'
       FEND
       BACK  14
STOP       
       B     STOP
              
       END

I do not get why it has to be much more complicated to read? (Other then it has to be uppercase in GPL not lowercase like C.)

 

Testing on the Ryte Data GPL Assembler it works the same as you indicated it Autostarts fine and I had no issues when I tested your program the way I changed it.

I used the GPL*LOADER to load it into Classic99 and it worked great.

 

I think the issue is XGA99 as the Ryte Data GPL Assembler worked without a hitch, oh and just tested the RAG GPL Assembler and it worked fine too.

Link to comment
Share on other sites

Thank you, Rich, but OHEADER looks like an object file. I was talking about a cartridge image.

I use Classic99 and has RXB 2015E built in so do not know what you mean by cartridge image?

 

The object file can be loaded with GPL*LOADER which is what I use to load all GRAM I create.

Link to comment
Share on other sites

I just loaded Rich's OHEADER from post #8. The source is in post #4.

 

Edit:

OK I just added these two instructions

ST >E0,@FAC
MOVE 1,@FAC,#1
To change VDP register #1 from >80 to >E0, and it works.
Edited by lucien2
  • Like 3
Link to comment
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.
Note: Your post will require moderator approval before it will be visible.

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...