Skip to content

Commit

Permalink
Version 3.5c with more additions to the internal database for various…
Browse files Browse the repository at this point in the history
… prototypes.
  • Loading branch information
wavemotion-dave committed Jan 7, 2024
1 parent 80121e8 commit f79116e
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 140 deletions.
Binary file modified A5200DS.nds
Binary file not shown.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ include $(DEVKITARM)/ds_rules
export TARGET := A5200DS
export TOPDIR := $(CURDIR)

VERSION=3.5b
VERSION=3.5c

ICON := -b $(CURDIR)/logo.bmp "A5200DS $(VERSION);wavemotion-dave;http://https://github.com/wavemotion-dave/A5200DS"

Expand Down
33 changes: 14 additions & 19 deletions arm9/source/a5200utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,27 +176,24 @@ short int screen_slide_y __attribute__((section(".dtcm"))) = 0;

ITCM_CODE void vblankIntr()
{
static const u8 jitter[] =
{
0x00, 0x00,
0x40, 0x00
};

REG_BG2PA = xdxBG;
REG_BG2PD = ydyBG;
REG_BG2X = cxBG;

REG_BG2X = cxBG+jitter[sIndex++];
REG_BG2Y = cyBG+jitter[sIndex++] + (screen_slide_y<<8);
sIndex = sIndex & 3;

if (sIndex == 0)
if (++sIndex & 1)
{
// Slight jitter to help with X-screen scaling...
REG_BG2Y = cyBG+0x40 + (screen_slide_y<<8);
if (dampen_slide_y == 0)
{
if (screen_slide_y < 0) screen_slide_y++;
else if (screen_slide_y > 0) screen_slide_y--;
} else dampen_slide_y--;
}
else
{
REG_BG2Y = cyBG + (screen_slide_y<<8);
}
}

void dsInitScreenMain(void)
Expand Down Expand Up @@ -366,8 +363,6 @@ int load_os(char *filename )

