psx.wiki

Memory Card GUI Module (mcgui)

Provides the save and load screens for the Memory Card in game titles.

Memory Card GUI Module (mcgui)
Librarymcgui.obj
Header Filemcgui.h
SDKPsy-Q

Overview

The Memory Card GUI module (McGUI) is a program that complies with the TRC (Technical Requirements Checklist). It provides the Memory Card load and save functions together with their user interface. A game title that includes McGUI therefore needs less code for its Memory Card screens.1

A program that uses McGUI links with mcgui.obj and includes mcgui.h, which defines the structures, functions and macros of the module. McGUI uses the following libraries, and the program must link them as well:12

Table 1: Libraries required by McGUI
Library Version
Kernel library (libapi) 4.3 or later
Basic graphics library (libgpu) 4.2 or later
ETC library (libetc) 4.2 or later
Memory Card library (libcard) 4.3 or later
Memory Card simple library (libmcrd) 4.4 or later
Sound library (libspu) 4.3 or later
Extended sound library (libsnd) 4.3 or later

This library is part of the run-time library that Sony distributed with the Psy-Q development tools.3

Module Functions

McGUI has two functions. McGuiSave() saves game data and McGuiLoad() loads it. Before either is called, a McGuiEnv structure is set up with the values for the screen. The module checks some of the values, but not all conditions, so an invalid value does not always give an error.1

McGuiSave() runs the save operation of the Memory Card screen. The user selects a slot, the module checks its status, such as no card or an unformatted card, and checks its contents for earlier saves and empty blocks. It then saves the game data and returns to the title. McGuiLoad() runs the load operation in the same way and checks for earlier saved data. Both functions return 1 when the operation completes, 0 when the user cancels on the slot selection screen and -1 for an invalid value in McGuiEnv.1425

McGuiEnv Structure

McGuiEnv is the main structure of the module, and each of its members is a structure of its own:6

Table 2: McGuiEnv members
Member Structure Contents
cards sMcGuiCards Memory Card data
bg sMcGuiBg Background data
controller sMcGuiController Controller data
sound sMcGuiSnd BGM and sound effect data
texture sMcGuiTexture Texture data
cursor sMcGuiCursor Cursor data

sMcGuiCards holds the file name of up to 20 ASCII characters and the Shift-JIS document name of 32 full-size characters. It also holds the number of icon images from 1 to 3 and the TIM address of the icon. The address of the game data and its size in 128-byte units complete it, and the data occupies 1 to 15 blocks.7

sMcGuiBg selects the background. Mode 0 scrolls an internal 64 x 64 tiled texture in one of 8 directions at a speed of 1/60, 1/30 or 1/20 second, and mode 1 shows the still image of the TIM at timadr.8

sMcGuiController holds the two receive buffers of the controllers. For each controller type, the default controller, the mouse, the analog joystick or DUAL SHOCK, and the NeGcon, it holds a flag and the button codes of OK and cancel. The flag is 1 for a supported type and 0 for an unsupported one.9

sMcGuiSnd holds the main volume and the reverb setting together with two groups of sound data. The BGM group gives the SEQ data with its VH and VB data and the SEQ volume. The sound effect group gives the VH and VB data, the volume, the program number and the tone numbers of the confirm, cancel, cursor and error sounds. sMcGuiCursor sets the color of the menu cursor, while its shape (type) is not supported.1011

Controllers

McGUI supports the following controller terminal types, and it does not support guns or Multi Taps except at ports 1-A and 2-A:4

Table 3: Supported controllers
Terminal type Controller name Model number
1 Mouse SCPH-1030
2 16-button analog SLPH-00001 (Namco)
4 16-button SCPH-1080, 1150, 1200
5 Analog joystick SCPH-1110
7 DUAL SHOCK SCPH-1200

Initialization and Termination

McGUI calls SsInit(), SsStart(), ResetGraph() and ResetCallback() itself, and it calls SsEnd(), SsQuit() and StopCallback() when it exits. Before it calls a McGUI function, the application initializes libmcrd with MemCardInit() and runs MemCardStart() and MemCardStop() as needed. It also initializes the controllers with functions that set up receive buffers in the application, such as InitPAD() and PadInitDirect(), and gives the buffer address in McGuiEnv. PadInit() cannot set up such a buffer and is not supported.412

Limitations

The block count of a save is fixed by the first save made with McGUI. Existing data cannot be overwritten by data of more blocks, so a game whose saves grow makes its first save at the largest size.12

The TIM header of the texture data sets where the images and CLUTs load in the frame buffer, and these areas must not be in use by the game. McGUI also uses the 67 lines below the image as a work area, which must not overlap the CLUT. The images load at the start of a texture page, the texture always uses 128 x 128 8-bit CLUT mode, and the positions and sizes of the titles and the mouse cursor are fixed.12

The screen resolution is fixed at 320 x 240. Drawing uses two frame buffers, so the frame buffer area (0, 0) to (319, 479) is destroyed.13

SEQ data always plays at TICK60 and is made for TICK60. Up to 23 voices sound at once, and the 24th is reserved for sound effects, which play with SsUtKeyOnV() at note 60 and fine 0. The contents of the sound buffer are not guaranteed after McGUI ends, so the game transfers its waveform data again as needed.13

Functions

McGUI has the following functions:25

Table 4: McGUI functions
Function Introduced Purpose
McGuiLoad 4.4 Load game data.
McGuiSave 4.4 Save game data.

References


  1. ^ a b c d Sony Computer Entertainment Inc. Run-Time Library Overview. Run-Time Library 4.4. January 1999. Page 20-3.

  2. ^ a b c Sony Computer Entertainment Inc. Run-Time Library Reference. Run-Time Library 4.4. January 1999. Page 19-10.

  3. ^ Sony Computer Entertainment Inc. Programmer Tools CD (DTL-S2002), README.TXT. 11/26/96. Section "CD-ROM Contents - Highlights", directories \PSX and \PSYQ.

  4. ^ a b c Sony Computer Entertainment Inc. Run-Time Library Overview. Run-Time Library 4.4. January 1999. Page 20-4.

  5. ^ a b Sony Computer Entertainment Inc. Run-Time Library Reference. Run-Time Library 4.4. January 1999. Page 19-11.

  6. ^ Sony Computer Entertainment Inc. Run-Time Library Reference. Run-Time Library 4.4. January 1999. Page 19-3.

  7. ^ Sony Computer Entertainment Inc. Run-Time Library Reference. Run-Time Library 4.4. January 1999. Page 19-5.

  8. ^ Sony Computer Entertainment Inc. Run-Time Library Reference. Run-Time Library 4.4. January 1999. Page 19-4.

  9. ^ Sony Computer Entertainment Inc. Run-Time Library Reference. Run-Time Library 4.4. January 1999. Page 19-6.

  10. ^ Sony Computer Entertainment Inc. Run-Time Library Reference. Run-Time Library 4.4. January 1999. Page 19-7.

  11. ^ Sony Computer Entertainment Inc. Run-Time Library Reference. Run-Time Library 4.4. January 1999. Page 19-8.

  12. ^ a b c Sony Computer Entertainment Inc. Run-Time Library Overview. Run-Time Library 4.4. January 1999. Page 20-5.

  13. ^ a b Sony Computer Entertainment Inc. Run-Time Library Overview. Run-Time Library 4.4. January 1999. Page 20-6.

Categories: Psy-Q