Jump to content

Photo

Minesweeper - game released

game assembler cartridge

148 replies to this topic

#26 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,993 posts
  • Location:Denmark

Posted Sat Aug 8, 2015 11:57 PM

So I want to implement a timer in the Minesweeper game.
 
There's a chip inside the TI-99/4A called the TMS9901 and it has a timer.  :thumbsup: 
 
ref.:
Nouspikel's TI-99/4A Tech Pages
 
Back in 2006 I started experimental work on a Sudoku clone, and it used the timer. It worked fine in Mess.  :thumbsup:
 
At one point Tursi implemented support for the 9901 timer. And then it worked fine in Classic99.  :thumbsup:

 

Later Mantadoc burned the ROM and tested it on the real iron. And there were some problems with the graphics. Luckily another 3 demos worked fine.  :thumbsup:

 
Later again Classic99 developed the same issue with graphics. A handful of my demos had issues. :|
 
I think it's safe to say now, that the reason was code at uneven addresses. :) TIAsm and WinAsm99 do not warn or report as error. :|
 
;)

 

Edit:

Mistake and assumptions about emulators deleted.


Edited by sometimes99er, Sun Aug 9, 2015 8:05 AM.


#27 mizapf OFFLINE  

mizapf

    River Patroller

  • 2,623 posts
  • Location:Germany

Posted Sun Aug 9, 2015 4:22 AM

Hmm ... I'm pretty sure (really close to 100%) that MESS won't execute code on uneven locations. I know I once had this issue, but I think it was with the 9995 emulation. Can you tell exactly where it happens?



#28 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,993 posts
  • Location:Denmark

Posted Sun Aug 9, 2015 5:21 AM

Hmm ... I'm pretty sure (really close to 100%) that MESS won't execute code on uneven locations. I know I once had this issue, but I think it was with the 9995 emulation. Can you tell exactly where it happens?

 

Ahhh, my fault. The compiler can compile to an odd address, and then things go wrong. That error does not have to do with the emulator. Sorry, and thanks for feedback. ;)


Edited by sometimes99er, Wed Aug 12, 2015 6:19 AM.


#29 Lee Stewart OFFLINE  

Lee Stewart

    River Patroller

  • 3,436 posts
  • Location:Silver Run, Maryland

Posted Sun Aug 9, 2015 7:42 AM

So I want to implement a timer in the Minesweeper game.
 
There's a chip inside the TI-99/4A called the TMS9901 and it has a timer.  :thumbsup: 
 
ref.:
Nouspikel's TI-99/4A Tech Pages
 
...

 

Here is a discussion of using the 9901 as a timer: TurboForth Assembler

 

As you will see, there was concern expressed that using the 9901 (as it is wired in the TI-99/4A) as a timer may not be safe.

 

...lee



#30 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,993 posts
  • Location:Denmark

Posted Sun Aug 9, 2015 8:20 AM

Here is a discussion of using the 9901 as a timer: TurboForth Assembler
 
As you will see, there was concern expressed that using the 9901 (as it is wired in the TI-99/4A) as a timer may not be safe.
 
...lee


Thanks. Maybe I should simply do a brute force count between vdp interrupts a few times, and then decide if it's a 50 or 60 Hz system. Didn't we (here on AtariAge) do that some time ago ? I guess emulation should be able to give a rough but good enough estimate ?

:)

Edited by sometimes99er, Sun Aug 9, 2015 8:21 AM.


#31 mizapf OFFLINE  

mizapf

    River Patroller

  • 2,623 posts
  • Location:Germany

Posted Sun Aug 9, 2015 9:50 AM

I did not follow the discussions about the 9901 at that time (maybe I was not yet member of AA), but "reading too fast" sounds not too likely for me. I don't know what caused the damage of the 9901 as described.

 

The 9901 is a pretty "dumb" chip. It looks complicated from the outside, but things inside are pretty much synchronized to the external clock. It does not even have a READY line. The timer is actually a decrementer that is triggered on every 64 clock pulses. The specs do not reveal anything about minimum timing with respect to program operation. At least it's not comparable to the VDP which has an own flow of control.

 

I think the worst thing that can happen to the 9901 is when its outputs are short-circuited (e.g. when one of the lines INT7* - INT10* are configured to be outputs instead of inputs). Still, there are resistors for protection inside the TI console, so this somewhat remains mysterious.



