mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2024-09-07 15:54:26 +00:00
8 lines
47 KiB
Plaintext
8 lines
47 KiB
Plaintext
|
{
|
||
|
"version": 3,
|
||
|
"sources": ["../src/platform/vectrex.ts"],
|
||
|
"sourcesContent": ["\nimport { Platform, BaseZ80Platform, Base6502Platform, Base6809Platform } from \"../common/baseplatform\";\nimport { PLATFORMS, newAddressDecoder, padBytes, noise, setKeyboardFromMap, AnimationTimer, VectorVideo, Keys, makeKeycodeMap } from \"../common/emu\";\nimport { hex, lzgmini, stringToByteArray, safe_extend } from \"../common/util\";\nimport { MasterAudio, AY38910_Audio } from \"../common/audio\";\nimport { ProbeRecorder } from \"../common/recorder\";\nimport { NullProbe, Probeable, ProbeAll } from \"../common/devices\";\n\n// emulator from https://github.com/raz0red/jsvecx\n// https://roadsidethoughts.com/vectrex/vectrex-memory-map.htm\n// http://www.playvectrex.com/designit/chrissalo/memorymap.htm\n// http://vectrexmuseum.com/share/coder/other/TEXT/VECTREX/INTERNAL.TXT\n// http://vide.malban.de/help/vectrex-tutorial-ii-starting-with-bios\n// http://www.playvectrex.com/designit/chrissalo/bios.asm\n// https://www.6809.org.uk/asm6809/doc/asm6809.shtml\n// http://www.playvectrex.com/\n// http://vectrexmuseum.com/vectrexhistory.php\n\nvar VECTREX_PRESETS = [\n { id: 'hello.xasm', name: 'Hello World (ASM)' },\n { id: 'hello.c', name: 'Hello World (CMOC)' },\n { id: 'joystick.c', name: 'Joystick Test (CMOC)' },\n { id: 'threed.c', name: '3D Transformations (CMOC)' },\n]\n\n// TODO: player 2\nvar VECTREX_KEYCODE_MAP = makeKeycodeMap([\n [Keys.LEFT, 0, 0x01],\n [Keys.RIGHT, 0, 0x02],\n [Keys.DOWN, 0, 0x04],\n [Keys.UP, 0, 0x08],\n [Keys.GP_B, 2, 0x01],\n [Keys.GP_A, 2, 0x02],\n [Keys.GP_D, 2, 0x04],\n [Keys.GP_C, 2, 0x08],\n\n [Keys.P2_LEFT, 1, 0x01],\n [Keys.P2_RIGHT, 1, 0x02],\n [Keys.P2_DOWN, 1, 0x04],\n [Keys.P2_UP, 1, 0x08],\n [Keys.P2_GP_B, 2, 0x10],\n [Keys.P2_GP_A, 2, 0x20],\n [Keys.P2_GP_D, 2, 0x40],\n [Keys.P2_GP_C, 2, 0x80],\n]);\n\n//\n\nclass VIA6522 {\n vectrex: VectrexPlatform;\n constructor(vectrex) {\n this.vectrex = vectrex;\n }\n\n //static unsigned via_ora;\n ora = 0;\n //static unsigned via_orb;\n orb = 0;\n //static unsigned via_ddra;\n ddra = 0;\n //static unsigned via_ddrb;\n ddrb = 0;\n //static unsigned via_t1on; /* is timer 1 on? */\n t1on = 0;\n //static unsigned via_t1int; /* are timer 1 interrupts allowed? */\n t1int = 0;\n //static unsigned via_t1c;\n t1c = 0;\n //static unsigned via_t1ll;\n t1ll = 0;\n //static unsigned via_t1lh;\n t1lh = 0;\n //static unsigned via_t1pb7; /* timer 1 controlled version of pb7 */\n t1pb7 = 0;\n //static unsigned via_t2on; /* is timer 2 on? */\n t2on = 0;\n //static unsigned via_t2int; /* are timer 2 interrupts allowed? */\n t2int = 0;\n //static unsigned via_t2c;\n t2c = 0;\n //static unsigned via_t2ll;\n t2ll = 0;\n //static unsigned via_sr;\n sr = 0;\n //static unsigned via_srb; /* number of bits shifted so far */\n srb = 0;\n //static unsigned via_src; /* shift counter */\n src = 0;\n //static unsigned via_srclk;\n srclk = 0;\n //static unsigned via_acr;\n acr = 0;\n //static unsigned via_pcr;\n pcr = 0;\n //static unsigned via_ifr;\n ifr = 0;\n //static unsigned via_ier;\n ier = 0;\n //static unsigned via_ca2;\n ca2 = 0;\n //static unsigned via_cb2h; /* basic handshake version of cb2 */\n cb2h = 0;\n //static unsigned via_cb2s; /* version of cb2 controlled by the shift register */\n cb2s = 0;\n\n reset() {\n // http://archive.6502.org/datasheets/mos_6522_preliminary_nov_1977.pdf\n // \"Reset sets all registers to zero except t1 t2 and sr\"\n this.ora = 0;\n this.orb = 0;\n this.ddra = 0;\n this.ddrb = 0;\n this.t1on = 0;\n this.t1int = 0;\n this.t1c = 0;\n this.t1ll = 0;\n this.t1lh = 0;\n this.t1pb7 = 0x80;\n this.t2on = 0;\n this.t2int = 0;\n this.t2c = 0;\n this.t2ll = 0;\n this.sr = 0;\n this.srb = 8;\n this.src = 0;\n this.srclk = 0;\n this.acr = 0;\n this.pcr = 0;\n this.ifr = 0;\n this.ier = 0;\n this.ca2 = 1;\n this.cb2h = 1;\n this.cb2s = 0;\n };\n\n int_update() {\n if ((this.ifr & 0x7f) & (this.ier & 0x7f)) {\n this.ifr |= 0x80;\n
|
||
|
"mappings": "iPAkBA,GAAI,GAAkB,CACpB,CAAE,GAAI,aAAc,KAAM,qBAC1B,CAAE,GAAI,UAAW,KAAM,sBACvB,CAAE,GAAI,aAAc,KAAM,wBAC1B,CAAE,GAAI,WAAY,KAAM,8BAItB,EAAsB,EAAe,CACvC,CAAC,EAAK,KAAO,EAAG,GAChB,CAAC,EAAK,MAAO,EAAG,GAChB,CAAC,EAAK,KAAO,EAAG,GAChB,CAAC,EAAK,GAAO,EAAG,GAChB,CAAC,EAAK,KAAO,EAAG,GAChB,CAAC,EAAK,KAAO,EAAG,GAChB,CAAC,EAAK,KAAO,EAAG,GAChB,CAAC,EAAK,KAAO,EAAG,GAEhB,CAAC,EAAK,QAAU,EAAG,GACnB,CAAC,EAAK,SAAU,EAAG,GACnB,CAAC,EAAK,QAAU,EAAG,GACnB,CAAC,EAAK,MAAU,EAAG,GACnB,CAAC,EAAK,QAAU,EAAG,IACnB,CAAC,EAAK,QAAU,EAAG,IACnB,CAAC,EAAK,QAAU,EAAG,IACnB,CAAC,EAAK,QAAU,EAAG,OAKrB,OAAc,CAEZ,YAAY,EAAS,CAKrB,SAAM,EAEN,SAAM,EAEN,UAAO,EAEP,UAAO,EAEP,UAAO,EAEP,WAAQ,EAER,SAAM,EAEN,UAAO,EAEP,UAAO,EAEP,WAAQ,EAER,UAAO,EAEP,WAA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