void dsLoadGame(char *filename)
{
unsigned short int index;

// Free buffer if needed
TIMER2_CR=0; irqDisable(IRQ_TIMER2);
if (filebuffer != 0)
Expand All @@ -384,7 +379,7 @@ void dsLoadGame(char *filename)
memset(sound_buffer, 0x00, 16);

// Init palette
for(index = 0; index < 256; index++) {
for(u16 index = 0; index < 256; index++) {
unsigned short r = palette_data[(index * 3) + 0];
unsigned short g = palette_data[(index * 3) + 1];
unsigned short b = palette_data[(index * 3) + 2];
Expand Down Expand Up @@ -424,9 +419,9 @@ unsigned int dsReadPad(void) {
}

bool dsWaitOnQuit(void) {
bool bRet=false, bDone=false;
char bRet=false, bDone=false;
unsigned int keys_pressed;
unsigned int posdeb=0;
char posdeb=0;
static char szName[32];

decompress(bgFileSelTiles, bgGetGfxPtr(bg0b), LZ77Vram);
Expand Down Expand Up @@ -471,7 +466,7 @@ bool dsWaitOnQuit(void) {


void dsDisplayFiles(unsigned int NoDebGame,u32 ucSel) {
unsigned int ucBcl,ucGame;
unsigned short int ucBcl,ucGame;
u8 maxLen;
static char szName[256];

Expand Down Expand Up @@ -509,8 +504,8 @@ void dsDisplayFiles(unsigned int NoDebGame,u32 ucSel) {

unsigned int dsWaitForRom(void)
{
bool bDone=false, bRet=false;
u32 ucHaut=0x00, ucBas=0x00,ucSHaut=0x00, ucSBas=0x00,romSelected= 0, firstRomDisplay=0,nbRomPerPage, uNbRSPage, uLenFic=0,ucFlip=0, ucFlop=0;
char bDone=false, bRet=false;
u16 ucHaut=0x00, ucBas=0x00,ucSHaut=0x00, ucSBas=0x00,romSelected= 0, firstRomDisplay=0,nbRomPerPage, uNbRSPage, uLenFic=0,ucFlip=0, ucFlop=0;
static char szName[64];

decompress(bgFileSelTiles, bgGetGfxPtr(bg0b), LZ77Vram);
Expand Down
80 changes: 3 additions & 77 deletions arm9/source/emu/atari.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,80 +26,18 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_SIGNAL_H
#include <signal.h>
#endif
#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
#else
# ifdef HAVE_SYS_TIME_H
# include <sys/time.h>
# elif defined(HAVE_TIME_H)
# include <time.h>
# endif
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef WIN32
#include <windows.h>
#endif
#ifdef __EMX__
#define INCL_DOS
#include <os2.h>
#endif
#ifdef __BEOS__
#include <OS.h>
#endif
#ifdef HAVE_LIBZ
#include <zlib.h>
#endif

#include "main.h"

#include "antic.h"
#include "atari.h"
#include "cartridge.h"
#include "cpu.h"
#include "gtia.h"

#include "input.h"

#include "memory.h"
#include "pia.h"
#include "platform.h"
#include "pokeysnd.h"
#if !defined(BASIC) && !defined(CURSES_BASIC)
#endif
#ifndef BASIC
#ifndef __PLUS
#endif
#endif /* BASIC */
#if defined(SOUND) && !defined(__PLUS)
#include "pokeysnd.h"
#endif

#ifdef __PLUS
#ifdef _WX_
#include "export.h"
#else /* _WX_ */
#include "globals.h"
#include "macros.h"
#include "display_win.h"
#include "misc_win.h"
#include "registry.h"
#include "timing.h"
#include "FileService.h"
#include "Helpers.h"
#endif /* _WX_ */
#endif /* __PLUS */


int tv_mode = TV_NTSC;
int disable_basic = TRUE;

int verbose = FALSE;

void Atari800_RunEsc(UBYTE esc_code)
{
Expand Down Expand Up @@ -131,9 +69,8 @@ void Coldstart(void) {

/* set Atari OS Coldstart flag */
dPutByte(0x244, 1);
/* handle Option key (disable BASIC in XL/XE)
and Start key (boot from cassette) */
consol_index = 2;

consol_index = 2;
consol_table[2] = 0x0f;

/* hold Option during reboot */
Expand Down Expand Up @@ -195,9 +132,7 @@ int Atari800_Initialise(void) {
}

int Atari800_Exit(int run_monitor) {
int restart;
restart = Atari_Exit(run_monitor);
return restart;
return Atari_Exit(run_monitor);
}

extern int gTotalAtariFrames;
Expand All @@ -210,12 +145,3 @@ void Atari800_Frame(void)

gTotalAtariFrames++;
}


void MainStateSave(void)
{
}

void MainStateRead(void)
{
}
17 changes: 3 additions & 14 deletions arm9/source/emu/atari.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
#include "config.h"


#define MAX_FILENAME_LEN 256


/* Fundamental declarations ---------------------------------------------- */

//#define BUILD_BOSCONIAN 1 // Enable this to produce a build that will run fast bankswitching at the expense of 15% slowdown in memory fetches. Renders games like Bosconian fully playable.
Expand All @@ -19,6 +16,8 @@
#define TRUE 1
#endif

#define MAX_FILENAME_LEN 256

// Some global sound defines
#define SOUND_FREQ (15720) // 60 frames per second. 264 scanlines per frame. 1 samples per scanline. 60*264*1 = 15720
#define SNDLENGTH 4096 // Must be power of 2... so we can quicly mask it
Expand All @@ -41,9 +40,8 @@
#define MACHINE_5200 3

/* Video system. */
#define TV_PAL 312
#define TV_PAL 312
#define TV_NTSC 262
extern int tv_mode;

/* Dimensions of atari_screen.
atari_screen is ATARI_WIDTH * ATARI_HEIGHT bytes.
Expand Down Expand Up @@ -103,12 +101,6 @@ int Atari800_OpenFile(const char *filename, int reboot, int diskno, int readonly
Util_filenamenotset() is TRUE for it. */
void Atari800_FindROMImages(const char *directory, int only_if_not_set);

/* Load Atari800 text configuration file. */
int Atari800_LoadConfig(const char *alternate_config_filename);

/* Writes Atari800 text configuration file. */
int Atari800_WriteConfig(void);

/* Shuts down Atari800 emulation core. */
int Atari800_Exit(int run_monitor);

Expand Down Expand Up @@ -155,7 +147,4 @@ UBYTE Atari800_GetByte(UWORD addr);
/* Stores a byte at the specified special address (not RAM or ROM). */
void Atari800_PutByte(UWORD addr, UBYTE byte);

/* Sleeps until it's time to emulate next Atari frame. */
void atari_sync(void);

#endif /* _ATARI_H_ */
4 changes: 0 additions & 4 deletions arm9/source/emu/atari_nds.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@ u16 trig1 = 1;
u16 stick0 = STICK_CENTRE;
u16 stick1 = STICK_CENTRE;

/* this should be variables if we could move 320x200 window, but we can't :) */
/* static int first_lno = 24;
static int first_col = 32; */
#define first_lno 20 /* center 320x200 window in 384x240 screen */
#define first_col 32

Expand All @@ -40,7 +37,6 @@ static int first_col = 32; */
/* -------------------------------------------------------------------------- */
void Atari_Initialise(void)
{

Pokey_sound_init(FREQ_17_APPROX, DSPRATE, 1, 0); //SND_BIT16);

trig0 = 1; // Not pressed
Expand Down
Loading

0 comments on commit f79116e

Please sign in to comment.