Jump to content
IGNORED

It's Conner time 3! V23.75 out now! ((c) 2023!) (Note: DOESN'T WORK ON JS7800.)


Ecernosoft

Recommended Posts

4 hours ago, TwentySixHundred said:

Are you going to the directory that holds the 7800 sign program then attempting the write command? I haven't tried to sign anything myself yet, although it looks fairly straight forward. I might have a go later tonight just for kicks. Im assuming by putting both the 7800sign program and the gameROM in same directory then writing within is all it needs.

Ok. I'm not going to blame any of you, but it seems that a lot of you REALLY WANT ME to get this sign program working.

Well..... I'm going to need some help.

Also, this code is SUPPOSED to generate a valid signature.

 

 

         org $4000

START

        ; A78 Header v3.1
  ; 
  ; Use this file to add an a78 header via the source code of your ROM.
  ;
  ; _Implementation Notes_
  ;
  ; * Include this header near the beginning of your DASM source, but after
  ;   your initial ROM ORG statement.
  ; * Change the fields withn the file to describe your game's hardware
  ;   requirements to emulators and flash carts.
  ; * All unused/reserved bits and bytes must be set to zero.


.ROMSIZE = $C000; 48KB                ; Update with your total ROM size.

  ; Auto-header ROM allocation follows. If the current address is page aligned,
  ; we backup 128 bytes. This may cause issues if you use a different ORG+RORG
  ; at the start of your ROM - in that case, account for the 128 bytes of
  ; header within your game ROM start ORG+RORG statements.

    if ( . & $FF ) = 0             ; Check if we're at an even page.
        ORG  (. - 128),0           ; If so, go -128 bytes, for header space.
    else
        ORG .,0                    ; In case zero-fill wasn't specified
    endif                          ; orginally.

.HEADER = .

  ; Format detection - do not modify.
    DC.B    3                  ; 0          header major version
    DC.B    "ATARI7800"        ; 1..16      header magic string - zero pad


    ORG .HEADER+$11,0
    DC.B    "I'll miss you Atariage"   ; 17..48     cartridge title string - zero pad


    ORG .HEADER+$31,0
    DC.B    (.ROMSIZE>>24)     ; 49..52     cartridge ROM size
    DC.B    (.ROMSIZE>>16&$FF)
    DC.B    (.ROMSIZE>>8&$FF)
    DC.B    (.ROMSIZE&$FF)


    DC.B    %00000000          ; 53         cartridge type A
    DC.B    %00000000          ; 54         cartridge type B
    ; Ballblazer uses 10000010101100 
    ; _Cartridge Type A_
    ;    bit 7 ; POKEY @ $0800 - $080F
    ;    bit 6 ; EXRAM/M2                   (halt banked RAM)
    ;    bit 5 ; BANKSET
    ;    bit 4 ; SOUPER
    ;    bit 3 ; YM2151 @ $0461 - $0462 
    ;    bit 2 ; POKEY @ $0440 - $044F 
    ;    bit 1 ; ABSOLUTE
    ;    bit 0 ; ACTIVISION
    ; _Cartridge Type B_
    ;    bit 7 ; EXRAM/A8                   (mirror RAM)
    ;    bit 6 ; POKEY @ $0450 - $045F 
    ;    bit 5 ; EXRAM/X2                   (hotspot banked RAM)
    ;    bit 4 ; EXFIX                      (2nd last bank @ $4000)
    ;    bit 3 ; EXROM                      (ROM @ $4000)
    ;    bit 2 ; EXRAM                      (RAM @ $4000)
    ;    bit 1 ; SUPERGAME
    ;    bit 0 ; POKEY @ $4000 - $7FFF


    DC.B    1                  ; 55         controller 1 device type
    DC.B    1                  ; 56         controller 2 device type
    ;    0 = none
    ;    1 = 7800 joystick
    ;    2 = lightgun
    ;    3 = paddle
    ;    4 = trakball
    ;    5 = 2600 joystick
    ;    6 = 2600 driving
    ;    7 = 2600 keypad
    ;    8 = ST mouse
    ;    9 = Amiga mouse
    ;   10 = AtariVox
    ;   11 = SNES2Atari


    DC.B    %00000000          ; 57         tv type
    ;    bits 7..2 ; reserved
    ;    bit 1     ; 0:component,1:composite
    ;    bit 0     ; 0:NTSC,1:PAL


    DC.B    %00000000          ; 58         save peripheral
    ;    bits 7..2 ; reserved
    ;    bit 1     ; SaveKey/AtariVox
    ;    bit 0     ; High Score Cart (HSC)


    ORG     .HEADER+62,0
    DC.B    %00000000          ; 62         external irq source
    ;    bits 7..5 ; reserved
    ;    bit 4     ; POKEY @ $0800 - $080F
    ;    bit 3     ; YM2151 @ $0461 - $0462
    ;    bit 2     ; POKEY @ $0440 - $044F
    ;    bit 1     ; POKEY @ $0450 - $045F
    ;    bit 0     ; POKEY @ $4000 - $7FFF

    DC.B    %00000000          ; 63         slot passthrough device
    ;    bits 7..1 ; reserved
    ;    bit 0     ; XM module


    ORG     .HEADER+100       ; 100..127  footer magic string
    DC.B    "ACTUAL CART DATA STARTS HERE"

 

 