#32 Lee Stewart OFFLINE  

Lee Stewart

    River Patroller

  • 3,436 posts
  • Location:Silver Run, Maryland

Posted Sun Aug 9, 2015 9:56 AM

I did not follow the discussions about the 9901 at that time (maybe I was not yet member of AA), but "reading too fast" sounds not too likely for me. I don't know what caused the damage of the 9901 as described.

 

The 9901 is a pretty "dumb" chip. It looks complicated from the outside, but things inside are pretty much synchronized to the external clock. It does not even have a READY line. The timer is actually a decrementer that is triggered on every 64 clock pulses. The specs do not reveal anything about minimum timing with respect to program operation. At least it's not comparable to the VDP which has an own flow of control.

 

I think the worst thing that can happen to the 9901 is when its outputs are short-circuited (e.g. when one of the lines INT7* - INT10* are configured to be outputs instead of inputs). Still, there are resistors for protection inside the TI console, so this somewhat remains mysterious.

 

I agree.  I just wanted to bring that discussion reference here to evoke more input  :) —especially from Tursi because he suggested the 9901's use here and was also in on that older discussion and may have some more recent insight.

 

...lee

 

[EDIT:  Re above strikethroughs, I'm not sure where I got the idea that Tursi recently suggested using the 9901 as a timer.  It obviously wasn't here!]


Edited by Lee Stewart, Sun Aug 9, 2015 10:10 AM.


#33 Tursi OFFLINE  

Tursi

    River Patroller

  • 4,852 posts
  • HarmlessLion
  • Location:BUR

Posted Sun Aug 9, 2015 4:26 PM

I wondered about that.. everything I know about the 9901 timer I learned from Sometimes99er! :)

 

In the other thread, it's worth noting that hardware was also being developed. We should dedicate a console or two to determining whether timer mode is safe or not.



#34 Ksarul OFFLINE  

Ksarul

    River Patroller

  • 4,238 posts

Posted Sun Aug 9, 2015 5:23 PM

I tried Minesweeper on real iron today, Sometimes99er. I got to the menu selection fine, but the cartridge went off into nirvana when I tried to execute. . .I used my known good cartridge test board with a ZIF socket, jumpered properly for an 8K/16K cartridge, using a known good EPROM. I'll validate the EPROM again in my programmer, just in case it failed to burn properly, but that is the current test status. . .



#35 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,993 posts
  • Location:Denmark

Posted Sun Aug 9, 2015 11:10 PM

I tried Minesweeper on real iron today, Sometimes99er. I got to the menu selection fine, but the cartridge went off into nirvana when I tried to execute. . .I used my known good cartridge test board with a ZIF socket, jumpered properly for an 8K/16K cartridge, using a known good EPROM. I'll validate the EPROM again in my programmer, just in case it failed to burn properly, but that is the current test status. . .


Thanks.  :thumbsup: 

Also if you could try it out on a minimal configuration. I'm assuming a few things when control is transfered from OS to cartridge *), but has tested with the Classic99's Scramble RAM feature. Also works fine with Js99'er, Win994a, older, newer, 32 and 64 bit versions of MESS.

*) I only change 3 vdp registers instead of all 8. Assuming a state of limi 0. Assuming workspace at >83e0. Assuming r15 is >8c02 (vdp address).

I don't know if you want to go any further and test more. We could take a route of incremental testing to narrow in on the faulty part(s). - I guess one way for me to go is make an EA3 version. That would maybe reveal a thing or two. And I guess it would be much more easy for many to test. In the end I could eat my hat and release the source.

:|



#36 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,993 posts
  • Location:Denmark

Posted Mon Aug 10, 2015 5:53 AM

I wondered about that.. everything I know about the 9901 timer I learned from Sometimes99er! :)

 

You're giving me too much credit. It could maybe be "because of" and not "from" ... ;)



#37 Ksarul OFFLINE  

Ksarul

    River Patroller

  • 4,238 posts

Posted Mon Aug 10, 2015 6:04 AM

