Page 3 of 5

Posted: Sun Jan 29, 2012 11:08 am
by Mayhem
Yep, those appear to work fine, cheers :)

Posted: Mon Jan 30, 2012 10:18 am
by eslapion
I know now why it "worked" on my config.

I first started the VIC-20 emulation THEN attached the image THEN performed a hardware reset. This means the hardware initialisation was already performed when starting to run the image.

After examining the code in WinHEX, I agree with e5frog that this program should really be 4k in size. There's really nothing in the range $B000-$BFFF.

Posted: Tue Jan 31, 2012 10:06 am
by nbla000
I've tested it with Mega-Cart + C64SD v2.0 Infinity and work like a jewel.

If you agree I will update the Mega-Cart firmware to include it to a next revision.

The 4k version seems that work properly btw I will further investigate.

Posted: Tue Jan 31, 2012 10:09 am
by Mayhem
I'll check with the guy who loaned me the cartridge that he's okay with it going on Mega-Cart. Can't imagine why not, but might as well make sure.

Posted: Tue Jan 31, 2012 10:25 am
by nbla000
OK.

Posted: Tue Jan 31, 2012 6:44 pm
by Mayhem
Yeah, he's fine with it. I think he has a Megacart already, he queried being able to get an update at some point...

Posted: Fri Feb 03, 2012 1:18 am
by nbla000
Perfect, today is snowing here and I have a free day with my children and maybe with my Vic-20 too :wink:

The Mega-Cart could not be updated, he may sell the old one once he gets the new one btw you may load any external program (as this rom) very easily anyway with EasyLoad or from revision 20 with FileBrowser (best choice).

I will inform you when the new revision will be ready.

Posted: Fri Feb 03, 2012 5:12 am
by nbla000
e5frog wrote:I played around with it a bit, It seemed it didn't start without these two subroutines being called first, someone with more experience might slim it down more.

JSR LAB_FD8D ; initialise and test RAM
JSR LAB_E518 ; initialise hardware
I need to understand why the original rom doesn't work with the last VICE (too much time) btw with this modify it works (real VIC and all VICE versions) so it's ok for me.
In the 4kB version I assume the $FD bytes last are just a "filler" and put the nine needed bytes in there.
Yes, I'm quite sure bytes from $AF92 to $AFFF are unused so I will use this 4K version for Mega-Cart.

PS: The game has no copy protection and may work in RAM too (RAM in BLK5 of course)

Posted: Fri Feb 03, 2012 11:34 am
by nbla000
Wow, it's really hard to fit something now on Mega-Cart, to fit this rom I must remove something other... :?

I need to remove an item from tape/disk or utility menu (max total menu items 255) or move this item to the extra section and remove an extra item perhaps a music tune... :?

It is not very easy to reorganize stuff now, I need to think about it :|

Posted: Fri Feb 03, 2012 12:10 pm
by buzbard
Nice job e5frog, the 4k version works great!

I noticed that you set the RESET vector to $AFA2 but your patch is actually at $AFAE, was there a reason for that?

Posted: Sat Feb 04, 2012 12:52 am
by nbla000
buzbard wrote:I noticed that you set the RESET vector to $AFA2 but your patch is actually at $AFAE, was there a reason for that?
Yes the right pointers in $A000 and $A001 for the 4K version patch are $AE $AF that means the start address is $AFAE, I think it was just a e5frog oversight with no consequences because it pointed to "harmless" code (SBC $FDFD,X).

This is the right bytes sequences on $a000 for the 4k patch version:

Code: Select all

ae af 4a af 41 30 c3 c2
This is the e5frog's code (the patch) on $AFAE:

Code: Select all

afae   20 8D FD   JSR $FD8D
afb1   20 18 E5   JSR $E518
afb4   4C 4A AF   JMP $AF4A

Posted: Sun Feb 05, 2012 1:23 am
by buzbard
Thanks nbla000, I suspected it was just a mistake.

I've been playing around with this, and I really don't think it was meant to be an auto-starting cartridge.