And when I insert this into my program, it works, and even the Concerto says it works! (When it is removed the Concerto talks about it's going to put in a signature for you since your game doesn't have one)

 

Is this not valid?

 

I'm confused....

 

Edit: The reason it says "I'll miss you Atariage" is because the name was put in during the bad days of the ICT3 thread.

Edited by Ecernosoft
Link to comment
Share on other sites

The 7800 ROM Header and the 7800 ROM signature are TWO different things.  The 7800 signature is a data chunk that is an encrypted security key that the 7800 checks before running the cartridge.  The reason the Concerto works is because it's already given a valid key to the 7800 when the Concerto menu program starts.  The Dragonfly doesn't have a 7800 menu program (you selected the program via an LCD screen/buttons on the cartridge itself), so it boots directly into the game... which requires the game to provide the security key.

 

To summarize:

 - 7800 header contains cart/type information about the ROM file (part of the A78 file format)

 - 7800 signature is a security key in the ROM file and is usually required to be able to boot directly into the game

 

If you want your game to run in ALL emulators / hardware devices, you need to run the 7800sign program to "sign" the ROM file (which adds a security key), so that the 7800 system/emulator knows that it's a valid 7800 program.

 

As a side note, the NES also has a security system... but it's a hardware chip (not a software key).

  • Like 5
Link to comment
Share on other sites

3 hours ago, splendidnut said:

The 7800 ROM Header and the 7800 ROM signature are TWO different things.  The 7800 signature is a data chunk that is an encrypted security key that the 7800 checks before running the cartridge.  The reason the Concerto works is because it's already given a valid key to the 7800 when the Concerto menu program starts.  The Dragonfly doesn't have a 7800 menu program (you selected the program via an LCD screen/buttons on the cartridge itself), so it boots directly into the game... which requires the game to provide the security key.

 

To summarize:

 - 7800 header contains cart/type information about the ROM file (part of the A78 file format)

 - 7800 signature is a security key in the ROM file and is usually required to be able to boot directly into the game

 

If you want your game to run in ALL emulators / hardware devices, you need to run the 7800sign program to "sign" the ROM file (which adds a security key), so that the 7800 system/emulator knows that it's a valid 7800 program.

 

As a side note, the NES also has a security system... but it's a hardware chip (not a software key).

OH!!!!!!!

So that's what I'm missing............ documentation please?

And please, don't get mad at me for being stubborn- I just didn't know. I thought the header WAS the signature. I'm guessing that takes up space from $3F00-$3F7F?

Thanks for the info!

Edited by Ecernosoft
Link to comment
Share on other sites

Documentation on this is a bit scattered:

 

A good starting point for any 7800 information quest starts here:

http://7800.8bitdev.org/index.php/Main_Page

 

Software guide mentions it in the 7800 memory layout table:

   - FF80 to FFF7 Reserved for cart encryption signature

http://7800.8bitdev.org/index.php/7800_Software_Guide

 

Here's some more documentation that goes into depth on the encryption system:

https://www.atariage.com/7800/archives/encryption.html?SystemID=7800

 

The '7800sign' tool can be found within the 7800basic package or

http://7800.8bitdev.org/index.php/7800AsmDevKit

 

It requires using the Command line interface.  I know you don't like that, but it's part of the process.

 

People have already provide you some information on how to use it earlier in this thread.  Here's one of them:

 

 

  • Like 1
Link to comment
Share on other sites

3 hours ago, splendidnut said:

Documentation on this is a bit scattered:

 

A good starting point for any 7800 information quest starts here:

http://7800.8bitdev.org/index.php/Main_Page

 

Software guide mentions it in the 7800 memory layout table:

   - FF80 to FFF7 Reserved for cart encryption signature

http://7800.8bitdev.org/index.php/7800_Software_Guide

 

Here's some more documentation that goes into depth on the encryption system:

https://www.atariage.com/7800/archives/encryption.html?SystemID=7800

 

