Skip to content

Commit

Permalink
Merge pull request #24 from fhoedemakers/NewSchool
Browse files Browse the repository at this point in the history
Changes by NewSchool
  • Loading branch information
fhoedemakers authored Aug 19, 2023
2 parents 1d5074e + 82433a5 commit b26bc26
Show file tree
Hide file tree
Showing 6 changed files with 393 additions and 106 deletions.
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## General Information

> To go back to the games list menu when in a game, you have to press (Y+X) and then (A). This is because of a newly added in-game menu.
Comes with Homebrew game Blade Buster. When no rom is loaded, this game starts.

Support for flashing multiple games. In this case a menu is displayed in the emulator.
Expand All @@ -12,12 +14,21 @@ Extract the zip-file **PicoSystemInfoNesLoader.zip** to a folder of choice, then

![Screenshot](https://github.com/fhoedemakers/PicoSystemInfoNesLoader/blob/master/assets/Screen.png)

Attention! Base address for uploading rom with picotool has changed again. You have to re-upload your rom.

See [Readme](https://github.com/fhoedemakers/PicoSystem_InfoNes/blob/master/README.md) for more info.

## Release History

### 1.2.0 (2023-08-18)

Fixes

- Various minor fixes and code cleanup.

Features

- Y + X toggles an in-game menu. (See [Readme](https://github.com/fhoedemakers/PicoSystem_InfoNes/blob/master/README.md) for more info). Presents options for return to games list, rapid fire and backlight settings.
- Battery indicator shown on low battery.

### 1.0.0 (2023-08-13)

Fixes:
Expand Down
16 changes: 11 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,22 +114,28 @@ picotool load games.tar -t bin -o 0x10110000
- X: is mapped to NES Start

### In-game
- Y + X: Open menu
- Y + X: Opens in-game menu. Browse options with UP/DOWN:
- A Back to games list menu (quit), B Resume game (close).
- Toggle rapid fire A button. Press A to toggle.
- Toggle rapid fire B button. Press A to toggle.
- Change brightness. Press LEFT or RIGHT to change.
- Y + LEFT: Previous game
- Y + RIGHT: Next Game
- Y + UP: Start built-in freeware game [Blade Buster](https://www.rgcd.co.uk/2011/05/blade-buster-nes.html)
- Y + Down: Toggle between speakers. (Built-In - Added via Mod - Both - Mute)
- X + A: Toggle framerate
- X + A: Toggle framerate.
- Y + A: Volume up
- Y + B: Volume down

> Speaker selection and volume level will be saved, but only when you reset to menu ( X + Y ) or toggle between games (Y + Left, Y + Right, Y + Up). Powering-off the device will not save these settings.
> Speaker selection, volume level and brightness setting will be saved, but only when you reset to the games list menu (X + Y, then A) or toggle between games (Y + Left, Y + Right, Y + Up). Powering-off the device will not save these settings.
### In-Menu
- Up/DOWN: Scroll through list
### In-Game list menu
- Up/DOWN: Scroll through game list
- A : Start selected game
- B : Exit menu

## Battery status
The battery status is shown when activating the in-game menu. When battery level drops to 10 percent or below, the indicator is permanently shown.

## Screen Resolution
The original Nintendo Entertainment System has a resolution of 256x240 pixels. The PicoSystem has a resolution of 240x240 pixels. Therefore, on the PicoSystem the first and last 8 Pixels of each horizontal line are not visible.
Expand Down
73 changes: 38 additions & 35 deletions infones/InfoNES.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/*===================================================================*/
/*===================================================================*/
/* */
/* InfoNES.cpp : NES Emulator for Win32, Linux(x86), Linux(PS2) */
/* */
Expand Down Expand Up @@ -616,7 +617,7 @@ void InfoNES_Main()
/*-------------------------------------------------------------------*/
/* To the menu screen */
/*-------------------------------------------------------------------*/
if (InfoNES_Menu() == 0)
if (InfoNES_Menu() == 0 )
{

/*-------------------------------------------------------------------*/
Expand Down Expand Up @@ -650,50 +651,51 @@ void __not_in_flash_func(InfoNES_Cycle)()
for (;;)
{
//util::WorkMeterMark(MARKER_START);
if (!micromenu)
{
// Set a flag if a scanning line is a hit in the sprite #0
if (SpriteJustHit == PPU_Scanline &&
PPU_ScanTable[PPU_Scanline] == SCAN_ON_SCREEN)
{
// # of Steps to execute before sprite #0 hit
int nStep = SPRRAM[SPR_X] * STEP_PER_SCANLINE / NES_DISP_WIDTH;

// Set a flag if a scanning line is a hit in the sprite #0
if (SpriteJustHit == PPU_Scanline &&
PPU_ScanTable[PPU_Scanline] == SCAN_ON_SCREEN)
{
// # of Steps to execute before sprite #0 hit
int nStep = SPRRAM[SPR_X] * STEP_PER_SCANLINE / NES_DISP_WIDTH;

// Execute instructions
K6502_Step(nStep);

// Set a sprite hit flag
if ((PPU_R1 & R1_SHOW_SP) && (PPU_R1 & R1_SHOW_SCR))
PPU_R2 |= R2_HIT_SP;
// Execute instructions
K6502_Step(nStep);

// NMI is required if there is necessity
if ((PPU_R0 & R0_NMI_SP) && (PPU_R1 & R1_SHOW_SP))
NMI_REQ;
// Set a sprite hit flag
if ((PPU_R1 & R1_SHOW_SP) && (PPU_R1 & R1_SHOW_SCR))
PPU_R2 |= R2_HIT_SP;

// Execute instructions
K6502_Step(STEP_PER_SCANLINE - nStep);
}
else
{
// Execute instructions
K6502_Step(STEP_PER_SCANLINE);
}
// NMI is required if there is necessity
if ((PPU_R0 & R0_NMI_SP) && (PPU_R1 & R1_SHOW_SP))
NMI_REQ;

// Frame IRQ in H-Sync
FrameStep += STEP_PER_SCANLINE;
if (FrameStep > STEP_PER_FRAME && FrameIRQ_Enable)
{
FrameStep %= STEP_PER_FRAME;
IRQ_REQ;
APU_Reg[0x15] |= 0x40;
}
// Execute instructions
K6502_Step(STEP_PER_SCANLINE - nStep);
}
else
{
// Execute instructions
K6502_Step(STEP_PER_SCANLINE);
}

//util::WorkMeterMark(MARKER_CPU);
// Frame IRQ in H-Sync
FrameStep += STEP_PER_SCANLINE;
if (FrameStep > STEP_PER_FRAME && FrameIRQ_Enable)
{
FrameStep %= STEP_PER_FRAME;
IRQ_REQ;
APU_Reg[0x15] |= 0x40;
}

//util::WorkMeterMark(MARKER_CPU);
}
// A mapper function in H-Sync
MapperHSync();

// A function in H-Sync
if (InfoNES_HSync() == -1)
if (InfoNES_HSync() == -1) //quit was called
return; // To the menu screen

// HSYNC Wait
Expand Down Expand Up @@ -855,6 +857,7 @@ int __not_in_flash_func(InfoNES_HSync)()
}

// Exit an emulation if a QUIT button is pushed

if (PAD_PUSH(PAD_System, PAD_SYS_QUIT))
return -1; // Exit an emulation

Expand Down
2 changes: 1 addition & 1 deletion infones/InfoNES.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ extern BYTE PPU_Scr_H_Byte;
//extern BYTE PPU_Scr_H_Byte_Next;
extern BYTE PPU_Scr_H_Bit;
//extern BYTE PPU_Scr_H_Bit_Next;

extern bool micromenu;
extern BYTE PPU_Latch_Flag;
extern WORD PPU_Addr;
extern WORD PPU_Temp;
Expand Down
Loading

0 comments on commit b26bc26

Please sign in to comment.