When you select option 5 "Load from cassette" (in the patched version) it seems to return to BASIC and lock-up, probably because the vectors and I/O have not been initialized.

And option 4 "Cassette Words" would never bring up any words.

So, I added these from Compute!'s Mapping the VIC, pg.183;

JSR $FD52 ; set vectors
JSR $FDF9 ; initial I/O, CLI

to e5frog's patch.

This allowed the program to exit to BASIC and not lock-up, but still, after searching through the disassembled code I could not find any code that would access the cassette.

Then I thought maybe I'm supposed to load a list from cassette, but to where? And what format?

So, looking back through the code I found this:

Code: Select all

A336  CMP #$31    'Key 1
      BNE $A345
      LDA #$D0    'Set poiner to beginning of easy word list ($A8D0)
      STA $01
      LDA #$A8
      STA $02
      JMP $A3EE

A345  CMP #$32    'Key 2
      BNE $A354
      LDA #$F0    'Set pointer to beginning of hard word list ($ABF0)
      STA $01
      LDA #$AB
      STA $02
      JMP $A3EE

A354  CMP #$33    'Key 3
      BNE $A363
      LDA #$29    'Set pointer to your word($1229)
      STA $01
      LDA #$12
      STA $02
      JMP $A379

A363  CMP #$34    'Key 4
      BNE $A372
      LDA #$00    'Set pointer to cassette words($1800)
      STA $01
      LDA #$18
      STA $02
      JMP $A3EE

A372  CMP #$35    'Key 5
      BNE $A32F
      JMP $AF42   'Exit to BASIC and load words
Option 4 sets a pointer at $01-$02 that points to $1800, that must be the start of the cassette word list, and since the screen RAM starts at $1E00 on the unexpanded VIC, that gives 1536 bytes for the word list. Since the words in the ROM are buffered by spaces to make them 8 bytes long, the same format seems to work for the cassette word list. That means about 192 words.

I copied the list from the program and pasted it into a new file (because I'm lazy and didn't want to type a new list), I added $00 and $18 to the beginning for the load address, saved the file then started Vice(xVIC), attached the original (unpatched) ROM image, loaded the word list with;

LOAD"WORDS",8,1 (obviously it doesn't matter if it's cassette or disk)

pressed the PgUp key(RESTORE), selected option 4, and it worked!

And because the cart didn't auto-start, option 5 returns to the BASIC prompt. Maybe there should be some instructions on screen after the exit to BASIC.

Posted: Sun Feb 05, 2012 2:28 am
by nbla000
Wow, it's strange, I was attracted from the same feature too !

and i've noticed the same thing... and your work will help me to better understand it, may you upload your cassette words ?
I really don't think it was meant to be an auto-starting cartridge.
Yes I agree, btw I wish to find a way to autostart the game and use the cassette words feature...

I've an idea...

Code: Select all

a372   C9 35      CMP #$35
a374   D0 B9      BNE $A32F
a376   4C 42 AF   JMP $AF42
to change the a376 jump for an addition patch for proper basic exit... I hope there is free space on the $A000 - $AFFF area...

hey Mayhem, do you know if the game had an attached cassette ? any instruction or he has just the cartridge ?

Posted: Sun Feb 05, 2012 3:32 am
by buzbard
Here is the word list that I copied from the ROM image for testing.

http://www.mediafire.com/?v7wpswcd7khikxk

I'm attempting to write a program that will allow you to create/edit word lists on the VIC but it's late here, 1:30am, if someone else want to take a stab at it, I don't mind.

Posted: Sun Feb 05, 2012 5:12 am
by nbla000
buzbard wrote:Here is the word list that I copied from the ROM image for testing.

http://www.mediafire.com/?v7wpswcd7khikxk

Ok, thank you.
I'm attempting to write a program that will allow you to create/edit word lists on the VIC but it's late here, 1:30am, if someone else want to take a stab at it, I don't mind.
Ok, I will try to fix it for both autostart and cassette load.