The '7800sign' tool can be found within the 7800basic package or

http://7800.8bitdev.org/index.php/7800AsmDevKit

 

It requires using the Command line interface.  I know you don't like that, but it's part of the process.

 

People have already provide you some information on how to use it earlier in this thread.  Here's one of them:

 

 

I didn't understand.

really do not want to go back to that mess, but I will if I 100% need to. That thread is really just a nightmare. I want it to be forgotten.... not remembered. Unfortunately, that's not going to happen. As long as it's out there people WILL remember and even if I were to be able to delete it it would still be a bad memory.

Thank you for posting the info, though! I'll read up on those at a later date. Right now..... I need to go to bed. And we just got a new dog for my sister (It's a puppy, so you know what that means) so there's that too. And the christmas tree! Not to mention the dog is a lab mix and we already had 2 other semi-puppies in the house (They are both 5 years old). So it's a mess.

 

Link to comment
Share on other sites

8 hours ago, Ecernosoft said:

really do not want to go back to that mess, but I will if I 100% need to. That thread is really just a nightmare. I want it to be forgotten

No need to worry.  That link I posted is to a message that's in this thread, not the other thread.

 

It's completely understandable that you did not know about the 7800 encryption signature... the information on it is a bit scattered.

Link to comment
Share on other sites

On 11/24/2022 at 2:18 PM, Ecernosoft said:

1. Is there a way to do this IN THE SOURCE CODE? I don't want to need to do this every time I make an update otherwise. And concerto says that the files have a valid signature when I run the .a78 on that, and the signature hasn't changed since.

Never, Ever, EVER put cryptographic keys in your code.  Always sign externally.  That's cryptography 101.  It doesn't matter that it's just a game on an old platform with easily-bypassed signature checks; get into the habit of doing it properly now.

 

For more details, see the following: https://www.ubiqsecurity.com/exploring-cwe-321-use-of-hard-coded-cryptographic-key/

On 11/24/2022 at 2:18 PM, Ecernosoft said:

2. If not, is there a better way to do this? Just asking.

The way that you are currently doing it is the best way.

  • Like 2
Link to comment
Share on other sites

The primary reason WHY the 7800 signature can't be done in source code IS because it's based on the binary data that's output from the assembler.  Anytime the assembler is run, the 7800sign program needs to be run to create the new signature to match the binary data.

 

The primary issue here was that the 7800 header and the 7800 ROM signature were being confused as the same thing.  Hopefully we're past that point now.

 

  • Like 3
Link to comment
Share on other sites

6 minutes ago, splendidnut said:

The primary reason WHY the 7800 signature can't be done in source code IS because it's based on the binary data that's output from the assembler.  Anytime the assembler is run, the 7800sign program needs to be run to create the new signature to match the binary data.

 

The primary issue here was that the 7800 header and the 7800 ROM signature were being confused as the same thing.  Hopefully we're past that point now.

Understood.  FWIW, I was just using the opportunity to point out that keys in code == bad, since it looked as though that was what was being considered.

 

Having spent 20-odd years in infosec cleaning up after people who did exactly that (amongst other things), it's something of an immediate 'not this crap again' moment for me whenever I see it.

 

Also, I look forward to the day when emoji start working on the forum again, because a lot of indicated nuance isn't making it through in text alone.

  • Like 5
Link to comment
Share on other sites

15 hours ago, Ecernosoft said:

Ok. I'm not going to blame any of you, but it seems that a lot of you REALLY WANT ME to get this sign program working.

Well..... I'm going to need some help.

Learning to do stuff from the command line is bound to be easier than learning to make 7800 games in assembly. I'll give you some steps to get started, and if you run into trouble you can give details here.

 

  1. Unzip the 7800sign program in the same folder as your source code.
  2. Use an Explorer window to navigate to your source folder.
  3. Click on the location bar to highlight it, then type "cmd" (without the quotes). This will open up a command prompt with the working directory set to your source folder.
    1. Here's a link that shows how to do that: https://helpdeskgeek.com/how-to/open-command-prompt-folder-windows-explorer/
  4. In the newly-opened command prompt, type "7800sign -w ICT3_V19.0.a78" (without the quotes)

That's it! Hopefully that will help get you started.

  • Like 2
Link to comment
Share on other sites

4 hours ago, Karl G said:

Learning to do stuff from the command line is bound to be easier than learning to make 7800 games in assembly. I'll give you some steps to get started, and if you run into trouble you can give details here.

 

  1. Unzip the 7800sign program in the same folder as your source code.
  2. Use an Explorer window to navigate to your source folder.
  3. Click on the location bar to highlight it, then type "cmd" (without the quotes). This will open up a command prompt with the working directory set to your source folder.
    1. Here's a link that shows how to do that: https://helpdeskgeek.com/how-to/open-command-prompt-folder-windows-explorer/
  4. In the newly-opened command prompt, type "7800sign -w ICT3_V19.0.a78" (without the quotes)

That's it! Hopefully that will help get you started.

Appreciated!

 

(I'm not saying I don't want to do the signature because I do, it's just that I want to learn what it is and how it works first)

6 hours ago, splendidnut said:

The primary reason WHY the 7800 signature can't be done in source code IS because it's based on the binary data that's output from the assembler.  Anytime the assembler is run, the 7800sign program needs to be run to create the new signature to match the binary data.

 

The primary issue here was that the 7800 header and the 7800 ROM signature were being confused as the same thing.  Hopefully we're past that point now.

 

oh =|

6 hours ago, x=usr(1536) said:

Understood.  FWIW, I was just using the opportunity to point out that keys in code == bad, since it looked as though that was what was being considered.

 

Having spent 20-odd years in infosec cleaning up after people who did exactly that (amongst other things), it's something of an immediate 'not this crap again' moment for me whenever I see it.

 

Also, I look forward to the day when emoji start working on the forum again, because a lot of indicated nuance isn't making it through in text alone.

:) :D😃 <-- you mean these?

8 hours ago, splendidnut said:

No need to worry.  That link I posted is to a message that's in this thread, not the other thread.

 

It's completely understandable that you did not know about the 7800 encryption signature... the information on it is a bit scattered.

Oh ok.

Also, thanks 😃

7 hours ago, x=usr(1536) said:

Never, Ever, EVER put cryptographic keys in your code.  Always sign externally.  That's cryptography 101.  It doesn't matter that it's just a game on an old platform with easily-bypassed signature checks; get into the habit of doing it properly now.

 

For more details, see the following: https://www.ubiqsecurity.com/exploring-cwe-321-use-of-hard-coded-cryptographic-key/

The way that you are currently doing it is the best way.

OK. I WILL NEVER DO THAT.

 

Also, thanks 😃

Link to comment
Share on other sites

Ok, so I hate to overpost, but I'm trying to find a good, box collision routine for 6502 that isn't that slow. I saw one on 5200 but I couldn't figure it out... said it could calculate in 28 cycles...

 

Do any of you have good collision routines that I could use? Thanks!
 

(A simple box collision routine would do)

Edited by Ecernosoft
Link to comment
Share on other sites

 

