Jump to content

Photo

Auto-starting GROM carts?

gpl

16 replies to this topic

#1 ralphb OFFLINE  

ralphb

    Dragonstomper

  • 533 posts
  • Location:Germany

Posted Wed Apr 5, 2017 11:05 AM

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.

 



#2 RXB OFFLINE  

RXB

    River Patroller

  • 2,847 posts
  • Location:Vancouver, Washington, USA

Posted Wed Apr 5, 2017 11:23 AM

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:

 

 



#3 ralphb OFFLINE  

ralphb

    Dragonstomper

  • Topic Starter
  • 533 posts
  • Location:Germany

Posted Thu Apr 6, 2017 12:09 AM

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.

 
 


#4 RXB OFFLINE  

RXB

    River Patroller

  • 2,847 posts
  • Location:Vancouver, Washington, USA

Posted Thu Apr 6, 2017 1:48 AM

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



#5 ralphb OFFLINE  

ralphb

    Dragonstomper

  • Topic Starter
  • 533 posts
  • Location:Germany

Posted Thu Apr 6, 2017 2:14 AM

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?



#6 RXB OFFLINE  

RXB

    River Patroller

  • 2,847 posts
  • Location:Vancouver, Washington, USA

Posted Thu Apr 6, 2017 3:57 AM

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.



#7 ralphb OFFLINE  

ralphb

    Dragonstomper

  • Topic Starter
  • 533 posts
  • Location:Germany

Posted Thu Apr 6, 2017 10:29 AM

Rich, would you be so kind to post your resulting BIN file?  I'd like to compare to my output.



#8 RXB OFFLINE  

RXB

    River Patroller

  • 2,847 posts
  • Location:Vancouver, Washington, USA

Posted Fri Apr 7, 2017 1:02 AM

Ok I am using Classic99 so this is the source, Object and List file.

 

 

Attached Files


Edited by RXB, Fri Apr 7, 2017 1:04 AM.


#9 ralphb OFFLINE  

ralphb

    Dragonstomper

  • Topic Starter
  • 533 posts
  • Location:Germany

Posted Fri Apr 7, 2017 1:21 AM

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



#10 RXB OFFLINE  

RXB

    River Patroller

  • 2,847 posts
  • Location:Vancouver, Washington, USA

Posted Fri Apr 7, 2017 4:07 PM

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.



#11 ralphb OFFLINE  

ralphb

    Dragonstomper

  • Topic Starter
  • 533 posts
  • Location:Germany

Posted Sat Apr 8, 2017 3:44 AM

Yes, but I've been talking about cartridges all along.  What I'm referring to is the byte sequence that you get when you load your object file to G>6000 and dump it to a progG.BIN that you can use as a cartridge in Classic99.



#12 Willsy OFFLINE  

Willsy

    River Patroller

  • 3,042 posts
  • Location:Uzbekistan (no, really!)

Posted Sat Apr 8, 2017 4:17 AM

Load it using the gpl loader and examine 0x6000 using the classic99 debugger.
  • RXB likes this

#13 ralphb OFFLINE  

ralphb

    Dragonstomper

  • Topic Starter
  • 533 posts
  • Location:Germany

Posted Sat Apr 8, 2017 4:20 AM

Load it using the gpl loader and examine 0x6000 using the classic99 debugger.

 

Good idea, a screenshot is enough.  I'd do it myself, but I don't have your setup.


  • RXB likes this

#14 lucien2 OFFLINE  

lucien2

    Moonsweeper

  • 285 posts
  • Location:Switzerland

Posted Sat Apr 8, 2017 8:48 AM

Here is the print screen.
It does not work as expected. It autostarts, changes the screen color to gray, but does not print the "*"s and the "autostart" string. It also does not respond to FCTN QUIT.

Attached File  autostart.png   20.82KB   1 downloads

#15 ralphb OFFLINE  

ralphb

    Dragonstomper

  • Topic Starter
  • 533 posts
  • Location:Germany

Posted Sat Apr 8, 2017 9:43 AM

Thank you, that is what I meant.  You used a different technique than I, though (see #6).

 

Which GPL assembler did you use?



#16 lucien2 OFFLINE  

lucien2

    Moonsweeper

  • 285 posts
  • Location:Switzerland

Posted Sat Apr 8, 2017 11:06 AM

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, Sat Apr 8, 2017 12:14 PM.


#17 ralphb OFFLINE  

ralphb

    Dragonstomper

  • Topic Starter
  • 533 posts
  • Location:Germany

Posted Sun Apr 9, 2017 10:04 AM

Thank you, lucien2, now I understand! I didn't realize the autostarting program was run in a different context.  Blanking the screen does make a lot of sense for a menu translator.







Also tagged with one or more of these keywords: gpl

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users