You just gave me a thought--I had my Myarc MPES-50 connected to the machine when I did my tests. I don't usually see problems from that one, but I'll try again without it, just in case that introduces something weird into the mix. This one runs from cartridge space and doesn't use the 32K space for anything, correct? The fact that it runs in that many different emulators points to incompatibilities with something in my setup, and that has my curiosity piqued. If it is the MPES-50, I wouldn't worry about changing the code, as I doubt there are more than five or six of them left in the community--and two of those belong to me.



#38 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,993 posts
  • Location:Denmark

Posted Mon Aug 10, 2015 6:18 AM

You just gave me a thought--I had my Myarc MPES-50 connected to the machine when I did my tests. I don't usually see problems from that one, but I'll try again without it, just in case that introduces something weird into the mix. This one runs from cartridge space and doesn't use the 32K space for anything, correct? The fact that it runs in that many different emulators points to incompatibilities with something in my setup, and that has my curiosity piqued. If it is the MPES-50, I wouldn't worry about changing the code, as I doubt there are more than five or six of them left in the community--and two of those belong to me.

 

Yes, that's correct.

 

I'm also thinking that a DSR could screw up what I see as default values. I know I shouldn't assume too much, just my minimalistic nature around this TI-99/4A retro-computing. Maybe I'm being too smart (in that department), it would only cost a handful of bytes to set all vdp registers, do a limi 0, set the workspace registers, and effectively clear scratch-pad prior to the game and when trying to boot (detecting Fctn Quit (as recommended by Tursi in another thread)).

 

:)



#39 Opry99er OFFLINE  

Opry99er

    Quadrunner

  • 8,261 posts
  • Location:Cookeville, TN

Posted Mon Aug 10, 2015 7:48 AM

Ahh, but minimalism can be quite beautiful and effective when in the proper hands. :)

That is one of the reasons I love tape-loaded programs for TI BASIC.

Hope all goes well in testing. Id love to play this game on my TI.

#40 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,993 posts
  • Location:Denmark

Posted Tue Aug 11, 2015 2:09 AM

Created the EA3 file:

Attached File  mine.ea3.obj   12.65KB   20 downloads

That was relatively easy. Removed the aorg and created a def. :)

Still version 0.4. Please test on real iron. ;)

minesweeper0.4.ea3.gif

#41 Willsy OFFLINE  

Willsy

    River Patroller

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

Posted Tue Aug 11, 2015 2:32 AM

 

Yes, that's correct.

 

I'm also thinking that a DSR could screw up what I see as default values. I know I shouldn't assume too much, just my minimalistic nature around this TI-99/4A retro-computing. Maybe I'm being too smart (in that department), it would only cost a handful of bytes to set all vdp registers, do a limi 0, set the workspace registers, and effectively clear scratch-pad prior to the game and when trying to boot (detecting Fctn Quit (as recommended by Tursi in another thread)).

 

:)

 

 

I load the VDP registers in a loop:

 

    ; load the vdp registers
        li r2,col32d          ; address of register data
ldvdpr  mov r2,r7                   ; save address for later
        movb *r2+,r1                ; number of registers to load
        sra r1,8                    ; move the count to the low byte
        clr r0                      ; start with register 0
ldvdpl  movb *r2+,r0                ; get register data in r0 MSB
        swpb r0                     ; swap it over
        bl @_vwtr                   ; write the register
        swpb r0                     ; swap it back again
        inc r0                      ; add 1 to register
        dec r1                      ; finished?
        jne ldvdpl                  ; repeat if not

col32d    ; register count and data
        byte 8,>00,>e0,>00,>0e,>01,>06,>02,>f4

 

Could maybe make this code a little shorter by loading the registers backwards (from register 7 to 0) rather than forwards. If going backwards, R1 can be the loop counter, and the VDP register. :thumbsup:



#42 Opry99er OFFLINE  

Opry99er

    Quadrunner

  • 8,261 posts
  • Location:Cookeville, TN

Posted Tue Aug 11, 2015 11:42 AM

I like using that little tactic when flashing colors or creating funny visual effects when showing my son stuff in XB.

He loves Hunt the Wumpus... Im sure he will get a real kick out of Minesweeper. :)

#43 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,993 posts
  • Location:Denmark

Posted Wed Aug 12, 2015 2:56 AM

I like using that little tactic when flashing colors or creating funny visual effects when showing my son stuff in XB.


I'm afraid I don't know exactly what you're referring to.
 

He loves Hunt the Wumpus... Im sure he will get a real kick out of Minesweeper. :)


