X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=gp2x%2F940ctl.c;h=11890bd528ce85290692d533c77a13204e198ba0;hb=046c454067c66b783417f4a61ab1445d06412d66;hp=d219d8a42b14e5124eb094c3d13370d9c6ad6e4e;hpb=e31266dd116b6bea59ce3f2036feeb6725c45a72;p=libpicofe.git diff --git a/gp2x/940ctl.c b/gp2x/940ctl.c index d219d8a..11890bd 100644 --- a/gp2x/940ctl.c +++ b/gp2x/940ctl.c @@ -11,9 +11,8 @@ #include #include "code940/940shared.h" -#include "gp2x.h" -#include "emu.h" -#include "menu.h" +#include "soc_mmsp2.h" +#include "soc.h" #include "../common/mp3.h" #include "../common/arm_utils.h" #include "../common/menu.h" @@ -22,10 +21,6 @@ #include "../../pico/sound/ym2612.h" #include "../../pico/sound/mix.h" -/* we will need some gp2x internals here */ -extern volatile unsigned short *gp2x_memregs; /* from minimal library rlyeh */ -extern volatile unsigned long *gp2x_memregl; - extern int reset_timing; static unsigned char *shared_mem = 0; static _940_data_t *shared_data = 0; @@ -150,7 +145,7 @@ static void wait_busy_940(int job) gp2x_memregs[0x3b46>>1], gp2x_memregl[0x4500>>2], gp2x_memregl[0x4510>>2]); printf("last lr: %08x, lastjob: %i\n", shared_ctl->last_lr, shared_ctl->lastjob); - strcpy(menuErrorMsg, "940 crashed, too much overclock?"); + me_update_msg("940 crashed, too much overclock?"); engineState = PGS_Menu; crashed_940 = 1; } @@ -247,7 +242,7 @@ static void internal_reset(void) /* this must be called after mmu hack, the allocated regions must not get cached */ -void sharedmem_init(void) +void sharedmem940_init(void) { if (shared_mem != NULL) return; @@ -270,7 +265,7 @@ void sharedmem_init(void) } -void sharedmem_deinit(void) +void sharedmem940_finish(void) { munmap(shared_mem, 0x210000); munmap(mp3_mem, MP3_SIZE_MAX); @@ -287,8 +282,8 @@ void YM2612Init_940(int baseclock, int rate) printf("YM2612Init_940()\n"); printf("Mem usage: shared_data: %i, shared_ctl: %i\n", sizeof(*shared_data), sizeof(*shared_ctl)); - Reset940(1, 2); - Pause940(1); + reset940(1, 2); + pause940(1); gp2x_memregs[0x3B40>>1] = 0; // disable DUALCPU interrupts for 920 gp2x_memregs[0x3B42>>1] = 1; // enable DUALCPU interrupts for 940 @@ -348,8 +343,8 @@ void YM2612Init_940(int baseclock, int rate) gp2x_memregl[0x4510>>2] = 0xffffffff; // clear pending IRQs in INTPND /* start the 940 */ - Reset940(0, 2); - Pause940(0); + reset940(0, 2); + pause940(0); // YM2612ResetChip_940(); // will be done on JOB940_YM2612INIT