Box collision detection straight out of ChaoticGrill...  This code is currently set with 4x4 collision boxes allowing a lot of overlap between the sprites.  The hardcoded (#values) determine the size of the box.

 

	;-- check for player collision
	
	; enemy at 6 player at 10 = (6-10 +4) = 0
	; enemy at 10 player at 6 = (10-6 +4) = 8
	; if (enemyY - playerY + 4) < 8 then nearPlayer
	
	LDA		<enemyY,x
	SBC		<playerY
	ADC		#4                 ;--- distance between centers
	CMP		#8                 ;--- twice the distance between centers
	BCS		contMoveEnemy
	
	LDA		<enemyX,x
	SBC		<playerX
	ADC		#4                 ;--- distance between centers
	CMP		#8                 ;--- twice the distance between centers
	BCS		contMoveEnemy
	
	JMP		killPlayer

 

The comments at the top of the code should give you the basic idea of how this works.  Let me know if you have any questions.

  • Like 2
Link to comment
Share on other sites

3 hours ago, splendidnut said:

 

Box collision detection straight out of ChaoticGrill...  This code is currently set with 4x4 collision boxes allowing a lot of overlap between the sprites.  The hardcoded (#values) determine the size of the box.

 

	;-- check for player collision
	
	; enemy at 6 player at 10 = (6-10 +4) = 0
	; enemy at 10 player at 6 = (10-6 +4) = 8
	; if (enemyY - playerY + 4) < 8 then nearPlayer
	
	LDA		<enemyY,x
	SBC		<playerY
	ADC		#4                 ;--- distance between centers
	CMP		#8                 ;--- twice the distance between centers
	BCS		contMoveEnemy
	
	LDA		<enemyX,x
	SBC		<playerX
	ADC		#4                 ;--- distance between centers
	CMP		#8                 ;--- twice the distance between centers
	BCS		contMoveEnemy
	
	JMP		killPlayer

 

The comments at the top of the code should give you the basic idea of how this works.  Let me know if you have any questions.

Thanks a ton!

So, 2 questions...

1. Do the YPOS's/XPOS's need to be 16 bit? (No, right?)

2. What are the Adc #4 and CMP #8 for? Are those the width/height of the sprites?

 

Edited by Ecernosoft
Link to comment
Share on other sites

The xpos / ypos are 8-bit values.  The ADC #4 is the size of the box.  The CMP #8 is that number*2.   So with the values I provided, the sprites collision boxes would be 4x4.

 

If your sprites are 8x8... then you'd replace those with ADC #8, and CMP #16.

If your sprites are 16x16... then you'd replace those values with ADC #16 and CMP #32.

 

If you want a bit of overlap with those boxes (ChaoticGrill has a lot), you'd reduce the sizes a bit.

 

The X check and the Y check can use different number sets.

 

 

  • Like 1
Link to comment
Share on other sites

4 hours ago, splendidnut said:

The xpos / ypos are 8-bit values.  The ADC #4 is the size of the box.  The CMP #8 is that number*2.   So with the values I provided, the sprites collision boxes would be 4x4.

 

If your sprites are 8x8... then you'd replace those with ADC #8, and CMP #16.

If your sprites are 16x16... then you'd replace those values with ADC #16 and CMP #32.

 

If you want a bit of overlap with those boxes (ChaoticGrill has a lot), you'd reduce the sizes a bit.

 

The X check and the Y check can use different number sets.

 

 

Well... I've got an issue.

You see... my sprites are 8*16. What do I do for that?

Edit: OOOOHHH!!!!!

I get it. So I can leave the X as is and change the Y compare to adc #16 and cmp #32.

 

I'm going to try it out. Thanks @splendidnut!!!

 

Edit 2: Thanks!!! it works! V20.5 coming out soon!

Edited by Ecernosoft
Link to comment
Share on other sites

On 11/28/2022 at 3:39 PM, Ecernosoft said:

I haven’t had time to. I will make sure I do for the final version.

That will come soon!!!!

 

Edit: Besides 7800sign and also adding sound/music (I might be able to do POKEY@4000 and move the startcode/header to $9600 because the Conner code goes from $9000-$95FF (Really it gets into the $8Cxx range and not all the way to $95FF) but I might not need all the gfx. That will probably not happen with music and all (And I'm going to have "Secret" zones like underground zone, accessable in Sunset plains by breaking through cracked blocks) and plus, while the OG ICT3 will probably have the origonally planned 5 zones + the final room, I'm going to continue  the ICT3 a little further so it has more content (More zones, bug fixes, horizontal momentum maybe...)

 

Edited by Ecernosoft
Link to comment
Share on other sites

  (From the harpy's curse thread)

On 12/1/2022 at 2:25 PM, Silver Back said:

It'll be nice playing something new where the creator is concerned with quality and compatibility. I know I shouldn't say this but I'm tired of games that are running version 24 that still doesn't work on most emulators and multicarts and have multiple threads.

 

Games like this is why I lurk around these parts and it becomes discouraging when they get buried by frivolous topics. 

I want to push out a disclaimer:

Sky base and Underground zone will be extras if I can manage them.

I'm trying to go for quality over quantity (And smaller goals) and I know my games look like utter trash compared to some of your creations. 

I'm not trying to, but I bet some of you know about some of the short-cuts I've taken.

For example, the level design in Sunset plains. It is there but you can tell it can feel like repeated screens mixed and matched and connected together, and that's because it sort of is.

Or in Aqua beach (Where it's mostly running forwards). That will be more combat focused when I implement more of the enemies.

I'm not great at level design. It's my big flaw. And since I'm alone, that's probably the weak spot of ICT3. 

Heck, the ICT2 prototype (The one with the overworld) was going to have randomly-generated levels based off of a table! Levels would get longer on harder difficulties.

You know, that might actually work out....

However, don't fret. The ICT3 levels ARE IN ROM so, for whatever reason, if you want a template for your assembly 7800 game, then here you go.

 

I'm trying to make this as good as possible for my exit (for now) from 7800 programming. I hope you'll agree.

Link to comment
Share on other sites

2 hours ago, Ecernosoft said:

I'm trying to make this as good as possible for my exit (for now) from 7800 programming. I hope you'll agree.

It's not a train station, and you don't need to announce your departure, especially if you're saying it might not be permanent.

  • Like 2
  • Haha 5
Link to comment
Share on other sites

3 hours ago, Cebus Capucinis said:

"That's it! I am LEAVING!"

Ok, to make this clear:

I am NOT Leaving, just I don't plan on doing future 7800 stuff.

4 hours ago, RevEng said:

It's not a train station, and you don't need to announce your departure, especially if you're saying it might not be permanent.

I know :) 

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