That would be cool.

 

:thumbsup:



#44 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,993 posts
  • Location:Denmark

Posted Wed Aug 12, 2015 3:13 AM

Unfortunately I'm a sorry-no-good-irritating-no-I-don't-have-real-iron-son-of-a- ...

 

Also I'd like to have a certain degree of confirmation that the game is working and playable on real iron before moving along. EA3 version is in post #40 and cartridge binary is in post #23.

 

As said, it's in a state where it's quite playable, with timer and sounds being the only things missing from making the more complete experience.

 

When these things are done, I'll look into saving a few bytes, maybe add a splash-screen and perhaps doing a built-in optional or standalone "Macintosh" version (opposed to the current "Amiga" style).

 

So, please ...

 

;)


Edited by sometimes99er, Wed Aug 12, 2015 5:25 AM.


#45 TheMole OFFLINE  

TheMole

    Dragonstomper

  • 762 posts
  • Location:Belgium

Posted Wed Aug 12, 2015 3:45 AM

*nevermind; obvious question answered in your animated gif.*


Edited by TheMole, Wed Aug 12, 2015 3:46 AM.


#46 Opry99er OFFLINE  

Opry99er

    Quadrunner

  • 8,261 posts
  • Location:Cookeville, TN

Posted Wed Aug 12, 2015 4:05 PM

If going backwards, R1 can be the loop counter, and the VDP register. :thumbsup:


100 CALL CLEAR :: FOR I=1 TO 16 :: CALL SCREEN(I) :: FOR DELAY=1 TO 100 :: NEXT DELAY :: NEXT I

That is what I was referring to. In this case, I is the counter and the screen color.

Not a shot for shot likeness, but similar in principle.

#47 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,993 posts
  • Location:Denmark

Posted Wed Aug 12, 2015 4:11 PM

Oh. Okay.  ;)


Edited by sometimes99er, Thu Aug 13, 2015 1:09 AM.


#48 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,993 posts
  • Location:Denmark

Posted Thu Aug 13, 2015 1:09 AM

I load the VDP registers in a loop:
 

...
col32d    ; register count and data
        byte 8,>00,>e0,>00,>0e,>01,>06,>02,>f4
 
Could maybe make this code a little shorter by loading the registers backwards (from register 7 to 0) rather than forwards. If going backwards, R1 can be the loop counter, and the VDP register. :thumbsup:

 


Yes. I'll be doing the loop thing from now on. Thanks.  :thumbsup:



#49 TheMole OFFLINE  

TheMole

    Dragonstomper

  • 762 posts
  • Location:Belgium

Posted Thu Aug 13, 2015 3:35 AM

Unfortunately I'm a sorry-no-good-irritating-no-I-don't-have-real-iron-son-of-a- ...

 

Also I'd like to have a certain degree of confirmation that the game is working and playable on real iron before moving along. EA3 version is in post #40 and cartridge binary is in post #23.

 

As said, it's in a state where it's quite playable, with timer and sounds being the only things missing from making the more complete experience.

 

When these things are done, I'll look into saving a few bytes, maybe add a splash-screen and perhaps doing a built-in optional or standalone "Macintosh" version (opposed to the current "Amiga" style).

 

So, please ...

 

;)

 

I want to test it, but I'm having trouble creating a disk image that works for me... I'm probably missing something obviously stupid, but somehow I'm not succeeding...

 

Just for clarity, a disk image to put on my cf7+, not for an emulator :)


Edited by TheMole, Thu Aug 13, 2015 3:36 AM.


#50 sometimes99er OFFLINE  

sometimes99er

    River Patroller

  • Topic Starter
  • 3,993 posts
  • Location:Denmark

Posted Thu Aug 13, 2015 5:11 AM

I want to test it, but I'm having trouble creating a disk image that works for me... I'm probably missing something obviously stupid, but somehow I'm not succeeding...
 
Just for clarity, a disk image to put on my cf7+, not for an emulator :)


Thanks. :)

Attached File  mine.dsk   90KB   11 downloads

 

Edit: New disk with help from mizapf. Video below changed accordingly.

minesweeper0.4.ea3.2.gif


Edited by sometimes99er, Thu Aug 13, 2015 10:39 PM.






Also tagged with one or more of these keywords: game, assembler, cartridge

0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users