-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* init * kindly working on my happy code * its darius day * make icon look nicer * various menu improvements * use key held state not key pressed state * add a freaking sweet drop shadow to highlighted option * add menu behavior for left/right on bools, files * bounds check the cursor only once * add ability to compile roms into the program * combine sd and romfs when browsing roms * bump libpressf version * remove old libdragon trunk code * have multiple menus persist between state change * kill the old keys code * prevent $s in filenames being read as control code * Update README.md * fiddle with settings to make audio sound nicer * add functionality for "return to bios" button
- Loading branch information
Showing
14 changed files
with
713 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
|
||
/build | ||
*.z64 | ||
/filesystem | ||
*.bin | ||
*.chf | ||
*.rom |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
We, the copyright holders of this work, hereby release it into the | ||
public domain. This applies worldwide. | ||
|
||
In case this is not legally possible, | ||
|
||
We grant any entity the right to use this work for any purpose, without | ||
any conditions, unless such conditions are required by law. | ||
|
||
Thatcher Ulrich <[email protected]> http://tulrich.com | ||
Karoly Barta [email protected] | ||
Michael Evans http://www.evertype.com |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Place Channel F ROM files here to compile them into the emulator filesystem. | ||
|
||
ROM files must have .chf, .rom, or .bin extensions. | ||
|
||
The Channel F BIOS can be included here as well. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
#include <libdragon.h> | ||
|
||
#include "libpressf/src/emu.h" | ||
#include "libpressf/src/input.h" | ||
#include "libpressf/src/screen.h" | ||
#include "libpressf/src/hw/beeper.h" | ||
#include "libpressf/src/hw/vram.h" | ||
|
||
#include "main.h" | ||
#include "emu.h" | ||
|
||
static void pfu_video_render_1_1(void) | ||
{ | ||
surface_t *disp = display_get(); | ||
|
||
rdpq_attach_clear(disp, NULL); | ||
rdpq_set_mode_standard(); | ||
rdpq_tex_blit(&emu.video_frame, 14, 66, &(rdpq_blitparms_t){ .scale_x = 6.0f, .scale_y = 6.0f}); | ||
rdpq_detach_show(); | ||
} | ||
|
||
static void pfu_video_render_4_3(void) | ||
{ | ||
surface_t *disp = display_get(); | ||
|
||
rdpq_attach_clear(disp, NULL); | ||
rdpq_set_mode_standard(); | ||
rdpq_tex_blit(&emu.video_frame, 0, 0, &(rdpq_blitparms_t){ .scale_x = 640.0f / SCREEN_WIDTH, .scale_y = 480.0f / SCREEN_HEIGHT}); | ||
rdpq_detach_show(); | ||
} | ||
|
||
static void pfu_emu_input(void) | ||
{ | ||
joypad_buttons_t buttons; | ||
|
||
joypad_poll(); | ||
buttons = joypad_get_buttons(JOYPAD_PORT_1); | ||
|
||
/* Handle hotkeys */ | ||
if (buttons.l) | ||
{ | ||
pfu_menu_switch_roms(); | ||
return; | ||
} | ||
else if (buttons.r) | ||
{ | ||
pfu_menu_switch_settings(); | ||
return; | ||
} | ||
|
||
/* Handle console input */ | ||
set_input_button(0, INPUT_TIME, buttons.a); | ||
set_input_button(0, INPUT_MODE, buttons.b); | ||
set_input_button(0, INPUT_HOLD, buttons.z); | ||
set_input_button(0, INPUT_START, buttons.start); | ||
|
||
/* Handle player 1 input */ | ||
set_input_button(4, INPUT_RIGHT, buttons.d_right); | ||
set_input_button(4, INPUT_LEFT, buttons.d_left); | ||
set_input_button(4, INPUT_BACK, buttons.d_down); | ||
set_input_button(4, INPUT_FORWARD, buttons.d_up); | ||
set_input_button(4, INPUT_ROTATE_CCW, buttons.c_left); | ||
set_input_button(4, INPUT_ROTATE_CW, buttons.c_right); | ||
set_input_button(4, INPUT_PULL, buttons.c_up); | ||
set_input_button(4, INPUT_PUSH, buttons.c_down); | ||
|
||
buttons = joypad_get_buttons(JOYPAD_PORT_2); | ||
|
||
/* Handle player 2 input */ | ||
set_input_button(1, INPUT_RIGHT, buttons.d_right); | ||
set_input_button(1, INPUT_LEFT, buttons.d_left); | ||
set_input_button(1, INPUT_BACK, buttons.d_down); | ||
set_input_button(1, INPUT_FORWARD, buttons.d_up); | ||
set_input_button(1, INPUT_ROTATE_CCW, buttons.c_left); | ||
set_input_button(1, INPUT_ROTATE_CW, buttons.c_right); | ||
set_input_button(1, INPUT_PULL, buttons.c_up); | ||
set_input_button(1, INPUT_PUSH, buttons.c_down); | ||
} | ||
|
||
void pfu_emu_run(void) | ||
{ | ||
/* Input */ | ||
pfu_emu_input(); | ||
|
||
/* Emulation */ | ||
pressf_run(&emu.system); | ||
|
||
/* Video */ | ||
draw_frame_rgb5551(((vram_t*)emu.system.f8devices[3].device)->data, emu.video_buffer); | ||
|
||
/* Audio */ | ||
audio_push(((f8_beeper_t*)emu.system.f8devices[7].device)->samples, PF_SOUND_SAMPLES, true); | ||
|
||
/* Blit the frame */ | ||
if (emu.video_scaling == PFU_SCALING_1_1) | ||
pfu_video_render_1_1(); | ||
else | ||
pfu_video_render_4_3(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef PRESS_F_ULTRA_EMU_H | ||
#define PRESS_F_ULTRA_EMU_H | ||
|
||
void pfu_emu_run(void); | ||
|
||
#endif |
Oops, something went wrong.