Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:52 27 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : PICO PETSCII

     Page 37 of 38    
Author Message
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 509
Posted: 07:09pm 04 Dec 2023
Copy link to clipboard 
Print this post

Hi Tom,
Thanks for that, I had just come across that problem, presumably there is a problem with a controller, because a qwerty keyboard only gives a single key, until it repeats, where as a controller repeats at the rate it is called.
Anyway, your code fix above subdues my Wii controller very well. Thanks. :-)
Regards, Kevin.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4040
Posted: 02:40pm 05 Dec 2023
Copy link to clipboard 
Print this post

Still WIP but here is my latest based upon pet25l:

   pet25l-thwill-1.zip

Differences from pet25l:
- Requires 5.07.08b4

- Several messages titivated.

- Suppressed auto-repeat of user input EXCEPT for movement.
  e.g. to fire multiple times to the right now you would hold down A
       and explicitly press RIGHT multiple-times, not hold RIGHT down.

- Improved UI feedback on map:
  - Beeps when map button is activated.
  - Writes current map mode to message area.
  - Tried to reduce graphical glitch when entering map, there is
    still an issue where the player sprite is briefly shown over
    the map, perhaps someone more familiar with the graphics can fix.

- Initial controller determined by (case-insensitive) setting of
  OPTION PLATFORM:
    "Game*Mite"    => Game*Mite controller
    "PicoGAME VGA" => NES gamepad attached to Port A
    other          => Keyboard only

- This can be overridden irrespective of platform by setting the "controller"
  property in "A:/.spconfig" or "A:/.config", e.g.

    controller = "gamemite"

  or,

    controller = "nes-a"

  or,

    controller = "atari-a"

  Note that enabling "nes-a" or "atari-a" on the Game*Mite will report an
  ERROR because the expected pins are already allocated to the display.

- Game*Mite/NES controls redefined - still a WIP:
  - FIRE A           Acts as START on menu-screen
  - FIRE A + FIRE B  Quit, must be pressed twice within a short period
  - SELECT           Toggles between walk/search/move modes
  - START            Use item
  - UP
  - UP + FIRE A      Fire up
  - UP + FIRE B      Toggles weapons
  - DOWN
  - DOWN + FIRE A    Fire down
  - DOWN + FIRE B    Toggles items
  - LEFT
  - LEFT + FIRE A    Fire left
  - LEFT + FIRE B    Use item
  - RIGHT
  - RIGHT + FIRE A   Fire right
  - RIGHT + FIRE B   Map


TODO:

- Wii Classic gamepad support (referring to Kevin's code).
- SNES gamepad support (not that anyone, including myself has a working one).
- Controller responsiveness on intro menu.
- [Game*Mite only] intro menu return to Game*Mite menu.
- Continue to experiment with Game*Mite/NES button allocation.
- Issue with player frequently moving immediately after moving an object.

May not happen quickly though, I'm not sure how much free time I have for the remainder of the week.

Best wishes,

Tom
Edited 2023-12-06 00:53 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9121
Posted: 03:17pm 05 Dec 2023
Copy link to clipboard 
Print this post

What is the issue with the SNES controller. If I buy this for development use will it not be OK? The contents should just be a 16-bit shift register?
Edited 2023-12-06 01:18 by matherp
 
Mixtel90

Guru

Joined: 05/10/2019
Location: United Kingdom
Posts: 6797
Posted: 03:26pm 05 Dec 2023
Copy link to clipboard 
Print this post

They should be fine, Peter. I have a cheap Chinese one here that doesn't appear to be a SNES controller although it looks like one. The buttons are multiplexed and, I suspect, the "black blob" may be a microcontroller and not a shift register. The "proper" ones should be correct.
Mick

Zilog Inside! nascom.info for Nascom & Gemini
Preliminary MMBasic docs & my PCB designs
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4239
Posted: 03:27pm 05 Dec 2023
Copy link to clipboard 
Print this post

@Tom,

Change
         Select Case map_mode
           Case 0
             FRAMEBUFFER write l:CLS col(5):FRAMEBUFFER write sc$ 'clear layer
             writeplayer(hp,vp,pl_wp)
             WriteComment("Map deactivated")
           Case 1
             WriteComment("Map activated")
             RenderLiveMap()
           Case 2


To
         Select Case map_mode
           Case 0
             writeplayer(hp,vp,pl_wp)
             WriteComment("Map deactivated")
           Case 1
             FRAMEBUFFER write l:CLS col(5):FRAMEBUFFER write sc$ 'clear layer
             WriteComment("Map activated")
             RenderLiveMap()
           Case 2


Regards,

Volhout
PicomiteVGA PETSCII ROBOTS
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4040
Posted: 06:50pm 05 Dec 2023
Copy link to clipboard 
Print this post

Noted, I will take a look when I get an opportunity.

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
MarkF
Regular Member

Joined: 01/08/2023
Location: Australia
Posts: 47
Posted: 04:49am 06 Dec 2023
Copy link to clipboard 
Print this post

Oh. An issue with pet25l.bas version. I'm running RC17.

Looks like line nesPG1=0 has been removed.
That's okay, but...

pet25l.bas no longer works with the NES controller. If I use the keyboard instead the game hangs after the intro, on the [Loading] screen.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4239
Posted: 06:18am 06 Dec 2023
Copy link to clipboard 
Print this post

I guess you need picomite 50800b4 how.
Volhout
PicomiteVGA PETSCII ROBOTS
 
MarkF
Regular Member

Joined: 01/08/2023
Location: Australia
Posts: 47
Posted: 06:32am 06 Dec 2023
Copy link to clipboard 
Print this post

Ok Volhout. I will try then let you know.

 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4040
Posted: 07:43am 06 Dec 2023
Copy link to clipboard 
Print this post

Mark are you using pet25l.bas from the beta thread or pet25l-thwill-1.bas from this thread?

Best wishes,

Tom
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
MarkF
Regular Member

Joined: 01/08/2023
Location: Australia
Posts: 47
Posted: 08:53am 06 Dec 2023
Copy link to clipboard 
Print this post

Hi Tom. I am using "pet25l.bas" with PicoGame VGA and SNES controller.

I will upgrade the firmware to "50800b4" as Volhout suggested and try again.
 
thwill

Guru

Joined: 16/09/2019
Location: United Kingdom
Posts: 4040
Posted: 10:22am 06 Dec 2023
Copy link to clipboard 
Print this post

Hi Mark,

  MarkF said  Hi Tom. I am using "pet25l.bas" with PicoGame VGA and SNES controller.


Out of curiosity an original SNES controller or a modern cheap Chinese clone ?

  MarkF said  I will upgrade the firmware to "50800b4" as Volhout suggested and try again.


Depending on what version you were running I'm not sure that's going to matter, I think we will need more information to diagnose the hang.

  MarkF said  Looks like line nesPG1=0 has been removed ...


Yes, unfortunately the mainline got some of my changes before they were properly cooked.

For the moment I suggest "hacking it" by replacing line 13:
Const CTRL_DRIVER$ = init_controller$()


with:
' Const CTRL_DRIVER$ = "ctrl_none$" ' Uncomment for no controller
' Const CTRL_DRIVER$ = "ctrl_gamemite$" ' Uncomment for Game*Mite
Const CTRL_DRIVER$ = "ctrl_nes_a$" ' Uncomment for NES controller on
                                   ' PicoGAME VGA port A
If Call(CTRL_DRIVER$, 1) <> "" Then Error


and:
Function read_input$()
 read_input$ = read_inkey$()
 If Len(read_input$) Then Exit Function
 read_input$ = Call(CTRL_DRIVER$)
End Function


with:
Function read_input$()
 Static last$
 read_input$ = read_inkey$()
 If Len(read_input$) Then Exit Function
 read_input$ = Call(CTRL_DRIVER$)

 ' Suppress auto-repeat except for movement.
 If last$ = read_input$ Then
   If Not InStr("up,down,left,right", last$) Then
     read_input$ = ""
     Exit Function
   EndIf
 Else
   last$ = read_input$
 EndIf
End Function


@Volhout you might want to pull these changes into the mainline even if you don't adopt the rest of my work yet.

In future should I email you my changes so that this thread can lapse and all activity go into the beta thread ?

Best wishes,

Tom
Edited 2023-12-06 20:26 by thwill
Game*Mite, CMM2 Welcome Tape, Creaky old text adventures
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4239
Posted: 04:01pm 06 Dec 2023
Copy link to clipboard 
Print this post

Tom

I am currently sick, and hope ypu will put these needed changes in mainstream petscii. Just create a pet25m.bas, for all to use with 50800b4 firmware.
In a few days when fever is gone, I'll take over again.

Volhout
Edited 2023-12-07 02:02 by Volhout
PicomiteVGA PETSCII ROBOTS
 
MarkF
Regular Member

Joined: 01/08/2023
Location: Australia
Posts: 47
Posted: 01:20am 07 Dec 2023
Copy link to clipboard 
Print this post

Sorry to hear you are unwell Volhout. Get better soon.
 
MarkF
Regular Member

Joined: 01/08/2023
Location: Australia
Posts: 47
Posted: 01:21am 07 Dec 2023
Copy link to clipboard 
Print this post

ALL NEW POSTS TO NEW BETA THREAD:

https://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=16465
Edited 2023-12-07 11:27 by MarkF
 
Martin H.

Guru

Joined: 04/06/2022
Location: Germany
Posts: 1113
Posted: 05:07pm 07 Dec 2023
Copy link to clipboard 
Print this post

  MarkF said  ALL NEW POSTS TO NEW BETA THREAD:

https://www.thebackshed.com/forum/ViewTopic.php?FID=16&TID=16465

No
Things can be tried out here; in the topic you link, inconsistencies in the program flow are looked for compared to the existing versions.It's about beta testing, which Volhout and I can't do alone
Edited 2023-12-08 03:09 by Martin H.
'no comment
 
Bleep
Guru

Joined: 09/01/2022
Location: United Kingdom
Posts: 509
Posted: 06:33pm 07 Dec 2023
Copy link to clipboard 
Print this post

Hi Harm & Martin,
I've made a small optimisation to writeworld, it only saves about 1.5mS but it all helps. :-)
Sub writeworld_n(xm,ym)
 For xn=-xm To xm
   xsn=xs+xn*24:xpn=xp+xn+1+lva
   For yn=-ym To ym
     'load tile from world map
     spn=Peek(byte(yp+yn)*129+xpn)
     Blit memory tile_index(spn),xsn,ys+yn*24
   Next
 Next
End Sub

Regards, Kevin.
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4239
Posted: 07:39pm 07 Dec 2023
Copy link to clipboard 
Print this post

Hi Kevin,

Adopted in pet25n.bas, see main thread.

Volhout
PicomiteVGA PETSCII ROBOTS
 
Volhout
Guru

Joined: 05/03/2018
Location: Netherlands
Posts: 4239
Posted: 08:00am 08 Dec 2023
Copy link to clipboard 
Print this post

Just a small observation...

When you "crunch" the program in MMEdit (take out all formatting and comments) you gain 10ms in the loop, and the program is only 40kb in size (from 70kb).
Not going there, but nice to know.

Volhout
PicomiteVGA PETSCII ROBOTS
 
matherp
Guru

Joined: 11/12/2012
Location: United Kingdom
Posts: 9121
Posted: 08:27am 08 Dec 2023
Copy link to clipboard 
Print this post

There are a couple of places in the code where you aren't using INC where you could and a couple where CHOICE is faster than IF THEN ELSE. Don't know if they are in code that would make any difference.

One thing that could help is that string variables less than or equal to 9 characters could be specified with a length

e.g.

DIM s$ length 8

This saves 256 bytes of general memory and uses no extra variable memory.

You can safely use length for simple string variables > 9 characters but it has no impact they still take 256 bytes of general memory
 
     Page 37 of 38    
Print this page
© JAQ Software 2024